blob: e3aff0c7d707c36c98cf24b6ff25f00e60ad05b3 [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#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010018# Foundation, Inc.
Paul Burtone8530032014-06-14 00:00:10 +010019#
20
21###############################################################################
22# MIPS specific options
23###############################################################################
24
25ifeq ($(CONFIG_ARCH_ROMSTAGE_MIPS),y)
Julius Wernerefcee762014-11-10 13:14:24 -080026CBFSTOOL_PRE1_OPTS = -m mips -s $(CONFIG_CBFS_SIZE)
Paul Burtone8530032014-06-14 00:00:10 +010027endif
28
29###############################################################################
30# bootblock
31###############################################################################
32
33ifeq ($(CONFIG_ARCH_BOOTBLOCK_MIPS),y)
34
35bootblock-y += boot.c
Patrick Georgi6b65f0d2015-03-30 13:40:29 +020036bootblock-y += bootblock.S
37bootblock-y += bootblock_simple.c
Ionela Voinescu8fa8f4b2014-12-01 18:31:48 +000038bootblock-y += cache.c
Andrew Bresticker3537e952015-02-05 13:31:41 -080039bootblock-y += mmu.c
Paul Burtone8530032014-06-14 00:00:10 +010040bootblock-y += stages.c
Paul Burtone8530032014-06-14 00:00:10 +010041bootblock-y += ../../lib/memcpy.c
42bootblock-y += ../../lib/memmove.c
43bootblock-y += ../../lib/memset.c
44
Paul Burtone8530032014-06-14 00:00:10 +010045# Much of the assembly code is generated by the compiler, and may contain
46# terms which the preprocessor will happily go on to replace. For example
47# "mips" would be replaced with "1". Clear all the built in definitions to
48# prevent that.
49bootblock-S-ccopts += -undef
50
Julius Wernerec5e5e02014-08-20 15:29:56 -070051$(objcbfs)/bootblock.debug: $$(bootblock-objs) $(obj)/config.h
Paul Burtone8530032014-06-14 00:00:10 +010052 @printf " LINK $(subst $(obj)/,,$(@))\n"
Patrick Georgieec8dfb2015-05-07 22:24:41 +020053 $(LD_bootblock) --gc-sections -static -o $@ -L$(obj) -T $(obj)/mainboard/$(MAINBOARDDIR)/memlayout.bootblock.ld --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) --end-group
Paul Burtone8530032014-06-14 00:00:10 +010054
55endif # CONFIG_ARCH_BOOTBLOCK_MIPS
56
57###############################################################################
58# romstage
59###############################################################################
60
61ifeq ($(CONFIG_ARCH_ROMSTAGE_MIPS),y)
62
63romstage-y += boot.c
Ionela Voinescu8fa8f4b2014-12-01 18:31:48 +000064romstage-y += cache.c
Andrew Bresticker3537e952015-02-05 13:31:41 -080065romstage-y += mmu.c
Paul Burtone8530032014-06-14 00:00:10 +010066romstage-y += stages.c
Paul Burtone8530032014-06-14 00:00:10 +010067romstage-y += ../../lib/memcpy.c
68romstage-y += ../../lib/memmove.c
69romstage-y += ../../lib/memset.c
70
Julius Wernerec5e5e02014-08-20 15:29:56 -070071$(objcbfs)/romstage.debug: $$(romstage-objs)
Paul Burtone8530032014-06-14 00:00:10 +010072 @printf " LINK $(subst $(obj)/,,$(@))\n"
Patrick Georgieec8dfb2015-05-07 22:24:41 +020073 $(LD_romstage) --gc-sections -static -o $@ -L$(obj) -T $(obj)/mainboard/$(MAINBOARDDIR)/memlayout.romstage.ld --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group
Paul Burtone8530032014-06-14 00:00:10 +010074
75endif # CONFIG_ARCH_ROMSTAGE_MIPS
76
77###############################################################################
78# ramstage
79###############################################################################
80
81ifeq ($(CONFIG_ARCH_RAMSTAGE_MIPS),y)
82
83ramstage-y += ashldi3.c
84ramstage-y += boot.c
Ionela Voinescu8fa8f4b2014-12-01 18:31:48 +000085ramstage-y += cache.c
Andrew Bresticker3537e952015-02-05 13:31:41 -080086ramstage-y += mmu.c
Paul Burtone8530032014-06-14 00:00:10 +010087ramstage-y += stages.c
88ramstage-y += tables.c
Paul Burtone8530032014-06-14 00:00:10 +010089ramstage-y += ../../lib/memcpy.c
90ramstage-y += ../../lib/memmove.c
91ramstage-y += ../../lib/memset.c
Julius Wernerec5e5e02014-08-20 15:29:56 -070092
Paul Burtone8530032014-06-14 00:00:10 +010093ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c)
94
Julius Wernerec5e5e02014-08-20 15:29:56 -070095$(objcbfs)/ramstage.debug: $$(ramstage-objs)
Paul Burtone8530032014-06-14 00:00:10 +010096 @printf " CC $(subst $(obj)/,,$(@))\n"
Patrick Georgieec8dfb2015-05-07 22:24:41 +020097 $(LD_ramstage) --gc-sections -static -o $@ -L$(obj) -T $(obj)/mainboard/$(MAINBOARDDIR)/memlayout.ramstage.ld --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group
Paul Burtone8530032014-06-14 00:00:10 +010098
99endif # CONFIG_ARCH_RAMSTAGE_MIPS