X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=arch%2Farm%2Fcpu%2Farmv7%2Fam33xx%2Fsys_info.c;h=ab327c86566653194f42ea9c2c33d95e8d7e67ac;hp=5fd8b47b2d24e1b41b87df653abd4118b37ba05c;hb=0a44bb78e9e620386376a5b818e80548228bf9b9;hpb=b6379e15a70cc2e22486e5962927d9de374d877b diff --git a/arch/arm/cpu/armv7/am33xx/sys_info.c b/arch/arm/cpu/armv7/am33xx/sys_info.c index 5fd8b47b2d..ab327c8656 100644 --- a/arch/arm/cpu/armv7/am33xx/sys_info.c +++ b/arch/arm/cpu/armv7/am33xx/sys_info.c @@ -9,15 +9,7 @@ * Richard Woodruff * Syed Mohammed Khasim * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the - * GNU General Public License for more details. + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -71,7 +63,7 @@ u32 get_board_rev(void) u32 get_device_type(void) { int mode; - mode = readl(&cstat->statusreg) & (DEVICE_MASK); + mode = readl(&cstat->statusreg) & DEVICE_MASK; return mode >>= 8; } @@ -81,18 +73,30 @@ u32 get_device_type(void) u32 get_sysboot_value(void) { int mode; - mode = readl(&cstat->statusreg) & (SYSBOOT_MASK); + mode = readl(&cstat->statusreg) & SYSBOOT_MASK; return mode; } #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; - int arm_freq, ddr_freq; + char *cpu_s, *sec_s, *rev_s; switch (get_cpu_type()) { case AM335X: @@ -102,31 +106,20 @@ int print_cpuinfo(void) cpu_s = "TI81XX"; break; default: - cpu_s = "Unknown cpu type"; - break; + cpu_s = "Unknown CPU type"; } - 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: - sec_s = "?"; - } + if (get_cpu_rev() < ARRAY_SIZE(cpu_revs)) + rev_s = cpu_revs[get_cpu_rev()]; + else + rev_s = "?"; - printf("%s-%s rev %d\n", - cpu_s, sec_s, get_cpu_rev()); + if (get_device_type() < ARRAY_SIZE(dev_types)) + sec_s = dev_types[get_device_type()]; + else + sec_s = "?"; - /* TODO: Print ARM and DDR frequencies */ + printf("%s-%s rev %s\n", cpu_s, sec_s, rev_s); return 0; }