Re: [PATCH 4/4] reset: Remove addr parameter from reset_cpu()

2021-03-03 Thread Tom Rini
On Tue, Dec 15, 2020 at 04:47:52PM +0100, Harald Seiler wrote:

> Historically, the reset_cpu() function had an `addr` parameter which was
> meant to pass in an address of the reset vector location, where the CPU
> should reset to.  This feature is no longer used anywhere in U-Boot as
> all reset_cpu() implementations now ignore the passed value.  Generic
> code has been added which always calls reset_cpu() with `0` which means
> this feature can no longer be used easily anyway.
> 
> Over time, many implementations seem to have "misunderstood" the
> existence of this parameter as a way to customize/parameterize the reset
> (e.g.  COLD vs WARM resets).  As this is not properly supported, the
> code will almost always not do what it is intended to (because all
> call-sites just call reset_cpu() with 0).
> 
> To avoid confusion and to clean up the codebase from unused left-overs
> of the past, remove the `addr` parameter entirely.  Code which intends
> to support different kinds of resets should be rewritten as a sysreset
> driver instead.
> 
> This transformation was done with the following coccinelle patch:
> 
> @@
> expression argvalue;
> @@
> - reset_cpu(argvalue)
> + reset_cpu()
> 
> @@
> identifier argname;
> type argtype;
> @@
> - reset_cpu(argtype argname)
> + reset_cpu(void)
> { ... }
> 
> Signed-off-by: Harald Seiler 
> Reviewed-by: Simon Glass 

Applied to u-boot/next, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 4/4] reset: Remove addr parameter from reset_cpu()

