mirror of
https://git.yoctoproject.org/meta-ti
synced 2026-05-07 11:59:49 +00:00
u-boot 2011.10rc: fix loading from /boot by adding ext4 support
This patchset was pulled from u-boot patchwork and aren't final, but testing on beaglebone shows it to work. Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Acked-by: Tom Rini <trini@ti.com> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
This commit is contained in:
committed by
Denys Dmytriyenko
parent
bb34e69f3d
commit
d686d9d676
@@ -0,0 +1,74 @@
|
||||
From 486ce56b1203dd71bad310940b321d3ae13cadec Mon Sep 17 00:00:00 2001
|
||||
From: u-boot@lakedaemon.net <u-boot@lakedaemon.net>
|
||||
Date: Wed, 28 Mar 2012 04:37:11 +0000
|
||||
Subject: [PATCH 11/15] ext2load: increase read speed
|
||||
|
||||
This patch dramatically drops the amount of time u-boot needs to read a
|
||||
file from an ext2 partition. On a typical 2 to 5 MB file (kernels and
|
||||
initrds) it goes from tens of seconds to a couple seconds.
|
||||
|
||||
All we are doing here is grouping contiguous blocks into one read.
|
||||
|
||||
Boot tested on Globalscale Technologies Dreamplug (Kirkwood ARM SoC)
|
||||
with three different files. sha1sums were calculated in Linux
|
||||
userspace, and then confirmed after ext2load.
|
||||
|
||||
Signed-off-by: Jason Cooper <u-boot@lakedaemon.net>
|
||||
---
|
||||
fs/ext2/ext2fs.c | 26 ++++++++++++++++++++++++--
|
||||
1 files changed, 24 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/fs/ext2/ext2fs.c b/fs/ext2/ext2fs.c
|
||||
index e119e13..8531db5 100644
|
||||
--- a/fs/ext2/ext2fs.c
|
||||
+++ b/fs/ext2/ext2fs.c
|
||||
@@ -414,7 +414,6 @@ int ext2fs_read_file
|
||||
if (blknr < 0) {
|
||||
return (-1);
|
||||
}
|
||||
- blknr = blknr << log2blocksize;
|
||||
|
||||
/* Last block. */
|
||||
if (i == blockcnt - 1) {
|
||||
@@ -432,6 +431,29 @@ int ext2fs_read_file
|
||||
blockend -= skipfirst;
|
||||
}
|
||||
|
||||
+ /* grab middle blocks in one go */
|
||||
+ if (i != pos / blocksize && i != blockcnt - 1 && blockcnt > 3) {
|
||||
+ int oldblk = blknr;
|
||||
+ int blocknxt;
|
||||
+ while (i < blockcnt - 1) {
|
||||
+ blocknxt = ext2fs_read_block(node, i + 1);
|
||||
+ if (blocknxt == (oldblk + 1)) {
|
||||
+ oldblk = blocknxt;
|
||||
+ i++;
|
||||
+ } else {
|
||||
+ blocknxt = ext2fs_read_block(node, i);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (oldblk == blknr)
|
||||
+ blockend = blocksize;
|
||||
+ else
|
||||
+ blockend = (1 + blocknxt - blknr) * blocksize;
|
||||
+ }
|
||||
+
|
||||
+ blknr = blknr << log2blocksize;
|
||||
+
|
||||
/* If the block number is 0 this block is not stored on disk but
|
||||
is zero filled instead. */
|
||||
if (blknr) {
|
||||
@@ -444,7 +466,7 @@ int ext2fs_read_file
|
||||
} else {
|
||||
memset (buf, 0, blocksize - skipfirst);
|
||||
}
|
||||
- buf += blocksize - skipfirst;
|
||||
+ buf += blockend - skipfirst;
|
||||
}
|
||||
return (len);
|
||||
}
|
||||
--
|
||||
1.7.2.5
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
From 6233c6274e86dad6bac240cf8703e0a0b3e14e27 Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen@dominion.thruhere.net>
|
||||
Date: Sun, 1 Apr 2012 22:57:37 +0200
|
||||
Subject: [PATCH 12/15] am335x-evm: fix ext2load and specify partition for both fatload and ext2load
|
||||
|
||||
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
|
||||
---
|
||||
include/configs/am335x_evm.h | 4 ++--
|
||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
|
||||
index 5a7e9a8..9a4b407 100755
|
||||
--- a/include/configs/am335x_evm.h
|
||||
+++ b/include/configs/am335x_evm.h
|
||||
@@ -74,8 +74,8 @@
|
||||
"loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}\0" \
|
||||
"importbootenv=echo Importing environment from mmc ...; " \
|
||||
"env import -t $loadaddr $filesize\0" \
|
||||
- "mmc_load_uimage=fatload mmc ${mmc_dev} 0x80007fc0 ${bootfile}\0" \
|
||||
- "mmc_load_uimage_ext2=ext2load ${mmc_dev} 0x80007fc0 /boot/${bootfile}\0" \
|
||||
+ "mmc_load_uimage=fatload mmc ${mmc_dev}:1 0x80007fc0 ${bootfile}\0" \
|
||||
+ "mmc_load_uimage_ext2=ext2load mmc ${mmc_dev}:2 0x80007fc0 /boot/${bootfile}\0" \
|
||||
"optargs=\0" \
|
||||
"bootargs_defaults=setenv bootargs " \
|
||||
"console=${console} " \
|
||||
--
|
||||
1.7.2.5
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
From 4c7580268803485ecbc05c3da3e1bbb9f2f431e0 Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen@dominion.thruhere.net>
|
||||
Date: Sun, 1 Apr 2012 23:10:22 +0200
|
||||
Subject: [PATCH 13/15] am335x-evm: load uImage from /boot instead of VFAT
|
||||
|
||||
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
|
||||
---
|
||||
include/configs/am335x_evm.h | 4 ++--
|
||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
|
||||
index 9a4b407..b2628c5 100755
|
||||
--- a/include/configs/am335x_evm.h
|
||||
+++ b/include/configs/am335x_evm.h
|
||||
@@ -102,7 +102,7 @@
|
||||
"nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
|
||||
"ip=dhcp\0" \
|
||||
"mmc_boot=run mmc_args; " \
|
||||
- "run mmc_load_uimage; " \
|
||||
+ "run mmc_load_uimage_ext2; " \
|
||||
"bootm 0x80007fc0\0" \
|
||||
"nand_boot=echo Booting from nand ...; " \
|
||||
"run nand_args; " \
|
||||
@@ -136,7 +136,7 @@
|
||||
"echo Running uenvcmd ...;" \
|
||||
"run uenvcmd;" \
|
||||
"fi;" \
|
||||
- "if run mmc_load_uimage; then " \
|
||||
+ "if run mmc_load_uimage_ext2; then " \
|
||||
"run mmc_args;" \
|
||||
"bootm 0x80007fc0;" \
|
||||
"fi;" \
|
||||
--
|
||||
1.7.2.5
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,51 @@
|
||||
From 89f08384d5048059ac0a8ab72b6a7a194513dc64 Mon Sep 17 00:00:00 2001
|
||||
From: Koen Kooi <koen@dominion.thruhere.net>
|
||||
Date: Wed, 4 Apr 2012 00:06:31 +0200
|
||||
Subject: [PATCH 15/15] am335x: switch to ext4 mode
|
||||
|
||||
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
|
||||
---
|
||||
include/configs/am335x_evm.h | 6 ++++--
|
||||
1 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
|
||||
index b2628c5..18d2cac 100755
|
||||
--- a/include/configs/am335x_evm.h
|
||||
+++ b/include/configs/am335x_evm.h
|
||||
@@ -76,6 +76,7 @@
|
||||
"env import -t $loadaddr $filesize\0" \
|
||||
"mmc_load_uimage=fatload mmc ${mmc_dev}:1 0x80007fc0 ${bootfile}\0" \
|
||||
"mmc_load_uimage_ext2=ext2load mmc ${mmc_dev}:2 0x80007fc0 /boot/${bootfile}\0" \
|
||||
+ "mmc_load_uimage_ext4=ext4load mmc ${mmc_dev}:2 0x80007fc0 /boot/${bootfile}\0" \
|
||||
"optargs=\0" \
|
||||
"bootargs_defaults=setenv bootargs " \
|
||||
"console=${console} " \
|
||||
@@ -102,7 +103,7 @@
|
||||
"nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
|
||||
"ip=dhcp\0" \
|
||||
"mmc_boot=run mmc_args; " \
|
||||
- "run mmc_load_uimage_ext2; " \
|
||||
+ "run mmc_load_uimage_ext4; " \
|
||||
"bootm 0x80007fc0\0" \
|
||||
"nand_boot=echo Booting from nand ...; " \
|
||||
"run nand_args; " \
|
||||
@@ -136,7 +137,7 @@
|
||||
"echo Running uenvcmd ...;" \
|
||||
"run uenvcmd;" \
|
||||
"fi;" \
|
||||
- "if run mmc_load_uimage_ext2; then " \
|
||||
+ "if run mmc_load_uimage_ext4; then " \
|
||||
"run mmc_args;" \
|
||||
"bootm 0x80007fc0;" \
|
||||
"fi;" \
|
||||
@@ -404,6 +405,7 @@
|
||||
#define CONFIG_DOS_PARTITION
|
||||
#define CONFIG_CMD_FAT
|
||||
#define CONFIG_CMD_EXT2
|
||||
+#define CONFIG_CMD_EXT4
|
||||
#endif
|
||||
|
||||
/* Unsupported features */
|
||||
--
|
||||
1.7.2.5
|
||||
|
||||
@@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "(ti33x)"
|
||||
DEFAULT_PREFERENCE_ti33x = "99"
|
||||
|
||||
PV = "2011.09+git"
|
||||
PR = "r26"
|
||||
PR = "r27"
|
||||
|
||||
# SPL build
|
||||
UBOOT_BINARY = "u-boot.img"
|
||||
@@ -24,6 +24,11 @@ SRC_URI = "git://arago-project.org/git/projects/u-boot-am33x.git;protocol=git;br
|
||||
file://2011.09git/0008-HACK-am335x-evm-turn-d-cache-on-globally-turn-it-off.patch \
|
||||
file://2011.09git/0009-am335x-evm-enable-i2c2-pinmux-for-beaglebone.patch \
|
||||
file://2011.09git/0001-ddr_defs-change-DDR-timings-for-15x15-EVM.patch \
|
||||
file://2011.09git/0011-ext2load-increase-read-speed.patch \
|
||||
file://2011.09git/0012-am335x-evm-fix-ext2load-and-specify-partition-for-bo.patch \
|
||||
file://2011.09git/0013-am335x-evm-load-uImage-from-boot-instead-of-VFAT.patch \
|
||||
file://2011.09git/0014-ext4fs-ls-load-support.patch \
|
||||
file://2011.09git/0015-am335x-switch-to-ext4-mode.patch \
|
||||
"
|
||||
|
||||
SRCREV = "f63b270e47f62f4d1a05b2001357e215966c6f5a"
|
||||
|
||||
Reference in New Issue
Block a user