[PATCH 0/2] ARM: at91: fix compilation errors after SAMA7G5

STALE1834d

7 messages, 3 authors, 2021-07-27 · open the first message on its own page

[PATCH 0/2] ARM: at91: fix compilation errors after SAMA7G5

From: Claudiu Beznea <hidden>
Date: 2021-07-19 08:04:06

This series fix compilation errors after the merge of AT91 SAMA7G5 SoC
support.

Claudiu Beznea (2):
  ARM: at91: fix link error
  clk: at91: add register definition for sama7g5's master clock

 arch/arm/mach-at91/Kconfig   |  3 +++
 include/linux/clk/at91_pmc.h | 26 ++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

-- 
2.25.1


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

[PATCH 1/2] ARM: at91: fix link error

From: Claudiu Beznea <hidden>
Date: 2021-07-19 08:04:08

PM support for SAMA7G5 has been submitted to mailing list before SAMA7G5
soc support thus the SAMA7G5 was not present in AT91 Kconfig file at
that moment. SoC support for SAMA7G5 hasn't added the proper PM flags to
Kconfig thus the link error bellow:

arch/arm/mach-at91/sama7.o: In function `sama7_dt_device_init':
sama7.c:(.init.text+0x18): undefined reference to `sama7_pm_init'
make: *** [Makefile:1176: vmlinux] Error 1

Add proper flags to AT91 Kconfig file to solve the issue.

Fixes: 5617a08dd9e1 ("ARM: at91: pm: add pm support for SAMA7G5")
Fixes: 18d694ecd91e ("ARM: at91: add new SoC sama7g5") 
Signed-off-by: Claudiu Beznea <redacted>
---
 arch/arm/mach-at91/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index f52b46bccd85..b09bb2279f7f 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -204,6 +204,9 @@ config ATMEL_PM
 config SOC_SAMA7
 	bool
 	select ARM_GIC
+	select ATMEL_PM if PM
+	select ATMEL_SDRAMC
 	select MEMORY
 	select SOC_SAM_V7
+	select SRAM if PM
 endif
-- 
2.25.1


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

[PATCH 2/2] clk: at91: add register definition for sama7g5's master clock

From: Claudiu Beznea <hidden>
Date: 2021-07-19 08:04:14

Add register definitions for SAMA7G5's master clock. These would be
also used by architecture specific power saving code.

Fixes: 6cb0e54412a3 ("ARM: at91: pm: add support for MCK1..4 save/restore for ulp modes")
Signed-off-by: Claudiu Beznea <redacted>
---

Hi Stephen,

This is a part from patch at [1]. I keep it at minimum (only definitions)
for faster acceptance as the build is broken on arm multi_v7_defconfig
without it).
In next version of patch at [1] I will update it accordingly.

Thank you,
Claudiu Beznea

[1] https://lore.kernel.org/linux-clk/20210401122726.28528-5-claudiu.beznea@microchip.com/

 include/linux/clk/at91_pmc.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff --git a/include/linux/clk/at91_pmc.h b/include/linux/clk/at91_pmc.h
index a4f82e836a7c..ccb3f034bfa9 100644
--- a/include/linux/clk/at91_pmc.h
+++ b/include/linux/clk/at91_pmc.h
@@ -137,6 +137,32 @@
 #define			AT91_PMC_PLLADIV2_ON		(1 << 12)
 #define		AT91_PMC_H32MXDIV	BIT(24)
 
