blob: 7130abaaa041eb56dc0670baa2e0ea08153783ef [file] [log] [blame]
Paul Burtone8530032014-06-14 00:00:10 +01001#
2# This file is part of the coreboot project.
3#
Paul Burtone8530032014-06-14 00:00:10 +01004# This program is free software; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License as
6# published by the Free Software Foundation; version 2 of
7# 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#
Paul Burtone8530032014-06-14 00:00:10 +010014
15###############################################################################
16# MIPS specific options
17###############################################################################
18
Julius Wernerfffee872016-03-07 17:55:43 -080019ifeq ($(CONFIG_ARCH_RAMSTAGE_MIPS),y)
20check-ramstage-overlap-regions += stack
21endif
22
Paul Burtone8530032014-06-14 00:00:10 +010023###############################################################################
24# bootblock
25###############################################################################
26
27ifeq ($(CONFIG_ARCH_BOOTBLOCK_MIPS),y)
28
29bootblock-y += boot.c
Patrick Georgi6b65f0d2015-03-30 13:40:29 +020030bootblock-y += bootblock.S
31bootblock-y += bootblock_simple.c
Ionela Voinescu8fa8f4b2014-12-01 18:31:48 +000032bootblock-y += cache.c
Andrew Bresticker3537e952015-02-05 13:31:41 -080033bootblock-y += mmu.c
Paul Burtone8530032014-06-14 00:00:10 +010034bootblock-y += stages.c
Paul Burtone8530032014-06-14 00:00:10 +010035bootblock-y += ../../lib/memcpy.c
36bootblock-y += ../../lib/memmove.c
37bootblock-y += ../../lib/memset.c
38
Paul Burtone8530032014-06-14 00:00:10 +010039# Much of the assembly code is generated by the compiler, and may contain
40# terms which the preprocessor will happily go on to replace. For example
41# "mips" would be replaced with "1". Clear all the built in definitions to
42# prevent that.
43bootblock-S-ccopts += -undef
44
Julius Wernerec5e5e02014-08-20 15:29:56 -070045$(objcbfs)/bootblock.debug: $$(bootblock-objs) $(obj)/config.h
Paul Burtone8530032014-06-14 00:00:10 +010046 @printf " LINK $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +010047 $(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 Burtone8530032014-06-14 00:00:10 +010048
49endif # CONFIG_ARCH_BOOTBLOCK_MIPS
50
51###############################################################################
52# romstage
53###############################################################################
54
55ifeq ($(CONFIG_ARCH_ROMSTAGE_MIPS),y)
56
57romstage-y += boot.c
Ionela Voinescu8fa8f4b2014-12-01 18:31:48 +000058romstage-y += cache.c
Andrew Bresticker3537e952015-02-05 13:31:41 -080059romstage-y += mmu.c
Paul Burtone8530032014-06-14 00:00:10 +010060romstage-y += stages.c
Paul Burtone8530032014-06-14 00:00:10 +010061romstage-y += ../../lib/memcpy.c
62romstage-y += ../../lib/memmove.c
63romstage-y += ../../lib/memset.c
64
Julius Wernerec5e5e02014-08-20 15:29:56 -070065$(objcbfs)/romstage.debug: $$(romstage-objs)
Paul Burtone8530032014-06-14 00:00:10 +010066 @printf " LINK $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +010067 $(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 Burtone8530032014-06-14 00:00:10 +010068
69endif # CONFIG_ARCH_ROMSTAGE_MIPS
70
71###############################################################################
72# ramstage
73###############################################################################
74
75ifeq ($(CONFIG_ARCH_RAMSTAGE_MIPS),y)
76
77ramstage-y += ashldi3.c
78ramstage-y += boot.c
Ionela Voinescu8fa8f4b2014-12-01 18:31:48 +000079ramstage-y += cache.c
Andrew Bresticker3537e952015-02-05 13:31:41 -080080ramstage-y += mmu.c
Paul Burtone8530032014-06-14 00:00:10 +010081ramstage-y += stages.c
82ramstage-y += tables.c
Paul Burtone8530032014-06-14 00:00:10 +010083ramstage-y += ../../lib/memcpy.c
84ramstage-y += ../../lib/memmove.c
85ramstage-y += ../../lib/memset.c
Julius Wernerec5e5e02014-08-20 15:29:56 -070086
Paul Burtone8530032014-06-14 00:00:10 +010087ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
88
Julius Wernerec5e5e02014-08-20 15:29:56 -070089$(objcbfs)/ramstage.debug: $$(ramstage-objs)
Paul Burtone8530032014-06-14 00:00:10 +010090 @printf " CC $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +010091 $(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 Burtone8530032014-06-14 00:00:10 +010092
93endif # CONFIG_ARCH_RAMSTAGE_MIPS