aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini2019-10-12 10:10:59 -0400
committerTom Rini2019-10-12 10:10:59 -0400
commit0c9cc5155cb5027ae17ace986f349e2f0d1fb9a3 (patch)
tree49c59081ca15147dcc311880648732a5d4fc019a /common
parent36317705cb5ab43db25fede2446d2352de527630 (diff)
parent7d2dc6af540fad77bff2a3ff16cdc2f9d9df72eb (diff)
Merge branch '2019-10-11-master-imports'
- Assorted cleanups - FAT bugfixes - mediatek platform updates
Diffstat (limited to 'common')
-rw-r--r--common/spl/Kconfig22
-rw-r--r--common/spl/spl.c18
-rw-r--r--common/spl/spl_mmc.c44
3 files changed, 64 insertions, 20 deletions
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 92de9cd7443..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
@@ -316,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
@@ -682,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 ebc566081ad..c5cae970991 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -355,28 +355,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");