]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: AM33xx: PRM: move global warm reset implementation to driver
authorTero Kristo <t-kristo@ti.com>
Mon, 27 Oct 2014 15:39:25 +0000 (08:39 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 27 Oct 2014 15:39:25 +0000 (08:39 -0700)
Moved the implementation from am33xx-restart.c to the prm33xx.c file to
isolate the PRM register accesses to be private for PRM driver.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/am33xx-restart.c
arch/arm/mach-omap2/prm33xx.c

index c88d8df753c2d49b44db050e450c8dcb8fada2de..728638913cd142d4eb714c25304b0a3c6fbc9d69 100644 (file)
@@ -24,12 +24,5 @@ void am33xx_restart(enum reboot_mode mode, const char *cmd)
 {
        /* TODO: Handle mode and cmd if necessary */
 
-       am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK,
-                               AM33XX_RST_GLOBAL_WARM_SW_MASK,
-                               AM33XX_PRM_DEVICE_MOD,
-                               AM33XX_PRM_RSTCTRL_OFFSET);
-
-       /* OCP barrier */
-       (void)am33xx_prm_read_reg(AM33XX_PRM_DEVICE_MOD,
-                                 AM33XX_PRM_RSTCTRL_OFFSET);
+       am33xx_prm_global_warm_sw_reset();
 }
index 3cbfb78ed5e9aceb1afba79505b775fb3fb9ff7d..03960bc9b41961dcf3eadc37f744d054391633ce 100644 (file)
 #include "prm33xx.h"
 #include "prm-regbits-33xx.h"
 
+#define AM33XX_PRM_RSTCTRL_OFFSET              0x0000
+
+#define AM33XX_RST_GLOBAL_WARM_SW_MASK         (1 << 0)
+
 /* Read a register in a PRM instance */
 u32 am33xx_prm_read_reg(s16 inst, u16 idx)
 {
@@ -332,6 +336,23 @@ static int am33xx_check_vcvp(void)
        return 0;
 }
 
+/**
+ * am33xx_prm_global_warm_sw_reset - reboot the device via warm reset
+ *
+ * Immediately reboots the device through warm reset.
+ */
+void am33xx_prm_global_warm_sw_reset(void)
+{
+       am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK,
+                               AM33XX_RST_GLOBAL_WARM_SW_MASK,
+                               AM33XX_PRM_DEVICE_MOD,
+                               AM33XX_PRM_RSTCTRL_OFFSET);
+
+       /* OCP barrier */
+       (void)am33xx_prm_read_reg(AM33XX_PRM_DEVICE_MOD,
+                                 AM33XX_PRM_RSTCTRL_OFFSET);
+}
+
 struct pwrdm_ops am33xx_pwrdm_operations = {
        .pwrdm_set_next_pwrst           = am33xx_pwrdm_set_next_pwrst,
        .pwrdm_read_next_pwrst          = am33xx_pwrdm_read_next_pwrst,