Skip to content

Commit 5b0a6fb

Browse files
committed
Fix reboot with new restart method of machine driver
1 parent 3bc2651 commit 5b0a6fb

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

arch/arm/mach-bcm2708/bcm2708.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,21 @@ int __init bcm_register_device(struct platform_device *pdev)
663663
return ret;
664664
}
665665

666+
static void bcm2708_restart(char mode, const char *cmd)
667+
{
668+
uint32_t pm_rstc, pm_wdog;
669+
uint32_t timeout = 10;
670+
671+
/* Setup watchdog for reset */
672+
pm_rstc = readl(IO_ADDRESS(PM_RSTC));
673+
674+
pm_wdog = PM_PASSWORD | (timeout & PM_WDOG_TIME_SET); // watchdog timer = timer clock / 16; need password (31:16) + value (11:0)
675+
pm_rstc = PM_PASSWORD | (pm_rstc & PM_RSTC_WRCFG_CLR) | PM_RSTC_WRCFG_FULL_RESET;
676+
677+
writel(pm_wdog, IO_ADDRESS(PM_WDOG));
678+
writel(pm_rstc, IO_ADDRESS(PM_RSTC));
679+
}
680+
666681
/* We can't really power off, but if we do the normal reset scheme, and indicate to bootcode.bin not to reboot, then most of the chip will be powered off */
667682
static void bcm2708_power_off(void)
668683
{
@@ -671,7 +686,7 @@ static void bcm2708_power_off(void)
671686
pm_rsts = PM_PASSWORD | (pm_rsts & PM_RSTC_WRCFG_CLR) | PM_RSTS_HADWRH_SET;
672687
writel(pm_rsts, IO_ADDRESS(PM_RSTS));
673688
/* continue with normal reset mechanism */
674-
arch_reset(0, "");
689+
bcm2708_restart(0, "");
675690
}
676691

677692
void __init bcm2708_init(void)
@@ -928,6 +943,7 @@ MACHINE_START(BCM2708, "BCM2708")
928943
.init_machine = bcm2708_init,
929944
.init_early = bcm2708_init_early,
930945
.reserve = board_reserve,
946+
.restart = bcm2708_restart,
931947
MACHINE_END
932948

933949
module_param(boardrev, uint, 0644);

arch/arm/mach-bcm2708/include/mach/system.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,4 @@ static inline void arch_idle(void)
3535
cpu_do_idle();
3636
}
3737

38-
static inline void arch_reset(char mode, const char *cmd)
39-
{
40-
uint32_t pm_rstc, pm_wdog;
41-
uint32_t timeout = 10;
42-
43-
/* Setup watchdog for reset */
44-
pm_rstc = readl(IO_ADDRESS(PM_RSTC));
45-
46-
pm_wdog = PM_PASSWORD | (timeout & PM_WDOG_TIME_SET); // watchdog timer = timer clock / 16; need password (31:16) + value (11:0)
47-
pm_rstc = PM_PASSWORD | (pm_rstc & PM_RSTC_WRCFG_CLR) | PM_RSTC_WRCFG_FULL_RESET;
48-
49-
writel(pm_wdog, IO_ADDRESS(PM_WDOG));
50-
writel(pm_rstc, IO_ADDRESS(PM_RSTC));
51-
}
52-
5338
#endif

0 commit comments

Comments
 (0)