From a8c075414a48663b0604c22b90883e651c1a053d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 5 Dec 2013 15:08:31 +0900 Subject: Makefile: use two double-quotations as a pair Some editors such as Emacs can highlight source files. But their parser algorithm is not perfect. If you use one double-quotation alone, some editor cannot handle it nicely and mark source lines as a string by mistake. It is preferable to use two double-quotations as a pair. Signed-off-by: Masahiro Yamada --- spl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spl') diff --git a/spl/Makefile b/spl/Makefile index 2a787afa4f9..b816e20efc9 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -37,7 +37,7 @@ endif HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(SRCTREE)/board/$(VENDOR)/common/Makefile),y,n) ifdef CONFIG_SPL_START_S_PATH -START_PATH := $(subst ",,$(CONFIG_SPL_START_S_PATH)) +START_PATH := $(CONFIG_SPL_START_S_PATH:"%"=%) else START_PATH := $(CPUDIR) endif @@ -118,7 +118,7 @@ __LIBS := $(subst $(obj),,$(LIBS)) # Linker Script ifdef CONFIG_SPL_LDSCRIPT # need to strip off double quotes -LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SPL_LDSCRIPT))) +LDSCRIPT := $(addprefix $(SRCTREE)/,$(CONFIG_SPL_LDSCRIPT:"%"=%)) endif ifeq ($(wildcard $(LDSCRIPT)),) -- cgit v1.3.1 From ba931259b10477f5cd2dd43b290d986335d506ba Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 11 Dec 2013 10:00:08 +0900 Subject: spl/Makefile: merge LIBS-y += arch/$(ARCH)/imx-common Signed-off-by: Masahiro Yamada --- spl/Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'spl') diff --git a/spl/Makefile b/spl/Makefile index b816e20efc9..9b862be9a5f 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -90,17 +90,13 @@ LIBS-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += drivers/usb/musb-new/ LIBS-$(CONFIG_SPL_USBETH_SUPPORT) += drivers/usb/gadget/ LIBS-$(CONFIG_SPL_WATCHDOG_SUPPORT) += drivers/watchdog/ -ifneq (,$(CONFIG_MX23)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) +ifneq (,$(CONFIG_MX23)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) LIBS-y += arch/$(ARCH)/imx-common/ endif LIBS-$(CONFIG_ARM) += arch/arm/cpu/ LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/ -ifneq ($(CONFIG_MX23)$(CONFIG_MX35),) -LIBS-y += arch/$(ARCH)/imx-common/ -endif - LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y)) # Add GCC lib -- cgit v1.3.1 From 93f70dfd58ff0c291c88af57785f131d534d5559 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 26 Nov 2013 18:05:45 +0900 Subject: .gitignore: ignore spl/ and tpl/ directories except spl/Makefile Before this commit, output files under tpl/ directry were not ignored. This commit fixes this problem. And we have only one source file under spl/ directory: spl/Makefile So, we can describe .gitignore more simply. Signed-off-by: Masahiro Yamada --- .gitignore | 7 ++++--- spl/.gitignore | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 spl/.gitignore (limited to 'spl') diff --git a/.gitignore b/.gitignore index a39bd54d38d..a1f07f00c67 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,10 @@ /errlog /reloc_off +/spl/ +!/spl/Makefile +/tpl/ + /include/generated/ /include/spl-autoconf.mk /include/tpl-autoconf.mk @@ -88,6 +92,3 @@ GPATH GRTAGS GSYMS GTAGS - -# spl ais files -/spl/*.ais diff --git a/spl/.gitignore b/spl/.gitignore deleted file mode 100644 index 7c8814709f6..00000000000 --- a/spl/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -u-boot-spl -u-boot-spl.bin -u-boot-spl.lds -u-boot-spl.map -- cgit v1.3.1 From 392ba5256ab9bf017a9b7320ef0cee98862c908d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 28 Nov 2013 12:22:17 +0900 Subject: drivers/mtd: descend into sub directories only when it is necessary Signed-off-by: Masahiro Yamada --- Makefile | 4 ++-- drivers/mtd/nand/Makefile | 3 --- drivers/mtd/ubi/Makefile | 3 --- spl/Makefile | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) (limited to 'spl') diff --git a/Makefile b/Makefile index 468b1bc605e..b251bf64974 100644 --- a/Makefile +++ b/Makefile @@ -249,9 +249,9 @@ LIBS-y += drivers/i2c/ LIBS-y += drivers/input/ LIBS-y += drivers/mmc/ LIBS-y += drivers/mtd/ -LIBS-y += drivers/mtd/nand/ +LIBS-$(CONFIG_CMD_NAND) += drivers/mtd/nand/ LIBS-y += drivers/mtd/onenand/ -LIBS-y += drivers/mtd/ubi/ +LIBS-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/ LIBS-y += drivers/mtd/spi/ LIBS-y += drivers/net/ LIBS-y += drivers/net/phy/ diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile index e145cd18421..02b149cacca 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile @@ -5,8 +5,6 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifdef CONFIG_CMD_NAND - ifdef CONFIG_SPL_BUILD ifdef CONFIG_SPL_NAND_DRIVERS @@ -69,4 +67,3 @@ obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_spl.o obj-$(CONFIG_NAND_MXC) += mxc_nand_spl.o endif # drivers -endif # nand diff --git a/drivers/mtd/ubi/Makefile b/drivers/mtd/ubi/Makefile index e1f3a241a26..56c2823477d 100644 --- a/drivers/mtd/ubi/Makefile +++ b/drivers/mtd/ubi/Makefile @@ -5,9 +5,6 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifdef CONFIG_CMD_UBI obj-y += build.o vtbl.o vmt.o upd.o kapi.o eba.o io.o wl.o scan.o crc32.o - obj-y += misc.o obj-y += debug.o -endif diff --git a/spl/Makefile b/spl/Makefile index 9b862be9a5f..ec0983170a0 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -78,7 +78,7 @@ LIBS-y += fs/ LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/ LIBS-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/ \ drivers/power/pmic/ -LIBS-$(CONFIG_SPL_NAND_SUPPORT) += drivers/mtd/nand/ +LIBS-$(if $(CONFIG_CMD_NAND),$(CONFIG_SPL_NAND_SUPPORT)) += drivers/mtd/nand/ LIBS-$(CONFIG_SPL_ONENAND_SUPPORT) += drivers/mtd/onenand/ LIBS-$(CONFIG_SPL_DMA_SUPPORT) += drivers/dma/ LIBS-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/ -- cgit v1.3.1 From e8a8b8246a5e7dee9db19b14b31039389ccf99af Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 28 Nov 2013 12:09:59 +0900 Subject: Makefile: Select objects by CONFIG_ rather than $(ARCH) or $(CPU) Convert like follows: CPU mpc83xx -> CONFIG_MPC83xx CPU mpc85xx -> CONFIG_MPC85xx CPU mpc86xx -> CONFIG_MPC86xx CPU mpc5xxx -> CONFIG_MPC5xxx CPU mpc8xx -> CONFIG_8xx CPU mpc8260 -> CONFIG_8260 CPU ppc4xx -> CONFIG_4xx CPU x86 -> CONFIG_X86 ARCH x86 -> CONFIG_X86 ARCH powerpc -> CONFIG_PPC Signed-off-by: Masahiro Yamada --- Makefile | 12 ++++-------- arch/powerpc/cpu/Makefile | 6 +++--- arch/powerpc/cpu/mpc8xxx/Makefile | 6 ++---- examples/standalone/Makefile | 26 +++++++++++++------------- post/Makefile | 6 +++--- spl/Makefile | 17 +++++------------ 6 files changed, 30 insertions(+), 43 deletions(-) (limited to 'spl') diff --git a/Makefile b/Makefile index a0e59737a83..ca3c5c3c5da 100644 --- a/Makefile +++ b/Makefile @@ -213,15 +213,11 @@ endif ######################################################################### # U-Boot objects....order is important (i.e. start must be first) -OBJS = $(CPUDIR)/start.o -ifeq ($(CPU),ppc4xx) -OBJS += $(CPUDIR)/resetvec.o -endif -ifeq ($(CPU),mpc85xx) -OBJS += $(CPUDIR)/resetvec.o -endif +head-y := $(CPUDIR)/start.o +head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o +head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o -OBJS := $(addprefix $(obj),$(OBJS)) +OBJS := $(addprefix $(obj),$(head-y)) HAVE_VENDOR_COMMON_LIB = $(if $(wildcard board/$(VENDOR)/common/Makefile),y,n) diff --git a/arch/powerpc/cpu/Makefile b/arch/powerpc/cpu/Makefile index d630abe1da5..88b5298be0c 100644 --- a/arch/powerpc/cpu/Makefile +++ b/arch/powerpc/cpu/Makefile @@ -1,3 +1,3 @@ -ifneq ($(filter mpc83xx mpc85xx mpc86xx,$(CPU)),) -obj-y += mpc8xxx/ -endif +obj-$(CONFIG_MPC83xx) += mpc8xxx/ +obj-$(CONFIG_MPC85xx) += mpc8xxx/ +obj-$(CONFIG_MPC86xx) += mpc8xxx/ diff --git a/arch/powerpc/cpu/mpc8xxx/Makefile b/arch/powerpc/cpu/mpc8xxx/Makefile index f66ee2e4239..e95539e0a3e 100644 --- a/arch/powerpc/cpu/mpc8xxx/Makefile +++ b/arch/powerpc/cpu/mpc8xxx/Makefile @@ -19,10 +19,8 @@ ifdef MINIMAL obj-$(CONFIG_FSL_LAW) += law.o else - -ifneq ($(CPU),mpc83xx) -obj-y += cpu.o -endif +obj-$(CONFIG_MPC85xx) += cpu.o +obj-$(CONFIG_MPC86xx) += cpu.o obj-$(CONFIG_OF_LIBFDT) += fdt.o obj-$(CONFIG_FSL_LBC) += fsl_lbc.o diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index f4f102b3e1c..6e7500dc75d 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -7,25 +7,27 @@ include $(TOPDIR)/config.mk -ELF-$(ARCH) := -ELF-$(CPU) := ELF-y := hello_world ELF-$(CONFIG_SMC91111) += smc91111_eeprom ELF-$(CONFIG_SMC911X) += smc911x_eeprom ELF-$(CONFIG_SPI_FLASH_ATMEL) += atmel_df_pow2 -ELF-i386 += 82559_eeprom -ELF-mpc5xxx += interrupt -ELF-mpc8xx += test_burst timer -ELF-mpc8260 += mem_to_mem_idma2intr -ELF-ppc += sched +# TODO: +# - Fix the warning of 82559_eeprom.c and uncomment the following +# or +# - Delete 82559_eeprom.c and the following line +#ELF-$(CONFIG_X86) += 82559_eeprom +ELF-$(CONFIG_MPC5xxx) += interrupt +ELF-$(CONFIG_8xx) += test_burst timer +ELF-$(CONFIG_8260) += mem_to_mem_idma2intr +ELF-$(CONFIG_PPC) += sched # # Some versions of make do not handle trailing white spaces properly; # leading to build failures. The problem was found with GNU Make 3.80. # Using 'strip' as a workaround for the problem. # -ELF := $(strip $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(CPU))) +ELF := $(strip $(ELF-y)) SREC := $(addsuffix .srec,$(ELF)) BIN := $(addsuffix .bin,$(ELF)) @@ -34,11 +36,9 @@ COBJS := $(ELF:=.o) LIB = $(obj)libstubs.o -LIBAOBJS-$(ARCH) := -LIBAOBJS-$(CPU) := -LIBAOBJS-ppc += $(ARCH)_longjmp.o $(ARCH)_setjmp.o -LIBAOBJS-mpc8xx += test_burst_lib.o -LIBAOBJS := $(LIBAOBJS-$(ARCH)) $(LIBAOBJS-$(CPU)) +LIBAOBJS-$(CONFIG_PPC) += ppc_longjmp.o ppc_setjmp.o +LIBAOBJS-$(CONFIG_8xx) += test_burst_lib.o +LIBAOBJS := $(LIBAOBJS-y) LIBCOBJS = stubs.o diff --git a/post/Makefile b/post/Makefile index 20a463a3453..2fa6f8a295a 100644 --- a/post/Makefile +++ b/post/Makefile @@ -10,9 +10,9 @@ obj-$(CONFIG_POST_STD_LIST) += tests.o obj-y += drivers/ obj-$(CONFIG_PPC) += lib_powerpc/ -ifneq ($(filter mpc83xx mpc8xx ppc4xx,$(CPU)),) -obj-y += cpu/$(CPU)/ -endif +obj-$(CONFIG_MPC83xx) += cpu/mpc83xx/ +obj-$(CONFIG_8xx) += cpu/mpc8xx/ +obj-$(CONFIG_4xx) += cpu/ppc4xx/ ifneq ($(filter lwmon lwmon5 netta pdm360ng,$(BOARD)),) obj-y += board/$(BOARD)/ endif diff --git a/spl/Makefile b/spl/Makefile index ec0983170a0..1e88d7469f4 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -42,17 +42,10 @@ else START_PATH := $(CPUDIR) endif -START := $(START_PATH)/start.o -ifeq ($(CPU),x86) -START += $(START_PATH)/start16.o -START += $(START_PATH)/resetvec.o -endif -ifeq ($(CPU),ppc4xx) -START += $(START_PATH)/resetvec.o -endif -ifeq ($(CPU),mpc85xx) -START += $(START_PATH)/resetvec.o -endif +head-y := $(START_PATH)/start.o +head-$(CONFIG_X86) += $(START_PATH)/start16.o $(START_PATH)/resetvec.o +head-$(CONFIG_4xx) += $(START_PATH)/resetvec.o +head-$(CONFIG_MPC85xx) += $(START_PATH)/resetvec.o LIBS-y += arch/$(ARCH)/lib/ @@ -105,7 +98,7 @@ PLATFORM_LIBGCC = $(SPLTREE)/arch/$(ARCH)/lib/libgcc.o PLATFORM_LIBS := $(filter-out %/libgcc.o, $(filter-out -lgcc, $(PLATFORM_LIBS))) $(PLATFORM_LIBGCC) endif -START := $(addprefix $(SPLTREE)/,$(START)) +START := $(addprefix $(SPLTREE)/,$(head-y)) LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y))) __START := $(subst $(obj),,$(START)) -- cgit v1.3.1 From b02bfc4dfcef3be8276521e1933573e97a5cf203 Mon Sep 17 00:00:00 2001 From: Albert ARIBAUD Date: Mon, 13 Jan 2014 14:57:05 +0100 Subject: arm: put .hash, .got.plt and .machine_param back in binaries Some targets will build fine but not boot if sections .hash and .got.plt are not present in the binary. Add them back. Also, Exynos machines require .machine_param section in SPL. Add it. Signed-off-by: Albert ARIBAUD Tested-by: Rajeshwari S Shinde --- arch/arm/config.mk | 2 +- arch/arm/cpu/armv7/exynos/config.mk | 7 +++++++ arch/arm/cpu/u-boot.lds | 3 +-- spl/Makefile | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/config.mk (limited to 'spl') diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 329c7a7f01d..cfa42094ca7 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -109,5 +109,5 @@ endif ifdef CONFIG_ARM64 OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn else -OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rel.dyn +OBJCFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn endif diff --git a/arch/arm/cpu/armv7/exynos/config.mk b/arch/arm/cpu/armv7/exynos/config.mk new file mode 100644 index 00000000000..ee0d2dab7b8 --- /dev/null +++ b/arch/arm/cpu/armv7/exynos/config.mk @@ -0,0 +1,7 @@ +# +# Copyright (C) Albert ARIBAUD +# +# SPDX-License-Identifier: GPL-2.0+ +# + +SPL_OBJCFLAGS += -j .machine_param diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 9463a33dcb3..4da5d246e0e 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -92,8 +92,6 @@ SECTIONS } .dynsym _end : { *(.dynsym) } - .hash : { *(.hash) } - .got.plt : { *(.got.plt) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) } @@ -101,4 +99,5 @@ SECTIONS .interp : { *(.interp*) } .gnu : { *(.gnu*) } .ARM.exidx : { *(.ARM.exidx*) } + .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } } diff --git a/spl/Makefile b/spl/Makefile index 003956ebb34..5e5472d97ce 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -165,7 +165,7 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin endif $(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN) - $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ GEN_UBOOT = \ cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \ -- cgit v1.3.1