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 ab90606..a876da3 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 0312d66..7fcaec1 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 7cb45bb..a0b0d0e 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 0402a57..a564e4a 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 4f1fedd..c225ac1 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 bd03b55..b3a73e6 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 ef18d60..9fd9c71 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;
+}