aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2015-06-17 10:04:04 -0400
committerWim Van Sebroeck <wim@iguana.be>2015-09-28 04:56:05 -0400
commit898e6861ff7cfc9f539b57859a27fbd1fe4298ae (patch)
tree449a20ba7c6ee5e1097026aa83725752230cbfa8
parentc73318f43d3967e3ce810665d9c74a7d238d24d1 (diff)
watchdog: bcm2835: Fix poweroff behaviour
Currently poweroff/halt results in a reboot on the Raspberry Pi. The firmware uses the RSTS register to know which partiton to boot from. The partiton value is spread into bits 0, 2, 4, 6, 8, 10. Partiton 63 is a special partition used by the firmware to indicate halt. The firmware made this change in 19 Aug 2013 and was matched by the downstream commit: Changes for new NOOBS multi partition booting from gsh Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r--drivers/watchdog/bcm2835_wdt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
index 66c3e656a616..8a5ce5b5a0b6 100644
--- a/drivers/watchdog/bcm2835_wdt.c
+++ b/drivers/watchdog/bcm2835_wdt.c
@@ -36,6 +36,13 @@
36#define PM_RSTC_WRCFG_FULL_RESET 0x00000020 36#define PM_RSTC_WRCFG_FULL_RESET 0x00000020
37#define PM_RSTC_RESET 0x00000102 37#define PM_RSTC_RESET 0x00000102
38 38
39/*
40 * The Raspberry Pi firmware uses the RSTS register to know which partiton
41 * to boot from. The partiton value is spread into bits 0, 2, 4, 6, 8, 10.
42 * Partiton 63 is a special partition used by the firmware to indicate halt.
43 */
44#define PM_RSTS_RASPBERRYPI_HALT 0x555
45
39#define SECS_TO_WDOG_TICKS(x) ((x) << 16) 46#define SECS_TO_WDOG_TICKS(x) ((x) << 16)
40#define WDOG_TICKS_TO_SECS(x) ((x) >> 16) 47#define WDOG_TICKS_TO_SECS(x) ((x) >> 16)
41 48
@@ -151,8 +158,7 @@ static void bcm2835_power_off(void)
151 * hard reset. 158 * hard reset.
152 */ 159 */
153 val = readl_relaxed(wdt->base + PM_RSTS); 160 val = readl_relaxed(wdt->base + PM_RSTS);
154 val &= PM_RSTC_WRCFG_CLR; 161 val |= PM_PASSWORD | PM_RSTS_RASPBERRYPI_HALT;
155 val |= PM_PASSWORD | PM_RSTS_HADWRH_SET;
156 writel_relaxed(val, wdt->base + PM_RSTS); 162 writel_relaxed(val, wdt->base + PM_RSTS);
157 163
158 /* Continue with normal reset mechanism */ 164 /* Continue with normal reset mechanism */