[PATCH 4/4] reset: Remove addr parameter from reset_cpu()
Simon Glass
sjg at chromium.org
Sat Dec 19 03:28:39 CET 2020
On Tue, 15 Dec 2020 at 08:48, Harald Seiler <hws at denx.de> 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 <hws at denx.de>
> ---
> 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/nds32/cpu/n1213/ag101/cpu.c | 2 +-
> arch/nds32/lib/interrupts.c | 2 +-
> arch/sandbox/cpu/sdl.c | 4 ++--
> arch/sh/cpu/sh4/cpu.c | 2 +-
> arch/sh/cpu/sh4/watchdog.c | 2 +-
> arch/x86/cpu/ivybridge/cpu.c | 2 +-
> board/BuR/brppt2/board.c | 2 +-
> board/abilis/tb100/tb100.c | 2 +-
> board/advantech/imx8qm_rom7720_a1/imx8qm_rom7720_a1.c | 2 +-
> board/armltd/total_compute/total_compute.c | 2 +-
> board/armltd/vexpress/vexpress_common.c | 2 +-
> board/armltd/vexpress64/vexpress64.c | 2 +-
> board/atmark-techno/armadillo-800eva/armadillo-800eva.c | 2 +-
> board/beacon/beacon-rzg2m/beacon-rzg2m.c | 2 +-
> board/bosch/shc/board.c | 2 +-
> board/broadcom/bcmns2/northstar2.c | 2 +-
> board/broadcom/bcmns3/ns3.c | 2 +-
> board/broadcom/bcmstb/bcmstb.c | 2 +-
> board/cavium/thunderx/thunderx.c | 2 +-
> board/compulab/cm_t335/spl.c | 2 +-
> board/cortina/presidio-asic/presidio.c | 2 +-
> board/freescale/imx8qm_mek/imx8qm_mek.c | 2 +-
> board/freescale/imx8qxp_mek/imx8qxp_mek.c | 2 +-
> board/freescale/mx6memcal/spl.c | 2 +-
> board/ge/b1x5v2/spl.c | 2 +-
> board/highbank/highbank.c | 2 +-
> board/hisilicon/hikey/hikey.c | 2 +-
> board/hisilicon/hikey960/hikey960.c | 2 +-
> board/hisilicon/poplar/poplar.c | 2 +-
> board/kmc/kzm9g/kzm9g.c | 2 +-
> board/liebherr/display5/spl.c | 2 +-
> board/phytium/durian/durian.c | 2 +-
> board/qualcomm/dragonboard410c/dragonboard410c.c | 2 +-
> board/qualcomm/dragonboard820c/dragonboard820c.c | 2 +-
> board/renesas/alt/alt.c | 2 +-
> board/renesas/alt/alt_spl.c | 2 +-
> board/renesas/blanche/blanche.c | 2 +-
> board/renesas/condor/condor.c | 2 +-
> board/renesas/draak/draak.c | 2 +-
> board/renesas/eagle/eagle.c | 2 +-
> board/renesas/ebisu/ebisu.c | 2 +-
> board/renesas/gose/gose.c | 2 +-
> board/renesas/gose/gose_spl.c | 2 +-
> board/renesas/grpeach/grpeach.c | 2 +-
> board/renesas/koelsch/koelsch.c | 2 +-
> board/renesas/koelsch/koelsch_spl.c | 2 +-
> board/renesas/lager/lager.c | 2 +-
> board/renesas/lager/lager_spl.c | 2 +-
> board/renesas/porter/porter.c | 2 +-
> board/renesas/porter/porter_spl.c | 2 +-
> board/renesas/rcar-common/gen3-spl.c | 2 +-
> board/renesas/salvator-x/salvator-x.c | 2 +-
> board/renesas/silk/silk.c | 2 +-
> board/renesas/silk/silk_spl.c | 2 +-
> board/renesas/stout/cpld.c | 2 +-
> board/renesas/stout/stout_spl.c | 2 +-
> board/siemens/capricorn/board.c | 2 +-
> board/synopsys/emsdp/emsdp.c | 2 +-
> board/synopsys/iot_devkit/iot_devkit.c | 2 +-
> board/technexion/pico-imx6ul/spl.c | 2 +-
> board/technexion/pico-imx7d/spl.c | 2 +-
> board/toradex/apalis-imx8/apalis-imx8.c | 2 +-
> board/toradex/apalis-imx8x/apalis-imx8x.c | 2 +-
> board/toradex/apalis_imx6/apalis_imx6.c | 2 +-
> board/toradex/colibri-imx8x/colibri-imx8x.c | 2 +-
> board/toradex/colibri_imx6/colibri_imx6.c | 2 +-
> board/toradex/colibri_imx7/colibri_imx7.c | 2 +-
> board/xen/xenguest_arm64/xenguest_arm64.c | 2 +-
> board/xilinx/versal/board.c | 2 +-
> board/xilinx/zynqmp/zynqmp.c | 2 +-
> cmd/tpm_test.c | 2 +-
> drivers/sysreset/sysreset-uclass.c | 2 +-
> drivers/watchdog/imx_watchdog.c | 2 +-
> drivers/watchdog/ulp_wdog.c | 2 +-
> include/cpu_func.h | 4 ++--
> include/sysreset.h | 2 +-
> 134 files changed, 142 insertions(+), 142 deletions(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list