From 27072274450ea8de1994744782397452b99814cc Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Wed, 3 Feb 2010 12:26:30 -0800 Subject: [PATCH 05/37] OMAP3: add entry for rev 3.1.2, check and display max cpu clock for rev > 3.0 --- cpu/arm_cortexa8/omap3/sys_info.c | 24 ++++++++++++++++++++++-- include/asm-arm/arch-omap3/cpu.h | 8 +++++++- include/asm-arm/arch-omap3/omap3.h | 3 ++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/cpu/arm_cortexa8/omap3/sys_info.c b/cpu/arm_cortexa8/omap3/sys_info.c index 08fb32e..e227f67 100644 --- a/cpu/arm_cortexa8/omap3/sys_info.c +++ b/cpu/arm_cortexa8/omap3/sys_info.c @@ -39,7 +39,10 @@ static char *rev_s[CPU_3XX_MAX_REV] = { "2.0", "2.1", "3.0", - "3.1"}; + "3.1", + "UNKNOWN", + "UNKNOWN", + "3.1.2"}; /***************************************************************** * dieid_num_r(void) - read and set die ID @@ -104,6 +107,16 @@ u32 get_cpu_rev(void) } } +/***************************************************************** + * get_sku_id(void) - read sku_id to get info on max clock rate + *****************************************************************/ +u32 get_sku_id(void) +{ + struct ctrl_id *id_base = (struct ctrl_id *)OMAP34XX_ID_L4_IO_BASE; + return (readl(&id_base->sku_id) & SKUID_CLK_MASK); +} + + /**************************************************** * is_mem_sdr() - return 1 if mem type in use is SDR ****************************************************/ @@ -291,9 +304,16 @@ int print_cpuinfo (void) sec_s = "?"; } - printf("OMAP%s-%s ES%s, CPU-OPP2 L3-165MHz\n", + printf("OMAP%s-%s ES%s, CPU-OPP2, L3-165MHz, ", cpu_s, sec_s, rev_s[get_cpu_rev()]); + printf("Max clock-"); + if ((get_cpu_rev() >= CPU_3XX_ES31) && (get_sku_id() == SKUID_CLK_720MHZ)) + printf("720Mhz\n"); + else printf("600Mhz\n"); + + + return 0; } #endif /* CONFIG_DISPLAY_CPUINFO */ diff --git a/include/asm-arm/arch-omap3/cpu.h b/include/asm-arm/arch-omap3/cpu.h index aa8de32..f769571 100644 --- a/include/asm-arm/arch-omap3/cpu.h +++ b/include/asm-arm/arch-omap3/cpu.h @@ -72,7 +72,8 @@ struct ctrl_id { u8 res1[0x4]; u32 idcode; /* 0x04 */ u32 prod_id; /* 0x08 */ - u8 res2[0x0C]; + u32 sku_id; /* 0x0c */ + u8 res2[0x08]; u32 die_id_0; /* 0x18 */ u32 die_id_1; /* 0x1C */ u32 die_id_2; /* 0x20 */ @@ -89,6 +90,11 @@ struct ctrl_id { #define HS_DEVICE 0x2 #define GP_DEVICE 0x3 +/* device speed */ +#define SKUID_CLK_MASK 0xf +#define SKUID_CLK_600MHZ 0x0 +#define SKUID_CLK_720MHZ 0x8 + #define GPMC_BASE (OMAP34XX_GPMC_BASE) #define GPMC_CONFIG_CS0 0x60 #define GPMC_CONFIG_CS0_BASE (GPMC_BASE + GPMC_CONFIG_CS0) diff --git a/include/asm-arm/arch-omap3/omap3.h b/include/asm-arm/arch-omap3/omap3.h index 12815f6..1349b8b 100644 --- a/include/asm-arm/arch-omap3/omap3.h +++ b/include/asm-arm/arch-omap3/omap3.h @@ -176,7 +176,8 @@ struct gpio { #define CPU_3XX_ES21 2 #define CPU_3XX_ES30 3 #define CPU_3XX_ES31 4 -#define CPU_3XX_MAX_REV (CPU_3XX_ES31 + 1) +#define CPU_3XX_ES312 7 +#define CPU_3XX_MAX_REV 8 #define CPU_3XX_ID_SHIFT 28 -- 1.6.6.1