All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leonard Crestez <leonard.crestez@nxp.com>
To: Peng Fan <peng.fan@nxp.com>, "shawnguo@kernel.org" <shawnguo@kernel.org>
Cc: "sboyd@kernel.org" <sboyd@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	Abel Vesa <abel.vesa@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Anson Huang <anson.huang@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>
Subject: Re: [PATCH V3 2/4] clk: imx: imx8mq: use imx8m_clk_hw_composite_core
Date: Mon, 27 Jan 2020 20:33:10 +0000	[thread overview]
Message-ID: <VI1PR04MB7023DD8E3D07543FB8F5CD50EE0B0@VI1PR04MB7023.eurprd04.prod.outlook.com> (raw)
In-Reply-To: AM0PR04MB4481A8AF4694F539FBED0D54880B0@AM0PR04MB4481.eurprd04.prod.outlook.com

On 27.01.2020 07:00, Peng Fan wrote:
>> Subject: Re: [PATCH V3 2/4] clk: imx: imx8mq: use
>> imx8m_clk_hw_composite_core
>>
>> On 16.01.2020 04:15, Peng Fan wrote:
>>> From: Peng Fan <peng.fan@nxp.com>
>>>
>>> Use imx8m_clk_hw_composite_core to simplify code.
>>>
>>> Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>> ---
>>>    drivers/clk/imx/clk-imx8mq.c | 22 ++++++++--------------
>>>    1 file changed, 8 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/drivers/clk/imx/clk-imx8mq.c
>>> b/drivers/clk/imx/clk-imx8mq.c index 4c0edca1a6d0..e928c1355ad8
>> 100644
>>> --- a/drivers/clk/imx/clk-imx8mq.c
>>> +++ b/drivers/clk/imx/clk-imx8mq.c
>>> @@ -403,22 +403,16 @@ static int imx8mq_clocks_probe(struct
>>> platform_device *pdev)
>>>
>>>    	/* CORE */
>>>    	hws[IMX8MQ_CLK_A53_SRC] = imx_clk_hw_mux2("arm_a53_src",
>> base + 0x8000, 24, 3, imx8mq_a53_sels, ARRAY_SIZE(imx8mq_a53_sels));
>>> -	hws[IMX8MQ_CLK_M4_SRC] = imx_clk_hw_mux2("arm_m4_src", base
>> + 0x8080, 24, 3, imx8mq_arm_m4_sels, ARRAY_SIZE(imx8mq_arm_m4_sels));
>>> -	hws[IMX8MQ_CLK_VPU_SRC] = imx_clk_hw_mux2("vpu_src", base +
>> 0x8100, 24, 3, imx8mq_vpu_sels, ARRAY_SIZE(imx8mq_vpu_sels));
>>> -	hws[IMX8MQ_CLK_GPU_CORE_SRC] =
>> imx_clk_hw_mux2("gpu_core_src", base + 0x8180, 24, 3,
>> imx8mq_gpu_core_sels, ARRAY_SIZE(imx8mq_gpu_core_sels));
>>> -	hws[IMX8MQ_CLK_GPU_SHADER_SRC] =
>> imx_clk_hw_mux2("gpu_shader_src", base + 0x8200, 24, 3,
>> imx8mq_gpu_shader_sels,  ARRAY_SIZE(imx8mq_gpu_shader_sels));
>>> -
>>>    	hws[IMX8MQ_CLK_A53_CG] =
>> imx_clk_hw_gate3_flags("arm_a53_cg", "arm_a53_src", base + 0x8000, 28,
>> CLK_IS_CRITICAL);
>>> -	hws[IMX8MQ_CLK_M4_CG] = imx_clk_hw_gate3("arm_m4_cg",
>> "arm_m4_src", base + 0x8080, 28);
>>> -	hws[IMX8MQ_CLK_VPU_CG] = imx_clk_hw_gate3("vpu_cg", "vpu_src",
>> base + 0x8100, 28);
>>> -	hws[IMX8MQ_CLK_GPU_CORE_CG] = imx_clk_hw_gate3("gpu_core_cg",
>> "gpu_core_src", base + 0x8180, 28);
>>> -	hws[IMX8MQ_CLK_GPU_SHADER_CG] =
>> imx_clk_hw_gate3("gpu_shader_cg", "gpu_shader_src", base + 0x8200, 28);
>>> -
>>>    	hws[IMX8MQ_CLK_A53_DIV] =
>> imx_clk_hw_divider2("arm_a53_div", "arm_a53_cg", base + 0x8000, 0, 3);
>>> -	hws[IMX8MQ_CLK_M4_DIV] = imx_clk_hw_divider2("arm_m4_div",
>> "arm_m4_cg", base + 0x8080, 0, 3);
>>> -	hws[IMX8MQ_CLK_VPU_DIV] = imx_clk_hw_divider2("vpu_div",
>> "vpu_cg", base + 0x8100, 0, 3);
>>> -	hws[IMX8MQ_CLK_GPU_CORE_DIV] =
>> imx_clk_hw_divider2("gpu_core_div", "gpu_core_cg", base + 0x8180, 0, 3);
>>> -	hws[IMX8MQ_CLK_GPU_SHADER_DIV] =
>> imx_clk_hw_divider2("gpu_shader_div", "gpu_shader_cg", base + 0x8200, 0,
>> 3);
>>> +
>>> +	hws[IMX8MQ_CLK_M4_DIV] =
>> imx8m_clk_hw_composite_core("arm_m4_div", imx8mq_arm_m4_sels, base
>> + 0x8080);
>>> +	hws[IMX8MQ_CLK_VPU_DIV] =
>> imx8m_clk_hw_composite_core("vpu_div", imx8mq_vpu_sels, base +
>> 0x8100);
>>> +	hws[IMX8MQ_CLK_GPU_CORE_DIV] =
>> imx8m_clk_hw_composite_core("gpu_core_div", imx8mq_gpu_core_sels,
>> base + 0x8180);
>>> +	hws[IMX8MQ_CLK_GPU_SHADER_DIV] =
>>> +imx8m_clk_hw_composite("gpu_shader_div", imx8mq_gpu_shader_sels,
>> base
>>> ++ 0x8200);
>>
>>> +	/* For DTS which still assign parents for gpu core src clk */
>>> +	hws[IMX8MQ_CLK_GPU_CORE_SRC] =
>> hws[IMX8MQ_CLK_GPU_CORE_DIV];
>>> +	hws[IMX8MQ_CLK_GPU_SHADER_SRC] =
>> hws[IMX8MQ_CLK_GPU_SHADER_DIV];
>>
>> Why not assign to all the old clocks?
> 
> Are those clocks expect the GPU ones needed?
> 
> Currently only the gpu clocks are needed, others are not used in dts.
> 
> For dts update to use the SRC clocks should be avoided in future for Linux,
> DIV clocks should be used.
> 
> How do you think?

