Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 1 | # |
| 2 | # This file is part of the coreboot project. |
| 3 | # |
| 4 | # Copyright (C) 2014 Imagination Technologies |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or |
| 7 | # modify it under the terms of the GNU General Public License as |
| 8 | # published by the Free Software Foundation; version 2 of |
| 9 | # the License. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 16 | |
| 17 | ############################################################################### |
| 18 | # MIPS specific options |
| 19 | ############################################################################### |
| 20 | |
Julius Werner | fffee87 | 2016-03-07 17:55:43 -0800 | [diff] [blame] | 21 | ifeq ($(CONFIG_ARCH_RAMSTAGE_MIPS),y) |
| 22 | check-ramstage-overlap-regions += stack |
| 23 | endif |
| 24 | |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 25 | ############################################################################### |
| 26 | # bootblock |
| 27 | ############################################################################### |
| 28 | |
| 29 | ifeq ($(CONFIG_ARCH_BOOTBLOCK_MIPS),y) |
| 30 | |
| 31 | bootblock-y += boot.c |
Patrick Georgi | 6b65f0d | 2015-03-30 13:40:29 +0200 | [diff] [blame] | 32 | bootblock-y += bootblock.S |
| 33 | bootblock-y += bootblock_simple.c |
Ionela Voinescu | 8fa8f4b | 2014-12-01 18:31:48 +0000 | [diff] [blame] | 34 | bootblock-y += cache.c |
Andrew Bresticker | 3537e95 | 2015-02-05 13:31:41 -0800 | [diff] [blame] | 35 | bootblock-y += mmu.c |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 36 | bootblock-y += stages.c |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 37 | bootblock-y += ../../lib/memcpy.c |
| 38 | bootblock-y += ../../lib/memmove.c |
| 39 | bootblock-y += ../../lib/memset.c |
| 40 | |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 41 | # Much of the assembly code is generated by the compiler, and may contain |
| 42 | # terms which the preprocessor will happily go on to replace. For example |
| 43 | # "mips" would be replaced with "1". Clear all the built in definitions to |
| 44 | # prevent that. |
| 45 | bootblock-S-ccopts += -undef |
| 46 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 47 | $(objcbfs)/bootblock.debug: $$(bootblock-objs) $(obj)/config.h |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 48 | @printf " LINK $(subst $(obj)/,,$(@))\n" |
Nico Huber | 81b09f4 | 2016-01-23 00:50:00 +0100 | [diff] [blame] | 49 | $(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 |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 50 | |
| 51 | endif # CONFIG_ARCH_BOOTBLOCK_MIPS |
| 52 | |
| 53 | ############################################################################### |
| 54 | # romstage |
| 55 | ############################################################################### |
| 56 | |
| 57 | ifeq ($(CONFIG_ARCH_ROMSTAGE_MIPS),y) |
| 58 | |
| 59 | romstage-y += boot.c |
Ionela Voinescu | 8fa8f4b | 2014-12-01 18:31:48 +0000 | [diff] [blame] | 60 | romstage-y += cache.c |
Andrew Bresticker | 3537e95 | 2015-02-05 13:31:41 -0800 | [diff] [blame] | 61 | romstage-y += mmu.c |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 62 | romstage-y += stages.c |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 63 | romstage-y += ../../lib/memcpy.c |
| 64 | romstage-y += ../../lib/memmove.c |
| 65 | romstage-y += ../../lib/memset.c |
| 66 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 67 | $(objcbfs)/romstage.debug: $$(romstage-objs) |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 68 | @printf " LINK $(subst $(obj)/,,$(@))\n" |
Nico Huber | 81b09f4 | 2016-01-23 00:50:00 +0100 | [diff] [blame] | 69 | $(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 |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 70 | |
| 71 | endif # CONFIG_ARCH_ROMSTAGE_MIPS |
| 72 | |
| 73 | ############################################################################### |
| 74 | # ramstage |
| 75 | ############################################################################### |
| 76 | |
| 77 | ifeq ($(CONFIG_ARCH_RAMSTAGE_MIPS),y) |
| 78 | |
| 79 | ramstage-y += ashldi3.c |
| 80 | ramstage-y += boot.c |
Ionela Voinescu | 8fa8f4b | 2014-12-01 18:31:48 +0000 | [diff] [blame] | 81 | ramstage-y += cache.c |
Andrew Bresticker | 3537e95 | 2015-02-05 13:31:41 -0800 | [diff] [blame] | 82 | ramstage-y += mmu.c |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 83 | ramstage-y += stages.c |
| 84 | ramstage-y += tables.c |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 85 | ramstage-y += ../../lib/memcpy.c |
| 86 | ramstage-y += ../../lib/memmove.c |
| 87 | ramstage-y += ../../lib/memset.c |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 88 | |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 89 | ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) |
| 90 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 91 | $(objcbfs)/ramstage.debug: $$(ramstage-objs) |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 92 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Nico Huber | 81b09f4 | 2016-01-23 00:50:00 +0100 | [diff] [blame] | 93 | $(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 |
Paul Burton | e853003 | 2014-06-14 00:00:10 +0100 | [diff] [blame] | 94 | |
| 95 | endif # CONFIG_ARCH_RAMSTAGE_MIPS |