From patchwork Sat Oct 17 15:38:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11842847 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30A7AC43457 for ; Sat, 17 Oct 2020 15:41:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA7BC2074A for ; Sat, 17 Oct 2020 15:41:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RBQdZ3xO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="V+07PWg7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA7BC2074A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=nwZ/RtaQBmYJY0d/43NJJhTkWP3UQ70mlF7I9FwJtYk=; b=RBQdZ3xONWPGMKeKx9iDBnHWXv JEapgZyqdXqDJwAy/Yz9HWhpjw09dcMjNQsKuyNPjrylco2ndL9ngTFJ0vR9vIkclvKFr1KvHV0iU x1cnK0bhkXR+XsPMpOPNtBNUcbb7DkPFMHgXGSMJA3k8KzghMDZOwGwD6gQhQsfuxFGfSEBg8t9ob yfWyGBuGLIjLaCptS725rw++TpIuywlX6jUfstxGGjo6cyvzzK72WRlXASR2E0d8MGxxCfCvbVhKj 6VMIYaOkv8s79sYCQ1QF/gDshIw6OdyIvUv/46JIJyNsbLnjtCrqDHE0gImZqwLx+zXlhcVIf1sHc 5d8oTQkg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kToIV-0003K6-CF; Sat, 17 Oct 2020 15:39:07 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kToIS-0003Ix-1B for linux-arm-kernel@lists.infradead.org; Sat, 17 Oct 2020 15:39:04 +0000 Received: by mail-wr1-x441.google.com with SMTP id x7so6771318wrl.3 for ; Sat, 17 Oct 2020 08:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=S57koDeKUk9PDAYgtgQlZSy1LTrQ6sM1ZV8HODyjnuA=; b=V+07PWg7E3zcry2NI5Zrheb2Mam1kkLOYXJjko6l7ewkCpiSMFtjAMYK4i05qeUe+C n6Qi4SZ15TwwJHmm+V+QBYzoJb2cyQV3v3Q6Po4sW8dz3vLmfzros9JiQlFmIqCYYSyp hO69nJ+8GSt5elCZZMtUH1gqK9/lv0wGWQGDYuVygdPNABZEJQleNy0vpA9F3Jwc0/mS DBqo8fJ2QBn4uU/MqBHjrY36GuA5WJsXaaJC45RgfIdN1Liik3bI0goeN9Zv0PDSoPp8 /PG9Vdyu6GV8OoBJyPtjFIeddef3oQbAYZqzgh89zXuikTma0a7CTiwawBsLPTTOFpjx 39xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=S57koDeKUk9PDAYgtgQlZSy1LTrQ6sM1ZV8HODyjnuA=; b=iuL9XYPx02OeCN7q6laXcnvNNqen4ukFBpaJPeqTe2NoHv/2DEdnC28ourZ1VfmkzK C2oc9Qc3ifc9tfgD1sU1UpoBkc6mGNvlkAuGY0Ofo8GIvnTWLe2GV2q1UNBtiktGMor5 zS2zE6up3DoISjXT+dACQsHD1mUHZB8YY0b3KhB8ITFiiG5xFHKWzfpNFDkKQ5dVBwSK SZeV+2wiLPpOxpx3EIF1HZSLVBF3D05UKWRZfludETtHqSqxY72b4ovibLNTcfoKC9E3 GMqMzfpr7YheNX1i3lVKthlFDuJXI8dUO9tMoiNqQn+W30AaIixrNCIRqwUJm8eCR0EI fWsg== X-Gm-Message-State: AOAM530xj8qDRongGwz3zumAWc+pKg8jNAxF1S+eevqxAKyf2CiDCzdl Cm/HoRH3i7tDbLOjWLD+RoxcPA== X-Google-Smtp-Source: ABdhPJxaLOFBPxlbBFHRog+7C5BOZDHcTEDwnCef2nkMVMHZV6tTMIEHAy9lHwGxGrVbgIdZBSUfjA== X-Received: by 2002:adf:bbca:: with SMTP id z10mr11255586wrg.403.1602949141476; Sat, 17 Oct 2020 08:39:01 -0700 (PDT) Received: from localhost.localdomain (159.171.185.81.rev.sfr.net. [81.185.171.159]) by smtp.gmail.com with ESMTPSA id n66sm7654953wmb.35.2020.10.17.08.38.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 08:39:00 -0700 (PDT) From: Fabien Parent To: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] dt-bindings: timer: mtk-timer: add optional 13m and bus clock Date: Sat, 17 Oct 2020 17:38:56 +0200 Message-Id: <20201017153857.2494845-1-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201017_113904_091556_CF8A3D94 X-CRM114-Status: GOOD ( 11.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matthias.bgg@gmail.com, Fabien Parent , tglx@linutronix.de, robh+dt@kernel.org, daniel.lezcano@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The timer IP on MT8516 requires two clocks to be enabled. Add both clocks. Signed-off-by: Fabien Parent Acked-by: Rob Herring --- .../devicetree/bindings/timer/mediatek,mtk-timer.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt b/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt index 690a9c0966ac..3f9bfd246f19 100644 --- a/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt +++ b/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt @@ -29,6 +29,11 @@ Required properties: - reg: Should contain location and length for timer register. - clocks: Should contain system clock. +Optional properties: +- clock-names: May contain: + * "clk13m": 13MHz clock system clock + * "bus": Bus clock + Examples: timer@10008000 { From patchwork Sat Oct 17 15:38:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11842845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1E14C433DF for ; Sat, 17 Oct 2020 15:41:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5534B2074A for ; Sat, 17 Oct 2020 15:41:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sey6gZYZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="eetgpeWy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5534B2074A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p5RHP37zoHROYzp2SIAwWoNpTa0xf1g0l94lqua0l8Y=; b=sey6gZYZD/usjJPoAzoFJ1V+i 1bp1FerKAGVQMyEwc0DMIRkb0U1aErJkeJEYEOauBBSCqtQmde1pbvKdlU19F6nmt7cS9zweH1VUF CFTNLEpcjdRSXWvcE7RfQUFXI54JNSJEFBVHmcT+14WMUsinOg1e56xYdX5btzOQra2ZAwke0Wd6q tbCZ19P4U4VtA/KUhT43UCR6fqUCQoNcBWSJYOwEnHbDLqWUHr7ob0AK5DBrjOFoDZH1tvufw4Vop v+rcFNwcLVYmv7dpXN1bl3OWRfMtKs1TLunzpvtzQ+DWthkmTZaX3OPb+u9++LHv9mRO4lgpOW7gQ 3XNyGpjvg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kToIa-0003L7-4h; Sat, 17 Oct 2020 15:39:12 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kToIS-0003JA-44 for linux-arm-kernel@lists.infradead.org; Sat, 17 Oct 2020 15:39:09 +0000 Received: by mail-wr1-x442.google.com with SMTP id h5so6739579wrv.7 for ; Sat, 17 Oct 2020 08:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O8b3a8tEsPdmZGsHhmbkp77mMXjgy1OCPeTQ0OgsXhc=; b=eetgpeWy2duISOUDuLyFZjrkyYQTTQ4O/2P+CjAqB5m11MBRtpoRaAYVv15D9JlmyM a1Icr54M4EieBbiqaq0OIvB4Xk0nZC0ipg9IUPpxTKe+6mEY2xYS0zPWVSUYAEsjt6pf 1ArkVnfn0TV4zhdy1QuKC2MHufrU83Gk/bqq+qQUs/eI5ZLQ5uTvP9GGBXuYy9nOahfu 2ILaJWM6Z5l+lFIPMj4xpu46GomC3haPVwC72czZxJ4JvqcKXKYh47f/YHlcCLskXtCr AWbmMf5xk4jQweA7ccmj9VhgdxDJxcK1p/v0wdzZFwNLuCr321dvztWFBxc+5etmC4ti BYcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O8b3a8tEsPdmZGsHhmbkp77mMXjgy1OCPeTQ0OgsXhc=; b=CuNP6Ycw1kEpeTv8jFajZBQ7sCKndSTVVqagR+yLbP0kBgu3TMhE4oQmY3nhDpJyh2 +cE7Yviv40DYrieQPDSmj1XBRkvCymL9iHbALIZ/GLSmp35GEEjy9qOKKs38aTnxYnSW 5iwXpa1j0RCp1UNJCnVaU9bOuSivxVYAhIWs9IVSlvldyZP53NXBVhDerTfvtFRk22uL KzTiVMsxE6oDdIJ9JfJ6o8j7G1nnBn/NHE6tAjHHGPRb5k7pgHhw097vTcKphHek07bh 9kVMg9KSqS5fzACJhumzl7NqOP2QTehUaQiaE3eeEut5zXwbYU6uIGiMvRL1eiYAQOaF KBSA== X-Gm-Message-State: AOAM533V0s5Y7jymq/otAJTaComoA7J5sHniRVFpQ2nqbGlRwLZE9/eL M4cehOhq4cBxuvZiFTa5mLrFZg== X-Google-Smtp-Source: ABdhPJzFnhShrjHXlRQr6YUYUiE55WTFRHSvzdlJc5N5ji8mSvo00iysRozA20esxUivjnKunTuapw== X-Received: by 2002:a05:6000:118c:: with SMTP id g12mr10942738wrx.246.1602949143310; Sat, 17 Oct 2020 08:39:03 -0700 (PDT) Received: from localhost.localdomain (159.171.185.81.rev.sfr.net. [81.185.171.159]) by smtp.gmail.com with ESMTPSA id n66sm7654953wmb.35.2020.10.17.08.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 08:39:02 -0700 (PDT) From: Fabien Parent To: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] clocksource: mediatek: add clk13m and bus clock support Date: Sat, 17 Oct 2020 17:38:57 +0200 Message-Id: <20201017153857.2494845-2-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201017153857.2494845-1-fparent@baylibre.com> References: <20201017153857.2494845-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201017_113904_185968_93871C44 X-CRM114-Status: GOOD ( 12.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matthias.bgg@gmail.com, Fabien Parent , tglx@linutronix.de, robh+dt@kernel.org, daniel.lezcano@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some MediaTek SoC like MT8516 need to enable additional clocks for the GPT timer. Enable them if present. Signed-off-by: Fabien Parent --- drivers/clocksource/timer-mediatek.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/clocksource/timer-mediatek.c b/drivers/clocksource/timer-mediatek.c index 9318edcd8963..42e2d2090484 100644 --- a/drivers/clocksource/timer-mediatek.c +++ b/drivers/clocksource/timer-mediatek.c @@ -9,6 +9,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -278,8 +279,19 @@ static int __init mtk_syst_init(struct device_node *node) static int __init mtk_gpt_init(struct device_node *node) { + struct clk *clk_13m, *clk_bus; int ret; + /* Optional clock*/ + clk_13m = of_clk_get_by_name(node, "clk13m"); + if (!IS_ERR(clk_13m)) + clk_prepare_enable(clk_13m); + + /* Optional clock*/ + clk_bus = of_clk_get_by_name(node, "bus"); + if (!IS_ERR(clk_bus)) + clk_prepare_enable(clk_bus); + to.clkevt.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; to.clkevt.set_state_shutdown = mtk_gpt_clkevt_shutdown; to.clkevt.set_state_periodic = mtk_gpt_clkevt_set_periodic;