devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: dts: VIM3: Set the rates of the clocks for the NPU
@ 2023-10-16  8:02 Tomeu Vizoso
  2023-10-16  8:02 ` [PATCH 2/2] pmdomain: amlogic: Fix mask for the second NNA mem PD domain Tomeu Vizoso
  0 siblings, 1 reply; 5+ messages in thread
From: Tomeu Vizoso @ 2023-10-16  8:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Da Xue, Tomeu Vizoso, Lucas Stach, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, Ulf Hansson, devicetree,
	linux-arm-kernel, linux-amlogic, linux-pm

Otherwise they are left at 24MHz and the NPU runs very slowly.

Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Suggested-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index ff68b911b729..9d5eab6595d0 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -2502,6 +2502,9 @@ npu: npu@ff100000 {
 		clocks = <&clkc CLKID_NNA_CORE_CLK>,
 			 <&clkc CLKID_NNA_AXI_CLK>;
 		clock-names = "core", "bus";
+		assigned-clocks = <&clkc CLKID_NNA_CORE_CLK>,
+				  <&clkc CLKID_NNA_AXI_CLK>;
+		assigned-clock-rates = <800000000>, <800000000>;
 		resets = <&reset RESET_NNA>;
 		status = "disabled";
 	};
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] pmdomain: amlogic: Fix mask for the second NNA mem PD domain
  2023-10-16  8:02 [PATCH 1/2] arm64: dts: VIM3: Set the rates of the clocks for the NPU Tomeu Vizoso
@ 2023-10-16  8:02 ` Tomeu Vizoso
  2023-10-26 14:36   ` Ulf Hansson
  2023-10-27  9:03   ` Ulf Hansson
  0 siblings, 2 replies; 5+ messages in thread
From: Tomeu Vizoso @ 2023-10-16  8:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Da Xue, Tomeu Vizoso, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, Ulf Hansson, devicetree, linux-arm-kernel,
	linux-amlogic, linux-pm

Without this change, the NPU hangs when the 8th NN core is used.

It matches what the out-of-tree driver does.

Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
---
 drivers/pmdomain/amlogic/meson-ee-pwrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pmdomain/amlogic/meson-ee-pwrc.c b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
index cfb796d40d9d..0dd71cd814c5 100644
--- a/drivers/pmdomain/amlogic/meson-ee-pwrc.c
+++ b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
@@ -228,7 +228,7 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
 
 static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_nna[] = {
 	{ G12A_HHI_NANOQ_MEM_PD_REG0, GENMASK(31, 0) },
-	{ G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(23, 0) },
+	{ G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(31, 0) },
 };
 
 #define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks)	\
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] pmdomain: amlogic: Fix mask for the second NNA mem PD domain
  2023-10-16  8:02 ` [PATCH 2/2] pmdomain: amlogic: Fix mask for the second NNA mem PD domain Tomeu Vizoso
@ 2023-10-26 14:36   ` Ulf Hansson
  2023-10-26 14:42     ` Neil Armstrong
  2023-10-27  9:03   ` Ulf Hansson
  1 sibling, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2023-10-26 14:36 UTC (permalink / raw)
  To: Tomeu Vizoso
  Cc: linux-kernel, Da Xue, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, devicetree, linux-arm-kernel, linux-amlogic,
	linux-pm

On Mon, 16 Oct 2023 at 10:02, Tomeu Vizoso <tomeu@tomeuvizoso.net> wrote:
>
> Without this change, the NPU hangs when the 8th NN core is used.
>
> It matches what the out-of-tree driver does.
>
> Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>

The change looks good to me, but I have been awaiting an ack from some
of the platform/soc maintainers before applying.

That said, it looks like we need a fixes/stable tag too. Is there a
certain commit this fixes?

Kind regards
Uffe

