aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/image.c5
-rw-r--r--common/iotrace.c6
-rw-r--r--common/spl/Kconfig23
-rw-r--r--common/spl/spl.c18
-rw-r--r--common/spl/spl_mmc.c44
-rw-r--r--common/spl/spl_ymodem.c9
6 files changed, 76 insertions, 29 deletions
diff --git a/common/image.c b/common/image.c
index 62ba6b3bfe9..f17fa40c495 100644
--- a/common/image.c
+++ b/common/image.c
@@ -583,7 +583,7 @@ ulong env_get_bootm_low(void)
#if defined(CONFIG_SYS_SDRAM_BASE)
return CONFIG_SYS_SDRAM_BASE;
-#elif defined(CONFIG_ARM)
+#elif defined(CONFIG_ARM) || defined(CONFIG_MICROBLAZE)
return gd->bd->bi_dram[0].start;
#else
return 0;
@@ -600,7 +600,8 @@ phys_size_t env_get_bootm_size(void)
return tmp;
}
-#if defined(CONFIG_ARM) && defined(CONFIG_NR_DRAM_BANKS)
+#if (defined(CONFIG_ARM) || defined(CONFIG_MICROBLAZE)) && \
+ defined(CONFIG_NR_DRAM_BANKS)
start = gd->bd->bi_dram[0].start;
size = gd->bd->bi_dram[0].size;
#else
diff --git a/common/iotrace.c b/common/iotrace.c
index 49bee3c92a0..5b92fabc76e 100644
--- a/common/iotrace.c
+++ b/common/iotrace.c
@@ -86,7 +86,7 @@ u32 iotrace_readl(const void *ptr)
return v;
}
-void iotrace_writel(ulong value, const void *ptr)
+void iotrace_writel(ulong value, void *ptr)
{
add_record(IOT_32 | IOT_WRITE, ptr, value);
writel(value, ptr);
@@ -102,7 +102,7 @@ u16 iotrace_readw(const void *ptr)
return v;
}
-void iotrace_writew(ulong value, const void *ptr)
+void iotrace_writew(ulong value, void *ptr)
{
add_record(IOT_16 | IOT_WRITE, ptr, value);
writew(value, ptr);
@@ -118,7 +118,7 @@ u8 iotrace_readb(const void *ptr)
return v;
}
-void iotrace_writeb(ulong value, const void *ptr)
+void iotrace_writeb(ulong value, void *ptr)
{
add_record(IOT_8 | IOT_WRITE, ptr, value);
writeb(value, ptr);
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 57d06ccece5..562eafe2e5b 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -25,6 +25,15 @@ config SPL_FRAMEWORK
supports MMC, NAND and YMODEM and other methods loading of U-Boot
and the Linux Kernel. If unsure, say Y.
+config SPL_FRAMEWORK_BOARD_INIT_F
+ bool "Define a generic function board_init_f"
+ depends on SPL_FRAMEWORK
+ help
+ Define a generic function board_init_f that:
+ - initialize the spl (spl_early_init)
+ - initialize the serial (preloader_console_init)
+ Unless you want to provide your own board_init_f, you should say Y.
+
config SPL_SIZE_LIMIT
hex "Maximum size of SPL image"
depends on SPL
@@ -139,6 +148,7 @@ config SPL_TEXT_BASE
default 0x10060 if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN9I
default 0x20060 if MACH_SUN50I_H6
default 0x00060 if ARCH_SUNXI
+ default 0xfffc0000 if ARCH_ZYNQMP
default 0x0
help
The address in memory that SPL will be running from.
@@ -315,6 +325,12 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
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 SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
+ int "Number of the eMMC boot partition to use"
+ default 1
+ help
+ eMMC boot partition number to use when the eMMC in raw mode.
+
config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
bool "MMC Raw mode: by partition"
help
@@ -681,6 +697,13 @@ config SPL_UBI
Enable support for loading payloads from UBI. See
README.ubispl for more info.
+if SPL_DM
+config SPL_DM_SPI
+ bool "Support SPI DM drivers in SPL"
+ help
+ Enable support for SPI DM drivers in SPL.
+
+endif
if SPL_UBI
config SPL_UBI_LOAD_BY_VOLNAME
bool "Support loading volumes by name"
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 5fdd6d0d032..a9d3e847af5 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -555,6 +555,24 @@ static int boot_from_devices(struct spl_image_info *spl_image,
return -ENODEV;
}
+#if defined(CONFIG_SPL_FRAMEWORK_BOARD_INIT_F)
+void board_init_f(ulong dummy)
+{
+ if (CONFIG_IS_ENABLED(OF_CONTROL)) {
+ int ret;
+
+ ret = spl_early_init();
+ if (ret) {
+ debug("spl_early_init() failed: %d\n", ret);
+ hang();
+ }
+ }
+
+ if (CONFIG_IS_ENABLED(SERIAL_SUPPORT))
+ preloader_console_init();
+}
+#endif
+
void board_init_r(gd_t *dummy1, ulong dummy2)
{
u32 spl_boot_list[] = {
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index ea07687fd8d..34e1e73d80d 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -349,28 +349,32 @@ int spl_mmc_load(struct spl_image_info *spl_image,
err = -EINVAL;
switch (boot_mode) {
case MMCSD_MODE_EMMCBOOT:
- /*
- * We need to check what the partition is configured to.
- * 1 and 2 match up to boot0 / boot1 and 7 is user data
- * which is the first physical partition (0).
- */
- part = (mmc->part_config >> 3) & PART_ACCESS_MASK;
-
- if (part == 7)
- part = 0;
-
- if (CONFIG_IS_ENABLED(MMC_TINY))
- err = mmc_switch_part(mmc, part);
- else
- err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
-
- if (err) {
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
+ part = CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION;
+#else
+ /*
+ * We need to check what the partition is configured to.
+ * 1 and 2 match up to boot0 / boot1 and 7 is user data
+ * which is the first physical partition (0).
+ */
+ part = (mmc->part_config >> 3) & PART_ACCESS_MASK;
+
+ if (part == 7)
+ part = 0;
+#endif
+
+ if (CONFIG_IS_ENABLED(MMC_TINY))
+ err = mmc_switch_part(mmc, part);
+ else
+ err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
+
+ if (err) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
- puts("spl: mmc partition switch failed\n");
+ puts("spl: mmc partition switch failed\n");
#endif
- return err;
- }
- /* Fall through */
+ return err;
+ }
+ /* Fall through */
case MMCSD_MODE_RAW:
debug("spl: mmc boot mode: raw\n");
diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c
index 20f42600625..c02c05624d4 100644
--- a/common/spl/spl_ymodem.c
+++ b/common/spl/spl_ymodem.c
@@ -44,7 +44,8 @@ static ulong ymodem_read_fit(struct spl_load_info *load, ulong offset,
while (info->image_read < offset) {
res = xyzModem_stream_read(buf, BUF_SIZE, &err);
if (res <= 0)
- return res;
+ break;
+
info->image_read += res;
}
@@ -57,7 +58,7 @@ static ulong ymodem_read_fit(struct spl_load_info *load, ulong offset,
while (info->image_read < offset + size) {
res = xyzModem_stream_read(buf, BUF_SIZE, &err);
if (res <= 0)
- return res;
+ break;
memcpy(addr, buf, res);
info->image_read += res;
@@ -67,8 +68,8 @@ static ulong ymodem_read_fit(struct spl_load_info *load, ulong offset,
return size;
}
-static int spl_ymodem_load_image(struct spl_image_info *spl_image,
- struct spl_boot_device *bootdev)
+int spl_ymodem_load_image(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
{
ulong size = 0;
int err;