-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Robert Nelson <[email protected]>
- Loading branch information
1 parent
0edeafe
commit bc105b1
Showing
2 changed files
with
242 additions
and
0 deletions.
There are no files selected for viewing
186 changes: 186 additions & 0 deletions
186
v2015.01-rc4/0001-beagle_x15-uEnv.txt-bootz-n-fixes.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
From b8af042e873f73d9ccc78302f11a0cf7542e04d3 Mon Sep 17 00:00:00 2001 | ||
From: Robert Nelson <[email protected]> | ||
Date: Mon, 8 Dec 2014 19:22:08 -0600 | ||
Subject: [PATCH] beagle_x15: uEnv.txt, bootz, n fixes | ||
|
||
Signed-off-by: Robert Nelson <[email protected]> | ||
--- | ||
include/configs/ti_omap5_common.h | 133 +++++++++++++++++++++++++++++++------- | ||
1 file changed, 108 insertions(+), 25 deletions(-) | ||
|
||
diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h | ||
index c47651d..78043c2 100644 | ||
--- a/include/configs/ti_omap5_common.h | ||
+++ b/include/configs/ti_omap5_common.h | ||
@@ -70,45 +70,66 @@ | ||
DEFAULT_LINUX_BOOT_ENV \ | ||
"console=" CONSOLEDEV ",115200n8\0" \ | ||
"fdtfile=undefined\0" \ | ||
- "bootpart=0:2\0" \ | ||
- "bootdir=/boot\0" \ | ||
+ "bootpart=0:1\0" \ | ||
+ "bootdir=\0" \ | ||
"bootfile=zImage\0" \ | ||
+ "fdtdir=/dtbs\0" \ | ||
"usbtty=cdc_acm\0" \ | ||
"vram=16M\0" \ | ||
"partitions=" PARTS_DEFAULT "\0" \ | ||
"optargs=\0" \ | ||
"mmcdev=0\0" \ | ||
- "mmcroot=/dev/mmcblk0p2 rw\0" \ | ||
- "mmcrootfstype=ext4 rootwait\0" \ | ||
+ "mmcroot=/dev/mmcblk0p2 ro\0" \ | ||
+ "mmcrootfstype=ext4 rootwait fixrtc\0" \ | ||
"mmcargs=setenv bootargs console=${console} " \ | ||
"${optargs} " \ | ||
- "vram=${vram} " \ | ||
"root=${mmcroot} " \ | ||
- "rootfstype=${mmcrootfstype}\0" \ | ||
- "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \ | ||
+ "rootfstype=${mmcrootfstype} " \ | ||
+ "${cmdline}\0" \ | ||
+ "loadbootscript=load mmc ${bootpart} ${loadaddr} boot.scr\0" \ | ||
"bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ | ||
"source ${loadaddr}\0" \ | ||
- "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \ | ||
+ "loadbootenv=load mmc ${bootpart} ${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" \ | ||
+ "loadrd=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \ | ||
+ "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \ | ||
"mmcboot=mmc dev ${mmcdev}; " \ | ||
"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 loadimage; then " \ | ||
- "run loadfdt; " \ | ||
- "echo Booting from mmc${mmcdev} ...; " \ | ||
- "run mmcargs; " \ | ||
- "bootz ${loadaddr} - ${fdtaddr}; " \ | ||
- "fi;" \ | ||
+ "setenv bootpart ${mmcdev}:1; " \ | ||
+ "echo Checking for: /uEnv.txt ...;" \ | ||
+ "if test -e mmc ${bootpart} /uEnv.txt; then " \ | ||
+ "load mmc ${bootpart} ${loadaddr} /uEnv.txt;" \ | ||
+ "env import -t ${loadaddr} ${filesize};" \ | ||
+ "echo Loaded environment from /uEnv.txt;" \ | ||
+ "echo Checking if uenvcmd is set ...;" \ | ||
+ "if test -n ${uenvcmd}; then " \ | ||
+ "echo Running uenvcmd ...;" \ | ||
+ "run uenvcmd;" \ | ||
+ "fi;" \ | ||
+ "fi; " \ | ||
+ "echo Checking for: /boot/uEnv.txt ...;" \ | ||
+ "for i in 1 2 3 4 5 6 7 ; do " \ | ||
+ "setenv mmcpart ${i};" \ | ||
+ "setenv bootpart ${mmcdev}:${mmcpart};" \ | ||
+ "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \ | ||
+ "load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \ | ||
+ "env import -t ${loadaddr} ${filesize};" \ | ||
+ "echo Loaded environment from /boot/uEnv.txt;" \ | ||
+ "if test -n ${dtb}; then " \ | ||
+ "setenv fdtfile ${dtb};" \ | ||
+ "echo Using: dtb=${fdtfile} ...;" \ | ||
+ "fi;" \ | ||
+ "echo Checking if uname_r is set in /boot/uEnv.txt...;" \ | ||
+ "if test -n ${uname_r}; then " \ | ||
+ "echo Running uname_boot ...;" \ | ||
+ "setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart} ro;" \ | ||
+ "run uname_boot;" \ | ||
+ "fi;" \ | ||
+ "fi;" \ | ||
+ "done;" \ | ||
"fi;\0" \ | ||
"findfdt="\ | ||
"if test $board_name = omap5_uevm; then " \ | ||
@@ -121,14 +142,76 @@ | ||
"setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ | ||
"if test $fdtfile = undefined; then " \ | ||
"echo WARNING: Could not determine device tree to use; fi; \0" \ | ||
- "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile};\0" \ | ||
+ "uname_boot="\ | ||
+ "setenv bootdir /boot; " \ | ||
+ "setenv bootfile vmlinuz-${uname_r}; " \ | ||
+ "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \ | ||
+ "echo loading ${bootdir}/${bootfile} ...; "\ | ||
+ "run loadimage;" \ | ||
+ "setenv fdtdir /boot/dtbs/${uname_r}; " \ | ||
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \ | ||
+ "run loadfdt;" \ | ||
+ "else " \ | ||
+ "setenv fdtdir /usr/lib/linux-image-${uname_r}; " \ | ||
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \ | ||
+ "run loadfdt;" \ | ||
+ "else " \ | ||
+ "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \ | ||
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \ | ||
+ "run loadfdt;" \ | ||
+ "else " \ | ||
+ "setenv fdtdir /boot/dtb-${uname_r}; " \ | ||
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \ | ||
+ "run loadfdt;" \ | ||
+ "else " \ | ||
+ "setenv fdtdir /boot/dtbs; " \ | ||
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \ | ||
+ "run loadfdt;" \ | ||
+ "else " \ | ||
+ "setenv fdtdir /boot/dtb; " \ | ||
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \ | ||
+ "run loadfdt;" \ | ||
+ "else " \ | ||
+ "setenv fdtdir /boot; " \ | ||
+ "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \ | ||
+ "run loadfdt;" \ | ||
+ "else " \ | ||
+ "echo; echo unable to find ${fdtfile} ...; echo booting legacy ...;"\ | ||
+ "run mmcargs;" \ | ||
+ "echo debug: [${bootargs}] ... ;" \ | ||
+ "echo debug: [bootz ${loadaddr}] ... ;" \ | ||
+ "bootz ${loadaddr}; " \ | ||
+ "fi;" \ | ||
+ "fi;" \ | ||
+ "fi;" \ | ||
+ "fi;" \ | ||
+ "fi;" \ | ||
+ "fi;" \ | ||
+ "fi; " \ | ||
+ "setenv rdfile initrd.img-${uname_r}; " \ | ||
+ "if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \ | ||
+ "echo loading ${bootdir}/${rdfile} ...; "\ | ||
+ "run loadrd;" \ | ||
+ "if test -n ${uuid}; then " \ | ||
+ "setenv mmcroot UUID=${uuid} ro;" \ | ||
+ "fi;" \ | ||
+ "run mmcargs;" \ | ||
+ "echo debug: [${bootargs}] ... ;" \ | ||
+ "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}] ... ;" \ | ||
+ "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \ | ||
+ "else " \ | ||
+ "run mmcargs;" \ | ||
+ "echo debug: [${bootargs}] ... ;" \ | ||
+ "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \ | ||
+ "bootz ${loadaddr} - ${fdtaddr}; " \ | ||
+ "fi;" \ | ||
+ "fi;\0" \ | ||
|
||
#define CONFIG_BOOTCOMMAND \ | ||
"run findfdt; " \ | ||
+ "setenv mmcdev 0; " \ | ||
"run mmcboot;" \ | ||
"setenv mmcdev 1; " \ | ||
- "setenv bootpart 1:2; " \ | ||
- "setenv mmcroot /dev/mmcblk0p2 rw; " \ | ||
"run mmcboot;" \ | ||
|
||
|
||
-- | ||
2.1.3 | ||
|
56 changes: 56 additions & 0 deletions
56
v2015.01-rc4/0001-spl-mmc-Fix-raw-boot-mode-related-to-commit-4c5bbc23.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
From 3c629b672d50e178249e8bc2e0e978972d0fdb58 Mon Sep 17 00:00:00 2001 | ||
From: Guillaume GARDET <[email protected]> | ||
Date: Tue, 16 Dec 2014 12:00:44 +0100 | ||
Subject: [PATCH] spl: mmc: Fix raw boot mode (related to commit | ||
4c5bbc2328a24f5e1ee990c9a9527e48e5fb3b5f) | ||
|
||
As reported by Robert Nelson, commit 4c5bbc2328a24f5e1ee990c9a9527e48e5fb3b5f | ||
may break MMC RAW boot mode. | ||
This patch fixes the check path to fix MMC Raw boot mode. | ||
|
||
Tested raw boot mode and FS boot mode on a pandaboard (rev. A3). | ||
|
||
Reported-by: Robert Nelson <[email protected]> | ||
Signed-off-by: Guillaume GARDET <[email protected]> | ||
|
||
Cc: Tom Rini <[email protected]> | ||
Cc: Robert Nelson <[email protected]> | ||
--- | ||
common/spl/spl_mmc.c | 19 ++++++++++++++++--- | ||
1 file changed, 16 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c | ||
index 7bae16b..c2e596b 100644 | ||
--- a/common/spl/spl_mmc.c | ||
+++ b/common/spl/spl_mmc.c | ||
@@ -172,11 +172,24 @@ void spl_mmc_load_image(void) | ||
err = mmc_load_image_raw_sector(mmc, | ||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); | ||
#endif | ||
- } else { | ||
+ } | ||
+ | ||
+ switch(boot_mode){ | ||
+ case MMCSD_MODE_RAW: | ||
+#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT) | ||
+ case MMCSD_MODE_FS: | ||
+#endif | ||
+#ifdef CONFIG_SUPPORT_EMMC_BOOT | ||
+ case MMCSD_MODE_EMMCBOOT: | ||
+#endif | ||
+ /* Boot mode is ok. Nothing to do. */ | ||
+ break; | ||
+ case MMCSD_MODE_UNDEFINED: | ||
+ default: | ||
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT | ||
- puts("spl: wrong MMC boot mode\n"); | ||
+ puts("spl: wrong MMC boot mode\n"); | ||
#endif | ||
- hang(); | ||
+ hang(); | ||
} | ||
|
||
if (err) | ||
-- | ||
2.1.3 | ||
|