aboutsummaryrefslogtreecommitdiff
path: root/sysutils/u-boot-rpi
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2015-01-02 02:18:37 +0000
committerIan Lepore <ian@FreeBSD.org>2015-01-02 02:18:37 +0000
commit7b369371c161409afc645ea1d0a804a56df3bfad (patch)
tree6511514068b9e65390f046f8e83cc8d296d296fd /sysutils/u-boot-rpi
parent47a5d3ca97fa6a80ec8ad5bd8a238cb89ac70451 (diff)
downloadports-7b369371c161409afc645ea1d0a804a56df3bfad.tar.gz
ports-7b369371c161409afc645ea1d0a804a56df3bfad.zip
Add all the files required to boot a Raspberry Pi to the port. Also, change
the default environment variables to be similar to wandboard and beaglebone. Approved by: imp
Notes
Notes: svn path=/head/; revision=376038
Diffstat (limited to 'sysutils/u-boot-rpi')
-rw-r--r--sysutils/u-boot-rpi/Makefile29
-rw-r--r--sysutils/u-boot-rpi/distinfo2
-rw-r--r--sysutils/u-boot-rpi/files/patch-include_configs_rpi__b.h39
-rw-r--r--sysutils/u-boot-rpi/pkg-descr6
4 files changed, 51 insertions, 25 deletions
diff --git a/sysutils/u-boot-rpi/Makefile b/sysutils/u-boot-rpi/Makefile
index 7c4ec3ad5ebc..b3741ec250ae 100644
--- a/sysutils/u-boot-rpi/Makefile
+++ b/sysutils/u-boot-rpi/Makefile
@@ -2,9 +2,16 @@
PORTNAME= u-boot
PORTVERSION= 2013.01
+PORTREVISION= 1
CATEGORIES= sysutils
+MASTER_SITES= GH:uboot \
+ http://distcache.FreeBSD.org/local-distfiles/ian/:bootfiles \
+ http://distcache.us-east.FreeBSD.org/local-distfiles/ian/:bootfiles \
+ http://distcache.eu.FreeBSD.org/local-distfiles/ian/:bootfiles \
+ http://distcache.us-west.FreeBSD.org/local-distfiles/ian/:bootfiles
PKGNAMESUFFIX= -rpi
-DISTNAME= u-boot-${PORTVERSION}-${GH_ACCOUNT}-${GH_PROJECT}
+DISTFILES= u-boot-${PORTVERSION}-${GH_ACCOUNT}-${GH_PROJECT}.tar.gz:uboot \
+ rpi-boot-files-2014.10_1.tar.bz2:bootfiles
MAINTAINER= ian@FreeBSD.org
COMMENT= Cross-build U-Boot loader for Raspberry Pi
@@ -26,9 +33,18 @@ WRKSRC= ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_TAGNAME}
USES= gmake
SSP_UNSAFE= yes # cross-build static linking dies with -fstack-protector
+WRK_BOOTFILES= ${WRKDIR}/rpi-boot-files
+
U_BOOT_DIR= share/u-boot/${PORTNAME}${PKGNAMESUFFIX}
-PLIST_FILES= ${U_BOOT_DIR}/uboot.img \
- ${U_BOOT_DIR}/README
+PLIST_FILES= ${U_BOOT_DIR}/u-boot.img \
+ ${U_BOOT_DIR}/LICENCE.broadcom \
+ ${U_BOOT_DIR}/README \
+ ${U_BOOT_DIR}/bootcode.bin \
+ ${U_BOOT_DIR}/config.txt \
+ ${U_BOOT_DIR}/fixup.dat \
+ ${U_BOOT_DIR}/fixup_cd.dat \
+ ${U_BOOT_DIR}/start.elf \
+ ${U_BOOT_DIR}/start_cd.elf
MAKE_ARGS+= ARCH=arm \
CROSS_COMPILE=arm-none-eabi- \
@@ -40,12 +56,13 @@ do-configure:
# The output of the u-boot build process is u-boot.bin. We have to put a
# standard (for the RPi) image header on the front of it, and the resulting
-# file is named uboot.img (without a dash for historical reasons).
-IMGFILE=${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/uboot.img
+# file is named u-boot.img. Also copy the entire contents of the bootfiles
+# distribution (these are proprietary binary files required to boot).
+IMGFILE=${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/u-boot.img
do-install:
${MKDIR} ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}
${GZCAT} ${FILESDIR}/imgprefix.bin.gz >${IMGFILE}
${CAT} ${WRKSRC}/u-boot.bin >>${IMGFILE}
- ${CP} ${.CURDIR}/pkg-descr ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/README
+ ${CP} ${WRK_BOOTFILES}/* ${STAGEDIR}/${PREFIX}/${U_BOOT_DIR}/
.include <bsd.port.mk>
diff --git a/sysutils/u-boot-rpi/distinfo b/sysutils/u-boot-rpi/distinfo
index e08c12827292..953c1ecfd959 100644
--- a/sysutils/u-boot-rpi/distinfo
+++ b/sysutils/u-boot-rpi/distinfo
@@ -1,2 +1,4 @@
SHA256 (u-boot-2013.01-gonzoua-u-boot-pi.tar.gz) = 29a0d6ffa952483adf37d066bc1823f5f0d62e6534829d6190e9880ef9354f42
SIZE (u-boot-2013.01-gonzoua-u-boot-pi.tar.gz) = 13850640
+SHA256 (rpi-boot-files-2014.10_1.tar.bz2) = 1c9aaefe6c9558f7e60844b3cb00538eb42d5c45937f3da464cad65fcae4a70b
+SIZE (rpi-boot-files-2014.10_1.tar.bz2) = 1784837
diff --git a/sysutils/u-boot-rpi/files/patch-include_configs_rpi__b.h b/sysutils/u-boot-rpi/files/patch-include_configs_rpi__b.h
index 79c358de84e0..4a82c3147358 100644
--- a/sysutils/u-boot-rpi/files/patch-include_configs_rpi__b.h
+++ b/sysutils/u-boot-rpi/files/patch-include_configs_rpi__b.h
@@ -1,6 +1,6 @@
--- include/configs/rpi_b.h.orig 2012-11-28 01:28:06 UTC
+++ include/configs/rpi_b.h
-@@ -183,4 +183,57 @@
+@@ -183,4 +183,64 @@
#define CONFIG_INITRD_TAG
#define CONFIG_CMD_BMP
@@ -21,40 +21,47 @@
+#define FAT_ENV_INTERFACE "mmc"
+#define FAT_ENV_DEVICE 0
+#define FAT_ENV_PART 1
-+#define FAT_ENV_FILE "uboot.env"
++#define FAT_ENV_FILE "u-boot.env"
+#define CONFIG_CMD_SAVEENV
+
+/* Create a small(ish) boot environment for FreeBSD. */
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS \
-+ "bootfile=ubldr\0" \
-+ "fatdev=mmc 0:1\0" \
-+ "loaderdev=disk\0" \
++ "loadaddr=0x00200000\0" \
+ "stdin=serial\0" \
+ "stderr=serial,lcd\0" \
+ "stdout=serial,lcd\0" \
-+ "uenv_file=uEnv.txt\0" \
-+ \
-+ "fatboot=" \
-+ "env exists user_fatboot && run user_fatboot; " \
++ "Fatboot=" \
++ "env exists loaderdev || env set loaderdev ${fatdev}; " \
++ "env exists UserFatboot && run UserFatboot; " \
++ "echo Booting from: ${fatdev} ${bootfile}; " \
+ "fatload ${fatdev} ${loadaddr} ${bootfile} && bootelf; " \
+ "\0" \
-+ "netboot=" \
++ "Netboot=" \
+ "env exists ethact || usb start; " \
-+ "env exists user_netboot && run user_netboot; " \
++ "env exists loaderdev || env set loaderdev net; " \
++ "env exists UserNetboot && run UserNetboot; " \
+ "dhcp ${loadaddr} ${bootfile} && bootelf; " \
+ "\0" \
-+ "preboot=" \
++ "Preboot=" \
+ "fdt addr 0x100; " \
-+ "env exists uenv_import && run uenv_import; " \
-+ "env exists user_preboot && run user_preboot; " \
++ "env exists bootfile || bootfile=ubldr; " \
++ "env exists uenv_file || uenv_file=uEnv.txt; " \
++ "env exists SetupFatdev && run SetupFatdev; " \
++ "env exists SetupUenv && run SetupUenv; " \
++ "env exists UserPreboot && run UserPreboot; " \
+ "\0" \
-+ "uenv_import=" \
++ "SetupFatdev=" \
++ "env exists fatdev || fatdev='mmc 0'; " \
++ "\0" \
++ "SetupUenv=" \
+ "fatload ${fatdev} ${loadaddr} ${uenv_file} && " \
+ "env import -t ${loadaddr} ${filesize}; " \
+ "\0"
+
+#undef CONFIG_BOOTCOMMAND
-+#define CONFIG_BOOTCOMMAND "run fatboot"
++#define CONFIG_BOOTCOMMAND "run Fatboot"
++#undef CONFIG_PREBOOT
++#define CONFIG_PREBOOT "run Preboot"
+
#endif
diff --git a/sysutils/u-boot-rpi/pkg-descr b/sysutils/u-boot-rpi/pkg-descr
index 2a14fdc249d5..3312e0c4bf60 100644
--- a/sysutils/u-boot-rpi/pkg-descr
+++ b/sysutils/u-boot-rpi/pkg-descr
@@ -1,7 +1,7 @@
-U-Boot loader for Raspberry Pi
+U-Boot loader and related files for Raspberry Pi
-To install this bootloader, copy the file uboot.img to the FAT parition
-on an SD card. Other files (not part of this package) are also required.
+To install this bootloader, copy ALL the files in the share/u-boot/u-boot-rpi
+directory to the first partition, formatted as FAT16 or FAT32, on an SD card.
This version is patched so that:
* ELF and API features are enabled.