> ---
>  drivers/pmdomain/amlogic/meson-ee-pwrc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pmdomain/amlogic/meson-ee-pwrc.c b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
> index cfb796d40d9d..0dd71cd814c5 100644
> --- a/drivers/pmdomain/amlogic/meson-ee-pwrc.c
> +++ b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
> @@ -228,7 +228,7 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
>
>  static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_nna[] = {
>         { G12A_HHI_NANOQ_MEM_PD_REG0, GENMASK(31, 0) },
> -       { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(23, 0) },
> +       { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(31, 0) },
>  };
>
>  #define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks)        \
> --
> 2.41.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] pmdomain: amlogic: Fix mask for the second NNA mem PD domain
  2023-10-26 14:36   ` Ulf Hansson
@ 2023-10-26 14:42     ` Neil Armstrong
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2023-10-26 14:42 UTC (permalink / raw)
  To: Ulf Hansson, Tomeu Vizoso
  Cc: linux-kernel, Da Xue, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	devicetree, linux-arm-kernel, linux-amlogic, linux-pm

Hi Ulf,

On 26/10/2023 16:36, Ulf Hansson wrote:
> On Mon, 16 Oct 2023 at 10:02, Tomeu Vizoso <tomeu@tomeuvizoso.net> wrote:
>>
>> Without this change, the NPU hangs when the 8th NN core is used.
>>
>> It matches what the out-of-tree driver does.
>>
>> Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
> 
> The change looks good to me, but I have been awaiting an ack from some
> of the platform/soc maintainers before applying.
> 
> That said, it looks like we need a fixes/stable tag too. Is there a
> certain commit this fixes?

It looks good for me, you can add:

Fixes: 9a217b7e8953 ("soc: amlogic: meson-pwrc: Add NNA power domain for A311D")

and

Acked-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

> 
> Kind regards
> Uffe
> 
>> ---
>>   drivers/pmdomain/amlogic/meson-ee-pwrc.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/pmdomain/amlogic/meson-ee-pwrc.c b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
>> index cfb796d40d9d..0dd71cd814c5 100644
>> --- a/drivers/pmdomain/amlogic/meson-ee-pwrc.c
>> +++ b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
>> @@ -228,7 +228,7 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
>>
>>   static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_nna[] = {
>>          { G12A_HHI_NANOQ_MEM_PD_REG0, GENMASK(31, 0) },
>> -       { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(23, 0) },
>> +       { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(31, 0) },
>>   };
>>
>>   #define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks)        \
>> --
>> 2.41.0
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] pmdomain: amlogic: Fix mask for the second NNA mem PD domain
  2023-10-16  8:02 ` [PATCH 2/2] pmdomain: amlogic: Fix mask for the second NNA mem PD domain Tomeu Vizoso
  2023-10-26 14:36   ` Ulf Hansson
@ 2023-10-27  9:03   ` Ulf Hansson
  1 sibling, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2023-10-27  9:03 UTC (permalink / raw)
  To: Tomeu Vizoso
  Cc: linux-kernel, Da Xue, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	Martin Blumenstingl, devicetree, linux-arm-kernel, linux-amlogic,
	linux-pm

On Mon, 16 Oct 2023 at 10:02, Tomeu Vizoso <tomeu@tomeuvizoso.net> wrote:
>
> Without this change, the NPU hangs when the 8th NN core is used.
>
> It matches what the out-of-tree driver does.
>
> Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>

Applied for fixes and by adding a fixes/stable tag, thanks!

Kind regards
Uffe

> ---
>  drivers/pmdomain/amlogic/meson-ee-pwrc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pmdomain/amlogic/meson-ee-pwrc.c b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
> index cfb796d40d9d..0dd71cd814c5 100644
> --- a/drivers/pmdomain/amlogic/meson-ee-pwrc.c
> +++ b/drivers/pmdomain/amlogic/meson-ee-pwrc.c
> @@ -228,7 +228,7 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = {
>
>  static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_nna[] = {
>         { G12A_HHI_NANOQ_MEM_PD_REG0, GENMASK(31, 0) },
> -       { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(23, 0) },
> +       { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(31, 0) },
>  };
>
>  #define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks)        \
> --
> 2.41.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-27  9:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-16  8:02 [PATCH 1/2] arm64: dts: VIM3: Set the rates of the clocks for the NPU Tomeu Vizoso
2023-10-16  8:02 ` [PATCH 2/2] pmdomain: amlogic: Fix mask for the second NNA mem PD domain Tomeu Vizoso
2023-10-26 14:36   ` Ulf Hansson
2023-10-26 14:42     ` Neil Armstrong
2023-10-27  9:03   ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).