Martin Roth | 9231f0b | 2022-10-28 22:39:23 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Sam Lewis | ad7b2e2 | 2020-08-03 20:18:29 +1000 | [diff] [blame] | 2 | ifeq ($(CONFIG_SOC_TI_AM335X),y) |
Alexander Couzens | 8c53b75 | 2014-10-24 23:52:56 +0200 | [diff] [blame] | 3 | bootblock-y += bootblock.c |
Sam Lewis | fde084b | 2020-08-04 19:47:50 +1000 | [diff] [blame] | 4 | bootblock-y += timer.c |
Gabe Black | eee6a7f | 2013-09-24 01:36:08 -0700 | [diff] [blame] | 5 | bootblock-y += gpio.c |
Gabe Black | 5acc76c | 2013-06-17 01:17:55 -0700 | [diff] [blame] | 6 | bootblock-y += pinmux.c |
Sam Lewis | c25d54b | 2020-08-19 21:14:40 +1000 | [diff] [blame] | 7 | bootblock-y += mmc.c |
Gabe Black | 3c7e939 | 2013-05-26 07:15:57 -0700 | [diff] [blame] | 8 | |
Kyösti Mälkki | a38d1b2 | 2014-11-10 15:08:47 +0200 | [diff] [blame] | 9 | romstage-y += cbmem.c |
Sam Lewis | fde084b | 2020-08-04 19:47:50 +1000 | [diff] [blame] | 10 | romstage-y += timer.c |
Sam Lewis | c25d54b | 2020-08-19 21:14:40 +1000 | [diff] [blame] | 11 | romstage-y += mmc.c |
Sam Lewis | 1d8d99b | 2020-08-06 21:08:20 +1000 | [diff] [blame] | 12 | romstage-y += sdram.c |
Gabe Black | 3c7e939 | 2013-05-26 07:15:57 -0700 | [diff] [blame] | 13 | |
Sam Lewis | fde084b | 2020-08-04 19:47:50 +1000 | [diff] [blame] | 14 | ramstage-y += timer.c |
Sam Lewis | c25d54b | 2020-08-19 21:14:40 +1000 | [diff] [blame] | 15 | ramstage-y += soc.c |
| 16 | ramstage-y += mmc.c |
Kyösti Mälkki | afa7b13 | 2014-02-13 17:16:22 +0200 | [diff] [blame] | 17 | |
Nico Huber | 755db95 | 2018-11-11 01:42:17 +0100 | [diff] [blame] | 18 | bootblock-y += uart.c |
Kyösti Mälkki | afa7b13 | 2014-02-13 17:16:22 +0200 | [diff] [blame] | 19 | romstage-y += uart.c |
Gabe Black | 3c7e939 | 2013-05-26 07:15:57 -0700 | [diff] [blame] | 20 | ramstage-y += uart.c |
Gabe Black | ddbfc64 | 2013-05-29 16:42:35 +0200 | [diff] [blame] | 21 | |
| 22 | $(call add-class,omap-header) |
Gabe Black | 51edd54 | 2013-09-30 23:00:33 -0700 | [diff] [blame] | 23 | $(eval $(call create_class_compiler,omap-header,arm)) |
Gabe Black | ddbfc64 | 2013-05-29 16:42:35 +0200 | [diff] [blame] | 24 | |
Kyösti Mälkki | 555c9f9 | 2016-12-07 15:01:54 +0200 | [diff] [blame] | 25 | omap-header-generic-ccopts += -D__COREBOOT_ARM_ARCH__=7 |
| 26 | |
Gabe Black | ddbfc64 | 2013-05-29 16:42:35 +0200 | [diff] [blame] | 27 | real-target: $(obj)/MLO |
| 28 | |
Nico Huber | 81b09f4 | 2016-01-23 00:50:00 +0100 | [diff] [blame] | 29 | header_ld := $(call src-to-obj,omap-header,$(dir)/header.ld) |
Gabe Black | ddbfc64 | 2013-05-29 16:42:35 +0200 | [diff] [blame] | 30 | |
Gabe Black | 6e5c86f | 2013-06-10 20:49:15 -0400 | [diff] [blame] | 31 | get_header_size= \ |
Sam Lewis | 266c136 | 2020-08-03 20:50:49 +1000 | [diff] [blame] | 32 | $(shell echo $$(wc -c < $(objcbfs)/bootblock.bin)) |
Gabe Black | 1ef5ff2 | 2013-06-10 02:07:17 -0400 | [diff] [blame] | 33 | |
Sam Lewis | 266c136 | 2020-08-03 20:50:49 +1000 | [diff] [blame] | 34 | $(obj)/omap-header.bin: $$(omap-header-objs) $(objcbfs)/bootblock.bin |
Gabe Black | ddbfc64 | 2013-05-29 16:42:35 +0200 | [diff] [blame] | 35 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Furquan Shaikh | 99ac98f | 2014-04-23 10:18:48 -0700 | [diff] [blame] | 36 | $(CC_omap-header) -nostdlib -nostartfiles -static -include $(obj)/config.h \ |
Gabe Black | 1ef5ff2 | 2013-06-10 02:07:17 -0400 | [diff] [blame] | 37 | -Wl,--defsym,header_load_size=$(strip \ |
Sam Lewis | 266c136 | 2020-08-03 20:50:49 +1000 | [diff] [blame] | 38 | $(call get_header_size,$(obj)/coreboot.rom) \ |
Gabe Black | 1ef5ff2 | 2013-06-10 02:07:17 -0400 | [diff] [blame] | 39 | ) \ |
| 40 | -o $@.tmp $< -T $(header_ld) |
Furquan Shaikh | 99ac98f | 2014-04-23 10:18:48 -0700 | [diff] [blame] | 41 | $(OBJCOPY_omap-header) --only-section=".header" -O binary $@.tmp $@ |
Gabe Black | ddbfc64 | 2013-05-29 16:42:35 +0200 | [diff] [blame] | 42 | |
| 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 | |
| 47 | omap-header-y += header.c |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 48 | |
Furquan Shaikh | 46514c2 | 2020-06-11 11:59:07 -0700 | [diff] [blame] | 49 | omap-header-srcs += $(CONFIG_MEMLAYOUT_LD_FILE) |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 50 | omap-header-y += header.ld |
Sam Lewis | ad7b2e2 | 2020-08-03 20:18:29 +1000 | [diff] [blame] | 51 | endif |