diff options
author | Emmanuel Vadot <manu@FreeBSD.org> | 2018-03-25 04:40:27 +0800 |
---|---|---|
committer | Emmanuel Vadot <manu@FreeBSD.org> | 2018-03-25 04:40:27 +0800 |
commit | c62148826902067b6d23fce9ddfed9c9200d129c (patch) | |
tree | 3c9d9e2e46043db611e8251cbb475fc1282a68a6 | |
parent | b7f9b0f297a6cfe2a68770b9874efaf15c3a5ae2 (diff) | |
download | freebsd-ports-c62148826902067b6d23fce9ddfed9c9200d129c.tar.gz freebsd-ports-c62148826902067b6d23fce9ddfed9c9200d129c.tar.zst freebsd-ports-c62148826902067b6d23fce9ddfed9c9200d129c.zip |
u-boot: Update to v2018.01
- Track upstream directly We cannot build u-boot directly on FreeBSD as
it needs gmake, gsed etc ... Earlier update dealt with that using
BINARY_ALIAS to avoid patching. The cache patches have been sent upstream
(a V2 is needed as some arch don't have those functions) so put them in
the ports tree for now. This is the only patches needed to build a
u-boot for armv6/armv7/arm64 so do not use the freebsd github fork anymore
as they will go away soon.
- We now use boot.scr (converted with mkimage from sysutils/u-boot-tools)
instead of patching u-boot. U-Boot have two way for dealing with distribution
one is boot scripts and the other is extlinux. extlinux will be harder as we
use raw binary for ubldr and use go $address, this cannot fail and the boot
process could be in a bad state so this is something that upstream doesn't
want to merge in mainline. boot script are easy to write and compile and
also give a way to the user to customize it's boot
(printing a message, setting variable etc ...)
- CONFIG_API isn't defined by default so use a configuration fragment and
generate our final config with scripts/kconfig/merge_config.sh
Other configuration value could be added in the futur.
For now only arm uses it as we don't use CONFIG_API on arm64.
- Switch the maintainer to uboot@freebsd.org
Reviewed by: imp (previous version)
Approved by: imp
Differential Revision: https://reviews.freebsd.org/D14230
Notes
Notes:
svn path=/head/; revision=465468
-rw-r--r-- | sysutils/u-boot-master/Makefile | 38 | ||||
-rw-r--r-- | sysutils/u-boot-master/distinfo | 6 | ||||
-rw-r--r-- | sysutils/u-boot-master/files/FreeBSD_Fragment | 1 | ||||
-rw-r--r-- | sysutils/u-boot-master/files/boot.cmd | 2 | ||||
-rw-r--r-- | sysutils/u-boot-master/files/patch-api_api.c | 14 | ||||
-rw-r--r-- | sysutils/u-boot-master/files/patch-cmd_boot.c | 13 | ||||
-rw-r--r-- | sysutils/u-boot-master/files/patch-cmd_elf.c | 14 |
7 files changed, 73 insertions, 15 deletions
diff --git a/sysutils/u-boot-master/Makefile b/sysutils/u-boot-master/Makefile index a81d10507e6b..1d00885a0e70 100644 --- a/sysutils/u-boot-master/Makefile +++ b/sysutils/u-boot-master/Makefile @@ -5,29 +5,25 @@ PORTNAME= u-boot PORTVERSION= ${UBOOT_VERSION} -PORTREVISION= 2 -DISTVERSIONPREFIX= ports-v CATEGORIES= sysutils PKGNAMESUFFIX?= -${MODEL} +MASTER_SITES= ftp://ftp.denx.de/pub/u-boot/ -MAINTAINER= imp@FreeBSD.org +MAINTAINER= uboot@FreeBSD.org COMMENT= Cross-build das u-boot for model ${MODEL} LICENSE= GPLv2 BUILD_DEPENDS+= gsed:textproc/gsed \ swig3.0:devel/swig30 \ - dtc>=1.4.1:sysutils/dtc + dtc>=1.4.1:sysutils/dtc \ + mkimage:sysutils/u-boot-tools BUILD_DEPENDS+= ${COMPILER}:devel/${COMPILER} -USES= gmake python:2.7,build shebangfix -BINARY_ALIAS= swig=swig3.0 sed=gsed +USES= tar:bz2 gmake python:2.7,build shebangfix +BINARY_ALIAS= swig=swig3.0 sed=gsed dtc=${LOCALBASE}/bin/dtc -USE_GITHUB= yes -GH_ACCOUNT= freebsd -GH_PROJECT= u-boot - -SHEBANG_FILES= lib/libfdt/pylibfdt/setup.py +SHEBANG_FILES= tools/binman/binman.py SSP_UNSAFE= yes UBOOT_DIR= share/u-boot/${PORTNAME}${PKGNAMESUFFIX} INST= ${PREFIX}/${UBOOT_DIR} @@ -74,7 +70,7 @@ UBOOT_PLIST_RPI= u-boot.bin .if !defined(UBOOT_VERSION) && defined(UBOOT_VERSION_${FAMILY:tu}) UBOOT_VERSION=${UBOOT_VERSION_${FAMILY:tu}} .endif -UBOOT_VERSION?= 2017.09.00 +UBOOT_VERSION?= 2018.03 .if !defined(UBOOT_PLIST) && defined(UBOOT_PLIST_${FAMILY:tu}) UBOOT_PLIST=${UBOOT_PLIST_${FAMILY:tu}} @@ -89,6 +85,7 @@ UBOOT_ARCH?= arm .if ${UBOOT_ARCH} == arm CROSS_COMPILE=arm-none-eabi- ARCHFLAGS=ARCH=${UBOOT_ARCH} +UBOOT_PLIST+= boot.scr .elif ${UBOOT_ARCH} == aarch64 CROSS_COMPILE=aarch64-none-elf- ARCHFLAGS=ARCH=arm @@ -115,8 +112,20 @@ PLIST_FILES+= ${UBOOT_DIR}/${i} .endfor PLIST_FILES+= ${UBOOT_DIR}/README +post-patch: + @${REINPLACE_CMD} -e "s|make|${MAKE_CMD}|" ${WRKSRC}/scripts/kconfig/merge_config.sh + ${CP} ${FILESDIR}/FreeBSD_Fragment ${WRKSRC}/configs/ + ${CP} ${FILESDIR}/boot.cmd ${WRKSRC}/ + +.if ${UBOOT_ARCH} == arm +# For armv6/v7 we want CONFIG_API +# Use a KConfig fragment for that +do-configure: + (cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} scripts/kconfig/merge_config.sh configs/${BOARD_CONFIG} configs/FreeBSD_Fragment) +.else do-configure: (cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${MAKE_CMD} ${BOARD_CONFIG}) +.endif # U-Boot for Allwinner 64bits SoCs is splited in two parts # Generate a single binary to ease deployement on sdcard @@ -125,6 +134,11 @@ post-build: ${CAT} ${WRKSRC}/spl/sunxi-spl.bin ${WRKSRC}/u-boot.itb > ${WRKSRC}/u-boot-sunxi-with-spl.bin .endif +.if ${UBOOT_ARCH} == arm +post-build: + mkimage -C none -A arm -T script -d ${FILESDIR}/boot.cmd ${WRKSRC}/boot.scr +.endif + # If we need to put anything into WRKSRC, do so now so we can build the PLIST # in do-install .if defined(UBOOT_MOVE) diff --git a/sysutils/u-boot-master/distinfo b/sysutils/u-boot-master/distinfo index 5e2abd133d21..066193f8ed84 100644 --- a/sysutils/u-boot-master/distinfo +++ b/sysutils/u-boot-master/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1508182195 -SHA256 (freebsd-u-boot-ports-v2017.09.00_GH0.tar.gz) = 5e408dee8be45e11293771a7d8a91250dad20711088195f5d6da99d42f5d4f7e -SIZE (freebsd-u-boot-ports-v2017.09.00_GH0.tar.gz) = 14429809 +TIMESTAMP = 1521912727 +SHA256 (u-boot-2018.03.tar.bz2) = 7e7477534409d5368eb1371ffde6820f0f79780a1a1f676161c48442cb303dfd +SIZE (u-boot-2018.03.tar.bz2) = 12304292 diff --git a/sysutils/u-boot-master/files/FreeBSD_Fragment b/sysutils/u-boot-master/files/FreeBSD_Fragment new file mode 100644 index 000000000000..daba07203d5d --- /dev/null +++ b/sysutils/u-boot-master/files/FreeBSD_Fragment @@ -0,0 +1 @@ +CONFIG_API=y diff --git a/sysutils/u-boot-master/files/boot.cmd b/sysutils/u-boot-master/files/boot.cmd new file mode 100644 index 000000000000..b3ce82975eb3 --- /dev/null +++ b/sysutils/u-boot-master/files/boot.cmd @@ -0,0 +1,2 @@ +fatload ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ubldr.bin && go ${kernel_addr_r} +echo "Cannot load ubldr.bin" diff --git a/sysutils/u-boot-master/files/patch-api_api.c b/sysutils/u-boot-master/files/patch-api_api.c new file mode 100644 index 000000000000..5c8de4dead08 --- /dev/null +++ b/sysutils/u-boot-master/files/patch-api_api.c @@ -0,0 +1,14 @@ +--- api/api.c.orig 2018-01-09 01:25:29 UTC ++++ api/api.c +@@ -290,6 +290,11 @@ static int API_dev_close(va_list ap) + if (!err) + di->state = DEV_STA_CLOSED; + ++ if (dcache_status()) ++ flush_dcache_all(); ++ if (icache_status()) ++ invalidate_icache_all(); ++ + return err; + } + diff --git a/sysutils/u-boot-master/files/patch-cmd_boot.c b/sysutils/u-boot-master/files/patch-cmd_boot.c new file mode 100644 index 000000000000..b3e2a6583e88 --- /dev/null +++ b/sysutils/u-boot-master/files/patch-cmd_boot.c @@ -0,0 +1,13 @@ +--- cmd/boot.c.orig 2018-01-09 01:25:29 UTC ++++ cmd/boot.c +@@ -19,6 +19,10 @@ __attribute__((weak)) + unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, + char * const argv[]) + { ++ if (dcache_status()) ++ flush_dcache_all(); ++ if (icache_status()) ++ invalidate_icache_all(); + return entry (argc, argv); + } + diff --git a/sysutils/u-boot-master/files/patch-cmd_elf.c b/sysutils/u-boot-master/files/patch-cmd_elf.c new file mode 100644 index 000000000000..f332c2528a2b --- /dev/null +++ b/sysutils/u-boot-master/files/patch-cmd_elf.c @@ -0,0 +1,14 @@ +--- cmd/elf.c.orig 2018-01-09 01:25:29 UTC ++++ cmd/elf.c +@@ -109,6 +109,11 @@ static unsigned long do_bootelf_exec(ulong (*entry)(in + { + unsigned long ret; + ++ if (dcache_status()) ++ flush_dcache_all(); ++ if (icache_status()) ++ invalidate_icache_all(); ++ + /* + * pass address parameter as argv[0] (aka command name), + * and all remaining args |