about summary refs log tree commit diff
path: root/pkgs/misc/uboot
diff options
context:
space:
mode:
authorBen Wolsieffer <benwolsieffer@gmail.com>2018-02-23 23:47:27 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-13 16:12:08 -0400
commitd50bcaa8168b2b41d0e6d195d9ccb03e9d332d6c (patch)
treef9178ee8d69df4fc7dcd6fdb9952dbef4acdc9ea /pkgs/misc/uboot
parent2a450cec19028bb7ea533bbb3d98966722b22d7e (diff)
downloadnixlib-d50bcaa8168b2b41d0e6d195d9ccb03e9d332d6c.tar
nixlib-d50bcaa8168b2b41d0e6d195d9ccb03e9d332d6c.tar.gz
nixlib-d50bcaa8168b2b41d0e6d195d9ccb03e9d332d6c.tar.bz2
nixlib-d50bcaa8168b2b41d0e6d195d9ccb03e9d332d6c.tar.lz
nixlib-d50bcaa8168b2b41d0e6d195d9ccb03e9d332d6c.tar.xz
nixlib-d50bcaa8168b2b41d0e6d195d9ccb03e9d332d6c.tar.zst
nixlib-d50bcaa8168b2b41d0e6d195d9ccb03e9d332d6c.zip
uboot: sheevplug and guruplug: use mainline U-Boot
These derivations have not seen any updates since they were created in 2010,
and some of their sources have disappeared. There are upstream configs for
these boards, so these are now used, and they build correctly. I have no way
of testing them, and I don't if anyone even uses either board with Nix anymore.

(cherry picked from commit 01020b3263629be5a8697aa781dcb267df8de0a0)
(cherry picked from commit 48ade50d8ece09d3ff732b07f0facdcd78084ac3)
Diffstat (limited to 'pkgs/misc/uboot')
-rw-r--r--pkgs/misc/uboot/default.nix12
-rw-r--r--pkgs/misc/uboot/gas220.patch18
-rw-r--r--pkgs/misc/uboot/guruplug-file-systems.patch48
-rw-r--r--pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch106
-rw-r--r--pkgs/misc/uboot/guruplug.nix57
-rw-r--r--pkgs/misc/uboot/sheevaplug.nix61
6 files changed, 12 insertions, 290 deletions
diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix
index 800c00572821..9da52e494371 100644
--- a/pkgs/misc/uboot/default.nix
+++ b/pkgs/misc/uboot/default.nix
@@ -129,6 +129,12 @@ in rec {
     filesToInstall = ["u-boot-spl.kwb"];
   };
 
