|
10 | 10 | #include <linux/errno.h> |
11 | 11 | #include <linux/err.h> |
12 | 12 | #include <linux/io.h> |
| 13 | +#include <linux/reboot.h> |
13 | 14 |
|
14 | 15 | #include "powerdomain.h" |
15 | 16 | #include "prm33xx.h" |
16 | 17 | #include "prm-regbits-33xx.h" |
17 | 18 |
|
18 | | -#define AM33XX_PRM_RSTCTRL_OFFSET 0x0000 |
19 | | - |
20 | | -#define AM33XX_RST_GLOBAL_WARM_SW_MASK (1 << 0) |
21 | | - |
22 | 19 | /* Read a register in a PRM instance */ |
23 | 20 | static u32 am33xx_prm_read_reg(s16 inst, u16 idx) |
24 | 21 | { |
@@ -322,10 +319,19 @@ static int am33xx_check_vcvp(void) |
322 | 319 | * |
323 | 320 | * Immediately reboots the device through warm reset. |
324 | 321 | */ |
325 | | -static void am33xx_prm_global_warm_sw_reset(void) |
| 322 | +static void am33xx_prm_global_sw_reset(void) |
326 | 323 | { |
327 | | - am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK, |
328 | | - AM33XX_RST_GLOBAL_WARM_SW_MASK, |
| 324 | + /* |
| 325 | + * Historically AM33xx performed warm reset for all requested reboot_mode. |
| 326 | + * Keep this behaviour unchanged for all except newly added REBOOT_COLD. |
| 327 | + */ |
| 328 | + u32 mask = AM33XX_RST_GLOBAL_WARM_SW_MASK; |
| 329 | + |
| 330 | + if (prm_reboot_mode == REBOOT_COLD) |
| 331 | + mask = AM33XX_RST_GLOBAL_COLD_SW_MASK; |
| 332 | + |
| 333 | + am33xx_prm_rmw_reg_bits(mask, |
| 334 | + mask, |
329 | 335 | AM33XX_PRM_DEVICE_MOD, |
330 | 336 | AM33XX_PRM_RSTCTRL_OFFSET); |
331 | 337 |
|
@@ -386,7 +392,7 @@ static struct prm_ll_data am33xx_prm_ll_data = { |
386 | 392 | .assert_hardreset = am33xx_prm_assert_hardreset, |
387 | 393 | .deassert_hardreset = am33xx_prm_deassert_hardreset, |
388 | 394 | .is_hardreset_asserted = am33xx_prm_is_hardreset_asserted, |
389 | | - .reset_system = am33xx_prm_global_warm_sw_reset, |
| 395 | + .reset_system = am33xx_prm_global_sw_reset, |
390 | 396 | }; |
391 | 397 |
|
392 | 398 | int __init am33xx_prm_init(const struct omap_prcm_init_data *data) |
|
0 commit comments