blob: 508b0a80f88b58f70a18302d61a9d0f05795e88e [file] [log] [blame]
Stefan Reinauer52db0b92012-12-07 17:15:04 -08001################################################################################
2##
3## This file is part of the coreboot project.
4##
Stefan Reinauer52db0b92012-12-07 17:15:04 -08005## This program is free software; you can redistribute it and/or modify
6## it under the terms of the GNU General Public License as published by
7## the Free Software Foundation; version 2 of the License.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12## GNU General Public License for more details.
13##
Stefan Reinauer52db0b92012-12-07 17:15:04 -080014
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070015###############################################################################
16# ARM specific options
17###############################################################################
Stefan Reinauer52db0b92012-12-07 17:15:04 -080018
Julius Wernerfffee872016-03-07 17:55:43 -080019ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM),y)
20check-ramstage-overlap-regions += postram_cbfs_cache stack ttb
21endif
22
Gabe Black51edd542013-09-30 23:00:33 -070023ifeq ($(CONFIG_ARCH_ARM),y)
Patrick Georgi8ef8afb2015-04-29 20:28:03 +020024subdirs-y += libgcc/
25subdirs-y += armv4/ armv7/
26
Gabe Black51edd542013-09-30 23:00:33 -070027stages_c = $(src)/arch/arm/stages.c
28stages_o = $(obj)/arch/arm/stages.o
Ronald G. Minnich27bd64a2013-02-28 17:47:00 +010029
Gabe Black4938a322013-09-15 20:53:57 -070030$(stages_o): $(stages_c) $(obj)/config.h
Ronald G. Minnich27bd64a2013-02-28 17:47:00 +010031 @printf " CC $(subst $(obj)/,,$(@))\n"
Gabe Black51edd542013-09-30 23:00:33 -070032 $(CC_arm) -I. $(CPPFLAGS_arm) -c -o $@ $< -marm
Ronald G. Minnich27bd64a2013-02-28 17:47:00 +010033
Gabe Black51edd542013-09-30 23:00:33 -070034endif # CONFIG_ARCH_ARM
David Hendricks10c90d32012-12-27 13:30:55 -080035
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070036###############################################################################
37# bootblock
38###############################################################################
Ronald G. Minnichb21eaa72013-03-07 15:23:45 -080039
Gabe Black51edd542013-09-30 23:00:33 -070040ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM),y)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070041
Julius Werner99f46832018-05-16 14:14:04 -070042decompressor-y += id.S
Gabe Blacka2a87d42013-09-29 05:40:13 -070043bootblock-y += id.S
Julius Werner99f46832018-05-16 14:14:04 -070044$(call src-to-obj,decompressor,$(dir)/id.S): $(obj)/build.h
Nico Huber81b09f42016-01-23 00:50:00 +010045$(call src-to-obj,bootblock,$(dir)/id.S): $(obj)/build.h
Gabe Black8b685392013-09-29 03:02:55 -070046
Julius Werner99f46832018-05-16 14:14:04 -070047decompressor-y += boot.c
Aaron Durbinb3847e62015-03-20 15:55:08 -050048bootblock-y += boot.c
Julius Werner99f46832018-05-16 14:14:04 -070049decompressor-y += div0.c
Gabe Black169c0df2013-10-08 18:24:10 -070050bootblock-y += div0.c
Julius Werner99f46832018-05-16 14:14:04 -070051decompressor-y += eabi_compat.c
52bootblock-y += eabi_compat.c
53decompressor-y += memset.S
54bootblock-y += memset.S
55decompressor-y += memcpy.S
56bootblock-y += memcpy.S
57decompressor-y += memmove.S
58bootblock-y += memmove.S
59
Furquan Shaikhd653ae82014-06-24 15:21:03 -070060bootblock-y += clock.c
Julius Werner99f46832018-05-16 14:14:04 -070061bootblock-y += stages.c
Stefan Reinauerff7c8e82013-05-29 13:12:20 -070062
Aaron Durbin52a530d2015-05-08 15:47:00 -050063$(objcbfs)/bootblock.debug: $$(bootblock-objs)
Stefan Reinauer52db0b92012-12-07 17:15:04 -080064 @printf " LINK $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +010065 $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) -T $(call src-to-obj,bootblock,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) --end-group
Stefan Reinauer52db0b92012-12-07 17:15:04 -080066
Julius Werner99f46832018-05-16 14:14:04 -070067$(objcbfs)/decompressor.debug: $$(decompressor-objs)
68 @printf " LINK $(subst $(obj)/,,$(@))\n"
69 $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) -T $(call src-to-obj,decompressor,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(decompressor-objs)) --end-group
70
Gabe Black51edd542013-09-30 23:00:33 -070071endif # CONFIG_ARCH_BOOTBLOCK_ARM
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070072
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070073###############################################################################
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070074# verification stage
75###############################################################################
76
Aaron Durbin804c1392015-04-22 12:10:06 -050077ifeq ($(CONFIG_ARCH_VERSTAGE_ARM),y)
78
Julius Wernere91d1702017-03-20 15:32:15 -070079$(objcbfs)/verstage.debug: $$(verstage-objs)
Daisuke Nojiriefddcfb2014-09-04 09:55:34 -070080 @printf " LINK $(subst $(obj)/,,$(@))\n"
Julius Wernere91d1702017-03-20 15:32:15 -070081 $(LD_verstage) $(LDFLAGS_verstage) -o $@ -L$(obj) -T $(call src-to-obj,verstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(verstage-objs)) --end-group
Daisuke Nojiriefddcfb2014-09-04 09:55:34 -070082
Aaron Durbin52a530d2015-05-08 15:47:00 -050083verstage-y += boot.c
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070084verstage-y += div0.c
85verstage-y += eabi_compat.c
86verstage-y += memset.S
87verstage-y += memcpy.S
88verstage-y += memmove.S
89verstage-y += stages.c
90
Aaron Durbin804c1392015-04-22 12:10:06 -050091endif # CONFIG_ARCH_VERSTAGE_ARM
92
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070093###############################################################################
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070094# romstage
95###############################################################################
96
Gabe Black51edd542013-09-30 23:00:33 -070097ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM),y)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070098
Aaron Durbinb3847e62015-03-20 15:55:08 -050099romstage-y += boot.c
Gabe Black8b685392013-09-29 03:02:55 -0700100romstage-y += stages.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700101romstage-y += div0.c
102romstage-y += eabi_compat.c
103romstage-y += memset.S
104romstage-y += memcpy.S
105romstage-y += memmove.S
Furquan Shaikhd653ae82014-06-24 15:21:03 -0700106romstage-y += clock.c
Furquan Shaikha742ef12014-07-23 11:41:59 -0700107rmodules_arm-y += memset.S
108rmodules_arm-y += memcpy.S
109rmodules_arm-y += memmove.S
110rmodules_arm-y += eabi_compat.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700111
Julius Wernerec5e5e02014-08-20 15:29:56 -0700112$(objcbfs)/romstage.debug: $$(romstage-objs)
Stefan Reinauer52db0b92012-12-07 17:15:04 -0800113 @printf " LINK $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +0100114 $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) -T $(call src-to-obj,romstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group
Stefan Reinauer52db0b92012-12-07 17:15:04 -0800115
Gabe Black51edd542013-09-30 23:00:33 -0700116endif # CONFIG_ARCH_ROMSTAGE_ARM
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700117
118###############################################################################
119# ramstage
120###############################################################################
121
Gabe Black51edd542013-09-30 23:00:33 -0700122ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM),y)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700123
Gabe Black8b685392013-09-29 03:02:55 -0700124ramstage-y += stages.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700125ramstage-y += div0.c
Julius Werner635ee512014-09-23 20:53:20 -0700126ramstage-$(CONFIG_COOP_MULTITASKING) += cpu.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700127ramstage-y += eabi_compat.c
128ramstage-y += boot.c
129ramstage-y += tables.c
130ramstage-y += memset.S
131ramstage-y += memcpy.S
132ramstage-y += memmove.S
Furquan Shaikhd653ae82014-06-24 15:21:03 -0700133ramstage-y += clock.c
Julius Wernerec5e5e02014-08-20 15:29:56 -0700134
Furquan Shaikhfbff9082014-07-22 15:59:16 -0700135rmodules_arm-y += memset.S
136rmodules_arm-y += memcpy.S
137rmodules_arm-y += memmove.S
138rmodules_arm-y += eabi_compat.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700139ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
140
Julius Wernerec5e5e02014-08-20 15:29:56 -0700141$(objcbfs)/ramstage.debug: $$(ramstage-objs)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700142 @printf " CC $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +0100143 $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) -T $(call src-to-obj,ramstage,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700144
Gabe Black51edd542013-09-30 23:00:33 -0700145endif # CONFIG_ARCH_RAMSTAGE_ARM