summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/uboot/default.nix53
-rw-r--r--pkgs/misc/uboot/gas220.patch18
2 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix
new file mode 100644
index 0000000000000..eeb76df622122
--- /dev/null
+++ b/pkgs/misc/uboot/default.nix
@@ -0,0 +1,53 @@
+{stdenv, fetchurl, unzip}:
+
+assert stdenv.system == "armv5tel-linux";
+
+# All this file is made for the Marvell Sheevaplug
+   
+stdenv.mkDerivation {
+  name = "uboot-sheevaplug-3.4.19";
+   
+  src = fetchurl {
+    url = "ftp://ftp.denx.de/pub/u-boot/u-boot-1.1.4.tar.bz2";
+    sha256 = "19vp4rlikz7h72pqsjhgz7nmgjy4c6vabvxkw67wni70vy5ddy8s";
+  };
+
+  srcAddon = fetchurl {
+    url = "http://www.plugcomputer.org/data/uboot/u-boot-3.4.19.zip";
+    sha256 = "1wag1l6agr8dbnnfaw6bgcrwynwwgry4ihb3gp438699wmkmy91k";
+  };
+
+  postUnpack = ''
+    mv u-boot-1.1.4 u-boot-3.4.19
+    unzip -o $srcAddon
+    sourceRoot=u-boot-3.4.19
+  '';
+
+  patches = [ ./gas220.patch ];
+
+  # Remove the cross compiler prefix, and add reiserfs support
+  configurePhase = ''
+    make mrproper
+    make rd88f6281Sheevaplug_config NBOOT=1 LE=1
+    sed -i /CROSS_COMPILE/d include/config.mk
+  '';
+
+  buildPhase = ''
+    unset src
+    make clean all
+  '';
+
+  buildInputs = [ unzip ];
+
+  dontStrip = true;
+  NIX_STRIP_DEBUG = false;
+
+  installPhase = ''
+    ensureDir $out
+    cp u-boot-rd88f6281Sheevaplug_400db_nand.bin $out
+    cp u-boot u-boot.map $out
+
+    ensureDir $out/bin
+    cp tools/{envcrc,mkimage} $out/bin
+  '';
+}
diff --git a/pkgs/misc/uboot/gas220.patch b/pkgs/misc/uboot/gas220.patch
new file mode 100644
index 0000000000000..c5a91b0f3d00e
--- /dev/null
+++ b/pkgs/misc/uboot/gas220.patch
@@ -0,0 +1,18 @@
+Patch to allow assembling with binutils 2.20. It worked without this patch in 2.19.1
+diff --git a/board/mv_feroceon/USP/jump.S b/board/mv_feroceon/USP/jump.S
+index 4b6b9ee..58037fc 100644
+--- a/board/mv_feroceon/USP/jump.S
++++ b/board/mv_feroceon/USP/jump.S
+@@ -29,9 +29,11 @@ disclaimer.
+ #include "sys/mvCpuIfRegs.h"
+ 
+ 
+-jumpStart:
+ 
+ .section	".reset_vector_sect",#alloc, #execinstr
++
++jumpStart:
++
+ #if defined(MV_88F6082) || defined(MV_88F6183) || defined(DB_88F5181_OLD) || defined(DB_FPGA) || \
+ 	defined(MV88F6281) || defined(MV88F6192) || defined(MV88F6180)  || defined(MV_88F6183L) || \
+     defined(MV88F6190)