In theory backwards compatibility should be supported at the level of 
"DT bindings", not just hacked for a particular DT. In this case it's 
easy to add aliases for everything, just slightly verbose.

It might also make sense to add new defines for the composite clock so 
that IMX8MQ_CLK_GPU_CORE looks like IMX8MQ_CLK_DSI_CORE and all the _SRC 
_DIV _CG stuff is just aliases to the unsuffixed composite.

--
Regards,
Leonard

WARNING: multiple messages have this Message-ID (diff)
From: Leonard Crestez <leonard.crestez@nxp.com>
To: Peng Fan <peng.fan@nxp.com>, "shawnguo@kernel.org" <shawnguo@kernel.org>
Cc: Aisheng Dong <aisheng.dong@nxp.com>,
	Abel Vesa <abel.vesa@nxp.com>, Anson Huang <anson.huang@nxp.com>,
	"sboyd@kernel.org" <sboyd@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Jacky Bai <ping.bai@nxp.com>
Subject: Re: [PATCH V3 2/4] clk: imx: imx8mq: use imx8m_clk_hw_composite_core
Date: Mon, 27 Jan 2020 20:33:10 +0000	[thread overview]
Message-ID: <VI1PR04MB7023DD8E3D07543FB8F5CD50EE0B0@VI1PR04MB7023.eurprd04.prod.outlook.com> (raw)
In-Reply-To: AM0PR04MB4481A8AF4694F539FBED0D54880B0@AM0PR04MB4481.eurprd04.prod.outlook.com

