X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=arch%2Farm%2Fimx-common%2Fcpu.c;h=caa6ef6296159769574b4568cee28e479d2d742d;hp=b58df7da6fc1e3f992e2f5f5ad2e4b40afabb1ea;hb=8705c560fb8534ce89832e6f47cf2668cc838691;hpb=85bafb6da4dddfffa78479aa49a72ae48578a4ce diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index b58df7da6f..caa6ef6296 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -24,13 +25,17 @@ #include #endif -char *get_reset_cause(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +static u32 reset_cause = -1; + +static char *get_reset_cause(void) { u32 cause; struct src *src_regs = (struct src *)SRC_BASE_ADDR; cause = readl(&src_regs->srsr); writel(cause, &src_regs->srsr); + reset_cause = cause; switch (cause) { case 0x00001: @@ -53,8 +58,14 @@ char *get_reset_cause(void) } } -#if defined(CONFIG_MX53) || defined(CONFIG_MX6) -#if defined(CONFIG_MX53) +u32 get_imx_reset_cause(void) +{ + return reset_cause; +} +#endif + +#if defined(CONFIG_SOC_MX53) || defined(CONFIG_SOC_MX6) +#if defined(CONFIG_SOC_MX53) #define MEMCTL_BASE ESDCTL_BASE_ADDR #else #define MEMCTL_BASE MMDC_P0_BASE_ADDR @@ -111,6 +122,10 @@ unsigned imx_ddr_size(void) const char *get_imx_type(u32 imxtype) { switch (imxtype) { + case MXC_CPU_MX6QP: + return "6QP"; /* Quad-Plus version of the mx6 */ + case MXC_CPU_MX6DP: + return "6DP"; /* Dual-Plus version of the mx6 */ case MXC_CPU_MX6Q: return "6Q"; /* Quad-core version of the mx6 */ case MXC_CPU_MX6D: @@ -123,6 +138,8 @@ const char *get_imx_type(u32 imxtype) return "6SL"; /* Solo-Lite version of the mx6 */ case MXC_CPU_MX6SX: return "6SX"; /* SoloX version of the mx6 */ + case MXC_CPU_MX6UL: + return "6UL"; /* Ultra-Lite version of the mx6 */ case MXC_CPU_MX51: return "51"; case MXC_CPU_MX53: @@ -135,31 +152,61 @@ const char *get_imx_type(u32 imxtype) int print_cpuinfo(void) { u32 cpurev; + __maybe_unused u32 max_freq; -#if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL) +#if defined(CONFIG_SOC_MX6) && defined(CONFIG_IMX6_THERMAL) struct udevice *thermal_dev; - int cpu_tmp, ret; + int cpu_tmp, minc, maxc, ret; #endif cpurev = get_cpu_rev(); +#if defined(CONFIG_SOC_MX6) + printf("CPU: Freescale i.MX%s rev%d.%d", + get_imx_type((cpurev & 0xFF000) >> 12), + (cpurev & 0x000F0) >> 4, + (cpurev & 0x0000F) >> 0); + max_freq = get_cpu_speed_grade_hz(); + if (!max_freq || max_freq == mxc_get_clock(MXC_ARM_CLK)) { + printf(" at %dMHz\n", mxc_get_clock(MXC_ARM_CLK) / 1000000); + } else { + printf(" %d MHz (running at %d MHz)\n", max_freq / 1000000, + mxc_get_clock(MXC_ARM_CLK) / 1000000); + } +#else printf("CPU: Freescale i.MX%s rev%d.%d at %d MHz\n", get_imx_type((cpurev & 0xFF000) >> 12), (cpurev & 0x000F0) >> 4, (cpurev & 0x0000F) >> 0, mxc_get_clock(MXC_ARM_CLK) / 1000000); +#endif -#if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL) +#if defined(CONFIG_SOC_MX6) && defined(CONFIG_IMX6_THERMAL) + puts("CPU: "); + switch (get_cpu_temp_grade(&minc, &maxc)) { + case TEMP_AUTOMOTIVE: + puts("Automotive temperature grade "); + break; + case TEMP_INDUSTRIAL: + puts("Industrial temperature grade "); + break; + case TEMP_EXTCOMMERCIAL: + puts("Extended Commercial temperature grade "); + break; + default: + puts("Commercial temperature grade "); + } + printf("(%dC to %dC)", minc, maxc); ret = uclass_get_device(UCLASS_THERMAL, 0, &thermal_dev); if (!ret) { ret = thermal_get_temp(thermal_dev, &cpu_tmp); if (!ret) - printf("CPU: Temperature %d C\n", cpu_tmp); + printf(" at %dC\n", cpu_tmp); else - printf("CPU: Temperature: invalid sensor data\n"); + puts(" - invalid sensor data\n"); } else { - printf("CPU: Temperature: Can't find sensor device\n"); + puts(" - invalid sensor device\n"); } #endif @@ -172,7 +219,7 @@ int cpu_eth_init(bd_t *bis) { int rc = -ENODEV; -#if defined(CONFIG_FEC_MXC) +#if defined(CONFIG_FEC_MXC) && defined(CONFIG_FEC_MXC_PHYADDR) rc = fecmxc_initialize(bis); #endif @@ -206,6 +253,9 @@ void arch_preboot_os(void) { #if defined(CONFIG_CMD_SATA) sata_stop(); +#if defined(CONFIG_SOC_MX6) + disable_sata_clock(); +#endif #endif #if defined(CONFIG_VIDEO_IPUV3) /* disable video before launching O/S */