+#define	AT91_PMC_MCR_V2		0x30				/* Master Clock Register [SAMA7G5 only] */
+#define		AT91_PMC_MCR_V2_ID_MSK	(0xF)
+#define			AT91_PMC_MCR_V2_ID(_id)		((_id) & AT91_PMC_MCR_V2_ID_MSK)
+#define		AT91_PMC_MCR_V2_CMD	(1 << 7)
+#define		AT91_PMC_MCR_V2_DIV	(7 << 8)
+#define			AT91_PMC_MCR_V2_DIV1		(0 << 8)
+#define			AT91_PMC_MCR_V2_DIV2		(1 << 8)
+#define			AT91_PMC_MCR_V2_DIV4		(2 << 8)
+#define			AT91_PMC_MCR_V2_DIV8		(3 << 8)
+#define			AT91_PMC_MCR_V2_DIV16		(4 << 8)
+#define			AT91_PMC_MCR_V2_DIV32		(5 << 8)
+#define			AT91_PMC_MCR_V2_DIV64		(6 << 8)
+#define			AT91_PMC_MCR_V2_DIV3		(7 << 8)
+#define		AT91_PMC_MCR_V2_CSS	(0x1F << 16)
+#define			AT91_PMC_MCR_V2_CSS_MD_SLCK	(0 << 16)
+#define			AT91_PMC_MCR_V2_CSS_TD_SLCK	(1 << 16)
+#define			AT91_PMC_MCR_V2_CSS_MAINCK	(2 << 16)
+#define			AT91_PMC_MCR_V2_CSS_MCK0	(3 << 16)
+#define			AT91_PMC_MCR_V2_CSS_SYSPLL	(5 << 16)
+#define			AT91_PMC_MCR_V2_CSS_DDRPLL	(6 << 16)
+#define			AT91_PMC_MCR_V2_CSS_IMGPLL	(7 << 16)
+#define			AT91_PMC_MCR_V2_CSS_BAUDPLL	(8 << 16)
+#define			AT91_PMC_MCR_V2_CSS_AUDIOPLL	(9 << 16)
+#define			AT91_PMC_MCR_V2_CSS_ETHPLL	(10 << 16)
+#define		AT91_PMC_MCR_V2_EN	(1 << 28)
+
 #define AT91_PMC_XTALF		0x34			/* Main XTAL Frequency Register [SAMA7G5 only] */
 
 #define	AT91_PMC_USB		0x38			/* USB Clock Register [some SAM9 only] */
-- 
2.25.1


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

Re: [PATCH 1/2] ARM: at91: fix link error

From: Nicolas Ferre <nicolas.ferre@microchip.com>
Date: 2021-07-19 12:40:33

Hi Claudiu,

On 19/07/2021 at 10:03, Claudiu Beznea wrote:
quoted hunk
PM support for SAMA7G5 has been submitted to mailing list before SAMA7G5
soc support thus the SAMA7G5 was not present in AT91 Kconfig file at
that moment. SoC support for SAMA7G5 hasn't added the proper PM flags to
Kconfig thus the link error bellow:

arch/arm/mach-at91/sama7.o: In function `sama7_dt_device_init':
sama7.c:(.init.text+0x18): undefined reference to `sama7_pm_init'
make: *** [Makefile:1176: vmlinux] Error 1

Add proper flags to AT91 Kconfig file to solve the issue.

Fixes: 5617a08dd9e1 ("ARM: at91: pm: add pm support for SAMA7G5")
Fixes: 18d694ecd91e ("ARM: at91: add new SoC sama7g5")
Signed-off-by: Claudiu Beznea <redacted>
---
  arch/arm/mach-at91/Kconfig | 3 +++
  1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index f52b46bccd85..b09bb2279f7f 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -204,6 +204,9 @@ config ATMEL_PM
  config SOC_SAMA7
  	bool
  	select ARM_GIC
+	select ATMEL_PM if PM
+	select ATMEL_SDRAMC
  	select MEMORY
  	select SOC_SAM_V7
+	select SRAM if PM
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

