* [U-Boot] [PATCH 1/5] Rename some defines containing FAT in their name to be filesystem generic MMCSD_MODE_FAT => MMCSD_MODE_FS CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION => CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
2014-09-19 8:47 [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL Guillaume GARDET
@ 2014-09-19 8:47 ` Guillaume GARDET
2014-09-19 8:47 ` [U-Boot] [PATCH 2/5] spl: Add EXT support to SPL Guillaume GARDET
` (4 subsequent siblings)
5 siblings, 0 replies; 21+ messages in thread
From: Guillaume GARDET @ 2014-09-19 8:47 UTC (permalink / raw)
To: u-boot
Rename some defines containing FAT in their name to be filesystem generic:
MMCSD_MODE_FAT => MMCSD_MODE_FS
CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME
CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION => CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Andreas Bie?mann <andreas.devel@googlemail.com>
---
arch/arm/cpu/arm1136/mx35/generic.c | 2 +-
arch/arm/cpu/armv7/omap-common/boot-common.c | 4 ++--
arch/arm/cpu/armv7/omap3/board.c | 2 +-
arch/arm/cpu/armv7/zynq/spl.c | 2 +-
arch/arm/cpu/at91-common/spl.c | 2 +-
arch/arm/imx-common/spl.c | 2 +-
common/spl/spl_fat.c | 6 +++---
common/spl/spl_mmc.c | 8 ++++----
common/spl/spl_sata.c | 2 +-
common/spl/spl_usb.c | 2 +-
include/configs/am3517_crane.h | 4 ++--
include/configs/am3517_evm.h | 4 ++--
include/configs/cm_t35.h | 4 ++--
include/configs/devkit8000.h | 8 ++++----
include/configs/imx6_spl.h | 4 ++--
include/configs/mcx.h | 4 ++--
include/configs/omap3_evm.h | 4 ++--
include/configs/omap3_evm_quick_mmc.h | 4 ++--
include/configs/sama5d3_xplained.h | 4 ++--
include/configs/sama5d3xek.h | 4 ++--
include/configs/siemens-am33x-common.h | 4 ++--
include/configs/tao3530.h | 4 ++--
include/configs/ti814x_evm.h | 4 ++--
include/configs/ti816x_evm.h | 4 ++--
include/configs/ti_armv7_common.h | 8 ++++----
include/configs/tricorder.h | 4 ++--
include/configs/zynq-common.h | 10 +++++-----
include/spl.h | 2 +-
28 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/arch/arm/cpu/arm1136/mx35/generic.c b/arch/arm/cpu/arm1136/mx35/generic.c
index 8d3f92c..bc98edd 100644
--- a/arch/arm/cpu/arm1136/mx35/generic.c
+++ b/arch/arm/cpu/arm1136/mx35/generic.c
@@ -531,7 +531,7 @@ u32 spl_boot_mode(void)
switch (spl_boot_device()) {
case BOOT_DEVICE_MMC1:
#ifdef CONFIG_SPL_FAT_SUPPORT
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
#else
return MMCSD_MODE_RAW;
#endif
diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c b/arch/arm/cpu/armv7/omap-common/boot-common.c
index 3033564..fb535eb 100644
--- a/arch/arm/cpu/armv7/omap-common/boot-common.c
+++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
@@ -81,8 +81,8 @@ u32 spl_boot_mode(void)
if (val == MMCSD_MODE_RAW)
return MMCSD_MODE_RAW;
- else if (val == MMCSD_MODE_FAT)
- return MMCSD_MODE_FAT;
+ else if (val == MMCSD_MODE_FS)
+ return MMCSD_MODE_FS;
else
#ifdef CONFIG_SUPPORT_EMMC_BOOT
return MMCSD_MODE_EMMCBOOT;
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 667e77f..9bcca9d 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -65,7 +65,7 @@ u32 spl_boot_mode(void)
case BOOT_DEVICE_MMC2:
return MMCSD_MODE_RAW;
case BOOT_DEVICE_MMC1:
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
break;
default:
puts("spl: ERROR: unknown device - can't select boot mode\n");
diff --git a/arch/arm/cpu/armv7/zynq/spl.c b/arch/arm/cpu/armv7/zynq/spl.c
index 9ff2ef2..31627f9 100644
--- a/arch/arm/cpu/armv7/zynq/spl.c
+++ b/arch/arm/cpu/armv7/zynq/spl.c
@@ -63,7 +63,7 @@ u32 spl_boot_device(void)
#ifdef CONFIG_SPL_MMC_SUPPORT
u32 spl_boot_mode(void)
{
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
}
#endif
diff --git a/arch/arm/cpu/at91-common/spl.c b/arch/arm/cpu/at91-common/spl.c
index cbb5a52..674a470 100644
--- a/arch/arm/cpu/at91-common/spl.c
+++ b/arch/arm/cpu/at91-common/spl.c
@@ -102,7 +102,7 @@ u32 spl_boot_mode(void)
switch (spl_boot_device()) {
#ifdef CONFIG_SYS_USE_MMC
case BOOT_DEVICE_MMC1:
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
break;
#endif
case BOOT_DEVICE_NONE:
diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
index 9a02a64..9d3c31a 100644
--- a/arch/arm/imx-common/spl.c
+++ b/arch/arm/imx-common/spl.c
@@ -68,7 +68,7 @@ u32 spl_boot_mode(void)
case BOOT_DEVICE_MMC1:
case BOOT_DEVICE_MMC2:
#ifdef CONFIG_SPL_FAT_SUPPORT
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
#else
return MMCSD_MODE_RAW;
#endif
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 56be943..91481fc 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -106,18 +106,18 @@ int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
defaults:
#endif
- err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME,
+ err = file_fat_read(CONFIG_SPL_FS_LOAD_ARGS_NAME,
(void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
if (err <= 0) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: error reading image %s, err - %d\n",
- __func__, CONFIG_SPL_FAT_LOAD_ARGS_NAME, err);
+ __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
#endif
return -1;
}
return spl_load_image_fat(block_dev, partition,
- CONFIG_SPL_FAT_LOAD_KERNEL_NAME);
+ CONFIG_SPL_FS_LOAD_KERNEL_NAME);
}
#endif
#endif
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index fa6f891..a631e0a 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -101,15 +101,15 @@ void spl_mmc_load_image(void)
err = mmc_load_image_raw(mmc,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
#ifdef CONFIG_SPL_FAT_SUPPORT
- } else if (boot_mode == MMCSD_MODE_FAT) {
+ } else if (boot_mode == MMCSD_MODE_FS) {
debug("boot mode - FAT\n");
#ifdef CONFIG_SPL_OS_BOOT
if (spl_start_uboot() || spl_load_image_fat_os(&mmc->block_dev,
- CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION))
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION))
#endif
err = spl_load_image_fat(&mmc->block_dev,
- CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION,
- CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION,
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
#endif
#ifdef CONFIG_SUPPORT_EMMC_BOOT
} else if (boot_mode == MMCSD_MODE_EMMCBOOT) {
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 2e7adca..6fd1b79 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -41,7 +41,7 @@ void spl_sata_load_image(void)
#endif
err = spl_load_image_fat(stor_dev,
CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
- CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
if (err) {
puts("Error loading sata device\n");
hang();
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index 53a9043..c81672b 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -49,7 +49,7 @@ void spl_usb_load_image(void)
#endif
err = spl_load_image_fat(stor_dev,
CONFIG_SYS_USB_FAT_BOOT_PARTITION,
- CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
if (err) {
puts("Error loading USB device\n");
diff --git a/include/configs/am3517_crane.h b/include/configs/am3517_crane.h
index fcb4033..0fbfa3f 100644
--- a/include/configs/am3517_crane.h
+++ b/include/configs/am3517_crane.h
@@ -304,8 +304,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_LIBCOMMON_SUPPORT
#define CONFIG_SPL_LIBDISK_SUPPORT
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index c5d64ca..8719f76 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -313,8 +313,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_LIBCOMMON_SUPPORT
#define CONFIG_SPL_LIBDISK_SUPPORT
diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index 6f4d97f..1919cde 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -321,8 +321,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_BOARD_INIT
#define CONFIG_SPL_LIBCOMMON_SUPPORT
diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index 7ab6d51..ca62461 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -298,8 +298,8 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SPL_TEXT_BASE 0x40200000 /*CONFIG_SYS_SRAM_START*/
@@ -341,8 +341,8 @@
0x400000)
#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
-#define CONFIG_SPL_FAT_LOAD_KERNEL_NAME "uImage"
-#define CONFIG_SPL_FAT_LOAD_ARGS_NAME "args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"
#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x500 /* address 0xa0000 */
#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x8 /* address 0x1000 */
diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h
index 970460d..308e520 100644
--- a/include/configs/imx6_spl.h
+++ b/include/configs/imx6_spl.h
@@ -46,7 +46,7 @@
#if defined(CONFIG_SPL_MMC_SUPPORT)
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 138 /* offset 69KB */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 800 /* 400 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
#define CONFIG_SYS_MONITOR_LEN (CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS/2*1024)
#endif
@@ -58,7 +58,7 @@
/* Define the payload for FAT/EXT support */
#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_LIBDISK_SUPPORT
#endif
diff --git a/include/configs/mcx.h b/include/configs/mcx.h
index cd85a6c..adaf44f 100644
--- a/include/configs/mcx.h
+++ b/include/configs/mcx.h
@@ -372,8 +372,8 @@
#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
/* NAND boot config */
#define CONFIG_SYS_NAND_PAGE_COUNT 64
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index b7638fb..27bf89c 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -75,8 +75,8 @@
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
/* Partition tables */
#define CONFIG_EFI_PARTITION
diff --git a/include/configs/omap3_evm_quick_mmc.h b/include/configs/omap3_evm_quick_mmc.h
index 50929aa..2daf13c 100644
--- a/include/configs/omap3_evm_quick_mmc.h
+++ b/include/configs/omap3_evm_quick_mmc.h
@@ -87,7 +87,7 @@
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#endif /* __OMAP3_EVM_QUICK_MMC_H */
diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
index 0dfb7e7..5b77db2 100644
--- a/include/configs/sama5d3_xplained.h
+++ b/include/configs/sama5d3_xplained.h
@@ -230,8 +230,8 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SPL_LIBDISK_SUPPORT
diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
index 56c2454..3cdd7ec 100644
--- a/include/configs/sama5d3xek.h
+++ b/include/configs/sama5d3xek.h
@@ -265,8 +265,8 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SPL_LIBDISK_SUPPORT
diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h
index b8fb77e..8fab105 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -148,8 +148,8 @@
#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_FS_FAT
diff --git a/include/configs/tao3530.h b/include/configs/tao3530.h
index 8d2db27..d687717 100644
--- a/include/configs/tao3530.h
+++ b/include/configs/tao3530.h
@@ -305,8 +305,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_BOARD_INIT
#define CONFIG_SPL_LIBCOMMON_SUPPORT
diff --git a/include/configs/ti814x_evm.h b/include/configs/ti814x_evm.h
index a55bde2..2fddef3 100644
--- a/include/configs/ti814x_evm.h
+++ b/include/configs/ti814x_evm.h
@@ -178,8 +178,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
diff --git a/include/configs/ti816x_evm.h b/include/configs/ti816x_evm.h
index e86c364..aeabb1b 100644
--- a/include/configs/ti816x_evm.h
+++ b/include/configs/ti816x_evm.h
@@ -144,8 +144,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
index 85171db..4b9b629 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -232,13 +232,13 @@
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
/* FAT sd card locations. */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#ifdef CONFIG_SPL_OS_BOOT
/* FAT */
-#define CONFIG_SPL_FAT_LOAD_KERNEL_NAME "uImage"
-#define CONFIG_SPL_FAT_LOAD_ARGS_NAME "args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"
/* RAW SD card / eMMC */
#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x900 /* address 0x120000 */
diff --git a/include/configs/tricorder.h b/include/configs/tricorder.h
index 6ddf3d5..6e7a7fb 100644
--- a/include/configs/tricorder.h
+++ b/include/configs/tricorder.h
@@ -348,8 +348,8 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SPL_TEXT_BASE 0x40200000 /*CONFIG_SYS_SRAM_START*/
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 875cb43..e4d1161 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -270,13 +270,13 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
#define CONFIG_SPL_LIBDISK_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
#if defined(CONFIG_OF_CONTROL) && defined(CONFIG_OF_SEPARATE)
-# define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot-dtb.img"
+# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img"
#else
-# define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#endif
#endif
@@ -290,8 +290,8 @@
/* Address in RAM where the parameters must be copied by SPL. */
#define CONFIG_SYS_SPL_ARGS_ADDR 0x10000000
-#define CONFIG_SPL_FAT_LOAD_ARGS_NAME "system.dtb"
-#define CONFIG_SPL_FAT_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME "system.dtb"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
/* Not using MMC raw mode - just for compilation purpose */
#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0
diff --git a/include/spl.h b/include/spl.h
index a7e41da..58c81dc 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -15,7 +15,7 @@
/* Boot type */
#define MMCSD_MODE_UNDEFINED 0
#define MMCSD_MODE_RAW 1
-#define MMCSD_MODE_FAT 2
+#define MMCSD_MODE_FS 2
#define MMCSD_MODE_EMMCBOOT 3
struct spl_image_info {
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread* [U-Boot] [PATCH 2/5] spl: Add EXT support to SPL
2014-09-19 8:47 [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL Guillaume GARDET
2014-09-19 8:47 ` [U-Boot] [PATCH 1/5] Rename some defines containing FAT in their name to be filesystem generic MMCSD_MODE_FAT => MMCSD_MODE_FS CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION => CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION Guillaume GARDET
@ 2014-09-19 8:47 ` Guillaume GARDET
2014-09-19 8:47 ` [U-Boot] [PATCH 3/5] doc: Update documentation according to the EXT SPL support patch set Guillaume GARDET
` (3 subsequent siblings)
5 siblings, 0 replies; 21+ messages in thread
From: Guillaume GARDET @ 2014-09-19 8:47 UTC (permalink / raw)
To: u-boot
Add EXT filesystem support to SPL.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Andreas Bie?mann <andreas.devel@googlemail.com>
---
common/spl/Makefile | 1 +
common/spl/spl_ext.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++
common/spl/spl_mmc.c | 18 ++++++-
fs/Makefile | 1 +
include/spl.h | 4 ++
5 files changed, 160 insertions(+), 2 deletions(-)
create mode 100644 common/spl/spl_ext.c
diff --git a/common/spl/Makefile b/common/spl/Makefile
index 64569c2..10a4589 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -18,5 +18,6 @@ obj-$(CONFIG_SPL_NET_SUPPORT) += spl_net.o
obj-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc.o
obj-$(CONFIG_SPL_USB_SUPPORT) += spl_usb.o
obj-$(CONFIG_SPL_FAT_SUPPORT) += spl_fat.o
+obj-$(CONFIG_SPL_EXT_SUPPORT) += spl_ext.o
obj-$(CONFIG_SPL_SATA_SUPPORT) += spl_sata.o
endif
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
new file mode 100644
index 0000000..7342268
--- /dev/null
+++ b/common/spl/spl_ext.c
@@ -0,0 +1,138 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <spl.h>
+#include <asm/u-boot.h>
+#include <ext4fs.h>
+#include <image.h>
+
+#ifdef CONFIG_SPL_EXT_SUPPORT
+int spl_load_image_ext(block_dev_desc_t *block_dev,
+ int partition,
+ const char *filename)
+{
+ s32 err;
+ struct image_header *header;
+ int filelen;
+ disk_partition_t part_info = {};
+
+ header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
+ sizeof(struct image_header));
+
+ if (get_partition_info(block_dev,
+ partition, &part_info)) {
+ printf("spl: no partition table found\n");
+ goto end;
+ }
+
+ ext4fs_set_blk_dev(block_dev, &part_info);
+
+ err = ext4fs_mount(0);
+ if (!err) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+ printf("%s: ext4fs mount err - %d\n", __func__, err);
+#endif
+ goto end;
+ }
+
+ filelen = err = ext4fs_open(filename);
+ if (err < 0) {
+ puts("spl: ext4fs_open failed\n");
+ goto end;
+ }
+ err = ext4fs_read((char *)header, sizeof(struct image_header));
+ if (err <= 0) {
+ puts("spl: ext4fs_read failed\n");
+ goto end;
+ }
+
+ spl_parse_image_header(header);
+
+ err = ext4fs_read((char *)spl_image.load_addr, filelen);
+
+end:
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+ if (err <= 0)
+ printf("%s: error reading image %s, err - %d\n",
+ __func__, filename, err);
+#endif
+
+ return (err <= 0);
+}
+
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
+{
+ int err;
+ int filelen;
+ disk_partition_t part_info = {};
+ __maybe_unused char *file;
+
+ if (get_partition_info(block_dev,
+ partition, &part_info)) {
+ printf("spl: no partition table found\n");
+ return -1;
+ }
+
+ ext4fs_set_blk_dev(block_dev, &part_info);
+
+ err = ext4fs_mount(0);
+ if (!err) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+ printf("%s: ext4fs mount err - %d\n", __func__, err);
+#endif
+ return -1;
+ }
+
+#if defined(CONFIG_SPL_ENV_SUPPORT) && defined(CONFIG_SPL_OS_BOOT)
+ file = getenv("falcon_args_file");
+ if (file) {
+ filelen = err = ext4fs_open(file);
+ if (err < 0) {
+ puts("spl: ext4fs_open failed\n");
+ goto defaults;
+ }
+ err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+ if (err <= 0) {
+ printf("spl: error reading image %s, err - %d, falling back to default\n",
+ file, err);
+ goto defaults;
+ }
+ file = getenv("falcon_image_file");
+ if (file) {
+ err = spl_load_image_ext(block_dev, partition, file);
+ if (err != 0) {
+ puts("spl: falling back to default\n");
+ goto defaults;
+ }
+
+ return 0;
+ } else
+ puts("spl: falcon_image_file not set in environment, falling back to default\n");
+ } else
+ puts("spl: falcon_args_file not set in environment, falling back to default\n");
+
+defaults:
+#endif
+
+ filelen = err = ext4fs_open(CONFIG_SPL_FS_LOAD_ARGS_NAME);
+ if (err < 0) {
+ puts("spl: ext4fs_open failed\n");
+ }
+ err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+ if (err <= 0) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+ printf("%s: error reading image %s, err - %d\n",
+ __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
+#endif
+ return -1;
+ }
+
+ return spl_load_image_ext(block_dev, partition,
+ CONFIG_SPL_FS_LOAD_KERNEL_NAME);
+}
+#endif
+#endif
+
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index a631e0a..ee71f79 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -100,9 +100,10 @@ void spl_mmc_load_image(void)
#endif
err = mmc_load_image_raw(mmc,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
-#ifdef CONFIG_SPL_FAT_SUPPORT
+#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
} else if (boot_mode == MMCSD_MODE_FS) {
- debug("boot mode - FAT\n");
+ debug("boot mode - FS\n");
+#ifdef CONFIG_SPL_FAT_SUPPORT
#ifdef CONFIG_SPL_OS_BOOT
if (spl_start_uboot() || spl_load_image_fat_os(&mmc->block_dev,
CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION))
@@ -110,7 +111,20 @@ void spl_mmc_load_image(void)
err = spl_load_image_fat(&mmc->block_dev,
CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION,
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+ if(err)
+#endif /* CONFIG_SPL_FAT_SUPPORT */
+ {
+#ifdef CONFIG_SPL_EXT_SUPPORT
+#ifdef CONFIG_SPL_OS_BOOT
+ if (spl_start_uboot() || spl_load_image_ext_os(&mmc->block_dev,
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION))
#endif
+ err = spl_load_image_ext(&mmc->block_dev,
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION,
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+#endif /* CONFIG_SPL_EXT_SUPPORT */
+ }
+#endif /* defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT) */
#ifdef CONFIG_SUPPORT_EMMC_BOOT
} else if (boot_mode == MMCSD_MODE_EMMCBOOT) {
/*
diff --git a/fs/Makefile b/fs/Makefile
index 1822165..51d06fc 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -8,6 +8,7 @@
ifdef CONFIG_SPL_BUILD
obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/
+obj-$(CONFIG_SPL_EXT_SUPPORT) += ext4/
else
obj-y += fs.o
diff --git a/include/spl.h b/include/spl.h
index 58c81dc..f4688c0 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -72,6 +72,10 @@ void spl_sata_load_image(void);
int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const char *filename);
int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition);
+/* SPL EXT image functions */
+int spl_load_image_ext(block_dev_desc_t *block_dev, int partition, const char *filename);
+int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition);
+
#ifdef CONFIG_SPL_BOARD_INIT
void spl_board_init(void);
#endif
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread* [U-Boot] [PATCH 3/5] doc: Update documentation according to the EXT SPL support patch set
2014-09-19 8:47 [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL Guillaume GARDET
2014-09-19 8:47 ` [U-Boot] [PATCH 1/5] Rename some defines containing FAT in their name to be filesystem generic MMCSD_MODE_FAT => MMCSD_MODE_FS CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION => CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION Guillaume GARDET
2014-09-19 8:47 ` [U-Boot] [PATCH 2/5] spl: Add EXT support to SPL Guillaume GARDET
@ 2014-09-19 8:47 ` Guillaume GARDET
2014-09-19 8:47 ` [U-Boot] [PATCH 4/5] spl: do not hang in spl_register_fat_device but return error value. It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT Guillaume GARDET
` (2 subsequent siblings)
5 siblings, 0 replies; 21+ messages in thread
From: Guillaume GARDET @ 2014-09-19 8:47 UTC (permalink / raw)
To: u-boot
Update documentation according to the EXT SPL support patch set.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Andreas Bie?mann <andreas.devel@googlemail.com>
---
README | 17 ++++++++++-------
doc/README.SPL | 1 +
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/README b/README
index 0a0f528..30a2008 100644
--- a/README
+++ b/README
@@ -3525,7 +3525,7 @@ FIT uImage format:
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR,
CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS,
- CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
Address, size and partition on the MMC to load U-Boot from
when the MMC is being used in raw mode.
@@ -3542,16 +3542,19 @@ FIT uImage format:
CONFIG_SPL_FAT_SUPPORT
Support for fs/fat/libfat.o in SPL binary
- CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME
- Filename to read to load U-Boot when reading from FAT
+ CONFIG_SPL_EXT_SUPPORT
+ Support for EXT filesystem in SPL binary
- CONFIG_SPL_FAT_LOAD_KERNEL_NAME
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
+ Filename to read to load U-Boot when reading from filesystem
+
+ CONFIG_SPL_FS_LOAD_KERNEL_NAME
Filename to read to load kernel uImage when reading
- from FAT (for Falcon mode)
+ from filesystem (for Falcon mode)
- CONFIG_SPL_FAT_LOAD_ARGS_NAME
+ CONFIG_SPL_FS_LOAD_ARGS_NAME
Filename to read to load kernel argument parameters
- when reading from FAT (for Falcon mode)
+ when reading from filesystem (for Falcon mode)
CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
Set this for NAND SPL on PPC mpc83xx targets, so that
diff --git a/doc/README.SPL b/doc/README.SPL
index c283dcf..3ba313c 100644
--- a/doc/README.SPL
+++ b/doc/README.SPL
@@ -54,6 +54,7 @@ CONFIG_SPL_SERIAL_SUPPORT (drivers/serial/libserial.o)
CONFIG_SPL_SPI_FLASH_SUPPORT (drivers/mtd/spi/libspi_flash.o)
CONFIG_SPL_SPI_SUPPORT (drivers/spi/libspi.o)
CONFIG_SPL_FAT_SUPPORT (fs/fat/libfat.o)
+CONFIG_SPL_EXT_SUPPORT
CONFIG_SPL_LIBGENERIC_SUPPORT (lib/libgeneric.o)
CONFIG_SPL_POWER_SUPPORT (drivers/power/libpower.o)
CONFIG_SPL_NAND_SUPPORT (drivers/mtd/nand/libnand.o)
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread* [U-Boot] [PATCH 4/5] spl: do not hang in spl_register_fat_device but return error value. It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT.
2014-09-19 8:47 [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL Guillaume GARDET
` (2 preceding siblings ...)
2014-09-19 8:47 ` [U-Boot] [PATCH 3/5] doc: Update documentation according to the EXT SPL support patch set Guillaume GARDET
@ 2014-09-19 8:47 ` Guillaume GARDET
2014-09-19 8:47 ` [U-Boot] [PATCH 5/5] TI:OMAP4: enable EXT support in SPL for OMAP4 boards Guillaume GARDET
2014-09-29 6:39 ` [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL Guillaume Gardet
5 siblings, 0 replies; 21+ messages in thread
From: Guillaume GARDET @ 2014-09-19 8:47 UTC (permalink / raw)
To: u-boot
Do not hang in spl_register_fat_device but return an error value.
It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT.
If FAT load fails, then EXT load is tried.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Andreas Bie?mann <andreas.devel@googlemail.com>
---
common/spl/spl_fat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 91481fc..350f7d9 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -30,7 +30,7 @@ static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition)
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: fat register err - %d\n", __func__, err);
#endif
- hang();
+ return err;
}
fat_registered = 1;
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread* [U-Boot] [PATCH 5/5] TI:OMAP4: enable EXT support in SPL for OMAP4 boards
2014-09-19 8:47 [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL Guillaume GARDET
` (3 preceding siblings ...)
2014-09-19 8:47 ` [U-Boot] [PATCH 4/5] spl: do not hang in spl_register_fat_device but return error value. It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT Guillaume GARDET
@ 2014-09-19 8:47 ` Guillaume GARDET
2014-09-29 6:39 ` [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL Guillaume Gardet
5 siblings, 0 replies; 21+ messages in thread
From: Guillaume GARDET @ 2014-09-19 8:47 UTC (permalink / raw)
To: u-boot
Enable EXT support in SPL for OMAP4 boards.
Build tested for duovero, omap4_sdp4430 and omap4_panda.
Run time tested on omap4_panda.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Andreas Bie?mann <andreas.devel@googlemail.com>
---
include/configs/ti_omap4_common.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h
index 8c7310c..7b911c4 100644
--- a/include/configs/ti_omap4_common.h
+++ b/include/configs/ti_omap4_common.h
@@ -167,6 +167,9 @@
#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_SDRAM_BASE + \
(128 << 20))
+/* SPL: Allow to use an EXT partition */
+#define CONFIG_SPL_EXT_SUPPORT
+
#ifdef CONFIG_NAND
#define CONFIG_SPL_NAND_AM33XX_BCH /* ELM support */
#endif
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread* [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL
2014-09-19 8:47 [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL Guillaume GARDET
` (4 preceding siblings ...)
2014-09-19 8:47 ` [U-Boot] [PATCH 5/5] TI:OMAP4: enable EXT support in SPL for OMAP4 boards Guillaume GARDET
@ 2014-09-29 6:39 ` Guillaume Gardet
2014-09-30 13:33 ` Tom Rini
5 siblings, 1 reply; 21+ messages in thread
From: Guillaume Gardet @ 2014-09-29 6:39 UTC (permalink / raw)
To: u-boot
Hi,
Just a ping on this patch set which affects various part of u-boot.
Any comments ?
Guillaume
Le 19/09/2014 10:47, Guillaume GARDET a ?crit :
> Hi,
>
> This patch set adds EXT filesystem support to SPL and enables it for OMAP4 boards.
> Build is succesful on all omap4 and omap5 boards.
> Note that some OMAP3 boards (omap3_beagle and omap3_overo) may need to disable some functions in order to support EXT in SPL, otherwise the MLO (SPL) may be too big to fit in SRAM.
> I tested it succesfully on a Pandaboard (rev. A3) and on a Beagleboard xM (rev. B).
>
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Tom Rini <trini@ti.com>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Andreas Bie?mann <andreas.devel@googlemail.com>
>
>
> Regards,
>
> Guillaume
>
> ---
>
> Guillaume GARDET (5):
> Rename some defines containing FAT in their name to be filesystem
> generic MMCSD_MODE_FAT => MMCSD_MODE_FS
> CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME
> CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
> CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION =>
> CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
> spl: Add EXT support to SPL
> doc: Update documentation according to the EXT SPL support patch set
> spl: do not hang in spl_register_fat_device but return error value.
> It allows to use both CONFIG_SPL_FAT_SUPPORT and
> CONFIG_SPL_EXT_SUPPORT.
> TI:OMAP4: enable EXT support in SPL for OMAP4 boards
>
> README | 17 ++--
> arch/arm/cpu/arm1136/mx35/generic.c | 2 +-
> arch/arm/cpu/armv7/omap-common/boot-common.c | 4 +-
> arch/arm/cpu/armv7/omap3/board.c | 2 +-
> arch/arm/cpu/armv7/zynq/spl.c | 2 +-
> arch/arm/cpu/at91-common/spl.c | 2 +-
> arch/arm/imx-common/spl.c | 2 +-
> common/spl/Makefile | 1 +
> common/spl/spl_ext.c | 138 +++++++++++++++++++++++++++
> common/spl/spl_fat.c | 8 +-
> common/spl/spl_mmc.c | 24 ++++-
> common/spl/spl_sata.c | 2 +-
> common/spl/spl_usb.c | 2 +-
> doc/README.SPL | 1 +
> fs/Makefile | 1 +
> include/configs/am3517_crane.h | 4 +-
> include/configs/am3517_evm.h | 4 +-
> include/configs/cm_t35.h | 4 +-
> include/configs/devkit8000.h | 8 +-
> include/configs/imx6_spl.h | 4 +-
> include/configs/mcx.h | 4 +-
> include/configs/omap3_evm.h | 4 +-
> include/configs/omap3_evm_quick_mmc.h | 4 +-
> include/configs/sama5d3_xplained.h | 4 +-
> include/configs/sama5d3xek.h | 4 +-
> include/configs/siemens-am33x-common.h | 4 +-
> include/configs/tao3530.h | 4 +-
> include/configs/ti814x_evm.h | 4 +-
> include/configs/ti816x_evm.h | 4 +-
> include/configs/ti_armv7_common.h | 8 +-
> include/configs/ti_omap4_common.h | 3 +
> include/configs/tricorder.h | 4 +-
> include/configs/zynq-common.h | 10 +-
> include/spl.h | 6 +-
> 34 files changed, 232 insertions(+), 67 deletions(-)
> create mode 100644 common/spl/spl_ext.c
>
^ permalink raw reply [flat|nested] 21+ messages in thread* [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL
2014-09-29 6:39 ` [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL Guillaume Gardet
@ 2014-09-30 13:33 ` Tom Rini
2014-09-30 14:15 ` Guillaume Gardet
2014-10-15 15:53 ` [U-Boot] [PATCH V2 " Guillaume GARDET
0 siblings, 2 replies; 21+ messages in thread
From: Tom Rini @ 2014-09-30 13:33 UTC (permalink / raw)
To: u-boot
On Mon, Sep 29, 2014 at 08:39:54AM +0200, Guillaume Gardet wrote:
> Hi,
>
> Just a ping on this patch set which affects various part of u-boot.
>
> Any comments ?
I like the concept and will look harder for the next merge window,
thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140930/47b6bb90/attachment.pgp>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL
2014-09-30 13:33 ` Tom Rini
@ 2014-09-30 14:15 ` Guillaume Gardet
2014-10-15 15:53 ` [U-Boot] [PATCH V2 " Guillaume GARDET
1 sibling, 0 replies; 21+ messages in thread
From: Guillaume Gardet @ 2014-09-30 14:15 UTC (permalink / raw)
To: u-boot
Le 30/09/2014 15:33, Tom Rini a ?crit :
> On Mon, Sep 29, 2014 at 08:39:54AM +0200, Guillaume Gardet wrote:
>
>> Hi,
>>
>> Just a ping on this patch set which affects various part of u-boot.
>>
>> Any comments ?
> I like the concept and will look harder for the next merge window,
> thanks!
>
Ok, thanks for the answer.
When will start the next merge window? In case you need a ping. ;)
Guillaume
^ permalink raw reply [flat|nested] 21+ messages in thread
* [U-Boot] [PATCH V2 0/5] Add EXT filesystem support to SPL
2014-09-30 13:33 ` Tom Rini
2014-09-30 14:15 ` Guillaume Gardet
@ 2014-10-15 15:53 ` Guillaume GARDET
2014-10-15 15:53 ` [U-Boot] [PATCH V2 1/5] Rename some defines containing FAT in their name to be filesystem generic Guillaume GARDET
` (4 more replies)
1 sibling, 5 replies; 21+ messages in thread
From: Guillaume GARDET @ 2014-10-15 15:53 UTC (permalink / raw)
To: u-boot
Changes in V2:
* Rebase on v2014.10
V1 :
* This patch set adds EXT filesystem support to SPL and enables it for OMAP4 boards.
* Build is succesful on all omap4 and omap5 boards.
* Note that some OMAP3 boards (omap3_beagle and omap3_overo) may need to disable some functions in order to support EXT in SPL, otherwise the MLO (SPL) may be too big to fit in SRAM.
* I tested it succesfully on a Pandaboard (rev. A3) and on a Beagleboard xM (rev. B).
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@ti.com>
Regards,
Guillaume
---
Guillaume GARDET (5):
Rename some defines containing FAT in their name to be filesystem
generic MMCSD_MODE_FAT => MMCSD_MODE_FS
CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME
CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION =>
CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
spl: Add EXT support to SPL
doc: Update documentation according to the EXT SPL support patch set
spl: do not hang in spl_register_fat_device but return error value.
It allows to use both CONFIG_SPL_FAT_SUPPORT and
CONFIG_SPL_EXT_SUPPORT.
TI:OMAP4: enable EXT support in SPL for OMAP4 boards
README | 17 ++--
arch/arm/cpu/arm1136/mx35/generic.c | 2 +-
arch/arm/cpu/armv7/omap-common/boot-common.c | 4 +-
arch/arm/cpu/armv7/omap3/board.c | 2 +-
arch/arm/cpu/armv7/zynq/spl.c | 2 +-
arch/arm/cpu/at91-common/spl.c | 2 +-
arch/arm/imx-common/spl.c | 2 +-
common/spl/Makefile | 1 +
common/spl/spl_ext.c | 138 +++++++++++++++++++++++++++
common/spl/spl_fat.c | 8 +-
common/spl/spl_mmc.c | 24 ++++-
common/spl/spl_sata.c | 2 +-
common/spl/spl_usb.c | 2 +-
doc/README.SPL | 1 +
fs/Makefile | 1 +
include/configs/am3517_crane.h | 4 +-
include/configs/am3517_evm.h | 4 +-
include/configs/cm_t35.h | 4 +-
include/configs/devkit8000.h | 8 +-
include/configs/imx6_spl.h | 4 +-
include/configs/mcx.h | 4 +-
include/configs/omap3_evm.h | 4 +-
include/configs/omap3_evm_quick_mmc.h | 4 +-
include/configs/sama5d3_xplained.h | 4 +-
include/configs/sama5d3xek.h | 4 +-
include/configs/siemens-am33x-common.h | 4 +-
include/configs/tao3530.h | 4 +-
include/configs/ti814x_evm.h | 4 +-
include/configs/ti816x_evm.h | 4 +-
include/configs/ti_armv7_common.h | 8 +-
include/configs/ti_omap4_common.h | 3 +
include/configs/tricorder.h | 4 +-
include/configs/zynq-common.h | 8 +-
include/spl.h | 6 +-
34 files changed, 231 insertions(+), 66 deletions(-)
create mode 100644 common/spl/spl_ext.c
--
1.8.4.5
^ permalink raw reply [flat|nested] 21+ messages in thread* [U-Boot] [PATCH V2 1/5] Rename some defines containing FAT in their name to be filesystem generic
2014-10-15 15:53 ` [U-Boot] [PATCH V2 " Guillaume GARDET
@ 2014-10-15 15:53 ` Guillaume GARDET
2014-10-27 22:20 ` [U-Boot] [U-Boot, V2, " Tom Rini
2014-10-15 15:53 ` [U-Boot] [PATCH V2 2/5] spl: Add EXT support to SPL Guillaume GARDET
` (3 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Guillaume GARDET @ 2014-10-15 15:53 UTC (permalink / raw)
To: u-boot
Rename some defines containing FAT in their name to be filesystem generic:
MMCSD_MODE_FAT => MMCSD_MODE_FS
CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME
CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION => CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@ti.com>
---
arch/arm/cpu/arm1136/mx35/generic.c | 2 +-
arch/arm/cpu/armv7/omap-common/boot-common.c | 4 ++--
arch/arm/cpu/armv7/omap3/board.c | 2 +-
arch/arm/cpu/armv7/zynq/spl.c | 2 +-
arch/arm/cpu/at91-common/spl.c | 2 +-
arch/arm/imx-common/spl.c | 2 +-
common/spl/spl_fat.c | 6 +++---
common/spl/spl_mmc.c | 8 ++++----
common/spl/spl_sata.c | 2 +-
common/spl/spl_usb.c | 2 +-
include/configs/am3517_crane.h | 4 ++--
include/configs/am3517_evm.h | 4 ++--
include/configs/cm_t35.h | 4 ++--
include/configs/devkit8000.h | 8 ++++----
include/configs/imx6_spl.h | 4 ++--
include/configs/mcx.h | 4 ++--
include/configs/omap3_evm.h | 4 ++--
include/configs/omap3_evm_quick_mmc.h | 4 ++--
include/configs/sama5d3_xplained.h | 4 ++--
include/configs/sama5d3xek.h | 4 ++--
include/configs/siemens-am33x-common.h | 4 ++--
include/configs/tao3530.h | 4 ++--
include/configs/ti814x_evm.h | 4 ++--
include/configs/ti816x_evm.h | 4 ++--
include/configs/ti_armv7_common.h | 8 ++++----
include/configs/tricorder.h | 4 ++--
include/configs/zynq-common.h | 8 ++++----
include/spl.h | 2 +-
28 files changed, 57 insertions(+), 57 deletions(-)
diff --git a/arch/arm/cpu/arm1136/mx35/generic.c b/arch/arm/cpu/arm1136/mx35/generic.c
index 8d3f92c..bc98edd 100644
--- a/arch/arm/cpu/arm1136/mx35/generic.c
+++ b/arch/arm/cpu/arm1136/mx35/generic.c
@@ -531,7 +531,7 @@ u32 spl_boot_mode(void)
switch (spl_boot_device()) {
case BOOT_DEVICE_MMC1:
#ifdef CONFIG_SPL_FAT_SUPPORT
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
#else
return MMCSD_MODE_RAW;
#endif
diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c b/arch/arm/cpu/armv7/omap-common/boot-common.c
index 3033564..fb535eb 100644
--- a/arch/arm/cpu/armv7/omap-common/boot-common.c
+++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
@@ -81,8 +81,8 @@ u32 spl_boot_mode(void)
if (val == MMCSD_MODE_RAW)
return MMCSD_MODE_RAW;
- else if (val == MMCSD_MODE_FAT)
- return MMCSD_MODE_FAT;
+ else if (val == MMCSD_MODE_FS)
+ return MMCSD_MODE_FS;
else
#ifdef CONFIG_SUPPORT_EMMC_BOOT
return MMCSD_MODE_EMMCBOOT;
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 667e77f..9bcca9d 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -65,7 +65,7 @@ u32 spl_boot_mode(void)
case BOOT_DEVICE_MMC2:
return MMCSD_MODE_RAW;
case BOOT_DEVICE_MMC1:
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
break;
default:
puts("spl: ERROR: unknown device - can't select boot mode\n");
diff --git a/arch/arm/cpu/armv7/zynq/spl.c b/arch/arm/cpu/armv7/zynq/spl.c
index 9ff2ef2..31627f9 100644
--- a/arch/arm/cpu/armv7/zynq/spl.c
+++ b/arch/arm/cpu/armv7/zynq/spl.c
@@ -63,7 +63,7 @@ u32 spl_boot_device(void)
#ifdef CONFIG_SPL_MMC_SUPPORT
u32 spl_boot_mode(void)
{
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
}
#endif
diff --git a/arch/arm/cpu/at91-common/spl.c b/arch/arm/cpu/at91-common/spl.c
index cbb5a52..674a470 100644
--- a/arch/arm/cpu/at91-common/spl.c
+++ b/arch/arm/cpu/at91-common/spl.c
@@ -102,7 +102,7 @@ u32 spl_boot_mode(void)
switch (spl_boot_device()) {
#ifdef CONFIG_SYS_USE_MMC
case BOOT_DEVICE_MMC1:
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
break;
#endif
case BOOT_DEVICE_NONE:
diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
index 9a02a64..9d3c31a 100644
--- a/arch/arm/imx-common/spl.c
+++ b/arch/arm/imx-common/spl.c
@@ -68,7 +68,7 @@ u32 spl_boot_mode(void)
case BOOT_DEVICE_MMC1:
case BOOT_DEVICE_MMC2:
#ifdef CONFIG_SPL_FAT_SUPPORT
- return MMCSD_MODE_FAT;
+ return MMCSD_MODE_FS;
#else
return MMCSD_MODE_RAW;
#endif
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 56be943..91481fc 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -106,18 +106,18 @@ int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
defaults:
#endif
- err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME,
+ err = file_fat_read(CONFIG_SPL_FS_LOAD_ARGS_NAME,
(void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
if (err <= 0) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: error reading image %s, err - %d\n",
- __func__, CONFIG_SPL_FAT_LOAD_ARGS_NAME, err);
+ __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
#endif
return -1;
}
return spl_load_image_fat(block_dev, partition,
- CONFIG_SPL_FAT_LOAD_KERNEL_NAME);
+ CONFIG_SPL_FS_LOAD_KERNEL_NAME);
}
#endif
#endif
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index fa6f891..a631e0a 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -101,15 +101,15 @@ void spl_mmc_load_image(void)
err = mmc_load_image_raw(mmc,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
#ifdef CONFIG_SPL_FAT_SUPPORT
- } else if (boot_mode == MMCSD_MODE_FAT) {
+ } else if (boot_mode == MMCSD_MODE_FS) {
debug("boot mode - FAT\n");
#ifdef CONFIG_SPL_OS_BOOT
if (spl_start_uboot() || spl_load_image_fat_os(&mmc->block_dev,
- CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION))
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION))
#endif
err = spl_load_image_fat(&mmc->block_dev,
- CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION,
- CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION,
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
#endif
#ifdef CONFIG_SUPPORT_EMMC_BOOT
} else if (boot_mode == MMCSD_MODE_EMMCBOOT) {
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 12e16d9..aeea793 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -42,7 +42,7 @@ void spl_sata_load_image(void)
#endif
err = spl_load_image_fat(stor_dev,
CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
- CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
if (err) {
puts("Error loading sata device\n");
hang();
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index 53a9043..c81672b 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -49,7 +49,7 @@ void spl_usb_load_image(void)
#endif
err = spl_load_image_fat(stor_dev,
CONFIG_SYS_USB_FAT_BOOT_PARTITION,
- CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
if (err) {
puts("Error loading USB device\n");
diff --git a/include/configs/am3517_crane.h b/include/configs/am3517_crane.h
index fcb4033..0fbfa3f 100644
--- a/include/configs/am3517_crane.h
+++ b/include/configs/am3517_crane.h
@@ -304,8 +304,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_LIBCOMMON_SUPPORT
#define CONFIG_SPL_LIBDISK_SUPPORT
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index c5d64ca..8719f76 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -313,8 +313,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_LIBCOMMON_SUPPORT
#define CONFIG_SPL_LIBDISK_SUPPORT
diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index 6f4d97f..1919cde 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -321,8 +321,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_BOARD_INIT
#define CONFIG_SPL_LIBCOMMON_SUPPORT
diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index 7ab6d51..ca62461 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -298,8 +298,8 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SPL_TEXT_BASE 0x40200000 /*CONFIG_SYS_SRAM_START*/
@@ -341,8 +341,8 @@
0x400000)
#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
-#define CONFIG_SPL_FAT_LOAD_KERNEL_NAME "uImage"
-#define CONFIG_SPL_FAT_LOAD_ARGS_NAME "args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"
#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x500 /* address 0xa0000 */
#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x8 /* address 0x1000 */
diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h
index 970460d..308e520 100644
--- a/include/configs/imx6_spl.h
+++ b/include/configs/imx6_spl.h
@@ -46,7 +46,7 @@
#if defined(CONFIG_SPL_MMC_SUPPORT)
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 138 /* offset 69KB */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 800 /* 400 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
#define CONFIG_SYS_MONITOR_LEN (CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS/2*1024)
#endif
@@ -58,7 +58,7 @@
/* Define the payload for FAT/EXT support */
#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_LIBDISK_SUPPORT
#endif
diff --git a/include/configs/mcx.h b/include/configs/mcx.h
index cd85a6c..adaf44f 100644
--- a/include/configs/mcx.h
+++ b/include/configs/mcx.h
@@ -372,8 +372,8 @@
#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
/* NAND boot config */
#define CONFIG_SYS_NAND_PAGE_COUNT 64
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index b7638fb..27bf89c 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -75,8 +75,8 @@
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
/* Partition tables */
#define CONFIG_EFI_PARTITION
diff --git a/include/configs/omap3_evm_quick_mmc.h b/include/configs/omap3_evm_quick_mmc.h
index 50929aa..2daf13c 100644
--- a/include/configs/omap3_evm_quick_mmc.h
+++ b/include/configs/omap3_evm_quick_mmc.h
@@ -87,7 +87,7 @@
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#endif /* __OMAP3_EVM_QUICK_MMC_H */
diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
index 0dfb7e7..5b77db2 100644
--- a/include/configs/sama5d3_xplained.h
+++ b/include/configs/sama5d3_xplained.h
@@ -230,8 +230,8 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SPL_LIBDISK_SUPPORT
diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
index c46baf2..dfbf3cb 100644
--- a/include/configs/sama5d3xek.h
+++ b/include/configs/sama5d3xek.h
@@ -276,8 +276,8 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SPL_LIBDISK_SUPPORT
diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h
index 1ce0965..0d5dba1 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -148,8 +148,8 @@
#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_FS_FAT
diff --git a/include/configs/tao3530.h b/include/configs/tao3530.h
index 8d2db27..d687717 100644
--- a/include/configs/tao3530.h
+++ b/include/configs/tao3530.h
@@ -305,8 +305,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_BOARD_INIT
#define CONFIG_SPL_LIBCOMMON_SUPPORT
diff --git a/include/configs/ti814x_evm.h b/include/configs/ti814x_evm.h
index a55bde2..2fddef3 100644
--- a/include/configs/ti814x_evm.h
+++ b/include/configs/ti814x_evm.h
@@ -178,8 +178,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
diff --git a/include/configs/ti816x_evm.h b/include/configs/ti816x_evm.h
index e86c364..aeabb1b 100644
--- a/include/configs/ti816x_evm.h
+++ b/include/configs/ti816x_evm.h
@@ -144,8 +144,8 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
index 85171db..4b9b629 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -232,13 +232,13 @@
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
/* FAT sd card locations. */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
#ifdef CONFIG_SPL_OS_BOOT
/* FAT */
-#define CONFIG_SPL_FAT_LOAD_KERNEL_NAME "uImage"
-#define CONFIG_SPL_FAT_LOAD_ARGS_NAME "args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"
/* RAW SD card / eMMC */
#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x900 /* address 0x120000 */
diff --git a/include/configs/tricorder.h b/include/configs/tricorder.h
index 6ddf3d5..6e7a7fb 100644
--- a/include/configs/tricorder.h
+++ b/include/configs/tricorder.h
@@ -348,8 +348,8 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SPL_TEXT_BASE 0x40200000 /*CONFIG_SYS_SRAM_START*/
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 0b4dd66..2bc1562 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -268,10 +268,10 @@
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
+#define CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION 1
#define CONFIG_SPL_LIBDISK_SUPPORT
#define CONFIG_SPL_FAT_SUPPORT
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot-dtb.img"
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img"
#endif
/* Disable dcache for SPL just for sure */
@@ -283,8 +283,8 @@
/* Address in RAM where the parameters must be copied by SPL. */
#define CONFIG_SYS_SPL_ARGS_ADDR 0x10000000
-#define CONFIG_SPL_FAT_LOAD_ARGS_NAME "system.dtb"
-#define CONFIG_SPL_FAT_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME "system.dtb"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
/* Not using MMC raw mode - just for compilation purpose */
#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0
diff --git a/include/spl.h b/include/spl.h
index a7e41da..58c81dc 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -15,7 +15,7 @@
/* Boot type */
#define MMCSD_MODE_UNDEFINED 0
#define MMCSD_MODE_RAW 1
-#define MMCSD_MODE_FAT 2
+#define MMCSD_MODE_FS 2
#define MMCSD_MODE_EMMCBOOT 3
struct spl_image_info {
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread* [U-Boot] [PATCH V2 2/5] spl: Add EXT support to SPL
2014-10-15 15:53 ` [U-Boot] [PATCH V2 " Guillaume GARDET
2014-10-15 15:53 ` [U-Boot] [PATCH V2 1/5] Rename some defines containing FAT in their name to be filesystem generic Guillaume GARDET
@ 2014-10-15 15:53 ` Guillaume GARDET
2014-10-27 22:22 ` [U-Boot] [U-Boot,V2,2/5] " Tom Rini
2014-10-15 15:53 ` [U-Boot] [PATCH V2 3/5] doc: Update documentation according to the EXT SPL support patch set Guillaume GARDET
` (2 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Guillaume GARDET @ 2014-10-15 15:53 UTC (permalink / raw)
To: u-boot
Add EXT filesystem support to SPL.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@ti.com>
---
common/spl/Makefile | 1 +
common/spl/spl_ext.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++
common/spl/spl_mmc.c | 18 ++++++-
fs/Makefile | 1 +
include/spl.h | 4 ++
5 files changed, 160 insertions(+), 2 deletions(-)
create mode 100644 common/spl/spl_ext.c
diff --git a/common/spl/Makefile b/common/spl/Makefile
index 64569c2..10a4589 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -18,5 +18,6 @@ obj-$(CONFIG_SPL_NET_SUPPORT) += spl_net.o
obj-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc.o
obj-$(CONFIG_SPL_USB_SUPPORT) += spl_usb.o
obj-$(CONFIG_SPL_FAT_SUPPORT) += spl_fat.o
+obj-$(CONFIG_SPL_EXT_SUPPORT) += spl_ext.o
obj-$(CONFIG_SPL_SATA_SUPPORT) += spl_sata.o
endif
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
new file mode 100644
index 0000000..7342268
--- /dev/null
+++ b/common/spl/spl_ext.c
@@ -0,0 +1,138 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <spl.h>
+#include <asm/u-boot.h>
+#include <ext4fs.h>
+#include <image.h>
+
+#ifdef CONFIG_SPL_EXT_SUPPORT
+int spl_load_image_ext(block_dev_desc_t *block_dev,
+ int partition,
+ const char *filename)
+{
+ s32 err;
+ struct image_header *header;
+ int filelen;
+ disk_partition_t part_info = {};
+
+ header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
+ sizeof(struct image_header));
+
+ if (get_partition_info(block_dev,
+ partition, &part_info)) {
+ printf("spl: no partition table found\n");
+ goto end;
+ }
+
+ ext4fs_set_blk_dev(block_dev, &part_info);
+
+ err = ext4fs_mount(0);
+ if (!err) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+ printf("%s: ext4fs mount err - %d\n", __func__, err);
+#endif
+ goto end;
+ }
+
+ filelen = err = ext4fs_open(filename);
+ if (err < 0) {
+ puts("spl: ext4fs_open failed\n");
+ goto end;
+ }
+ err = ext4fs_read((char *)header, sizeof(struct image_header));
+ if (err <= 0) {
+ puts("spl: ext4fs_read failed\n");
+ goto end;
+ }
+
+ spl_parse_image_header(header);
+
+ err = ext4fs_read((char *)spl_image.load_addr, filelen);
+
+end:
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+ if (err <= 0)
+ printf("%s: error reading image %s, err - %d\n",
+ __func__, filename, err);
+#endif
+
+ return (err <= 0);
+}
+
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
+{
+ int err;
+ int filelen;
+ disk_partition_t part_info = {};
+ __maybe_unused char *file;
+
+ if (get_partition_info(block_dev,
+ partition, &part_info)) {
+ printf("spl: no partition table found\n");
+ return -1;
+ }
+
+ ext4fs_set_blk_dev(block_dev, &part_info);
+
+ err = ext4fs_mount(0);
+ if (!err) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+ printf("%s: ext4fs mount err - %d\n", __func__, err);
+#endif
+ return -1;
+ }
+
+#if defined(CONFIG_SPL_ENV_SUPPORT) && defined(CONFIG_SPL_OS_BOOT)
+ file = getenv("falcon_args_file");
+ if (file) {
+ filelen = err = ext4fs_open(file);
+ if (err < 0) {
+ puts("spl: ext4fs_open failed\n");
+ goto defaults;
+ }
+ err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+ if (err <= 0) {
+ printf("spl: error reading image %s, err - %d, falling back to default\n",
+ file, err);
+ goto defaults;
+ }
+ file = getenv("falcon_image_file");
+ if (file) {
+ err = spl_load_image_ext(block_dev, partition, file);
+ if (err != 0) {
+ puts("spl: falling back to default\n");
+ goto defaults;
+ }
+
+ return 0;
+ } else
+ puts("spl: falcon_image_file not set in environment, falling back to default\n");
+ } else
+ puts("spl: falcon_args_file not set in environment, falling back to default\n");
+
+defaults:
+#endif
+
+ filelen = err = ext4fs_open(CONFIG_SPL_FS_LOAD_ARGS_NAME);
+ if (err < 0) {
+ puts("spl: ext4fs_open failed\n");
+ }
+ err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+ if (err <= 0) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+ printf("%s: error reading image %s, err - %d\n",
+ __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);
+#endif
+ return -1;
+ }
+
+ return spl_load_image_ext(block_dev, partition,
+ CONFIG_SPL_FS_LOAD_KERNEL_NAME);
+}
+#endif
+#endif
+
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index a631e0a..ee71f79 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -100,9 +100,10 @@ void spl_mmc_load_image(void)
#endif
err = mmc_load_image_raw(mmc,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
-#ifdef CONFIG_SPL_FAT_SUPPORT
+#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
} else if (boot_mode == MMCSD_MODE_FS) {
- debug("boot mode - FAT\n");
+ debug("boot mode - FS\n");
+#ifdef CONFIG_SPL_FAT_SUPPORT
#ifdef CONFIG_SPL_OS_BOOT
if (spl_start_uboot() || spl_load_image_fat_os(&mmc->block_dev,
CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION))
@@ -110,7 +111,20 @@ void spl_mmc_load_image(void)
err = spl_load_image_fat(&mmc->block_dev,
CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION,
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+ if(err)
+#endif /* CONFIG_SPL_FAT_SUPPORT */
+ {
+#ifdef CONFIG_SPL_EXT_SUPPORT
+#ifdef CONFIG_SPL_OS_BOOT
+ if (spl_start_uboot() || spl_load_image_ext_os(&mmc->block_dev,
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION))
#endif
+ err = spl_load_image_ext(&mmc->block_dev,
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION,
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+#endif /* CONFIG_SPL_EXT_SUPPORT */
+ }
+#endif /* defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT) */
#ifdef CONFIG_SUPPORT_EMMC_BOOT
} else if (boot_mode == MMCSD_MODE_EMMCBOOT) {
/*
diff --git a/fs/Makefile b/fs/Makefile
index 1822165..51d06fc 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -8,6 +8,7 @@
ifdef CONFIG_SPL_BUILD
obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/
+obj-$(CONFIG_SPL_EXT_SUPPORT) += ext4/
else
obj-y += fs.o
diff --git a/include/spl.h b/include/spl.h
index 58c81dc..f4688c0 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -72,6 +72,10 @@ void spl_sata_load_image(void);
int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const char *filename);
int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition);
+/* SPL EXT image functions */
+int spl_load_image_ext(block_dev_desc_t *block_dev, int partition, const char *filename);
+int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition);
+
#ifdef CONFIG_SPL_BOARD_INIT
void spl_board_init(void);
#endif
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread* [U-Boot] [U-Boot,V2,2/5] spl: Add EXT support to SPL
2014-10-15 15:53 ` [U-Boot] [PATCH V2 2/5] spl: Add EXT support to SPL Guillaume GARDET
@ 2014-10-27 22:22 ` Tom Rini
2014-10-29 12:45 ` Guillaume Gardet
0 siblings, 1 reply; 21+ messages in thread
From: Tom Rini @ 2014-10-27 22:22 UTC (permalink / raw)
To: u-boot
On Wed, Oct 15, 2014 at 05:53:12PM +0200, Guillaume GARDET wrote:
> Add EXT filesystem support to SPL.
>
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> Cc: Tom Rini <trini@ti.com>
With the following change:
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 7342268..7fbf3df 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -24,7 +24,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
if (get_partition_info(block_dev,
partition, &part_info)) {
printf("spl: no partition table found\n");
- goto end;
+ return -1;
}
ext4fs_set_blk_dev(block_dev, &part_info);
@@ -39,7 +39,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
filelen = err = ext4fs_open(filename);
if (err < 0) {
- puts("spl: ext4fs_open failed\n");
+ puts("spl: ext4fs_open failed\n");
goto end;
}
err = ext4fs_read((char *)header, sizeof(struct image_header));
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 7342268..d9eba5a 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -22,9 +22,9 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
sizeof(struct image_header));
if (get_partition_info(block_dev,
- partition, &part_info)) {
+ partition, &part_info)) {
printf("spl: no partition table found\n");
- goto end;
+ return -1;
}
ext4fs_set_blk_dev(block_dev, &part_info);
@@ -39,7 +39,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev,
filelen = err = ext4fs_open(filename);
if (err < 0) {
- puts("spl: ext4fs_open failed\n");
+ puts("spl: ext4fs_open failed\n");
goto end;
}
err = ext4fs_read((char *)header, sizeof(struct image_header));
@@ -59,7 +59,7 @@ end:
__func__, filename, err);
#endif
- return (err <= 0);
+ return err <= 0;
}
#ifdef CONFIG_SPL_OS_BOOT
@@ -69,9 +69,9 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
int filelen;
disk_partition_t part_info = {};
__maybe_unused char *file;
-
+
if (get_partition_info(block_dev,
- partition, &part_info)) {
+ partition, &part_info)) {
printf("spl: no partition table found\n");
return -1;
}
@@ -94,7 +94,7 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
puts("spl: ext4fs_open failed\n");
goto defaults;
}
- err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+ err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
if (err <= 0) {
printf("spl: error reading image %s, err - %d, falling back to default\n",
file, err);
@@ -109,19 +109,21 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
}
return 0;
- } else
+ } else {
puts("spl: falcon_image_file not set in environment, falling back to default\n");
- } else
+ }
+ } else {
puts("spl: falcon_args_file not set in environment, falling back to default\n");
+ }
defaults:
#endif
filelen = err = ext4fs_open(CONFIG_SPL_FS_LOAD_ARGS_NAME);
- if (err < 0) {
- puts("spl: ext4fs_open failed\n");
- }
- err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+ if (err < 0)
+ puts("spl: ext4fs_open failed\n");
+
+ err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
if (err <= 0) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: error reading image %s, err - %d\n",
@@ -135,4 +137,3 @@ defaults:
}
#endif
#endif
-
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141027/784a0479/attachment.pgp>
^ permalink raw reply related [flat|nested] 21+ messages in thread* [U-Boot] [U-Boot,V2,2/5] spl: Add EXT support to SPL
2014-10-27 22:22 ` [U-Boot] [U-Boot,V2,2/5] " Tom Rini
@ 2014-10-29 12:45 ` Guillaume Gardet
0 siblings, 0 replies; 21+ messages in thread
From: Guillaume Gardet @ 2014-10-29 12:45 UTC (permalink / raw)
To: u-boot
Le 27/10/2014 23:22, Tom Rini a ?crit :
> On Wed, Oct 15, 2014 at 05:53:12PM +0200, Guillaume GARDET wrote:
>
>> Add EXT filesystem support to SPL.
>>
>> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>> Cc: Tom Rini <trini@ti.com>
> With the following change:
> diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
> index 7342268..7fbf3df 100644
>
> Applied to u-boot/master, thanks!
>
Thanks. :)
Guillaume
^ permalink raw reply [flat|nested] 21+ messages in thread
* [U-Boot] [PATCH V2 3/5] doc: Update documentation according to the EXT SPL support patch set
2014-10-15 15:53 ` [U-Boot] [PATCH V2 " Guillaume GARDET
2014-10-15 15:53 ` [U-Boot] [PATCH V2 1/5] Rename some defines containing FAT in their name to be filesystem generic Guillaume GARDET
2014-10-15 15:53 ` [U-Boot] [PATCH V2 2/5] spl: Add EXT support to SPL Guillaume GARDET
@ 2014-10-15 15:53 ` Guillaume GARDET
2014-10-27 22:21 ` [U-Boot] [U-Boot, V2, " Tom Rini
2014-10-15 15:53 ` [U-Boot] [PATCH V2 4/5] spl: do not hang in spl_register_fat_device but return error value. It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT Guillaume GARDET
2014-10-15 15:53 ` [U-Boot] [PATCH V2 5/5] TI:OMAP4: enable EXT support in SPL for OMAP4 boards Guillaume GARDET
4 siblings, 1 reply; 21+ messages in thread
From: Guillaume GARDET @ 2014-10-15 15:53 UTC (permalink / raw)
To: u-boot
Update documentation according to the EXT SPL support patch set.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@ti.com>
---
README | 17 ++++++++++-------
doc/README.SPL | 1 +
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/README b/README
index 46def00..43b460c 100644
--- a/README
+++ b/README
@@ -3541,7 +3541,7 @@ FIT uImage format:
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR,
CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS,
- CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION
+ CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
Address, size and partition on the MMC to load U-Boot from
when the MMC is being used in raw mode.
@@ -3558,16 +3558,19 @@ FIT uImage format:
CONFIG_SPL_FAT_SUPPORT
Support for fs/fat/libfat.o in SPL binary
- CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME
- Filename to read to load U-Boot when reading from FAT
+ CONFIG_SPL_EXT_SUPPORT
+ Support for EXT filesystem in SPL binary
- CONFIG_SPL_FAT_LOAD_KERNEL_NAME
+ CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
+ Filename to read to load U-Boot when reading from filesystem
+
+ CONFIG_SPL_FS_LOAD_KERNEL_NAME
Filename to read to load kernel uImage when reading
- from FAT (for Falcon mode)
+ from filesystem (for Falcon mode)
- CONFIG_SPL_FAT_LOAD_ARGS_NAME
+ CONFIG_SPL_FS_LOAD_ARGS_NAME
Filename to read to load kernel argument parameters
- when reading from FAT (for Falcon mode)
+ when reading from filesystem (for Falcon mode)
CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
Set this for NAND SPL on PPC mpc83xx targets, so that
diff --git a/doc/README.SPL b/doc/README.SPL
index c283dcf..3ba313c 100644
--- a/doc/README.SPL
+++ b/doc/README.SPL
@@ -54,6 +54,7 @@ CONFIG_SPL_SERIAL_SUPPORT (drivers/serial/libserial.o)
CONFIG_SPL_SPI_FLASH_SUPPORT (drivers/mtd/spi/libspi_flash.o)
CONFIG_SPL_SPI_SUPPORT (drivers/spi/libspi.o)
CONFIG_SPL_FAT_SUPPORT (fs/fat/libfat.o)
+CONFIG_SPL_EXT_SUPPORT
CONFIG_SPL_LIBGENERIC_SUPPORT (lib/libgeneric.o)
CONFIG_SPL_POWER_SUPPORT (drivers/power/libpower.o)
CONFIG_SPL_NAND_SUPPORT (drivers/mtd/nand/libnand.o)
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [U-Boot] [PATCH V2 4/5] spl: do not hang in spl_register_fat_device but return error value. It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT.
2014-10-15 15:53 ` [U-Boot] [PATCH V2 " Guillaume GARDET
` (2 preceding siblings ...)
2014-10-15 15:53 ` [U-Boot] [PATCH V2 3/5] doc: Update documentation according to the EXT SPL support patch set Guillaume GARDET
@ 2014-10-15 15:53 ` Guillaume GARDET
2014-10-27 22:21 ` [U-Boot] [U-Boot, V2, " Tom Rini
2014-10-15 15:53 ` [U-Boot] [PATCH V2 5/5] TI:OMAP4: enable EXT support in SPL for OMAP4 boards Guillaume GARDET
4 siblings, 1 reply; 21+ messages in thread
From: Guillaume GARDET @ 2014-10-15 15:53 UTC (permalink / raw)
To: u-boot
Do not hang in spl_register_fat_device but return an error value.
It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT.
If FAT load fails, then EXT load is tried.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@ti.com>
---
common/spl/spl_fat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 91481fc..350f7d9 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -30,7 +30,7 @@ static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition)
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: fat register err - %d\n", __func__, err);
#endif
- hang();
+ return err;
}
fat_registered = 1;
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread* [U-Boot] [PATCH V2 5/5] TI:OMAP4: enable EXT support in SPL for OMAP4 boards
2014-10-15 15:53 ` [U-Boot] [PATCH V2 " Guillaume GARDET
` (3 preceding siblings ...)
2014-10-15 15:53 ` [U-Boot] [PATCH V2 4/5] spl: do not hang in spl_register_fat_device but return error value. It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT Guillaume GARDET
@ 2014-10-15 15:53 ` Guillaume GARDET
2014-10-27 22:21 ` [U-Boot] [U-Boot, V2, " Tom Rini
4 siblings, 1 reply; 21+ messages in thread
From: Guillaume GARDET @ 2014-10-15 15:53 UTC (permalink / raw)
To: u-boot
Enable EXT support in SPL for OMAP4 boards.
Build tested for duovero, omap4_sdp4430 and omap4_panda.
Run time tested on omap4_panda.
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@ti.com>
---
include/configs/ti_omap4_common.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h
index b0f199e..1c93aab 100644
--- a/include/configs/ti_omap4_common.h
+++ b/include/configs/ti_omap4_common.h
@@ -167,6 +167,9 @@
#define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_SDRAM_BASE + \
(128 << 20))
+/* SPL: Allow to use an EXT partition */
+#define CONFIG_SPL_EXT_SUPPORT
+
#ifdef CONFIG_NAND
#define CONFIG_SPL_NAND_AM33XX_BCH /* ELM support */
#endif
--
1.8.4.5
^ permalink raw reply related [flat|nested] 21+ messages in thread