]> git.openpandora.org Git - pandora-x-loader.git/commitdiff
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 8c99923916e29e27adc8dec3e8c9769fd3141eb1..5550741567d7433ffbb14d0982eb2497bda0c8e7 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 2c421686de30e0d2fec6b8a01a9e9cb37743f61a..522de068dc9b196235465539a1cbb29f3145ada8 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 fe3f8e18f0e50f0b9b25092863f54ebd14078c73..d8a2c1b0e6a4b4ec2e6ee0ff215d6e2b3f332a43 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 c861b211815eb6a2d0708fa85b48bed147be6447..c85bebf9e9b43cbbb71d119b6e6b88bb60fc6b54 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 164c21107f9988791a817e4d9e574a55cfc6dfa8..604896478bca0f21bd479ee83f44533514f9be10 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 1c8102b0b334dadf9d1a27fce560a140929a4dfc..413fe43e9093f9b07df4661b3fe914f1fea97cc6 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 09bd823252ce7213ba2a2d59d538e84f28650882..0d592e9af643fd5575c2c598b4faf47bba9cb82a 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 7e768fa99d3def44b9759eefe4d64ce303de7e0a..8622d9f60d7cc664500d6a0f7edaf493bf621439 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);