Skip to contentSkip to conversation

OMAP3: igep00x0: allow DeviceTree booting

PATCH New Javier Martinez Canillas 2 participants 7 messages Aug 7, 2013 – Aug 16, 2013

lore
Share & tools
lore
#0 lore raw

cover OMAP3: igep00x0: allow DeviceTree booting

Now that Device Tree support for IGEP boards has been included in the mainline Linux kernel, it's better if the default boot command has proper support for booting with DT.

This patch-set his composed of the following patches:

Enric Balletbo i Serra (1):

      ARM: igep00x0.h: Enable the use of CMD_EXT4, CMD_FS_GENERIC and zImage.

Javier Martinez Canillas (1):

      OMAP3: igep00x0: allow booting with a FDT from MMC

The first patch adds some improvements to igep00x0.h to support loading kernel images from ext{2,3,4} partitions besides FAT and using by default a zImage instead of a uImage now that multiplatform support has been added to OMAP.

The second patch adds support to boot using a FDT if is present in the /boot dir of the rootfs partition and fallback to legacy boot if is not present so users that have not migrated to DT can still use the default boot command.

Thanks a lot and best regards,
Javier

#1 lore raw

PATCH 1/2 ARM: igep00x0.h: Enable the use of CMD_EXT4, CMD_FS_GENERIC and zImage.

From: Enric Balletbo i Serra <[email protected]>

Able to load the kernel from some form of ext[234] or FAT. Also, with v3.9 and later of the Linux Kernel, uImage isn't builtable anymore by default, so we should switch to use the bootz command.

---
 include/configs/igep00x0.h |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
include/configs/igep00x0.h +7 -6
index c17267e..b3c57f4 100644
@@ -97,8 +97,9 @@
 #include <config_cmd_default.h>
 
 #define CONFIG_CMD_CACHE
-#define CONFIG_CMD_EXT2		/* EXT2 Support			*/
+#define CONFIG_CMD_EXT4
 #define CONFIG_CMD_FAT		/* FAT support			*/
+#define CONFIG_CMD_FS_GENERIC
 #define CONFIG_CMD_I2C		/* I2C serial bus support	*/
 #define CONFIG_CMD_MMC		/* MMC support			*/
 #ifdef CONFIG_BOOT_ONENAND
@@ -163,17 +164,17 @@
 		"omapdss.def_disp=${defaultdisplay} " \
 		"root=${nandroot} " \
 		"rootfstype=${nandrootfstype}\0" \
-	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
+	"loadbootenv=load mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
 	"importbootenv=echo Importing environment from mmc ...; " \
 		"env import -t $loadaddr $filesize\0" \
-	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+	"loadzimage=load mmc ${mmcdev} ${loadaddr} zImage\0" \
 	"mmcboot=echo Booting from mmc ...; " \
 		"run mmcargs; " \
-		"bootm ${loadaddr}\0" \
+		"bootz ${loadaddr}\0" \
 	"nandboot=echo Booting from onenand ...; " \
 		"run nandargs; " \
 		"onenand read ${loadaddr} 280000 400000; " \
-		"bootm ${loadaddr}\0" \
+		"bootz ${loadaddr}\0" \
 
 #define CONFIG_BOOTCOMMAND \
 	"mmc dev ${mmcdev}; if mmc rescan; then " \
@@ -185,7 +186,7 @@
 			"echo Running uenvcmd ...;" \
 			"run uenvcmd;" \
 		"fi;" \
-		"if run loaduimage; then " \
+		"if run loadzimage; then " \
 			"run mmcboot;" \
 		"fi;" \
 	"fi;" \
Signature · 1 line
1.7.7.6
#2 lore raw

PATCH 1/2 ARM: igep00x0.h: Enable the use of CMD_EXT4, CMD_FS_GENERIC and zImage.

Quoted 7 lines · Javier Martinez Canillas

From: Enric Balletbo i Serra <[email protected]>

Able to load the kernel from some form of ext[234] or FAT. Also, with v3.9 and later of the Linux Kernel, uImage isn't builtable anymore by default, so we should switch to use the bootz command.

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130816/c290f676/attachment.pgp>
#3 lore raw

PATCH 2/2 OMAP3: igep00x0: allow booting with a FDT from MMC

In reply to Javier Martinez Canillas

IGEP boards now have Device Tree support in the mainline kernel. To boot an IGEP board using a DT, a uEnv.txt plain text file could be used to define a custom uenvcmd that will be run by the default boot command.

It is more convenient to change the default boot command to allow loading a FDT if it is stored in the boot dir of the rootfs uSD/MMC partition.

If no FDT is found then the defaul command tries to boot a zImage without a DT using legacy boot.

---
 board/isee/igep00x0/igep00x0.c |   14 ++++++++++++++
 include/configs/igep00x0.h     |   13 ++++++++++++-
 2 files changed, 26 insertions(+), 1 deletions(-)
