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

 board/omap3530beagle/omap3530beagle.c :159:u32 get_cpu_rev(void)
 board/igep00x0/igep00x0.c             :129:u32 get_cpu_rev(void)
 board/omap3430sdp/omap3430sdp.c       :82:u32 get_cpu_rev(void)
 board/omap3evm/omap3evm.c             :135:u32 get_cpu_rev(void)
 board/omap3430labrador/omap3430sdp.c  :79:u32 get_cpu_rev(void)
 board/overo/overo.c                   :164:u32 get_cpu_rev(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

index ab90606eac9059d0c51a21aabe57443b8b2f8885..a876da35b352f3c2b6f4af5b73c887e87ec7b9b9 100644 (file)
@@ -123,19 +123,6 @@ u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
        } while (1);
 }
 
-/******************************************
- * get_cpu_rev(void) - extract version info
- ******************************************/
-u32 get_cpu_rev(void)
-{
-       u32 cpuid = get_cpu_id();
-
-       if (cpuid == 0)
-               return CPU_3XX_ES10;
-       else
-               return (cpuid >> CPU_3XX_ID_SHIFT) & 0xf;
-}
-
 /******************************************
  * Print CPU information
  ******************************************/
index 0312d66712f7ee82a916d2206acb22a067ecec7f..7fcaec1558d3de08db586f95bc6352cb0dff3735 100644 (file)
@@ -73,24 +73,6 @@ int board_init (void)
        return 0;
 }
 
-/******************************************
- * get_cpu_rev(void) - extract version info
- ******************************************/
-u32 get_cpu_rev(void)
-{
-       u32 cpuid=0;
-       /* On ES1.0 the IDCODE register is not exposed on L4
-        * so using CPU ID to differentiate
-        * between ES2.0 and ES1.0.
-        */
-       __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r" (cpuid));
-       if((cpuid  & 0xf) == 0x0)
-               return CPU_3430_ES1;
-       else
-               return CPU_3430_ES2;
-
-}
-
 /******************************************
  * cpu_is_3410(void) - returns true for 3410
  ******************************************/
index 7cb45bba1620085012f524a2f29633bb46ff2198..a0b0d0e826fbd9d52b5cbe0702e6aa2d4693282e 100644 (file)
@@ -76,24 +76,6 @@ int board_init (void)
        return 0;
 }
 
-/******************************************
- * get_cpu_rev(void) - extract version info
- ******************************************/
-u32 get_cpu_rev(void)
-{
-       u32 cpuid=0;
-       /* On ES1.0 the IDCODE register is not exposed on L4
-        * so using CPU ID to differentiate
-        * between ES2.0 and ES1.0.
-        */
-       __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r" (cpuid));
-       if((cpuid  & 0xf) == 0x0)
-               return CPU_3430_ES1;
-       else
-               return CPU_3430_ES2;
-
-}
-
 /******************************************
  * cpu_is_3410(void) - returns true for 3410
  ******************************************/
index 0402a5741455f71fa5205be554e89be274787309..a564e4a65e42d6be206154f331db0d04af667c1c 100644 (file)
@@ -153,24 +153,6 @@ u32 get_mem_type(void)
        }
 }
 
-/******************************************
- * get_cpu_rev(void) - extract version info
- ******************************************/
-u32 get_cpu_rev(void)
-{
-       u32 cpuid = 0;
-       /* On ES1.0 the IDCODE register is not exposed on L4
-        * so using CPU ID to differentiate
-        * between ES2.0 and ES1.0.
-        */
-       __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r" (cpuid));
-       if ((cpuid  & 0xf) == 0x0)
-               return CPU_3430_ES1;
-       else
-               return CPU_3430_ES2;
-
-}
-
 /******************************************
  * cpu_is_3410(void) - returns true for 3410
  ******************************************/
index 4f1fedd3c308ff7ea55a0795faf4a3057a304857..c225ac187e4c4f7cdfcdd35a1e91fb22a5a2a95e 100644 (file)
@@ -129,24 +129,6 @@ u32 get_mem_type(void)
         }
 }
 
-/******************************************
- * get_cpu_rev(void) - extract version info
- ******************************************/
-u32 get_cpu_rev(void)
-{
-       u32 cpuid=0;
-       /* On ES1.0 the IDCODE register is not exposed on L4
-        * so using CPU ID to differentiate
-        * between ES2.0 and ES1.0.
-        */
-       __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r" (cpuid));
-       if((cpuid  & 0xf) == 0x0)
-               return CPU_3430_ES1;
-       else
-               return CPU_3430_ES2;
-
-}
-
 /******************************************
  * cpu_is_3410(void) - returns true for 3410
  ******************************************/
index bd03b55c047ac3f0a30a6ca1e728a314286a6c7c..b3a73e6b139ae6b5f1e696ebb5559b811f5aa20a 100644 (file)
@@ -158,19 +158,6 @@ u32 get_mem_type(void)
        }
 }
 
-/******************************************
- * get_cpu_rev(void) - extract version info
- ******************************************/
-u32 get_cpu_rev(void)
-{
-       u32 cpuid = get_cpu_id();
-
-       if (cpuid == 0)
-               return CPU_3XX_ES10;
-       else
-               return (cpuid >> CPU_3XX_ID_SHIFT) & 0xf;
-}
-
 /******************************************
  * Print CPU information
  ******************************************/
index ef18d604cd3edccdd41d64f4334680378b4db8b4..9fd9c71842fbca535424f95ded7d036e3a16c432 100644 (file)
@@ -94,3 +94,16 @@ u32 get_cpu_family(void)
 
        return cpu_family;
 }
+
+/*
+ * get_cpu_rev(void): extract version info
+ */
+u32 get_cpu_rev(void)
+{
+       u32 cpuid = get_cpu_id();
+
+       if (cpuid == 0)
+               return CPU_3XX_ES10;
+       else
+               return (cpuid >> CPU_3XX_ID_SHIFT) & 0xf;
+}