uboot: updating the default uboot to 2012.07

This is what I use in the sheevplug, with the provided patches.
The old sheevaplug uboot doesn't understand ubifs.
This commit is contained in:
Lluis Batlle 2013-01-27 15:27:54 +01:00
parent 83366b484f
commit 0353c08d38
3 changed files with 1160 additions and 3 deletions

View File

@ -20,11 +20,11 @@ let
in
stdenv.mkDerivation {
name = "uboot-2009.11";
name = "uboot-2012.07";
src = fetchurl {
url = "ftp://ftp.denx.de/pub/u-boot/u-boot-2009.11.tar.bz2";
sha256 = "1rld7q3ww89si84g80hqskd1z995lni5r5xc4d4322n99wqiarh6";
url = "ftp://ftp.denx.de/pub/u-boot/u-boot-2012.07.tar.bz2";
sha256 = "15nli6h9a127ldizsck3g4ysy5j4m910wawspgpadz4vjyk213p0";
};
buildNativeInputs = [ unzip ];
@ -40,6 +40,15 @@ stdenv.mkDerivation {
cp tools/{envcrc,mkimage} $out/bin
'';
# They have 'errno.h' included by a "-idirafter". As the gcc
# wrappers add the glibc include as "-idirafter", the only way
# we can make the glibc take priority is to -include errno.h.
postPatch = if stdenv ? glibc && stdenv.glibc != null then ''
sed -i 's,$(HOSTCPPFLAGS),-include ${stdenv.glibc}/include/errno.h $(HOSTCPPFLAGS),' config.mk
'' else "";
patches = [ ./sheevaplug-sdio.patch ./sheevaplug-config.patch ];
configurePhase =
assert platform ? uboot && platform.uboot != null;
assert (platform ? ubootConfig);

View File

@ -0,0 +1,57 @@
diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 7c8497c..b0da1e5 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -50,7 +50,6 @@
#define CONFIG_CMD_MII
#define CONFIG_CMD_MMC
#define CONFIG_CMD_NAND
-#define CONFIG_JFFS2_NAND
#define CONFIG_CMD_PING
#define CONFIG_CMD_USB
/*
@@ -73,25 +72,36 @@
* it has to be rounded to sector size
*/
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
-#define CONFIG_ENV_ADDR 0xa0000
-#define CONFIG_ENV_OFFSET 0xa0000 /* env starts here */
+#define CONFIG_ENV_ADDR 0x60000
+#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */
/*
* Default environment variables
*/
-#define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \
+#define CONFIG_BOOTCOMMAND "${x_bootcmd_ubi0}; " \
+ "${x_bootcmd_ubi1}; " \
+ "${x_bootcmd_ubi2}; " \
+ "${x_bootcmd_ubi3}; " \
"setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \
- "${x_bootcmd_usb}; bootm 0x6400000;"
+ "${x_bootcmd_usb}; bootm 0x200000 0x1100000;"
#define CONFIG_MTDPARTS "orion_nand:512k(uboot)," \
- "0x1ff00000@512k(rootfs) rw\0"
+ "0x1ff00000@512k(rootfs)\0"
+#define CONFIG_MTDPARTSK "orion_nand:512k(uboot)," \
+ "0x1ff00000@512k(rootfs)rw\0"
#define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console" \
- "=ttyS0,115200 mtdparts="CONFIG_MTDPARTS \
+ "=ttyS0,115200 mtdparts="CONFIG_MTDPARTSK \
+ "mtdparts=mtdparts="CONFIG_MTDPARTS \
"mtdids=nand0=orion_nand\0" \
- "x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \
+ "ipaddr=192.168.1.4\0" \
+ "x_bootcmd_ubi0=ubi part nand0,1\0" \
+ "x_bootcmd_ubi1=ubifsmount rootfs\0" \
+ "x_bootcmd_ubi2=ubifsload 0x200000 /nixos-kernel\0" \
+ "x_bootcmd_ubi3=ubifsload 0x1100000 /nixos-initrd\0" \
"x_bootcmd_usb=usb start\0" \
- "x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"
+ "x_bootargs_root=ubi.mtd=rootfs root=ubi0:rootfs rw rootfstype=ubifs " \
+ "init=/boot/nixos-init systemConfig=/boot/default/system\0"
/*
* Ethernet Driver configuration

File diff suppressed because it is too large Load Diff