board/isee/igep00x0/igep00x0.c +14 -0
index 77a9bc6..7a7500b 100644
@@ -138,6 +138,18 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+void set_fdt(void)
+{
+	switch (gd->bd->bi_arch_number) {
+	case MACH_TYPE_IGEP0020:
+		setenv("dtbfile", "omap3-igep0020.dtb");
+		break;
+	case MACH_TYPE_IGEP0030:
+		setenv("dtbfile", "omap3-igep0030.dtb");
+		break;
+	}
+}
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -150,6 +162,8 @@ int misc_init_r(void)
 
 	dieid_num_r();
 
+	set_fdt();
+
 	return 0;
 }
 
include/configs/igep00x0.h +12 -1
index b3c57f4..13d58a4 100644
@@ -137,6 +137,9 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"usbtty=cdc_acm\0" \
 	"loadaddr=0x82000000\0" \
+	"dtbaddr=0x81600000\0" \
+	"bootdir=/boot\0" \
+	"bootfile=zImage\0" \
 	"usbtty=cdc_acm\0" \
 	"console=ttyO2,115200n8\0" \
 	"mpurate=auto\0" \
@@ -167,10 +170,13 @@
 	"loadbootenv=load mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
 	"importbootenv=echo Importing environment from mmc ...; " \
 		"env import -t $loadaddr $filesize\0" \
-	"loadzimage=load mmc ${mmcdev} ${loadaddr} zImage\0" \
+	"loadzimage=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}\0" \
+	"loadfdt=load mmc ${mmcdev}:2 ${dtbaddr} ${bootdir}/${dtbfile}\0" \
 	"mmcboot=echo Booting from mmc ...; " \
 		"run mmcargs; " \
 		"bootz ${loadaddr}\0" \
+	"mmcbootfdt=echo Booting with DT from mmc ...; " \
+		"bootz ${loadaddr} - ${dtbaddr}\0" \
 	"nandboot=echo Booting from onenand ...; " \
 		"run nandargs; " \
 		"onenand read ${loadaddr} 280000 400000; " \
@@ -187,6 +193,11 @@
 			"run uenvcmd;" \
 		"fi;" \
 		"if run loadzimage; then " \
+			"if test -n $dtbfile; then " \
+				"if run loadfdt; then " \
+					"run mmcbootfdt;" \
+				"fi;" \
+			"fi;" \
 			"run mmcboot;" \
 		"fi;" \
 	"fi;" \
Signature · 1 line
1.7.7.6
#4 lore raw

PATCH 2/2 OMAP3: igep00x0: allow booting with a FDT from MMC

Quoted 5 lines · Javier Martinez Canillas

IGEP boards now have Device Tree support in the mainline kernel. To boot an IGEP board using a DT, a uEnv.txt plain text file could be used to define a custom uenvcmd that will be run by the default boot command.

Quoted 8 lines

It is more convenient to change the default boot command to allow loading a FDT if it is stored in the boot dir of the rootfs uSD/MMC partition.

If no FDT is found then the defaul command tries to boot a zImage without a DT using legacy boot.

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130816/cfd2c066/attachment.pgp>
#5 lore raw

cover OMAP3: igep00x0: allow DeviceTree booting

In reply to Javier Martinez Canillas
Quoted 17 lines · Javier Martinez Canillas

Now that Device Tree support for IGEP boards has been included in the mainline Linux kernel, it's better if the default boot command has proper support for booting with DT.

This patch-set his composed of the following patches:

Enric Balletbo i Serra (1):

      ARM: igep00x0.h: Enable the use of CMD_EXT4, CMD_FS_GENERIC and zImage.

Javier Martinez Canillas (1):

      OMAP3: igep00x0: allow booting with a FDT from MMC

The first patch adds some improvements to igep00x0.h to support loading kernel images from ext{2,3,4} partitions besides FAT and using by default a zImage instead of a uImage now that multiplatform support has been added to OMAP.

Quoted 5 lines

The second patch adds support to boot using a FDT if is present in the /boot dir of the rootfs partition and fallback to legacy boot if is not present so users that have not migrated to DT can still use the default boot command.

Hi Tom,

Any comments on this patch-set?

Thanks a lot and best regards,
Javier

#6 lore raw

cover OMAP3: igep00x0: allow DeviceTree booting

Quoted 25 lines · Javier Martinez Canillas
Quoted 17 lines · Javier Martinez Canillas

Now that Device Tree support for IGEP boards has been included in the mainline Linux kernel, it's better if the default boot command has proper support for booting with DT.

This patch-set his composed of the following patches:

Enric Balletbo i Serra (1):

      ARM: igep00x0.h: Enable the use of CMD_EXT4, CMD_FS_GENERIC and zImage.

Javier Martinez Canillas (1):

      OMAP3: igep00x0: allow booting with a FDT from MMC

The first patch adds some improvements to igep00x0.h to support loading kernel images from ext{2,3,4} partitions besides FAT and using by default a zImage instead of a uImage now that multiplatform support has been added to OMAP.

Quoted 5 lines

The second patch adds support to boot using a FDT if is present in the /boot dir of the rootfs partition and fallback to legacy boot if is not present so users that have not migrated to DT can still use the default boot command.

Quoted 3 lines

Hi Tom,

Any comments on this patch-set?

Looks good, preparing another u-boot-ti pull request for soon now.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130813/94a95dc7/attachment.pgp>