blob: cd474eeb48ca335fd6ef73fee6bbf3aa76b55acf [file] [log] [blame]
Paul Burtone8530032014-06-14 00:00:10 +01001#
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 Burtone8530032014-06-14 00:00:10 +010016
17###############################################################################
18# MIPS specific options
19###############################################################################
20
Julius Wernerfffee872016-03-07 17:55:43 -080021ifeq ($(CONFIG_ARCH_RAMSTAGE_MIPS),y)
22check-ramstage-overlap-regions += stack
23endif
24
Paul Burtone8530032014-06-14 00:00:10 +010025###############################################################################
26# bootblock
27###############################################################################
28
29ifeq ($(CONFIG_ARCH_BOOTBLOCK_MIPS),y)
30
31bootblock-y += boot.c
Patrick Georgi6b65f0d2015-03-30 13:40:29 +020032bootblock-y += bootblock.S
33bootblock-y += bootblock_simple.c
Ionela Voinescu8fa8f4b2014-12-01 18:31:48 +000034bootblock-y += cache.c
Andrew Bresticker3537e952015-02-05 13:31:41 -080035bootblock-y += mmu.c
Paul Burtone8530032014-06-14 00:00:10 +010036bootblock-y += stages.c
Paul Burtone8530032014-06-14 00:00:10 +010037bootblock-y += ../../lib/memcpy.c
38bootblock-y += ../../lib/memmove.c
39bootblock-y += ../../lib/memset.c
40
Paul Burtone8530032014-06-14 00:00:10 +010041# 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.
45bootblock-S-ccopts += -undef
46
Julius Wernerec5e5e02014-08-20 15:29:56 -070047$(objcbfs)/bootblock.debug: $$(bootblock-objs) $(obj)/config.h
Paul Burtone8530032014-06-14 00:00:10 +010048 @printf " LINK $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +010049 $(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 +010050
51endif # CONFIG_ARCH_BOOTBLOCK_MIPS
52
53###############################################################################
54# romstage
55###############################################################################
56
57ifeq ($(CONFIG_ARCH_ROMSTAGE_MIPS),y)
58
59romstage-y += boot.c
Ionela Voinescu8fa8f4b2014-12-01 18:31:48 +000060romstage-y += cache.c
Andrew Bresticker3537e952015-02-05 13:31:41 -080061romstage-y += mmu.c
Paul Burtone8530032014-06-14 00:00:10 +010062romstage-y += stages.c
Paul Burtone8530032014-06-14 00:00:10 +010063romstage-y += ../../lib/memcpy.c
64romstage-y += ../../lib/memmove.c
65romstage-y += ../../lib/memset.c
66
Julius Wernerec5e5e02014-08-20 15:29:56 -070067$(objcbfs)/romstage.debug: $$(romstage-objs)
Paul Burtone8530032014-06-14 00:00:10 +010068 @printf " LINK $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +010069 $(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 +010070
71endif # CONFIG_ARCH_ROMSTAGE_MIPS
72
73###############################################################################
74# ramstage
75###############################################################################
76
77ifeq ($(CONFIG_ARCH_RAMSTAGE_MIPS),y)
78
79ramstage-y += ashldi3.c
80ramstage-y += boot.c
Ionela Voinescu8fa8f4b2014-12-01 18:31:48 +000081ramstage-y += cache.c
Andrew Bresticker3537e952015-02-05 13:31:41 -080082ramstage-y += mmu.c
Paul Burtone8530032014-06-14 00:00:10 +010083ramstage-y += stages.c
84ramstage-y += tables.c
Paul Burtone8530032014-06-14 00:00:10 +010085ramstage-y += ../../lib/memcpy.c
86ramstage-y += ../../lib/memmove.c
87ramstage-y += ../../lib/memset.c
Julius Wernerec5e5e02014-08-20 15:29:56 -070088
Paul Burtone8530032014-06-14 00:00:10 +010089ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
90
Julius Wernerec5e5e02014-08-20 15:29:56 -070091$(objcbfs)/ramstage.debug: $$(ramstage-objs)
Paul Burtone8530032014-06-14 00:00:10 +010092 @printf " CC $(subst $(obj)/,,$(@))\n"
Nico Huber81b09f42016-01-23 00:50:00 +010093 $(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 +010094
95endif # CONFIG_ARCH_RAMSTAGE_MIPS