4 * System information functions
6 * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
8 * Derived from Beagle Board and 3430 SDP code by
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
20 * GNU General Public License for more details.
25 #include <asm/arch/sys_proto.h>
26 #include <asm/arch/cpu.h>
27 #include <asm/arch/clock.h>
29 struct ctrl_stat *cstat = (struct ctrl_stat *)CTRL_BASE;
32 * get_cpu_rev(void) - extract rev info
39 id = readl(DEVICE_ID);
40 rev = (id >> 28) & 0xff;
46 * get_cpu_type(void) - extract cpu info
48 u32 get_cpu_type(void)
53 id = readl(DEVICE_ID);
54 partnum = (id >> 12) & 0xffff;
60 * get_board_rev() - setup to pass kernel board revision information
61 * returns:(bit[0-3] sub version, higher bit[7-4] is higher version)
63 u32 get_board_rev(void)
69 * get_device_type(): tell if GP/HS/EMU/TST
71 u32 get_device_type(void)
74 mode = readl(&cstat->statusreg) & (DEVICE_MASK);
79 * get_sysboot_value(void) - return SYS_BOOT[4:0]
81 u32 get_sysboot_value(void)
84 mode = readl(&cstat->statusreg) & (SYSBOOT_MASK);
88 #ifdef CONFIG_DISPLAY_CPUINFO
90 * Print CPU information
92 int print_cpuinfo(void)
96 switch (get_cpu_type()) {
104 cpu_s = "Unknown cpu type";
108 switch (get_device_type()) {
125 printf("%s-%s rev %d\n", cpu_s, sec_s, get_cpu_rev());
129 #endif /* CONFIG_DISPLAY_CPUINFO */