blob: e09a0f7e378e0b61af2ff533b051c376546f0a37 [file] [log] [blame]
Martin Roth9231f0b2022-10-28 22:39:23 -06001## SPDX-License-Identifier: GPL-2.0-only
Sam Lewisad7b2e22020-08-03 20:18:29 +10002ifeq ($(CONFIG_SOC_TI_AM335X),y)
Alexander Couzens8c53b752014-10-24 23:52:56 +02003bootblock-y += bootblock.c
Sam Lewisfde084b2020-08-04 19:47:50 +10004bootblock-y += timer.c
Gabe Blackeee6a7f2013-09-24 01:36:08 -07005bootblock-y += gpio.c
Gabe Black5acc76c2013-06-17 01:17:55 -07006bootblock-y += pinmux.c
Sam Lewisc25d54b2020-08-19 21:14:40 +10007bootblock-y += mmc.c
Gabe Black3c7e9392013-05-26 07:15:57 -07008
Kyösti Mälkkia38d1b22014-11-10 15:08:47 +02009romstage-y += cbmem.c
Sam Lewisfde084b2020-08-04 19:47:50 +100010romstage-y += timer.c
Sam Lewisc25d54b2020-08-19 21:14:40 +100011romstage-y += mmc.c
Sam Lewis1d8d99b2020-08-06 21:08:20 +100012romstage-y += sdram.c
Gabe Black3c7e9392013-05-26 07:15:57 -070013
Sam Lewisfde084b2020-08-04 19:47:50 +100014ramstage-y += timer.c
Sam Lewisc25d54b2020-08-19 21:14:40 +100015ramstage-y += soc.c
16ramstage-y += mmc.c
Kyösti Mälkkiafa7b132014-02-13 17:16:22 +020017
Nico Huber755db952018-11-11 01:42:17 +010018bootblock-y += uart.c
Kyösti Mälkkiafa7b132014-02-13 17:16:22 +020019romstage-y += uart.c
Gabe Black3c7e9392013-05-26 07:15:57 -070020ramstage-y += uart.c
Gabe Blackddbfc642013-05-29 16:42:35 +020021
22$(call add-class,omap-header)
Gabe Black51edd542013-09-30 23:00:33 -070023$(eval $(call create_class_compiler,omap-header,arm))
Gabe Blackddbfc642013-05-29 16:42:35 +020024
Kyösti Mälkki555c9f92016-12-07 15:01:54 +020025omap-header-generic-ccopts += -D__COREBOOT_ARM_ARCH__=7
26
Gabe Blackddbfc642013-05-29 16:42:35 +020027real-target: $(obj)/MLO
28
Nico Huber81b09f42016-01-23 00:50:00 +010029header_ld := $(call src-to-obj,omap-header,$(dir)/header.ld)
Gabe Blackddbfc642013-05-29 16:42:35 +020030
Gabe Black6e5c86f2013-06-10 20:49:15 -040031get_header_size= \
Sam Lewis266c1362020-08-03 20:50:49 +100032 $(shell echo $$(wc -c < $(objcbfs)/bootblock.bin))
Gabe Black1ef5ff22013-06-10 02:07:17 -040033
Sam Lewis266c1362020-08-03 20:50:49 +100034$(obj)/omap-header.bin: $$(omap-header-objs) $(objcbfs)/bootblock.bin
Gabe Blackddbfc642013-05-29 16:42:35 +020035 @printf " CC $(subst $(obj)/,,$(@))\n"
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070036 $(CC_omap-header) -nostdlib -nostartfiles -static -include $(obj)/config.h \
Gabe Black1ef5ff22013-06-10 02:07:17 -040037 -Wl,--defsym,header_load_size=$(strip \
Sam Lewis266c1362020-08-03 20:50:49 +100038 $(call get_header_size,$(obj)/coreboot.rom) \
Gabe Black1ef5ff22013-06-10 02:07:17 -040039 ) \
40 -o $@.tmp $< -T $(header_ld)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070041 $(OBJCOPY_omap-header) --only-section=".header" -O binary $@.tmp $@
Gabe Blackddbfc642013-05-29 16:42:35 +020042
43$(obj)/MLO: $(obj)/coreboot.rom $(obj)/omap-header.bin
44 @printf " HEADER $(subst $(obj)/,,$(@))\n"
45 $(Q)cat $(obj)/omap-header.bin $(obj)/coreboot.rom > $@
46
47omap-header-y += header.c
Julius Wernerec5e5e02014-08-20 15:29:56 -070048
Furquan Shaikh46514c22020-06-11 11:59:07 -070049omap-header-srcs += $(CONFIG_MEMLAYOUT_LD_FILE)
Julius Wernerec5e5e02014-08-20 15:29:56 -070050omap-header-y += header.ld
Sam Lewisad7b2e22020-08-03 20:18:29 +100051endif