|
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" |
@@ -318,10 +319,19 @@ static int am33xx_check_vcvp(void) |
318 | 319 | * |
319 | 320 | * Immediately reboots the device through warm reset. |
320 | 321 | */ |
321 | | -static void am33xx_prm_global_warm_sw_reset(void) |
| 322 | +static void am33xx_prm_global_sw_reset(void) |
322 | 323 | { |
323 | | - am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK, |
324 | | - 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, |
325 | 335 | AM33XX_PRM_DEVICE_MOD, |
326 | 336 | AM33XX_PRM_RSTCTRL_OFFSET); |
327 | 337 |
|
@@ -382,7 +392,7 @@ static struct prm_ll_data am33xx_prm_ll_data = { |
382 | 392 | .assert_hardreset = am33xx_prm_assert_hardreset, |
383 | 393 | .deassert_hardreset = am33xx_prm_deassert_hardreset, |
384 | 394 | .is_hardreset_asserted = am33xx_prm_is_hardreset_asserted, |
385 | | - .reset_system = am33xx_prm_global_warm_sw_reset, |
| 395 | + .reset_system = am33xx_prm_global_sw_reset, |
386 | 396 | }; |
387 | 397 |
|
388 | 398 | int __init am33xx_prm_init(const struct omap_prcm_init_data *data) |
|
0 commit comments