On 27.01.2020 07:00, Peng Fan wrote:
>> Subject: Re: [PATCH V3 2/4] clk: imx: imx8mq: use
>> imx8m_clk_hw_composite_core
>>
>> On 16.01.2020 04:15, Peng Fan wrote:
>>> From: Peng Fan <peng.fan@nxp.com>
>>>
>>> Use imx8m_clk_hw_composite_core to simplify code.
>>>
>>> Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>> ---
>>>    drivers/clk/imx/clk-imx8mq.c | 22 ++++++++--------------
>>>    1 file changed, 8 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/drivers/clk/imx/clk-imx8mq.c
>>> b/drivers/clk/imx/clk-imx8mq.c index 4c0edca1a6d0..e928c1355ad8
>> 100644
>>> --- a/drivers/clk/imx/clk-imx8mq.c
>>> +++ b/drivers/clk/imx/clk-imx8mq.c
>>> @@ -403,22 +403,16 @@ static int imx8mq_clocks_probe(struct
>>> platform_device *pdev)
>>>
>>>    	/* CORE */
>>>    	hws[IMX8MQ_CLK_A53_SRC] = imx_clk_hw_mux2("arm_a53_src",
>> base + 0x8000, 24, 3, imx8mq_a53_sels, ARRAY_SIZE(imx8mq_a53_sels));
>>> -	hws[IMX8MQ_CLK_M4_SRC] = imx_clk_hw_mux2("arm_m4_src", base
>> + 0x8080, 24, 3, imx8mq_arm_m4_sels, ARRAY_SIZE(imx8mq_arm_m4_sels));
>>> -	hws[IMX8MQ_CLK_VPU_SRC] = imx_clk_hw_mux2("vpu_src", base +
>> 0x8100, 24, 3, imx8mq_vpu_sels, ARRAY_SIZE(imx8mq_vpu_sels));
>>> -	hws[IMX8MQ_CLK_GPU_CORE_SRC] =
>> imx_clk_hw_mux2("gpu_core_src", base + 0x8180, 24, 3,
>> imx8mq_gpu_core_sels, ARRAY_SIZE(imx8mq_gpu_core_sels));
>>> -	hws[IMX8MQ_CLK_GPU_SHADER_SRC] =
>> imx_clk_hw_mux2("gpu_shader_src", base + 0x8200, 24, 3,
>> imx8mq_gpu_shader_sels,  ARRAY_SIZE(imx8mq_gpu_shader_sels));
>>> -
>>>    	hws[IMX8MQ_CLK_A53_CG] =
>> imx_clk_hw_gate3_flags("arm_a53_cg", "arm_a53_src", base + 0x8000, 28,
>> CLK_IS_CRITICAL);
>>> -	hws[IMX8MQ_CLK_M4_CG] = imx_clk_hw_gate3("arm_m4_cg",
>> "arm_m4_src", base + 0x8080, 28);
>>> -	hws[IMX8MQ_CLK_VPU_CG] = imx_clk_hw_gate3("vpu_cg", "vpu_src",
>> base + 0x8100, 28);
>>> -	hws[IMX8MQ_CLK_GPU_CORE_CG] = imx_clk_hw_gate3("gpu_core_cg",
>> "gpu_core_src", base + 0x8180, 28);
>>> -	hws[IMX8MQ_CLK_GPU_SHADER_CG] =
>> imx_clk_hw_gate3("gpu_shader_cg", "gpu_shader_src", base + 0x8200, 28);
>>> -
>>>    	hws[IMX8MQ_CLK_A53_DIV] =
>> imx_clk_hw_divider2("arm_a53_div", "arm_a53_cg", base + 0x8000, 0, 3);
>>> -	hws[IMX8MQ_CLK_M4_DIV] = imx_clk_hw_divider2("arm_m4_div",
>> "arm_m4_cg", base + 0x8080, 0, 3);
>>> -	hws[IMX8MQ_CLK_VPU_DIV] = imx_clk_hw_divider2("vpu_div",
>> "vpu_cg", base + 0x8100, 0, 3);
>>> -	hws[IMX8MQ_CLK_GPU_CORE_DIV] =
>> imx_clk_hw_divider2("gpu_core_div", "gpu_core_cg", base + 0x8180, 0, 3);
>>> -	hws[IMX8MQ_CLK_GPU_SHADER_DIV] =
>> imx_clk_hw_divider2("gpu_shader_div", "gpu_shader_cg", base + 0x8200, 0,
>> 3);
>>> +
>>> +	hws[IMX8MQ_CLK_M4_DIV] =
>> imx8m_clk_hw_composite_core("arm_m4_div", imx8mq_arm_m4_sels, base
>> + 0x8080);
>>> +	hws[IMX8MQ_CLK_VPU_DIV] =
>> imx8m_clk_hw_composite_core("vpu_div", imx8mq_vpu_sels, base +
>> 0x8100);
>>> +	hws[IMX8MQ_CLK_GPU_CORE_DIV] =
>> imx8m_clk_hw_composite_core("gpu_core_div", imx8mq_gpu_core_sels,
>> base + 0x8180);
>>> +	hws[IMX8MQ_CLK_GPU_SHADER_DIV] =
>>> +imx8m_clk_hw_composite("gpu_shader_div", imx8mq_gpu_shader_sels,
>> base
>>> ++ 0x8200);
>>
>>> +	/* For DTS which still assign parents for gpu core src clk */
>>> +	hws[IMX8MQ_CLK_GPU_CORE_SRC] =
>> hws[IMX8MQ_CLK_GPU_CORE_DIV];
>>> +	hws[IMX8MQ_CLK_GPU_SHADER_SRC] =
>> hws[IMX8MQ_CLK_GPU_SHADER_DIV];
>>
>> Why not assign to all the old clocks?
> 
> Are those clocks expect the GPU ones needed?
> 
> Currently only the gpu clocks are needed, others are not used in dts.
> 
> For dts update to use the SRC clocks should be avoided in future for Linux,
> DIV clocks should be used.
> 
> How do you think?

