Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 2 | /* |
| 3 | * boot-common.c |
| 4 | * |
| 5 | * Common bootmode functions for omap based boards |
| 6 | * |
| 7 | * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/ |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include <common.h> |
Dmitry Lifshitz | 29211a0 | 2014-12-15 16:02:58 +0200 | [diff] [blame] | 11 | #include <ahci.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 12 | #include <log.h> |
Keerthy | 0efb06d | 2022-01-27 13:16:52 +0100 | [diff] [blame] | 13 | #include <dm/uclass.h> |
| 14 | #include <fs_loader.h> |
Tom Rini | 28591df | 2012-08-13 12:03:19 -0700 | [diff] [blame] | 15 | #include <spl.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 16 | #include <asm/global_data.h> |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 17 | #include <asm/omap_common.h> |
| 18 | #include <asm/arch/omap.h> |
Tom Rini | a0b9fa5 | 2012-08-14 10:25:15 -0700 | [diff] [blame] | 19 | #include <asm/arch/mmc_host_def.h> |
Ilya Yanok | 741c57f | 2012-11-06 13:06:28 +0000 | [diff] [blame] | 20 | #include <asm/arch/sys_proto.h> |
Tom Rini | 303bfe8 | 2013-10-01 12:32:04 -0400 | [diff] [blame] | 21 | #include <watchdog.h> |
Dmitry Lifshitz | 29211a0 | 2014-12-15 16:02:58 +0200 | [diff] [blame] | 22 | #include <scsi.h> |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 23 | #include <i2c.h> |
Keerthy | 0efb06d | 2022-01-27 13:16:52 +0100 | [diff] [blame] | 24 | #include <remoteproc.h> |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 25 | |
SRICHARAN R | 3f30b0a | 2013-04-24 00:41:24 +0000 | [diff] [blame] | 26 | DECLARE_GLOBAL_DATA_PTR; |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 27 | |
Keerthy | 0efb06d | 2022-01-27 13:16:52 +0100 | [diff] [blame] | 28 | #define IPU1_LOAD_ADDR (0xa17ff000) |
| 29 | #define MAX_REMOTECORE_BIN_SIZE (8 * 0x100000) |
| 30 | #define IPU2_LOAD_ADDR (IPU1_LOAD_ADDR + MAX_REMOTECORE_BIN_SIZE) |
| 31 | |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 32 | __weak u32 omap_sys_boot_device(void) |
| 33 | { |
| 34 | return BOOT_DEVICE_NONE; |
| 35 | } |
| 36 | |
Tom Rini | 51df26c | 2013-05-31 12:31:59 -0400 | [diff] [blame] | 37 | void save_omap_boot_params(void) |
| 38 | { |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 39 | u32 boot_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS); |
| 40 | struct omap_boot_parameters *omap_boot_params; |
Paul Kocialkowski | dd15fab | 2015-08-27 10:46:09 +0200 | [diff] [blame] | 41 | int sys_boot_device = 0; |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 42 | u32 boot_device; |
| 43 | u32 boot_mode; |
Tom Rini | 51df26c | 2013-05-31 12:31:59 -0400 | [diff] [blame] | 44 | |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 45 | if ((boot_params < NON_SECURE_SRAM_START) || |
| 46 | (boot_params > NON_SECURE_SRAM_END)) |
Tom Rini | 51df26c | 2013-05-31 12:31:59 -0400 | [diff] [blame] | 47 | return; |
| 48 | |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 49 | omap_boot_params = (struct omap_boot_parameters *)boot_params; |
Stefan Roese | 0f3a480 | 2014-11-12 11:57:33 +0100 | [diff] [blame] | 50 | |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 51 | boot_device = omap_boot_params->boot_device; |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 52 | boot_mode = MMCSD_MODE_UNDEFINED; |
| 53 | |
| 54 | /* Boot device */ |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 55 | |
| 56 | #ifdef BOOT_DEVICE_NAND_I2C |
Stefan Roese | 0f3a480 | 2014-11-12 11:57:33 +0100 | [diff] [blame] | 57 | /* |
| 58 | * Re-map NAND&I2C boot-device to the "normal" NAND boot-device. |
| 59 | * Otherwise the SPL boot IF can't handle this device correctly. |
| 60 | * Somehow booting with Hynix 4GBit NAND H27U4G8 on Siemens |
| 61 | * Draco leads to this boot-device passed to SPL from the BootROM. |
| 62 | */ |
| 63 | if (boot_device == BOOT_DEVICE_NAND_I2C) |
| 64 | boot_device = BOOT_DEVICE_NAND; |
| 65 | #endif |
Paul Kocialkowski | b16d6d5 | 2015-07-15 16:02:21 +0200 | [diff] [blame] | 66 | #ifdef BOOT_DEVICE_QSPI_4 |
Tom Rini | 560ef45 | 2014-04-03 07:52:56 -0400 | [diff] [blame] | 67 | /* |
| 68 | * We get different values for QSPI_1 and QSPI_4 being used, but |
| 69 | * don't actually care about this difference. Rather than |
| 70 | * mangle the later code, if we're coming in as QSPI_4 just |
| 71 | * change to the QSPI_1 value. |
| 72 | */ |
Paul Kocialkowski | b16d6d5 | 2015-07-15 16:02:21 +0200 | [diff] [blame] | 73 | if (boot_device == BOOT_DEVICE_QSPI_4) |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 74 | boot_device = BOOT_DEVICE_SPI; |
| 75 | #endif |
Tom Rini | d00abb1 | 2017-06-15 13:57:00 -0400 | [diff] [blame] | 76 | #ifdef CONFIG_TI816X |
| 77 | /* |
| 78 | * On PG2.0 and later TI816x the values we get when booting are not the |
| 79 | * same as on PG1.0, which is what the defines are based on. Update |
| 80 | * them as needed. |
| 81 | */ |
| 82 | if (get_cpu_rev() != 1) { |
| 83 | if (boot_device == 0x05) { |
| 84 | omap_boot_params->boot_device = BOOT_DEVICE_NAND; |
| 85 | boot_device = BOOT_DEVICE_NAND; |
| 86 | } |
| 87 | if (boot_device == 0x08) { |
| 88 | omap_boot_params->boot_device = BOOT_DEVICE_MMC1; |
| 89 | boot_device = BOOT_DEVICE_MMC1; |
| 90 | } |
| 91 | } |
| 92 | #endif |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 93 | /* |
| 94 | * When booting from peripheral booting, the boot device is not usable |
| 95 | * as-is (unless there is support for it), so the boot device is instead |
| 96 | * figured out using the SYS_BOOT pins. |
| 97 | */ |
| 98 | switch (boot_device) { |
Paul Kocialkowski | dd15fab | 2015-08-27 10:46:09 +0200 | [diff] [blame] | 99 | #if defined(BOOT_DEVICE_UART) && !defined(CONFIG_SPL_YMODEM_SUPPORT) |
| 100 | case BOOT_DEVICE_UART: |
| 101 | sys_boot_device = 1; |
| 102 | break; |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 103 | #endif |
Abel Vesa | 5ea11ba5 | 2019-02-01 16:40:07 +0000 | [diff] [blame] | 104 | #if defined(BOOT_DEVICE_USB) && !defined(CONFIG_SPL_USB_STORAGE) |
Paul Kocialkowski | dd15fab | 2015-08-27 10:46:09 +0200 | [diff] [blame] | 105 | case BOOT_DEVICE_USB: |
| 106 | sys_boot_device = 1; |
| 107 | break; |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 108 | #endif |
Faiz Abbas | c01553b | 2018-02-16 21:17:44 +0530 | [diff] [blame] | 109 | #if defined(BOOT_DEVICE_USBETH) && !defined(CONFIG_SPL_USB_ETHER) |
Paul Kocialkowski | dd15fab | 2015-08-27 10:46:09 +0200 | [diff] [blame] | 110 | case BOOT_DEVICE_USBETH: |
| 111 | sys_boot_device = 1; |
| 112 | break; |
| 113 | #endif |
Simon Glass | e5cd9a4 | 2021-07-10 21:14:26 -0600 | [diff] [blame] | 114 | #if defined(BOOT_DEVICE_CPGMAC) && !defined(CONFIG_SPL_ETH) |
Paul Kocialkowski | dd15fab | 2015-08-27 10:46:09 +0200 | [diff] [blame] | 115 | case BOOT_DEVICE_CPGMAC: |
| 116 | sys_boot_device = 1; |
| 117 | break; |
| 118 | #endif |
Andrew F. Davis | 6d932e6 | 2019-01-17 13:43:02 -0600 | [diff] [blame] | 119 | #if defined(BOOT_DEVICE_DFU) && !defined(CONFIG_SPL_DFU) |
B, Ravi | 2fb19df | 2016-07-28 17:39:17 +0530 | [diff] [blame] | 120 | case BOOT_DEVICE_DFU: |
| 121 | sys_boot_device = 1; |
| 122 | break; |
| 123 | #endif |
Paul Kocialkowski | dd15fab | 2015-08-27 10:46:09 +0200 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | if (sys_boot_device) { |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 127 | boot_device = omap_sys_boot_device(); |
| 128 | |
| 129 | /* MMC raw mode will fallback to FS mode. */ |
| 130 | if ((boot_device >= MMC_BOOT_DEVICES_START) && |
| 131 | (boot_device <= MMC_BOOT_DEVICES_END)) |
| 132 | boot_mode = MMCSD_MODE_RAW; |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 133 | } |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 134 | |
| 135 | gd->arch.omap_boot_device = boot_device; |
| 136 | |
| 137 | /* Boot mode */ |
| 138 | |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 139 | #ifdef CONFIG_OMAP34XX |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 140 | if ((boot_device >= MMC_BOOT_DEVICES_START) && |
| 141 | (boot_device <= MMC_BOOT_DEVICES_END)) { |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 142 | switch (boot_device) { |
| 143 | case BOOT_DEVICE_MMC1: |
Tom Rini | 9266bf4 | 2016-05-02 10:52:51 -0400 | [diff] [blame] | 144 | boot_mode = MMCSD_MODE_FS; |
| 145 | break; |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 146 | case BOOT_DEVICE_MMC2: |
| 147 | boot_mode = MMCSD_MODE_RAW; |
| 148 | break; |
| 149 | } |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 150 | } |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 151 | #else |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 152 | /* |
| 153 | * If the boot device was dynamically changed and doesn't match what |
| 154 | * the bootrom initially booted, we cannot use the boot device |
| 155 | * descriptor to figure out the boot mode. |
| 156 | */ |
| 157 | if ((boot_device == omap_boot_params->boot_device) && |
| 158 | (boot_device >= MMC_BOOT_DEVICES_START) && |
| 159 | (boot_device <= MMC_BOOT_DEVICES_END)) { |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 160 | boot_params = omap_boot_params->boot_device_descriptor; |
| 161 | if ((boot_params < NON_SECURE_SRAM_START) || |
| 162 | (boot_params > NON_SECURE_SRAM_END)) |
| 163 | return; |
| 164 | |
| 165 | boot_params = *((u32 *)(boot_params + DEVICE_DATA_OFFSET)); |
| 166 | if ((boot_params < NON_SECURE_SRAM_START) || |
| 167 | (boot_params > NON_SECURE_SRAM_END)) |
| 168 | return; |
| 169 | |
| 170 | boot_mode = *((u32 *)(boot_params + BOOT_MODE_OFFSET)); |
| 171 | |
| 172 | if (boot_mode != MMCSD_MODE_FS && |
| 173 | boot_mode != MMCSD_MODE_RAW) |
| 174 | #ifdef CONFIG_SUPPORT_EMMC_BOOT |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 175 | boot_mode = MMCSD_MODE_EMMCBOOT; |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 176 | #else |
| 177 | boot_mode = MMCSD_MODE_UNDEFINED; |
| 178 | #endif |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 179 | } |
Paul Kocialkowski | 062fbb6 | 2015-07-15 16:02:23 +0200 | [diff] [blame] | 180 | #endif |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 181 | |
| 182 | gd->arch.omap_boot_mode = boot_mode; |
| 183 | |
| 184 | #if !defined(CONFIG_TI814X) && !defined(CONFIG_TI816X) && \ |
| 185 | !defined(CONFIG_AM33XX) && !defined(CONFIG_AM43XX) |
| 186 | |
| 187 | /* CH flags */ |
| 188 | |
| 189 | gd->arch.omap_ch_flags = omap_boot_params->ch_flags; |
Tom Rini | 560ef45 | 2014-04-03 07:52:56 -0400 | [diff] [blame] | 190 | #endif |
Tom Rini | 51df26c | 2013-05-31 12:31:59 -0400 | [diff] [blame] | 191 | } |
| 192 | |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 193 | #ifdef CONFIG_SPL_BUILD |
Tom Rini | 0be93ff | 2012-08-13 12:53:23 -0700 | [diff] [blame] | 194 | u32 spl_boot_device(void) |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 195 | { |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 196 | return gd->arch.omap_boot_device; |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 197 | } |
| 198 | |
Andre Przywara | 3cb12ef | 2021-07-12 11:06:49 +0100 | [diff] [blame] | 199 | u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 200 | { |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 201 | return gd->arch.omap_boot_mode; |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 202 | } |
Tom Rini | a0b9fa5 | 2012-08-14 10:25:15 -0700 | [diff] [blame] | 203 | |
Keerthy | 0efb06d | 2022-01-27 13:16:52 +0100 | [diff] [blame] | 204 | int load_firmware(char *name_fw, u32 *loadaddr) |
| 205 | { |
| 206 | struct udevice *fsdev; |
| 207 | int size = 0; |
| 208 | |
| 209 | if (!IS_ENABLED(CONFIG_FS_LOADER)) |
| 210 | return 0; |
| 211 | |
| 212 | if (!*loadaddr) |
| 213 | return 0; |
| 214 | |
| 215 | if (!uclass_get_device(UCLASS_FS_FIRMWARE_LOADER, 0, &fsdev)) { |
| 216 | size = request_firmware_into_buf(fsdev, name_fw, |
| 217 | (void *)*loadaddr, 0, 0); |
| 218 | } |
| 219 | |
| 220 | return size; |
| 221 | } |
| 222 | |
| 223 | void spl_boot_ipu(void) |
| 224 | { |
| 225 | int ret, size; |
| 226 | u32 loadaddr = IPU1_LOAD_ADDR; |
| 227 | |
| 228 | if (!IS_ENABLED(CONFIG_SPL_BUILD) || |
| 229 | !IS_ENABLED(CONFIG_REMOTEPROC_TI_IPU)) |
| 230 | return; |
| 231 | |
| 232 | size = load_firmware("dra7-ipu1-fw.xem4", &loadaddr); |
| 233 | if (size <= 0) { |
| 234 | pr_err("Firmware loading failed\n"); |
| 235 | goto skip_ipu1; |
| 236 | } |
| 237 | |
| 238 | enable_ipu1_clocks(); |
| 239 | ret = rproc_dev_init(0); |
| 240 | if (ret) { |
| 241 | debug("%s: IPU1 failed to initialize on rproc (%d)\n", |
| 242 | __func__, ret); |
| 243 | goto skip_ipu1; |
| 244 | } |
| 245 | |
| 246 | ret = rproc_load(0, IPU1_LOAD_ADDR, 0x2000000); |
| 247 | if (ret) { |
| 248 | debug("%s: IPU1 failed to load on rproc (%d)\n", __func__, |
| 249 | ret); |
| 250 | goto skip_ipu1; |
| 251 | } |
| 252 | |
| 253 | debug("Starting IPU1...\n"); |
| 254 | |
| 255 | ret = rproc_start(0); |
| 256 | if (ret) |
| 257 | debug("%s: IPU1 failed to start (%d)\n", __func__, ret); |
| 258 | |
| 259 | skip_ipu1: |
| 260 | loadaddr = IPU2_LOAD_ADDR; |
| 261 | size = load_firmware("dra7-ipu2-fw.xem4", &loadaddr); |
| 262 | if (size <= 0) { |
| 263 | pr_err("Firmware loading failed for ipu2\n"); |
| 264 | return; |
| 265 | } |
| 266 | |
| 267 | enable_ipu2_clocks(); |
| 268 | ret = rproc_dev_init(1); |
| 269 | if (ret) { |
| 270 | debug("%s: IPU2 failed to initialize on rproc (%d)\n", __func__, |
| 271 | ret); |
| 272 | return; |
| 273 | } |
| 274 | |
| 275 | ret = rproc_load(1, IPU2_LOAD_ADDR, 0x2000000); |
| 276 | if (ret) { |
| 277 | debug("%s: IPU2 failed to load on rproc (%d)\n", __func__, |
| 278 | ret); |
| 279 | return; |
| 280 | } |
| 281 | |
| 282 | debug("Starting IPU2...\n"); |
| 283 | |
| 284 | ret = rproc_start(1); |
| 285 | if (ret) |
| 286 | debug("%s: IPU2 failed to start (%d)\n", __func__, ret); |
| 287 | } |
| 288 | |
Tom Rini | 9e0c260 | 2012-08-14 12:26:08 -0700 | [diff] [blame] | 289 | void spl_board_init(void) |
| 290 | { |
Tom Rini | c95d6c4 | 2014-12-19 16:53:24 -0500 | [diff] [blame] | 291 | /* Prepare console output */ |
| 292 | preloader_console_init(); |
Samuel Holland | b03e666 | 2020-05-07 18:08:10 -0500 | [diff] [blame] | 293 | |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 294 | #if defined(CONFIG_SPL_NAND_SUPPORT) || defined(CONFIG_SPL_ONENAND_SUPPORT) |
Tom Rini | 9e0c260 | 2012-08-14 12:26:08 -0700 | [diff] [blame] | 295 | gpmc_init(); |
| 296 | #endif |
Simon Glass | bccfc2e | 2021-07-10 21:14:36 -0600 | [diff] [blame] | 297 | #if defined(CONFIG_SPL_I2C) && !CONFIG_IS_ENABLED(DM_I2C) |
Tom Rini | a7a9bc0 | 2021-08-18 23:12:29 -0400 | [diff] [blame] | 298 | i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 299 | #endif |
Simon Glass | 762b997 | 2021-07-10 21:14:27 -0600 | [diff] [blame] | 300 | #if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW) |
Ilya Yanok | 87b82cc | 2013-02-05 11:36:25 +0000 | [diff] [blame] | 301 | arch_misc_init(); |
| 302 | #endif |
Suniel Mahesh | 370d491 | 2019-07-31 21:54:07 +0530 | [diff] [blame] | 303 | #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
Tom Rini | 303bfe8 | 2013-10-01 12:32:04 -0400 | [diff] [blame] | 304 | hw_watchdog_init(); |
| 305 | #endif |
Tom Rini | ac8fdf9 | 2013-08-30 16:28:44 -0400 | [diff] [blame] | 306 | #ifdef CONFIG_AM33XX |
| 307 | am33xx_spl_board_init(); |
| 308 | #endif |
Keerthy | 0efb06d | 2022-01-27 13:16:52 +0100 | [diff] [blame] | 309 | if (IS_ENABLED(CONFIG_SPL_BUILD) && |
| 310 | IS_ENABLED(CONFIG_REMOTEPROC_TI_IPU)) |
| 311 | spl_boot_ipu(); |
Tom Rini | 9e0c260 | 2012-08-14 12:26:08 -0700 | [diff] [blame] | 312 | } |
| 313 | |
SRICHARAN R | 3f30b0a | 2013-04-24 00:41:24 +0000 | [diff] [blame] | 314 | void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) |
| 315 | { |
| 316 | typedef void __noreturn (*image_entry_noargs_t)(u32 *); |
| 317 | image_entry_noargs_t image_entry = |
| 318 | (image_entry_noargs_t) spl_image->entry_point; |
| 319 | |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 320 | u32 boot_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS); |
| 321 | |
Andre Przywara | 6c52607 | 2017-01-02 11:48:31 +0000 | [diff] [blame] | 322 | debug("image entry point: 0x%lX\n", spl_image->entry_point); |
SRICHARAN R | 3f30b0a | 2013-04-24 00:41:24 +0000 | [diff] [blame] | 323 | /* Pass the saved boot_params from rom code */ |
Paul Kocialkowski | d5b7624 | 2015-07-15 16:02:19 +0200 | [diff] [blame] | 324 | image_entry((u32 *)boot_params); |
SRICHARAN R | 3f30b0a | 2013-04-24 00:41:24 +0000 | [diff] [blame] | 325 | } |
Chandan Nath | 77a73fe | 2012-01-09 20:38:59 +0000 | [diff] [blame] | 326 | #endif |
Dmitry Lifshitz | 29211a0 | 2014-12-15 16:02:58 +0200 | [diff] [blame] | 327 | |
| 328 | #ifdef CONFIG_SCSI_AHCI_PLAT |
| 329 | void arch_preboot_os(void) |
| 330 | { |
Scott Wood | 16519a3 | 2015-04-17 09:19:01 -0500 | [diff] [blame] | 331 | ahci_reset((void __iomem *)DWC_AHSATA_BASE); |
Dmitry Lifshitz | 29211a0 | 2014-12-15 16:02:58 +0200 | [diff] [blame] | 332 | } |
| 333 | #endif |