Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 1 | ################################################################################ |
| 2 | ## |
| 3 | ## This file is part of the coreboot project. |
| 4 | ## |
| 5 | ## Copyright (C) 2014 Google Inc. |
| 6 | ## Copyright (C) 2012-2013 The ChromiumOS Authors |
| 7 | ## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com> |
| 8 | ## Copyright (C) 2009-2010 coresystems GmbH |
| 9 | ## Copyright (C) 2009 Ronald G. Minnich |
| 10 | ## |
| 11 | ## This program is free software; you can redistribute it and/or modify |
| 12 | ## it under the terms of the GNU General Public License as published by |
| 13 | ## the Free Software Foundation; version 2 of the License. |
| 14 | ## |
| 15 | ## This program is distributed in the hope that it will be useful, |
| 16 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | ## GNU General Public License for more details. |
| 19 | ## |
| 20 | ## You should have received a copy of the GNU General Public License |
| 21 | ## along with this program; if not, write to the Free Software |
| 22 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 23 | ## |
| 24 | ################################################################################ |
| 25 | |
| 26 | ################################################################################ |
| 27 | # Take care of subdirectories |
| 28 | ################################################################################ |
| 29 | |
| 30 | subdirs-y += armv8/ |
| 31 | |
| 32 | ################################################################################ |
| 33 | # ARM specific options |
| 34 | ################################################################################ |
| 35 | |
| 36 | ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y) |
| 37 | CBFSTOOL_PRE1_OPTS = -m arm64 -b $(CONFIG_BOOTBLOCK_ROM_OFFSET) -H $(CONFIG_CBFS_HEADER_ROM_OFFSET) -o $(CONFIG_CBFS_ROM_OFFSET) |
| 38 | endif |
| 39 | |
Marc Jones | 17b9c19 | 2015-01-16 13:45:23 -0700 | [diff] [blame] | 40 | ifeq ($(CONFIG_ARCH_ARM64),y) |
| 41 | stages_c = $(src)/arch/arm64/stages.c |
| 42 | stages_o = $(obj)/arch/arm64/stages.o |
| 43 | |
| 44 | $(stages_o): $(stages_c) $(obj)/config.h |
| 45 | @printf " CC $(subst $(obj)/,,$(@))\n" |
| 46 | $(CC_arm) -I. $(CPPFLAGS_arm) -c -o $@ $< -marm |
| 47 | |
| 48 | endif |
| 49 | |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 50 | ################################################################################ |
| 51 | # bootblock |
| 52 | ################################################################################ |
| 53 | |
| 54 | ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM64),y) |
| 55 | |
| 56 | bootblock-y += div0.c |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 57 | bootblock-y += id.S |
| 58 | $(obj)/arch/arm64/id.bootblock.o: $(obj)/build.h |
| 59 | |
Aaron Durbin | b3847e6 | 2015-03-20 15:55:08 -0500 | [diff] [blame] | 60 | bootblock-y += boot.c |
Aaron Durbin | 30cda7e | 2014-07-15 10:25:48 -0500 | [diff] [blame] | 61 | bootblock-y += c_entry.c |
| 62 | bootblock-y += stage_entry.S |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 63 | bootblock-y += stages.c |
| 64 | bootblock-y += eabi_compat.c |
Furquan Shaikh | 668316b | 2014-08-30 21:59:11 -0700 | [diff] [blame] | 65 | bootblock-y += transition.c transition_asm.S |
| 66 | |
Aaron Durbin | 00263d0 | 2014-07-10 17:01:22 -0500 | [diff] [blame] | 67 | bootblock-y += ../../lib/memset.c |
| 68 | bootblock-y += ../../lib/memcpy.c |
| 69 | bootblock-y += ../../lib/memmove.c |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 70 | |
| 71 | # Build the bootblock |
| 72 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame^] | 73 | $(objcbfs)/bootblock.debug: $$(bootblock-objs) $(obj)/config.h |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 74 | @printf " LINK $(subst $(obj)/,,$(@))\n" |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame^] | 75 | $(LD_bootblock) --gc-sections -static -o $@ -L$(obj) --start-group $(filter-out %.ld,$(bootblock-objs)) --end-group -T $(obj)/mainboard/$(MAINBOARDDIR)/memlayout.bootblock.ld |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 76 | |
| 77 | endif # CONFIG_ARCH_BOOTBLOCK_ARM64 |
| 78 | |
| 79 | ################################################################################ |
| 80 | # romstage |
| 81 | ################################################################################ |
| 82 | |
| 83 | ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y) |
| 84 | |
Aaron Durbin | b3847e6 | 2015-03-20 15:55:08 -0500 | [diff] [blame] | 85 | romstage-y += boot.c |
Aaron Durbin | 30cda7e | 2014-07-15 10:25:48 -0500 | [diff] [blame] | 86 | romstage-y += c_entry.c |
| 87 | romstage-y += stage_entry.S |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 88 | romstage-y += stages.c |
| 89 | romstage-y += div0.c |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 90 | romstage-y += eabi_compat.c |
Aaron Durbin | 00263d0 | 2014-07-10 17:01:22 -0500 | [diff] [blame] | 91 | romstage-y += ../../lib/memset.c |
| 92 | romstage-y += ../../lib/memcpy.c |
| 93 | romstage-y += ../../lib/memmove.c |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 94 | romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
Furquan Shaikh | 668316b | 2014-08-30 21:59:11 -0700 | [diff] [blame] | 95 | romstage-y += transition.c transition_asm.S |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 96 | |
Furquan Shaikh | a742ef1 | 2014-07-23 11:41:59 -0700 | [diff] [blame] | 97 | rmodules_arm64-y += ../../lib/memset.c |
| 98 | rmodules_arm64-y += ../../lib/memcpy.c |
| 99 | rmodules_arm64-y += ../../lib/memmove.c |
| 100 | rmodules_arm64-y += eabi_compat.c |
| 101 | |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 102 | # Build the romstage |
Marc Jones | 17b9c19 | 2015-01-16 13:45:23 -0700 | [diff] [blame] | 103 | VBOOT_STUB_DEPS += $(obj)/arch/arm/eabi_compat.rmodules_arm64.o |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 104 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame^] | 105 | $(objcbfs)/romstage.debug: $$(romstage-objs) |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 106 | @printf " LINK $(subst $(obj)/,,$(@))\n" |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame^] | 107 | $(LD_romstage) -nostdlib --gc-sections -static -o $@ -L$(obj) --start-group $(filter-out %.ld,$(romstage-objs)) --end-group -T $(obj)/mainboard/$(MAINBOARDDIR)/memlayout.romstage.ld |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 108 | |
| 109 | endif # CONFIG_ARCH_ROMSTAGE_ARM64 |
| 110 | |
| 111 | ################################################################################ |
| 112 | # ramstage |
| 113 | ################################################################################ |
| 114 | |
| 115 | ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM64),y) |
| 116 | |
Aaron Durbin | 30cda7e | 2014-07-15 10:25:48 -0500 | [diff] [blame] | 117 | ramstage-y += c_entry.c |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 118 | ramstage-y += stages.c |
| 119 | ramstage-y += div0.c |
| 120 | ramstage-y += cpu.c |
Aaron Durbin | b30c9b1 | 2014-09-18 11:52:16 -0500 | [diff] [blame] | 121 | ramstage-y += cpu_ramstage.c |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 122 | ramstage-y += eabi_compat.c |
| 123 | ramstage-y += boot.c |
| 124 | ramstage-y += tables.c |
Aaron Durbin | 00263d0 | 2014-07-10 17:01:22 -0500 | [diff] [blame] | 125 | ramstage-y += ../../lib/memset.c |
| 126 | ramstage-y += ../../lib/memcpy.c |
| 127 | ramstage-y += ../../lib/memmove.c |
Aaron Durbin | 0df877a | 2014-07-10 12:40:30 -0500 | [diff] [blame] | 128 | ramstage-y += stage_entry.S |
Aaron Durbin | 5add435 | 2014-09-17 11:43:20 -0500 | [diff] [blame] | 129 | ramstage-$(CONFIG_ARCH_SPINTABLE) += spintable.c spintable_asm.S |
Furquan Shaikh | 668316b | 2014-08-30 21:59:11 -0700 | [diff] [blame] | 130 | ramstage-y += transition.c transition_asm.S |
| 131 | |
Furquan Shaikh | fbff908 | 2014-07-22 15:59:16 -0700 | [diff] [blame] | 132 | rmodules_arm64-y += ../../lib/memset.c |
| 133 | rmodules_arm64-y += ../../lib/memcpy.c |
| 134 | rmodules_arm64-y += ../../lib/memmove.c |
| 135 | rmodules_arm64-y += eabi_compat.c |
Furquan Shaikh | abde3b5 | 2014-08-26 15:39:51 -0700 | [diff] [blame] | 136 | |
| 137 | secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += stage_entry.S |
| 138 | secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += ../../lib/memset.c |
| 139 | secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += ../../lib/memcmp.c |
| 140 | secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += ../../lib/memcpy.c |
| 141 | |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 142 | ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
| 143 | |
Marc Jones | 17b9c19 | 2015-01-16 13:45:23 -0700 | [diff] [blame] | 144 | ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 145 | |
| 146 | # Build the ramstage |
| 147 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame^] | 148 | $(objcbfs)/ramstage.debug: $$(ramstage-objs) |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 149 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame^] | 150 | $(LD_ramstage) -nostdlib --gc-sections -o $@ -L$(obj) --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group -T $(obj)/mainboard/$(MAINBOARDDIR)/memlayout.ramstage.ld |
Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 151 | |
| 152 | endif # CONFIG_ARCH_RAMSTAGE_ARM64 |