Lines Matching +full:u +full:- +full:boot +full:- +full:spl

2 # (C) Copyright 2000-2011
9 # Texas Instruments Incorporated - http://www.ti.com/
12 # SPDX-License-Identifier: GPL-2.0+
14 # Based on top-level Makefile.
20 _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
24 -include include/config/auto.conf
25 -include $(obj)/include/autoconf.mk
27 KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD
29 KBUILD_CPPFLAGS += -DCONFIG_TPL_BUILD
33 SPL_BIN := u-boot-tpl
35 SPL_BIN := u-boot-spl
53 # Enable garbage collection of un-used sections for SPL
54 KBUILD_CFLAGS += -ffunction-sections -fdata-sections
55 LDFLAGS_FINAL += --gc-sections
64 libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
65 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
69 libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/
72 libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/
75 libs-y += common/init/
77 # Special handling for a few options which support SPL/TPL
79 libs-$(CONFIG_TPL_LIBCOMMON_SUPPORT) += common/ cmd/ env/
80 libs-$(CONFIG_TPL_LIBGENERIC_SUPPORT) += lib/
82 libs-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/ cmd/ env/
83 libs-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/
86 libs-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/
88 libs-y += drivers/
90 libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/dwc3/
91 libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/cdns3/
92 libs-y += dts/
93 libs-y += fs/
94 libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/
95 libs-$(CONFIG_SPL_NET_SUPPORT) += net/
97 head-y := $(addprefix $(obj)/,$(head-y))
98 libs-y := $(addprefix $(obj)/,$(libs-y))
99 u-boot-spl-dirs := $(patsubst %/,%,$(filter %/, $(libs-y)))
101 libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
106 PLATFORM_LIBS := $(filter-out %/lib.a, $(filter-out -lgcc, $(PLATFORM_LIBS))) $(PLATFORM_LIBGCC)
109 u-boot-spl-init := $(head-y)
110 u-boot-spl-main := $(libs-y)
112 u-boot-spl-platdata := $(obj)/dts/dt-platdata.o
116 # First test whether there's a linker-script for the specific stage defined...
121 # ...then fall back to the generic SPL linker-script
129 LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot-spl.lds
132 LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot-spl.lds
135 LDSCRIPT := $(srctree)/arch/$(ARCH)/cpu/u-boot-spl.lds
145 -include $(srctree)/include/u-boot/u-boot.lds.h \
146 -include $(objtree)/include/config.h \
147 -DCPUDIR=$(CPUDIR) \
148 $(shell $(LD) --version | \
149 sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
154 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
157 MKIMAGEFLAGS_MLO = -T omapimage -a $(CONFIG_SPL_TEXT_BASE)
159 MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE)
161 MLO MLO.byteswap: $(obj)/u-boot-spl.bin FORCE
165 MKIMAGEFLAGS_boot.bin = -T atmelimage
168 MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
170 boot.bin: $(obj)/../tools/atmel_pmecc_params
173 boot.bin: $(obj)/u-boot-spl.bin FORCE
177 MKIMAGEFLAGS_boot.bin = -T zynqimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE)
180 MKIMAGEFLAGS_boot.bin = -T zynqmpimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE) \
181 -n $(srctree)/$(CONFIG_PMUFW_INIT_FILE)
184 spl/boot.bin: $(obj)/u-boot-spl.bin FORCE
188 ALL-y += $(obj)/$(SPL_BIN).bin
191 ALL-y += $(obj)/$(BOARD)-spl.bin
195 ALL-y += $(obj)/$(SPL_BIN).sfp
199 ALL-y += $(obj)/sunxi-spl.bin
202 ALL-y += $(obj)/sunxi-spl-with-ecc.bin
207 ALL-y += boot.bin
210 ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-16bit-spl.bin
212 ALL-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin
213 ALL-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin
215 all: $(ALL-y)
218 cmd_cat = cat $(filter-out $(PHONY), $^) > $@
235 $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \
236 $(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \
240 $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
243 $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
247 # Create a file that pads from the end of u-boot-spl-nodtb.bin to bss_end
248 $(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN)
253 $(obj)/$(SPL_BIN).dtb: dts/dt-tpl.dtb FORCE
256 $(obj)/$(SPL_BIN).dtb: dts/dt-spl.dtb FORCE
263 cmd_dtocc = $(pythonpath) $(srctree)/tools/dtoc/dtoc -d $(obj)/$(SPL_BIN).dtb -o $@ platdata
266 cmd_dtoch = $(pythonpath) $(srctree)/tools/dtoc/dtoc -d $(obj)/$(SPL_BIN).dtb -o $@ struct
269 cmd_plat = $(CC) $(c_flags) -c $< -o $@
271 $(obj)/dts/dt-platdata.o: $(obj)/dts/dt-platdata.c \
272 include/generated/dt-structs-gen.h
277 $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts)
279 include/generated/dt-structs-gen.h: $(obj)/$(SPL_BIN).dtb dts_dir FORCE
282 $(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir FORCE
287 VAR_SIZE_PARAM = --vs
291 $(obj)/$(BOARD)-spl.bin: $(obj)/u-boot-spl.bin
292 $(if $(wildcard $(objtree)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl),\
293 $(objtree)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl,\
300 OBJCOPYFLAGS_$(SPL_BIN)-nodtb.bin = $(SPL_OBJCFLAGS) -O binary \
301 $(if $(CONFIG_SPL_X86_16BIT_INIT),-R .start16 -R .resetvec)
303 $(obj)/$(SPL_BIN)-nodtb.bin: $(obj)/$(SPL_BIN) FORCE
306 OBJCOPYFLAGS_u-boot-x86-16bit-spl.bin := -O binary -j .start16 -j .resetvec
307 $(obj)/u-boot-x86-16bit-spl.bin: $(obj)/u-boot-spl FORCE
310 LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
313 LDFLAGS_$(SPL_BIN) += $(call ld-option, --no-dynamic-linker)
315 # First try the best-match (i.e. SPL_TEXT_BASE for SPL, TPL_TEXT_BASE for TPL)
317 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_$(SPL_TPL_)TEXT_BASE)
321 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
325 MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
331 --default-dt $(CONFIG_DEFAULT_DEVICE_TREE) $< $@
332 $(obj)/sunxi-spl.bin: $(obj)/$(SPL_BIN).bin FORCE
336 cmd_sunxi_spl_image_builder = $(objtree)/tools/sunxi-spl-image-builder \
337 -c $(CONFIG_NAND_SUNXI_SPL_ECC_STRENGTH)/$(CONFIG_NAND_SUNXI_SPL_ECC_SIZE) \
338 -p $(CONFIG_SYS_NAND_PAGE_SIZE) \
339 -o $(CONFIG_SYS_NAND_OOBSIZE) \
340 -u $(CONFIG_NAND_SUNXI_SPL_USABLE_PAGE_SIZE) \
341 -e $(CONFIG_SYS_NAND_BLOCK_SIZE) \
342 -s -b $< $@
343 $(obj)/sunxi-spl-with-ecc.bin: $(obj)/sunxi-spl.bin
346 # Rule to link u-boot-spl
348 quiet_cmd_u-boot-spl ?= LD $@
349 cmd_u-boot-spl ?= (cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
350 $(patsubst $(obj)/%,%,$(u-boot-spl-init)) --start-group \
351 $(patsubst $(obj)/%,%,$(u-boot-spl-main)) \
352 $(patsubst $(obj)/%,%,$(u-boot-spl-platdata)) \
353 --end-group \
354 $(PLATFORM_LIBS) -Map $(SPL_BIN).map -o $(SPL_BIN) && \
355 $(OBJDUMP) -t $(SPL_BIN) > $(SPL_BIN).sym)
357 $(obj)/$(SPL_BIN): $(u-boot-spl-platdata) $(u-boot-spl-init) \
358 $(u-boot-spl-main) $(obj)/u-boot-spl.lds FORCE
359 $(call if_changed,u-boot-spl)
361 $(sort $(u-boot-spl-init) $(u-boot-spl-main)): $(u-boot-spl-dirs) ;
363 PHONY += $(u-boot-spl-dirs)
364 $(u-boot-spl-dirs): $(u-boot-spl-platdata)
368 cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
369 -D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $<
371 $(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE
400 MKIMAGEFLAGS_$(SPL_BIN).multidtb.fit = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
401 -n "Multi DTB fit image for $(SPL_BIN)" -E \
402 $(patsubst %,-b %,$(SHRUNK_ARCH_DTB))
408 @gzip -kf9 $< > $@
411 @lzop -f9 $< > $@