2020-12-18 Thread Simon Glass
On Tue, 15 Dec 2020 at 08:48, Harald Seiler  wrote:
>
> Historically, the reset_cpu() function had an `addr` parameter which was
> meant to pass in an address of the reset vector location, where the CPU
> should reset to.  This feature is no longer used anywhere in U-Boot as
> all reset_cpu() implementations now ignore the passed value.  Generic
> code has been added which always calls reset_cpu() with `0` which means
> this feature can no longer be used easily anyway.
>
> Over time, many implementations seem to have "misunderstood" the
> existence of this parameter as a way to customize/parameterize the reset
> (e.g.  COLD vs WARM resets).  As this is not properly supported, the
> code will almost always not do what it is intended to (because all
> call-sites just call reset_cpu() with 0).
>
> To avoid confusion and to clean up the codebase from unused left-overs
> of the past, remove the `addr` parameter entirely.  Code which intends
> to support different kinds of resets should be rewritten as a sysreset
> driver instead.
>
> This transformation was done with the following coccinelle patch:
>
> @@
> expression argvalue;
> @@
> - reset_cpu(argvalue)
> + reset_cpu()
>
> @@
> identifier argname;
> type argtype;
> @@
> - reset_cpu(argtype argname)
> + reset_cpu(void)
> { ... }
>
> Signed-off-by: Harald Seiler 
> ---
>  arch/arc/lib/reset.c| 4 ++--
>  arch/arm/cpu/arm920t/ep93xx/cpu.c   | 2 +-
>  arch/arm/cpu/arm920t/imx/timer.c| 2 +-
>  arch/arm/cpu/arm926ejs/armada100/timer.c| 2 +-
>  arch/arm/cpu/arm926ejs/mx25/reset.c | 2 +-
>  arch/arm/cpu/arm926ejs/mx27/reset.c | 2 +-
>  arch/arm/cpu/arm926ejs/mxs/mxs.c| 4 ++--
>  arch/arm/cpu/arm926ejs/spear/reset.c| 2 +-
>  arch/arm/cpu/arm946es/cpu.c | 2 +-
>  arch/arm/cpu/armv7/bcm281xx/reset.c | 2 +-
>  arch/arm/cpu/armv7/bcmcygnus/reset.c| 2 +-
>  arch/arm/cpu/armv7/bcmnsp/reset.c   | 2 +-
>  arch/arm/cpu/armv7/ls102xa/cpu.c| 2 +-
>  arch/arm/cpu/armv7/s5p4418/cpu.c| 2 +-
>  arch/arm/cpu/armv7/stv0991/reset.c  | 2 +-
>  arch/arm/cpu/armv7m/cpu.c   | 2 +-
>  arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 4 ++--
>  arch/arm/cpu/armv8/s32v234/generic.c| 2 +-
>  arch/arm/cpu/pxa/pxa2xx.c   | 4 ++--
>  arch/arm/cpu/sa1100/cpu.c   | 2 +-
>  arch/arm/lib/interrupts.c   | 2 +-
>  arch/arm/lib/interrupts_m.c | 2 +-
>  arch/arm/lib/reset.c| 2 +-
>  arch/arm/mach-at91/arm920t/reset.c  | 2 +-
>  arch/arm/mach-at91/arm926ejs/reset.c| 2 +-
>  arch/arm/mach-at91/armv7/reset.c| 2 +-
>  arch/arm/mach-bcm283x/reset.c   | 2 +-
>  arch/arm/mach-davinci/reset.c   | 2 +-
>  arch/arm/mach-exynos/soc.c  | 2 +-
>  arch/arm/mach-imx/imx8m/soc.c   | 2 +-
>  arch/arm/mach-imx/mx7ulp/soc.c  | 2 +-
>  arch/arm/mach-k3/common.c   | 2 +-
>  arch/arm/mach-keystone/ddr3.c   | 4 ++--
>  arch/arm/mach-keystone/init.c   | 2 +-
>  arch/arm/mach-kirkwood/cpu.c| 2 +-
>  arch/arm/mach-lpc32xx/cpu.c | 2 +-
>  arch/arm/mach-mediatek/mt7622/init.c| 2 +-
>  arch/arm/mach-mediatek/mt8512/init.c| 2 +-
>  arch/arm/mach-mediatek/mt8516/init.c| 2 +-
>  arch/arm/mach-mediatek/mt8518/init.c| 2 +-
>  arch/arm/mach-meson/board-common.c  | 4 ++--
>  arch/arm/mach-mvebu/armada3700/cpu.c| 2 +-
>  arch/arm/mach-mvebu/armada8k/cpu.c  | 2 +-
>  arch/arm/mach-mvebu/cpu.c   | 2 +-
>  arch/arm/mach-octeontx/cpu.c| 2 +-
>  arch/arm/mach-octeontx2/cpu.c   | 2 +-
>  arch/arm/mach-omap2/omap5/hwinit.c  | 2 +-
>  arch/arm/mach-omap2/reset.c | 2 +-
>  arch/arm/mach-orion5x/cpu.c | 2 +-
>  arch/arm/mach-owl/soc.c | 2 +-
>  arch/arm/mach-socfpga/include/mach/reset_manager.h  | 2 +-
>  arch/arm/mach-sunxi/board.c | 2 +-
>  arch/arm/mach-tegra/cmd_enterrcm.c  | 2 +-
>  arch/arm/mach-tegra/pmc.c   | 2 +-
>  arch/arm/mach-uniphier/arm32/psci.c

[PATCH 4/4] reset: Remove addr parameter from reset_cpu()

2020-12-15 Thread Harald Seiler
Historically, the reset_cpu() function had an `addr` parameter which was
meant to pass in an address of the reset vector location, where the CPU
should reset to.  This feature is no longer used anywhere in U-Boot as
all reset_cpu() implementations now ignore the passed value.  Generic
code has been added which always calls reset_cpu() with `0` which means
this feature can no longer be used easily anyway.

Over time, many implementations seem to have "misunderstood" the
existence of this parameter as a way to customize/parameterize the reset
(e.g.  COLD vs WARM resets).  As this is not properly supported, the
code will almost always not do what it is intended to (because all
call-sites just call reset_cpu() with 0).

To avoid confusion and to clean up the codebase from unused left-overs
of the past, remove the `addr` parameter entirely.  Code which intends
to support different kinds of resets should be rewritten as a sysreset
driver instead.

This transformation was done with the following coccinelle patch:

@@
expression argvalue;
@@
- reset_cpu(argvalue)
+ reset_cpu()

@@
identifier argname;
type argtype;
@@
- reset_cpu(argtype argname)
+ reset_cpu(void)
{ ... }