I squashed this patch in 18d694ecd91e ("ARM: at91: add new SoC 
sama7g5"), verified that it compiles and rebased the at91-soc branch on 
it. The commit message is as follow (wrapped):

ARM: at91: add new SoC sama7g5

Add new SoC from at91 family : sama7g5

Signed-off-by: Eugen Hristev <redacted>
[claudiu.beznea@microchip.com: Select PLL, generic clock and UTMI 
support, add PM configs]
Signed-off-by: Claudiu Beznea <redacted>
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: 
https://lore.kernel.org/r/20210409113116.482199-1-eugen.hristev@microchip.com
Link: 
https://lore.kernel.org/r/20210719080317.1045832-2-claudiu.beznea@microchip.com

Added lore link will allow us to trace this part of the discussion.
Here is the new branch:
https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git/log/?h=at91-soc

Tell me if it's good for you.

Thanks for having fixed that so quickly. Best regards,
   Nicolas


-- 
Nicolas Ferre

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

Re: [PATCH 2/2] clk: at91: add register definition for sama7g5's master clock

From: Nicolas Ferre <nicolas.ferre@microchip.com>
Date: 2021-07-19 12:46:06

On 19/07/2021 at 10:03, Claudiu Beznea wrote:
Add register definitions for SAMA7G5's master clock. These would be
also used by architecture specific power saving code.

Fixes: 6cb0e54412a3 ("ARM: at91: pm: add support for MCK1..4 save/restore for ulp modes")
Signed-off-by: Claudiu Beznea <redacted>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
---

Hi Stephen,

This is a part from patch at [1]. I keep it at minimum (only definitions)
for faster acceptance as the build is broken on arm multi_v7_defconfig
without it).
In next version of patch at [1] I will update it accordingly.
Stephen,

Before hearing from you I inserted this patch in our at91-soc branch 
that is part of linux-next. With this at least the build don't break 
anymore.

Tell me if you want to have an immutable branch that we could share with 
it on top of 5.14-rc1 or if it's fine if we add the same patch in both 
of our trees.

Best regards,
   Nicolas

quoted hunk
[1] https://lore.kernel.org/linux-clk/20210401122726.28528-5-claudiu.beznea@microchip.com/

  include/linux/clk/at91_pmc.h | 26 ++++++++++++++++++++++++++
  1 file changed, 26 insertions(+)
diff --git a/include/linux/clk/at91_pmc.h b/include/linux/clk/at91_pmc.h
index a4f82e836a7c..ccb3f034bfa9 100644
--- a/include/linux/clk/at91_pmc.h
+++ b/include/linux/clk/at91_pmc.h
@@ -137,6 +137,32 @@
  #define			AT91_PMC_PLLADIV2_ON		(1 << 12)
  #define		AT91_PMC_H32MXDIV	BIT(24)
  
+#define	AT91_PMC_MCR_V2		0x30				/* Master Clock Register [SAMA7G5 only] */
+#define		AT91_PMC_MCR_V2_ID_MSK	(0xF)
+#define			AT91_PMC_MCR_V2_ID(_id)		((_id) & AT91_PMC_MCR_V2_ID_MSK)
+#define		AT91_PMC_MCR_V2_CMD	(1 << 7)
+#define		AT91_PMC_MCR_V2_DIV	(7 << 8)
+#define			AT91_PMC_MCR_V2_DIV1		(0 << 8)
+#define			AT91_PMC_MCR_V2_DIV2		(1 << 8)
+#define			AT91_PMC_MCR_V2_DIV4		(2 << 8)
+#define			AT91_PMC_MCR_V2_DIV8		(3 << 8)
+#define			AT91_PMC_MCR_V2_DIV16		(4 << 8)
+#define			AT91_PMC_MCR_V2_DIV32		(5 << 8)
+#define			AT91_PMC_MCR_V2_DIV64		(6 << 8)
+#define			AT91_PMC_MCR_V2_DIV3		(7 << 8)
+#define		AT91_PMC_MCR_V2_CSS	(0x1F << 16)
+#define			AT91_PMC_MCR_V2_CSS_MD_SLCK	(0 << 16)
+#define			AT91_PMC_MCR_V2_CSS_TD_SLCK	(1 << 16)
+#define			AT91_PMC_MCR_V2_CSS_MAINCK	(2 << 16)
+#define			AT91_PMC_MCR_V2_CSS_MCK0	(3 << 16)
+#define			AT91_PMC_MCR_V2_CSS_SYSPLL	(5 << 16)
+#define			AT91_PMC_MCR_V2_CSS_DDRPLL	(6 << 16)
+#define			AT91_PMC_MCR_V2_CSS_IMGPLL	(7 << 16)
+#define			AT91_PMC_MCR_V2_CSS_BAUDPLL	(8 << 16)
+#define			AT91_PMC_MCR_V2_CSS_AUDIOPLL	(9 << 16)
+#define			AT91_PMC_MCR_V2_CSS_ETHPLL	(10 << 16)
+#define		AT91_PMC_MCR_V2_EN	(1 << 28)
+
  #define AT91_PMC_XTALF		0x34			/* Main XTAL Frequency Register [SAMA7G5 only] */
  
  #define	AT91_PMC_USB		0x38			/* USB Clock Register [some SAM9 only] */

