]> git.openpandora.org Git - pandora-x-loader.git/commitdiff
OMAP3: Move wait_on_value() function to not duplicate code
authorEnric Balletbo i Serra <eballetbo@gmail.com>
Wed, 25 May 2011 09:07:51 +0000 (11:07 +0200)
committerAnand Gadiyar <gadiyar@ti.com>
Thu, 14 Jul 2011 12:10:48 +0000 (17:40 +0530)
The wait_on_value() function is implemented by various boards, this
patch moves this function to a common place to not duplicate code.

 board/omap3530beagle/omap3530beagle.c :216:u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
 board/igep00x0/igep00x0.c             :90:u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
 board/omap3430sdp/omap3430sdp.c       :104:u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
 board/omap3evm/omap3evm.c             :148:u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
 board/omap3430labrador/omap3430sdp.c  :101:u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
 board/overo/overo.c                   :207:u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)

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

index f1c182994ff9ad998348c4bfdc1157245c55d132..0b2ce5eeabbcff29ca7a177b217d37bb3f61fae8 100644 (file)
@@ -83,23 +83,6 @@ u32 get_mem_type(void)
        return GPMC_ONENAND;
 }
 
-/*********************************************************************
- * wait_on_value() - common routine to allow waiting for changes in
- *   volatile regs.
- *********************************************************************/
-u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
-{
-       u32 i = 0, val;
-       do {
-               ++i;
-               val = __raw_readl(read_addr) & read_bit_mask;
-               if (val == match_value)
-                       return 1;
-               if (i == bound)
-                       return 0;
-       } while (1);
-}
-
 /*************************************************************
  * get_sys_clk_speed - determine reference oscillator speed
  *  based on known 32kHz clock and gptimer.
index 300deb15512a7c25ede4bc402fd84cf91c63767f..79d0dcecb9141b910488dc82edeb2ff42d553cca 100644 (file)
@@ -94,23 +94,6 @@ u32 cpu_is_3410(void)
        }
 }
 
-/*********************************************************************
- * wait_on_value() - common routine to allow waiting for changes in
- *   volatile regs.
- *********************************************************************/
-u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
-{
-       u32 i = 0, val;
-       do {
-               ++i;
-               val = __raw_readl(read_addr) & read_bit_mask;
-               if (val == match_value)
-                       return (1);
-               if (i == bound)
-                       return (0);
-       } while (1);
-}
-
 #ifdef CFG_3430SDRAM_DDR
 /*********************************************************************
  * config_3430sdram_ddr() - Init DDR on 3430SDP dev board.
index bfa61dccc8d83406678ff7856789b3a6da46e3ad..bb6070e90391bd9fbc587b46c124553c449ca630 100644 (file)
@@ -97,23 +97,6 @@ u32 cpu_is_3410(void)
        }
 }
 
-/*********************************************************************
- * wait_on_value() - common routine to allow waiting for changes in
- *   volatile regs.
- *********************************************************************/
-u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
-{
-       u32 i = 0, val;
-       do {
-               ++i;
-               val = __raw_readl(read_addr) & read_bit_mask;
-               if (val == match_value)
-                       return (1);
-               if (i == bound)
-                       return (0);
-       } while (1);
-}
-
 #ifdef CFG_3430SDRAM_DDR
 /*********************************************************************
  * config_3430sdram_ddr() - Init DDR on 3430SDP dev board.
index 5659f3ba82d6b80d8ff436632bc7b40a2140a7f0..5a97d96a03218ee97103b83fbe3c747ff47ea4d9 100644 (file)
@@ -209,23 +209,6 @@ int beagle_revision(void)
        return rev;
 }
 
-/*********************************************************************
- * wait_on_value() - common routine to allow waiting for changes in
- *   volatile regs.
- *********************************************************************/
-u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
-{
-       u32 i = 0, val;
-       do {
-               ++i;
-               val = __raw_readl(read_addr) & read_bit_mask;
-               if (val == match_value)
-                       return 1;
-               if (i == bound)
-                       return 0;
-       } while (1);
-}
-
 #ifdef CFG_3430SDRAM_DDR
 
 #define MICRON_DDR     0
index 4265da1558b7336727c1d5b57abe58054e364711..50710467422679dc93d4ae7077bd7a6ebec574d7 100644 (file)
@@ -141,23 +141,6 @@ u32 cpu_is_3410(void)
        }
 }
 
-/*********************************************************************
- * wait_on_value() - common routine to allow waiting for changes in
- *   volatile regs.
- *********************************************************************/
-u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
-{
-       u32 i = 0, val;
-       do {
-               ++i;
-               val = __raw_readl(read_addr) & read_bit_mask;
-               if (val == match_value)
-                       return (1);
-               if (i == bound)
-                       return (0);
-       } while (1);
-}
-
 #ifdef CFG_3430SDRAM_DDR
 /*********************************************************************
  * config_3430sdram_ddr() - Init DDR on 3430SDP dev board.
index 3b61335453e0f3da867cb06003c692319ca108ff..e7ac7a6fc719b73f66b6209dec3b31cf68f08f72 100644 (file)
@@ -200,23 +200,6 @@ int get_board_revision(void)
        return revision;
 }
 
-/*********************************************************************
- * wait_on_value() - common routine to allow waiting for changes in
- *   volatile regs.
- *********************************************************************/
-u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
-{
-       u32 i = 0, val;
-       do {
-               ++i;
-               val = __raw_readl(read_addr) & read_bit_mask;
-               if (val == match_value)
-                       return 1;
-               if (i == bound)
-                       return 0;
-       } while (1);
-}
-
 #ifdef CFG_3430SDRAM_DDR
 /*********************************************************************
  * config_3430sdram_ddr() - Init DDR on 3430SDP dev board.
index bcf5f8e25e472a7b4dd782ddc9afaac0b356e4e9..d6568a98bf7d1f588de0af5de5efb7802b7ca0f6 100644 (file)
@@ -47,6 +47,23 @@ void sr32(u32 addr, u32 start_bit, u32 num_bits, u32 value)
        __raw_writel(tmp, addr);
 }
 
+/*
+ * wait_on_value(): common routine to allow waiting for changes in
+ * volatile regs.
+ */
+u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
+{
+       u32 i = 0, val;
+       do {
+               ++i;
+               val = __raw_readl(read_addr) & read_bit_mask;
+               if (val == match_value)
+                       return 1;
+               if (i == bound)
+                       return 0;
+       } while (1);
+}
+
 /*
  *  get_device_type(): tell if GP/HS/EMU/TST
  */