blob: 013a4dda75bb98eca55e53804a1f513cf28fc3ed [file] [log] [blame]
Stefan Reinauer52db0b92012-12-07 17:15:04 -08001################################################################################
2##
3## This file is part of the coreboot project.
4##
Gabe Black169c0df2013-10-08 18:24:10 -07005## Copyright (C) 2012-2013 The ChromiumOS Authors
Stefan Reinauer52db0b92012-12-07 17:15:04 -08006## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
7## Copyright (C) 2009-2010 coresystems GmbH
8## Copyright (C) 2009 Ronald G. Minnich
9##
10## This program is free software; you can redistribute it and/or modify
11## it under the terms of the GNU General Public License as published by
12## the Free Software Foundation; version 2 of the License.
13##
14## This program is distributed in the hope that it will be useful,
15## but WITHOUT ANY WARRANTY; without even the implied warranty of
16## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17## GNU General Public License for more details.
18##
Stefan Reinauer52db0b92012-12-07 17:15:04 -080019
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070020###############################################################################
21# ARM specific options
22###############################################################################
Stefan Reinauer52db0b92012-12-07 17:15:04 -080023
Julius Wernerfffee872016-03-07 17:55:43 -080024ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM),y)
25check-ramstage-overlap-regions += postram_cbfs_cache stack ttb
26endif
27
Gabe Black51edd542013-09-30 23:00:33 -070028ifeq ($(CONFIG_ARCH_ARM),y)
Patrick Georgi8ef8afb2015-04-29 20:28:03 +020029subdirs-y += libgcc/
30subdirs-y += armv4/ armv7/
31
Gabe Black51edd542013-09-30 23:00:33 -070032stages_c = $(src)/arch/arm/stages.c
33stages_o = $(obj)/arch/arm/stages.o
Ronald G. Minnich27bd64a2013-02-28 17:47:00 +010034
Gabe Black4938a322013-09-15 20:53:57 -070035$(stages_o): $(stages_c) $(obj)/config.h
Ronald G. Minnich27bd64a2013-02-28 17:47:00 +010036 @printf " CC $(subst $(obj)/,,$(@))\n"
Gabe Black51edd542013-09-30 23:00:33 -070037 $(CC_arm) -I. $(CPPFLAGS_arm) -c -o $@ $< -marm
Ronald G. Minnich27bd64a2013-02-28 17:47:00 +010038
Gabe Black51edd542013-09-30 23:00:33 -070039endif # CONFIG_ARCH_ARM
David Hendricks10c90d32012-12-27 13:30:55 -080040
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070041###############################################################################
42# bootblock
43###############################################################################
Ronald G. Minnichb21eaa72013-03-07 15:23:45 -080044
Gabe Black51edd542013-09-30 23:00:33 -070045ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM),y)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070046
Gabe Blacka2a87d42013-09-29 05:40:13 -070047bootblock-y += id.S
Nico Huber81b09f42016-01-23 00:50:00 +010048$(call src-to-obj,bootblock,$(dir)/id.S): $(obj)/build.h
Gabe Black8b685392013-09-29 03:02:55 -070049
Aaron Durbinb3847e62015-03-20 15:55:08 -050050bootblock-y += boot.c
Gabe Black8b685392013-09-29 03:02:55 -070051bootblock-y += stages.c
Stefan Reinauer93ce3b32013-05-24 14:38:48 -070052bootblock-y += eabi_compat.c
Stefan Reinauerff7c8e82013-05-29 13:12:20 -070053bootblock-y += memset.S
Stefan Reinauerff7c8e82013-05-29 13:12:20 -070054bootblock-y += memcpy.S
Gabe Black7a6651c2013-07-07 14:15:22 -070055bootblock-y += memmove.S
Gabe Black169c0df2013-10-08 18:24:10 -070056bootblock-y += div0.c
Furquan Shaikhd653ae82014-06-24 15:21:03 -070057bootblock-y += clock.c
Stefan Reinauerff7c8e82013-05-29 13:12:20 -070058
Aaron Durbin52a530d2015-05-08 15:47:00 -050059$(objcbfs)/bootblock.debug: $$(bootblock-objs)
Stefan Reinauer52db0b92012-12-07 17:15:04 -080060 @printf " LINK $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +010061 $(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 -080062
Gabe Black51edd542013-09-30 23:00:33 -070063endif # CONFIG_ARCH_BOOTBLOCK_ARM
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070064
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070065###############################################################################
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070066# verification stage
67###############################################################################
68
Aaron Durbin804c1392015-04-22 12:10:06 -050069ifeq ($(CONFIG_ARCH_VERSTAGE_ARM),y)
70
Julius Wernere91d1702017-03-20 15:32:15 -070071$(objcbfs)/verstage.debug: $$(verstage-objs)
Daisuke Nojiriefddcfb2014-09-04 09:55:34 -070072 @printf " LINK $(subst $(obj)/,,$(@))\n"
Julius Wernere91d1702017-03-20 15:32:15 -070073 $(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 -070074
Aaron Durbin52a530d2015-05-08 15:47:00 -050075verstage-y += boot.c
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070076verstage-y += div0.c
77verstage-y += eabi_compat.c
78verstage-y += memset.S
79verstage-y += memcpy.S
80verstage-y += memmove.S
81verstage-y += stages.c
82
Aaron Durbin804c1392015-04-22 12:10:06 -050083endif # CONFIG_ARCH_VERSTAGE_ARM
84
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070085###############################################################################
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070086# romstage
87###############################################################################
88
Gabe Black51edd542013-09-30 23:00:33 -070089ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM),y)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -070090
Aaron Durbinb3847e62015-03-20 15:55:08 -050091romstage-y += boot.c
Gabe Black8b685392013-09-29 03:02:55 -070092romstage-y += stages.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -070093romstage-y += div0.c
94romstage-y += eabi_compat.c
95romstage-y += memset.S
96romstage-y += memcpy.S
97romstage-y += memmove.S
Furquan Shaikhd653ae82014-06-24 15:21:03 -070098romstage-y += clock.c
Furquan Shaikha742ef12014-07-23 11:41:59 -070099rmodules_arm-y += memset.S
100rmodules_arm-y += memcpy.S
101rmodules_arm-y += memmove.S
102rmodules_arm-y += eabi_compat.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700103
Julius Wernerec5e5e02014-08-20 15:29:56 -0700104$(objcbfs)/romstage.debug: $$(romstage-objs)
Stefan Reinauer52db0b92012-12-07 17:15:04 -0800105 @printf " LINK $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +0100106 $(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 -0800107
Gabe Black51edd542013-09-30 23:00:33 -0700108endif # CONFIG_ARCH_ROMSTAGE_ARM
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700109
110###############################################################################
111# ramstage
112###############################################################################
113
Gabe Black51edd542013-09-30 23:00:33 -0700114ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM),y)
Furquan Shaikh99ac98f2014-04-23 10:18:48 -0700115
Gabe Black8b685392013-09-29 03:02:55 -0700116ramstage-y += stages.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700117ramstage-y += div0.c
Julius Werner635ee512014-09-23 20:53:20 -0700118ramstage-$(CONFIG_COOP_MULTITASKING) += cpu.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700119ramstage-y += eabi_compat.c
120ramstage-y += boot.c
121ramstage-y += tables.c
122ramstage-y += memset.S
123ramstage-y += memcpy.S
124ramstage-y += memmove.S
Furquan Shaikhd653ae82014-06-24 15:21:03 -0700125ramstage-y += clock.c
Julius Wernerec5e5e02014-08-20 15:29:56 -0700126
Furquan Shaikhfbff9082014-07-22 15:59:16 -0700127rmodules_arm-y += memset.S
128rmodules_arm-y += memcpy.S
129rmodules_arm-y += memmove.S
130rmodules_arm-y += eabi_compat.c
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700131ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
132
Julius Wernerec5e5e02014-08-20 15:29:56 -0700133$(objcbfs)/ramstage.debug: $$(ramstage-objs)
Furquan Shaikh88ca81a2014-04-22 16:33:22 -0700134 @printf " CC $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +0100135 $(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 -0700136
Gabe Black51edd542013-09-30 23:00:33 -0700137endif # CONFIG_ARCH_RAMSTAGE_ARM