-- 
Nicolas Ferre

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

Re: [PATCH 1/2] ARM: at91: fix link error

From: <hidden>
Date: 2021-07-19 13:17:42

On 19.07.2021 15:40, Nicolas Ferre wrote:
Hi Claudiu,

On 19/07/2021 at 10:03, Claudiu Beznea wrote:
quoted
PM support for SAMA7G5 has been submitted to mailing list before SAMA7G5
soc support thus the SAMA7G5 was not present in AT91 Kconfig file at
that moment. SoC support for SAMA7G5 hasn't added the proper PM flags to
Kconfig thus the link error bellow:

arch/arm/mach-at91/sama7.o: In function `sama7_dt_device_init':
sama7.c:(.init.text+0x18): undefined reference to `sama7_pm_init'
make: *** [Makefile:1176: vmlinux] Error 1

Add proper flags to AT91 Kconfig file to solve the issue.

Fixes: 5617a08dd9e1 ("ARM: at91: pm: add pm support for SAMA7G5")
Fixes: 18d694ecd91e ("ARM: at91: add new SoC sama7g5")
Signed-off-by: Claudiu Beznea <redacted>
---
  arch/arm/mach-at91/Kconfig | 3 +++
  1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index f52b46bccd85..b09bb2279f7f 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -204,6 +204,9 @@ config ATMEL_PM
  config SOC_SAMA7
      bool
      select ARM_GIC
+    select ATMEL_PM if PM
+    select ATMEL_SDRAMC
      select MEMORY
      select SOC_SAM_V7
+    select SRAM if PM
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

I squashed this patch in 18d694ecd91e ("ARM: at91: add new SoC sama7g5"),
verified that it compiles and rebased the at91-soc branch on it. The commit
message is as follow (wrapped):

ARM: at91: add new SoC sama7g5

Add new SoC from at91 family : sama7g5

Signed-off-by: Eugen Hristev <redacted>
[claudiu.beznea@microchip.com: Select PLL, generic clock and UTMI support,
add PM configs]
Signed-off-by: Claudiu Beznea <redacted>
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link:
https://lore.kernel.org/r/20210409113116.482199-1-eugen.hristev@microchip.com
Link:
https://lore.kernel.org/r/20210719080317.1045832-2-claudiu.beznea@microchip.com


Added lore link will allow us to trace this part of the discussion.
Here is the new branch:
https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git/log/?h=at91-soc

Tell me if it's good for you.
Hi Nicolas,

It's good for me.

Thank you,
Claudiu
Thanks for having fixed that so quickly. Best regards,
  Nicolas

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

Re: [PATCH 2/2] clk: at91: add register definition for sama7g5's master clock

From: Stephen Boyd <sboyd@kernel.org>
Date: 2021-07-27 01:19:33

Quoting Nicolas Ferre (2021-07-19 05:46:00)
On 19/07/2021 at 10:03, Claudiu Beznea wrote:
quoted
Add register definitions for SAMA7G5's master clock. These would be
also used by architecture specific power saving code.

Fixes: 6cb0e54412a3 ("ARM: at91: pm: add support for MCK1..4 save/restore for ulp modes")
Signed-off-by: Claudiu Beznea <redacted>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
quoted
---

Hi Stephen,

This is a part from patch at [1]. I keep it at minimum (only definitions)
for faster acceptance as the build is broken on arm multi_v7_defconfig
without it).
In next version of patch at [1] I will update it accordingly.
Stephen,

Before hearing from you I inserted this patch in our at91-soc branch 
that is part of linux-next. With this at least the build don't break 
anymore.
I don't think I need the patches? I'll try to remember this patch if I
apply some patch that needs this in the future and probably just
duplicate the commit to make things simpler.
Tell me if you want to have an immutable branch that we could share with 
it on top of 5.14-rc1 or if it's fine if we add the same patch in both 
of our trees.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help