From patchwork Fri Jan 21 19:35:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12720158 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 F1A77C433FE for ; Fri, 21 Jan 2022 19:37:35 +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: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:In-Reply-To:References: List-Owner; bh=TPulURclObPBsDvEY7irqSoANyrW1AN+sE5V3E/JQbs=; b=XOMKF+XOnfL4T2 N/bSMskXsM6m3BUWoepPTbaOdWKaoqRG54qKybCMCK78lMvVcHt8dzeidf5XZosBIHppOOHyY4+pb oOeqSIDyOtoQDOQddM36qIUMY124FvzKAuJL1/sCZvsZ08NIdKF2wz6t6o6VbceAQ0Lu+j7VAcOmg AZbZrVT5vAzBIWfu2x4jNSZjlw6L0O6rfDoNLoLiXUqh6Q2SZmPl4htsT/wOTULHMEgai9g40uYd1 ss0q03n2fcU78fhll2fVxCcZd8y4y3RXz+JRuQTWjgbO8B2VLwvEk+N9bRXC5Aok9WE2aAUKDXd1G ayoZ709AMn+hk6KOP5nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAzhV-00Fw3A-K6; Fri, 21 Jan 2022 19:35:57 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAzhS-00Fw17-0m for linux-arm-kernel@lists.infradead.org; Fri, 21 Jan 2022 19:35:55 +0000 Received: by mail-wm1-x32a.google.com with SMTP id l35-20020a05600c1d2300b0034d477271c1so23380762wms.3 for ; Fri, 21 Jan 2022 11:35:50 -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:mime-version :content-transfer-encoding; bh=OG5i1U75JFlGEp4vAP5hCTScqw6mwFeMzIFBq2Z1cfw=; b=m02Lkjdhv80VuCwMmiK7vgoUvaXS40pRgrTKEN6fEHyaqxZ6LWpVTn2sDesVjrNKyt eBRgYP8VATt2Vxy8pMNZP3vbzgQgDxPIYD1gTpCoN1APiqL/14WqnpMy8pfcgPx1AhXD 14GG38V8pJLhflytCOevs0sCdDqFhNdTXi73Ba9r33HfUwB5IPCxCoxkXZRdCNk7S+rU Y41cb80GbS8GPt7BTmeJfsLJC1y9lRMZGE4x1yP1ohPr0cyd9IriqBcf5MBm35bWra1Y stIoY39m3P5bETrJGeyViTC4NML4R+yiCFQrSppiUwy2M1qV4bN+K7kvK8o6HZ3DTTBm p6Sg== 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:mime-version :content-transfer-encoding; bh=OG5i1U75JFlGEp4vAP5hCTScqw6mwFeMzIFBq2Z1cfw=; b=IlsIvEBKgiq7BY6piJAIjVUagAkAqc+8Jw3nhcvYKoPxpPklMTbf5ukFzERvSvPi25 pi09oQvkEym4hkgWZskmgP/jM7ef5TPhBSom1BLVAbqzwbhPfjeyCUpdIJhn+NHtZxPq f3HxsUMK+8it3WAjVaqz6H9FXPvvS99psaEJsW/cQksRygvzEMWR9y8bt3Ds+33hUgxH 9LKftCVbwdN0r/E+2sq16QulTo7aV+W1gjqifzdt4eQKAx06lQoZaC8dXZA72IW0sptC FG6miQKLbm6tx+gAYdJuBMxJAjXOfb9K+1Yj5Svg3uWQ8EkNYd/V8pSqYHXwYWTpI8nu 2LBg== X-Gm-Message-State: AOAM530Oa5fnvnsF/dhLljYjY/z29s8pursIyaV7rg+p//M0xO13O052 1OpW5opLOa+H2vjDSRfcfr0= X-Google-Smtp-Source: ABdhPJw+2RKyMVqaHbLpTxd5iL40TOcowFWOfAIbNkFsfqxSc1E8Ptqj7zKspbq4dYYlHa4aa2XBEg== X-Received: by 2002:a05:600c:5028:: with SMTP id n40mr1972112wmr.10.1642793749133; Fri, 21 Jan 2022 11:35:49 -0800 (PST) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id z1sm11473860wmk.32.2022.01.21.11.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 11:35:48 -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 v3 0/9] ARM: mstar: cpupll Date: Fri, 21 Jan 2022 20:35:35 +0100 Message-Id: <20220121193544.23231-1-romain.perier@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220121_113554_093127_C6AB238F X-CRM114-Status: GOOD ( 15.83 ) 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 This series adds a basic driver for the PLL that generates the cpu clock on MStar/SigmaStar ARMv7 SoCs. Unfortunately there isn't much documentation for this thing so there are few magic values and guesses. This needs to come after the MPLL DT changes. Changes since v2: - Re-ordered Kconfig by name - Re-ordered includes alphabetically and removed useless ones - Used timeout for cpu_relax - Returned DIV_ROUND_DOWN_ULL() directly in msc313_cpupll_frequencyforreg() - Returned DIV_ROUND_DOWN_ULL() directly in msc313_cpupll_regforfrequecy() - Reduced the number of lines for msc313_cpupll_of_match - Removed CLK_IS_CRITICAL Changes since v1: - Re-worked the series and ensure that 'make dt_binding_check' passes. The required commit is merged now, so it is okay. - Fixed coding style issues in the driver and makes check_patch.pl happy - Added one more commit for extending the opp_table for infinity2m. Daniel Palmer (8): dt-bindings: clk: mstar msc313 cpupll binding description clk: mstar: msc313 cpupll clk driver ARM: mstar: Add cpupll to base dtsi ARM: mstar: Link cpupll to cpu ARM: mstar: Link cpupll to second core ARM: mstar: Add OPP table for infinity ARM: mstar: Add OPP table for infinity3 ARM: mstar: Add OPP table for mercury5 Romain Perier (1): ARM: mstar: Extend opp_table for infinity2m .../bindings/clock/mstar,msc313-cpupll.yaml | 45 ++++ arch/arm/boot/dts/mstar-infinity.dtsi | 34 +++ arch/arm/boot/dts/mstar-infinity2m.dtsi | 17 ++ arch/arm/boot/dts/mstar-infinity3.dtsi | 58 +++++ arch/arm/boot/dts/mstar-mercury5.dtsi | 36 +++ arch/arm/boot/dts/mstar-v7.dtsi | 9 + drivers/clk/mstar/Kconfig | 8 + drivers/clk/mstar/Makefile | 2 +- drivers/clk/mstar/clk-msc313-cpupll.c | 221 ++++++++++++++++++ 9 files changed, 429 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/clock/mstar,msc313-cpupll.yaml create mode 100644 drivers/clk/mstar/clk-msc313-cpupll.c