In theory backwards compatibility should be supported at the level of 
"DT bindings", not just hacked for a particular DT. In this case it's 
easy to add aliases for everything, just slightly verbose.

It might also make sense to add new defines for the composite clock so 
that IMX8MQ_CLK_GPU_CORE looks like IMX8MQ_CLK_DSI_CORE and all the _SRC 
_DIV _CG stuff is just aliases to the unsuffixed composite.

--
Regards,
Leonard

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-01-27 20:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16  2:15 [PATCH V3 0/4] clk: imx: imx8m: introduce imx8m_clk_hw_composite_core Peng Fan
2020-01-16  2:15 ` Peng Fan
2020-01-16  2:15 ` [PATCH V3 1/4] clk: imx: composite-8m: add imx8m_clk_hw_composite_core Peng Fan
2020-01-16  2:15   ` Peng Fan
2020-01-20 13:41   ` Leonard Crestez
2020-01-20 13:41     ` Leonard Crestez
2020-01-16  2:15 ` [PATCH V3 2/4] clk: imx: imx8mq: use imx8m_clk_hw_composite_core Peng Fan
2020-01-16  2:15   ` Peng Fan
2020-01-20 13:40   ` Leonard Crestez
2020-01-20 13:40     ` Leonard Crestez
2020-01-27  5:00     ` Peng Fan
2020-01-27  5:00       ` Peng Fan
2020-01-27 20:33       ` Leonard Crestez [this message]
2020-01-27 20:33         ` Leonard Crestez
2020-01-16  2:15 ` [PATCH V3 3/4] clk: imx: imx8mm: " Peng Fan
2020-01-16  2:15   ` Peng Fan
2020-01-16  2:16 ` [PATCH V3 4/4] clk: imx: imx8mn: " Peng Fan
2020-01-16  2:16   ` Peng Fan
2020-02-19  9:53 [PATCH v3 0/4] clk: imx: imx8m: fix a53 cpu clock peng.fan
2020-02-19  9:53 ` [PATCH V3 2/4] clk: imx: imx8mq: use imx8m_clk_hw_composite_core peng.fan
2020-02-19  9:53   ` peng.fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR04MB7023DD8E3D07543FB8F5CD50EE0B0@VI1PR04MB7023.eurprd04.prod.outlook.com \
    --to=leonard.crestez@nxp.com \
    --cc=abel.vesa@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.