int spl_net_load_image_usb(struct spl_image_info *spl_image, struct spl_boot_device *bootdev) { bootdev->boot_device_name = "usb_ether"; return spl_net_load_image(spl_image, bootdev); }
int spl_net_load_image_cpgmac(struct spl_image_info *spl_image, struct spl_boot_device *bootdev) { #ifdef CONFIG_SPL_ETH_DEVICE bootdev->boot_device_name = CONFIG_SPL_ETH_DEVICE; #endif return spl_net_load_image(spl_image, bootdev); }
void board_init_r(gd_t *dummy1, ulong dummy2) { u32 boot_device; debug(">>spl:board_init_r()\n"); #ifdef CONFIG_SYS_SPL_MALLOC_START mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE); #endif #ifndef CONFIG_PPC /* * timer_init() does not exist on PPC systems. The timer is initialized * and enabled (decrementer) in interrupt_init() here. */ timer_init(); #endif #ifdef CONFIG_SPL_BOARD_INIT spl_board_init(); #endif boot_device = spl_boot_device(); debug("boot device - %d\n", boot_device); switch (boot_device) { #ifdef CONFIG_SPL_RAM_DEVICE case BOOT_DEVICE_RAM: spl_ram_load_image(); break; #endif #ifdef CONFIG_SPL_MMC_SUPPORT case BOOT_DEVICE_MMC1: case BOOT_DEVICE_MMC2: case BOOT_DEVICE_MMC2_2: spl_mmc_load_image(); break; #endif #ifdef CONFIG_SPL_NAND_SUPPORT case BOOT_DEVICE_NAND: spl_nand_load_image(); break; #endif #ifdef CONFIG_SPL_ONENAND_SUPPORT case BOOT_DEVICE_ONENAND: spl_onenand_load_image(); break; #endif #ifdef CONFIG_SPL_NOR_SUPPORT case BOOT_DEVICE_NOR: spl_nor_load_image(); break; #endif #ifdef CONFIG_SPL_YMODEM_SUPPORT case BOOT_DEVICE_UART: spl_ymodem_load_image(); break; #endif #ifdef CONFIG_SPL_SPI_SUPPORT case BOOT_DEVICE_SPI: spl_spi_load_image(); break; #endif #ifdef CONFIG_SPL_ETH_SUPPORT case BOOT_DEVICE_CPGMAC: #ifdef CONFIG_SPL_ETH_DEVICE spl_net_load_image(CONFIG_SPL_ETH_DEVICE); #else spl_net_load_image(NULL); #endif break; #endif #ifdef CONFIG_SPL_USBETH_SUPPORT case BOOT_DEVICE_USBETH: spl_net_load_image("usb_ether"); break; #endif #ifdef CONFIG_SPL_USB_SUPPORT case BOOT_DEVICE_USB: spl_usb_load_image(); break; #endif #ifdef CONFIG_SPL_SATA_SUPPORT case BOOT_DEVICE_SATA: spl_sata_load_image(); break; #endif default: debug("SPL: Un-supported Boot Device\n"); hang(); } switch (spl_image.os) { case IH_OS_U_BOOT: debug("Jumping to U-Boot\n"); break; #ifdef CONFIG_SPL_OS_BOOT case IH_OS_LINUX: debug("Jumping to Linux\n"); spl_board_prepare_for_linux(); jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR); #endif default: debug("Unsupported OS image.. Jumping nevertheless..\n"); } jump_to_image_no_args(&spl_image); }
static int spl_load_image(u32 boot_device) { switch (boot_device) { #ifdef CONFIG_SPL_RAM_DEVICE case BOOT_DEVICE_RAM: return spl_ram_load_image(); #endif #ifdef CONFIG_SPL_MMC_SUPPORT case BOOT_DEVICE_MMC1: case BOOT_DEVICE_MMC2: case BOOT_DEVICE_MMC2_2: return spl_mmc_load_image(boot_device); #endif #ifdef CONFIG_SPL_NAND_SUPPORT case BOOT_DEVICE_NAND: return spl_nand_load_image(); #endif #ifdef CONFIG_SPL_ONENAND_SUPPORT case BOOT_DEVICE_ONENAND: return spl_onenand_load_image(); #endif #ifdef CONFIG_SPL_NOR_SUPPORT case BOOT_DEVICE_NOR: return spl_nor_load_image(); #endif #ifdef CONFIG_SPL_YMODEM_SUPPORT case BOOT_DEVICE_UART: return spl_ymodem_load_image(); #endif #ifdef CONFIG_SPL_SPI_SUPPORT case BOOT_DEVICE_SPI: return spl_spi_load_image(); #endif #ifdef CONFIG_SPL_ETH_SUPPORT case BOOT_DEVICE_CPGMAC: #ifdef CONFIG_SPL_ETH_DEVICE return spl_net_load_image(CONFIG_SPL_ETH_DEVICE); #else return spl_net_load_image(NULL); #endif #endif #ifdef CONFIG_SPL_USBETH_SUPPORT case BOOT_DEVICE_USBETH: return spl_net_load_image("usb_ether"); #endif #ifdef CONFIG_SPL_USB_SUPPORT case BOOT_DEVICE_USB: return spl_usb_load_image(); #endif #ifdef CONFIG_SPL_DFU_SUPPORT case BOOT_DEVICE_DFU: spl_dfu_cmd(0, "dfu_alt_info_ram", "ram", "0"); return spl_ram_load_image(); #endif #ifdef CONFIG_SPL_SATA_SUPPORT case BOOT_DEVICE_SATA: return spl_sata_load_image(); #endif #ifdef CONFIG_SPL_BOARD_LOAD_IMAGE case BOOT_DEVICE_BOARD: return spl_board_load_image(); #endif default: #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT) puts("SPL: Unsupported Boot Device!\n"); #endif return -ENODEV; } return -EINVAL; }
void board_init_r(gd_t *dummy1, ulong dummy2) { u32 boot_device; debug(">>spl:board_init_r()\n"); #if defined(CONFIG_SYS_SPL_MALLOC_START) mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE); gd->flags |= GD_FLG_FULL_MALLOC_INIT; #endif if (!(gd->flags & GD_FLG_SPL_INIT)) { if (spl_init()) hang(); } #ifndef CONFIG_PPC /* * timer_init() does not exist on PPC systems. The timer is initialized * and enabled (decrementer) in interrupt_init() here. */ timer_init(); #endif #ifdef CONFIG_SPL_BOARD_INIT spl_board_init(); #endif boot_device = spl_boot_device(); debug("boot device - %d\n", boot_device); switch (boot_device) { #ifdef CONFIG_SPL_RAM_DEVICE case BOOT_DEVICE_RAM: spl_ram_load_image(); break; #endif #ifdef CONFIG_SPL_MMC_SUPPORT case BOOT_DEVICE_MMC1: case BOOT_DEVICE_MMC2: case BOOT_DEVICE_MMC2_2: spl_mmc_load_image(); break; #endif #ifdef CONFIG_SPL_NAND_SUPPORT case BOOT_DEVICE_NAND: spl_nand_load_image(); break; #endif #ifdef CONFIG_SPL_ONENAND_SUPPORT case BOOT_DEVICE_ONENAND: spl_onenand_load_image(); break; #endif #ifdef CONFIG_SPL_NOR_SUPPORT case BOOT_DEVICE_NOR: spl_nor_load_image(); break; #endif #ifdef CONFIG_SPL_YMODEM_SUPPORT case BOOT_DEVICE_UART: spl_ymodem_load_image(); break; #endif #ifdef CONFIG_SPL_SPI_SUPPORT case BOOT_DEVICE_SPI: spl_spi_load_image(); break; #endif #ifdef CONFIG_SPL_ETH_SUPPORT case BOOT_DEVICE_CPGMAC: #ifdef CONFIG_SPL_ETH_DEVICE spl_net_load_image(CONFIG_SPL_ETH_DEVICE); #else spl_net_load_image(NULL); #endif break; #endif #ifdef CONFIG_SPL_USBETH_SUPPORT case BOOT_DEVICE_USBETH: spl_net_load_image("usb_ether"); break; #endif #ifdef CONFIG_SPL_USB_SUPPORT case BOOT_DEVICE_USB: spl_usb_load_image(); break; #endif #ifdef CONFIG_SPL_SATA_SUPPORT case BOOT_DEVICE_SATA: spl_sata_load_image(); break; #endif #ifdef CONFIG_SPL_BOARD_LOAD_IMAGE case BOOT_DEVICE_BOARD: spl_board_load_image(); break; #endif default: #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT) puts("SPL: Unsupported Boot Device!\n"); #endif hang(); } switch (spl_image.os) { case IH_OS_U_BOOT: debug("Jumping to U-Boot\n"); break; #ifdef CONFIG_SPL_OS_BOOT case IH_OS_LINUX: debug("Jumping to Linux\n"); spl_board_prepare_for_linux(); jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR); #endif default: debug("Unsupported OS image.. Jumping nevertheless..\n"); } #if defined(CONFIG_SYS_MALLOC_F_LEN) && !defined(CONFIG_SYS_SPL_MALLOC_SIZE) debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr, gd->malloc_ptr / 1024); #endif debug("loaded - jumping to U-Boot..."); jump_to_image_no_args(&spl_image); }
void board_init_r(gd_t *dummy1, ulong dummy2) { u32 boot_device; debug(">>spl:board_init_r()\n"); #ifdef CONFIG_SYS_SPL_MALLOC_START mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE); #endif #ifndef CONFIG_PPC /* * timer_init() does not exist on PPC systems. The timer is initialized * and enabled (decrementer) in interrupt_init() here. */ timer_init(); #endif #ifdef CONFIG_SPL_BOARD_INIT spl_board_init(); #endif boot_device = spl_boot_device(); debug("boot device - %d\n", boot_device); switch (boot_device) { #ifdef CONFIG_SPL_RAM_DEVICE case BOOT_DEVICE_RAM: spl_ram_load_image(); break; #endif #ifdef CONFIG_SPL_MMC_SUPPORT case BOOT_DEVICE_MMC1: case BOOT_DEVICE_MMC2: case BOOT_DEVICE_MMC2_2: spl_mmc_load_image(); break; #endif #ifdef CONFIG_SPL_NAND_SUPPORT case BOOT_DEVICE_NAND: spl_nand_load_image(); break; #endif #ifdef CONFIG_SPL_NOR_SUPPORT case BOOT_DEVICE_NOR: spl_nor_load_image(); break; #endif #ifdef CONFIG_SPL_YMODEM_SUPPORT case BOOT_DEVICE_UART: spl_ymodem_load_image(); break; #endif #ifdef CONFIG_SPL_SPI_SUPPORT case BOOT_DEVICE_SPI: spl_spi_load_image(); break; #endif #ifdef CONFIG_SPL_ETH_SUPPORT case BOOT_DEVICE_CPGMAC: #ifdef CONFIG_SPL_ETH_DEVICE spl_net_load_image(CONFIG_SPL_ETH_DEVICE); #else spl_net_load_image(NULL); #endif break; #endif default: debug("SPL: Un-supported Boot Device\n"); hang(); } #ifdef CONFIG_SPL_SBOOT_SUPPORT #if !defined(CONFIG_SPL_MMC_SD_FAT_BOOT_DEVICE) || CONFIG_SPL_MMC_SD_FAT_BOOT_DEVICE == 0 #warning "CONFIG_SPL_MMC_SD_FAT_BOOT_DEVICE may not be configured or may \ configured as the same device as the SPL image. If implementing a trusted \ or secured boot (with SBOOT) your SRTM (SPL) should be read from write \ protected storage." #endif sboot_srtm_init(); spl_sboot_extend(); /* Assumes IH_OS_U_BOOT */ spl_sboot_check(); #endif switch (spl_image.os) { case IH_OS_U_BOOT: debug("Jumping to U-Boot\n"); break; #ifdef CONFIG_SPL_OS_BOOT case IH_OS_LINUX: debug("Jumping to Linux\n"); spl_board_prepare_for_linux(); jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR); #endif default: debug("Unsupported OS image.. Jumping nevertheless..\n"); } jump_to_image_no_args(&spl_image); }
void board_init_r(gd_t *dummy1, ulong dummy2) { u32 boot_device; debug(">>spl:board_init_r()\n"); #ifdef CONFIG_SYS_SPL_MALLOC_START mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE); #endif timer_init(); #ifdef CONFIG_SPL_BOARD_INIT spl_board_init(); #endif boot_device = spl_boot_device(); debug("boot device - %d\n", boot_device); switch (boot_device) { #ifdef CONFIG_SPL_RAM_DEVICE case BOOT_DEVICE_RAM: spl_ram_load_image(); break; #endif #ifdef CONFIG_SPL_MMC_SUPPORT case BOOT_DEVICE_MMC1: case BOOT_DEVICE_MMC2: case BOOT_DEVICE_MMC2_2: spl_mmc_load_image(); break; #endif #ifdef CONFIG_SPL_NAND_SUPPORT case BOOT_DEVICE_NAND: spl_nand_load_image(); break; #endif #ifdef CONFIG_SPL_NOR_SUPPORT case BOOT_DEVICE_NOR: spl_nor_load_image(); break; #endif #ifdef CONFIG_SPL_YMODEM_SUPPORT case BOOT_DEVICE_UART: spl_ymodem_load_image(); break; #endif #ifdef CONFIG_SPL_SPI_SUPPORT case BOOT_DEVICE_SPI: spl_spi_load_image(); break; #endif #ifdef CONFIG_SPL_ETH_SUPPORT case BOOT_DEVICE_CPGMAC: #ifdef CONFIG_SPL_ETH_DEVICE spl_net_load_image(CONFIG_SPL_ETH_DEVICE); #else spl_net_load_image(NULL); #endif break; #endif default: debug("SPL: Un-supported Boot Device\n"); hang(); } switch (spl_image.os) { case IH_OS_U_BOOT: debug("Jumping to U-Boot\n"); break; #ifdef CONFIG_SPL_OS_BOOT case IH_OS_LINUX: debug("Jumping to Linux\n"); spl_board_prepare_for_linux(); jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR); #endif default: debug("Unsupported OS image.. Jumping nevertheless..\n"); } jump_to_image_no_args(&spl_image); }