]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/BuR/kwb/board.c
board/BuR/kwb: use bootvx(...) (with bootline feature) instead go(...)
[karo-tx-uboot.git] / board / BuR / kwb / board.c
index 892311e6eeb943e6f903f7c9493a905f60566139..ad74ff299cb724d5f146b5472a406c77c847b957 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Board functions for B&R KWB Board
  *
- * Copyright (C) 2013 Hannes Petermaier <oe5hpm@oevsv.at>
+ * Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at>
  * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
  *
  * SPDX-License-Identifier:    GPL-2.0+
 #define        RSTCTRL_FORCE_PWR_NEN                   0x0404
 #define        RSTCTRL_CAN_STB                         0x4040
 
-#define VXWORKS_BOOTLINE                       0x80001100
-#define DEFAULT_BOOTLINE       "cpsw(0,0):pme/vxWorks"
-#define VXWORKS_USER           "u=vxWorksFTP pw=vxWorks tn=vxtarget"
-
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_SPL_BUILD)
@@ -124,7 +120,8 @@ void am33xx_spl_board_init(void)
        gpio_direction_output(LCD_PWR, 0);
 
        /* setup I2C */
-       enable_i2c0_pin_mux();
+       enable_i2c_pin_mux();
+       i2c_set_bus_num(0);
        i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 
        /* power-ON  3V3 via Resetcontroller */
@@ -213,8 +210,8 @@ int board_late_init(void)
                            gpio_get_value(PUSH_KEY) && 1 == cnt) {
                                lcd_position_cursor(1, 8);
                                lcd_puts(
-                               "updating U-BOOT from USB ...           ");
-                               setenv("bootcmd", "run usbupdate");
+                               "starting u-boot script from USB ...    ");
+                               setenv("bootcmd", "run usbscript");
                                cnt = 4;
                                break;
                        } else if ((!gpio_get_value(ESC_KEY) &&
@@ -280,30 +277,15 @@ int board_late_init(void)
        } else {
                puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n");
        }
-       /* setup vxworks bootline */
-       char *vxworksbootline = (char *)VXWORKS_BOOTLINE;
-
-       /* setup default IP, in case if there is nothing in environment */
-       if (!getenv("ipaddr")) {
-               setenv("ipaddr", "192.168.60.1");
-               setenv("netmask", "255.255.255.0");
-               setenv("serverip", "192.168.60.254");
-               setenv("gatewayip", "192.168.60.254");
-               puts("net: had no IP! made default setup.\n");
-       }
-
-       sprintf(vxworksbootline,
-               "%s h=%s e=%s:%s g=%s %s o=0x%08x;0x%08x;0x%08x;0x%08x",
-               DEFAULT_BOOTLINE,
-               getenv("serverip"),
-               getenv("ipaddr"), getenv("netmask"),
-               getenv("gatewayip"),
-               VXWORKS_USER,
-               (unsigned int) gd->fb_base-0x20,
-               (u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
-               (u32)getenv_ulong("vx_romfsbase", 16, 0),
-               (u32)getenv_ulong("vx_romfssize", 16, 0));
-
+       /* 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)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
+                (u32)getenv_ulong("vx_romfsbase", 16, 0),
+                (u32)getenv_ulong("vx_romfssize", 16, 0));
+       setenv("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