[uboot-tools] add patches to support ext filesystems in exynos and omap SPL's
Dennis Gilmore
ausil at fedoraproject.org
Wed Jun 5 18:50:13 UTC 2013
commit 1669bbd6e5b8e15b97746eadd32475accd757d83
Author: Dennis Gilmore <dennis at ausil.us>
Date: Wed Jun 5 13:50:04 2013 -0500
add patches to support ext filesystems in exynos and omap SPL's
- drop bringing in arm-boot-config on arm systems
- build a highbank u-boot (intention is to use in qemu)
exynos-ext.patch | 54 +++++++++++++++++++
mlo-ext.patch | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
uboot-tools.spec | 35 +++++++++++--
3 files changed, 242 insertions(+), 4 deletions(-)
---
diff --git a/exynos-ext.patch b/exynos-ext.patch
new file mode 100644
index 0000000..5f725a5
--- /dev/null
+++ b/exynos-ext.patch
@@ -0,0 +1,54 @@
+Index: u-boot-2013.04rc2/include/configs/origen.h
+===================================================================
+--- u-boot-2013.04rc2.orig/include/configs/origen.h
++++ u-boot-2013.04rc2/include/configs/origen.h
+@@ -87,8 +87,11 @@
+ #define CONFIG_CMD_DHCP
+ #define CONFIG_CMD_MMC
+ #define CONFIG_CMD_FAT
++#define CONFIG_CMD_EXT2 /* EXT2 Support */
+ #undef CONFIG_CMD_NET
+ #undef CONFIG_CMD_NFS
++#define CONFIG_CMD_BOOTZ /* bootz zImage support */
++#define CONFIG_SUPPORT_RAW_INITRD /* bootz raw initrd support */
+
+ #define CONFIG_BOOTDELAY 3
+ #define CONFIG_ZERO_BOOTDELAY_CHECK
+@@ -96,7 +99,35 @@
+ #define CONFIG_SPL
+ #define COPY_BL2_FNPTR_ADDR 0x02020030
+
+-#define CONFIG_BOOTCOMMAND "fatload mmc 0 40007000 uImage; bootm 40007000"
++#define CONFIG_EXTRA_ENV_SETTINGS \
++ "loadaddr=0x40007000\0" \
++ "rdaddr=0x48000000\0" \
++ "kerneladdr=0x40007000\0" \
++ "ramdiskaddr=0x48000000\0" \
++ "console=ttySAC2,115200n8\0" \
++ "mmcdev=0\0" \
++ "bootenv=uEnv.txt\0" \
++ "loadbootenv=ext2load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
++ "importbootenv=echo Importing environment from mmc ...; " \
++ "env import -t $loadaddr $filesize\0" \
++ "loadbootscript=ext2load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
++ "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
++ "source ${loadaddr}\0"
++#define CONFIG_BOOTCOMMAND \
++ "if mmc rescan; then " \
++ "echo SD/MMC found on device ${mmcdev};" \
++ "if run loadbootenv; then " \
++ "echo Loaded environment from ${bootenv};" \
++ "run importbootenv;" \
++ "fi;" \
++ "if test -n $uenvcmd; then " \
++ "echo Running uenvcmd ...;" \
++ "run uenvcmd;" \
++ "fi;" \
++ "if run loadbootscript; then " \
++ "run bootscript; " \
++ "fi; " \
++ "fi;"
+
+ /* Miscellaneous configurable options */
+ #define CONFIG_SYS_LONGHELP /* undef to save memory */
+
diff --git a/mlo-ext.patch b/mlo-ext.patch
new file mode 100644
index 0000000..b1204eb
--- /dev/null
+++ b/mlo-ext.patch
@@ -0,0 +1,157 @@
+Index: u-boot-2013.04/drivers/mmc/spl_mmc.c
+===================================================================
+--- u-boot-2013.04.orig/drivers/mmc/spl_mmc.c
++++ u-boot-2013.04/drivers/mmc/spl_mmc.c
+@@ -67,6 +67,59 @@ end:
+ }
+
+ #ifdef CONFIG_SPL_FAT_SUPPORT
++static void mmc_load_image_ext2(struct mmc *mmc)
++{
++ s32 err;
++ struct image_header *header;
++ char *payloadname;
++ int filelen;
++ disk_partition_t part_info = {};
++
++ header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
++ sizeof(struct image_header));
++
++ if (get_partition_info(&mmc->block_dev,
++ CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION, &part_info)) {
++ printf("spl: no partition table found\n");
++ hang();
++ }
++
++ err = ext4fs_set_blk_dev(&mmc->block_dev, &part_info);
++ if (!err) {
++ printf("spl: ext4fs register err - %d\n", err);
++ hang();
++ }
++
++ err = ext4fs_mount(0);
++ if (!err) {
++ printf("spl: ext4fs mount err - %d\n", err);
++ hang();
++ }
++
++
++ payloadname = "u-boot.img";
++
++ filelen = err = ext4fs_open(payloadname);
++ if (err < 0) {
++ goto end;
++ }
++ err = ext4fs_read((u8 *)header, sizeof(struct image_header));
++ if (err <= 0) {
++ goto end;
++ }
++
++ spl_parse_image_header(header);
++
++ err = ext4fs_read((u8 *)spl_image.load_addr, filelen);
++
++end:
++ if (err <= 0) {
++ printf("spl: error reading image %s, err - %d\n",
++ payloadname, err);
++ hang();
++ }
++}
++
+ static void mmc_load_image_fat(struct mmc *mmc)
+ {
+ s32 err;
+@@ -127,7 +180,8 @@ void spl_mmc_load_image(void)
+ #ifdef CONFIG_SPL_FAT_SUPPORT
+ } else if (boot_mode == MMCSD_MODE_FAT) {
+ debug("boot mode - FAT\n");
+- mmc_load_image_fat(mmc);
++// mmc_load_image_fat(mmc);
++ mmc_load_image_ext2(mmc);
+ #endif
+ } else {
+ puts("spl: wrong MMC boot mode\n");
+Index: u-boot-2013.04/include/configs/omap3_beagle.h
+===================================================================
+--- u-boot-2013.04.orig/include/configs/omap3_beagle.h
++++ u-boot-2013.04/include/configs/omap3_beagle.h
+@@ -55,6 +55,7 @@
+
+ #define CONFIG_OF_LIBFDT
+ #define CONFIG_CMD_BOOTZ
++#define CONFIG_SUPPORT_RAW_INITRD /* bootz raw initrd support */
+
+ #define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
+ #define CONFIG_SETUP_MEMORY_TAGS 1
+@@ -255,7 +256,7 @@
+ "root=${nandroot} " \
+ "rootfstype=${nandrootfstype}\0" \
+ "bootenv=uEnv.txt\0" \
+- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
++ "loadbootenv=ext2load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+ "importbootenv=echo Importing environment from mmc ...; " \
+ "env import -t $loadaddr $filesize\0" \
+ "ramargs=setenv bootargs console=${console} " \
+@@ -267,8 +268,8 @@
+ "omapdss.def_disp=${defaultdisplay} " \
+ "root=${ramroot} " \
+ "rootfstype=${ramrootfstype}\0" \
+- "loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
+- "loaduimagefat=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
++ "loadramdisk=ext2load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
++ "loaduimagefat=ext2load mmc ${mmcdev} ${loadaddr} uImage\0" \
+ "loaduimage=ext2load mmc ${mmcdev}:2 ${loadaddr} /boot/uImage\0" \
+ "mmcboot=echo Booting from mmc ...; " \
+ "run mmcargs; " \
+Index: u-boot-2013.04/include/configs/omap4_common.h
+===================================================================
+--- u-boot-2013.04.orig/include/configs/omap4_common.h
++++ u-boot-2013.04/include/configs/omap4_common.h
+@@ -126,6 +126,7 @@
+ #define CONFIG_CMD_FAT /* FAT support */
+ #define CONFIG_CMD_I2C /* I2C serial bus support */
+ #define CONFIG_CMD_MMC /* MMC support */
++#define CONFIG_SUPPORT_RAW_INITRD /* bootz raw initrd support */
+
+ /* Disabled commands */
+ #undef CONFIG_CMD_NET
+@@ -162,10 +163,10 @@
+ "vram=${vram} " \
+ "root=${mmcroot} " \
+ "rootfstype=${mmcrootfstype}\0" \
+- "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
++ "loadbootscript=ext2load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+ "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
+ "source ${loadaddr}\0" \
+- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
++ "loadbootenv=ext2load mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
+ "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
+ "env import -t ${loadaddr} ${filesize}\0" \
+ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+Index: u-boot-2013.04/spl/Makefile
+===================================================================
+--- u-boot-2013.04.orig/spl/Makefile
++++ u-boot-2013.04/spl/Makefile
+@@ -72,6 +72,7 @@ LIBS-$(CONFIG_SPL_SERIAL_SUPPORT) += dri
+ LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/libspi_flash.o
+ LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o
+ LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/libfat.o
++LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/ext4/libext4fs.o
+ LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/libgeneric.o
+ LIBS-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/libpower.o
+ LIBS-$(CONFIG_SPL_NAND_SUPPORT) += drivers/mtd/nand/libnand.o
+Index: u-boot-2013.04/arch/arm/cpu/armv7/omap3/board.c
+===================================================================
+--- u-boot-2013.04.orig/arch/arm/cpu/armv7/omap3/board.c
++++ u-boot-2013.04/arch/arm/cpu/armv7/omap3/board.c
+@@ -77,6 +77,8 @@ u32 omap3_boot_device = BOOT_DEVICE_NAND
+ /* auto boot mode detection is not possible for OMAP3 - hard code */
+ u32 spl_boot_mode(void)
+ {
++ return MMCSD_MODE_FAT;
++
+ switch (spl_boot_device()) {
+ case BOOT_DEVICE_MMC2:
+ return MMCSD_MODE_RAW;
+
diff --git a/uboot-tools.spec b/uboot-tools.spec
index 59ae094..591c361 100644
--- a/uboot-tools.spec
+++ b/uboot-tools.spec
@@ -2,7 +2,7 @@
Name: uboot-tools
Version: 2013.04
-Release: 4%{?candidate:.%{candidate}}%{?dist}
+Release: 5%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
Group: Development/Tools
@@ -18,6 +18,8 @@ Source6: uEnv.txt.panda_es
Source7: uEnv.txt.uevm
Patch1: u-boot-fat.patch
Patch2: uboot-omap-fit.patch
+Patch3: mlo-ext.patch
+Patch4: exynos-ext.patch
# Beagle Bone Black support
Patch10: 0001-beaglebone-default-to-beaglebone-black-for-unknown-E.patch
@@ -36,9 +38,6 @@ Patch22: 0013-beaglebone-enable-CONFIG_SUPPORT_RAW_INITRD-option.patch
Patch23: 0014-mmc-Add-RSTN-enable-for-emmc.patch
Requires: dtc
-%ifarch %{arm}
-Requires: arm-boot-config
-%endif
# build the tool for manipulation with environment only on arm
%ifarch %{arm}
@@ -64,6 +63,14 @@ Requires: uboot-tools
%description -n uboot-beaglebone
u-boot bootloader binaries for beaglebone
+%package -n uboot-highbank
+Summary: u-boot bootloader binaries for calxeda highbank
+Requires: uboot-tools
+BuildArch: noarch
+
+%description -n uboot-highbank
+u-boot bootloader binaries for calxeda highbank
+
%package -n uboot-panda
Summary: u-boot bootloader binaries for pandaboard
Requires: uboot-tools
@@ -119,6 +126,8 @@ u-boot bootloader binaries for vexpress
%setup -q -n u-boot-%{version}%{?candidate:-%{candidate}}
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
# Beagle Bone Black support
%patch10 -p1
@@ -159,6 +168,11 @@ cp -p u-boot.img builds/u-boot.img.beagle
cp -p u-boot.bin builds/u-boot.bin.beagle
make distclean
+make CROSS_COMPILE="" highbank_config
+make HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE=""
+cp -p u-boot.bin builds/u-boot.bin.highbank
+make distclean
+
make CROSS_COMPILE="" omap4_panda_config
make HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE=""
cp -p MLO builds/MLO.panda
@@ -214,6 +228,7 @@ mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot-panda/
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot-beagle/
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot-beaglebone/
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot-highbank/
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot-origen/
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot-smdkv310/
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot-imx6dl/
@@ -228,6 +243,8 @@ install -p -m 0644 builds/u-boot.img.$(echo $board) $RPM_BUILD_ROOT%{_datadir}/u
install -p -m 0644 builds/MLO.$(echo $board) $RPM_BUILD_ROOT%{_datadir}/uboot-$(echo $board)/MLO
done
+install -p -m 0644 builds/u-boot.bin.highbank $RPM_BUILD_ROOT%{_datadir}/uboot-highbank/u-boot.bin
+
install -p -m 0644 builds/origen-spl.bin.origen $RPM_BUILD_ROOT%{_datadir}/uboot-origen/origen-spl.bin
install -p -m 0644 builds/u-boot.bin.origen $RPM_BUILD_ROOT%{_datadir}/uboot-origen/u-boot.bin
@@ -238,6 +255,7 @@ install -p -m 0644 builds/u-boot.imx.dl $RPM_BUILD_ROOT%{_datadir}/uboot-imx6dl/
install -p -m 0644 builds/u-boot.imx.solo $RPM_BUILD_ROOT%{_datadir}/uboot-imx6solo/u-boot.bin
install -p -m 0644 builds/u-boot.bin.vexpress $RPM_BUILD_ROOT%{_datadir}/uboot-vexpress/u-boot.bin
+
install -p -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/uboot-beagle/uEnv.txt.beagle
install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/uboot-beaglebone/uEnv.txt.beaglebone
install -p -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/uboot-beagle/uEnv.txt.beagle_xm
@@ -280,6 +298,10 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%{_datadir}/uboot-beagle/
+%files -n uboot-highbank
+%defattr(-,root,root,-)
+%{_datadir}/uboot-highbank/
+
%files -n uboot-panda
%defattr(-,root,root,-)
%{_datadir}/uboot-panda/
@@ -310,6 +332,11 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
+* Wed Jun 05 2013 Dennis Gilmore <dennis at ausil.us> - 2013.04-5
+- add patches to support ext filesystems in exynos and omap SPL's
+- drop bringing in arm-boot-config on arm systems
+- build a highbank u-boot (intention is to use in qemu)
+
* Wed May 22 2013 Dennis Gilmore <dennis at ausil.us> - 2013.04-4
- build vexpress image
- add uEnv.txt files for various supported omap systems
More information about the scm-commits
mailing list