]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: OMAP3+: Detect reset type
authorLokesh Vutla <lokeshvutla@ti.com>
Tue, 29 May 2012 19:26:41 +0000 (19:26 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 7 Jul 2012 12:07:34 +0000 (14:07 +0200)
Certain modules are not affected by means of
a warm reset and need not be configured again.
Adding an API to detect the reset reason warm/cold.

This will be used to skip the module configurations
that are retained across a warm reset.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: R Sricharan <r.sricharan@ti.com>
arch/arm/cpu/armv7/omap-common/reset.c
arch/arm/include/asm/arch-am33xx/cpu.h
arch/arm/include/asm/arch-omap3/cpu.h
arch/arm/include/asm/arch-omap3/sys_proto.h
arch/arm/include/asm/arch-omap4/cpu.h
arch/arm/include/asm/arch-omap4/sys_proto.h
arch/arm/include/asm/arch-omap5/cpu.h
arch/arm/include/asm/arch-omap5/sys_proto.h

index 234e90a86831445d2dfb7e297cfd3c25d3cdca8e..587bb47745a14eed7fcf42e8f648329b7ff70915 100644 (file)
@@ -34,3 +34,8 @@ void __weak reset_cpu(unsigned long ignored)
 {
        writel(PRM_RSTCTRL_RESET, PRM_RSTCTRL);
 }
+
+u32 __weak warm_reset(void)
+{
+       return (readl(PRM_RSTST) & PRM_RSTST_WARM_RESET_MASK);
+}
index 5a6534e32eae1c9cdd73b48a2be3252c14976a18..a027e3128f46bdd16ec60a9529d2d4bc5ce01f2e 100644 (file)
 /* Reset control */
 #ifdef CONFIG_AM33XX
 #define PRM_RSTCTRL                    0x44E00F00
+#define PRM_RSTST                      0x44E00F08
 #endif
 #define PRM_RSTCTRL_RESET              0x01
+#define PRM_RSTST_WARM_RESET_MASK      0x232
 
 #ifndef __KERNEL_STRICT_NAMES
 #ifndef __ASSEMBLY__
index 457f99d2c5056bc1408a93670b840d5344a43933..5683e16177d253f846202fae293aad9f971c3c03 100644 (file)
@@ -479,6 +479,8 @@ struct prm {
 
 #define PRM_RSTCTRL            0x48307250
 #define PRM_RSTCTRL_RESET      0x04
+#define PRM_RSTST                      0x48307258
+#define PRM_RSTST_WARM_RESET_MASK      0x7D2
 #define SYSCLKDIV_1            (0x1 << 6)
 #define SYSCLKDIV_2            (0x1 << 7)
 
index 2a89e56534073ff7d65a63e9d89e4e866e88266f..9e52b12aa291ac3145a0a779909642919f553f82 100644 (file)
@@ -74,4 +74,5 @@ void power_init_r(void);
 void dieid_num_r(void);
 void do_omap3_emu_romcode_call(u32 service_id, u32 parameters);
 void omap3_gp_romcode_call(u32 service_id, u32 parameter);
+u32 warm_reset(void);
 #endif
index feddb7de5141d8b7e21fc1a37095299a88df0e32..a8c4c60c8c9b8883dcb1823b68d30b5d53ba8aba 100644 (file)
@@ -178,5 +178,7 @@ struct watchdog {
 
 #define PRM_RSTCTRL            PRM_DEVICE_BASE
 #define PRM_RSTCTRL_RESET      0x01
+#define PRM_RSTST              (PRM_DEVICE_BASE + 0x4)
+#define PRM_RSTST_WARM_RESET_MASK      0x07EA
 
 #endif /* _CPU_H */
index c6e3ad26ff29124fd507a5a28d472855e0aad5b9..4f0a29da7fa59c58002b1be2881faac9819831dd 100644 (file)
@@ -57,6 +57,7 @@ void init_omap_revision(void);
 void do_io_settings(void);
 void omap_vc_init(u16 speed_khz);
 int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
+u32 warm_reset(void);
 /*
  * This is used to verify if the configuration header
  * was executed by Romcode prior to control of transfer
index 8ef17c9a146aab0368f914b133621445c0accd66..5e62013236eb49cfcf39f8e5996ab45b1a7a67dd 100644 (file)
@@ -182,5 +182,7 @@ struct watchdog {
 
 #define PRM_RSTCTRL            PRM_DEVICE_BASE
 #define PRM_RSTCTRL_RESET      0x01
+#define PRM_RSTST              (PRM_DEVICE_BASE + 0x4)
+#define PRM_RSTST_WARM_RESET_MASK      0x7FEA
 
 #endif /* _CPU_H */
index 8396a2214181750aaa7526b110952b9b00c0010e..b3bbdb7cd8db34f88b9f958e7db0afea76c7705c 100644 (file)
@@ -57,6 +57,7 @@ void init_omap_revision(void);
 void do_io_settings(void);
 void omap_vc_init(u16 speed_khz);
 int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
+u32 warm_reset(void);
 
 /*
  * This is used to verify if the configuration header