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

 board/igep00x0/igep00x0.c :100:u32 get_cpu_id(void)
 board/overo/overo.c       :165:u32 get_cpu_id(void)

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
board/igep00x0/igep00x0.c
board/overo/overo.c
cpu/omap3/sys_info.c

index b9a1dcd..bb45637 100644 (file)
@@ -93,29 +93,6 @@ u32 get_mem_type(void)
        return GPMC_ONENAND;
 }
 
-/******************************************
- * get_cpu_id(void) - extract cpu id
- * returns 0 for ES1.0, cpuid otherwise
- ******************************************/
-u32 get_cpu_id(void)
-{
-       u32 cpuid = 0;
-
-       /*
-        * On ES1.0 the IDCODE register is not exposed on L4
-        * so using CPU ID to differentiate between ES1.0 and > ES1.0.
-        */
-       __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r"(cpuid));
-       if ((cpuid & 0xf) == 0x0) {
-               return 0;
-       } else {
-               /* Decode the IDs on > ES1.0 */
-               cpuid = __raw_readl(CONTROL_IDCODE);
-       }
-
-       return cpuid;
-}
-
 /*****************************************************************
  * sr32 - clear & set a value in a bit range for a 32 bit address
  *****************************************************************/
index b157b0e..165c503 100644 (file)
@@ -158,29 +158,6 @@ u32 get_mem_type(void)
        }
 }
 
-/******************************************
- * get_cpu_id(void) - extract cpu id
- * returns 0 for ES1.0, cpuid otherwise
- ******************************************/
-u32 get_cpu_id(void)
-{
-       u32 cpuid = 0;
-
-       /*
-        * On ES1.0 the IDCODE register is not exposed on L4
-        * so using CPU ID to differentiate between ES1.0 and > ES1.0.
-        */
-       __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r"(cpuid));
-       if ((cpuid & 0xf) == 0x0) {
-               return 0;
-       } else {
-               /* Decode the IDs on > ES1.0 */
-               cpuid = __raw_readl(CONTROL_IDCODE);
-       }
-
-       return cpuid;
-}
-
 /******************************************
  * get_cpu_family(void) - extract cpu info
  ******************************************/
index 49ee4d5..8422b4e 100644 (file)
@@ -41,3 +41,26 @@ u32 get_cpu_type(void)
 {
        return __raw_readl(CONTROL_OMAP_STATUS);
 }
+
+/*
+ * get_cpu_id(): extract cpu id
+ * returns 0 for ES1.0, cpuid otherwise
+ */
+u32 get_cpu_id(void)
+{
+       u32 cpuid = 0;
+
+       /*
+        * On ES1.0 the IDCODE register is not exposed on L4
+        * so using CPU ID to differentiate between ES1.0 and > ES1.0.
+        */
+       __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r"(cpuid));
+       if ((cpuid & 0xf) == 0x0) {
+               return 0;
+       } else {
+               /* Decode the IDs on > ES1.0 */
+               cpuid = __raw_readl(CONTROL_IDCODE);
+       }
+
+       return cpuid;
+}