Lines Matching +full:zynqmp +full:- +full:dwc3
1 # SPDX-License-Identifier: GPL-2.0+
3 # (C) Copyright 2000-2011
10 # Texas Instruments Incorporated - http://www.ti.com/
12 # Based on top-level Makefile.
18 _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
22 -include include/config/auto.conf
23 -include $(obj)/include/autoconf.mk
25 KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD
27 KBUILD_CPPFLAGS += -DCONFIG_TPL_BUILD
31 SPL_BIN := u-boot-tpl
33 SPL_BIN := u-boot-spl
60 # Enable garbage collection of un-used sections for SPL
61 KBUILD_CFLAGS += -ffunction-sections -fdata-sections
62 LDFLAGS_FINAL += --gc-sections -pie
71 libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
72 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
74 libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/
75 libs-y += common/init/
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/
85 libs-$(CONFIG_PARTITIONS) += disk/
89 libs-y += drivers/
90 libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/dwc3/
91 libs-y += dts/
92 libs-y += fs/
93 libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/
94 libs-$(CONFIG_SPL_NET_SUPPORT) += net/
96 head-y := $(addprefix $(obj)/,$(head-y))
97 libs-y := $(addprefix $(obj)/,$(libs-y))
98 u-boot-spl-dirs := $(patsubst %/,%,$(filter %/, $(libs-y)))
100 libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
105 PLATFORM_LIBS := $(filter-out %/lib.a, $(filter-out -lgcc, $(PLATFORM_LIBS))) $(PLATFORM_LIBGCC)
108 u-boot-spl-init := $(head-y)
109 u-boot-spl-main := $(libs-y)
111 u-boot-spl-platdata := $(obj)/dts/dt-platdata.o
115 # First test whether there's a linker-script for the specific stage defined...
120 # ...then fall back to the generic SPL linker-script
128 LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot-spl.lds
131 LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot-spl.lds
134 LDSCRIPT := $(srctree)/arch/$(ARCH)/cpu/u-boot-spl.lds
144 -include $(srctree)/include/u-boot/u-boot.lds.h \
145 -include $(objtree)/include/config.h \
146 -DCPUDIR=$(CPUDIR) \
147 $(shell $(LD) --version | \
148 sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
153 LDPPFLAGS += -DIMAGE_MAX_SIZE=$(CONFIG_$(SPL_TPL_)MAX_SIZE)
156 LDPPFLAGS += -DIMAGE_TEXT_BASE=$(CONFIG_$(SPL_TPL_)TEXT_BASE)
162 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
166 cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(SPL_ITS) -E $@ \
169 MKIMAGEFLAGS_MLO = -T omapimage -a $(CONFIG_SPL_TEXT_BASE)
171 MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a $(CONFIG_SPL_TEXT_BASE)
173 MLO MLO.byteswap: $(obj)/u-boot-spl.bin FORCE
177 MKIMAGEFLAGS_boot.bin = -T atmelimage
180 MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
185 boot.bin: $(obj)/u-boot-spl.bin FORCE
189 MKIMAGEFLAGS_boot.bin = -T zynqimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE)
193 spl/boot.bin: zynqmp-check-pmufw
194 zynqmp-check-pmufw: FORCE
195 ( cd $(srctree) && test -r $(CONFIG_PMUFW_INIT_FILE) ) \
198 MKIMAGEFLAGS_boot.bin = -T zynqmpimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE) \
199 -n "$(shell cd $(srctree); readlink -f $(CONFIG_PMUFW_INIT_FILE))"
202 $(obj)/$(SPL_BIN)-align.bin: $(obj)/$(SPL_BIN).bin
205 spl/boot.bin: $(obj)/$(SPL_BIN)-align.bin FORCE
209 ALL-y += $(obj)/$(SPL_BIN).bin
212 ALL-y += $(obj)/$(BOARD)-spl.bin
216 ALL-y += $(obj)/$(SPL_BIN).sfp
220 ALL-y += $(obj)/sunxi-spl.bin
223 ALL-y += $(obj)/sunxi-spl-with-ecc.bin
228 ALL-y += boot.bin
231 ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-16bit-spl.bin
233 ALL-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin
234 ALL-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin
236 ALL-$(CONFIG_ARCH_MEDIATEK) += $(obj)/u-boot-spl-mtk.bin
238 all: $(ALL-y)
241 cmd_cat = cat $(filter-out $(PHONY), $^) > $@
258 $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \
259 $(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \
263 $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
266 $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
270 # Create a file that pads from the end of u-boot-spl-nodtb.bin to bss_end
271 $(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN)
275 $(obj)/$(SPL_BIN).dtb: dts/dt-spl.dtb FORCE
281 cmd_dtocc = $(pythonpath) $(srctree)/tools/dtoc/dtoc -d $(obj)/$(SPL_BIN).dtb -o $@ platdata
284 cmd_dtoch = $(pythonpath) $(srctree)/tools/dtoc/dtoc -d $(obj)/$(SPL_BIN).dtb -o $@ struct
287 cmd_plat = $(CC) $(c_flags) -c $< -o $@
289 $(obj)/dts/dt-platdata.o: $(obj)/dts/dt-platdata.c \
290 include/generated/dt-structs-gen.h
295 $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts)
297 include/generated/dt-structs-gen.h: $(obj)/$(SPL_BIN).dtb dts_dir FORCE
300 $(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir FORCE
305 VAR_SIZE_PARAM = --vs
309 $(obj)/$(BOARD)-spl.bin: $(obj)/u-boot-spl.bin
318 OBJCOPYFLAGS_$(SPL_BIN)-nodtb.bin = $(SPL_OBJCFLAGS) -O binary \
319 $(if $(CONFIG_SPL_X86_16BIT_INIT),-R .start16 -R .resetvec)
321 $(obj)/$(SPL_BIN)-nodtb.bin: $(obj)/$(SPL_BIN) FORCE
324 OBJCOPYFLAGS_u-boot-x86-16bit-spl.bin := -O binary -j .start16 -j .resetvec
325 $(obj)/u-boot-x86-16bit-spl.bin: $(obj)/u-boot-spl FORCE
328 LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
331 LDFLAGS_$(SPL_BIN) += $(call ld-option, --no-dynamic-linker)
333 # Avoid 'warning: u-boot-spl has a LOAD segment with RWX permissions'
334 LDFLAGS_$(SPL_BIN) += $(call ld-option,--no-warn-rwx-segments)
336 # Avoid 'missing .note.GNU-stack section implies executable stack'
337 LDFLAGS_$(SPL_BIN) += -z noexecstack
339 # Pick the best-match (i.e. SPL_TEXT_BASE for SPL, TPL_TEXT_BASE for TPL)
341 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_$(SPL_TPL_)TEXT_BASE)
345 MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage_v1
347 MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
354 --default-dt $(CONFIG_DEFAULT_DEVICE_TREE) $< $@
355 $(obj)/sunxi-spl.bin: $(obj)/$(SPL_BIN).bin FORCE
359 cmd_sunxi_spl_image_builder = $(objtree)/tools/sunxi-spl-image-builder \
360 -c $(CONFIG_NAND_SUNXI_SPL_ECC_STRENGTH)/$(CONFIG_NAND_SUNXI_SPL_ECC_SIZE) \
361 -p $(CONFIG_SYS_NAND_PAGE_SIZE) \
362 -o $(CONFIG_SYS_NAND_OOBSIZE) \
363 -u $(CONFIG_NAND_SUNXI_SPL_USABLE_PAGE_SIZE) \
364 -e $(CONFIG_SYS_NAND_BLOCK_SIZE) \
365 -s -b $< $@
366 $(obj)/sunxi-spl-with-ecc.bin: $(obj)/sunxi-spl.bin
371 MKIMAGEFLAGS_u-boot-spl-mtk.bin = -T mtk_image \
372 -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) \
373 -n "$(patsubst "%",%,$(CONFIG_MTK_BROM_HEADER_INFO))"
375 $(obj)/u-boot-spl-mtk.bin: $(obj)/u-boot-spl.bin FORCE
378 # Rule to link u-boot-spl
380 quiet_cmd_u-boot-spl ?= LD $@
381 cmd_u-boot-spl ?= (cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
382 $(patsubst $(obj)/%,%,$(u-boot-spl-init)) --start-group \
383 $(patsubst $(obj)/%,%,$(u-boot-spl-main)) \
384 $(patsubst $(obj)/%,%,$(u-boot-spl-platdata)) \
385 --end-group \
386 $(PLATFORM_LIBS) -Map $(SPL_BIN).map -o $(SPL_BIN))
388 $(obj)/$(SPL_BIN): $(u-boot-spl-platdata) $(u-boot-spl-init) \
389 $(u-boot-spl-main) $(obj)/u-boot-spl.lds FORCE
390 $(call if_changed,u-boot-spl)
392 $(sort $(u-boot-spl-init) $(u-boot-spl-main)): $(u-boot-spl-dirs) ;
394 PHONY += $(u-boot-spl-dirs)
395 $(u-boot-spl-dirs): $(u-boot-spl-platdata)
399 cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
400 -D__ASSEMBLY__ -x assembler-with-cpp -std=c99 -P -o $@ $<
402 $(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE
431 MKIMAGEFLAGS_$(SPL_BIN).multidtb.fit = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
432 -n "Multi DTB fit image for $(SPL_BIN)" -E \
433 $(patsubst %,-b %,$(SHRUNK_ARCH_DTB))
438 touch -d @$(SOURCE_DATE_EPOCH) $(obj)/$(SPL_BIN).multidtb.fit
443 @gzip -kf9 $< > $@
446 @lzop -f9 $< > $@
449 tispl.bin: $(obj)/u-boot-spl-nodtb.bin $(SHRUNK_ARCH_DTB) $(SPL_ITS) FORCE