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 975cd956c..f89983fe6 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 56327a2c4..fdd8ea014 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 4abc55635..0465ed952 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 690f8e06b..dc5dddfb6 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 569aa274f..affc624b1 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 365bded56..850d34604 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 40ba9ed56..086e27a79 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 a5d464eca..b1e7b2c56 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 ca09dfe42..62e466fe5 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 03f40b73f..90ddb8f5d 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 4d1b570aa..5b57fe619 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 4fdcc36b1..1f3ff7f8f 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 d73a0a76a..ea3908ec2 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 2589f4fe7..9a35c5198 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 37fde63f1..3c6302dd2 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 59fb95ff4..e50d7501c 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 f25fff18c..8c47c766c 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 49f870b5b..a214e2b7a 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 8bdaada8a..d5266068e 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 7577df761..3c5cdf065 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 cff4a4fb1..3f6a34627 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 1f7115384..848a66406 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 106ca3020..5b980cb81 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 e7cbf3645..572e9dc58 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 4e8fb4a12..9076fd922 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 de38d47e2..ed3d30d99 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 53ec27873..38558309f 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 863580684..4ee90b1bb 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 f7c7ac918..a252c995e 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 006d4e723..eb94a07dc 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 3164ae307..78e452936 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 79a6b908e..806aeb913 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 c7f2018e0..df36764cb 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 f88167ba4..91414edd2 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 b756c859d..393ca00b0 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 33dfb7b3b..3ab9b0ce4 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 a6c05905d..85752f4ab 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 df7be0ae5..ad0de2741 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 62bcf40f6..9f86c911c 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 8afd22bde..47d8ab428 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 a85e1667b..5cf5194aa 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 7c8a59edc..efdff24e6 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 6f55e3970..01003dc00 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 dd15c8d5c..0f9e03765 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 6880b03b9..e7dd1bd2b 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