| Message ID | 20221113180710.1625410-2-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBCQ4XFG47UFRBV7EYSNQMGQE7B7NCVY@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 28FC83F1F5 for <linux-amarula@patchwork.amarulasolutions.com>; Sun, 13 Nov 2022 19:07:20 +0100 (CET) Received: by mail-ed1-f70.google.com with SMTP id w17-20020a056402269100b00461e28a75ccsf6770735edd.8 for <linux-amarula@patchwork.amarulasolutions.com>; Sun, 13 Nov 2022 10:07:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668362840; cv=pass; d=google.com; s=arc-20160816; b=Pc4yfPQvTRKJRj1hmJDgDoeVBwZbi7azu7cfrXxCBFd5VNFowUIYufERKYY5gIXJpL p6uF1XATVHElsx0x9e94b80Dmuc8br9RS3g3ZJku9i96JE08FtoCUdlSoWPvF80FQbBG 8qDpcGAIA9DyOZqw22+a0FCbANIzA+DetBYd+/OQ55VL/wI2EIfOnAm0rv7iO2zTJsIq Vpi49xfFoLbJIIO9yChPs+fHLIQ0aWoZRDWETygS40fKN5Mfvdcseg03RbxOoeNRkgCp JXPi5jCfIpuZS/sCAkLZ3mZKMs5LighzGRw167Gg6wRWM0SA4nP90MODpmwMV263xfIE yBng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=0EkBmUMGiilyKYF6J8SnD+mhAicCG1rNgV6aeVdlolw=; b=JZQqVq9VXK5T7esRvQUAxv6Dy8hXEmvJbCJXSxE+X9JQAuRjPoOqbbsDtT1kx3kLst JaIHKWCw/PgFIxGb0aSXzuJnViv5oIXld6S14Wg+CFTr3Vaq5aEGKrzDXyQlVL5gZ889 LP9TF1U4kX3D0qzRLugqHjYMeuElFR5/7F7RFHYUHcPaak4N0qwoKmFkCgnILtmlQquT VAG1UfD6zHscBiN4bSlm2v0X26aPO649twtfV7uKJg/59+KgXeKG4F9mVcTaavjRFFoQ m7NXDhiohgfhqe0r2yIWYL6O5y+xBbeBwGjqHxT5347a1STasc+K9RzA757OizP9lP0v z6Hw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kaKpU7Pg; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=0EkBmUMGiilyKYF6J8SnD+mhAicCG1rNgV6aeVdlolw=; b=RiwCK/q/krN6cJiwisbwklSvaIF0OvwhOm32Gv4C9zoSET7G/HD9h9bVbe8NZMjBAT MXOhz0KV2YULb+amu8h1uTA9y7l4EGeNozCUfWPvcyO8y867TZFh4L4Yly8Qmf7PedRY n7EPPzQb7zCdXamM5gKIOLNyf6mtH5/35r8fo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0EkBmUMGiilyKYF6J8SnD+mhAicCG1rNgV6aeVdlolw=; b=sM0aq3h6k/feEG2m5cMmwHRkBwEhU/AfZqQRdRyW4DU4YYuJYrYum6wO9Uo+lkgHb6 dARiihupDi2blaWO6rcam7FSnJYjkVyWcgnFJeIiOQZ8s3c3i8e7qfnR7Ucka62rONsF q6gMzoC668bThEYeHEDEH5S/cXNgS33uAq/xhAiLHCt/ldxoeiQ3qiLbzkqJ81RSRghF XxwMhijg+CH71P+pynmRWvXtFsNrci4xL/5vouNOm2E7cEOL6NfZQk02bFGf9FKKSyQM LR2rbOhVvl4GJJ12IPYO7Tu7ENHoJZeqjy3Lbtvi/wz3AiGdQMrrQhgfgFxySgwNUyad ngyA== X-Gm-Message-State: ANoB5pnEFriLZoOJCUe38rJL7iaAHXu4kk7aUMU2uDmBBmAHtUmlO2Tq yx0mNvP0cdPaMOV+0ozdq52idZxV X-Google-Smtp-Source: AA0mqf7LHjpX0vxpKbX9nCRVWpx1DfJopnJbFuvLkMPwK123KjVCc3z5WeTn5w7PMbOMG+ZRRUM5uA== X-Received: by 2002:a17:906:7102:b0:7ad:b45c:dd7a with SMTP id x2-20020a170906710200b007adb45cdd7amr8199328ejj.292.1668362839760; Sun, 13 Nov 2022 10:07:19 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:35d0:b0:45c:bfd9:fb45 with SMTP id z16-20020a05640235d000b0045cbfd9fb45ls2526947edc.3.-pod-prod-gmail; Sun, 13 Nov 2022 10:07:18 -0800 (PST) X-Received: by 2002:a50:8e16:0:b0:463:69bc:c574 with SMTP id 22-20020a508e16000000b0046369bcc574mr8690700edw.120.1668362838581; Sun, 13 Nov 2022 10:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668362838; cv=none; d=google.com; s=arc-20160816; b=zVoNkuli1HHtLA3hI212oeKJmFXHIINZpUSMDKK/bN92VKvaBnMGqCQGLaiyYvT5Gx huuZ3ZXdXeb6zDXQso1Rorh9HP2URnhsvfwuoRCpq4IxtFbvSfJSE1z4QP4pDq/z+7Q5 1jAOwhne1B0mBgBxSQbq0j0oMkseb7B71tRJfYcOx8KH6itYllIUEySbbaM+vbF2Y44a k6EFb1KaTHbvaSjJjp9u3F1OzdE+bHjR89GFenDV+6Hnf89vcafl1jE6YQj7DxTklMu1 6fzArVuwBX1kMn9hMb5AP1GkbulqtPi1E7mSPtw7RtQM/WScpQzWhxz4if9C0UY6LfZM NkJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gnyf91bipF2JRLTPkhwmHfUpzi0ppPqPGAVM2YEgVXE=; b=ty5xKHIase6kMCGEJIOFF4SRxhE4nCVOH+gA0VJ/OazUKpkY0Fja9hFmu8KGxoxXtg AuHkrpoiGhDhEelqPtftYN7WGxji1Em8earO358p33wZrzCu35FJHjhTisDLMiZxItbn apQCnZde0l2y6t+Lu6v4fZD1C1gU1NW2Pe74psAwsgu+fooGZLj6OSMv4iNB63JP5Wf1 nf8a0qr+AwuED0YSxwL/XD2J0FHuM8SY6FAdItwWXGVevuUGukrX4Rkb3uQVzDhrr9Cb eWJ+49VmT8Mr69CykpM0X6sAfALmgJA/GR87W7YSZfxOb2wRlONBGCfSfJjYOZxUy9AW 5PNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kaKpU7Pg; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id q16-20020a170906389000b00780d5ee1ce6sor3012288ejd.71.2022.11.13.10.07.18 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Sun, 13 Nov 2022 10:07:18 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:906:a20c:b0:7ae:27a7:2a66 with SMTP id r12-20020a170906a20c00b007ae27a72a66mr8220123ejy.72.1668362838299; Sun, 13 Nov 2022 10:07:18 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-40-103-33.business.telecomitalia.it. [79.40.103.33]) by smtp.gmail.com with ESMTPSA id n11-20020a170906118b00b007a8de84ce36sm3171058eja.206.2022.11.13.10.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 10:07:17 -0800 (PST) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, michael@amarulasolutions.com, Dario Binacchi <dario.binacchi@amarulasolutions.com>, Abel Vesa <abelvesa@kernel.org>, Fabio Estevam <festevam@gmail.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Michael Turquette <mturquette@baylibre.com>, NXP Linux Team <linux-imx@nxp.com>, Pengutronix Kernel Team <kernel@pengutronix.de>, Rob Herring <robh+dt@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Shawn Guo <shawnguo@kernel.org>, Stephen Boyd <sboyd@kernel.org>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH 1/5] clk: imx8mn: rename vpu_pll to m7_alt_pll Date: Sun, 13 Nov 2022 19:07:06 +0100 Message-Id: <20221113180710.1625410-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20221113180710.1625410-1-dario.binacchi@amarulasolutions.com> References: <20221113180710.1625410-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kaKpU7Pg; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
clk: imx8mn: miscellaneous cleanups and bug fixes
|
|
Commit Message
Dario Binacchi
Nov. 13, 2022, 6:07 p.m. UTC
There is no occurrence of vpu pll in the reference manual (document
IMX8MNRM Rev 2, 07/2022). From an analysis of the code and the RM
itself, I think vpu pll is used instead of m7 alternate pll, probably
for copy and paste of code taken from modules of similar architectures.
As an example for all, if we consider the second row of the "Clock Root"
table of chapter 5 (Clocks and Power Management) of the RM:
Clock Root offset Source Select (CCM_TARGET_ROOTn[MUX])
... ... ...
ARM_M7_CLK_ROOT 0x8080 000 - 24M_REF_CLK
001 - SYSTEM_PLL2_DIV5
010 - SYSTEM_PLL2_DIV4
011 - M7_ALT_PLL_CLK
100 - SYSTEM_PLL1_CLK
101 - AUDIO_PLL1_CLK
110 - VIDEO_PLL_CLK
111 - SYSTEM_PLL3_CLK
... ... ...
but in the source code, the imx8mn_m7_sels clocks list contains vpu_pll
for the source select bits 011b.
So, let's rename "vpu_pll" to "m7_alt_pll" to be consistent with the RM.
No functional changes intended.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
drivers/clk/imx/clk-imx8mn.c | 16 ++++++++--------
include/dt-bindings/clock/imx8mn-clock.h | 8 ++++----
2 files changed, 12 insertions(+), 12 deletions(-)
Comments
Hi Dario, On 22-11-13, Dario Binacchi wrote: > There is no occurrence of vpu pll in the reference manual (document > IMX8MNRM Rev 2, 07/2022). From an analysis of the code and the RM > itself, I think vpu pll is used instead of m7 alternate pll, probably > for copy and paste of code taken from modules of similar architectures. > > As an example for all, if we consider the second row of the "Clock Root" > table of chapter 5 (Clocks and Power Management) of the RM: > > Clock Root offset Source Select (CCM_TARGET_ROOTn[MUX]) > ... ... ... > ARM_M7_CLK_ROOT 0x8080 000 - 24M_REF_CLK > 001 - SYSTEM_PLL2_DIV5 > 010 - SYSTEM_PLL2_DIV4 > 011 - M7_ALT_PLL_CLK > 100 - SYSTEM_PLL1_CLK > 101 - AUDIO_PLL1_CLK > 110 - VIDEO_PLL_CLK > 111 - SYSTEM_PLL3_CLK > ... ... ... > > but in the source code, the imx8mn_m7_sels clocks list contains vpu_pll > for the source select bits 011b. Thanks for the real detailed description. Maybe we should mention, that the 8MN has no VPU complex at all. > So, let's rename "vpu_pll" to "m7_alt_pll" to be consistent with the RM. > > No functional changes intended. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- > > drivers/clk/imx/clk-imx8mn.c | 16 ++++++++-------- > include/dt-bindings/clock/imx8mn-clock.h | 8 ++++---- > 2 files changed, 12 insertions(+), 12 deletions(-) > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > index d37c45b676ab..72f9563a0ff6 100644 > --- a/drivers/clk/imx/clk-imx8mn.c > +++ b/drivers/clk/imx/clk-imx8mn.c > @@ -30,7 +30,7 @@ static const char * const audio_pll2_bypass_sels[] = {"audio_pll2", "audio_pll2_ > static const char * const video_pll1_bypass_sels[] = {"video_pll1", "video_pll1_ref_sel", }; > static const char * const dram_pll_bypass_sels[] = {"dram_pll", "dram_pll_ref_sel", }; > static const char * const gpu_pll_bypass_sels[] = {"gpu_pll", "gpu_pll_ref_sel", }; > -static const char * const vpu_pll_bypass_sels[] = {"vpu_pll", "vpu_pll_ref_sel", }; > +static const char * const m7_alt_pll_bypass_sels[] = {"m7_alt_pll", "m7_alt_pll_ref_sel", }; > static const char * const arm_pll_bypass_sels[] = {"arm_pll", "arm_pll_ref_sel", }; > static const char * const sys_pll3_bypass_sels[] = {"sys_pll3", "sys_pll3_ref_sel", }; > > @@ -40,7 +40,7 @@ static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl > > static const char * const imx8mn_a53_core_sels[] = {"arm_a53_div", "arm_pll_out", }; > > -static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "vpu_pll_out", > +static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "m7_alt_pll_out", > "sys_pll1_800m", "audio_pll1_out", "video_pll1_out", "sys_pll3_out", }; > > static const char * const imx8mn_gpu_core_sels[] = {"osc_24m", "gpu_pll_out", "sys_pll1_800m", > @@ -252,10 +252,10 @@ static const char * const imx8mn_gpt6_sels[] = {"osc_24m", "sys_pll2_100m", "sys > "audio_pll1_out", "clk_ext1", }; > > static const char * const imx8mn_wdog_sels[] = {"osc_24m", "sys_pll1_133m", "sys_pll1_160m", > - "vpu_pll_out", "sys_pll2_125m", "sys_pll3_out", > + "m7_alt_pll_out", "sys_pll2_125m", "sys_pll3_out", > "sys_pll1_80m", "sys_pll2_166m", }; > > -static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "vpu_pll_out", > +static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "m7_alt_pll_out", > "sys_pll3_out", "sys_pll2_200m", "sys_pll1_266m", > "sys_pll2_500m", "sys_pll1_100m", }; > > @@ -352,7 +352,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > hws[IMX8MN_VIDEO_PLL1_REF_SEL] = imx_clk_hw_mux("video_pll1_ref_sel", base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > hws[IMX8MN_DRAM_PLL_REF_SEL] = imx_clk_hw_mux("dram_pll_ref_sel", base + 0x50, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > hws[IMX8MN_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", base + 0x64, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > - hws[IMX8MN_VPU_PLL_REF_SEL] = imx_clk_hw_mux("vpu_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > + hws[IMX8MN_M7_ALT_PLL_REF_SEL] = imx_clk_hw_mux("m7_alt_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > hws[IMX8MN_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", base + 0x84, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > hws[IMX8MN_SYS_PLL3_REF_SEL] = imx_clk_hw_mux("sys_pll3_ref_sel", base + 0x114, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > @@ -361,7 +361,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > hws[IMX8MN_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", base + 0x28, &imx_1443x_pll); > hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", base + 0x50, &imx_1443x_dram_pll); > hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", base + 0x64, &imx_1416x_pll); > - hws[IMX8MN_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", base + 0x74, &imx_1416x_pll); > + hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", base + 0x74, &imx_1416x_pll); > hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", base + 0x84, &imx_1416x_pll); > hws[IMX8MN_SYS_PLL1] = imx_clk_hw_fixed("sys_pll1", 800000000); > hws[IMX8MN_SYS_PLL2] = imx_clk_hw_fixed("sys_pll2", 1000000000); > @@ -373,7 +373,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > hws[IMX8MN_VIDEO_PLL1_BYPASS] = imx_clk_hw_mux_flags("video_pll1_bypass", base + 0x28, 16, 1, video_pll1_bypass_sels, ARRAY_SIZE(video_pll1_bypass_sels), CLK_SET_RATE_PARENT); > hws[IMX8MN_DRAM_PLL_BYPASS] = imx_clk_hw_mux_flags("dram_pll_bypass", base + 0x50, 16, 1, dram_pll_bypass_sels, ARRAY_SIZE(dram_pll_bypass_sels), CLK_SET_RATE_PARENT); > hws[IMX8MN_GPU_PLL_BYPASS] = imx_clk_hw_mux_flags("gpu_pll_bypass", base + 0x64, 28, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels), CLK_SET_RATE_PARENT); > - hws[IMX8MN_VPU_PLL_BYPASS] = imx_clk_hw_mux_flags("vpu_pll_bypass", base + 0x74, 28, 1, vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), CLK_SET_RATE_PARENT); > + hws[IMX8MN_M7_ALT_PLL_BYPASS] = imx_clk_hw_mux_flags("m7_alt_pll_bypass", base + 0x74, 28, 1, m7_alt_pll_bypass_sels, ARRAY_SIZE(m7_alt_pll_bypass_sels), CLK_SET_RATE_PARENT); > hws[IMX8MN_ARM_PLL_BYPASS] = imx_clk_hw_mux_flags("arm_pll_bypass", base + 0x84, 28, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT); > hws[IMX8MN_SYS_PLL3_BYPASS] = imx_clk_hw_mux_flags("sys_pll3_bypass", base + 0x114, 28, 1, sys_pll3_bypass_sels, ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT); > > @@ -383,7 +383,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > hws[IMX8MN_VIDEO_PLL1_OUT] = imx_clk_hw_gate("video_pll1_out", "video_pll1_bypass", base + 0x28, 13); > hws[IMX8MN_DRAM_PLL_OUT] = imx_clk_hw_gate("dram_pll_out", "dram_pll_bypass", base + 0x50, 13); > hws[IMX8MN_GPU_PLL_OUT] = imx_clk_hw_gate("gpu_pll_out", "gpu_pll_bypass", base + 0x64, 11); > - hws[IMX8MN_VPU_PLL_OUT] = imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", base + 0x74, 11); > + hws[IMX8MN_M7_ALT_PLL_OUT] = imx_clk_hw_gate("m7_alt_pll_out", "m7_alt_pll_bypass", base + 0x74, 11); > hws[IMX8MN_ARM_PLL_OUT] = imx_clk_hw_gate("arm_pll_out", "arm_pll_bypass", base + 0x84, 11); > hws[IMX8MN_SYS_PLL3_OUT] = imx_clk_hw_gate("sys_pll3_out", "sys_pll3_bypass", base + 0x114, 11); The driver changes looking good from my pov. > diff --git a/include/dt-bindings/clock/imx8mn-clock.h b/include/dt-bindings/clock/imx8mn-clock.h > index 07b8a282c268..f103b008a12a 100644 > --- a/include/dt-bindings/clock/imx8mn-clock.h > +++ b/include/dt-bindings/clock/imx8mn-clock.h > @@ -19,7 +19,7 @@ > #define IMX8MN_VIDEO_PLL1_REF_SEL 10 > #define IMX8MN_DRAM_PLL_REF_SEL 11 > #define IMX8MN_GPU_PLL_REF_SEL 12 > -#define IMX8MN_VPU_PLL_REF_SEL 13 > +#define IMX8MN_M7_ALT_PLL_REF_SEL 13 If we take backward compatibility serious we can't do that since this may break existing device trees. What you can do is: #define IMX8MN_M7_ALT_PLL_REF_SEL 13 #define IMX8MN_VPU_PLL_REF_SEL IMX8MN_M7_ALT_PLL_REF_SEL and add a comment that we need this for backward compatibility. Same applies for the below defines. Regards, Marco > #define IMX8MN_ARM_PLL_REF_SEL 14 > #define IMX8MN_SYS_PLL1_REF_SEL 15 > #define IMX8MN_SYS_PLL2_REF_SEL 16 > @@ -29,7 +29,7 @@ > #define IMX8MN_VIDEO_PLL1 20 > #define IMX8MN_DRAM_PLL 21 > #define IMX8MN_GPU_PLL 22 > -#define IMX8MN_VPU_PLL 23 > +#define IMX8MN_M7_ALT_PLL 23 > #define IMX8MN_ARM_PLL 24 > #define IMX8MN_SYS_PLL1 25 > #define IMX8MN_SYS_PLL2 26 > @@ -39,7 +39,7 @@ > #define IMX8MN_VIDEO_PLL1_BYPASS 30 > #define IMX8MN_DRAM_PLL_BYPASS 31 > #define IMX8MN_GPU_PLL_BYPASS 32 > -#define IMX8MN_VPU_PLL_BYPASS 33 > +#define IMX8MN_M7_ALT_PLL_BYPASS 33 > #define IMX8MN_ARM_PLL_BYPASS 34 > #define IMX8MN_SYS_PLL1_BYPASS 35 > #define IMX8MN_SYS_PLL2_BYPASS 36 > @@ -49,7 +49,7 @@ > #define IMX8MN_VIDEO_PLL1_OUT 40 > #define IMX8MN_DRAM_PLL_OUT 41 > #define IMX8MN_GPU_PLL_OUT 42 > -#define IMX8MN_VPU_PLL_OUT 43 > +#define IMX8MN_M7_ALT_PLL_OUT 43 > #define IMX8MN_ARM_PLL_OUT 44 > #define IMX8MN_SYS_PLL1_OUT 45 > #define IMX8MN_SYS_PLL2_OUT 46 > -- > 2.32.0 > > >
Hi Marco, On Mon, Nov 14, 2022 at 9:34 AM Marco Felsch <m.felsch@pengutronix.de> wrote: > > Hi Dario, > > On 22-11-13, Dario Binacchi wrote: > > There is no occurrence of vpu pll in the reference manual (document > > IMX8MNRM Rev 2, 07/2022). From an analysis of the code and the RM > > itself, I think vpu pll is used instead of m7 alternate pll, probably > > for copy and paste of code taken from modules of similar architectures. > > > > As an example for all, if we consider the second row of the "Clock Root" > > table of chapter 5 (Clocks and Power Management) of the RM: > > > > Clock Root offset Source Select (CCM_TARGET_ROOTn[MUX]) > > ... ... ... > > ARM_M7_CLK_ROOT 0x8080 000 - 24M_REF_CLK > > 001 - SYSTEM_PLL2_DIV5 > > 010 - SYSTEM_PLL2_DIV4 > > 011 - M7_ALT_PLL_CLK > > 100 - SYSTEM_PLL1_CLK > > 101 - AUDIO_PLL1_CLK > > 110 - VIDEO_PLL_CLK > > 111 - SYSTEM_PLL3_CLK > > ... ... ... > > > > but in the source code, the imx8mn_m7_sels clocks list contains vpu_pll > > for the source select bits 011b. > > Thanks for the real detailed description. Maybe we should mention, that > the 8MN has no VPU complex at all. > > > So, let's rename "vpu_pll" to "m7_alt_pll" to be consistent with the RM. > > > > No functional changes intended. > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > > > drivers/clk/imx/clk-imx8mn.c | 16 ++++++++-------- > > include/dt-bindings/clock/imx8mn-clock.h | 8 ++++---- > > 2 files changed, 12 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > index d37c45b676ab..72f9563a0ff6 100644 > > --- a/drivers/clk/imx/clk-imx8mn.c > > +++ b/drivers/clk/imx/clk-imx8mn.c > > @@ -30,7 +30,7 @@ static const char * const audio_pll2_bypass_sels[] = {"audio_pll2", "audio_pll2_ > > static const char * const video_pll1_bypass_sels[] = {"video_pll1", "video_pll1_ref_sel", }; > > static const char * const dram_pll_bypass_sels[] = {"dram_pll", "dram_pll_ref_sel", }; > > static const char * const gpu_pll_bypass_sels[] = {"gpu_pll", "gpu_pll_ref_sel", }; > > -static const char * const vpu_pll_bypass_sels[] = {"vpu_pll", "vpu_pll_ref_sel", }; > > +static const char * const m7_alt_pll_bypass_sels[] = {"m7_alt_pll", "m7_alt_pll_ref_sel", }; > > static const char * const arm_pll_bypass_sels[] = {"arm_pll", "arm_pll_ref_sel", }; > > static const char * const sys_pll3_bypass_sels[] = {"sys_pll3", "sys_pll3_ref_sel", }; > > > > @@ -40,7 +40,7 @@ static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl > > > > static const char * const imx8mn_a53_core_sels[] = {"arm_a53_div", "arm_pll_out", }; > > > > -static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "vpu_pll_out", > > +static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "m7_alt_pll_out", > > "sys_pll1_800m", "audio_pll1_out", "video_pll1_out", "sys_pll3_out", }; > > > > static const char * const imx8mn_gpu_core_sels[] = {"osc_24m", "gpu_pll_out", "sys_pll1_800m", > > @@ -252,10 +252,10 @@ static const char * const imx8mn_gpt6_sels[] = {"osc_24m", "sys_pll2_100m", "sys > > "audio_pll1_out", "clk_ext1", }; > > > > static const char * const imx8mn_wdog_sels[] = {"osc_24m", "sys_pll1_133m", "sys_pll1_160m", > > - "vpu_pll_out", "sys_pll2_125m", "sys_pll3_out", > > + "m7_alt_pll_out", "sys_pll2_125m", "sys_pll3_out", > > "sys_pll1_80m", "sys_pll2_166m", }; > > > > -static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "vpu_pll_out", > > +static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "m7_alt_pll_out", > > "sys_pll3_out", "sys_pll2_200m", "sys_pll1_266m", > > "sys_pll2_500m", "sys_pll1_100m", }; > > > > @@ -352,7 +352,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > hws[IMX8MN_VIDEO_PLL1_REF_SEL] = imx_clk_hw_mux("video_pll1_ref_sel", base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > hws[IMX8MN_DRAM_PLL_REF_SEL] = imx_clk_hw_mux("dram_pll_ref_sel", base + 0x50, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > hws[IMX8MN_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", base + 0x64, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > - hws[IMX8MN_VPU_PLL_REF_SEL] = imx_clk_hw_mux("vpu_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > + hws[IMX8MN_M7_ALT_PLL_REF_SEL] = imx_clk_hw_mux("m7_alt_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > hws[IMX8MN_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", base + 0x84, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > hws[IMX8MN_SYS_PLL3_REF_SEL] = imx_clk_hw_mux("sys_pll3_ref_sel", base + 0x114, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > > @@ -361,7 +361,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > hws[IMX8MN_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", base + 0x28, &imx_1443x_pll); > > hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", base + 0x50, &imx_1443x_dram_pll); > > hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", base + 0x64, &imx_1416x_pll); > > - hws[IMX8MN_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", base + 0x74, &imx_1416x_pll); > > + hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", base + 0x74, &imx_1416x_pll); > > hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", base + 0x84, &imx_1416x_pll); > > hws[IMX8MN_SYS_PLL1] = imx_clk_hw_fixed("sys_pll1", 800000000); > > hws[IMX8MN_SYS_PLL2] = imx_clk_hw_fixed("sys_pll2", 1000000000); > > @@ -373,7 +373,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > hws[IMX8MN_VIDEO_PLL1_BYPASS] = imx_clk_hw_mux_flags("video_pll1_bypass", base + 0x28, 16, 1, video_pll1_bypass_sels, ARRAY_SIZE(video_pll1_bypass_sels), CLK_SET_RATE_PARENT); > > hws[IMX8MN_DRAM_PLL_BYPASS] = imx_clk_hw_mux_flags("dram_pll_bypass", base + 0x50, 16, 1, dram_pll_bypass_sels, ARRAY_SIZE(dram_pll_bypass_sels), CLK_SET_RATE_PARENT); > > hws[IMX8MN_GPU_PLL_BYPASS] = imx_clk_hw_mux_flags("gpu_pll_bypass", base + 0x64, 28, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels), CLK_SET_RATE_PARENT); > > - hws[IMX8MN_VPU_PLL_BYPASS] = imx_clk_hw_mux_flags("vpu_pll_bypass", base + 0x74, 28, 1, vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), CLK_SET_RATE_PARENT); > > + hws[IMX8MN_M7_ALT_PLL_BYPASS] = imx_clk_hw_mux_flags("m7_alt_pll_bypass", base + 0x74, 28, 1, m7_alt_pll_bypass_sels, ARRAY_SIZE(m7_alt_pll_bypass_sels), CLK_SET_RATE_PARENT); > > hws[IMX8MN_ARM_PLL_BYPASS] = imx_clk_hw_mux_flags("arm_pll_bypass", base + 0x84, 28, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT); > > hws[IMX8MN_SYS_PLL3_BYPASS] = imx_clk_hw_mux_flags("sys_pll3_bypass", base + 0x114, 28, 1, sys_pll3_bypass_sels, ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT); > > > > @@ -383,7 +383,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > hws[IMX8MN_VIDEO_PLL1_OUT] = imx_clk_hw_gate("video_pll1_out", "video_pll1_bypass", base + 0x28, 13); > > hws[IMX8MN_DRAM_PLL_OUT] = imx_clk_hw_gate("dram_pll_out", "dram_pll_bypass", base + 0x50, 13); > > hws[IMX8MN_GPU_PLL_OUT] = imx_clk_hw_gate("gpu_pll_out", "gpu_pll_bypass", base + 0x64, 11); > > - hws[IMX8MN_VPU_PLL_OUT] = imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", base + 0x74, 11); > > + hws[IMX8MN_M7_ALT_PLL_OUT] = imx_clk_hw_gate("m7_alt_pll_out", "m7_alt_pll_bypass", base + 0x74, 11); > > hws[IMX8MN_ARM_PLL_OUT] = imx_clk_hw_gate("arm_pll_out", "arm_pll_bypass", base + 0x84, 11); > > hws[IMX8MN_SYS_PLL3_OUT] = imx_clk_hw_gate("sys_pll3_out", "sys_pll3_bypass", base + 0x114, 11); > > The driver changes looking good from my pov. > > > diff --git a/include/dt-bindings/clock/imx8mn-clock.h b/include/dt-bindings/clock/imx8mn-clock.h > > index 07b8a282c268..f103b008a12a 100644 > > --- a/include/dt-bindings/clock/imx8mn-clock.h > > +++ b/include/dt-bindings/clock/imx8mn-clock.h > > @@ -19,7 +19,7 @@ > > #define IMX8MN_VIDEO_PLL1_REF_SEL 10 > > #define IMX8MN_DRAM_PLL_REF_SEL 11 > > #define IMX8MN_GPU_PLL_REF_SEL 12 > > -#define IMX8MN_VPU_PLL_REF_SEL 13 > > +#define IMX8MN_M7_ALT_PLL_REF_SEL 13 > > If we take backward compatibility serious we can't do that since this > may break existing device trees. What you can do is: > > #define IMX8MN_M7_ALT_PLL_REF_SEL 13 > #define IMX8MN_VPU_PLL_REF_SEL IMX8MN_M7_ALT_PLL_REF_SEL > > and add a comment that we need this for backward compatibility. Same > applies for the below defines. If I run the command "git grep IMX8MN_VPU_PLL", this is the output: drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL_REF_SEL] = imx_clk_hw_mux("vpu_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", base + 0x74, &imx_1416x_pll); drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL_BYPASS] = imx_clk_hw_mux_flags("vpu_pll_bypass", base + 0x74, 28, 1, vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), CLK_SET_RATE_PARENT); drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL_OUT] = imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", base + 0x74, 11); include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL_REF_SEL 13 include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL 23 include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL_BYPASS 33 include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL_OUT 43 No device tree comes out. So can we say that backwards compatibility is guaranteed or am I missing something ? Thanks and regards, Dario > > Regards, > Marco > > > #define IMX8MN_ARM_PLL_REF_SEL 14 > > #define IMX8MN_SYS_PLL1_REF_SEL 15 > > #define IMX8MN_SYS_PLL2_REF_SEL 16 > > @@ -29,7 +29,7 @@ > > #define IMX8MN_VIDEO_PLL1 20 > > #define IMX8MN_DRAM_PLL 21 > > #define IMX8MN_GPU_PLL 22 > > -#define IMX8MN_VPU_PLL 23 > > +#define IMX8MN_M7_ALT_PLL 23 > > #define IMX8MN_ARM_PLL 24 > > #define IMX8MN_SYS_PLL1 25 > > #define IMX8MN_SYS_PLL2 26 > > @@ -39,7 +39,7 @@ > > #define IMX8MN_VIDEO_PLL1_BYPASS 30 > > #define IMX8MN_DRAM_PLL_BYPASS 31 > > #define IMX8MN_GPU_PLL_BYPASS 32 > > -#define IMX8MN_VPU_PLL_BYPASS 33 > > +#define IMX8MN_M7_ALT_PLL_BYPASS 33 > > #define IMX8MN_ARM_PLL_BYPASS 34 > > #define IMX8MN_SYS_PLL1_BYPASS 35 > > #define IMX8MN_SYS_PLL2_BYPASS 36 > > @@ -49,7 +49,7 @@ > > #define IMX8MN_VIDEO_PLL1_OUT 40 > > #define IMX8MN_DRAM_PLL_OUT 41 > > #define IMX8MN_GPU_PLL_OUT 42 > > -#define IMX8MN_VPU_PLL_OUT 43 > > +#define IMX8MN_M7_ALT_PLL_OUT 43 > > #define IMX8MN_ARM_PLL_OUT 44 > > #define IMX8MN_SYS_PLL1_OUT 45 > > #define IMX8MN_SYS_PLL2_OUT 46 > > -- > > 2.32.0 > > > > > >
Hi Dario, On 22-11-14, Dario Binacchi wrote: > Hi Marco, > > On Mon, Nov 14, 2022 at 9:34 AM Marco Felsch <m.felsch@pengutronix.de> wrote: > > > > Hi Dario, > > > > On 22-11-13, Dario Binacchi wrote: > > > There is no occurrence of vpu pll in the reference manual (document > > > IMX8MNRM Rev 2, 07/2022). From an analysis of the code and the RM > > > itself, I think vpu pll is used instead of m7 alternate pll, probably > > > for copy and paste of code taken from modules of similar architectures. > > > > > > As an example for all, if we consider the second row of the "Clock Root" > > > table of chapter 5 (Clocks and Power Management) of the RM: > > > > > > Clock Root offset Source Select (CCM_TARGET_ROOTn[MUX]) > > > ... ... ... > > > ARM_M7_CLK_ROOT 0x8080 000 - 24M_REF_CLK > > > 001 - SYSTEM_PLL2_DIV5 > > > 010 - SYSTEM_PLL2_DIV4 > > > 011 - M7_ALT_PLL_CLK > > > 100 - SYSTEM_PLL1_CLK > > > 101 - AUDIO_PLL1_CLK > > > 110 - VIDEO_PLL_CLK > > > 111 - SYSTEM_PLL3_CLK > > > ... ... ... > > > > > > but in the source code, the imx8mn_m7_sels clocks list contains vpu_pll > > > for the source select bits 011b. > > > > Thanks for the real detailed description. Maybe we should mention, that > > the 8MN has no VPU complex at all. > > > > > So, let's rename "vpu_pll" to "m7_alt_pll" to be consistent with the RM. > > > > > > No functional changes intended. > > > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > --- > > > > > > drivers/clk/imx/clk-imx8mn.c | 16 ++++++++-------- > > > include/dt-bindings/clock/imx8mn-clock.h | 8 ++++---- > > > 2 files changed, 12 insertions(+), 12 deletions(-) > > > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > > index d37c45b676ab..72f9563a0ff6 100644 > > > --- a/drivers/clk/imx/clk-imx8mn.c > > > +++ b/drivers/clk/imx/clk-imx8mn.c > > > @@ -30,7 +30,7 @@ static const char * const audio_pll2_bypass_sels[] = {"audio_pll2", "audio_pll2_ > > > static const char * const video_pll1_bypass_sels[] = {"video_pll1", "video_pll1_ref_sel", }; > > > static const char * const dram_pll_bypass_sels[] = {"dram_pll", "dram_pll_ref_sel", }; > > > static const char * const gpu_pll_bypass_sels[] = {"gpu_pll", "gpu_pll_ref_sel", }; > > > -static const char * const vpu_pll_bypass_sels[] = {"vpu_pll", "vpu_pll_ref_sel", }; > > > +static const char * const m7_alt_pll_bypass_sels[] = {"m7_alt_pll", "m7_alt_pll_ref_sel", }; > > > static const char * const arm_pll_bypass_sels[] = {"arm_pll", "arm_pll_ref_sel", }; > > > static const char * const sys_pll3_bypass_sels[] = {"sys_pll3", "sys_pll3_ref_sel", }; > > > > > > @@ -40,7 +40,7 @@ static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl > > > > > > static const char * const imx8mn_a53_core_sels[] = {"arm_a53_div", "arm_pll_out", }; > > > > > > -static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "vpu_pll_out", > > > +static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "m7_alt_pll_out", > > > "sys_pll1_800m", "audio_pll1_out", "video_pll1_out", "sys_pll3_out", }; > > > > > > static const char * const imx8mn_gpu_core_sels[] = {"osc_24m", "gpu_pll_out", "sys_pll1_800m", > > > @@ -252,10 +252,10 @@ static const char * const imx8mn_gpt6_sels[] = {"osc_24m", "sys_pll2_100m", "sys > > > "audio_pll1_out", "clk_ext1", }; > > > > > > static const char * const imx8mn_wdog_sels[] = {"osc_24m", "sys_pll1_133m", "sys_pll1_160m", > > > - "vpu_pll_out", "sys_pll2_125m", "sys_pll3_out", > > > + "m7_alt_pll_out", "sys_pll2_125m", "sys_pll3_out", > > > "sys_pll1_80m", "sys_pll2_166m", }; > > > > > > -static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "vpu_pll_out", > > > +static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "m7_alt_pll_out", > > > "sys_pll3_out", "sys_pll2_200m", "sys_pll1_266m", > > > "sys_pll2_500m", "sys_pll1_100m", }; > > > > > > @@ -352,7 +352,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > > hws[IMX8MN_VIDEO_PLL1_REF_SEL] = imx_clk_hw_mux("video_pll1_ref_sel", base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > hws[IMX8MN_DRAM_PLL_REF_SEL] = imx_clk_hw_mux("dram_pll_ref_sel", base + 0x50, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > hws[IMX8MN_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", base + 0x64, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > - hws[IMX8MN_VPU_PLL_REF_SEL] = imx_clk_hw_mux("vpu_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > + hws[IMX8MN_M7_ALT_PLL_REF_SEL] = imx_clk_hw_mux("m7_alt_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > hws[IMX8MN_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", base + 0x84, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > hws[IMX8MN_SYS_PLL3_REF_SEL] = imx_clk_hw_mux("sys_pll3_ref_sel", base + 0x114, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > > > > @@ -361,7 +361,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > > hws[IMX8MN_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", base + 0x28, &imx_1443x_pll); > > > hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", base + 0x50, &imx_1443x_dram_pll); > > > hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", base + 0x64, &imx_1416x_pll); > > > - hws[IMX8MN_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", base + 0x74, &imx_1416x_pll); > > > + hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", base + 0x74, &imx_1416x_pll); > > > hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", base + 0x84, &imx_1416x_pll); > > > hws[IMX8MN_SYS_PLL1] = imx_clk_hw_fixed("sys_pll1", 800000000); > > > hws[IMX8MN_SYS_PLL2] = imx_clk_hw_fixed("sys_pll2", 1000000000); > > > @@ -373,7 +373,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > > hws[IMX8MN_VIDEO_PLL1_BYPASS] = imx_clk_hw_mux_flags("video_pll1_bypass", base + 0x28, 16, 1, video_pll1_bypass_sels, ARRAY_SIZE(video_pll1_bypass_sels), CLK_SET_RATE_PARENT); > > > hws[IMX8MN_DRAM_PLL_BYPASS] = imx_clk_hw_mux_flags("dram_pll_bypass", base + 0x50, 16, 1, dram_pll_bypass_sels, ARRAY_SIZE(dram_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > hws[IMX8MN_GPU_PLL_BYPASS] = imx_clk_hw_mux_flags("gpu_pll_bypass", base + 0x64, 28, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > - hws[IMX8MN_VPU_PLL_BYPASS] = imx_clk_hw_mux_flags("vpu_pll_bypass", base + 0x74, 28, 1, vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > + hws[IMX8MN_M7_ALT_PLL_BYPASS] = imx_clk_hw_mux_flags("m7_alt_pll_bypass", base + 0x74, 28, 1, m7_alt_pll_bypass_sels, ARRAY_SIZE(m7_alt_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > hws[IMX8MN_ARM_PLL_BYPASS] = imx_clk_hw_mux_flags("arm_pll_bypass", base + 0x84, 28, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > hws[IMX8MN_SYS_PLL3_BYPASS] = imx_clk_hw_mux_flags("sys_pll3_bypass", base + 0x114, 28, 1, sys_pll3_bypass_sels, ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT); > > > > > > @@ -383,7 +383,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > > hws[IMX8MN_VIDEO_PLL1_OUT] = imx_clk_hw_gate("video_pll1_out", "video_pll1_bypass", base + 0x28, 13); > > > hws[IMX8MN_DRAM_PLL_OUT] = imx_clk_hw_gate("dram_pll_out", "dram_pll_bypass", base + 0x50, 13); > > > hws[IMX8MN_GPU_PLL_OUT] = imx_clk_hw_gate("gpu_pll_out", "gpu_pll_bypass", base + 0x64, 11); > > > - hws[IMX8MN_VPU_PLL_OUT] = imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", base + 0x74, 11); > > > + hws[IMX8MN_M7_ALT_PLL_OUT] = imx_clk_hw_gate("m7_alt_pll_out", "m7_alt_pll_bypass", base + 0x74, 11); > > > hws[IMX8MN_ARM_PLL_OUT] = imx_clk_hw_gate("arm_pll_out", "arm_pll_bypass", base + 0x84, 11); > > > hws[IMX8MN_SYS_PLL3_OUT] = imx_clk_hw_gate("sys_pll3_out", "sys_pll3_bypass", base + 0x114, 11); > > > > The driver changes looking good from my pov. > > > > > diff --git a/include/dt-bindings/clock/imx8mn-clock.h b/include/dt-bindings/clock/imx8mn-clock.h > > > index 07b8a282c268..f103b008a12a 100644 > > > --- a/include/dt-bindings/clock/imx8mn-clock.h > > > +++ b/include/dt-bindings/clock/imx8mn-clock.h > > > @@ -19,7 +19,7 @@ > > > #define IMX8MN_VIDEO_PLL1_REF_SEL 10 > > > #define IMX8MN_DRAM_PLL_REF_SEL 11 > > > #define IMX8MN_GPU_PLL_REF_SEL 12 > > > -#define IMX8MN_VPU_PLL_REF_SEL 13 > > > +#define IMX8MN_M7_ALT_PLL_REF_SEL 13 > > > > If we take backward compatibility serious we can't do that since this > > may break existing device trees. What you can do is: > > > > #define IMX8MN_M7_ALT_PLL_REF_SEL 13 > > #define IMX8MN_VPU_PLL_REF_SEL IMX8MN_M7_ALT_PLL_REF_SEL > > > > and add a comment that we need this for backward compatibility. Same > > applies for the below defines. > > If I run the command "git grep IMX8MN_VPU_PLL", this is the output: > drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL_REF_SEL] = > imx_clk_hw_mux("vpu_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, > ARRAY_SIZE(pll_ref_sels)); > drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL] = > imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", base + 0x74, > &imx_1416x_pll); > drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL_BYPASS] = > imx_clk_hw_mux_flags("vpu_pll_bypass", base + 0x74, 28, 1, > vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), > CLK_SET_RATE_PARENT); > drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL_OUT] = > imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", base + 0x74, 11); > include/dt-bindings/clock/imx8mn-clock.h:#define > IMX8MN_VPU_PLL_REF_SEL 13 > include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL > 23 > include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL_BYPASS > 33 > include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL_OUT > 43 > > No device tree comes out. > So can we say that backwards compatibility is guaranteed or am I > missing something ? This depends on the maintainer POV since it is unfortunately quite usual to not have the DTS files within the kernel repo. Also bootloaders may use these defines. Regards, Marco > Thanks and regards, > Dario > > > > > Regards, > > Marco > > > > > #define IMX8MN_ARM_PLL_REF_SEL 14 > > > #define IMX8MN_SYS_PLL1_REF_SEL 15 > > > #define IMX8MN_SYS_PLL2_REF_SEL 16 > > > @@ -29,7 +29,7 @@ > > > #define IMX8MN_VIDEO_PLL1 20 > > > #define IMX8MN_DRAM_PLL 21 > > > #define IMX8MN_GPU_PLL 22 > > > -#define IMX8MN_VPU_PLL 23 > > > +#define IMX8MN_M7_ALT_PLL 23 > > > #define IMX8MN_ARM_PLL 24 > > > #define IMX8MN_SYS_PLL1 25 > > > #define IMX8MN_SYS_PLL2 26 > > > @@ -39,7 +39,7 @@ > > > #define IMX8MN_VIDEO_PLL1_BYPASS 30 > > > #define IMX8MN_DRAM_PLL_BYPASS 31 > > > #define IMX8MN_GPU_PLL_BYPASS 32 > > > -#define IMX8MN_VPU_PLL_BYPASS 33 > > > +#define IMX8MN_M7_ALT_PLL_BYPASS 33 > > > #define IMX8MN_ARM_PLL_BYPASS 34 > > > #define IMX8MN_SYS_PLL1_BYPASS 35 > > > #define IMX8MN_SYS_PLL2_BYPASS 36 > > > @@ -49,7 +49,7 @@ > > > #define IMX8MN_VIDEO_PLL1_OUT 40 > > > #define IMX8MN_DRAM_PLL_OUT 41 > > > #define IMX8MN_GPU_PLL_OUT 42 > > > -#define IMX8MN_VPU_PLL_OUT 43 > > > +#define IMX8MN_M7_ALT_PLL_OUT 43 > > > #define IMX8MN_ARM_PLL_OUT 44 > > > #define IMX8MN_SYS_PLL1_OUT 45 > > > #define IMX8MN_SYS_PLL2_OUT 46 > > > -- > > > 2.32.0 > > > > > > > > > > > > > -- > > Dario Binacchi > > Embedded Linux Developer > > dario.binacchi@amarulasolutions.com > > __________________________________ > > > Amarula Solutions SRL > > Via Le Canevare 30, 31100 Treviso, Veneto, IT > > T. +39 042 243 5310 > info@amarulasolutions.com > > www.amarulasolutions.com >
On 22-11-14 19:22:02, Marco Felsch wrote: > Hi Dario, > > On 22-11-14, Dario Binacchi wrote: > > Hi Marco, > > > > On Mon, Nov 14, 2022 at 9:34 AM Marco Felsch <m.felsch@pengutronix.de> wrote: > > > > > > Hi Dario, > > > > > > On 22-11-13, Dario Binacchi wrote: > > > > There is no occurrence of vpu pll in the reference manual (document > > > > IMX8MNRM Rev 2, 07/2022). From an analysis of the code and the RM > > > > itself, I think vpu pll is used instead of m7 alternate pll, probably > > > > for copy and paste of code taken from modules of similar architectures. > > > > > > > > As an example for all, if we consider the second row of the "Clock Root" > > > > table of chapter 5 (Clocks and Power Management) of the RM: > > > > > > > > Clock Root offset Source Select (CCM_TARGET_ROOTn[MUX]) > > > > ... ... ... > > > > ARM_M7_CLK_ROOT 0x8080 000 - 24M_REF_CLK > > > > 001 - SYSTEM_PLL2_DIV5 > > > > 010 - SYSTEM_PLL2_DIV4 > > > > 011 - M7_ALT_PLL_CLK > > > > 100 - SYSTEM_PLL1_CLK > > > > 101 - AUDIO_PLL1_CLK > > > > 110 - VIDEO_PLL_CLK > > > > 111 - SYSTEM_PLL3_CLK > > > > ... ... ... > > > > > > > > but in the source code, the imx8mn_m7_sels clocks list contains vpu_pll > > > > for the source select bits 011b. > > > > > > Thanks for the real detailed description. Maybe we should mention, that > > > the 8MN has no VPU complex at all. > > > > > > > So, let's rename "vpu_pll" to "m7_alt_pll" to be consistent with the RM. > > > > > > > > No functional changes intended. > > > > > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > > --- > > > > > > > > drivers/clk/imx/clk-imx8mn.c | 16 ++++++++-------- > > > > include/dt-bindings/clock/imx8mn-clock.h | 8 ++++---- > > > > 2 files changed, 12 insertions(+), 12 deletions(-) > > > > > > > > diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c > > > > index d37c45b676ab..72f9563a0ff6 100644 > > > > --- a/drivers/clk/imx/clk-imx8mn.c > > > > +++ b/drivers/clk/imx/clk-imx8mn.c > > > > @@ -30,7 +30,7 @@ static const char * const audio_pll2_bypass_sels[] = {"audio_pll2", "audio_pll2_ > > > > static const char * const video_pll1_bypass_sels[] = {"video_pll1", "video_pll1_ref_sel", }; > > > > static const char * const dram_pll_bypass_sels[] = {"dram_pll", "dram_pll_ref_sel", }; > > > > static const char * const gpu_pll_bypass_sels[] = {"gpu_pll", "gpu_pll_ref_sel", }; > > > > -static const char * const vpu_pll_bypass_sels[] = {"vpu_pll", "vpu_pll_ref_sel", }; > > > > +static const char * const m7_alt_pll_bypass_sels[] = {"m7_alt_pll", "m7_alt_pll_ref_sel", }; > > > > static const char * const arm_pll_bypass_sels[] = {"arm_pll", "arm_pll_ref_sel", }; > > > > static const char * const sys_pll3_bypass_sels[] = {"sys_pll3", "sys_pll3_ref_sel", }; > > > > > > > > @@ -40,7 +40,7 @@ static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl > > > > > > > > static const char * const imx8mn_a53_core_sels[] = {"arm_a53_div", "arm_pll_out", }; > > > > > > > > -static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "vpu_pll_out", > > > > +static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "m7_alt_pll_out", > > > > "sys_pll1_800m", "audio_pll1_out", "video_pll1_out", "sys_pll3_out", }; > > > > > > > > static const char * const imx8mn_gpu_core_sels[] = {"osc_24m", "gpu_pll_out", "sys_pll1_800m", > > > > @@ -252,10 +252,10 @@ static const char * const imx8mn_gpt6_sels[] = {"osc_24m", "sys_pll2_100m", "sys > > > > "audio_pll1_out", "clk_ext1", }; > > > > > > > > static const char * const imx8mn_wdog_sels[] = {"osc_24m", "sys_pll1_133m", "sys_pll1_160m", > > > > - "vpu_pll_out", "sys_pll2_125m", "sys_pll3_out", > > > > + "m7_alt_pll_out", "sys_pll2_125m", "sys_pll3_out", > > > > "sys_pll1_80m", "sys_pll2_166m", }; > > > > > > > > -static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "vpu_pll_out", > > > > +static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "m7_alt_pll_out", > > > > "sys_pll3_out", "sys_pll2_200m", "sys_pll1_266m", > > > > "sys_pll2_500m", "sys_pll1_100m", }; > > > > > > > > @@ -352,7 +352,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > > > hws[IMX8MN_VIDEO_PLL1_REF_SEL] = imx_clk_hw_mux("video_pll1_ref_sel", base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > > hws[IMX8MN_DRAM_PLL_REF_SEL] = imx_clk_hw_mux("dram_pll_ref_sel", base + 0x50, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > > hws[IMX8MN_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", base + 0x64, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > > - hws[IMX8MN_VPU_PLL_REF_SEL] = imx_clk_hw_mux("vpu_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > > + hws[IMX8MN_M7_ALT_PLL_REF_SEL] = imx_clk_hw_mux("m7_alt_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > > hws[IMX8MN_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", base + 0x84, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > > hws[IMX8MN_SYS_PLL3_REF_SEL] = imx_clk_hw_mux("sys_pll3_ref_sel", base + 0x114, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); > > > > > > > > @@ -361,7 +361,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > > > hws[IMX8MN_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", base + 0x28, &imx_1443x_pll); > > > > hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", base + 0x50, &imx_1443x_dram_pll); > > > > hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", base + 0x64, &imx_1416x_pll); > > > > - hws[IMX8MN_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", base + 0x74, &imx_1416x_pll); > > > > + hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", base + 0x74, &imx_1416x_pll); > > > > hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", base + 0x84, &imx_1416x_pll); > > > > hws[IMX8MN_SYS_PLL1] = imx_clk_hw_fixed("sys_pll1", 800000000); > > > > hws[IMX8MN_SYS_PLL2] = imx_clk_hw_fixed("sys_pll2", 1000000000); > > > > @@ -373,7 +373,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > > > hws[IMX8MN_VIDEO_PLL1_BYPASS] = imx_clk_hw_mux_flags("video_pll1_bypass", base + 0x28, 16, 1, video_pll1_bypass_sels, ARRAY_SIZE(video_pll1_bypass_sels), CLK_SET_RATE_PARENT); > > > > hws[IMX8MN_DRAM_PLL_BYPASS] = imx_clk_hw_mux_flags("dram_pll_bypass", base + 0x50, 16, 1, dram_pll_bypass_sels, ARRAY_SIZE(dram_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > > hws[IMX8MN_GPU_PLL_BYPASS] = imx_clk_hw_mux_flags("gpu_pll_bypass", base + 0x64, 28, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > > - hws[IMX8MN_VPU_PLL_BYPASS] = imx_clk_hw_mux_flags("vpu_pll_bypass", base + 0x74, 28, 1, vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > > + hws[IMX8MN_M7_ALT_PLL_BYPASS] = imx_clk_hw_mux_flags("m7_alt_pll_bypass", base + 0x74, 28, 1, m7_alt_pll_bypass_sels, ARRAY_SIZE(m7_alt_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > > hws[IMX8MN_ARM_PLL_BYPASS] = imx_clk_hw_mux_flags("arm_pll_bypass", base + 0x84, 28, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT); > > > > hws[IMX8MN_SYS_PLL3_BYPASS] = imx_clk_hw_mux_flags("sys_pll3_bypass", base + 0x114, 28, 1, sys_pll3_bypass_sels, ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT); > > > > > > > > @@ -383,7 +383,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) > > > > hws[IMX8MN_VIDEO_PLL1_OUT] = imx_clk_hw_gate("video_pll1_out", "video_pll1_bypass", base + 0x28, 13); > > > > hws[IMX8MN_DRAM_PLL_OUT] = imx_clk_hw_gate("dram_pll_out", "dram_pll_bypass", base + 0x50, 13); > > > > hws[IMX8MN_GPU_PLL_OUT] = imx_clk_hw_gate("gpu_pll_out", "gpu_pll_bypass", base + 0x64, 11); > > > > - hws[IMX8MN_VPU_PLL_OUT] = imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", base + 0x74, 11); > > > > + hws[IMX8MN_M7_ALT_PLL_OUT] = imx_clk_hw_gate("m7_alt_pll_out", "m7_alt_pll_bypass", base + 0x74, 11); > > > > hws[IMX8MN_ARM_PLL_OUT] = imx_clk_hw_gate("arm_pll_out", "arm_pll_bypass", base + 0x84, 11); > > > > hws[IMX8MN_SYS_PLL3_OUT] = imx_clk_hw_gate("sys_pll3_out", "sys_pll3_bypass", base + 0x114, 11); > > > > > > The driver changes looking good from my pov. > > > > > > > diff --git a/include/dt-bindings/clock/imx8mn-clock.h b/include/dt-bindings/clock/imx8mn-clock.h > > > > index 07b8a282c268..f103b008a12a 100644 > > > > --- a/include/dt-bindings/clock/imx8mn-clock.h > > > > +++ b/include/dt-bindings/clock/imx8mn-clock.h > > > > @@ -19,7 +19,7 @@ > > > > #define IMX8MN_VIDEO_PLL1_REF_SEL 10 > > > > #define IMX8MN_DRAM_PLL_REF_SEL 11 > > > > #define IMX8MN_GPU_PLL_REF_SEL 12 > > > > -#define IMX8MN_VPU_PLL_REF_SEL 13 > > > > +#define IMX8MN_M7_ALT_PLL_REF_SEL 13 > > > > > > If we take backward compatibility serious we can't do that since this > > > may break existing device trees. What you can do is: > > > > > > #define IMX8MN_M7_ALT_PLL_REF_SEL 13 > > > #define IMX8MN_VPU_PLL_REF_SEL IMX8MN_M7_ALT_PLL_REF_SEL > > > > > > and add a comment that we need this for backward compatibility. Same > > > applies for the below defines. > > > > If I run the command "git grep IMX8MN_VPU_PLL", this is the output: > > drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL_REF_SEL] = > > imx_clk_hw_mux("vpu_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, > > ARRAY_SIZE(pll_ref_sels)); > > drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL] = > > imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", base + 0x74, > > &imx_1416x_pll); > > drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL_BYPASS] = > > imx_clk_hw_mux_flags("vpu_pll_bypass", base + 0x74, 28, 1, > > vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), > > CLK_SET_RATE_PARENT); > > drivers/clk/imx/clk-imx8mn.c: hws[IMX8MN_VPU_PLL_OUT] = > > imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", base + 0x74, 11); > > include/dt-bindings/clock/imx8mn-clock.h:#define > > IMX8MN_VPU_PLL_REF_SEL 13 > > include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL > > 23 > > include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL_BYPASS > > 33 > > include/dt-bindings/clock/imx8mn-clock.h:#define IMX8MN_VPU_PLL_OUT > > 43 > > > > No device tree comes out. > > So can we say that backwards compatibility is guaranteed or am I > > missing something ? > > This depends on the maintainer POV since it is unfortunately quite usual > to not have the DTS files within the kernel repo. Also bootloaders may > use these defines. > Yep, Marco is right. Please do it like he mentioned above. Thanks, Abel > Regards, > Marco > > > Thanks and regards, > > Dario > > > > > > > > Regards, > > > Marco > > > > > > > #define IMX8MN_ARM_PLL_REF_SEL 14 > > > > #define IMX8MN_SYS_PLL1_REF_SEL 15 > > > > #define IMX8MN_SYS_PLL2_REF_SEL 16 > > > > @@ -29,7 +29,7 @@ > > > > #define IMX8MN_VIDEO_PLL1 20 > > > > #define IMX8MN_DRAM_PLL 21 > > > > #define IMX8MN_GPU_PLL 22 > > > > -#define IMX8MN_VPU_PLL 23 > > > > +#define IMX8MN_M7_ALT_PLL 23 > > > > #define IMX8MN_ARM_PLL 24 > > > > #define IMX8MN_SYS_PLL1 25 > > > > #define IMX8MN_SYS_PLL2 26 > > > > @@ -39,7 +39,7 @@ > > > > #define IMX8MN_VIDEO_PLL1_BYPASS 30 > > > > #define IMX8MN_DRAM_PLL_BYPASS 31 > > > > #define IMX8MN_GPU_PLL_BYPASS 32 > > > > -#define IMX8MN_VPU_PLL_BYPASS 33 > > > > +#define IMX8MN_M7_ALT_PLL_BYPASS 33 > > > > #define IMX8MN_ARM_PLL_BYPASS 34 > > > > #define IMX8MN_SYS_PLL1_BYPASS 35 > > > > #define IMX8MN_SYS_PLL2_BYPASS 36 > > > > @@ -49,7 +49,7 @@ > > > > #define IMX8MN_VIDEO_PLL1_OUT 40 > > > > #define IMX8MN_DRAM_PLL_OUT 41 > > > > #define IMX8MN_GPU_PLL_OUT 42 > > > > -#define IMX8MN_VPU_PLL_OUT 43 > > > > +#define IMX8MN_M7_ALT_PLL_OUT 43 > > > > #define IMX8MN_ARM_PLL_OUT 44 > > > > #define IMX8MN_SYS_PLL1_OUT 45 > > > > #define IMX8MN_SYS_PLL2_OUT 46 > > > > -- > > > > 2.32.0 > > > > > > > > > > > > > > > > > > > > -- > > > > Dario Binacchi > > > > Embedded Linux Developer > > > > dario.binacchi@amarulasolutions.com > > > > __________________________________ > > > > > > Amarula Solutions SRL > > > > Via Le Canevare 30, 31100 Treviso, Veneto, IT > > > > T. +39 042 243 5310 > > info@amarulasolutions.com > > > > www.amarulasolutions.com > >
diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index d37c45b676ab..72f9563a0ff6 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -30,7 +30,7 @@ static const char * const audio_pll2_bypass_sels[] = {"audio_pll2", "audio_pll2_ static const char * const video_pll1_bypass_sels[] = {"video_pll1", "video_pll1_ref_sel", }; static const char * const dram_pll_bypass_sels[] = {"dram_pll", "dram_pll_ref_sel", }; static const char * const gpu_pll_bypass_sels[] = {"gpu_pll", "gpu_pll_ref_sel", }; -static const char * const vpu_pll_bypass_sels[] = {"vpu_pll", "vpu_pll_ref_sel", }; +static const char * const m7_alt_pll_bypass_sels[] = {"m7_alt_pll", "m7_alt_pll_ref_sel", }; static const char * const arm_pll_bypass_sels[] = {"arm_pll", "arm_pll_ref_sel", }; static const char * const sys_pll3_bypass_sels[] = {"sys_pll3", "sys_pll3_ref_sel", }; @@ -40,7 +40,7 @@ static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl static const char * const imx8mn_a53_core_sels[] = {"arm_a53_div", "arm_pll_out", }; -static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "vpu_pll_out", +static const char * const imx8mn_m7_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll2_250m", "m7_alt_pll_out", "sys_pll1_800m", "audio_pll1_out", "video_pll1_out", "sys_pll3_out", }; static const char * const imx8mn_gpu_core_sels[] = {"osc_24m", "gpu_pll_out", "sys_pll1_800m", @@ -252,10 +252,10 @@ static const char * const imx8mn_gpt6_sels[] = {"osc_24m", "sys_pll2_100m", "sys "audio_pll1_out", "clk_ext1", }; static const char * const imx8mn_wdog_sels[] = {"osc_24m", "sys_pll1_133m", "sys_pll1_160m", - "vpu_pll_out", "sys_pll2_125m", "sys_pll3_out", + "m7_alt_pll_out", "sys_pll2_125m", "sys_pll3_out", "sys_pll1_80m", "sys_pll2_166m", }; -static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "vpu_pll_out", +static const char * const imx8mn_wrclk_sels[] = {"osc_24m", "sys_pll1_40m", "m7_alt_pll_out", "sys_pll3_out", "sys_pll2_200m", "sys_pll1_266m", "sys_pll2_500m", "sys_pll1_100m", }; @@ -352,7 +352,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_VIDEO_PLL1_REF_SEL] = imx_clk_hw_mux("video_pll1_ref_sel", base + 0x28, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MN_DRAM_PLL_REF_SEL] = imx_clk_hw_mux("dram_pll_ref_sel", base + 0x50, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MN_GPU_PLL_REF_SEL] = imx_clk_hw_mux("gpu_pll_ref_sel", base + 0x64, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); - hws[IMX8MN_VPU_PLL_REF_SEL] = imx_clk_hw_mux("vpu_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); + hws[IMX8MN_M7_ALT_PLL_REF_SEL] = imx_clk_hw_mux("m7_alt_pll_ref_sel", base + 0x74, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MN_ARM_PLL_REF_SEL] = imx_clk_hw_mux("arm_pll_ref_sel", base + 0x84, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); hws[IMX8MN_SYS_PLL3_REF_SEL] = imx_clk_hw_mux("sys_pll3_ref_sel", base + 0x114, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels)); @@ -361,7 +361,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_VIDEO_PLL1] = imx_clk_hw_pll14xx("video_pll1", "video_pll1_ref_sel", base + 0x28, &imx_1443x_pll); hws[IMX8MN_DRAM_PLL] = imx_clk_hw_pll14xx("dram_pll", "dram_pll_ref_sel", base + 0x50, &imx_1443x_dram_pll); hws[IMX8MN_GPU_PLL] = imx_clk_hw_pll14xx("gpu_pll", "gpu_pll_ref_sel", base + 0x64, &imx_1416x_pll); - hws[IMX8MN_VPU_PLL] = imx_clk_hw_pll14xx("vpu_pll", "vpu_pll_ref_sel", base + 0x74, &imx_1416x_pll); + hws[IMX8MN_M7_ALT_PLL] = imx_clk_hw_pll14xx("m7_alt_pll", "m7_alt_pll_ref_sel", base + 0x74, &imx_1416x_pll); hws[IMX8MN_ARM_PLL] = imx_clk_hw_pll14xx("arm_pll", "arm_pll_ref_sel", base + 0x84, &imx_1416x_pll); hws[IMX8MN_SYS_PLL1] = imx_clk_hw_fixed("sys_pll1", 800000000); hws[IMX8MN_SYS_PLL2] = imx_clk_hw_fixed("sys_pll2", 1000000000); @@ -373,7 +373,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_VIDEO_PLL1_BYPASS] = imx_clk_hw_mux_flags("video_pll1_bypass", base + 0x28, 16, 1, video_pll1_bypass_sels, ARRAY_SIZE(video_pll1_bypass_sels), CLK_SET_RATE_PARENT); hws[IMX8MN_DRAM_PLL_BYPASS] = imx_clk_hw_mux_flags("dram_pll_bypass", base + 0x50, 16, 1, dram_pll_bypass_sels, ARRAY_SIZE(dram_pll_bypass_sels), CLK_SET_RATE_PARENT); hws[IMX8MN_GPU_PLL_BYPASS] = imx_clk_hw_mux_flags("gpu_pll_bypass", base + 0x64, 28, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels), CLK_SET_RATE_PARENT); - hws[IMX8MN_VPU_PLL_BYPASS] = imx_clk_hw_mux_flags("vpu_pll_bypass", base + 0x74, 28, 1, vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels), CLK_SET_RATE_PARENT); + hws[IMX8MN_M7_ALT_PLL_BYPASS] = imx_clk_hw_mux_flags("m7_alt_pll_bypass", base + 0x74, 28, 1, m7_alt_pll_bypass_sels, ARRAY_SIZE(m7_alt_pll_bypass_sels), CLK_SET_RATE_PARENT); hws[IMX8MN_ARM_PLL_BYPASS] = imx_clk_hw_mux_flags("arm_pll_bypass", base + 0x84, 28, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT); hws[IMX8MN_SYS_PLL3_BYPASS] = imx_clk_hw_mux_flags("sys_pll3_bypass", base + 0x114, 28, 1, sys_pll3_bypass_sels, ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT); @@ -383,7 +383,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_VIDEO_PLL1_OUT] = imx_clk_hw_gate("video_pll1_out", "video_pll1_bypass", base + 0x28, 13); hws[IMX8MN_DRAM_PLL_OUT] = imx_clk_hw_gate("dram_pll_out", "dram_pll_bypass", base + 0x50, 13); hws[IMX8MN_GPU_PLL_OUT] = imx_clk_hw_gate("gpu_pll_out", "gpu_pll_bypass", base + 0x64, 11); - hws[IMX8MN_VPU_PLL_OUT] = imx_clk_hw_gate("vpu_pll_out", "vpu_pll_bypass", base + 0x74, 11); + hws[IMX8MN_M7_ALT_PLL_OUT] = imx_clk_hw_gate("m7_alt_pll_out", "m7_alt_pll_bypass", base + 0x74, 11); hws[IMX8MN_ARM_PLL_OUT] = imx_clk_hw_gate("arm_pll_out", "arm_pll_bypass", base + 0x84, 11); hws[IMX8MN_SYS_PLL3_OUT] = imx_clk_hw_gate("sys_pll3_out", "sys_pll3_bypass", base + 0x114, 11); diff --git a/include/dt-bindings/clock/imx8mn-clock.h b/include/dt-bindings/clock/imx8mn-clock.h index 07b8a282c268..f103b008a12a 100644 --- a/include/dt-bindings/clock/imx8mn-clock.h +++ b/include/dt-bindings/clock/imx8mn-clock.h @@ -19,7 +19,7 @@ #define IMX8MN_VIDEO_PLL1_REF_SEL 10 #define IMX8MN_DRAM_PLL_REF_SEL 11 #define IMX8MN_GPU_PLL_REF_SEL 12 -#define IMX8MN_VPU_PLL_REF_SEL 13 +#define IMX8MN_M7_ALT_PLL_REF_SEL 13 #define IMX8MN_ARM_PLL_REF_SEL 14 #define IMX8MN_SYS_PLL1_REF_SEL 15 #define IMX8MN_SYS_PLL2_REF_SEL 16 @@ -29,7 +29,7 @@ #define IMX8MN_VIDEO_PLL1 20 #define IMX8MN_DRAM_PLL 21 #define IMX8MN_GPU_PLL 22 -#define IMX8MN_VPU_PLL 23 +#define IMX8MN_M7_ALT_PLL 23 #define IMX8MN_ARM_PLL 24 #define IMX8MN_SYS_PLL1 25 #define IMX8MN_SYS_PLL2 26 @@ -39,7 +39,7 @@ #define IMX8MN_VIDEO_PLL1_BYPASS 30 #define IMX8MN_DRAM_PLL_BYPASS 31 #define IMX8MN_GPU_PLL_BYPASS 32 -#define IMX8MN_VPU_PLL_BYPASS 33 +#define IMX8MN_M7_ALT_PLL_BYPASS 33 #define IMX8MN_ARM_PLL_BYPASS 34 #define IMX8MN_SYS_PLL1_BYPASS 35 #define IMX8MN_SYS_PLL2_BYPASS 36 @@ -49,7 +49,7 @@ #define IMX8MN_VIDEO_PLL1_OUT 40 #define IMX8MN_DRAM_PLL_OUT 41 #define IMX8MN_GPU_PLL_OUT 42 -#define IMX8MN_VPU_PLL_OUT 43 +#define IMX8MN_M7_ALT_PLL_OUT 43 #define IMX8MN_ARM_PLL_OUT 44 #define IMX8MN_SYS_PLL1_OUT 45 #define IMX8MN_SYS_PLL2_OUT 46