+  ubootGuruplug = buildUBoot rec {
+    defconfig = "guruplug_defconfig";
+    extraMeta.platforms = ["armv5tel-linux"];
+    filesToInstall = ["u-boot.bin"];
+  };
+
   ubootJetsonTK1 = buildUBoot rec {
     defconfig = "jetson-tk1_defconfig";
     extraMeta.platforms = ["armv7l-linux"];
@@ -183,6 +189,12 @@ in rec {
     filesToInstall = ["u-boot.bin"];
   };
 
+  ubootSheevaplug = buildUBoot rec {
+    defconfig = "sheevaplug_defconfig";
+    extraMeta.platforms = ["armv5tel-linux"];
+    filesToInstall = ["u-boot.bin"];
+  };
+
   ubootUtilite = buildUBoot rec {
     defconfig = "cm_fx6_defconfig";
     extraMeta.platforms = ["armv7l-linux"];
diff --git a/pkgs/misc/uboot/gas220.patch b/pkgs/misc/uboot/gas220.patch
deleted file mode 100644
index c5a91b0f3d00..000000000000
--- a/pkgs/misc/uboot/gas220.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-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)
diff --git a/pkgs/misc/uboot/guruplug-file-systems.patch b/pkgs/misc/uboot/guruplug-file-systems.patch
deleted file mode 100644
index 30dc1994303d..000000000000
--- a/pkgs/misc/uboot/guruplug-file-systems.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-Add support for the various file systems as found in `sheevaplug.h'.
-As for the SheevaPlug, the increase in size means that the environment
-must be pushed further away.
-
-In addition, increase the malloc area size to allow compilation of UbiFS.
-
---- u-boot/include/configs/guruplug.h	1970-01-01 01:00:01.000000000 +0100
-+++ u-boot/include/configs/guruplug.h	2010-09-29 18:59:52.000000000 +0200
-@@ -123,8 +123,8 @@
-  * it has to be rounded to sector size
-  */
- #define CONFIG_ENV_SIZE			0x20000	/* 128k */
--#define CONFIG_ENV_ADDR			0x40000
--#define CONFIG_ENV_OFFSET		0x40000	/* env starts here */
-+#define CONFIG_ENV_ADDR			0x60000
-+#define CONFIG_ENV_OFFSET		0x60000	/* env starts here */
- 
- /*
-  * Default environment variables
-@@ -145,7 +145,7 @@
- /*
-  * Size of malloc() pool
-  */
--#define CONFIG_SYS_MALLOC_LEN	(1024 * 128) /* 128kB for malloc() */
-+#define CONFIG_SYS_MALLOC_LEN	(1024 * 1024) /* 1 MiB for malloc() */
- /* size in bytes reserved for initial data */
- #define CONFIG_SYS_GBL_DATA_SIZE	128
- 
-@@ -195,4 +195,18 @@
- 
- #define CONFIG_SYS_ALT_MEMTEST
- 
-+/*
-+ * File system
-+ */
-+#define CONFIG_CMD_EXT2
-+#define CONFIG_CMD_FAT
-+#define CONFIG_CMD_JFFS2
-+#define CONFIG_CMD_UBI
-+#define CONFIG_CMD_UBIFS
-+#define CONFIG_RBTREE
-+#define CONFIG_MTD_DEVICE               /* needed for mtdparts commands */
-+#define CONFIG_MTD_PARTITIONS
-+#define CONFIG_CMD_MTDPARTS
-+#define CONFIG_LZO
-+
- #endif /* _CONFIG_GURUPLUG_H */
-
diff --git a/pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch b/pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch
deleted file mode 100644
index 4f32dd89031f..000000000000
--- a/pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-The GuruPlug's microSD card reader is a USB mass storage device that
-has two logical units (LUNs), i.e., two "SCSI disks".  This patch
-adds multi-LUN support to the USB MSD driver.
-
-See the thread at <http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/85425>.
-
---- u-boot/common/usb_storage.c	1970-01-01 01:00:01.000000000 +0100
-+++ u-boot/common/usb_storage.c	2010-10-02 00:38:15.000000000 +0200
-@@ -204,6 +204,22 @@ int usb_stor_info(void)
- 	return 1;
- }
- 
-+static unsigned int usb_get_max_lun(struct us_data *us)
-+{
-+	int len;
-+	unsigned char result;
-+	len = usb_control_msg(us->pusb_dev,
-+			      usb_rcvctrlpipe(us->pusb_dev, 0),
-+			      US_BBB_GET_MAX_LUN,
-+			      USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
-+			      0, us->ifnum,
-+			      &result, sizeof(result),
-+			      USB_CNTL_TIMEOUT * 5);
-+	USB_STOR_PRINTF("Get Max LUN -> len = %i, result = %i\n",
-+			len, (int) result);
-+	return (len > 0) ? result : 0;
-+}
-+
- /*******************************************************************************
-  * scan the usb and reports device info
-  * to the user if mode = 1
-@@ -241,13 +257,21 @@ int usb_stor_scan(int mode)
- 			break; /* no more devices avaiable */
- 
- 		if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) {
--			/* ok, it is a storage devices
--			 * get info and fill it in
--			 */
--			if (usb_stor_get_info(dev, &usb_stor[usb_max_devs],
--						&usb_dev_desc[usb_max_devs]) == 1)
-+			/* OK, it's a storage device.  Iterate over its LUNs
-+			 * and populate `usb_dev_desc'.  */
-+			int lun, max_lun, start = usb_max_devs;
-+
-+			max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]);
-+			for (lun = 0;
-+			     lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV;
-+			     lun++) {
-+				usb_dev_desc[usb_max_devs].lun = lun;
-+				if (usb_stor_get_info(dev, &usb_stor[start],
-+						      &usb_dev_desc[usb_max_devs]) == 1) {
- 				usb_max_devs++;
- 		}
-+			}
-+		}
- 		/* if storage device */
- 		if (usb_max_devs == USB_MAX_STOR_DEV) {
- 			printf("max USB Storage Device reached: %d stopping\n",
-@@ -882,6 +906,7 @@ static int usb_inquiry(ccb *srb, struct 
- 	do {
- 		memset(&srb->cmd[0], 0, 12);
- 		srb->cmd[0] = SCSI_INQUIRY;
-+		srb->cmd[1] = srb->lun << 5;
- 		srb->cmd[4] = 36;
- 		srb->datalen = 36;
- 		srb->cmdlen = 12;
-@@ -905,6 +930,7 @@ static int usb_request_sense(ccb *srb, s
- 	ptr = (char *)srb->pdata;
- 	memset(&srb->cmd[0], 0, 12);
- 	srb->cmd[0] = SCSI_REQ_SENSE;
-+	srb->cmd[1] = srb->lun << 5;
- 	srb->cmd[4] = 18;
- 	srb->datalen = 18;
- 	srb->pdata = &srb->sense_buf[0];
-@@ -924,6 +950,7 @@ static int usb_test_unit_ready(ccb *srb,
- 	do {
- 		memset(&srb->cmd[0], 0, 12);
- 		srb->cmd[0] = SCSI_TST_U_RDY;
-+		srb->cmd[1] = srb->lun << 5;
- 		srb->datalen = 0;
- 		srb->cmdlen = 12;
- 		if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD)
-@@ -943,6 +970,7 @@ static int usb_read_capacity(ccb *srb, s
- 	do {
- 		memset(&srb->cmd[0], 0, 12);
- 		srb->cmd[0] = SCSI_RD_CAPAC;
-+		srb->cmd[1] = srb->lun << 5;
- 		srb->datalen = 8;
- 		srb->cmdlen = 12;
- 		if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD)
-@@ -957,6 +985,7 @@ static int usb_read_10(ccb *srb, struct 
- {
- 	memset(&srb->cmd[0], 0, 12);
- 	srb->cmd[0] = SCSI_READ10;
-+	srb->cmd[1] = srb->lun << 5;
- 	srb->cmd[2] = ((unsigned char) (start >> 24)) & 0xff;
- 	srb->cmd[3] = ((unsigned char) (start >> 16)) & 0xff;
- 	srb->cmd[4] = ((unsigned char) (start >> 8)) & 0xff;
-@@ -973,6 +1002,7 @@ static int usb_write_10(ccb *srb, struct
- {
- 	memset(&srb->cmd[0], 0, 12);
- 	srb->cmd[0] = SCSI_WRITE10;
-+	srb->cmd[1] = srb->lun << 5;
- 	srb->cmd[2] = ((unsigned char) (start >> 24)) & 0xff;
- 	srb->cmd[3] = ((unsigned char) (start >> 16)) & 0xff;
- 	srb->cmd[4] = ((unsigned char) (start >> 8)) & 0xff;
diff --git a/pkgs/misc/uboot/guruplug.nix b/pkgs/misc/uboot/guruplug.nix
deleted file mode 100644
index 9f24f1da86a4..000000000000
--- a/pkgs/misc/uboot/guruplug.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{stdenv, fetchgit, unzip}:
-
-# Marvell's branch of U-Boot for the GuruPlug.
-
-let
-  # Aug 2010 revision of the `testing' branch of Marvell's U-Boot repository.
-  # See
-  # <http://www.openplug.org/plugwiki/index.php/Re-building_the_kernel_and_U-Boot>
-  # for details.
-  rev = "f106056095049c2c748c2a2797e5353295240e04";
-in
-stdenv.mkDerivation {
-  name = "uboot-guruplug-0.0-pre-${stdenv.lib.strings.substring 0 7 rev}";
-
-  src = fetchgit {
-    url = "git://git.denx.de/u-boot-marvell.git";
-    sha256 = "18gwyj16vml7aja9cyan51jwfcysy4cs062z7wmgdc0l9bha6iw7";
-    inherit rev;
-  };
-
-  patches =
-    [ ./guruplug-file-systems.patch ./guruplug-usb-msd-multi-lun.patch ];
-
-  enableParallelBuilding = true;
-
-  # Remove the cross compiler prefix.
-  configurePhase = ''
-    make mrproper
-    make guruplug_config
-    sed -i /CROSS_COMPILE/d include/config.mk
-  '';
-
-  buildPhase = ''
-    unset src
-    if test -z "$crossConfig"; then
-        make all u-boot.kwb
-    else
-        make all u-boot.kwb ARCH=arm CROSS_COMPILE=$crossConfig-
-    fi
-  '';
-
-  nativeBuildInputs = [ unzip ];
-
-  dontStrip = true;
-
-  installPhase = ''
-    mkdir -p $out
-    cp -v u-boot u-boot.{kwb,map} $out
-
-    mkdir -p $out/bin
-    cp tools/{envcrc,mkimage} $out/bin
-  '';
-
-  meta = {
-    platforms = [ "armv5tel-linux" ];
-  };
-}
diff --git a/pkgs/misc/uboot/sheevaplug.nix b/pkgs/misc/uboot/sheevaplug.nix
deleted file mode 100644
index 53d811d1a44e..000000000000
--- a/pkgs/misc/uboot/sheevaplug.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-{stdenv, fetchurl, unzip}:
-
-# We should enable this check once we have the cross target system information
-# assert stdenv.system == "armv5tel-linux" || crossConfig == "armv5tel-linux";
-
-# All this file is made for the Marvell Sheevaplug
-   
-stdenv.mkDerivation {
-  name = "uboot-sheevaplug-3.4.27";
-   
-  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/405/us/plug-basic/uboot/u-boot-3.4.27.zip";
-    sha256 = "1wqxznpdb6d2kx58gral4q0mg5ddxyrv7az8c6v29nr3cd9yrfsg";
-  };
-
-  postUnpack = ''
-    mv u-boot-1.1.4 u-boot-3.4.27
-    unzip -o $srcAddon
-    sourceRoot=u-boot-3.4.27
-  '';
-
-  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
-    if test -z "$crossConfig"; then
-        make clean all
-    else
-        make clean all ARCH=arm CROSS_COMPILE=$crossConfig-
-    fi
-  '';
-
-  nativeBuildInputs = [ unzip ];
-
-  dontStrip = true;
-
-  installPhase = ''
-    mkdir -p $out
-    cp u-boot-rd88f6281Sheevaplug_400db_nand.bin $out
-    cp u-boot u-boot.map $out
-
-    mkdir -p $out/bin
-    cp tools/{envcrc,mkimage} $out/bin
-  '';
-
-  meta = {
-    platforms = [ "armv5tel-linux" ];
-  };
-}