diff options
Diffstat (limited to 'recipes/u-boot/u-boot-git/beagleboard/0018-OMAP3-sys_info-update-cpu-detection-for-36XX-37XX.patch')
-rw-r--r-- | recipes/u-boot/u-boot-git/beagleboard/0018-OMAP3-sys_info-update-cpu-detection-for-36XX-37XX.patch | 196 |
1 files changed, 196 insertions, 0 deletions
diff --git a/recipes/u-boot/u-boot-git/beagleboard/0018-OMAP3-sys_info-update-cpu-detection-for-36XX-37XX.patch b/recipes/u-boot/u-boot-git/beagleboard/0018-OMAP3-sys_info-update-cpu-detection-for-36XX-37XX.patch new file mode 100644 index 0000000000..65f606b442 --- /dev/null +++ b/recipes/u-boot/u-boot-git/beagleboard/0018-OMAP3-sys_info-update-cpu-detection-for-36XX-37XX.patch @@ -0,0 +1,196 @@ +From 8480eb0272865078290146031e09eb70baed3f6e Mon Sep 17 00:00:00 2001 +From: Steve Sakoman <steve@sakoman.com> +Date: Tue, 23 Mar 2010 09:17:59 -0700 +Subject: [PATCH 18/37] OMAP3 sys_info: update cpu detection for 36XX/37XX + +--- + cpu/arm_cortexa8/omap3/sys_info.c | 137 ++++++++++++++++++++++++++++--------- + 1 files changed, 105 insertions(+), 32 deletions(-) + +diff --git a/cpu/arm_cortexa8/omap3/sys_info.c b/cpu/arm_cortexa8/omap3/sys_info.c +index e227f67..e32a846 100644 +--- a/cpu/arm_cortexa8/omap3/sys_info.c ++++ b/cpu/arm_cortexa8/omap3/sys_info.c +@@ -79,32 +79,72 @@ u32 get_cpu_type(void) + } + + /****************************************** +- * get_cpu_rev(void) - extract version info ++ * get_cpu_id(void) - extract cpu id ++ * returns 0 for ES1.0, cpuid otherwise + ******************************************/ +-u32 get_cpu_rev(void) ++u32 get_cpu_id(void) + { +- u32 cpuid = 0; + struct ctrl_id *id_base; ++ u32 cpuid = 0; + + /* + * On ES1.0 the IDCODE register is not exposed on L4 + * so using CPU ID to differentiate between ES1.0 and > ES1.0. + */ + __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r"(cpuid)); +- if ((cpuid & 0xf) == 0x0) +- return CPU_3XX_ES10; +- else { ++ if ((cpuid & 0xf) == 0x0) { ++ return 0; ++ } else { + /* Decode the IDs on > ES1.0 */ + id_base = (struct ctrl_id *) OMAP34XX_ID_L4_IO_BASE; + +- cpuid = (readl(&id_base->idcode) >> CPU_3XX_ID_SHIFT) & 0xf; ++ cpuid = readl(&id_base->idcode); ++ } + +- /* Some early ES2.0 seem to report ID 0, fix this */ +- if(cpuid == 0) +- cpuid = CPU_3XX_ES20; ++ return cpuid; ++} + +- return cpuid; ++/****************************************** ++ * get_cpu_family(void) - extract cpu info ++ ******************************************/ ++u32 get_cpu_family(void) ++{ ++ u16 hawkeye; ++ u32 cpu_family; ++ u32 cpuid = get_cpu_id(); ++ ++ if (cpuid == 0) ++ return CPU_OMAP34XX; ++ ++ hawkeye = (cpuid >> HAWKEYE_SHIFT) & 0xffff; ++ switch(hawkeye) { ++ case HAWKEYE_OMAP34XX: ++ cpu_family = CPU_OMAP34XX; ++ break; ++ case HAWKEYE_AM35XX: ++ cpu_family = CPU_AM35XX; ++ break; ++ case HAWKEYE_OMAP36XX: ++ cpu_family = CPU_OMAP36XX; ++ break; ++ default: ++ cpu_family = CPU_OMAP34XX; + } ++ ++ return cpu_family; ++} ++ ++/****************************************** ++ * get_cpu_rev(void) - extract version info ++ ******************************************/ ++u32 get_cpu_rev(void) ++{ ++ u32 cpuid = get_cpu_id(); ++ ++ if (cpuid == 0) ++ return CPU_3XX_ES10; ++ else ++ return (cpuid >> CPU_3XX_ID_SHIFT) & 0xf; + } + + /***************************************************************** +@@ -267,24 +307,57 @@ u32 get_device_type(void) + */ + int print_cpuinfo (void) + { +- char *cpu_s, *sec_s; +- +- switch (get_cpu_type()) { +- case OMAP3503: +- cpu_s = "3503"; +- break; +- case OMAP3515: +- cpu_s = "3515"; ++ char *cpu_family_s, *cpu_s, *sec_s; ++ ++ switch(get_cpu_family()) { ++ case CPU_OMAP34XX: ++ cpu_family_s = "OMAP"; ++ switch (get_cpu_type()) { ++ case OMAP3503: ++ cpu_s = "3503"; ++ break; ++ case OMAP3515: ++ cpu_s = "3515"; ++ break; ++ case OMAP3525: ++ cpu_s = "3525"; ++ break; ++ case OMAP3530: ++ cpu_s = "3530"; ++ break; ++ default: ++ cpu_s = "35XX"; ++ break; ++ } + break; +- case OMAP3525: +- cpu_s = "3525"; ++ case CPU_AM35XX: ++ cpu_family_s = "AM"; ++ switch (get_cpu_type()) { ++ case AM3505: ++ cpu_s = "3505"; ++ break; ++ case AM3517: ++ cpu_s = "3517"; ++ break; ++ default: ++ cpu_s = "35XX"; ++ break; ++ } + break; +- case OMAP3530: +- cpu_s = "3530"; ++ case CPU_OMAP36XX: ++ cpu_family_s = "OMAP"; ++ switch (get_cpu_type()) { ++ case OMAP3730: ++ cpu_s = "3630/3730"; ++ break; ++ default: ++ cpu_s = "36XX/37XX"; ++ break; ++ } + break; + default: ++ cpu_family_s = "OMAP"; + cpu_s = "35XX"; +- break; + } + + switch (get_device_type()) { +@@ -304,16 +377,16 @@ int print_cpuinfo (void) + sec_s = "?"; + } + +- printf("OMAP%s-%s ES%s, CPU-OPP2, L3-165MHz, ", +- cpu_s, sec_s, rev_s[get_cpu_rev()]); ++ printf("%s%s-%s ES%s, CPU-OPP2, L3-165MHz, ", ++ cpu_family_s, 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"); ++ if (get_cpu_family() == CPU_OMAP34XX) ++ if ((get_cpu_rev() >= CPU_3XX_ES31) && ++ (get_sku_id() == SKUID_CLK_720MHZ)) ++ printf("Max clock-720Mhz\n"); ++ else printf("Max clock-600Mhz\n"); ++ else printf("\n"); + +- +- + return 0; + } + #endif /* CONFIG_DISPLAY_CPUINFO */ +-- +1.6.6.1 + |