From b81fdb04868e21693f5dfe9242ff6f49fcfe5a93 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 5 Feb 2014 20:49:20 -0700 Subject: pxe: allow compilation when !defined(CONFIG_CMD_NET) pxe.c provides both the "pxe" command which relies on a network, and the "sysboot" command which doesn't. Fix the file to compile when network support isn't enabled. This is useful e.g. on the Raspberry Pi which has no network support yet, but will soon support the sysboot command. Signed-off-by: Stephen Warren --- common/cmd_pxe.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common') diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 29e48db..3d13268 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -45,6 +45,7 @@ static char *from_env(const char *envvar) return ret; } +#ifdef CONFIG_CMD_NET /* * Convert an ethaddr from the environment to the format used by pxelinux * filenames based on mac addresses. Convert's ':' to '-', and adds "01-" to @@ -75,6 +76,7 @@ static int format_mac_pxe(char *outbuf, size_t outbuf_len) return 1; } +#endif /* * Returns the directory the file specified in the bootfile env variable is @@ -120,6 +122,7 @@ static int get_bootfile_path(const char *file_path, char *bootfile_path, static int (*do_getfile)(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr); +#ifdef CONFIG_CMD_NET static int do_get_tftp(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr) { char *tftp_argv[] = {"tftp", NULL, NULL, NULL}; @@ -132,6 +135,7 @@ static int do_get_tftp(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr) return 1; } +#endif static char *fs_argv[5]; @@ -249,6 +253,8 @@ static int get_pxe_file(cmd_tbl_t *cmdtp, const char *file_path, void *file_addr return 1; } +#ifdef CONFIG_CMD_NET + #define PXELINUX_DIR "pxelinux.cfg/" /* @@ -397,6 +403,7 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; } +#endif /* * Wrapper to make it easier to store the file at file_path in the location @@ -647,6 +654,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) len += strlen(ip_str); } +#ifdef CONFIG_CMD_NET if (label->ipappend & 0x2) { int err; strcpy(mac_str, " BOOTIF="); @@ -655,6 +663,7 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label) mac_str[0] = '\0'; len += strlen(mac_str); } +#endif if (label->append) len += strlen(label->append); @@ -1500,6 +1509,7 @@ static void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg) boot_unattempted_labels(cmdtp, cfg); } +#ifdef CONFIG_CMD_NET /* * Boots a system using a pxe file * @@ -1576,6 +1586,7 @@ U_BOOT_CMD( "get - try to retrieve a pxe file using tftp\npxe " "boot [pxefile_addr_r] - boot from the pxe file at pxefile_addr_r\n" ); +#endif /* * Boots a system using a local disk syslinux/extlinux file -- cgit v1.1 From b60eff31f3bd71a6f14b6c6efc8ad5fb3705de6d Mon Sep 17 00:00:00 2001 From: Albert ARIBAUD Date: Sat, 22 Feb 2014 17:53:43 +0100 Subject: arm: remove unneeded symbol offsets and _TEXT_BASE Remove the last uses of symbol offsets in ARM U-Boot. Remove some needless uses of _TEXT_BASE. Remove all _TEXT_BASE definitions. Signed-off-by: Albert ARIBAUD --- common/board_f.c | 14 +++----------- common/board_r.c | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index 02965b0..5b9ba07 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -149,13 +149,9 @@ static int display_text_info(void) #ifndef CONFIG_SANDBOX ulong bss_start, bss_end; -#ifdef CONFIG_SYS_SYM_OFFSETS - bss_start = _bss_start_ofs + _TEXT_BASE; - bss_end = _bss_end_ofs + _TEXT_BASE; -#else bss_start = (ulong)&__bss_start; bss_end = (ulong)&__bss_end; -#endif + debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n", CONFIG_SYS_TEXT_BASE, bss_start, bss_end); #endif @@ -279,8 +275,8 @@ static int zero_global_data(void) static int setup_mon_len(void) { -#ifdef CONFIG_SYS_SYM_OFFSETS - gd->mon_len = _bss_end_ofs; +#ifdef __ARM__ + gd->mon_len = (ulong)&__bss_end - (ulong)_start; #elif defined(CONFIG_SANDBOX) gd->mon_len = (ulong)&_end - (ulong)_init; #else @@ -363,11 +359,7 @@ static int setup_fdt(void) gd->fdt_blob = __dtb_dt_begin; #elif defined CONFIG_OF_SEPARATE /* FDT is at end of image */ -# ifdef CONFIG_SYS_SYM_OFFSETS - gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE); -# else gd->fdt_blob = (ulong *)&_end; -# endif #elif defined(CONFIG_OF_HOSTFILE) if (read_fdt_from_file()) { puts("Failed to read control FDT\n"); diff --git a/common/board_r.c b/common/board_r.c index c2d0763..899f377 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -128,8 +128,8 @@ __weak int fixup_cpu(void) static int initr_reloc_global_data(void) { -#ifdef CONFIG_SYS_SYM_OFFSETS - monitor_flash_len = _end_ofs; +#ifdef __ARM__ + monitor_flash_len = _end - __image_copy_start; #elif !defined(CONFIG_SANDBOX) monitor_flash_len = (ulong)&__init_end - gd->relocaddr; #endif -- cgit v1.1 From 1551df35f296f0a8df32f4f2054254f46e8be252 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 25 Feb 2014 10:27:01 -0500 Subject: arm: Switch to -mno-unaligned-access when supported by the compiler When we tell the compiler to optimize for ARMv7 (and ARMv6 for that matter) it assumes a default of SCTRL.A being cleared and unaligned accesses being allowed and fast at the hardware level. We set this bit and must pass along -mno-unaligned-access so that the compiler will still breakdown accesses and not trigger a data abort. To better help understand the requirements of the project with respect to unaligned memory access, the Documentation/unaligned-memory-access.txt file has been added as doc/README.unaligned-memory-access.txt and is taken from the v3.14-rc1 tag of the kernel. Cc: Albert ARIBAUD Cc: Mans Rullgard Signed-off-by: Tom Rini --- common/Makefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 3b2ff9b..70f813e 100644 --- a/common/Makefile +++ b/common/Makefile @@ -239,5 +239,3 @@ obj-y += memsize.o obj-y += stdio.o CFLAGS_env_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null) -CFLAGS_hush.o := $(PLATFORM_NO_UNALIGNED) -CFLAGS_fdt_support.o := $(PLATFORM_NO_UNALIGNED) -- cgit v1.1