Signed-off-by: Harald Seiler 
---
 arch/arc/lib/reset.c| 4 ++--
 arch/arm/cpu/arm920t/ep93xx/cpu.c   | 2 +-
 arch/arm/cpu/arm920t/imx/timer.c| 2 +-
 arch/arm/cpu/arm926ejs/armada100/timer.c| 2 +-
 arch/arm/cpu/arm926ejs/mx25/reset.c | 2 +-
 arch/arm/cpu/arm926ejs/mx27/reset.c | 2 +-
 arch/arm/cpu/arm926ejs/mxs/mxs.c| 4 ++--
 arch/arm/cpu/arm926ejs/spear/reset.c| 2 +-
 arch/arm/cpu/arm946es/cpu.c | 2 +-
 arch/arm/cpu/armv7/bcm281xx/reset.c | 2 +-
 arch/arm/cpu/armv7/bcmcygnus/reset.c| 2 +-
 arch/arm/cpu/armv7/bcmnsp/reset.c   | 2 +-
 arch/arm/cpu/armv7/ls102xa/cpu.c| 2 +-
 arch/arm/cpu/armv7/s5p4418/cpu.c| 2 +-
 arch/arm/cpu/armv7/stv0991/reset.c  | 2 +-
 arch/arm/cpu/armv7m/cpu.c   | 2 +-
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 4 ++--
 arch/arm/cpu/armv8/s32v234/generic.c| 2 +-
 arch/arm/cpu/pxa/pxa2xx.c   | 4 ++--
 arch/arm/cpu/sa1100/cpu.c   | 2 +-
 arch/arm/lib/interrupts.c   | 2 +-
 arch/arm/lib/interrupts_m.c | 2 +-
 arch/arm/lib/reset.c| 2 +-
 arch/arm/mach-at91/arm920t/reset.c  | 2 +-
 arch/arm/mach-at91/arm926ejs/reset.c| 2 +-
 arch/arm/mach-at91/armv7/reset.c| 2 +-
 arch/arm/mach-bcm283x/reset.c   | 2 +-
 arch/arm/mach-davinci/reset.c   | 2 +-
 arch/arm/mach-exynos/soc.c  | 2 +-
 arch/arm/mach-imx/imx8m/soc.c   | 2 +-
 arch/arm/mach-imx/mx7ulp/soc.c  | 2 +-
 arch/arm/mach-k3/common.c   | 2 +-
 arch/arm/mach-keystone/ddr3.c   | 4 ++--
 arch/arm/mach-keystone/init.c   | 2 +-
 arch/arm/mach-kirkwood/cpu.c| 2 +-
 arch/arm/mach-lpc32xx/cpu.c | 2 +-
 arch/arm/mach-mediatek/mt7622/init.c| 2 +-
 arch/arm/mach-mediatek/mt8512/init.c| 2 +-
 arch/arm/mach-mediatek/mt8516/init.c| 2 +-
 arch/arm/mach-mediatek/mt8518/init.c| 2 +-
 arch/arm/mach-meson/board-common.c  | 4 ++--
 arch/arm/mach-mvebu/armada3700/cpu.c| 2 +-
 arch/arm/mach-mvebu/armada8k/cpu.c  | 2 +-
 arch/arm/mach-mvebu/cpu.c   | 2 +-
 arch/arm/mach-octeontx/cpu.c| 2 +-
 arch/arm/mach-octeontx2/cpu.c   | 2 +-
 arch/arm/mach-omap2/omap5/hwinit.c  | 2 +-
 arch/arm/mach-omap2/reset.c | 2 +-
 arch/arm/mach-orion5x/cpu.c | 2 +-
 arch/arm/mach-owl/soc.c | 2 +-
 arch/arm/mach-socfpga/include/mach/reset_manager.h  | 2 +-
 arch/arm/mach-sunxi/board.c | 2 +-
 arch/arm/mach-tegra/cmd_enterrcm.c  | 2 +-
 arch/arm/mach-tegra/pmc.c   | 2 +-
 arch/arm/mach-uniphier/arm32/psci.c | 2 +-
 arch/arm/mach-uniphier/reset.c  | 2 +-
 arch/arm/mach-zynq/cpu.c| 2 +-
 arch/arm/mach-zynqmp-r5/cpu.c   | 2 +-
 arch/nds3