Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 2 | /* |
| 3 | * board.c |
| 4 | * |
Hannes Schmelzer | 46dc5cb | 2016-06-22 12:36:14 +0200 | [diff] [blame] | 5 | * Board functions for B&R BRXRE1 Board |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 6 | * |
Hannes Schmelzer | 7935f03 | 2015-05-28 15:41:12 +0200 | [diff] [blame] | 7 | * Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at> |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 8 | * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com |
| 9 | * |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 10 | */ |
| 11 | #include <common.h> |
| 12 | #include <errno.h> |
| 13 | #include <spl.h> |
| 14 | #include <asm/arch/cpu.h> |
| 15 | #include <asm/arch/hardware.h> |
| 16 | #include <asm/arch/omap.h> |
| 17 | #include <asm/arch/ddr_defs.h> |
| 18 | #include <asm/arch/clock.h> |
| 19 | #include <asm/arch/gpio.h> |
| 20 | #include <asm/arch/sys_proto.h> |
| 21 | #include <asm/arch/mem.h> |
| 22 | #include <asm/io.h> |
| 23 | #include <asm/emif.h> |
| 24 | #include <asm/gpio.h> |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 25 | #include <dm.h> |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 26 | #include <i2c.h> |
| 27 | #include <power/tps65217.h> |
| 28 | #include "../common/bur_common.h" |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 29 | #include <lcd.h> |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 30 | |
| 31 | /* -------------------------------------------------------------------------*/ |
| 32 | /* -- defines for used GPIO Hardware -- */ |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 33 | /* -- PSOC Resetcontroller Register defines -- */ |
Hannes Schmelzer | 80624c0 | 2019-04-10 14:13:15 +0200 | [diff] [blame^] | 34 | #define ESC_KEY (0 + 19) |
| 35 | #define LCD_PWR (0 + 5) |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 36 | |
| 37 | /* I2C Address of controller */ |
| 38 | #define RSTCTRL_ADDR 0x75 |
| 39 | /* Register for CTRL-word */ |
| 40 | #define RSTCTRL_CTRLREG 0x01 |
| 41 | /* Register for giving some information to VxWorks OS */ |
| 42 | #define RSTCTRL_SCRATCHREG 0x04 |
| 43 | |
| 44 | /* -- defines for RSTCTRL_CTRLREG -- */ |
| 45 | #define RSTCTRL_FORCE_PWR_NEN 0x0404 |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 46 | #define RSTCTRL_CAN_STB 0x4040 |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 47 | |
Hannes Petermaier | b6bb11d | 2015-02-03 13:22:42 +0100 | [diff] [blame] | 48 | DECLARE_GLOBAL_DATA_PTR; |
| 49 | |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 50 | static int rstctrl_rw(u8 reg, unsigned char rnw, void *pdat, int size) |
| 51 | { |
| 52 | struct udevice *i2cdev; |
| 53 | int rc; |
| 54 | |
| 55 | rc = i2c_get_chip_for_busnum(0, RSTCTRL_ADDR, 1, &i2cdev); |
| 56 | if (rc >= 0) { |
| 57 | if (rnw) |
| 58 | rc = dm_i2c_read(i2cdev, reg, pdat, size); |
| 59 | else |
| 60 | rc = dm_i2c_write(i2cdev, reg, pdat, size); |
| 61 | } else { |
| 62 | printf("%s: cannot get udevice for chip 0x%02x!\n", |
| 63 | __func__, RSTCTRL_ADDR); |
| 64 | } |
| 65 | |
| 66 | return rc; |
| 67 | } |
| 68 | |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 69 | #if defined(CONFIG_SPL_BUILD) |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 70 | static const struct ddr_data ddr3_data = { |
| 71 | .datardsratio0 = MT41K256M16HA125E_RD_DQS, |
| 72 | .datawdsratio0 = MT41K256M16HA125E_WR_DQS, |
| 73 | .datafwsratio0 = MT41K256M16HA125E_PHY_FIFO_WE, |
| 74 | .datawrsratio0 = MT41K256M16HA125E_PHY_WR_DATA, |
| 75 | }; |
Hannes Schmelzer | 80624c0 | 2019-04-10 14:13:15 +0200 | [diff] [blame^] | 76 | |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 77 | static const struct cmd_control ddr3_cmd_ctrl_data = { |
| 78 | .cmd0csratio = MT41K256M16HA125E_RATIO, |
| 79 | .cmd0iclkout = MT41K256M16HA125E_INVERT_CLKOUT, |
| 80 | |
| 81 | .cmd1csratio = MT41K256M16HA125E_RATIO, |
| 82 | .cmd1iclkout = MT41K256M16HA125E_INVERT_CLKOUT, |
| 83 | |
| 84 | .cmd2csratio = MT41K256M16HA125E_RATIO, |
| 85 | .cmd2iclkout = MT41K256M16HA125E_INVERT_CLKOUT, |
| 86 | }; |
Hannes Schmelzer | 80624c0 | 2019-04-10 14:13:15 +0200 | [diff] [blame^] | 87 | |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 88 | static struct emif_regs ddr3_emif_reg_data = { |
| 89 | .sdram_config = MT41K256M16HA125E_EMIF_SDCFG, |
| 90 | .ref_ctrl = MT41K256M16HA125E_EMIF_SDREF, |
| 91 | .sdram_tim1 = MT41K256M16HA125E_EMIF_TIM1, |
| 92 | .sdram_tim2 = MT41K256M16HA125E_EMIF_TIM2, |
| 93 | .sdram_tim3 = MT41K256M16HA125E_EMIF_TIM3, |
| 94 | .zq_config = MT41K256M16HA125E_ZQ_CFG, |
| 95 | .emif_ddr_phy_ctlr_1 = MT41K256M16HA125E_EMIF_READ_LATENCY, |
| 96 | }; |
| 97 | |
| 98 | static const struct ctrl_ioregs ddr3_ioregs = { |
| 99 | .cm0ioctl = MT41K256M16HA125E_IOCTRL_VALUE, |
| 100 | .cm1ioctl = MT41K256M16HA125E_IOCTRL_VALUE, |
| 101 | .cm2ioctl = MT41K256M16HA125E_IOCTRL_VALUE, |
| 102 | .dt0ioctl = MT41K256M16HA125E_IOCTRL_VALUE, |
| 103 | .dt1ioctl = MT41K256M16HA125E_IOCTRL_VALUE, |
| 104 | }; |
| 105 | |
Hannes Schmelzer | 80624c0 | 2019-04-10 14:13:15 +0200 | [diff] [blame^] | 106 | #define OSC (V_OSCK / 1000000) |
| 107 | const struct dpll_params dpll_ddr3 = { 400, OSC - 1, 1, -1, -1, -1, -1}; |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 108 | |
| 109 | void am33xx_spl_board_init(void) |
| 110 | { |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 111 | unsigned short buf; |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 112 | int rc; |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 113 | |
| 114 | struct cm_perpll *const cmper = (struct cm_perpll *)CM_PER; |
| 115 | struct cm_wkuppll *const cmwkup = (struct cm_wkuppll *)CM_WKUP; |
| 116 | /* |
| 117 | * enable additional clocks of modules which are accessed later from |
| 118 | * VxWorks OS |
| 119 | */ |
| 120 | u32 *const clk_domains[] = { 0 }; |
| 121 | |
Hannes Schmelzer | 46dc5cb | 2016-06-22 12:36:14 +0200 | [diff] [blame] | 122 | u32 *const clk_modules_xre1specific[] = { |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 123 | &cmwkup->wkup_adctscctrl, |
| 124 | &cmper->spi1clkctrl, |
| 125 | &cmper->dcan0clkctrl, |
| 126 | &cmper->dcan1clkctrl, |
| 127 | &cmper->epwmss0clkctrl, |
| 128 | &cmper->epwmss1clkctrl, |
| 129 | &cmper->epwmss2clkctrl, |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 130 | &cmper->lcdclkctrl, |
| 131 | &cmper->lcdcclkstctrl, |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 132 | 0 |
| 133 | }; |
Hannes Schmelzer | 46dc5cb | 2016-06-22 12:36:14 +0200 | [diff] [blame] | 134 | do_enable_clocks(clk_domains, clk_modules_xre1specific, 1); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 135 | /* power-OFF LCD-Display */ |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 136 | if (gpio_request(LCD_PWR, "LCD_PWR") != 0) |
| 137 | printf("cannot request gpio for LCD_PWR!\n"); |
| 138 | else if (gpio_direction_output(LCD_PWR, 0) != 0) |
| 139 | printf("cannot set direction output on LCD_PWR!\n"); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 140 | |
| 141 | /* setup I2C */ |
Hannes Petermaier | 2e68d2b | 2015-03-19 10:43:15 +0100 | [diff] [blame] | 142 | enable_i2c_pin_mux(); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 143 | |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 144 | /* power-ON 3V3 via Resetcontroller */ |
| 145 | buf = RSTCTRL_FORCE_PWR_NEN | RSTCTRL_CAN_STB; |
| 146 | rc = rstctrl_rw(RSTCTRL_CTRLREG, 0, (uint8_t *)&buf, sizeof(buf)); |
| 147 | if (rc != 0) |
| 148 | printf("ERROR: cannot write to resetc (turn on PWR_nEN)\n"); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 149 | |
Hannes Schmelzer | 717ee36 | 2019-01-31 09:24:45 +0100 | [diff] [blame] | 150 | pmicsetup(0, 0); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | const struct dpll_params *get_dpll_ddr_params(void) |
| 154 | { |
| 155 | return &dpll_ddr3; |
| 156 | } |
| 157 | |
| 158 | void sdram_init(void) |
| 159 | { |
| 160 | config_ddr(400, &ddr3_ioregs, |
| 161 | &ddr3_data, |
| 162 | &ddr3_cmd_ctrl_data, |
| 163 | &ddr3_emif_reg_data, 0); |
| 164 | } |
| 165 | #endif /* CONFIG_SPL_BUILD */ |
| 166 | /* |
| 167 | * Basic board specific setup. Pinmux has been handled already. |
| 168 | */ |
| 169 | int board_init(void) |
| 170 | { |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 171 | if (power_tps65217_init(0)) |
| 172 | printf("WARN: cannot setup PMIC 0x24 @ bus #0, not found!.\n"); |
| 173 | |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 174 | return 0; |
| 175 | } |
| 176 | |
| 177 | #ifdef CONFIG_BOARD_LATE_INIT |
| 178 | int board_late_init(void) |
| 179 | { |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 180 | const unsigned int toff = 1000; |
| 181 | unsigned int cnt = 3; |
| 182 | unsigned short buf = 0xAAAA; |
Hannes Petermaier | 7c27799 | 2015-02-03 13:22:43 +0100 | [diff] [blame] | 183 | unsigned char scratchreg = 0; |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 184 | int rc; |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 185 | |
Hannes Petermaier | 7c27799 | 2015-02-03 13:22:43 +0100 | [diff] [blame] | 186 | /* try to read out some boot-instruction from resetcontroller */ |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 187 | rc = rstctrl_rw(RSTCTRL_SCRATCHREG, 1, &scratchreg, sizeof(scratchreg)); |
| 188 | if (rc != 0) |
| 189 | printf("ERROR: read scratchregister (resetc) failed!\n"); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 190 | |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 191 | if (gpio_request(ESC_KEY, "boot-key") != 0) { |
| 192 | printf("cannot request boot-key!\n"); |
| 193 | } else if (gpio_get_value(ESC_KEY)) { |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 194 | do { |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 195 | lcd_position_cursor(1, 8); |
| 196 | switch (cnt) { |
| 197 | case 3: |
| 198 | lcd_puts( |
| 199 | "release ESC-KEY to enter SERVICE-mode."); |
| 200 | break; |
| 201 | case 2: |
| 202 | lcd_puts( |
| 203 | "release ESC-KEY to enter DIAGNOSE-mode."); |
| 204 | break; |
| 205 | case 1: |
| 206 | lcd_puts( |
| 207 | "release ESC-KEY to enter BOOT-mode. "); |
| 208 | break; |
| 209 | } |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 210 | mdelay(toff); |
| 211 | cnt--; |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 212 | if (!gpio_get_value(ESC_KEY) && |
| 213 | gpio_get_value(PUSH_KEY) && 2 == cnt) { |
| 214 | lcd_position_cursor(1, 8); |
| 215 | lcd_puts( |
| 216 | "switching to network-console ... "); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 217 | env_set("bootcmd", "run netconsole"); |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 218 | cnt = 4; |
| 219 | break; |
| 220 | } else if (!gpio_get_value(ESC_KEY) && |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 221 | gpio_get_value(PUSH_KEY) && 1 == cnt) { |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 222 | lcd_position_cursor(1, 8); |
| 223 | lcd_puts( |
Hannes Petermaier | 9826773 | 2015-04-24 14:49:39 +0200 | [diff] [blame] | 224 | "starting u-boot script from USB ... "); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 225 | env_set("bootcmd", "run usbscript"); |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 226 | cnt = 4; |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 227 | break; |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 228 | } else if ((!gpio_get_value(ESC_KEY) && |
| 229 | gpio_get_value(PUSH_KEY) && cnt == 0) || |
| 230 | (gpio_get_value(ESC_KEY) && |
| 231 | gpio_get_value(PUSH_KEY) && cnt == 0)) { |
| 232 | lcd_position_cursor(1, 8); |
| 233 | lcd_puts( |
| 234 | "starting script from network ... "); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 235 | env_set("bootcmd", "run netscript"); |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 236 | cnt = 4; |
| 237 | break; |
| 238 | } else if (!gpio_get_value(ESC_KEY)) { |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 239 | break; |
| 240 | } |
| 241 | } while (cnt); |
Hannes Petermaier | 7c27799 | 2015-02-03 13:22:43 +0100 | [diff] [blame] | 242 | } else if (scratchreg == 0xCC) { |
| 243 | lcd_position_cursor(1, 8); |
| 244 | lcd_puts( |
| 245 | "starting vxworks from network ... "); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 246 | env_set("bootcmd", "run netboot"); |
Hannes Petermaier | 7c27799 | 2015-02-03 13:22:43 +0100 | [diff] [blame] | 247 | cnt = 4; |
| 248 | } else if (scratchreg == 0xCD) { |
| 249 | lcd_position_cursor(1, 8); |
| 250 | lcd_puts( |
| 251 | "starting script from network ... "); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 252 | env_set("bootcmd", "run netscript"); |
Hannes Petermaier | 7c27799 | 2015-02-03 13:22:43 +0100 | [diff] [blame] | 253 | cnt = 4; |
| 254 | } else if (scratchreg == 0xCE) { |
| 255 | lcd_position_cursor(1, 8); |
| 256 | lcd_puts( |
| 257 | "starting AR from eMMC ... "); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 258 | env_set("bootcmd", "run mmcboot"); |
Hannes Petermaier | 7c27799 | 2015-02-03 13:22:43 +0100 | [diff] [blame] | 259 | cnt = 4; |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 260 | } |
| 261 | |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 262 | lcd_position_cursor(1, 8); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 263 | switch (cnt) { |
| 264 | case 0: |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 265 | lcd_puts("entering BOOT-mode. "); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 266 | env_set("bootcmd", "run defaultAR"); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 267 | buf = 0x0000; |
| 268 | break; |
| 269 | case 1: |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 270 | lcd_puts("entering DIAGNOSE-mode. "); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 271 | buf = 0x0F0F; |
| 272 | break; |
| 273 | case 2: |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 274 | lcd_puts("entering SERVICE mode. "); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 275 | buf = 0xB4B4; |
| 276 | break; |
| 277 | case 3: |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 278 | lcd_puts("loading OS... "); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 279 | buf = 0x0404; |
| 280 | break; |
| 281 | } |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 282 | /* write bootinfo into scratchregister of resetcontroller */ |
Hannes Schmelzer | 008c6b5 | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 283 | rc = rstctrl_rw(RSTCTRL_SCRATCHREG, 0, (uint8_t *)&buf, sizeof(buf)); |
| 284 | if (rc != 0) |
| 285 | printf("ERROR: write scratchregister (resetc) failed!\n"); |
| 286 | |
Hannes Petermaier | 73914df | 2015-09-29 08:43:33 +0200 | [diff] [blame] | 287 | /* setup othbootargs for bootvx-command (vxWorks bootline) */ |
| 288 | char othbootargs[128]; |
| 289 | snprintf(othbootargs, sizeof(othbootargs), |
| 290 | "u=vxWorksFTP pw=vxWorks o=0x%08x;0x%08x;0x%08x;0x%08x", |
Hannes Schmelzer | 80624c0 | 2019-04-10 14:13:15 +0200 | [diff] [blame^] | 291 | (u32)gd->fb_base - 0x20, |
| 292 | (u32)env_get_ulong("vx_memtop", 16, gd->fb_base - 0x20), |
Simon Glass | 22c34c2 | 2017-08-03 12:22:13 -0600 | [diff] [blame] | 293 | (u32)env_get_ulong("vx_romfsbase", 16, 0), |
| 294 | (u32)env_get_ulong("vx_romfssize", 16, 0)); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 295 | env_set("othbootargs", othbootargs); |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 296 | /* |
| 297 | * reset VBAR registers to its reset location, VxWorks 6.9.3.2 does |
| 298 | * expect that vectors are there, original u-boot moves them to _start |
| 299 | */ |
| 300 | __asm__("ldr r0,=0x20000"); |
| 301 | __asm__("mcr p15, 0, r0, c12, c0, 0"); /* Set VBAR */ |
| 302 | |
| 303 | return 0; |
| 304 | } |
| 305 | #endif /* CONFIG_BOARD_LATE_INIT */ |