summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-06-02 09:57:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-09-15 14:42:49 +0200
commit119d453c0b40d4a477781626f944d74d439956da (patch)
treef9fab4e0334d7e89d4761adedd0ae0a6ab6895da
parentb8ae5933bb138ad156af38fdb3226e14dc762f8f (diff)
downloadbarebox-119d453c0b40d4a477781626f944d74d439956da.tar.gz
barebox-119d453c0b40d4a477781626f944d74d439956da.tar.xz
restart: give all restart handlers a descriptive name
With incoming changes to choose a specific reset method, give all currently unnamed "default" reset handlers a name: - soc reset via SoC-specific means - soc-wdt reset via SoC watchdog timer - vector reset via jump to reset vector - efi reset via EFI firmware Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c2
-rw-r--r--arch/arm/mach-at91/at91sam9260.c2
-rw-r--r--arch/arm/mach-at91/at91sam9261.c2
-rw-r--r--arch/arm/mach-at91/at91sam9263.c2
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c2
-rw-r--r--arch/arm/mach-at91/at91sam9n12.c2
-rw-r--r--arch/arm/mach-at91/at91sam9x5.c2
-rw-r--r--arch/arm/mach-at91/sama5d3.c2
-rw-r--r--arch/arm/mach-at91/sama5d4.c2
-rw-r--r--arch/arm/mach-clps711x/reset.c2
-rw-r--r--arch/arm/mach-davinci/time.c2
-rw-r--r--arch/arm/mach-ep93xx/clocksource.c2
-rw-r--r--arch/arm/mach-highbank/reset.c2
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.c2
-rw-r--r--arch/arm/mach-mvebu/dove.c2
-rw-r--r--arch/arm/mach-mvebu/kirkwood.c2
-rw-r--r--arch/arm/mach-mxs/soc-imx23.c2
-rw-r--r--arch/arm/mach-mxs/soc-imx28.c2
-rw-r--r--arch/arm/mach-nomadik/reset.c2
-rw-r--r--arch/arm/mach-omap/am33xx_generic.c2
-rw-r--r--arch/arm/mach-omap/omap3_generic.c2
-rw-r--r--arch/arm/mach-omap/omap4_generic.c2
-rw-r--r--arch/arm/mach-pxa/common.c2
-rw-r--r--arch/arm/mach-rockchip/rk3188.c2
-rw-r--r--arch/arm/mach-rockchip/rk3288.c2
-rw-r--r--arch/arm/mach-samsung/generic.c2
-rw-r--r--arch/arm/mach-socfpga/arria10-generic.c2
-rw-r--r--arch/arm/mach-socfpga/cyclone5-reset-manager.c2
-rw-r--r--arch/arm/mach-tegra/tegra20-pmc.c2
-rw-r--r--arch/arm/mach-versatile/core.c2
-rw-r--r--arch/arm/mach-vexpress/reset.c2
-rw-r--r--arch/arm/mach-zynq/zynq.c2
-rw-r--r--arch/kvx/cpu/reset.c2
-rw-r--r--arch/mips/mach-ar231x/ar231x_reset.c2
-rw-r--r--arch/mips/mach-ath79/reset.c2
-rw-r--r--arch/mips/mach-bcm47xx/reset.c2
-rw-r--r--arch/mips/mach-loongson/loongson1_reset.c2
-rw-r--r--arch/mips/mach-malta/reset.c2
-rw-r--r--arch/nios2/cpu/cpu.c2
-rw-r--r--arch/openrisc/cpu/cpu.c2
-rw-r--r--arch/powerpc/mach-mpc5xxx/cpu.c2
-rw-r--r--arch/powerpc/mach-mpc85xx/cpu.c2
-rw-r--r--common/efi/efi.c2
-rw-r--r--common/restart.c5
-rw-r--r--include/restart.h3
45 files changed, 49 insertions, 45 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index 975cd956c9..f89983fe63 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -88,7 +88,7 @@ static void __noreturn at91rm9200_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(at91rm9200_restart_soc);
+ restart_handler_register_fn("soc-wdt", at91rm9200_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 56327a2c47..fdd8ea014e 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -243,7 +243,7 @@ static void at91sam9260_initialize(void)
at91_add_pit(AT91SAM9260_BASE_PIT);
at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9260_BASE_SMC, 0x200);
- restart_handler_register_fn(at91sam9260_restart);
+ restart_handler_register_fn("soc", at91sam9260_restart);
}
static int at91sam9260_setup(void)
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 4abc556354..0465ed9524 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -235,7 +235,7 @@ static void at91sam9261_initialize(void)
at91_add_pit(AT91SAM9261_BASE_PIT);
at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9261_BASE_SMC, 0x200);
- restart_handler_register_fn(at91sam9261_restart);
+ restart_handler_register_fn("soc", at91sam9261_restart);
}
static int at91sam9261_setup(void)
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 690f8e06bb..dc5dddfb64 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -256,7 +256,7 @@ static void at91sam9263_initialize(void)
at91_add_sam9_smc(0, AT91SAM9263_BASE_SMC0, 0x200);
at91_add_sam9_smc(1, AT91SAM9263_BASE_SMC1, 0x200);
- restart_handler_register_fn(at91sam9263_restart);
+ restart_handler_register_fn("soc", at91sam9263_restart);
}
static int at91sam9263_setup(void)
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 569aa274fc..affc624b1d 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -270,7 +270,7 @@ static void at91sam9g45_initialize(void)
at91_add_pit(AT91SAM9G45_BASE_PIT);
at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9G45_BASE_SMC, 0x200);
- restart_handler_register_fn(at91sam9g45_restart);
+ restart_handler_register_fn("soc", at91sam9g45_restart);
}
static int at91sam9g45_setup(void)
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index 365bded56e..850d34604a 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -226,7 +226,7 @@ static void at91sam9n12_initialize(void)
at91_add_pit(AT91SAM9N12_BASE_PIT);
at91_add_sam9_smc(DEVICE_ID_SINGLE, AT91SAM9N12_BASE_SMC, 0x200);
- restart_handler_register_fn(at91sam9n12_restart);
+ restart_handler_register_fn("soc", at91sam9n12_restart);
}
static int at91sam9n12_setup(void)
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index 40ba9ed56e..086e27a79f 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -13,7 +13,7 @@ static void at91sam9x5_restart(struct restart_handler *rst)
static int at91sam9x5_initialize(void)
{
- restart_handler_register_fn(at91sam9x5_restart);
+ restart_handler_register_fn("soc", at91sam9x5_restart);
return 0;
}
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index a5d464eca0..b1e7b2c565 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -397,7 +397,7 @@ static void sama5d3_initialize(void)
at91_add_pit(SAMA5D3_BASE_PIT);
at91_add_sam9_smc(DEVICE_ID_SINGLE, SAMA5D3_BASE_HSMC + 0x600, 0xa0);
- restart_handler_register_fn(sama5d3_restart);
+ restart_handler_register_fn("soc", sama5d3_restart);
}
static int sama5d3_setup(void)
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index ca09dfe425..62e466fe51 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -305,7 +305,7 @@ static void sama5d4_initialize(void)
at91_add_pit(SAMA5D4_BASE_PIT);
at91_add_sam9_smc(DEVICE_ID_SINGLE, SAMA5D4_BASE_HSMC + 0x600, 0xa0);
- restart_handler_register_fn(sama5d4_restart);
+ restart_handler_register_fn("soc", sama5d4_restart);
}
static int sama5d4_setup(void)
diff --git a/arch/arm/mach-clps711x/reset.c b/arch/arm/mach-clps711x/reset.c
index 03f40b73fa..90ddb8f5d2 100644
--- a/arch/arm/mach-clps711x/reset.c
+++ b/arch/arm/mach-clps711x/reset.c
@@ -22,7 +22,7 @@ static void __noreturn clps711x_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(clps711x_restart_soc);
+ restart_handler_register_fn("vector", clps711x_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 4d1b570aa0..5b57fe6192 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -210,7 +210,7 @@ static void __noreturn davinci_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(davinci_restart_soc);
+ restart_handler_register_fn("soc-wdt", davinci_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-ep93xx/clocksource.c b/arch/arm/mach-ep93xx/clocksource.c
index 4fdcc36b1c..1f3ff7f8f2 100644
--- a/arch/arm/mach-ep93xx/clocksource.c
+++ b/arch/arm/mach-ep93xx/clocksource.c
@@ -85,7 +85,7 @@ static void __noreturn ep92xx_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(ep92xx_restart_soc);
+ restart_handler_register_fn("soc", ep92xx_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-highbank/reset.c b/arch/arm/mach-highbank/reset.c
index d73a0a76a5..ea3908ec2b 100644
--- a/arch/arm/mach-highbank/reset.c
+++ b/arch/arm/mach-highbank/reset.c
@@ -33,7 +33,7 @@ static void __noreturn highbank_poweroff(struct poweroff_handler *handler)
static int highbank_init(void)
{
- restart_handler_register_fn(highbank_restart_soc);
+ restart_handler_register_fn("soc", highbank_restart_soc);
poweroff_handler_register_fn(highbank_poweroff);
return 0;
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 2589f4fe72..9a35c51985 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -132,7 +132,7 @@ static int armada_370_xp_init_soc(void)
if (!of_machine_is_compatible("marvell,armada-370-xp"))
return 0;
- restart_handler_register_fn(armada_370_xp_restart_soc);
+ restart_handler_register_fn("soc", armada_370_xp_restart_soc);
barebox_set_model("Marvell Armada 370/XP");
barebox_set_hostname("armada");
diff --git a/arch/arm/mach-mvebu/dove.c b/arch/arm/mach-mvebu/dove.c
index 37fde63f18..3c6302dd2d 100644
--- a/arch/arm/mach-mvebu/dove.c
+++ b/arch/arm/mach-mvebu/dove.c
@@ -36,7 +36,7 @@ static int dove_init_soc(void)
if (!of_machine_is_compatible("marvell,dove"))
return 0;
- restart_handler_register_fn(dove_restart_soc);
+ restart_handler_register_fn("soc", dove_restart_soc);
barebox_set_model("Marvell Dove");
barebox_set_hostname("dove");
diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c
index 59fb95ff4a..e50d7501c8 100644
--- a/arch/arm/mach-mvebu/kirkwood.c
+++ b/arch/arm/mach-mvebu/kirkwood.c
@@ -34,7 +34,7 @@ static int kirkwood_init_soc(void)
if (!of_machine_is_compatible("marvell,kirkwood"))
return 0;
- restart_handler_register_fn(kirkwood_restart_soc);
+ restart_handler_register_fn("soc", kirkwood_restart_soc);
barebox_set_model("Marvell Kirkwood");
barebox_set_hostname("kirkwood");
diff --git a/arch/arm/mach-mxs/soc-imx23.c b/arch/arm/mach-mxs/soc-imx23.c
index f25fff18c3..8c47c766cc 100644
--- a/arch/arm/mach-mxs/soc-imx23.c
+++ b/arch/arm/mach-mxs/soc-imx23.c
@@ -49,7 +49,7 @@ static int imx23_devices_init(void)
add_generic_device("imx23-gpio", 0, NULL, IMX_IOMUXC_BASE, 0x2000, IORESOURCE_MEM, NULL);
add_generic_device("imx23-gpio", 1, NULL, IMX_IOMUXC_BASE, 0x2000, IORESOURCE_MEM, NULL);
add_generic_device("imx23-gpio", 2, NULL, IMX_IOMUXC_BASE, 0x2000, IORESOURCE_MEM, NULL);
- restart_handler_register_fn(imx23_restart_soc);
+ restart_handler_register_fn("soc", imx23_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-mxs/soc-imx28.c b/arch/arm/mach-mxs/soc-imx28.c
index 49f870b5bf..a214e2b7a6 100644
--- a/arch/arm/mach-mxs/soc-imx28.c
+++ b/arch/arm/mach-mxs/soc-imx28.c
@@ -51,7 +51,7 @@ static int imx28_init(void)
HW_CLKCTRL_WDOG_POR_DISABLE;
writel(reg, IMX_CCM_BASE + HW_CLKCTRL_RESET);
- restart_handler_register_fn(imx28_restart_soc);
+ restart_handler_register_fn("soc", imx28_restart_soc);
arm_add_mem_device("ram0", IMX_MEMORY_BASE, imx28_get_memsize());
diff --git a/arch/arm/mach-nomadik/reset.c b/arch/arm/mach-nomadik/reset.c
index 8bdaada8a1..d5266068e2 100644
--- a/arch/arm/mach-nomadik/reset.c
+++ b/arch/arm/mach-nomadik/reset.c
@@ -35,7 +35,7 @@ static void __noreturn nomadik_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(nomadik_restart_soc);
+ restart_handler_register_fn("soc", nomadik_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c
index 7577df761c..3c5cdf065c 100644
--- a/arch/arm/mach-omap/am33xx_generic.c
+++ b/arch/arm/mach-omap/am33xx_generic.c
@@ -244,7 +244,7 @@ int am33xx_init(void)
{
omap_gpmc_base = (void *)AM33XX_GPMC_BASE;
- restart_handler_register_fn(am33xx_restart_soc);
+ restart_handler_register_fn("soc", am33xx_restart_soc);
am33xx_enable_per_clocks();
diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c
index cff4a4fb11..3f6a346277 100644
--- a/arch/arm/mach-omap/omap3_generic.c
+++ b/arch/arm/mach-omap/omap3_generic.c
@@ -540,7 +540,7 @@ int omap3_init(void)
{
omap_gpmc_base = (void *)OMAP3_GPMC_BASE;
- restart_handler_register_fn(omap3_restart_soc);
+ restart_handler_register_fn("soc", omap3_restart_soc);
if (IS_ENABLED(CONFIG_RESET_SOURCE))
omap3_detect_reset_reason();
diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c
index 1f71153848..848a664064 100644
--- a/arch/arm/mach-omap/omap4_generic.c
+++ b/arch/arm/mach-omap/omap4_generic.c
@@ -535,7 +535,7 @@ int omap4_init(void)
{
omap_gpmc_base = (void *)OMAP44XX_GPMC_BASE;
- restart_handler_register_fn(omap4_restart_soc);
+ restart_handler_register_fn("soc", omap4_restart_soc);
return omap4_bootsource();
}
diff --git a/arch/arm/mach-pxa/common.c b/arch/arm/mach-pxa/common.c
index 106ca3020e..5b980cb81b 100644
--- a/arch/arm/mach-pxa/common.c
+++ b/arch/arm/mach-pxa/common.c
@@ -41,7 +41,7 @@ static void __noreturn pxa_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(pxa_restart_soc);
+ restart_handler_register_fn("soc-wdt", pxa_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-rockchip/rk3188.c b/arch/arm/mach-rockchip/rk3188.c
index e7cbf36457..572e9dc58f 100644
--- a/arch/arm/mach-rockchip/rk3188.c
+++ b/arch/arm/mach-rockchip/rk3188.c
@@ -29,7 +29,7 @@ static void __noreturn rockchip_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(rockchip_restart_soc);
+ restart_handler_register_fn("soc", rockchip_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-rockchip/rk3288.c b/arch/arm/mach-rockchip/rk3288.c
index 4e8fb4a123..9076fd9227 100644
--- a/arch/arm/mach-rockchip/rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288.c
@@ -60,7 +60,7 @@ static void rk3288_detect_reset_reason(void)
static int rk3288_init(void)
{
- restart_handler_register_fn(rockchip_restart_soc);
+ restart_handler_register_fn("soc", rockchip_restart_soc);
if (IS_ENABLED(CONFIG_RESET_SOURCE))
rk3288_detect_reset_reason();
diff --git a/arch/arm/mach-samsung/generic.c b/arch/arm/mach-samsung/generic.c
index de38d47e21..ed3d30d995 100644
--- a/arch/arm/mach-samsung/generic.c
+++ b/arch/arm/mach-samsung/generic.c
@@ -44,7 +44,7 @@ static void __noreturn samsung_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(samsung_restart_soc);
+ restart_handler_register_fn("soc-wdt", samsung_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-socfpga/arria10-generic.c b/arch/arm/mach-socfpga/arria10-generic.c
index 53ec278739..38558309f8 100644
--- a/arch/arm/mach-socfpga/arria10-generic.c
+++ b/arch/arm/mach-socfpga/arria10-generic.c
@@ -70,7 +70,7 @@ static int arria10_generic_init(void)
arria10_init_emac();
pr_debug("Register restart handler\n");
- restart_handler_register_fn(arria10_restart_soc);
+ restart_handler_register_fn("soc", arria10_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-socfpga/cyclone5-reset-manager.c b/arch/arm/mach-socfpga/cyclone5-reset-manager.c
index 8635806846..4ee90b1bb0 100644
--- a/arch/arm/mach-socfpga/cyclone5-reset-manager.c
+++ b/arch/arm/mach-socfpga/cyclone5-reset-manager.c
@@ -37,7 +37,7 @@ static void __noreturn socfpga_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(socfpga_restart_soc);
+ restart_handler_register_fn("soc", socfpga_restart_soc);
return 0;
}
diff --git a/arch/arm/mach-tegra/tegra20-pmc.c b/arch/arm/mach-tegra/tegra20-pmc.c
index f7c7ac918f..a252c995ea 100644
--- a/arch/arm/mach-tegra/tegra20-pmc.c
+++ b/arch/arm/mach-tegra/tegra20-pmc.c
@@ -246,7 +246,7 @@ static struct driver_d tegra20_pmc_driver = {
static int tegra20_pmc_init(void)
{
- restart_handler_register_fn(tegra20_restart_soc);
+ restart_handler_register_fn("soc", tegra20_restart_soc);
return platform_driver_register(&tegra20_pmc_driver);
}
coredevice_initcall(tegra20_pmc_init);
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 006d4e7231..eb94a07dc9 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -192,7 +192,7 @@ static int versatile_init(void)
amba_apb_device_add(NULL, "pl061_gpio", 1, 0x101e5000, 4096, NULL, 0);
amba_apb_device_add(NULL, "pl061_gpio", 2, 0x101e6000, 4096, NULL, 0);
amba_apb_device_add(NULL, "pl061_gpio", 3, 0x101e7000, 4096, NULL, 0);
- restart_handler_register_fn(versatile_reset_soc);
+ restart_handler_register_fn("soc", versatile_reset_soc);
return 0;
}
coredevice_initcall(versatile_init);
diff --git a/arch/arm/mach-vexpress/reset.c b/arch/arm/mach-vexpress/reset.c
index 3164ae3079..78e452936d 100644
--- a/arch/arm/mach-vexpress/reset.c
+++ b/arch/arm/mach-vexpress/reset.c
@@ -24,7 +24,7 @@ static void vexpress_reset_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(vexpress_reset_soc);
+ restart_handler_register_fn("soc-wdt", vexpress_reset_soc);
return 0;
}
diff --git a/arch/arm/mach-zynq/zynq.c b/arch/arm/mach-zynq/zynq.c
index 79a6b908e0..806aeb9130 100644
--- a/arch/arm/mach-zynq/zynq.c
+++ b/arch/arm/mach-zynq/zynq.c
@@ -69,7 +69,7 @@ static int zynq_init(void)
writel(val, 0xf8f00000);
dmb();
- restart_handler_register_fn(zynq_restart_soc);
+ restart_handler_register_fn("soc", zynq_restart_soc);
bootsource_set(zynq_bootsource_get());
diff --git a/arch/kvx/cpu/reset.c b/arch/kvx/cpu/reset.c
index c7f2018e00..df36764cb6 100644
--- a/arch/kvx/cpu/reset.c
+++ b/arch/kvx/cpu/reset.c
@@ -60,7 +60,7 @@ static int kvx_reset_init(void)
break;
}
- restart_handler_register_fn(kvx_restart_soc);
+ restart_handler_register_fn("soc", kvx_restart_soc);
return 0;
}
diff --git a/arch/mips/mach-ar231x/ar231x_reset.c b/arch/mips/mach-ar231x/ar231x_reset.c
index f88167ba4c..91414edd26 100644
--- a/arch/mips/mach-ar231x/ar231x_reset.c
+++ b/arch/mips/mach-ar231x/ar231x_reset.c
@@ -68,7 +68,7 @@ static struct driver_d ar231x_reset_driver = {
static int ar231x_reset_init(void)
{
- restart_handler_register_fn(ar2312x_restart_soc);
+ restart_handler_register_fn("soc-wdt", ar2312x_restart_soc);
return platform_driver_register(&ar231x_reset_driver);
}
coredevice_initcall(ar231x_reset_init);
diff --git a/arch/mips/mach-ath79/reset.c b/arch/mips/mach-ath79/reset.c
index b756c859d8..393ca00b08 100644
--- a/arch/mips/mach-ath79/reset.c
+++ b/arch/mips/mach-ath79/reset.c
@@ -22,7 +22,7 @@ static void __noreturn ath79_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(ath79_restart_soc);
+ restart_handler_register_fn("soc", ath79_restart_soc);
return 0;
}
diff --git a/arch/mips/mach-bcm47xx/reset.c b/arch/mips/mach-bcm47xx/reset.c
index 33dfb7b3b5..3ab9b0ce4b 100644
--- a/arch/mips/mach-bcm47xx/reset.c
+++ b/arch/mips/mach-bcm47xx/reset.c
@@ -19,7 +19,7 @@ static void __noreturn bcm47xx_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(bcm47xx_restart_soc);
+ restart_handler_register_fn("soc", bcm47xx_restart_soc);
return 0;
}
diff --git a/arch/mips/mach-loongson/loongson1_reset.c b/arch/mips/mach-loongson/loongson1_reset.c
index a6c05905de..85752f4ab8 100644
--- a/arch/mips/mach-loongson/loongson1_reset.c
+++ b/arch/mips/mach-loongson/loongson1_reset.c
@@ -20,7 +20,7 @@ static void __noreturn longhorn_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(longhorn_restart_soc);
+ restart_handler_register_fn("soc-wdt", longhorn_restart_soc);
return 0;
}
diff --git a/arch/mips/mach-malta/reset.c b/arch/mips/mach-malta/reset.c
index df7be0ae55..ad0de2741b 100644
--- a/arch/mips/mach-malta/reset.c
+++ b/arch/mips/mach-malta/reset.c
@@ -24,7 +24,7 @@ static void __noreturn malta_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(malta_restart_soc);
+ restart_handler_register_fn("soc", malta_restart_soc);
return 0;
}
diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index 62bcf40f63..9f86c911cc 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -30,7 +30,7 @@ static void __noreturn nios2_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- return restart_handler_register_fn(nios2_restart_soc);
+ return restart_handler_register_fn("vector", nios2_restart_soc);
}
coredevice_initcall(restart_register_feature);
diff --git a/arch/openrisc/cpu/cpu.c b/arch/openrisc/cpu/cpu.c
index 8afd22bdea..47d8ab4288 100644
--- a/arch/openrisc/cpu/cpu.c
+++ b/arch/openrisc/cpu/cpu.c
@@ -33,6 +33,6 @@ static void __noreturn openrisc_restart_cpu(struct restart_handler *rst)
static int restart_register_feature(void)
{
- return restart_handler_register_fn(openrisc_restart_cpu);
+ return restart_handler_register_fn("vector", openrisc_restart_cpu);
}
coredevice_initcall(restart_register_feature);
diff --git a/arch/powerpc/mach-mpc5xxx/cpu.c b/arch/powerpc/mach-mpc5xxx/cpu.c
index a85e1667bc..5cf5194aa2 100644
--- a/arch/powerpc/mach-mpc5xxx/cpu.c
+++ b/arch/powerpc/mach-mpc5xxx/cpu.c
@@ -92,7 +92,7 @@ static void __noreturn mpc5xxx_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- return restart_handler_register_fn(mpc5xxx_restart_soc);
+ return restart_handler_register_fn("soc-wdt", mpc5xxx_restart_soc);
}
coredevice_initcall(restart_register_feature);
diff --git a/arch/powerpc/mach-mpc85xx/cpu.c b/arch/powerpc/mach-mpc85xx/cpu.c
index 7c8a59edc9..efdff24e6d 100644
--- a/arch/powerpc/mach-mpc85xx/cpu.c
+++ b/arch/powerpc/mach-mpc85xx/cpu.c
@@ -42,7 +42,7 @@ static void __noreturn mpc85xx_restart_soc(struct restart_handler *rst)
static int restart_register_feature(void)
{
- restart_handler_register_fn(mpc85xx_restart_soc);
+ restart_handler_register_fn("soc", mpc85xx_restart_soc);
return 0;
}
diff --git a/common/efi/efi.c b/common/efi/efi.c
index 6f55e3970e..01003dc00f 100644
--- a/common/efi/efi.c
+++ b/common/efi/efi.c
@@ -292,7 +292,7 @@ static void __noreturn efi_poweroff_system(struct poweroff_handler *handler)
static int restart_register_feature(void)
{
- restart_handler_register_fn(efi_restart_system);
+ restart_handler_register_fn("efi", efi_restart_system);
poweroff_handler_register_fn(efi_poweroff_system);
return 0;
diff --git a/common/restart.c b/common/restart.c
index dd15c8d5c3..0f9e03765d 100644
--- a/common/restart.c
+++ b/common/restart.c
@@ -47,6 +47,7 @@ int restart_handler_register(struct restart_handler *rst)
/**
* restart_handler_register_fn() - register a handler function
+ * @name: restart method name or NULL if name should be auto-generated
* @restart_fn: The restart function
*
* convenience wrapper for restart_handler_register() to register a handler
@@ -54,13 +55,15 @@ int restart_handler_register(struct restart_handler *rst)
*
* return: 0 for success or negative error code
*/
-int restart_handler_register_fn(void (*restart_fn)(struct restart_handler *))
+int restart_handler_register_fn(const char *name,
+ void (*restart_fn)(struct restart_handler *))
{
struct restart_handler *rst;
int ret;
rst = xzalloc(sizeof(*rst));
+ rst->name = xstrdup(name);
rst->restart = restart_fn;
ret = restart_handler_register(rst);
diff --git a/include/restart.h b/include/restart.h
index 6880b03b93..e7dd1bd2b7 100644
--- a/include/restart.h
+++ b/include/restart.h
@@ -12,7 +12,8 @@ struct restart_handler {
};
int restart_handler_register(struct restart_handler *);
-int restart_handler_register_fn(void (*restart_fn)(struct restart_handler *));
+int restart_handler_register_fn(const char *name,
+ void (*restart_fn)(struct restart_handler *));
#define RESTART_DEFAULT_PRIORITY 100