summaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/Kconfig84
-rw-r--r--common/spl/spl.c2
-rw-r--r--common/spl/spl_ext.c8
-rw-r--r--common/spl/spl_mmc.c4
-rw-r--r--common/spl/spl_spi.c3
-rw-r--r--common/spl/spl_ymodem.c1
6 files changed, 83 insertions, 19 deletions
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index bb99f1f..cba51f5 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -70,6 +70,33 @@ config SPL_DISPLAY_PRINT
banner ("U-Boot SPL ..."). This function should be provided by
the board.
+config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
+ bool "MMC raw mode: by sector"
+ depends on SPL
+ default y if ARCH_SUNXI || ARCH_DAVINCI || ARCH_UNIPHIER ||ARCH_MX6 || \
+ ARCH_ROCKCHIP || ARCH_MVEBU || ARCH_SOCFPGA || \
+ ARCH_AT91 || ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \
+ OMAP44XX || OMAP54XX || AM33XX || AM43XX
+ help
+ Use sector number for specifying U-Boot location on MMC/SD in
+ raw mode.
+
+config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
+ hex "Address on the MMC to load U-Boot from"
+ depends on SPL && SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
+ default 0x50 if ARCH_SUNXI
+ default 0x75 if ARCH_DAVINCI
+ default 0x80 if ARCH_UNIPHIER
+ default 0x8a if ARCH_MX6
+ default 0x100 if ARCH_ROCKCHIP
+ default 0x140 if ARCH_MVEBU
+ default 0x200 if ARCH_SOCFPGA || ARCH_AT91
+ default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \
+ OMAP54XX || AM33XX || AM43XX
+ help
+ Address on the MMC to load U-Boot from, when the MMC is being used
+ in raw mode. Units: MMC sectors (1 sector = 512 bytes).
+
config TPL
bool
depends on SPL && SUPPORT_TPL
@@ -465,17 +492,6 @@ config SPL_SPI_SUPPORT
enable SPI drivers that are needed for other purposes also, such
as a SPI PMIC.
-config SPL_USBETH_SUPPORT
- bool "Support USB Ethernet drivers"
- depends on SPL
- help
- Enable access to the USB network subsystem and associated
- drivers in SPL. This permits SPL to load U-Boot over a
- USB-connected Ethernet link (such as a USB Ethernet dongle) rather
- than from an onboard peripheral. Environment support is required
- since the network stack uses a number of environment variables.
- See also SPL_NET_SUPPORT and SPL_ETH_SUPPORT.
-
config SPL_USB_HOST_SUPPORT
bool "Support USB host drivers"
depends on SPL
@@ -497,6 +513,52 @@ config SPL_USB_SUPPORT
config options. This enables loading from USB using a configured
device.
+config SPL_USB_GADGET_SUPPORT
+ bool "Suppport USB Gadget drivers"
+ depends on SPL
+ help
+ Enable USB Gadget API which allows to enable USB device functions
+ in SPL.
+
+if SPL_USB_GADGET_SUPPORT
+
+config SPL_USBETH_SUPPORT
+ bool "Support USB Ethernet drivers"
+ help
+ Enable access to the USB network subsystem and associated
+ drivers in SPL. This permits SPL to load U-Boot over a
+ USB-connected Ethernet link (such as a USB Ethernet dongle) rather
+ than from an onboard peripheral. Environment support is required
+ since the network stack uses a number of environment variables.
+ See also SPL_NET_SUPPORT and SPL_ETH_SUPPORT.
+
+config SPL_DFU_SUPPORT
+ bool "Support DFU (Device Firmware Upgarde)"
+ select SPL_HASH_SUPPORT
+ help
+ This feature enables the DFU (Device Firmware Upgarde) in SPL with
+ RAM memory device support. The ROM code will load and execute
+ the SPL built with dfu. The user can load binaries (u-boot/kernel) to
+ selected device partition from host-pc using dfu-utils.
+ This feature is useful to flash the binaries to factory or bare-metal
+ boards using USB interface.
+
+choice
+ bool "DFU device selection"
+ depends on SPL_DFU_SUPPORT
+
+config SPL_DFU_RAM
+ bool "RAM device"
+ depends on SPL_DFU_SUPPORT
+ help
+ select RAM/DDR memory device for loading binary images
+ (u-boot/kernel) to the selected device partition using
+ DFU and execute the u-boot/kernel from RAM.
+
+endchoice
+
+endif
+
config SPL_WATCHDOG_SUPPORT
bool "Support watchdog drivers"
depends on SPL
diff --git a/common/spl/spl.c b/common/spl/spl.c
index bdb165a..32b9f1e 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -220,7 +220,9 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
return 0;
}
+#if defined(CONFIG_SPL_RAM_DEVICE)
SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_RAM, spl_ram_load_image);
+#endif
#if defined(CONFIG_SPL_DFU_SUPPORT)
SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_DFU, spl_ram_load_image);
#endif
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index b93e1ea..1b8e15e 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -42,7 +42,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
puts("spl: ext4fs_open failed\n");
goto end;
}
- err = ext4fs_read((char *)header, sizeof(struct image_header), &actlen);
+ err = ext4fs_read((char *)header, 0, sizeof(struct image_header), &actlen);
if (err < 0) {
puts("spl: ext4fs_read failed\n");
goto end;
@@ -54,7 +54,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
goto end;
}
- err = ext4fs_read((char *)spl_image->load_addr, filelen, &actlen);
+ err = ext4fs_read((char *)spl_image->load_addr, 0, filelen, &actlen);
end:
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
@@ -97,7 +97,7 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image,
puts("spl: ext4fs_open failed\n");
goto defaults;
}
- err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
+ err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, 0, filelen, &actlen);
if (err < 0) {
printf("spl: error reading image %s, err - %d, falling back to default\n",
file, err);
@@ -127,7 +127,7 @@ defaults:
if (err < 0)
puts("spl: ext4fs_open failed\n");
- err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
+ err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, 0, filelen, &actlen);
if (err < 0) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: error reading image %s, err - %d\n",
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index c674e61..0b681c2 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -165,7 +165,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
return -1;
}
-#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
return mmc_load_image_raw_sector(spl_image, mmc,
info.start + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
#else
@@ -327,7 +327,7 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);
if (!err)
return err;
-#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR)
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
err = mmc_load_image_raw_sector(spl_image, mmc,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
if (!err)
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index a3caafb..78b8cd1 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -99,7 +99,8 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
if (err)
return err;
- if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
+ if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
+ image_get_magic(header) == FDT_MAGIC) {
struct spl_load_info load;
debug("Found FIT\n");
diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c
index 13e8e51..957894d 100644
--- a/common/spl/spl_ymodem.c
+++ b/common/spl/spl_ymodem.c
@@ -109,7 +109,6 @@ static int spl_ymodem_load_image(struct spl_image_info *spl_image,
while ((res = xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0)
size += res;
} else {
- spl_parse_image_header(spl_image, (struct image_header *)buf);
ret = spl_parse_image_header(spl_image,
(struct image_header *)buf);
if (ret)