2 * See file CREDITS for list of people who contributed to this
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 #include <asm/arch/bits.h>
24 #include <asm/arch/sys_proto.h>
25 #include <asm/arch/sys_info.h>
27 static char *rev_s[CPU_3XX_MAX_REV] = {
38 * get_device_type(): tell if GP/HS/EMU/TST
40 u32 get_device_type(void)
43 mode = __raw_readl(CONTROL_STATUS) & (DEVICE_MASK);
48 * get_cpu_type(): extract cpu info
50 u32 get_cpu_type(void)
52 return __raw_readl(CONTROL_OMAP_STATUS);
56 * get_cpu_id(): extract cpu id
57 * returns 0 for ES1.0, cpuid otherwise
64 * On ES1.0 the IDCODE register is not exposed on L4
65 * so using CPU ID to differentiate between ES1.0 and > ES1.0.
67 __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r"(cpuid));
68 if ((cpuid & 0xf) == 0x0) {
71 /* Decode the IDs on > ES1.0 */
72 cpuid = __raw_readl(CONTROL_IDCODE);
79 * get_cpu_family(void): extract cpu info
81 u32 get_cpu_family(void)
85 u32 cpuid = get_cpu_id();
90 hawkeye = (cpuid >> HAWKEYE_SHIFT) & 0xffff;
92 case HAWKEYE_OMAP34XX:
93 cpu_family = CPU_OMAP34XX;
96 cpu_family = CPU_AM35XX;
98 case HAWKEYE_OMAP36XX:
99 cpu_family = CPU_OMAP36XX;
102 cpu_family = CPU_OMAP34XX;
109 * get_cpu_rev(void): extract version info
111 u32 get_cpu_rev(void)
113 u32 cpuid = get_cpu_id();
118 return (cpuid >> CPU_3XX_ID_SHIFT) & 0xf;
122 * print_cpuinfo(void): print CPU information
124 int print_cpuinfo(void)
126 char *cpu_family_s, *cpu_s, *sec_s;
128 switch (get_cpu_family()) {
130 cpu_family_s = "OMAP";
131 switch (get_cpu_type()) {
151 switch (get_cpu_type()) {
164 cpu_family_s = "OMAP";
165 switch (get_cpu_type()) {
175 cpu_family_s = "OMAP";
179 switch (get_device_type()) {
196 printf("%s%s-%s ES%s\n",
197 cpu_family_s, cpu_s, sec_s, rev_s[get_cpu_rev()]);
203 * get_sysboot_value(void): return SYS_BOOT[4:0]
205 u32 get_sysboot_value(void)
208 mode = __raw_readl(CONTROL_STATUS) & (SYSBOOT_MASK);