ARM: mach-at91: fix multiple cpu_reset definition when enabling SYSRESET
PATCH 1/1 ARM: mach-at91: fix multiple cpu_reset definition when enabling SYSRESET
When SYSRESET is enabled, cpu_reset function is also defined in sysreset-uclass.c which lead to multiple definitions of this function since reset.c is build unconditionally. Add a check in Makefile to build this file only if SYSRESET isn't enabled.
SYSRESET can be enabled when building SYSRESET_PSCI for instance on this platform.
--- arch/arm/mach-at91/armv7/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-at91/armv7/Makefile +3 -1
@@ -11,7 +11,9 @@ obj-$(CONFIG_SAMA5D3) += sama5d3_devices.o clock.o obj-$(CONFIG_SAMA5D4) += sama5d4_devices.o clock.o obj-$(CONFIG_SAMA7G5) += sama7g5_devices.o obj-y += cpu.o -obj-y += reset.o +ifndef CONFIG_$(SPL_TPL_)SYSRESET +obj-y += reset.o +endif ifneq ($(CONFIG_ATMEL_PIT_TIMER),y) ifneq ($(CONFIG_MCHP_PIT64B_TIMER),y) # old non-DM timer driver
Signature · 1 line
2.32.0
Quoted 6 lines · Clément Léger
When SYSRESET is enabled,
cpu_resetfunction is also defined insysreset-uclass.cwhich lead to multiple definitions of this function sincereset.cis build unconditionally. Add a check inMakefileto build this file only if SYSRESET isn't enabled.
SYSRESET can be enabled when buildingSYSRESET_PSCIfor instance on this platform.
Hello Clement,
Does this mean that in fact, the cpu_reset function from the reset.c file has to be implemented as a reset driver in the sysreset uclass ?
Eugen
Quoted 24 lines
Signed-off-by Clément Léger <[email protected]>--- arch/arm/mach-at91/armv7/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/arm/mach-at91/armv7/Makefile +3
-2@@ -11,7 +11,9 @@ obj-$(CONFIG_SAMA5D3) += sama5d3_devices.o clock.o obj-$(CONFIG_SAMA5D4) += sama5d4_devices.o clock.o obj-$(CONFIG_SAMA7G5) += sama7g5_devices.o obj-y += cpu.o -obj-y += reset.o +ifndef CONFIG_$(SPL_TPL_)SYSRESET +obj-y += reset.o +endif ifneq ($(CONFIG_ATMEL_PIT_TIMER),y) ifneq ($(CONFIG_MCHP_PIT64B_TIMER),y) # old non-DM timer driver --2.32.0
Quoted 8 lines · Le Mon, 23 Aug 2021 07:42:58 +0000, <[email protected]> a écrit :
Quoted 6 lines · Clément Léger
When SYSRESET is enabled,
cpu_resetfunction is also defined insysreset-uclass.cwhich lead to multiple definitions of this function sincereset.cis build unconditionally. Add a check inMakefileto build this file only if SYSRESET isn't enabled. SYSRESET can be enabled when buildingSYSRESET_PSCIfor instance on this platform.
Quoted 4 lines
Hello Clement,
Does this mean that in fact, the
cpu_resetfunction from thereset.cfile has to be implemented as a reset driver in the sysreset uclass ?
Hello Eugen,
In fact, when SYSRESET is selected, the reset_cpu function is defined in sysreset-uclass.c. This function will then call the appropriate reset function according to registered reset drivers.
Clément
Quoted 28 lines
Eugen
Quoted 24 lines
Signed-off-by Clément Léger <[email protected]>--- arch/arm/mach-at91/armv7/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)(quoted diff) +0
-0b/arch/arm/mach-at91/armv7/Makefile index
f5b2665957..246050b67b100644 --- a/arch/arm/mach-at91/armv7/Makefile
+++ b/arch/arm/mach-at91/armv7/Makefilearch/arm/mach-at91/armv7/Makefile +3
-2@@ -11,7 +11,9 @@ obj-$(CONFIG_SAMA5D3) += sama5d3_devices.o clock.o obj-$(CONFIG_SAMA5D4) += sama5d4_devices.o clock.o obj-$(CONFIG_SAMA7G5) += sama7g5_devices.o obj-y += cpu.o -obj-y += reset.o +ifndef CONFIG_$(SPL_TPL_)SYSRESET +obj-y += reset.o +endif ifneq ($(CONFIG_ATMEL_PIT_TIMER),y) ifneq ($(CONFIG_MCHP_PIT64B_TIMER),y) # old non-DM timer driver --2.32.0
Signature · 3 lines
Clément Léger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com
Quoted 13 lines · Clément Léger
Quoted 10 lines · Le Mon, 23 Aug 2021 07:42:58 +0000, <[email protected]> a écrit :
Quoted 6 lines · Clément Léger
When SYSRESET is enabled,
cpu_resetfunction is also defined insysreset-uclass.cwhich lead to multiple definitions of this function sincereset.cis build unconditionally. Add a check inMakefileto build this file only if SYSRESET isn't enabled. SYSRESET can be enabled when buildingSYSRESET_PSCIfor instance on this platform.Hello Clement,
Quoted 8 lines
Quoted 2 lines
Does this mean that in fact, the
cpu_resetfunction from thereset.cfile has to be implemented as a reset driver in the sysreset uclass ?Hello Eugen,
In fact, when SYSRESET is selected, the
reset_cpufunction is defined insysreset-uclass.c. This function will then call the appropriate reset function according to registered reset drivers.
Yes, so, my assumption is then correct, the cpu_reset from reset.c should be converted to a real driver that has to be registered with the sysreset-uclass .
Meanwhile, I guess it's fine to avoid build errors when selecting the SYSRESET from menuconfig, so I will apply your patch. I wanted to make sure I fully understand the situation there.
Eugen
Quoted 39 lines
Clément
Quoted 19 lines
Eugen
Quoted 16 lines
Signed-off-by Clément Léger <[email protected]>--- arch/arm/mach-at91/armv7/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)(quoted diff) +0
-0b/arch/arm/mach-at91/armv7/Makefile index
f5b2665957..246050b67b100644 --- a/arch/arm/mach-at91/armv7/Makefile
+++ b/arch/arm/mach-at91/armv7/Makefilearch/arm/mach-at91/armv7/Makefile +1
-1@@ -11,7 +11,9 @@ obj-$(CONFIG_SAMA5D3) += sama5d3_devices.o clock.o obj-$(CONFIG_SAMA5D4) += sama5d4_devices.o clock.o obj-$(CONFIG_SAMA7G5) += sama7g5_devices.o obj-y += cpu.o -obj-y += reset.o +ifndef CONFIG_$(SPL_TPL_)SYSRESETQuoted 9 lines
Quoted 8 lines
arch/arm/mach-at91/armv7/Makefile +2
-1+obj-y += reset.o +endif ifneq ($(CONFIG_ATMEL_PIT_TIMER),y) ifneq ($(CONFIG_MCHP_PIT64B_TIMER),y) # old non-DM timer driver --2.32.0
--
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com
Quoted 20 lines · Le Tue, 24 Aug 2021 09:51:24 +0000, <[email protected]> a écrit :
Quoted 19 lines · Clément Léger
Quoted 8 lines · Le Mon, 23 Aug 2021 07:42:58 +0000, <[email protected]> a écrit :
Quoted 6 lines · Clément Léger
When SYSRESET is enabled,
cpu_resetfunction is also defined insysreset-uclass.cwhich lead to multiple definitions of this function sincereset.cis build unconditionally. Add a check inMakefileto build this file only if SYSRESET isn't enabled. SYSRESET can be enabled when buildingSYSRESET_PSCIfor instance on this platform.Quoted 5 lines
Hello Clement,
Does this mean that in fact, the
cpu_resetfunction from thereset.cfile has to be implemented as a reset driver in the sysreset uclass ?Hello Eugen,
Quoted 7 lines
Quoted 3 lines
In fact, when SYSRESET is selected, the
reset_cpufunction is defined insysreset-uclass.c. This function will then call the appropriate reset function according to registered reset drivers.Yes, so, my assumption is then correct, the
cpu_resetfromreset.cshould be converted to a real driver that has to be registered with the sysreset-uclass .
Oh yes, sorry I did not understood you were talking about converting the sama5d2 reset driver to a read sysreset driver.
Quoted 4 lines
Meanwhile, I guess it's fine to avoid build errors when selecting the SYSRESET from menuconfig, so I will apply your patch. I wanted to make sure I fully understand the situation there.
Yes, this allows to build using another sysreset driver in the meantime.
Clément
Quoted 43 lines
Eugen
Quoted 39 lines
Clément
Quoted 19 lines
Eugen
Quoted 16 lines
Signed-off-by Clément Léger <[email protected]>--- arch/arm/mach-at91/armv7/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)(quoted diff) +0
-0b/arch/arm/mach-at91/armv7/Makefile index
f5b2665957..246050b67b100644 --- a/arch/arm/mach-at91/armv7/Makefile
+++ b/arch/arm/mach-at91/armv7/Makefile(quoted diff) +0
-0@@ -11,7 +11,9 @@ obj-$(CONFIG_SAMA5D3) += sama5d3_devices.oclock.o obj-$(CONFIG_SAMA5D4) += sama5d4_devices.o clock.o
obj-$(CONFIG_SAMA7G5) += sama7g5_devices.o obj-y += cpu.oarch/arm/mach-at91/armv7/Makefile +1
-1-obj-y += reset.o +ifndef CONFIG_$(SPL_TPL_)SYSRESETQuoted 9 lines
Quoted 8 lines
arch/arm/mach-at91/armv7/Makefile +2
-1+obj-y += reset.o +endif ifneq ($(CONFIG_ATMEL_PIT_TIMER),y) ifneq ($(CONFIG_MCHP_PIT64B_TIMER),y) # old non-DM timer driver --2.32.0
--
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com
Signature · 3 lines
Clément Léger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com