From patchwork Tue Feb 3 20:21:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 436016 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 796BF140271 for ; Wed, 4 Feb 2015 07:22:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 41FDF4A048; Tue, 3 Feb 2015 21:22:04 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iqmQIatVmtqA; Tue, 3 Feb 2015 21:22:03 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 88DAA4A03C; Tue, 3 Feb 2015 21:22:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A3D74A03C for ; Tue, 3 Feb 2015 21:21:59 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AZxLL55fueE0 for ; Tue, 3 Feb 2015 21:21:59 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-yk0-f179.google.com (mail-yk0-f179.google.com [209.85.160.179]) by theia.denx.de (Postfix) with ESMTPS id ACCC94A032 for ; Tue, 3 Feb 2015 21:21:55 +0100 (CET) Received: by mail-yk0-f179.google.com with SMTP id 142so25427249ykq.10 for ; Tue, 03 Feb 2015 12:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=lRLWtJ1/utHcqiL5jV/kZBohvAPebRf0oxzAYLKcY5Y=; b=bu21/FdHl+OtCp0nZ5KoFj27TT/X4kwUCpRjYnsxTfEa7bwry1foC7pYui5XgFTM5U lWqwawKp1mlIsWk/QVI9PXFD4D0J4S+ibokqakpiUm2/FLPO5meVyJmA55Hn+dkC3pTX jZ+Hv6qsT/c4smnvY5IE+QYWeU61j5swNG1nG3DYCXDNQsu4sMnKAo6TrREgCW0y/ogA FL8tkMmtunts5DBIOn5LG/jjqa6Ij/q7zSMh1fsgMYfl4PTJG3bxplDIV+6sWaIbvGx5 zSaX5uANyIOpgr/0WXGUO0I92WcvfrhrTmkYs0co5lI8po+NpizFdyMBEeBGw+SUdgQB jHjg== X-Received: by 10.236.15.69 with SMTP id e45mr10596949yhe.89.1422994914362; Tue, 03 Feb 2015 12:21:54 -0800 (PST) Received: from localhost.localdomain (cpe-174-106-048-186.ec.res.rr.com. [174.106.48.186]) by mx.google.com with ESMTPSA id i35sm14860071yhq.46.2015.02.03.12.21.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 12:21:53 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Date: Tue, 3 Feb 2015 15:21:53 -0500 Message-Id: <1422994913-2393-1-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 Subject: [U-Boot] [RFC PATCH] arm: Enable CONFIG_USE_ARCH_MEMSET/MEMCPY globally X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" - Move the obj- lines for memset.S/memcpy.S to outside of an SPL check so that SPL can use them as well. - Make sure memset() / memcpy() end up in a text.fn section for garbage collection in SPL. - Update examples/api/Makefile to get memset() again on ARM. - Drop Y-MODEM SPL from am335x_evm and USB SPL so that it fits within size constraints again. - Always set CONFIG_USE_ARCH_MEMSET/MEMCPY on ARM && !ARM64 Cc: Albert Aribaud Signed-off-by: Tom Rini --- Aside from needing to split at least the am335x_evm change out (it's fine to do today, and unused in the usecase am335x_evm_usbspl is for), the setting of MEMSET/MEMCPY should be done in Kconfig. This will make opting out easier if we need that long-term. The problems today are: - Lack of arm64 memset/memcpy (Exist in kernel, could be synced over) - A thumb1? problem on platforms such as taurus that I hope would be resolved with a re-sync to the kernel again as there's some minor differences between our implementations. If we're good with the notion of always switching over to the asm versions of these functions (and keeping it selectable or not?) I can address some of these problems and of course other feedback. --- arch/arm/lib/Makefile | 4 ++-- arch/arm/lib/memcpy.S | 2 +- arch/arm/lib/memset.S | 2 +- examples/api/Makefile | 3 ++- include/config_fallbacks.h | 5 +++++ include/configs/am335x_evm.h | 2 ++ 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index d74e4b8..d4b0742 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -27,11 +27,11 @@ endif obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o obj-$(CONFIG_CMD_BOOTM) += bootm.o obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o -obj-$(CONFIG_USE_ARCH_MEMSET) += memset.o -obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o else obj-$(CONFIG_SPL_FRAMEWORK) += spl.o endif +obj-$(CONFIG_USE_ARCH_MEMSET) += memset.o +obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o obj-$(CONFIG_SEMIHOSTING) += semihosting.o obj-y += sections.o diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S index eeaf003..ffaee74 100644 --- a/arch/arm/lib/memcpy.S +++ b/arch/arm/lib/memcpy.S @@ -58,7 +58,7 @@ ldmfd sp!, {r0, \reg1, \reg2} .endm - .text + .section .text.memcpy,"ax",%progbits /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */ .syntax unified diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S index 7208f20..49bdff7 100644 --- a/arch/arm/lib/memset.S +++ b/arch/arm/lib/memset.S @@ -12,7 +12,7 @@ #include #include - .text + .section .text.memset,"ax",%progbits .align 5 .syntax unified diff --git a/examples/api/Makefile b/examples/api/Makefile index 6cf23d1..e3c0b6e 100644 --- a/examples/api/Makefile +++ b/examples/api/Makefile @@ -28,6 +28,7 @@ EXT_COBJ-y += lib/string.o EXT_COBJ-y += lib/time.o EXT_COBJ-y += lib/vsprintf.o EXT_SOBJ-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o +EXT_SOBJ-$(CONFIG_USE_ARCH_MEMSET) += arch/arm/lib/memset.o # Create a list of object files to be compiled OBJS := $(OBJ-y) $(notdir $(EXT_COBJ-y) $(EXT_SOBJ-y)) @@ -53,5 +54,5 @@ $(addprefix $(obj)/,$(notdir $(EXT_COBJ-y))): $(obj)/%.o: lib/%.c FORCE $(call if_changed_rule,cc_o_c) # Rule to build architecture-specific library assembly files -$(addprefix $(obj)/,$(notdir $(EXT_SOBJ-y))): $(obj)/%.o: arch/powerpc/lib/%.S FORCE +$(addprefix $(obj)/,$(notdir $(EXT_SOBJ-y))): $(obj)/%.o: arch/$(ARCH)/lib/%.S FORCE $(call if_changed_dep,as_o_S) diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h index ddfe045..dd17573 100644 --- a/include/config_fallbacks.h +++ b/include/config_fallbacks.h @@ -97,4 +97,9 @@ # endif #endif +#if defined(CONFIG_ARM) && !defined(CONFIG_ARM64) +#define CONFIG_USE_ARCH_MEMSET +#define CONFIG_USE_ARCH_MEMCPY +#endif + #endif /* __CONFIG_FALLBACKS_H */ diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index f1c270c..7a87b46 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -345,6 +345,8 @@ /* disable EFI partitions and partition UUID support */ #undef CONFIG_PARTITION_UUIDS #undef CONFIG_EFI_PARTITION +/* Reclaim more space */ +#undef CONFIG_SPL_YMODEM_SUPPORT /* General network SPL */ #define CONFIG_SPL_NET_SUPPORT #define CONFIG_SPL_ENV_SUPPORT