All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: mach-at91: fix multiple cpu_reset definition when enabling SYSRESET
@ 2021-08-04 14:55 Clément Léger
  2021-08-23  7:42 ` Eugen.Hristev
  0 siblings, 1 reply; 5+ messages in thread
From: Clément Léger @ 2021-08-04 14:55 UTC (permalink / raw)
  To: u-boot, Eugen Hristev; +Cc: Clément Léger

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.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 arch/arm/mach-at91/armv7/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/armv7/Makefile b/arch/arm/mach-at91/armv7/Makefile
index f5b2665957..246050b67b 100644
--- a/arch/arm/mach-at91/armv7/Makefile
+++ b/arch/arm/mach-at91/armv7/Makefile
@@ -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


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

* Re: [PATCH] ARM: mach-at91: fix multiple cpu_reset definition when enabling SYSRESET
  2021-08-04 14:55 [PATCH] ARM: mach-at91: fix multiple cpu_reset definition when enabling SYSRESET Clément Léger
@ 2021-08-23  7:42 ` Eugen.Hristev
  2021-08-24  9:37   ` Clément Léger
  0 siblings, 1 reply; 5+ messages in thread
From: Eugen.Hristev @ 2021-08-23  7:42 UTC (permalink / raw)
  To: clement.leger, u-boot

On 8/4/21 5:55 PM, Clément Léger wrote:
> 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.

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

> 
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
> ---
>   arch/arm/mach-at91/armv7/Makefile | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-at91/armv7/Makefile b/arch/arm/mach-at91/armv7/Makefile
> index f5b2665957..246050b67b 100644
> --- a/arch/arm/mach-at91/armv7/Makefile
> +++ b/arch/arm/mach-at91/armv7/Makefile
> @@ -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
> 


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

* Re: [PATCH] ARM: mach-at91: fix multiple cpu_reset definition when enabling SYSRESET
  2021-08-23  7:42 ` Eugen.Hristev
@ 2021-08-24  9:37   ` Clément Léger
  2021-08-24  9:51     ` Eugen.Hristev
  0 siblings, 1 reply; 5+ messages in thread
From: Clément Léger @ 2021-08-24  9:37 UTC (permalink / raw)
  To: Eugen.Hristev; +Cc: u-boot

Le Mon, 23 Aug 2021 07:42:58 +0000,
<Eugen.Hristev@microchip.com> a écrit :

> On 8/4/21 5:55 PM, Clément Léger wrote:
> > 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.  
> 
> 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 ?

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

> 
> Eugen
> 
> > 
> > Signed-off-by: Clément Léger <clement.leger@bootlin.com>
> > ---
> >   arch/arm/mach-at91/armv7/Makefile | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/mach-at91/armv7/Makefile
> > b/arch/arm/mach-at91/armv7/Makefile index f5b2665957..246050b67b
> > 100644 --- a/arch/arm/mach-at91/armv7/Makefile
> > +++ b/arch/arm/mach-at91/armv7/Makefile
> > @@ -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
> >   
> 



-- 
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com

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

* Re: [PATCH] ARM: mach-at91: fix multiple cpu_reset definition when enabling SYSRESET
  2021-08-24  9:37   ` Clément Léger
@ 2021-08-24  9:51     ` Eugen.Hristev
  2021-08-25 18:55       ` Clément Léger
  0 siblings, 1 reply; 5+ messages in thread
From: Eugen.Hristev @ 2021-08-24  9:51 UTC (permalink / raw)
  To: clement.leger; +Cc: u-boot

On 8/24/21 12:37 PM, Clément Léger wrote:
> Le Mon, 23 Aug 2021 07:42:58 +0000,
> <Eugen.Hristev@microchip.com> a écrit :
> 
>> On 8/4/21 5:55 PM, Clément Léger wrote:
>>> 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.
>>
>> 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 ?
> 
> 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.

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

> 
> Clément
> 
>>
>> Eugen
>>
>>>
>>> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
>>> ---
>>>    arch/arm/mach-at91/armv7/Makefile | 4 +++-
>>>    1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/mach-at91/armv7/Makefile
>>> b/arch/arm/mach-at91/armv7/Makefile index f5b2665957..246050b67b
>>> 100644 --- a/arch/arm/mach-at91/armv7/Makefile
>>> +++ b/arch/arm/mach-at91/armv7/Makefile
>>> @@ -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
>>>
>>
> 
> 
> 
> --
> Clément Léger,
> Embedded Linux and Kernel engineer at Bootlin
> https://bootlin.com
> 


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

* Re: [PATCH] ARM: mach-at91: fix multiple cpu_reset definition when enabling SYSRESET
  2021-08-24  9:51     ` Eugen.Hristev
@ 2021-08-25 18:55       ` Clément Léger
  0 siblings, 0 replies; 5+ messages in thread
From: Clément Léger @ 2021-08-25 18:55 UTC (permalink / raw)
  To: Eugen.Hristev; +Cc: u-boot

Le Tue, 24 Aug 2021 09:51:24 +0000,
<Eugen.Hristev@microchip.com> a écrit :

> On 8/24/21 12:37 PM, Clément Léger wrote:
> > Le Mon, 23 Aug 2021 07:42:58 +0000,
> > <Eugen.Hristev@microchip.com> a écrit :
> >   
> >> On 8/4/21 5:55 PM, Clément Léger wrote:  
> >>> 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.  
> >>
> >> 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 ?  
> > 
> > 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.  
> 
> 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 .

Oh yes, sorry I did not understood you were talking about converting the
sama5d2 reset driver to a read sysreset driver.

> 
> 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

> 
> Eugen
> 
> > 
> > Clément
> >   
> >>
> >> Eugen
> >>  
> >>>
> >>> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
> >>> ---
> >>>    arch/arm/mach-at91/armv7/Makefile | 4 +++-
> >>>    1 file changed, 3 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/arch/arm/mach-at91/armv7/Makefile
> >>> b/arch/arm/mach-at91/armv7/Makefile index f5b2665957..246050b67b
> >>> 100644 --- a/arch/arm/mach-at91/armv7/Makefile
> >>> +++ b/arch/arm/mach-at91/armv7/Makefile
> >>> @@ -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
> >>>  
> >>  
> > 
> > 
> > 
> > --
> > Clément Léger,
> > Embedded Linux and Kernel engineer at Bootlin
> > https://bootlin.com
> >   
> 



-- 
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com

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

end of thread, other threads:[~2021-08-25 18:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 14:55 [PATCH] ARM: mach-at91: fix multiple cpu_reset definition when enabling SYSRESET Clément Léger
2021-08-23  7:42 ` Eugen.Hristev
2021-08-24  9:37   ` Clément Léger
2021-08-24  9:51     ` Eugen.Hristev
2021-08-25 18:55       ` Clément Léger

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.