From dc5aac57c2b79cb7a6c1127b4677a63e2b1f65fd Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Fri, 2 Jan 2015 02:09:29 +0000 Subject: [PATCH] Leave caches enabled when launching u-boot, it speeds up loader(8) and the kernel can tolerate being entered with caches enabled as of r276445. Approved by: imp --- sysutils/u-boot-beaglebone/Makefile | 1 + .../files/patch-common_cmd__elf.c | 33 +++++++++++++++---- .../files/patch-include_configs_am335x__evm.h | 5 ++- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/sysutils/u-boot-beaglebone/Makefile b/sysutils/u-boot-beaglebone/Makefile index e56db592c1a6..a5af20b0f3f1 100644 --- a/sysutils/u-boot-beaglebone/Makefile +++ b/sysutils/u-boot-beaglebone/Makefile @@ -2,6 +2,7 @@ PORTNAME= u-boot PORTVERSION= 2014.10 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= ftp://ftp.denx.de/pub/u-boot/ PKGNAMESUFFIX= -beaglebone diff --git a/sysutils/u-boot-beaglebone/files/patch-common_cmd__elf.c b/sysutils/u-boot-beaglebone/files/patch-common_cmd__elf.c index c1d74ccbc6c3..df55b087baad 100644 --- a/sysutils/u-boot-beaglebone/files/patch-common_cmd__elf.c +++ b/sysutils/u-boot-beaglebone/files/patch-common_cmd__elf.c @@ -1,10 +1,29 @@ --- common/cmd_elf.c.orig 2014-10-14 08:47:15 UTC +++ common/cmd_elf.c -@@ -46,6 +46,7 @@ unsigned long do_bootelf_exec(ulong (*en - * pass address parameter as argv[0] (aka command name), - * and all remaining args - */ -+ cleanup_before_linux(); - ret = entry(argc, argv); +@@ -35,22 +35,12 @@ unsigned long do_bootelf_exec(ulong (*en + 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 launch the program directly. + */ + ret = entry(argc, argv); +- +- if (dcache) +- dcache_enable(); +- + return ret; + } - if (dcache) diff --git a/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h b/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h index add727fd84b6..96c27a68e849 100644 --- a/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h +++ b/sysutils/u-boot-beaglebone/files/patch-include_configs_am335x__evm.h @@ -1,6 +1,6 @@ --- include/configs/am335x_evm.h.orig 2014-10-14 08:47:15 UTC +++ include/configs/am335x_evm.h -@@ -479,4 +479,76 @@ +@@ -479,4 +479,79 @@ #endif #endif /* NOR support */ @@ -15,6 +15,9 @@ +#define CONFIG_CMD_ENV_EXISTS +#define CONFIG_EFI_PARTITION +#define CONFIG_SYS_MMC_MAX_DEVICE 2 ++#ifndef CONFIG_SYS_DCACHE_OFF ++#define CONFIG_CMD_CACHE ++#endif +#endif + +/* Save the env to the fat partition. */