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

 board/igep00x0/igep00x0.c :129:u32 get_cpu_family(void)
 board/overo/overo.c       :164:u32 get_cpu_family(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 bb45637..ab90606 100644 (file)
@@ -124,36 +124,6 @@ u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound)
 }
 
 /******************************************
- * get_cpu_family(void) - extract cpu info
- ******************************************/
-u32 get_cpu_family(void)
-{
-       u16 hawkeye;
-       u32 cpu_family;
-       u32 cpuid = get_cpu_id();
-
-       if (cpuid == 0)
-               return CPU_OMAP34XX;
-
-       hawkeye = (cpuid >> HAWKEYE_SHIFT) & 0xffff;
-       switch (hawkeye) {
-       case HAWKEYE_OMAP34XX:
-               cpu_family = CPU_OMAP34XX;
-               break;
-       case HAWKEYE_AM35XX:
-               cpu_family = CPU_AM35XX;
-               break;
-       case HAWKEYE_OMAP36XX:
-               cpu_family = CPU_OMAP36XX;
-               break;
-       default:
-               cpu_family = CPU_OMAP34XX;
-       }
-
-       return cpu_family;
-}
-
-/******************************************
  * get_cpu_rev(void) - extract version info
  ******************************************/
 u32 get_cpu_rev(void)
index 165c503..bd03b55 100644 (file)
@@ -159,36 +159,6 @@ u32 get_mem_type(void)
 }
 
 /******************************************
- * get_cpu_family(void) - extract cpu info
- ******************************************/
-u32 get_cpu_family(void)
-{
-       u16 hawkeye;
-       u32 cpu_family;
-       u32 cpuid = get_cpu_id();
-
-       if (cpuid == 0)
-               return CPU_OMAP34XX;
-
-       hawkeye = (cpuid >> HAWKEYE_SHIFT) & 0xffff;
-       switch (hawkeye) {
-       case HAWKEYE_OMAP34XX:
-               cpu_family = CPU_OMAP34XX;
-               break;
-       case HAWKEYE_AM35XX:
-               cpu_family = CPU_AM35XX;
-               break;
-       case HAWKEYE_OMAP36XX:
-               cpu_family = CPU_OMAP36XX;
-               break;
-       default:
-               cpu_family = CPU_OMAP34XX;
-       }
-
-       return cpu_family;
-}
-
-/******************************************
  * get_cpu_rev(void) - extract version info
  ******************************************/
 u32 get_cpu_rev(void)
index 8422b4e..ef18d60 100644 (file)
@@ -64,3 +64,33 @@ u32 get_cpu_id(void)
 
        return cpuid;
 }
+
+/*
+ * get_cpu_family(void): extract cpu info
+ */
+u32 get_cpu_family(void)
+{
+       u16 hawkeye;
+       u32 cpu_family;
+       u32 cpuid = get_cpu_id();
+
+       if (cpuid == 0)
+               return CPU_OMAP34XX;
+
+       hawkeye = (cpuid >> HAWKEYE_SHIFT) & 0xffff;
+       switch (hawkeye) {
+       case HAWKEYE_OMAP34XX:
+               cpu_family = CPU_OMAP34XX;
+               break;
+       case HAWKEYE_AM35XX:
+               cpu_family = CPU_AM35XX;
+               break;
+       case HAWKEYE_OMAP36XX:
+               cpu_family = CPU_OMAP36XX;
+               break;
+       default:
+               cpu_family = CPU_OMAP34XX;
+       }
+
+       return cpu_family;
+}