aboutsummaryrefslogtreecommitdiff
path: root/sysutils/u-boot-rpi
diff options
context:
space:
mode:
authorBrad Davis <brd@FreeBSD.org>2015-10-23 19:12:27 +0000
committerBrad Davis <brd@FreeBSD.org>2015-10-23 19:12:27 +0000
commitb16e31e0a9eb2e171961923f5ca9b2960131ae53 (patch)
tree904f52e64303ee03fb92f88da2926739c9029bb4 /sysutils/u-boot-rpi
parent6f1821384b9a2b4e5a13ecfb2f167a5ef8d87a0a (diff)
downloadports-b16e31e0a9eb2e171961923f5ca9b2960131ae53.tar.gz
ports-b16e31e0a9eb2e171961923f5ca9b2960131ae53.zip
Notes
Diffstat (limited to 'sysutils/u-boot-rpi')
-rw-r--r--sysutils/u-boot-rpi/Makefile27
-rw-r--r--sysutils/u-boot-rpi/distinfo4
-rw-r--r--sysutils/u-boot-rpi/files/patch-api_api.c6
-rw-r--r--sysutils/u-boot-rpi/files/patch-arch_arm_cpu_arm11_cpu.c17
-rw-r--r--sysutils/u-boot-rpi/files/patch-common_cmd__boot.c18
-rw-r--r--sysutils/u-boot-rpi/files/patch-common_cmd__elf.c32
-rw-r--r--sysutils/u-boot-rpi/files/patch-common_cmd__nvedit.c46
-rw-r--r--sysutils/u-boot-rpi/files/patch-common_cmd__test.c6
-rw-r--r--sysutils/u-boot-rpi/files/patch-config.mk11
-rw-r--r--sysutils/u-boot-rpi/files/patch-include_configs_rpi-common.h (renamed from sysutils/u-boot-rpi/files/patch-include_configs_rpi__b.h)48
10 files changed, 103 insertions, 112 deletions
diff --git a/sysutils/u-boot-rpi/Makefile b/sysutils/u-boot-rpi/Makefile
index 7809e727f15d..872b1e8eae6c 100644
--- a/sysutils/u-boot-rpi/Makefile
+++ b/sysutils/u-boot-rpi/Makefile
@@ -1,10 +1,10 @@
# $FreeBSD$
PORTNAME= u-boot
-PORTVERSION= 2013.01
-PORTREVISION= 2
+PORTVERSION= 2015.10
CATEGORIES= sysutils
-MASTER_SITES= LOCAL/ian/:bootfiles
+MASTER_SITES= ftp://ftp.denx.de/pub/u-boot/ \
+ LOCAL/ian/:bootfiles
PKGNAMESUFFIX= -rpi
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
rpi-boot-files-2014.10_2.tar.bz2:bootfiles
@@ -14,20 +14,12 @@ COMMENT= Cross-build U-Boot loader for Raspberry Pi
LICENSE= GPLv2
-BUILD_DEPENDS= ${CROSS_GCC}:${PORTSDIR}/devel/arm-none-eabi-gcc492 \
- gsed:${PORTSDIR}/textproc/gsed
-
-CROSS_GCC= arm-none-eabi-gcc-4.9.2
-
-USE_GITHUB= yes
-GH_ACCOUNT= gonzoua
-GH_PROJECT= u-boot-pi
-GH_TAGNAME= 6709570
+BUILD_DEPENDS= arm-none-eabi-gcc:${PORTSDIR}/devel/arm-none-eabi-gcc
NO_ARCH= yes
-USES= gmake
-SSP_UNSAFE= yes # cross-build static linking dies with -fstack-protector
+USES= gmake tar:bzip2
+SSP_UNSAFE= yes # cross-LD does not support -fstack-protector
WRK_BOOTFILES= ${WRKDIR}/rpi-boot-files
@@ -43,13 +35,10 @@ PLIST_FILES= ${U_BOOT_DIR}/u-boot.img \
${U_BOOT_DIR}/start_cd.elf
MAKE_ARGS+= ARCH=arm \
- CROSS_COMPILE=arm-none-eabi- \
- HOSTCC=cc \
- CC=${CROSS_GCC} \
- SED=gsed
+ CROSS_COMPILE=arm-none-eabi-
do-configure:
- (cd ${WRKSRC}; ${GMAKE} ${MAKE_ARGS} rpi_b_config)
+ (cd ${WRKSRC}; ${GMAKE} rpi_defconfig)
# 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
diff --git a/sysutils/u-boot-rpi/distinfo b/sysutils/u-boot-rpi/distinfo
index e45f07cd6967..ffe29cc384fe 100644
--- a/sysutils/u-boot-rpi/distinfo
+++ b/sysutils/u-boot-rpi/distinfo
@@ -1,4 +1,4 @@
-SHA256 (gonzoua-u-boot-pi-2013.01-6709570_GH0.tar.gz) = e6c196eda2de36dce313c876f41ffa0f8353273e89c2e33382f303019fd73383
-SIZE (gonzoua-u-boot-pi-2013.01-6709570_GH0.tar.gz) = 13850358
+SHA256 (u-boot-2015.10.tar.bz2) = bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955
+SIZE (u-boot-2015.10.tar.bz2) = 10416503
SHA256 (rpi-boot-files-2014.10_2.tar.bz2) = bcaa493d3585151fde755245bee44b7d30d0e9c7ec9cc7f4dccdad57caf18cdc
SIZE (rpi-boot-files-2014.10_2.tar.bz2) = 1893216
diff --git a/sysutils/u-boot-rpi/files/patch-api_api.c b/sysutils/u-boot-rpi/files/patch-api_api.c
index aac103b5d63c..08a5edefb518 100644
--- a/sysutils/u-boot-rpi/files/patch-api_api.c
+++ b/sysutils/u-boot-rpi/files/patch-api_api.c
@@ -1,6 +1,6 @@
---- api/api.c.orig 2012-11-28 01:28:06 UTC
+--- api/api.c.orig 2015-10-19 23:59:38 UTC
+++ api/api.c
-@@ -512,45 +512,47 @@ static int API_env_set(va_list ap)
+@@ -495,45 +495,47 @@ static int API_env_set(va_list ap)
*/
static int API_env_enum(va_list ap)
{
@@ -56,7 +56,7 @@
+ if ((s = strchr(buf, '=')) != NULL)
+ *s = 0;
+ search.key = buf;
-+ if ((i = hsearch_r(search, FIND, &match, &env_htab)) == 0) {
++ if ((i = hsearch_r(search, FIND, &match, &env_htab, 0)) == 0) {
+ i = API_EINVAL;
+ goto done;
}
diff --git a/sysutils/u-boot-rpi/files/patch-arch_arm_cpu_arm11_cpu.c b/sysutils/u-boot-rpi/files/patch-arch_arm_cpu_arm11_cpu.c
new file mode 100644
index 000000000000..c8fc7127dbf0
--- /dev/null
+++ b/sysutils/u-boot-rpi/files/patch-arch_arm_cpu_arm11_cpu.c
@@ -0,0 +1,17 @@
+--- arch/arm/cpu/arm11/cpu.c.orig 2015-10-19 23:59:38 UTC
++++ arch/arm/cpu/arm11/cpu.c
+@@ -52,6 +52,14 @@ static void cache_flush(void)
+ asm volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (i));
+ }
+
++void invalidate_icache_all(void)
++{
++ /* invalidate entire icache and btb */
++ asm volatile("mcr p15, 0, %0, c7, c5, 0" : : "r" (0));
++ /* mem barrier to sync things */
++ asm volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
++}
++
+ #ifndef CONFIG_SYS_DCACHE_OFF
+
+ #ifndef CONFIG_SYS_CACHELINE_SIZE
diff --git a/sysutils/u-boot-rpi/files/patch-common_cmd__boot.c b/sysutils/u-boot-rpi/files/patch-common_cmd__boot.c
new file mode 100644
index 000000000000..2b4967f40cf5
--- /dev/null
+++ b/sysutils/u-boot-rpi/files/patch-common_cmd__boot.c
@@ -0,0 +1,18 @@
+--- common/cmd_boot.c.orig 2015-10-19 23:59:38 UTC
++++ common/cmd_boot.c
+@@ -19,6 +19,15 @@ __attribute__((weak))
+ unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
+ char * const argv[])
+ {
++ /*
++ * FreeBSD wants the caches enabled while ubldr runs, and as of r276397
++ * the kernel can tolerate being entered with internal (but not external
++ * PL310) caches enabled on armv6/7 systems. So don't disable caches
++ * here, just invalidate the icache (because we DMA'd new data into that
++ * memory recently) and launch the program directly.
++ */
++ flush_dcache_all();
++ invalidate_icache_all();
+ return entry (argc, argv);
+ }
+
diff --git a/sysutils/u-boot-rpi/files/patch-common_cmd__elf.c b/sysutils/u-boot-rpi/files/patch-common_cmd__elf.c
new file mode 100644
index 000000000000..85adbd291051
--- /dev/null
+++ b/sysutils/u-boot-rpi/files/patch-common_cmd__elf.c
@@ -0,0 +1,32 @@
+--- common/cmd_elf.c.orig 2015-10-19 23:59:38 UTC
++++ common/cmd_elf.c
+@@ -35,22 +35,15 @@ static unsigned long do_bootelf_exec(ulo
+ unsigned long ret;
+
+ /*
+- * QNX images require the data cache is disabled.
+- * Data cache is already flushed, so just turn it off.
+- */
+- int dcache = dcache_status();
+- if (dcache)
+- dcache_disable();
+-
+- /*
+- * pass address parameter as argv[0] (aka command name),
+- * and all remaining args
++ * FreeBSD wants the caches enabled while ubldr runs, and as of r276397
++ * the kernel can tolerate being entered with internal (but not external
++ * PL310) caches enabled on armv6/7 systems. So don't disable caches
++ * here, just invalidate the icache (because we DMA'd new data into that
++ * memory recently) and launch the program directly.
+ */
++ flush_dcache_all();
++ invalidate_icache_all();
+ ret = entry(argc, argv);
+-
+- if (dcache)
+- dcache_enable();
+-
+ return ret;
+ }
+
diff --git a/sysutils/u-boot-rpi/files/patch-common_cmd__nvedit.c b/sysutils/u-boot-rpi/files/patch-common_cmd__nvedit.c
deleted file mode 100644
index fdabe585e567..000000000000
--- a/sysutils/u-boot-rpi/files/patch-common_cmd__nvedit.c
+++ /dev/null
@@ -1,46 +0,0 @@
---- common/cmd_nvedit.c.orig 2012-11-28 01:28:06 UTC
-+++ common/cmd_nvedit.c
-@@ -966,6 +966,23 @@ sep_err:
- }
- #endif
-
-+#if defined(CONFIG_CMD_ENV_EXISTS)
-+static int do_env_exists(cmd_tbl_t *cmdtp, int flag, int argc,
-+ char * const argv[])
-+{
-+ ENTRY e, *ep;
-+
-+ if (argc < 2)
-+ return CMD_RET_USAGE;
-+
-+ e.key = argv[1];
-+ e.data = NULL;
-+ hsearch_r(e, FIND, &ep, &env_htab);
-+
-+ return (ep == NULL) ? 1 : 0;
-+}
-+#endif
-+
- /*
- * New command line interface: "env" command with subcommands
- */
-@@ -995,6 +1012,9 @@ static cmd_tbl_t cmd_env_sub[] = {
- U_BOOT_CMD_MKENT(save, 1, 0, do_env_save, "", ""),
- #endif
- U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 0, do_env_set, "", ""),
-+#if defined(CONFIG_CMD_ENV_EXISTS)
-+ U_BOOT_CMD_MKENT(exists, 2, 0, do_env_exists, "", ""),
-+#endif
- };
-
- #if defined(CONFIG_NEEDS_MANUAL_RELOC)
-@@ -1033,6 +1053,9 @@ static char env_help_text[] =
- #if defined(CONFIG_CMD_EDITENV)
- "env edit name - edit environment variable\n"
- #endif
-+#if defined(CONFIG_CMD_ENV_EXISTS)
-+ "env exists name - tests for existence of variable\n"
-+#endif
- #if defined(CONFIG_CMD_EXPORTENV)
- "env export [-t | -b | -c] [-s size] addr [var ...] - export environment\n"
- #endif
diff --git a/sysutils/u-boot-rpi/files/patch-common_cmd__test.c b/sysutils/u-boot-rpi/files/patch-common_cmd__test.c
index 64a4d185dd96..8ef57c2aca34 100644
--- a/sysutils/u-boot-rpi/files/patch-common_cmd__test.c
+++ b/sysutils/u-boot-rpi/files/patch-common_cmd__test.c
@@ -1,8 +1,8 @@
---- common/cmd_test.c.orig 2012-11-28 01:28:06 UTC
+--- common/cmd_test.c.orig 2015-10-19 23:59:38 UTC
+++ common/cmd_test.c
-@@ -29,9 +29,14 @@ static int do_test(cmd_tbl_t *cmdtp, int
+@@ -56,9 +56,14 @@ static int do_test(cmd_tbl_t *cmdtp, int
char * const *ap;
- int left, adv, expr, last_expr, neg, last_cmp;
+ int i, op, left, adv, expr, last_expr, last_unop, last_binop;
- /* args? */
- if (argc < 3)
diff --git a/sysutils/u-boot-rpi/files/patch-config.mk b/sysutils/u-boot-rpi/files/patch-config.mk
deleted file mode 100644
index 320f14b6e9bf..000000000000
--- a/sysutils/u-boot-rpi/files/patch-config.mk
+++ /dev/null
@@ -1,11 +0,0 @@
---- config.mk.orig 2012-11-28 01:28:06 UTC
-+++ config.mk
-@@ -90,7 +90,7 @@ HOSTCC = $(call os_x_before, 10, 5, "c
- HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp")
- HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
- else
--HOSTCC = gcc
-+HOSTCC ?= gcc
- endif
-
- ifeq ($(HOSTOS),cygwin)
diff --git a/sysutils/u-boot-rpi/files/patch-include_configs_rpi__b.h b/sysutils/u-boot-rpi/files/patch-include_configs_rpi-common.h
index 439683e4632a..7b5c15cca37b 100644
--- a/sysutils/u-boot-rpi/files/patch-include_configs_rpi__b.h
+++ b/sysutils/u-boot-rpi/files/patch-include_configs_rpi-common.h
@@ -1,51 +1,37 @@
---- include/configs/rpi_b.h.orig 2012-11-28 01:28:06 UTC
-+++ include/configs/rpi_b.h
-@@ -183,4 +183,64 @@
- #define CONFIG_INITRD_TAG
- #define CONFIG_CMD_BMP
+--- include/configs/rpi-common.h.orig 2015-10-19 23:59:38 UTC
++++ include/configs/rpi-common.h
+@@ -183,4 +183,56 @@
+
+ #define CONFIG_BOOTDELAY 2
+/*****************************************************************************
+ * FreeBSD customizations from here down.
+ ****************************************************************************/
+
-+//#define CONFIG_API
-+//#define CONFIG_CMD_ELF
-+#define CONFIG_CMD_ENV_EXISTS
++#define CONFIG_API
++#define CONFIG_CMD_ELF
+#define CONFIG_EFI_PARTITION
+#define CONFIG_PREBOOT
+
-+/* Save the env to the fat partition. */
-+#undef CONFIG_ENV_IS_NOWHERE
-+#define CONFIG_ENV_IS_IN_FAT
-+#define CONFIG_FAT_WRITE
-+#define FAT_ENV_INTERFACE "mmc"
-+#define FAT_ENV_DEVICE 0
-+#define FAT_ENV_PART 1
-+#define FAT_ENV_FILE "u-boot.env"
-+#define CONFIG_CMD_SAVEENV
++#define CONFIG_SYS_MMC_MAX_DEVICE 1
+
+/* Create a small(ish) boot environment for FreeBSD. */
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS \
-+ "loadaddr=0x02000000\0" \
-+ "stdin=serial\0" \
++ ENV_MEM_LAYOUT_SETTINGS \
++ "stdin=serial,lcd\0" \
+ "stderr=serial,lcd\0" \
+ "stdout=serial,lcd\0" \
++ \
+ "Fatboot=" \
++ "env exists bootfile || bootfile=ubldr.bin; " \
+ "env exists loaderdev || env set loaderdev ${fatdev}; " \
-+ "env exists UserFatboot && run UserFatboot; " \
++ "test ${loaderdev} = net && env exists SetupNetconfig && run SetupNetconfig; " \
+ "echo Booting from: ${fatdev} ${bootfile}; " \
-+ "fatload ${fatdev} ${loadaddr} ${bootfile} && bootelf; " \
-+ "\0" \
-+ "Netboot=" \
-+ "env exists ethact || usb start; " \
-+ "env exists loaderdev || env set loaderdev net; " \
-+ "env exists UserNetboot && run UserNetboot; " \
-+ "dhcp ${loadaddr} ${bootfile} && bootelf; " \
++ "fatload ${fatdev} ${loadaddr} ${bootfile} && bootelf || go ${loadaddr}; " \
+ "\0" \
+ "Preboot=" \
+ "fdt addr 0x100; " \
-+ "env exists bootfile || bootfile=ubldr; " \
+ "env exists uenv_file || uenv_file=uEnv.txt; " \
+ "env exists SetupFatdev && run SetupFatdev; " \
+ "env exists SetupUenv && run SetupUenv; " \
@@ -54,6 +40,10 @@
+ "SetupFatdev=" \
+ "env exists fatdev || fatdev='mmc 0'; " \
+ "\0" \
++ "SetupNetconfig=" \
++ "env exists ethact || usb start; " \
++ "env exists UserNetconfig && run UserNetconfig; " \
++ "\0" \
+ "SetupUenv=" \
+ "fatload ${fatdev} ${loadaddr} ${uenv_file} && " \
+ "env import -t ${loadaddr} ${filesize}; " \
@@ -64,4 +54,6 @@
+#undef CONFIG_PREBOOT
+#define CONFIG_PREBOOT "run Preboot"
+
++#define CONFIG_CMD_CACHE
++
#endif