summaryrefslogtreecommitdiff
path: root/board/BuR
diff options
context:
space:
mode:
authorHannes Petermaier <oe5hpm@oevsv.at>2015-02-03 13:22:43 +0100
committerTom Rini <trini@konsulko.com>2015-03-05 20:13:20 -0500
commit8db622cdd44ae5173a145a35c331cccfdbfeda5d (patch)
treef89317345f202af82314d0d8cddca80dc38dd63b /board/BuR
parenta9642925a126b6a0be1e205c8da60883114a0f3d (diff)
board/BuR/kwb: Support modify bootcmd through reset-controller
For some cases it is necessary to modify temporaly the bootcommand. This can be done by writing into the Scratchregister a specific value: * 0xCC - modify bootcmd "run netboot" * 0xCD - modify bootcmd "run netscript" * 0xCE - modify bootcmd "run mmcboot" the environment in flash is NOT overwritten. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
Diffstat (limited to 'board/BuR')
-rw-r--r--board/BuR/kwb/board.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 455f4721f0d..892311e6eeb 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -169,10 +169,18 @@ 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;
- tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
- TPS65217_WLEDCTRL2, 0x32, 0xFF); /* 50% dimlevel */
+ /* 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 {
@@ -223,6 +231,24 @@ int board_late_init(void)
break;
}
} while (cnt);
+ } else if (scratchreg == 0xCC) {
+ lcd_position_cursor(1, 8);
+ lcd_puts(
+ "starting vxworks from network ... ");
+ setenv("bootcmd", "run netboot");
+ cnt = 4;
+ } else if (scratchreg == 0xCD) {
+ lcd_position_cursor(1, 8);
+ lcd_puts(
+ "starting script from network ... ");
+ setenv("bootcmd", "run netscript");
+ cnt = 4;
+ } else if (scratchreg == 0xCE) {
+ lcd_position_cursor(1, 8);
+ lcd_puts(
+ "starting AR from eMMC ... ");
+ setenv("bootcmd", "run mmcboot");
+ cnt = 4;
}
lcd_position_cursor(1, 8);