int checkboard(void) { char it[] = " IT"; int minc, maxc; switch (get_cpu_temp_grade(&minc, &maxc)) { case TEMP_AUTOMOTIVE: case TEMP_INDUSTRIAL: break; case TEMP_EXTCOMMERCIAL: default: it[0] = 0; }; printf("Model: Toradex Apalis iMX6 %s %s%s\n", is_cpu_type(MXC_CPU_MX6D) ? "Dual" : "Quad", (gd->ram_size == 0x80000000) ? "2GB" : (gd->ram_size == 0x40000000) ? "1GB" : "512MB", it); return 0; }
static void spl_dram_init(void) { int minc, maxc; switch (get_cpu_temp_grade(&minc, &maxc)) { case TEMP_COMMERCIAL: case TEMP_EXTCOMMERCIAL: puts("Commercial temperature grade DDR3 timings.\n"); ddr_init(mx6_com_dcd_table, ARRAY_SIZE(mx6_com_dcd_table)); break; case TEMP_INDUSTRIAL: case TEMP_AUTOMOTIVE: default: puts("Industrial temperature grade DDR3 timings.\n"); ddr_init(mx6_it_dcd_table, ARRAY_SIZE(mx6_it_dcd_table)); break; }; udelay(100); }
int board_late_init(void) { int minc, maxc; if (get_cpu_temp_grade(&minc, &maxc) != TEMP_COMMERCIAL) env_set("variant", "-wifi"); #ifdef CONFIG_CMD_BMODE add_board_boot_modes(board_boot_modes); #endif #ifdef CONFIG_CMD_USB_SDP if (is_boot_from_usb()) { printf("Serial Downloader recovery mode, using sdp command\n"); env_set("bootdelay", "0"); env_set("bootcmd", "sdp 0"); } #endif /* CONFIG_CMD_USB_SDP */ return 0; }
int print_cpuinfo(void) { u32 cpurev, max_freq; #if defined(CONFIG_MX6) && defined(CONFIG_IMX6_THERMAL) struct udevice *thermal_dev; int cpu_tmp, minc, maxc, ret; #endif cpurev = get_cpu_rev(); #if defined(CONFIG_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) 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 "); break; } 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(" at %dC\n", cpu_tmp); else puts(" - invalid sensor data\n"); } else { puts(" - invalid sensor device\n"); } #endif printf("Reset cause: %s\n", get_reset_cause()); return 0; }