static void display_board_info(void) { #ifdef CONFIG_GENERIC_MMC struct mmc *mmc = find_mmc_device(0); #endif vidinfo_t *vid = &panel_info; lcd_position_cursor(4, 4); lcd_printf("%s\n\t", U_BOOT_VERSION); lcd_puts("\n\t\tBoard Info:\n"); #ifdef CONFIG_SYS_BOARD lcd_printf("\tBoard name: %s\n", CONFIG_SYS_BOARD); #endif #ifdef CONFIG_REVISION_TAG lcd_printf("\tBoard rev: %u\n", get_board_rev()); #endif lcd_printf("\tDRAM banks: %u\n", CONFIG_NR_DRAM_BANKS); lcd_printf("\tDRAM size: %u MB\n", gd->ram_size / SZ_1M); #ifdef CONFIG_GENERIC_MMC if (mmc) { if (!mmc->capacity) mmc_init(mmc); lcd_printf("\teMMC size: %llu MB\n", mmc->capacity / SZ_1M); } #endif if (vid) lcd_printf("\tDisplay resolution: %u x % u\n", vid->vl_col, vid->vl_row); lcd_printf("\tDisplay BPP: %u\n", 1 << vid->vl_bpix); }
int board_late_init(void) { if (0 == gpio_get_value(REPSWITCH)) { lcd_position_cursor(1, 8); lcd_puts( "switching to network-console ... "); setenv("bootcmd", "run netconsole"); } return 0; }
int board_late_init(void) { const unsigned int toff = 1000; unsigned int cnt = 3; unsigned short buf = 0xAAAA; unsigned char scratchreg = 0; unsigned int oldspeed; /* try to read out some boot-instruction from resetcontroller */ oldspeed = i2c_get_bus_speed(); if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) { i2c_read(RSTCTRL_ADDR, RSTCTRL_SCRATCHREG, 1, &scratchreg, sizeof(scratchreg)); i2c_set_bus_speed(oldspeed); } else { puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n"); } if (gpio_get_value(ESC_KEY)) { do { lcd_position_cursor(1, 8); switch (cnt) { case 3: lcd_puts( "release ESC-KEY to enter SERVICE-mode."); break; case 2: lcd_puts( "release ESC-KEY to enter DIAGNOSE-mode."); break; case 1: lcd_puts( "release ESC-KEY to enter BOOT-mode. "); break; } mdelay(toff); cnt--; if (!gpio_get_value(ESC_KEY) && gpio_get_value(PUSH_KEY) && 2 == cnt) { lcd_position_cursor(1, 8); lcd_puts( "switching to network-console ... "); env_set("bootcmd", "run netconsole"); cnt = 4; break; } else if (!gpio_get_value(ESC_KEY) && gpio_get_value(PUSH_KEY) && 1 == cnt) { lcd_position_cursor(1, 8); lcd_puts( "starting u-boot script from USB ... "); env_set("bootcmd", "run usbscript"); cnt = 4; break; } else if ((!gpio_get_value(ESC_KEY) && gpio_get_value(PUSH_KEY) && cnt == 0) || (gpio_get_value(ESC_KEY) && gpio_get_value(PUSH_KEY) && cnt == 0)) { lcd_position_cursor(1, 8); lcd_puts( "starting script from network ... "); env_set("bootcmd", "run netscript"); cnt = 4; break; } else if (!gpio_get_value(ESC_KEY)) { break; } } while (cnt); } else if (scratchreg == 0xCC) { lcd_position_cursor(1, 8); lcd_puts( "starting vxworks from network ... "); env_set("bootcmd", "run netboot"); cnt = 4; } else if (scratchreg == 0xCD) { lcd_position_cursor(1, 8); lcd_puts( "starting script from network ... "); env_set("bootcmd", "run netscript"); cnt = 4; } else if (scratchreg == 0xCE) { lcd_position_cursor(1, 8); lcd_puts( "starting AR from eMMC ... "); env_set("bootcmd", "run mmcboot"); cnt = 4; } lcd_position_cursor(1, 8); switch (cnt) { case 0: lcd_puts("entering BOOT-mode. "); env_set("bootcmd", "run defaultAR"); buf = 0x0000; break; case 1: lcd_puts("entering DIAGNOSE-mode. "); buf = 0x0F0F; break; case 2: lcd_puts("entering SERVICE mode. "); buf = 0xB4B4; break; case 3: lcd_puts("loading OS... "); buf = 0x0404; break; } /* write bootinfo into scratchregister of resetcontroller */ oldspeed = i2c_get_bus_speed(); if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) { i2c_write(RSTCTRL_ADDR, RSTCTRL_SCRATCHREG, 1, (uint8_t *)&buf, sizeof(buf)); i2c_set_bus_speed(oldspeed); } else { puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n"); } /* setup othbootargs for bootvx-command (vxWorks bootline) */ char othbootargs[128]; snprintf(othbootargs, sizeof(othbootargs), "u=vxWorksFTP pw=vxWorks o=0x%08x;0x%08x;0x%08x;0x%08x", (unsigned int) gd->fb_base-0x20, (u32)env_get_ulong("vx_memtop", 16, gd->fb_base-0x20), (u32)env_get_ulong("vx_romfsbase", 16, 0), (u32)env_get_ulong("vx_romfssize", 16, 0)); env_set("othbootargs", othbootargs); /* * reset VBAR registers to its reset location, VxWorks 6.9.3.2 does * expect that vectors are there, original u-boot moves them to _start */ __asm__("ldr r0,=0x20000"); __asm__("mcr p15, 0, r0, c12, c0, 0"); /* Set VBAR */ return 0; }