blob: 4e35529889d6aa8fb8c8126d5ee8e59f84949ab4 [file] [log] [blame]
Sam Lewisad7b2e22020-08-03 20:18:29 +10001ifeq ($(CONFIG_SOC_TI_AM335X),y)
Alexander Couzens8c53b752014-10-24 23:52:56 +02002bootblock-y += bootblock.c
Sam Lewisfde084b2020-08-04 19:47:50 +10003bootblock-y += timer.c
Gabe Blackeee6a7f2013-09-24 01:36:08 -07004bootblock-y += gpio.c
Gabe Black5acc76c2013-06-17 01:17:55 -07005bootblock-y += pinmux.c
Sam Lewisc25d54b2020-08-19 21:14:40 +10006bootblock-y += mmc.c
Gabe Black3c7e9392013-05-26 07:15:57 -07007
Kyösti Mälkkia38d1b22014-11-10 15:08:47 +02008romstage-y += cbmem.c
Sam Lewisfde084b2020-08-04 19:47:50 +10009romstage-y += timer.c
Sam Lewisc25d54b2020-08-19 21:14:40 +100010romstage-y += mmc.c
Sam Lewis1d8d99b2020-08-06 21:08:20 +100011romstage-y += sdram.c
Gabe Black3c7e9392013-05-26 07:15:57 -070012
Sam Lewisfde084b2020-08-04 19:47:50 +100013ramstage-y += timer.c
Sam Lewisc25d54b2020-08-19 21:14:40 +100014ramstage-y += soc.c
15ramstage-y += mmc.c
Kyösti Mälkkiafa7b132014-02-13 17:16:22 +020016
Nico Huber755db952018-11-11 01:42:17 +010017bootblock-y += uart.c
Kyösti Mälkkiafa7b132014-02-13 17:16:22 +020018romstage-y += uart.c
Gabe Black3c7e9392013-05-26 07:15:57 -070019ramstage-y += uart.c
Gabe Blackddbfc642013-05-29 16:42:35 +020020
21$(call add-class,omap-header)
Gabe Black51edd542013-09-30 23:00:33 -070022$(eval $(call create_class_compiler,omap-header,arm))
Gabe Blackddbfc642013-05-29 16:42:35 +020023
Kyösti Mälkki555c9f92016-12-07 15:01:54 +020024omap-header-generic-ccopts += -D__COREBOOT_ARM_ARCH__=7
25
Gabe Blackddbfc642013-05-29 16:42:35 +020026real-target: $(obj)/MLO
27
Nico Huber81b09f42016-01-23 00:50:00 +010028header_ld := $(call src-to-obj,omap-header,$(dir)/header.ld)
Gabe Blackddbfc642013-05-29 16:42:35 +020029
Gabe Black6e5c86f2013-06-10 20:49:15 -040030get_header_size= \
Sam Lewis266c1362020-08-03 20:50:49 +100031 $(shell echo $$(wc -c < $(objcbfs)/bootblock.bin))
Gabe Black1ef5ff22013-06-10 02:07:17 -040032
Sam Lewis266c1362020-08-03 20:50:49 +100033$(obj)/omap-header.bin: $$(omap-header-objs) $(objcbfs)/bootblock.bin
Gabe Blackddbfc642013-05-29 16:42:35 +020034 @printf " CC $(subst $(obj)/,,$(@))\n"
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070035 $(CC_omap-header) -nostdlib -nostartfiles -static -include $(obj)/config.h \
Gabe Black1ef5ff22013-06-10 02:07:17 -040036 -Wl,--defsym,header_load_size=$(strip \
Sam Lewis266c1362020-08-03 20:50:49 +100037 $(call get_header_size,$(obj)/coreboot.rom) \
Gabe Black1ef5ff22013-06-10 02:07:17 -040038 ) \
39 -o $@.tmp $< -T $(header_ld)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070040 $(OBJCOPY_omap-header) --only-section=".header" -O binary $@.tmp $@
Gabe Blackddbfc642013-05-29 16:42:35 +020041
42$(obj)/MLO: $(obj)/coreboot.rom $(obj)/omap-header.bin
43 @printf " HEADER $(subst $(obj)/,,$(@))\n"
44 $(Q)cat $(obj)/omap-header.bin $(obj)/coreboot.rom > $@
45
46omap-header-y += header.c
Julius Wernerec5e5e02014-08-20 15:29:56 -070047
Furquan Shaikh46514c22020-06-11 11:59:07 -070048omap-header-srcs += $(CONFIG_MEMLAYOUT_LD_FILE)
Julius Wernerec5e5e02014-08-20 15:29:56 -070049omap-header-y += header.ld
Sam Lewisad7b2e22020-08-03 20:18:29 +100050endif