From patchwork Wed Jan 26 17:55:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12725572 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AE74C2BA4C for ; Wed, 26 Jan 2022 18:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ysneKJnSmhlhc5iUEKk6+e9TngmFxlRDlmzfBqmURB0=; b=Tfsp4TcOmqR68R 22UerX5pM+LeeocQ5cxWOTA7d8iK/RjytnhZMvnGvmm9cPPbMvqKANgwQH8tcqjZKyAeLIPL/6O/Q rhBLsRiweuZFT3wSaE9389s/tiTv0103Ho8lxsfZ2i3J1w7k9fWi87rO+K2th5Ot/VM9ELea12QLv lGRT9Hk5otueSKBAGGionJDOvAFnEyD7i1LGE4XJoiAyhNm36hU8a5wXGkTtiSn09Bzydpxkkmyfh vYVU4G8SN/S0FbeCZdXGnqyBwXlY1vvhxzaCzU7uT6pDZm5ILsnm0KySfEq+SIb8Ai44ihDdxkKfw xRl1gyuKn/UAquYP2B0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmf0-00DDmF-7W; Wed, 26 Jan 2022 18:04:47 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmWl-00DABr-Ih for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:56:18 +0000 Received: by mail-wr1-x42c.google.com with SMTP id m14so169574wrg.12 for ; Wed, 26 Jan 2022 09:56:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JQsJN7pJU0BMJyEgmIQu4kyCp2vR66DlJR8TnVMAcyQ=; b=TOQ67iGAT+7+07uNizB8BHdh7jMFRMf/l+pHtOhq2S77YS6VBRszqhcfC+kZOKGRat FDU9kMMTLJivAE7oOHzbCf3euJ2eoS9POx7iSbAzJejOKGfziBKQRm6/eN6yJtZ4JjNx vFgbZP4cgzgnYWq/BcN/VYm47yo6rxWa8EBNCagRH9Zeez4Ck3kKyQe/99aLWlPEXK7K +iBbCm9PFe18TWp3b9s5HkZCH8UCGMUa97bJMgBHMHfT5mCYlcVDpNqdlfb670pi5qHd APrtuHWtdxvmhEDMDFPhiZMxqvLc2XOVGjn53ZbCOx5hVQ1scgGYJ5JbuWeyyEKooKcB oUlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JQsJN7pJU0BMJyEgmIQu4kyCp2vR66DlJR8TnVMAcyQ=; b=rrwH+zv4iC8jHwcoIM8MiOfO5rDRYbKGjj7QppBLtgDJ5EYF+jQhQMl5RoO4wmYYgl Ts+PWpgtQgbV3XJMziHcdvvU46R/I0qt19tQno8L2jIymUvhxsmOhS/e8ZRUmtsPva19 l0utJWaz4dgmUnkd5rQMK8ga4pZPiVEVJZgnHUm3r36I5luUisusgzI5aZFDHeivq7dl miUC8LG/lJ2IFaHoby4K6afkmYE370kfxx1D6eYUzlD1uLqeaoDvCBzlYLzgdcKH6geb Zi6fON1K7U9QTXj86eWl+aAeLX61atGVDfIP3MvoRD2RvqI6P4KDkwoidcyn+PEjPkY5 7NlA== X-Gm-Message-State: AOAM5316CaIErwfJItRnXnFz+hIEZZmNsuoQx/84IZR0MeW6CPhY/fKh 4C4TUnPYtJPgAfwy0idgBf4= X-Google-Smtp-Source: ABdhPJx2eb5nlXZaKrsfJpJ+W8WqvxfydVOT6cwaVmM5rRae+FOQ+xqg8ALAfHShxVhcl4JknstmdQ== X-Received: by 2002:a5d:610f:: with SMTP id v15mr23005925wrt.139.1643219773519; Wed, 26 Jan 2022 09:56:13 -0800 (PST) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id m2sm4072416wmq.35.2022.01.26.09.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:56:13 -0800 (PST) From: Romain Perier To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Arnd Bergmann , Daniel Palmer , Romain Perier , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring Subject: [PATCH v4 1/8] dt-bindings: clk: mstar msc313 cpupll binding description Date: Wed, 26 Jan 2022 18:55:57 +0100 Message-Id: <20220126175604.17919-2-romain.perier@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126175604.17919-1-romain.perier@gmail.com> References: <20220126175604.17919-1-romain.perier@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_095615_700163_92CD9E4C X-CRM114-Status: GOOD ( 14.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Daniel Palmer Add a binding description for the MStar/SigmaStar CPU PLL block. Signed-off-by: Daniel Palmer Reviewed-by: Rob Herring --- .../bindings/clock/mstar,msc313-cpupll.yaml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/mstar,msc313-cpupll.yaml diff --git a/Documentation/devicetree/bindings/clock/mstar,msc313-cpupll.yaml b/Documentation/devicetree/bindings/clock/mstar,msc313-cpupll.yaml new file mode 100644 index 000000000000..a9ad7ab5230c --- /dev/null +++ b/Documentation/devicetree/bindings/clock/mstar,msc313-cpupll.yaml @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/mstar,msc313-cpupll.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MStar/Sigmastar MSC313 CPU PLL + +maintainers: + - Daniel Palmer + +description: | + The MStar/SigmaStar MSC313 and later ARMv7 chips have a scalable + PLL that can be used as the clock source for the CPU(s). + +properties: + compatible: + const: mstar,msc313-cpupll + + "#clock-cells": + const: 1 + + clocks: + maxItems: 1 + + reg: + maxItems: 1 + +required: + - compatible + - "#clock-cells" + - clocks + - reg + +additionalProperties: false + +examples: + - | + #include + cpupll: cpupll@206400 { + compatible = "mstar,msc313-cpupll"; + reg = <0x206400 0x200>; + #clock-cells = <1>; + clocks = <&mpll MSTAR_MSC313_MPLL_DIV2>; + }; From patchwork Wed Jan 26 17:55:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12725574 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46C0BC63682 for ; Wed, 26 Jan 2022 18:07:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AJ+lrbeD8DjsO0Ik/RSQ+upB46pJeZhH2W0/a7Y8Qko=; b=QrEIywAj+NWkNb KktXFy/SJQhqO4P8vIvfu/dNpsGcx3cCuFOPgof8TE5mjmhi+N+53aocgfm7trT5lTw0DSi2xv17H BCv5p0rJVTMyb/ZiKVST+OtPzmW9TQabt+AiDh2tmJGW7EeucaOQMiBdbLwat6s2mBOFgOte6Sxkv BXRk4xH2v5FparCDoQHUazwtWYb+OMLXZMzdT1gpkxJ7+8ze85GHfyfSS0tn8X+9YIhUTxZDB+2IT XzoPTYKIdUKBkuiwxOSEVVNx9HEDjJ6Y1/53Anp1mR21dbzjTOyLkz2zsJEXdfW+PpBYveun8KEkf 8kbo72fdSeaPsLQkXZOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmgR-00DEOt-Dj; Wed, 26 Jan 2022 18:06:16 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmWm-00DACi-Fc for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:56:19 +0000 Received: by mail-wr1-x42f.google.com with SMTP id a13so377615wrh.9 for ; Wed, 26 Jan 2022 09:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d4sAbydBa6W6M0KWJr4NJNHgDhBapvpROJ25McC5A7M=; b=dH/+yarGXVmefcsJtqzHVmaS/ryRaddb9xJ/T4F1cQUBQvEyrzGPJddIlrSSDHSN2v fNdZWFsiAduXOjwJ7FHH4iPsfuQlWz5GFzbudCKnTsr3Mvo/CQG1tMJykWvyvf3I0JOq 6ZIiVvyYSe82KMdqPBvd2Shk4AKTioN11GsJuKUGEuOqiWbYpe5AaYSFT+f7ujy+yfh+ eEN6v8P5KNwMISz2qTRkNeVYZIIf9zjGlHPXOcpxJnENMLCeBFQjPXc9+xQxe+8jDFPu OuHqcEPhLIPr1nN4MucfRSKN2b9RWzv6TusGfOR4Fh2fNOiX1KqJ5Y0YS4jNtG/EX+iW hVlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d4sAbydBa6W6M0KWJr4NJNHgDhBapvpROJ25McC5A7M=; b=W80fliOsUUmB2ZQOJ6WGh3zOIbo7wdZgjtRM1moFLfo3wKWd4syILhvH8WPn9M/HFJ fhqCdCNieHQlx56fMKcsB8FMM5sZSEPIz2s+O7mxDnkYZ2LqIUDfx1fNBXCw1JTOpML6 TlHuqd8kAHHgKIsnX4H3nDL+Q9p0u9A/s3AF8nSiorxtmvrIrBcTjfCOx/TLHSikOV/O 5WuRSVNqpq7WTmiaZLUZO/t99/dpWJAnCesTsixXRAey1BX3EFWOdJwNXMkudpubKAzu wCqKneHiTVGbgQjC/V9mE6SLyJoxBSAvtNl9eRZT9JBf9x27nImIEKRfqXZUijYIDww6 kdHg== X-Gm-Message-State: AOAM531ZtfQ/v+er2RIZuXp69wKG2queVDI0gg2ZXRnqzABFlSEpkVPf CMTtPRzYhTeTUP/mzCiy/Z8= X-Google-Smtp-Source: ABdhPJzOAYH33Jt1htT3h7kdAWr7wla5FeFPqijenUfwKt46aQWHuV8TZjDIV8UFvOwFZZ5DnJFYyg== X-Received: by 2002:adf:c3c7:: with SMTP id d7mr24374423wrg.253.1643219774766; Wed, 26 Jan 2022 09:56:14 -0800 (PST) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id 16sm3708753wmj.12.2022.01.26.09.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:56:14 -0800 (PST) From: Romain Perier To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Arnd Bergmann , Daniel Palmer , Romain Perier , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH v4 2/8] clk: mstar: msc313 cpupll clk driver Date: Wed, 26 Jan 2022 18:55:58 +0100 Message-Id: <20220126175604.17919-3-romain.perier@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126175604.17919-1-romain.perier@gmail.com> References: <20220126175604.17919-1-romain.perier@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_095616_617070_598E6F38 X-CRM114-Status: GOOD ( 33.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Daniel Palmer Add a driver for the CPU pll/ARM pll/MIPS pll that is present in MStar SoCs. Currently there is no documentation for this block so it's possible this driver isn't entirely correct. Only tested on the version of this IP in the MStar/SigmaStar ARMv7 SoCs. Co-authored-by: Willy Tarreau Signed-off-by: Daniel Palmer --- drivers/clk/mstar/Kconfig | 8 + drivers/clk/mstar/Makefile | 2 +- drivers/clk/mstar/clk-msc313-cpupll.c | 221 ++++++++++++++++++++++++++ 3 files changed, 230 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/mstar/clk-msc313-cpupll.c diff --git a/drivers/clk/mstar/Kconfig b/drivers/clk/mstar/Kconfig index de37e1bce2d2..146eeb637318 100644 --- a/drivers/clk/mstar/Kconfig +++ b/drivers/clk/mstar/Kconfig @@ -1,4 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-only +config MSTAR_MSC313_CPUPLL + bool "MStar CPUPLL driver" + depends on ARCH_MSTARV7 || COMPILE_TEST + default ARCH_MSTARV7 + help + Support for the CPU PLL present on MStar/Sigmastar SoCs. + config MSTAR_MSC313_MPLL bool "MStar MPLL driver" depends on ARCH_MSTARV7 || COMPILE_TEST @@ -7,3 +14,4 @@ config MSTAR_MSC313_MPLL help Support for the MPLL PLL and dividers block present on MStar/Sigmastar SoCs. + diff --git a/drivers/clk/mstar/Makefile b/drivers/clk/mstar/Makefile index f8dcd25ede1d..21296a04e65a 100644 --- a/drivers/clk/mstar/Makefile +++ b/drivers/clk/mstar/Makefile @@ -2,5 +2,5 @@ # # Makefile for mstar specific clk # - +obj-$(CONFIG_MSTAR_MSC313_CPUPLL) += clk-msc313-cpupll.o obj-$(CONFIG_MSTAR_MSC313_MPLL) += clk-msc313-mpll.o diff --git a/drivers/clk/mstar/clk-msc313-cpupll.c b/drivers/clk/mstar/clk-msc313-cpupll.c new file mode 100644 index 000000000000..c57b509e8c20 --- /dev/null +++ b/drivers/clk/mstar/clk-msc313-cpupll.c @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 Daniel Palmer + */ + +#include +#include +#include + +/* + * This IP is not documented outside of the messy vendor driver. + * Below is what we think the registers look like based on looking at + * the vendor code and poking at the hardware: + * + * 0x140 -- LPF low. Seems to store one half of the clock transition + * 0x144 / + * 0x148 -- LPF high. Seems to store one half of the clock transition + * 0x14c / + * 0x150 -- vendor code says "toggle lpf enable" + * 0x154 -- mu? + * 0x15c -- lpf_update_count? + * 0x160 -- vendor code says "switch to LPF". Clock source config? Register bank? + * 0x164 -- vendor code says "from low to high" which seems to mean transition from LPF low to + * LPF high. + * 0x174 -- Seems to be the PLL lock status bit + * 0x180 -- Seems to be the current frequency, this might need to be populated by software? + * 0x184 / The vendor driver uses these to set the initial value of LPF low + * + * Frequency seems to be calculated like this: + * (parent clock (432mhz) / register_magic_value) * 16 * 524288 + * Only the lower 24 bits of the resulting value will be used. In addition, the + * PLL doesn't seem to be able to lock on frequencies lower than 220 MHz, as + * divisor 0xfb586f (220 MHz) works but 0xfb7fff locks up. + * + * Vendor values: + * frequency - register value + * + * 400000000 - 0x0067AE14 + * 600000000 - 0x00451EB8, + * 800000000 - 0x0033D70A, + * 1000000000 - 0x002978d4, + */ + +#define REG_LPF_LOW_L 0x140 +#define REG_LPF_LOW_H 0x144 +#define REG_LPF_HIGH_BOTTOM 0x148 +#define REG_LPF_HIGH_TOP 0x14c +#define REG_LPF_TOGGLE 0x150 +#define REG_LPF_MYSTERYTWO 0x154 +#define REG_LPF_UPDATE_COUNT 0x15c +#define REG_LPF_MYSTERYONE 0x160 +#define REG_LPF_TRANSITIONCTRL 0x164 +#define REG_LPF_LOCK 0x174 +#define REG_CURRENT 0x180 + +#define LPF_LOCK_TIMEOUT 100000000 + +#define MULTIPLIER_1 16 +#define MULTIPLIER_2 524288 +#define MULTIPLIER (MULTIPLIER_1 * MULTIPLIER_2) + +struct msc313_cpupll { + void __iomem *base; + struct clk_hw clk_hw; +}; + +#define to_cpupll(_hw) container_of(_hw, struct msc313_cpupll, clk_hw) + +static u32 msc313_cpupll_reg_read32(struct msc313_cpupll *cpupll, unsigned int reg) +{ + u32 value; + + value = ioread16(cpupll->base + reg + 4) << 16; + value |= ioread16(cpupll->base + reg); + + return value; +} + +static void msc313_cpupll_reg_write32(struct msc313_cpupll *cpupll, unsigned int reg, u32 value) +{ + u16 l = value & 0xffff, h = (value >> 16) & 0xffff; + + iowrite16(l, cpupll->base + reg); + iowrite16(h, cpupll->base + reg + 4); +} + +static void msc313_cpupll_setfreq(struct msc313_cpupll *cpupll, u32 regvalue) +{ + ktime_t timeout; + + msc313_cpupll_reg_write32(cpupll, REG_LPF_HIGH_BOTTOM, regvalue); + + iowrite16(0x1, cpupll->base + REG_LPF_MYSTERYONE); + iowrite16(0x6, cpupll->base + REG_LPF_MYSTERYTWO); + iowrite16(0x8, cpupll->base + REG_LPF_UPDATE_COUNT); + iowrite16(BIT(12), cpupll->base + REG_LPF_TRANSITIONCTRL); + + iowrite16(0, cpupll->base + REG_LPF_TOGGLE); + iowrite16(1, cpupll->base + REG_LPF_TOGGLE); + + timeout = ktime_add_ns(ktime_get(), LPF_LOCK_TIMEOUT); + while (!(ioread16(cpupll->base + REG_LPF_LOCK))) { + if (ktime_after(ktime_get(), timeout)) { + pr_err("timeout waiting for LPF_LOCK\n"); + return; + } + cpu_relax(); + } + + iowrite16(0, cpupll->base + REG_LPF_TOGGLE); + + msc313_cpupll_reg_write32(cpupll, REG_LPF_LOW_L, regvalue); +} + +static unsigned long msc313_cpupll_frequencyforreg(u32 reg, unsigned long parent_rate) +{ + unsigned long long prescaled = ((unsigned long long)parent_rate) * MULTIPLIER; + + if (prescaled == 0 || reg == 0) + return 0; + return DIV_ROUND_DOWN_ULL(prescaled, reg); +} + +static u32 msc313_cpupll_regforfrequecy(unsigned long rate, unsigned long parent_rate) +{ + unsigned long long prescaled = ((unsigned long long)parent_rate) * MULTIPLIER; + + if (prescaled == 0 || rate == 0) + return 0; + return DIV_ROUND_UP_ULL(prescaled, rate); +} + +static unsigned long msc313_cpupll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) +{ + struct msc313_cpupll *cpupll = to_cpupll(hw); + + return msc313_cpupll_frequencyforreg(msc313_cpupll_reg_read32(cpupll, REG_LPF_LOW_L), + parent_rate); +} + +static long msc313_cpupll_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *parent_rate) +{ + u32 reg = msc313_cpupll_regforfrequecy(rate, *parent_rate); + long rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate); + + /* + * This is my poor attempt at making sure the resulting + * rate doesn't overshoot the requested rate. + */ + for (; rounded >= rate && reg > 0; reg--) + rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate); + + return rounded; +} + +static int msc313_cpupll_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) +{ + struct msc313_cpupll *cpupll = to_cpupll(hw); + u32 reg = msc313_cpupll_regforfrequecy(rate, parent_rate); + + msc313_cpupll_setfreq(cpupll, reg); + + return 0; +} + +static const struct clk_ops msc313_cpupll_ops = { + .recalc_rate = msc313_cpupll_recalc_rate, + .round_rate = msc313_cpupll_round_rate, + .set_rate = msc313_cpupll_set_rate, +}; + +static const struct of_device_id msc313_cpupll_of_match[] = { + { .compatible = "mstar,msc313-cpupll" }, + {} +}; + +static const struct clk_parent_data cpupll_parent = { + .index = 0, +}; + +static int msc313_cpupll_probe(struct platform_device *pdev) +{ + struct clk_init_data clk_init = {}; + struct device *dev = &pdev->dev; + struct msc313_cpupll *cpupll; + int ret; + + cpupll = devm_kzalloc(&pdev->dev, sizeof(*cpupll), GFP_KERNEL); + if (!cpupll) + return -ENOMEM; + + cpupll->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(cpupll->base)) + return PTR_ERR(cpupll->base); + + /* LPF might not contain the current frequency so fix that up */ + msc313_cpupll_reg_write32(cpupll, REG_LPF_LOW_L, + msc313_cpupll_reg_read32(cpupll, REG_CURRENT)); + + clk_init.name = dev_name(dev); + clk_init.ops = &msc313_cpupll_ops; + clk_init.parent_data = &cpupll_parent; + clk_init.num_parents = 1; + cpupll->clk_hw.init = &clk_init; + + ret = devm_clk_hw_register(dev, &cpupll->clk_hw); + if (ret) + return ret; + + return of_clk_add_hw_provider(pdev->dev.of_node, of_clk_hw_simple_get, &cpupll->clk_hw); +} + +static struct platform_driver msc313_cpupll_driver = { + .driver = { + .name = "mstar-msc313-cpupll", + .of_match_table = msc313_cpupll_of_match, + }, + .probe = msc313_cpupll_probe, +}; +builtin_platform_driver(msc313_cpupll_driver); From patchwork Wed Jan 26 17:55:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12725571 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E16C7C2BA4C for ; Wed, 26 Jan 2022 18:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vcOfBokBF3ia8l9emUbP2BHhHMX3qyFm5fNzw1o83uw=; b=TPkEe/DB4yIo1r fxJ84CpjEGsvPlPKAjpf2O9qW6MiJwU9t9peZeTYt1W5p/oornWJRNx3UZnHWnuoQvv3kOG7WZcf7 ahNWqSvnNlwmyg0brgah0MpqR439uSx8O456qBshdjju5yjpRKBJEI4EIRgViEip+p/qGHrxLeaPT u/wBwSijNE+VtMdzd09Z599ZHTm7Jm8ieamIAQa29/z60hiPRxMP+AwQSY1rq4BBmtaFWqIY1vJci y+hl9KzLpKgB4mxe4OqTrB5IYLTS+U8ceb8Zd4AykztpJ3D6SX9rsErGhQWslDFL0VWhyo7rTvcAN IwmvtwLu0OrEOYJo+GWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmeH-00DDUc-B6; Wed, 26 Jan 2022 18:04:02 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmWo-00DADA-1r for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:56:19 +0000 Received: by mail-wm1-x32d.google.com with SMTP id c192so186870wma.4 for ; Wed, 26 Jan 2022 09:56:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gFG+KbiJy3wAWlhs/uVFVtW9rYrvfOZjzcLWJqCo1fo=; b=LYyV1sqt3V+CilRqHORvu19Q5iFoifflsAI9EMT7RgETKa7Z2l8g4937mrgt+k82J+ iuHJfVJ5PWsUllglXHXUN0jeG3K5UUVqhgv8QwAFv/BqhG/Y00uaO6cCIWRzNQQnOpLE YwaG2WvSfGL9U6sUki1LSapJvKefEGNnxnE5hBLhQKM+SkVnbnIdF4m7xRz1ENtdTclA ZzLS0cQHqcFChNmw0C7TbO8C/oXQmZb6UZnLRhJhcpzODvIlDKS5aexCinO+6eNmJ036 pe8m9lKtEUDSUWTP6VRllRw20ucUbIMSjaocu5KrFd5RMSH7SinvIfIY+iO3UnC9lQTY Z8BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gFG+KbiJy3wAWlhs/uVFVtW9rYrvfOZjzcLWJqCo1fo=; b=0hqG9fzrlctmETRFvPD4lTYCrc/022sIh7CZEccMG0gCoVeIqLuijHdtFtUOORnZe3 k4/5AMjDlFx8D/KnhgGCA7SKUPZsIwzXxmxo98OOBOcE0QRdaKRjS4PSjhdYM0glSXmQ wHSnUebEQaatwmDy+xEZ9l03rDCEdf1MMd/g/Ho9gd2e2v3rsUfTkKm4fhpIMfKQx45f jBRjXmJIXoZHKnA2i12V1vQrECxJUmGXjVD0F88BOcz/2RspzsejnZCrRy2HxuoOGRss Aez+9RwNWH/z9kBjZkR1So4TE+Gi9KeT+tBnvjpKCNpaB1M2WdQQKvWZeeWDJst7cybg yj9g== X-Gm-Message-State: AOAM5307PEQg9LHKBM0NpHPOXqLnHIaAiQlMzrloK20BMY3/dgiJ8M2y VKR09YryykkGlUgVyyQWKmc= X-Google-Smtp-Source: ABdhPJxHqVfmfSGZaYeB37u13ndBi5Z+7BR+fQsrn2XVjPF2K2i0Y0ubrbnTFZVE8oDxx0SY6LVa1Q== X-Received: by 2002:a1c:27c7:: with SMTP id n190mr8431580wmn.99.1643219775988; Wed, 26 Jan 2022 09:56:15 -0800 (PST) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id 6sm21098983wry.69.2022.01.26.09.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:56:15 -0800 (PST) From: Romain Perier To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Arnd Bergmann , Daniel Palmer , Romain Perier , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/8] ARM: mstar: Add cpupll to base dtsi Date: Wed, 26 Jan 2022 18:55:59 +0100 Message-Id: <20220126175604.17919-4-romain.perier@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126175604.17919-1-romain.perier@gmail.com> References: <20220126175604.17919-1-romain.perier@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_095618_143955_2CE87EEB X-CRM114-Status: GOOD ( 11.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Daniel Palmer All MStar/SigmaStar ARMv7 SoCs have the CPU PLL at the same place so add it to the base dtsi. Signed-off-by: Daniel Palmer Reviewed-by: Romain Perier --- arch/arm/boot/dts/mstar-v7.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/mstar-v7.dtsi b/arch/arm/boot/dts/mstar-v7.dtsi index 89ebfe4f29da..2249faaa3aa7 100644 --- a/arch/arm/boot/dts/mstar-v7.dtsi +++ b/arch/arm/boot/dts/mstar-v7.dtsi @@ -155,6 +155,13 @@ mpll: mpll@206000 { clocks = <&xtal>; }; + cpupll: cpupll@206400 { + compatible = "mstar,msc313-cpupll"; + reg = <0x206400 0x200>; + #clock-cells = <0>; + clocks = <&mpll MSTAR_MSC313_MPLL_DIV2>; + }; + gpio: gpio@207800 { #gpio-cells = <2>; reg = <0x207800 0x200>; From patchwork Wed Jan 26 17:56:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12725573 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF944C28CF5 for ; Wed, 26 Jan 2022 18:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=E5kDUAr3JPlY34D3OR1BTYqdEy196jdX2qTrrB37QPI=; b=oQPytWeypFlvlO Cxv7DVpecYnJvPA6Sad92fKzu6rO/swEQyESzSEs5aiFS6xpeWUXavWqjYfDjeshEGhb8PGUQ7r7I HlTRdhxQ+9Zw83zQjJEqbx3u2d18HN24qEk/ZCSUyNkTs3UiPiYZFvk9yVQ0skjw6RP22arRQQFQX FRD0kFo6GWF3Uf4c98Ocm6nKOxMCD0LWq2+RpA/HCgyWwl2f0Waxrupw1Z8czhLoT1Hzk4dE+6RQ/ oWe0CAwbztN8D683GGNz8jeLPKQi2KhH3awL7hfmOVXbS26S3Lo+6C4ezlg6x0KAXfTyIkUubub9i tZPKRhjc9J3FvM9WFh+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmfe-00DE5V-RB; Wed, 26 Jan 2022 18:05:27 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmWo-00DADj-UF for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:56:20 +0000 Received: by mail-wr1-x434.google.com with SMTP id l25so337419wrb.13 for ; Wed, 26 Jan 2022 09:56:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rDNoKV0qv6YEK56MEl2TbFC2RsE/2jQa2ifEdZIoeX0=; b=OqGltRvbjpCNbLcabWMdamxxF4OG4xNm/NOuGRc4l7L7cJ4ZF/20KF43TO2EZGCRap RUbL50jsdvJzLubUTpxcjr7fsjh4sey/1ow5NR6+a+M0LtChHzU3DMOUnC9IQKjoMqQ4 ITznzqwB8tRvcJANRiBOVBza3fBThjqy/eaw37Ji582lyGlYfZnRwjbMo+kifsbqdYp8 3sHD8y5cRzY0RlP4NWAk05iQ6sJZdJeeT/oORHWM+y+QN4OnfRAf1uUNYLADIwic5rzs l+Zvtu0DpULVx5v2qVaK3detxxPtSGS+bifTXhtxl6Oid1BOL/xuu2BaJwJynJ+dwCjm ZroQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rDNoKV0qv6YEK56MEl2TbFC2RsE/2jQa2ifEdZIoeX0=; b=UKbwqVJaCELfNn6qczcV4eL5tVdBHGSzDMuicCNuW5e5qcTEpBl8j+qjzIy7fBbEdD CYMY3EbJiTuRhyyNRsk5Vj1juC3XUeCtyeBR/qkSVCssVhW6zZq1glU5HDCvEFtuBYnD lzcG96Sz4M/6GEB2OF1KoQV3MJuO0RRQdiH5YxDw1ygVdJf28uCcZvLA8YIn0fh0Oj9a dyxBBRecIPyqphC31I4VSIg/JihbMHLfpW91Hz+467qX6sRHe8EpCSsJLOMzEuBDAUS+ zwIOFzDS5bxmky0sOMQv0/G2t3sw6uAVGtaiz4s+/Iv8jV1tnMH6rXG+mbFVhRe/t2/P X02Q== X-Gm-Message-State: AOAM531LPa7y0OeosaTeNUlCzrQH6Vx+1bamYkQg03Oo0qHRn5JL3QBF eoc3MITQ9oUBeWxZQkDowHY= X-Google-Smtp-Source: ABdhPJzoRB+ISl3F2EneRHRBb/x6urgHFoQbFid3vN+X+fH/Xm/+JtJ5GvksG57uVSkwv06e9i00Zg== X-Received: by 2002:a5d:6a08:: with SMTP id m8mr23742984wru.355.1643219777015; Wed, 26 Jan 2022 09:56:17 -0800 (PST) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id s17sm20207613wrm.62.2022.01.26.09.56.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:56:16 -0800 (PST) From: Romain Perier To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Arnd Bergmann , Daniel Palmer , Romain Perier , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/8] ARM: mstar: Link cpupll to cpu Date: Wed, 26 Jan 2022 18:56:00 +0100 Message-Id: <20220126175604.17919-5-romain.perier@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126175604.17919-1-romain.perier@gmail.com> References: <20220126175604.17919-1-romain.perier@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_095619_029016_0D5C7E8B X-CRM114-Status: GOOD ( 11.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Daniel Palmer The CPU clock is sourced from the CPU PLL. Link cpupll to the cpu so that frequency scaling can happen. Signed-off-by: Daniel Palmer Reviewed-by: Romain Perier --- arch/arm/boot/dts/mstar-v7.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/mstar-v7.dtsi b/arch/arm/boot/dts/mstar-v7.dtsi index 2249faaa3aa7..c26ba9b7b6dd 100644 --- a/arch/arm/boot/dts/mstar-v7.dtsi +++ b/arch/arm/boot/dts/mstar-v7.dtsi @@ -21,6 +21,8 @@ cpu0: cpu@0 { device_type = "cpu"; compatible = "arm,cortex-a7"; reg = <0x0>; + clocks = <&cpupll>; + clock-names = "cpuclk"; }; }; From patchwork Wed Jan 26 17:56:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12725577 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD390C28CF5 for ; Wed, 26 Jan 2022 18:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kEY7P8O+h5wy6jYlJ1HSZURzmYFqFmQWPU+u0snA+oc=; b=1Et8kOjVlii7+c PwsXYmRJWGa9VkNjzzxpkdkyLqApPxWmrFGdURN/sq1/DGJbcQblzpfDA3RQVLrgTvZaozpjS5e6W E98DepaCbi7bmvoHw/dUnNt/4DgIqrztsbcL2/rnm9v9aIDz4iHXA+jNkYwjrpRkX6LtjTWQqcSlo wDhsp8Uw1PiWci80/gFqtGU6XAJfBHu7tyG+GVTkFqiF7gQ2K6wGFfpjMBMCYrbXZ2j8QoPK9yJWx XIMtxJKqQO1gKjbLoe2gh1MZcE3pU+G+FNv4H0LFpYeg9YASGgveenyVyS6EFYzPocArIRTC74RIx iPfUzdj6urfvr758dh3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmhG-00DEjC-4k; Wed, 26 Jan 2022 18:07:07 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmWq-00DAE7-5e for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:56:21 +0000 Received: by mail-wr1-x435.google.com with SMTP id h21so384064wrb.8 for ; Wed, 26 Jan 2022 09:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I0fcplD3VFrkCpKgQiNkIlnOuTzfq8ZQ6areILp5ZR4=; b=U9Z/ql/ZK5IhK6P6O4TP//zSS7SALYSv28NVpH43H2c8VeWbavUv6Yczw/oDx7jch8 m+jzH6RY74MMRnWB39XeOeKKP//Ta7fXipFxNH3dToe5KpJCsb21jTrhJINlgdTVV3Yo NXVcNR4GjqEGNoj5p5SlHth02vxqMYXVAwYDevkNIvKQWg9sXt+LsmTimoJhGuKicBcU 7kVJz8+8Te1RWjqJw6mURwfIWOFNTCCj0xR6uakv8JvW/7LH6f1IEKprfI92TlkBB0mE uMhItvJJ6vrTIOkDSJwgqzjf4i6AgbjcIyKNRgdqRFo46N/M8qb0CDS+KI75xB4KmriQ YMZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I0fcplD3VFrkCpKgQiNkIlnOuTzfq8ZQ6areILp5ZR4=; b=WJIv0dyrmY7leG4MVCrK0dgbOsM4Ri5UgtsTGJPV0rVv+em7W02wfnymBAoymJO0Xh pJXuvfqrrakyp1O2yU2OScLjSxcUd2ELM2zu2buK0Z8AM8oHzcVEBySpVJ9FJ3NIEkvj qgUXC3EsaxPCUY2fvHeJS0kwKBIyqIV9GH0MqZOMj1M5sCdxIYLnndHXyEzXPTL34aET RLw5Cy1MqlTutMoF6X0bMNKlfcHdci/FAOGCmS5PdnJ6V6ink/Z4FtqSXnpJWucVftqN xjSyWJ9/i/PKCwVt6D/pBd2YFuu606KhSoeADFL5f7czYGE+bMKGbK6itbpQn23mkVEu KO5Q== X-Gm-Message-State: AOAM531ikmMPvXB0UU9rCLxcCgH7jCIL+d0FaeIF0+RKA7P3fMG1jPxE yte2jncWviEsbNfoRRVCPXM= X-Google-Smtp-Source: ABdhPJzllu4IdjHXcUMczo++gtjf4jceZyVT6HHXrsq0SLK7NBDrKCoKTv4YEOEn8X7kGWdEbXOzyA== X-Received: by 2002:a5d:5342:: with SMTP id t2mr23407788wrv.215.1643219777966; Wed, 26 Jan 2022 09:56:17 -0800 (PST) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id o12sm4632848wmq.41.2022.01.26.09.56.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:56:17 -0800 (PST) From: Romain Perier To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Arnd Bergmann , Daniel Palmer , Romain Perier , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 5/8] ARM: mstar: Link cpupll to second core Date: Wed, 26 Jan 2022 18:56:01 +0100 Message-Id: <20220126175604.17919-6-romain.perier@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126175604.17919-1-romain.perier@gmail.com> References: <20220126175604.17919-1-romain.perier@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_095620_262571_3FB1EBB8 X-CRM114-Status: GOOD ( 11.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Daniel Palmer The second core also sources it's clock from the CPU PLL. Signed-off-by: Daniel Palmer Reviewed-by: Romain Perier --- arch/arm/boot/dts/mstar-infinity2m.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/mstar-infinity2m.dtsi b/arch/arm/boot/dts/mstar-infinity2m.dtsi index 6d4d1d224e96..dc339cd29778 100644 --- a/arch/arm/boot/dts/mstar-infinity2m.dtsi +++ b/arch/arm/boot/dts/mstar-infinity2m.dtsi @@ -11,6 +11,8 @@ cpu1: cpu@1 { device_type = "cpu"; compatible = "arm,cortex-a7"; reg = <0x1>; + clocks = <&cpupll>; + clock-names = "cpuclk"; }; }; From patchwork Wed Jan 26 17:56:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12725578 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2DFDDC28CF5 for ; Wed, 26 Jan 2022 18:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8l7lFAw5WgQi9XSE4J6HMIHh/JpAHWpfQxh+BGHv3s0=; b=EI6PIHuggJDIBe 7iMF2XSfU1Wws/bnmLI4RtSZWgSJQMLmg5N23xpwymD9STUvxwfxV68Mg0GHie3Gnuw0b3xVAPVgL 09qoufSWdIZ/mkAaRbb0wRbuuoSXZn4XmLvXQ1dhRpBfCBHFIRQ4VZk/BZ7CVGivgS9+fbryqu0k1 DcGsmjxDSOg7UGhIyZtJAtScoj6eSKHNsV6fwyZAunrPk38XvOmA1RNWoLilg2+7cHCA6RQoAoRDH vzzo39WDYEOQ2kSVPYepUIjNgMApGHLmm4bNRT/h1g8hLsg5BHu7ONNRN7O0r7XAUvFQk1KREZGyo 8i5c0Ht5/NdY24A0zcPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmhz-00DEzt-Kc; Wed, 26 Jan 2022 18:07:52 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmWq-00DAEa-M2 for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:56:22 +0000 Received: by mail-wr1-x42b.google.com with SMTP id a13so377888wrh.9 for ; Wed, 26 Jan 2022 09:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=987i68G0hoSD7befa/sZSvlzgSvWjRDhljDEuS8vWhM=; b=YW2UrPWX3Gqj7NPwSuzV0pZYMXbe6mghkz4zxiAfBMsjgRWORd2wNL9Ngd0v113N6Q l/d1ujsUKh1C4a0IkFe8cWm+W55eBPI8OLU3IMuLr9EGPsdBU4rzmsosqxzuQ9Ra1r/J GbSDXVoiYDUuKwVBb77ylkN5/wMJC/3VLqFFLlURyO5RM6w4/Vje+9MOMzsxWs5tLCI0 TjCwXoXSyssc+muDW3ktraSDb8P60usz7GTOr/Id/aOa4bi2mp7gD69wquIF8u3ir2YU 8m1A4uLkadQxpmnR4K6Qjs0JcHTAEaMTH8Fxq6M3ZWndr+S0XSXb3+m5bD9pQvb0hEOe Xv2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=987i68G0hoSD7befa/sZSvlzgSvWjRDhljDEuS8vWhM=; b=FCsHsnreOY+UclmBFX3sISRJvpGUR7OJv/aLdUgHHTQlMdFbh/ylSCs1N65aS9NUQx 9XKFn+UbCELe9jWuhEFbsMBubWkBQp/W7KpeasHrC5ERNA0lEs/FAZMtuld4MvGyTCK5 wnYGqQAQ5p0+ap2VSAF0/dZ28vVMXmxs8hY/IPAP2rV6LtK5VXn6M/YJwEu26bAW2GZh huqqP+daUNJ43ENLffbfa9YF20N7czOp1M3Eycu2mBBqCxYSvEOSKxnyRodbKR4Th4Bc 3cWQLVzFlSDSoRpN+o9EzdXNPXtbOBmZfnfk6z9oQ9WsBsCmcTPVjniRnM2cNvTwn/N+ abhQ== X-Gm-Message-State: AOAM5334FQ7TaNSxMvgPbFICmOudbwy9GvrnQeBUMNH9IVFBQMSBibil wtleeJibL+DKoTJEYvs9akg= X-Google-Smtp-Source: ABdhPJyUUeUIz50LPFJ1txfvAZ2tlqLG/uX9p2O822Wau+U7NjY7bHm99jmtJ6NwczP49HCwt50baQ== X-Received: by 2002:adf:f791:: with SMTP id q17mr23246847wrp.340.1643219779015; Wed, 26 Jan 2022 09:56:19 -0800 (PST) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id o2sm2179098wmq.21.2022.01.26.09.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:56:18 -0800 (PST) From: Romain Perier To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Arnd Bergmann , Daniel Palmer , Romain Perier , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH v4 6/8] ARM: mstar: Add OPP table for infinity Date: Wed, 26 Jan 2022 18:56:02 +0100 Message-Id: <20220126175604.17919-7-romain.perier@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126175604.17919-1-romain.perier@gmail.com> References: <20220126175604.17919-1-romain.perier@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_095620_772991_F3526751 X-CRM114-Status: GOOD ( 11.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Daniel Palmer Add an OPP table for the inifinity chips so that cpu frequency scaling can happen. Co-authored-by: Willy Tarreau Signed-off-by: Daniel Palmer Reviewed-by: Romain Perier --- arch/arm/boot/dts/mstar-infinity.dtsi | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/boot/dts/mstar-infinity.dtsi b/arch/arm/boot/dts/mstar-infinity.dtsi index 0bee517797f4..441a917b88ba 100644 --- a/arch/arm/boot/dts/mstar-infinity.dtsi +++ b/arch/arm/boot/dts/mstar-infinity.dtsi @@ -8,6 +8,40 @@ #include +/ { + cpu0_opp_table: opp_table0 { + compatible = "operating-points-v2"; + opp-shared; + + opp-240000000 { + opp-hz = /bits/ 64 <240000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + }; + + opp-400000000 { + opp-hz = /bits/ 64 <400000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + }; + opp-600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + }; + + opp-800000000 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + }; + }; +}; + +&cpu0 { + operating-points-v2 = <&cpu0_opp_table>; +}; + &imi { reg = <0xa0000000 0x16000>; }; From patchwork Wed Jan 26 17:56:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12725579 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5E6EAC28CF5 for ; Wed, 26 Jan 2022 18:10:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0HAnhOr1C8kZUcuAsp+pkbawOMp8KFRP/SE9rsUts7E=; b=lUeiqv0yvpqp6X 8x1YevpkhY4140sZUdUpkJkREpMt6ZCcXUL5eKtenIqf+C2KFCA91WmbebGsaX5BxLTR+kPHr+FvT rODI3UjF5hTyYe6VaakorQBfd4xvfH5aDuZ+KbuKutDmAWgzWpYqxjwxdtEURC3NLG6txi6UY6nfZ JUOGNZktUCTbBdPGZAoA3ripxgxQ0nuq/u/NLvXS5AK3qUiOzAh7WBv7XLl5Oz8sGJneW/bEOs35b u/RxUMQVo96MhaMjmnU7Oepx99cxlJpxVQ9CN4+/TYvYqNsY08g/YW1sKf2H8EPVntpEUS7Z+JPyj bMOQcSJuyPgsgMBZ9seA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmie-00DFFV-RM; Wed, 26 Jan 2022 18:08:33 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmWs-00DAF5-3P for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:56:23 +0000 Received: by mail-wm1-x32f.google.com with SMTP id q141-20020a1ca793000000b00347b48dfb53so359674wme.0 for ; Wed, 26 Jan 2022 09:56:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YbbfYaxNXJjiNo8O6xmEfb2M0Ik6NihxDDvfwKnfopE=; b=LLbJQvi+fx8IkX14ezqcJmTTKm1B3+EKjhaD/fKavWP4YIT5w+OIlgUqgouf09gROv eTCkFvChgj2vYIN+H2LbJh1XMa3gCZT5U3VeXFwvvp8W3QEiBlAXf1uJbGwrB7IOgu2G TPDTU45uGhS8eoy2095OIN+S7KLNXNmvNdhBjqVQL1PxwBTML4SUADU//0yXRw2NHAdO DmCuRNMMxGTrD2zWP40nvf5KOkwreYz3iI7Qh2AJwSzYtefrm7h+zbAk0XoiKzOMkPwU vB/LhfmBJLHEWVEU7ZpZv2BK0uORZq897AQ1Rbxnw7L3JZG2Bavd55l237TbMvWhvyvj 39RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YbbfYaxNXJjiNo8O6xmEfb2M0Ik6NihxDDvfwKnfopE=; b=T1k7BTVLUfLa9asijm4f7mM47KOcP/ycu0LmfHLWu/rOKDpyRT9l3Dy70pmnOtjBgl 2zgwT2faLIMC6gRXcasw/Wh9cGB1NofjGutgsvwkIA2pduYsZvAm1He3xjtbEezAIGye Gy6o2FTDs/OaGOjmp+eaCHfz0803NW3tcNGa2fZne4CmBrajHpqFlwpSOtS53fAKRkOW fijttP7KXbAlJpcRKtODchlJzlIYnZR0vee4pD76lr/MSmDzA2pFeGAxLTq8lLllkYg8 AdqakKIyb/uE/inC4/HtYKkjNlRT5gqdEm3Khye5t4QGgdda5D9PSmSJTWXdrcaCh4UH EV7Q== X-Gm-Message-State: AOAM5316h3UECf2nWiUHrsfHCiLqHS4YOXgv6STUMT+KiVhDqDKyVLua 2xkVCozrrGYPXqeacdkXpDo= X-Google-Smtp-Source: ABdhPJyBNh0xEqsTSW37ZhKBR1IOZtVGY211ApiFMYBC1fYxhO0v5UJvpml8Lc7sVcNj/31SGIzgBQ== X-Received: by 2002:a05:600c:2245:: with SMTP id a5mr8052798wmm.8.1643219780052; Wed, 26 Jan 2022 09:56:20 -0800 (PST) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id u3sm10515371wrs.55.2022.01.26.09.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:56:19 -0800 (PST) From: Romain Perier To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Arnd Bergmann , Daniel Palmer , Romain Perier , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH v4 7/8] ARM: mstar: Add OPP table for infinity3 Date: Wed, 26 Jan 2022 18:56:03 +0100 Message-Id: <20220126175604.17919-8-romain.perier@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126175604.17919-1-romain.perier@gmail.com> References: <20220126175604.17919-1-romain.perier@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_095622_191539_D8DAE232 X-CRM114-Status: GOOD ( 11.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Daniel Palmer The infinity3 has a slightly higher max frequency compared to the infinity so extend the OPP table. Co-authored-by: Willy Tarreau Signed-off-by: Daniel Palmer Reviewed-by: Romain Perier --- arch/arm/boot/dts/mstar-infinity3.dtsi | 58 ++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/arch/arm/boot/dts/mstar-infinity3.dtsi b/arch/arm/boot/dts/mstar-infinity3.dtsi index 9857e2a9934d..a56cf29e5d82 100644 --- a/arch/arm/boot/dts/mstar-infinity3.dtsi +++ b/arch/arm/boot/dts/mstar-infinity3.dtsi @@ -6,6 +6,64 @@ #include "mstar-infinity.dtsi" +&cpu0_opp_table { + opp-1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + }; + + // overclock frequencies below, shown to work fine up to 1.3 GHz + opp-108000000 { + opp-hz = /bits/ 64 <1080000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + turbo-mode; + }; + + opp-1188000000 { + opp-hz = /bits/ 64 <1188000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + turbo-mode; + }; + + opp-1296000000 { + opp-hz = /bits/ 64 <1296000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + turbo-mode; + }; + + opp-1350000000 { + opp-hz = /bits/ 64 <1350000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + turbo-mode; + }; + + opp-1404000000 { + opp-hz = /bits/ 64 <1404000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + turbo-mode; + }; + + opp-1458000000 { + opp-hz = /bits/ 64 <1458000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + turbo-mode; + }; + + opp-1512000000 { + opp-hz = /bits/ 64 <1512000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + turbo-mode; + }; +}; + &imi { reg = <0xa0000000 0x20000>; }; From patchwork Wed Jan 26 17:56:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12725580 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D73F2C28CF5 for ; Wed, 26 Jan 2022 18:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+KPLgMNLE3kyidgHKPdaCpSihJ+LgUir0V+EEgo4Fsc=; b=XhxXesRq8T6Hum r5J4/bKqtvM9u1niqI5RSwZv5O038eElys+l6TDrCwloR4u59zMi3OMMpKg1XvpuDywXzShZHjs5P ZrELEgSrb9UeScV/1L9EJSwJwuq5SqtI3VH9GCDETrQFR5b4H7joxubfVnLoFy1ZJgIBGDySNw+Ve e2mM6wntTzayLGFG4IaOs746rQp9Rp1J6WPOuDhlVkZ77EW2lugnhiq2TOCPS5ngnF6DuFbLiWInk znPF9N8ErKibBY4YOBwHOSQCnk7QLSE+qJcRvU8VRwjq1dpt6Fahtf+RzjaiGnmGomNdsunVmZkNz 4zuLx516FXPL46S6Bcbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmjN-00DFWp-NE; Wed, 26 Jan 2022 18:09:19 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmWt-00DAGT-7m for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:56:24 +0000 Received: by mail-wr1-x42a.google.com with SMTP id m14so170065wrg.12 for ; Wed, 26 Jan 2022 09:56:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iD/CADMJmjE6Wqsta+zyCvYv9Ey28eqoIb5w5xoLVEA=; b=flYDVQBDLjA81NHjPaYBppGWq5mETdHWxrDTn3Dbnwln9/TBEzkdnKZDe7RG6nPKOd dHm3QNW2gGkyIwMoF8vs2rh40atl12yYEhFFUDnianqHAJUMceTYtMvgVLPRuNO5CRec hKgzSLm/l07nkz05/TF82VbNTOvWiNSdQNjJl5j17UiPZRvKj0EqYvqxsispKvD5ztHF 1e4kP81VTp35dGpp+8iiVnOxitL9I3EUn9EeIInYr5yL6RvEEXPFJneJwlO6h+ci4VxG zNaTTdqo46RePFXDCgZcmzELi3j6+sVk91frZNSRY0G9V0PhGTG2evKsCwmzgsaUpEmh 8rbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iD/CADMJmjE6Wqsta+zyCvYv9Ey28eqoIb5w5xoLVEA=; b=iCXnppOO6HpGeG5CYoTS0cdRQQnQpszv2VYE1nlpkXcUAd8F58GmWhUIO+F0In5yJw tbsaJsrPa54Po9ks8BOgFek8Ki4gEvYy8S2xyySNMkUr8q8jYuqJqHy2qc8o1Taztrj6 lwOQG76wUymHxEPZQNDS5b/bn9KLRD5i+cs0GnFrKpJXGdgvJeJC1gxpFAucgexTAffl vYntMhq/cdWWokS/7alX3PLgFY54SfMF05LmCVNWmxYtOW79Tref0S3BpxHqlQkv4C83 8+bO4MM4qclcn/nPyyQnU5BHqKBGkrjFHmwuIo65EplFRjVMxytcKjWdhC2Nen8fT7wq eqFg== X-Gm-Message-State: AOAM5307JrO1HyrXte8kleXP+Wmw8peGPOC14UHtxLZim9dAA4jn+IF0 egeoKo6e3oSGhIV2EnfeGxE= X-Google-Smtp-Source: ABdhPJw8fPH9A4/VhWfdDH8hu/O77mu+3yiNPKg2taaBwgHgn2QguKRql4XLNDPx64znUUkGamzang== X-Received: by 2002:a5d:4288:: with SMTP id k8mr23087912wrq.657.1643219781128; Wed, 26 Jan 2022 09:56:21 -0800 (PST) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id d2sm19935638wru.40.2022.01.26.09.56.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:56:20 -0800 (PST) From: Romain Perier To: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Arnd Bergmann , Daniel Palmer , Romain Perier , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 8/8] ARM: mstar: Extend opp_table for infinity2m Date: Wed, 26 Jan 2022 18:56:04 +0100 Message-Id: <20220126175604.17919-9-romain.perier@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126175604.17919-1-romain.perier@gmail.com> References: <20220126175604.17919-1-romain.perier@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_095623_325353_805913D5 X-CRM114-Status: GOOD ( 11.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org infinity2m are running up to 1.2Ghz, this extends opp_table with the corresponding frequencies and enable operating-points table for cpu1 Signed-off-by: Romain Perier --- arch/arm/boot/dts/mstar-infinity2m.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/boot/dts/mstar-infinity2m.dtsi b/arch/arm/boot/dts/mstar-infinity2m.dtsi index dc339cd29778..1b485efd7156 100644 --- a/arch/arm/boot/dts/mstar-infinity2m.dtsi +++ b/arch/arm/boot/dts/mstar-infinity2m.dtsi @@ -6,10 +6,25 @@ #include "mstar-infinity.dtsi" +&cpu0_opp_table { + opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + }; + + opp-1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <300000>; + }; +}; + &cpus { cpu1: cpu@1 { device_type = "cpu"; compatible = "arm,cortex-a7"; + operating-points-v2 = <&cpu0_opp_table>; reg = <0x1>; clocks = <&cpupll>; clock-names = "cpuclk";