OMAP3: Move try_unlock_memory() function to not duplicate code
authorEnric Balletbo i Serra <eballetbo@gmail.com>
Wed, 25 May 2011 12:04:05 +0000 (14:04 +0200)
committerAnand Gadiyar <gadiyar@ti.com>
Thu, 14 Jul 2011 12:10:48 +0000 (17:40 +0530)
The try_unlock_memory() function is implemented by various boards, this
patch moves this function to a common place to not duplicate code.

 board/omap3530beagle/omap3530beagle.c :527:void try_unlock_memory(void)
 board/igep00x0/igep00x0.c             :271:void try_unlock_memory(void)
 board/omap3430sdp/omap3430sdp.c       :314:void try_unlock_memory(void)
 board/omap3evm/omap3evm.c             :359:void try_unlock_memory(void)
 board/omap3430labrador/omap3430sdp.c  :316:void try_unlock_memory(void)
 board/overo/overo.c                   :478:void try_unlock_memory(void)

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
board/igep00x0/igep00x0.c
board/omap3430labrador/omap3430sdp.c
board/omap3430sdp/omap3430sdp.c
board/omap3530beagle/omap3530beagle.c
board/omap3evm/omap3evm.c
board/overo/overo.c
cpu/omap3/sys_info.c
include/asm/arch-omap3/sys_proto.h

index 8c99923..5550741 100644 (file)
@@ -263,23 +263,6 @@ void prcm_init(void)
        delay(5000);
 }
 
-/**********************************************************
- * Routine: try_unlock_sram()
- * Description: If chip is GP type, unlock the SRAM for
- *  general use.
- ***********************************************************/
-void try_unlock_memory(void)
-{
-       int mode;
-
-       /* if GP device unlock device SRAM for general use */
-       /* secure code breaks for Secure/Emulation device - HS/E/T */
-       mode = get_device_type();
-       if (mode == GP_DEVICE)
-               secure_unlock();
-       return;
-}
-
 /*********************************************************************
  * config_sdram_m65kx002am() - 2 dice of 2Gb, DDR x32 I/O, 4KB page
  *********************************************************************/
index 2c42168..522de06 100644 (file)
@@ -308,24 +308,6 @@ void prcm_init(void)
        delay(5000);
 }
 
-/**********************************************************
- * Routine: try_unlock_sram()
- * Description: If chip is GP type, unlock the SRAM for
- *  general use.
- ***********************************************************/
-void try_unlock_memory(void)
-{
-       int mode;
-
-       /* if GP device unlock device SRAM for general use */
-       /* secure code breaks for Secure/Emulation device - HS/E/T*/
-       mode = get_device_type();
-       if (mode == GP_DEVICE) {
-               secure_unlock();
-       }
-       return;
-}
-
 /**********************************************************
  * Routine: s_init
  * Description: Does early system init of muxing and clocks.
index fe3f8e1..d8a2c1b 100644 (file)
@@ -306,24 +306,6 @@ void prcm_init(void)
        delay(5000);
 }
 
-/**********************************************************
- * Routine: try_unlock_sram()
- * Description: If chip is GP type, unlock the SRAM for
- *  general use.
- ***********************************************************/
-void try_unlock_memory(void)
-{
-       int mode;
-
-       /* if GP device unlock device SRAM for general use */
-       /* secure code breaks for Secure/Emulation device - HS/E/T*/
-       mode = get_device_type();
-       if (mode == GP_DEVICE) {
-               secure_unlock();
-       }
-       return;
-}
-
 /**********************************************************
  * Routine: s_init
  * Description: Does early system init of muxing and clocks.
index c861b21..c85bebf 100644 (file)
@@ -519,23 +519,6 @@ void prcm_init(void)
        delay(5000);
 }
 
-/**********************************************************
- * Routine: try_unlock_sram()
- * Description: If chip is GP type, unlock the SRAM for
- *  general use.
- ***********************************************************/
-void try_unlock_memory(void)
-{
-       int mode;
-
-       /* if GP device unlock device SRAM for general use */
-       /* secure code breaks for Secure/Emulation device - HS/E/T */
-       mode = get_device_type();
-       if (mode == GP_DEVICE)
-               secure_unlock();
-       return;
-}
-
 /**********************************************************
  * Routine: s_init
  * Description: Does early system init of muxing and clocks.
index 164c211..6048964 100644 (file)
@@ -351,24 +351,6 @@ void prcm_init(void)
        delay(5000);
 }
 
-/**********************************************************
- * Routine: try_unlock_sram()
- * Description: If chip is GP type, unlock the SRAM for
- *  general use.
- ***********************************************************/
-void try_unlock_memory(void)
-{
-       int mode;
-
-       /* if GP device unlock device SRAM for general use */
-       /* secure code breaks for Secure/Emulation device - HS/E/T*/
-       mode = get_device_type();
-       if (mode == GP_DEVICE) {
-               secure_unlock();
-       }
-       return;
-}
-
 /**********************************************************
  * Routine: s_init
  * Description: Does early system init of muxing and clocks.
index 1c8102b..413fe43 100644 (file)
@@ -470,23 +470,6 @@ void prcm_init(void)
        delay(5000);
 }
 
-/**********************************************************
- * Routine: try_unlock_sram()
- * Description: If chip is GP type, unlock the SRAM for
- *  general use.
- ***********************************************************/
-void try_unlock_memory(void)
-{
-       int mode;
-
-       /* if GP device unlock device SRAM for general use */
-       /* secure code breaks for Secure/Emulation device - HS/E/T*/
-       mode = get_device_type();
-       if (mode == GP_DEVICE)
-               secure_unlock();
-       return;
-}
-
 /**********************************************************
  * Routine: s_init
  * Description: Does early system init of muxing and clocks.
index 09bd823..0d592e9 100644 (file)
@@ -290,3 +290,20 @@ void secure_unlock(void)
 
        __raw_writel(UNLOCK_1, SMS_RG_ATT0); /* SDRC region 0 public */
 }
+
+/*
+ * try_unlock_memory(void): If chip is GP type, unlock the SRAM for
+ *  general use.
+ */
+void try_unlock_memory(void)
+{
+       int mode;
+
+       /* if GP device unlock device SRAM for general use */
+       /* secure code breaks for Secure/Emulation device - HS/E/T*/
+       mode = get_device_type();
+       if (mode == GP_DEVICE) {
+               secure_unlock();
+       }
+       return;
+}
index 7e768fa..8622d9f 100644 (file)
@@ -55,6 +55,7 @@ u32 get_device_type(void);
 void get_sys_clkin_sel(u32 osc_clk, u32 *sys_clkin_sel);
 
 void secure_unlock(void);
+void try_unlock_memory(void);
 
 void sr32(u32 addr, u32 start_bit, u32 num_bits, u32 value);
 u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound);