git.iko.soy/typeable/nixpkgs
on master help sign in
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)

commitd50bcaa8168b2b41d0e6d195d9ccb03e9d332d6c authorBen Wolsieffer <benwolsieffer@gmail.com> dateFri 23 Feb 2018, 23:47 (9 years ago) parent2a450ce
7 files changed+14−294
pkgs/misc/uboot/default.nix+12 pkgs/misc/uboot/gas220.patch−18 pkgs/misc/uboot/guruplug-file-systems.patch−48 pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patch−106 pkgs/misc/uboot/guruplug.nix−57 pkgs/misc/uboot/sheevaplug.nix−61 pkgs/top-level/all-packages.nix+2−4
pkgs/misc/uboot/default.nix+12
@@ -129,6 +129,12 @@ in rec {
129129 filesToInstall = ["u-boot-spl.kwb"];
130130 };
131131
132+ ubootGuruplug = buildUBoot rec {
133+ defconfig = "guruplug_defconfig";
134+ extraMeta.platforms = ["armv5tel-linux"];
135+ filesToInstall = ["u-boot.bin"];
136+ };
137+
132138 ubootJetsonTK1 = buildUBoot rec {
133139 defconfig = "jetson-tk1_defconfig";
134140 extraMeta.platforms = ["armv7l-linux"];
@@ -183,6 +189,12 @@ in rec {
183189 filesToInstall = ["u-boot.bin"];
184190 };
185191
192+ ubootSheevaplug = buildUBoot rec {
193+ defconfig = "sheevaplug_defconfig";
194+ extraMeta.platforms = ["armv5tel-linux"];
195+ filesToInstall = ["u-boot.bin"];
196+ };
197+
186198 ubootUtilite = buildUBoot rec {
187199 defconfig = "cm_fx6_defconfig";
188200 extraMeta.platforms = ["armv7l-linux"];
pkgs/misc/uboot/gas220.patchdeleted−18
@@ -1,18 +0,0 @@
1−Patch to allow assembling with binutils 2.20. It worked without this patch in 2.19.1
2−diff --git a/board/mv_feroceon/USP/jump.S b/board/mv_feroceon/USP/jump.S
3−index 4b6b9ee..58037fc 100644
4−--- a/board/mv_feroceon/USP/jump.S
5−+++ b/board/mv_feroceon/USP/jump.S
6−@@ -29,9 +29,11 @@ disclaimer.
7− #include "sys/mvCpuIfRegs.h"
8−
9−
10−-jumpStart:
11−
12− .section ".reset_vector_sect",#alloc, #execinstr
13−+
14−+jumpStart:
15−+
16− #if defined(MV_88F6082) || defined(MV_88F6183) || defined(DB_88F5181_OLD) || defined(DB_FPGA) || \
17− defined(MV88F6281) || defined(MV88F6192) || defined(MV88F6180) || defined(MV_88F6183L) || \
18− defined(MV88F6190)
pkgs/misc/uboot/guruplug-file-systems.patchdeleted−48
@@ -1,48 +0,0 @@
1−Add support for the various file systems as found in `sheevaplug.h'.
2−As for the SheevaPlug, the increase in size means that the environment
3−must be pushed further away.
4−
5−In addition, increase the malloc area size to allow compilation of UbiFS.
6−
7−--- u-boot/include/configs/guruplug.h 1970-01-01 01:00:01.000000000 +0100
8−+++ u-boot/include/configs/guruplug.h 2010-09-29 18:59:52.000000000 +0200
9−@@ -123,8 +123,8 @@
10− * it has to be rounded to sector size
11− */
12− #define CONFIG_ENV_SIZE 0x20000 /* 128k */
13−-#define CONFIG_ENV_ADDR 0x40000
14−-#define CONFIG_ENV_OFFSET 0x40000 /* env starts here */
15−+#define CONFIG_ENV_ADDR 0x60000
16−+#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */
17−
18− /*
19− * Default environment variables
20−@@ -145,7 +145,7 @@
21− /*
22− * Size of malloc() pool
23− */
24−-#define CONFIG_SYS_MALLOC_LEN (1024 * 128) /* 128kB for malloc() */
25−+#define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* 1 MiB for malloc() */
26− /* size in bytes reserved for initial data */
27− #define CONFIG_SYS_GBL_DATA_SIZE 128
28−
29−@@ -195,4 +195,18 @@
30−
31− #define CONFIG_SYS_ALT_MEMTEST
32−
33−+/*
34−+ * File system
35−+ */
36−+#define CONFIG_CMD_EXT2
37−+#define CONFIG_CMD_FAT
38−+#define CONFIG_CMD_JFFS2
39−+#define CONFIG_CMD_UBI
40−+#define CONFIG_CMD_UBIFS
41−+#define CONFIG_RBTREE
42−+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
43−+#define CONFIG_MTD_PARTITIONS
44−+#define CONFIG_CMD_MTDPARTS
45−+#define CONFIG_LZO
46−+
47− #endif /* _CONFIG_GURUPLUG_H */
48−
pkgs/misc/uboot/guruplug-usb-msd-multi-lun.patchdeleted−106
@@ -1,106 +0,0 @@
1−The GuruPlug's microSD card reader is a USB mass storage device that
2−has two logical units (LUNs), i.e., two "SCSI disks". This patch
3−adds multi-LUN support to the USB MSD driver.
4−
5−See the thread at <http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/85425>.
6−
7−--- u-boot/common/usb_storage.c 1970-01-01 01:00:01.000000000 +0100
8−+++ u-boot/common/usb_storage.c 2010-10-02 00:38:15.000000000 +0200
9−@@ -204,6 +204,22 @@ int usb_stor_info(void)
10− return 1;
11− }
12−
13−+static unsigned int usb_get_max_lun(struct us_data *us)
14−+{
15−+ int len;
16−+ unsigned char result;
17−+ len = usb_control_msg(us->pusb_dev,
18−+ usb_rcvctrlpipe(us->pusb_dev, 0),
19−+ US_BBB_GET_MAX_LUN,
20−+ USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
21−+ 0, us->ifnum,
22−+ &result, sizeof(result),
23−+ USB_CNTL_TIMEOUT * 5);
24−+ USB_STOR_PRINTF("Get Max LUN -> len = %i, result = %i\n",
25−+ len, (int) result);
26−+ return (len > 0) ? result : 0;
27−+}
28−+
29− /*******************************************************************************
30− * scan the usb and reports device info
31− * to the user if mode = 1
32−@@ -241,13 +257,21 @@ int usb_stor_scan(int mode)
33− break; /* no more devices avaiable */
34−
35− if (usb_storage_probe(dev, 0, &usb_stor[usb_max_devs])) {
36−- /* ok, it is a storage devices
37−- * get info and fill it in
38−- */
39−- if (usb_stor_get_info(dev, &usb_stor[usb_max_devs],
40−- &usb_dev_desc[usb_max_devs]) == 1)
41−+ /* OK, it's a storage device. Iterate over its LUNs
42−+ * and populate `usb_dev_desc'. */
43−+ int lun, max_lun, start = usb_max_devs;
44−+
45−+ max_lun = usb_get_max_lun(&usb_stor[usb_max_devs]);
46−+ for (lun = 0;
47−+ lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV;
48−+ lun++) {
49−+ usb_dev_desc[usb_max_devs].lun = lun;
50−+ if (usb_stor_get_info(dev, &usb_stor[start],
51−+ &usb_dev_desc[usb_max_devs]) == 1) {
52− usb_max_devs++;
53− }
54−+ }
55−+ }
56− /* if storage device */
57− if (usb_max_devs == USB_MAX_STOR_DEV) {
58− printf("max USB Storage Device reached: %d stopping\n",
59−@@ -882,6 +906,7 @@ static int usb_inquiry(ccb *srb, struct
60− do {
61− memset(&srb->cmd[0], 0, 12);
62− srb->cmd[0] = SCSI_INQUIRY;
63−+ srb->cmd[1] = srb->lun << 5;
64− srb->cmd[4] = 36;
65− srb->datalen = 36;
66− srb->cmdlen = 12;
67−@@ -905,6 +930,7 @@ static int usb_request_sense(ccb *srb, s
68− ptr = (char *)srb->pdata;
69− memset(&srb->cmd[0], 0, 12);
70− srb->cmd[0] = SCSI_REQ_SENSE;
71−+ srb->cmd[1] = srb->lun << 5;
72− srb->cmd[4] = 18;
73− srb->datalen = 18;
74− srb->pdata = &srb->sense_buf[0];
75−@@ -924,6 +950,7 @@ static int usb_test_unit_ready(ccb *srb,
76− do {
77− memset(&srb->cmd[0], 0, 12);
78− srb->cmd[0] = SCSI_TST_U_RDY;
79−+ srb->cmd[1] = srb->lun << 5;
80− srb->datalen = 0;
81− srb->cmdlen = 12;
82− if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD)
83−@@ -943,6 +970,7 @@ static int usb_read_capacity(ccb *srb, s
84− do {
85− memset(&srb->cmd[0], 0, 12);
86− srb->cmd[0] = SCSI_RD_CAPAC;
87−+ srb->cmd[1] = srb->lun << 5;
88− srb->datalen = 8;
89− srb->cmdlen = 12;
90− if (ss->transport(srb, ss) == USB_STOR_TRANSPORT_GOOD)
91−@@ -957,6 +985,7 @@ static int usb_read_10(ccb *srb, struct
92− {
93− memset(&srb->cmd[0], 0, 12);
94− srb->cmd[0] = SCSI_READ10;
95−+ srb->cmd[1] = srb->lun << 5;
96− srb->cmd[2] = ((unsigned char) (start >> 24)) & 0xff;
97− srb->cmd[3] = ((unsigned char) (start >> 16)) & 0xff;
98− srb->cmd[4] = ((unsigned char) (start >> 8)) & 0xff;
99−@@ -973,6 +1002,7 @@ static int usb_write_10(ccb *srb, struct
100− {
101− memset(&srb->cmd[0], 0, 12);
102− srb->cmd[0] = SCSI_WRITE10;
103−+ srb->cmd[1] = srb->lun << 5;
104− srb->cmd[2] = ((unsigned char) (start >> 24)) & 0xff;
105− srb->cmd[3] = ((unsigned char) (start >> 16)) & 0xff;
106− srb->cmd[4] = ((unsigned char) (start >> 8)) & 0xff;
pkgs/misc/uboot/guruplug.nixdeleted−57
@@ -1,57 +0,0 @@
1−{stdenv, fetchgit, unzip}:
2−
3−# Marvell's branch of U-Boot for the GuruPlug.
4−
5−let
6− # Aug 2010 revision of the `testing' branch of Marvell's U-Boot repository.
7− # See
8− # <http://www.openplug.org/plugwiki/index.php/Re-building_the_kernel_and_U-Boot>
9− # for details.
10− rev = "f106056095049c2c748c2a2797e5353295240e04";
11−in
12−stdenv.mkDerivation {
13− name = "uboot-guruplug-0.0-pre-${stdenv.lib.strings.substring 0 7 rev}";
14−
15− src = fetchgit {
16− url = "git://git.denx.de/u-boot-marvell.git";
17− sha256 = "18gwyj16vml7aja9cyan51jwfcysy4cs062z7wmgdc0l9bha6iw7";
18− inherit rev;
19− };
20−
21− patches =
22− [ ./guruplug-file-systems.patch ./guruplug-usb-msd-multi-lun.patch ];
23−
24− enableParallelBuilding = true;
25−
26− # Remove the cross compiler prefix.
27− configurePhase = ''
28− make mrproper
29− make guruplug_config
30− sed -i /CROSS_COMPILE/d include/config.mk
31− '';
32−
33− buildPhase = ''
34− unset src
35− if test -z "$crossConfig"; then
36− make all u-boot.kwb
37− else
38− make all u-boot.kwb ARCH=arm CROSS_COMPILE=$crossConfig-
39− fi
40− '';
41−
42− nativeBuildInputs = [ unzip ];
43−
44− dontStrip = true;
45−
46− installPhase = ''
47− mkdir -p $out
48− cp -v u-boot u-boot.{kwb,map} $out
49−
50− mkdir -p $out/bin
51− cp tools/{envcrc,mkimage} $out/bin
52− '';
53−
54− meta = {
55− platforms = [ "armv5tel-linux" ];
56− };
57−}
pkgs/misc/uboot/sheevaplug.nixdeleted−61
@@ -1,61 +0,0 @@
1−{stdenv, fetchurl, unzip}:
2−
3−# We should enable this check once we have the cross target system information
4−# assert stdenv.system == "armv5tel-linux" || crossConfig == "armv5tel-linux";
5−
6−# All this file is made for the Marvell Sheevaplug
7−
8−stdenv.mkDerivation {
9− name = "uboot-sheevaplug-3.4.27";
10−
11− src = fetchurl {
12− url = "ftp://ftp.denx.de/pub/u-boot/u-boot-1.1.4.tar.bz2";
13− sha256 = "19vp4rlikz7h72pqsjhgz7nmgjy4c6vabvxkw67wni70vy5ddy8s";
14− };
15−
16− srcAddon = fetchurl {
17− url = "http://www.plugcomputer.org/405/us/plug-basic/uboot/u-boot-3.4.27.zip";
18− sha256 = "1wqxznpdb6d2kx58gral4q0mg5ddxyrv7az8c6v29nr3cd9yrfsg";
19− };
20−
21− postUnpack = ''
22− mv u-boot-1.1.4 u-boot-3.4.27
23− unzip -o $srcAddon
24− sourceRoot=u-boot-3.4.27
25− '';
26−
27− patches = [ ./gas220.patch ];
28−
29− # Remove the cross compiler prefix, and add reiserfs support
30− configurePhase = ''
31− make mrproper
32− make rd88f6281Sheevaplug_config NBOOT=1 LE=1
33− sed -i /CROSS_COMPILE/d include/config.mk
34− '';
35−
36− buildPhase = ''
37− unset src
38− if test -z "$crossConfig"; then
39− make clean all
40− else
41− make clean all ARCH=arm CROSS_COMPILE=$crossConfig-
42− fi
43− '';
44−
45− nativeBuildInputs = [ unzip ];
46−
47− dontStrip = true;
48−
49− installPhase = ''
50− mkdir -p $out
51− cp u-boot-rd88f6281Sheevaplug_400db_nand.bin $out
52− cp u-boot u-boot.map $out
53−
54− mkdir -p $out/bin
55− cp tools/{envcrc,mkimage} $out/bin
56− '';
57−
58− meta = {
59− platforms = [ "armv5tel-linux" ];
60− };
61−}
pkgs/top-level/all-packages.nix+2−4
@@ -13797,6 +13797,7 @@ with pkgs;
1379713797 ubootBananaPi
1379813798 ubootBeagleboneBlack
1379913799 ubootClearfog
13800+ ubootGuruplug
1380013801 ubootJetsonTK1
1380113802 ubootOdroidXU3
1380213803 ubootOrangePiPc
@@ -13806,17 +13807,14 @@ with pkgs;
1380613807 ubootRaspberryPi2
1380713808 ubootRaspberryPi3_32bit
1380813809 ubootRaspberryPi3_64bit
13810+ ubootSheevaplug
1380913811 ubootUtilite
1381013812 ubootWandboard
1381113813 ;
1381213814
1381313815 # Non-upstream U-Boots:
13814− ubootSheevaplug = callPackage ../misc/uboot/sheevaplug.nix { };
13815−
1381613816 ubootNanonote = callPackage ../misc/uboot/nanonote.nix { };
1381713817
13818− ubootGuruplug = callPackage ../misc/uboot/guruplug.nix { };
13819−
1382013818 uclibc = callPackage ../os-specific/linux/uclibc { };
1382113819
1382213820 uclibcCross = callPackage ../os-specific/linux/uclibc {