]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/am33xx/sys_info.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / am33xx / sys_info.c
index 50eb598ff2686142c364a6688b47650e5c64d5fe..781d83fc72a400f416d7c23b8f3f32b4b924af3a 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
 #include <power/tps65910.h>
+#include <linux/compiler.h>
 
 struct ctrl_stat *cstat = (struct ctrl_stat *)CTRL_BASE;
 
@@ -51,11 +52,11 @@ u32 get_cpu_type(void)
 
 /**
  * get_board_rev() - setup to pass kernel board revision information
- * returns:(bit[0-3] sub version, higher bit[7-4] is higher version)
+ * returns: 0 for the ATAG REVISION tag value.
  */
-u32 get_board_rev(void)
+u32 __weak get_board_rev(void)
 {
-       return BOARD_REV_ID;
+       return 0;
 }
 
 /**
@@ -79,12 +80,24 @@ u32 get_sysboot_value(void)
 }
 
 #ifdef CONFIG_DISPLAY_CPUINFO
+static char *cpu_revs[] = {
+               "1.0",
+               "2.0",
+               "2.1"};
+
+
+static char *dev_types[] = {
+               "TST",
+               "EMU",
+               "HS",
+               "GP"};
+
 /**
  * Print CPU information
  */
 int print_cpuinfo(void)
 {
-       char *cpu_s, *sec_s;
+       char *cpu_s, *sec_s, *rev_s;
 
        switch (get_cpu_type()) {
        case AM335X:
@@ -94,28 +107,21 @@ int print_cpuinfo(void)
                cpu_s = "TI81XX";
                break;
        default:
-               cpu_s = "Unknown cpu type";
+               cpu_s = "Unknown CPU type";
                break;
        }
 
-       switch (get_device_type()) {
-       case TST_DEVICE:
-               sec_s = "TST";
-               break;
-       case EMU_DEVICE:
-               sec_s = "EMU";
-               break;
-       case HS_DEVICE:
-               sec_s = "HS";
-               break;
-       case GP_DEVICE:
-               sec_s = "GP";
-               break;
-       default:
+       if (get_cpu_rev() < ARRAY_SIZE(cpu_revs))
+               rev_s = cpu_revs[get_cpu_rev()];
+       else
+               rev_s = "?";
+
+       if (get_device_type() < ARRAY_SIZE(dev_types))
+               sec_s = dev_types[get_device_type()];
+       else
                sec_s = "?";
-       }
 
-       printf("%s-%s rev %d\n", cpu_s, sec_s, get_cpu_rev());
+       printf("%s-%s rev %s\n", cpu_s, sec_s, rev_s);
 
        return 0;
 }