blob: fae4c926b760dc9ef4b21c6c4f00d02b58a4de69 [file] [log] [blame]
Ronald G. Minnich98312442016-02-12 22:37:48 +00001################################################################################
2##
3## This file is part of the coreboot project.
4##
Ronald G. Minnich98312442016-02-12 22:37:48 +00005## This program is free software; you can redistribute it and/or modify
6## it under the terms of the GNU General Public License as published by
7## the Free Software Foundation; version 2 of 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##
14################################################################################
15
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010016ppc64_flags = -I$(src)/arch/ppc64/ -mbig-endian -mcpu=power8 -mtune=power8
Ronald G. Minnich98312442016-02-12 22:37:48 +000017
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010018ppc64_asm_flags =
Ronald G. Minnich98312442016-02-12 22:37:48 +000019
20################################################################################
21## bootblock
22################################################################################
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010023ifeq ($(CONFIG_ARCH_BOOTBLOCK_PPC64),y)
Ronald G. Minnich98312442016-02-12 22:37:48 +000024
25bootblock-y = bootblock.S stages.c
26bootblock-y += boot.c
27bootblock-y += rom_media.c
28bootblock-y += \
29 $(top)/src/lib/memchr.c \
30 $(top)/src/lib/memcmp.c \
31 $(top)/src/lib/memcpy.c \
32 $(top)/src/lib/memmove.c \
33 $(top)/src/lib/memset.c
34
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010035bootblock-generic-ccopts += $(ppc64_flags)
Timothy Pearson66959012016-03-09 17:21:33 -060036
Ronald G. Minnich98312442016-02-12 22:37:48 +000037$(objcbfs)/bootblock.debug: $$(bootblock-objs)
38 @printf " LINK $(subst $(obj)/,,$(@))\n"
39 $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) \
40 -T $(call src-to-obj,bootblock,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) \
41 $(LIBGCC_FILE_NAME_bootblock) --end-group $(COMPILER_RT_bootblock)
42
43endif
44
45################################################################################
46## romstage
47################################################################################
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010048ifeq ($(CONFIG_ARCH_ROMSTAGE_PPC64),y)
Ronald G. Minnich98312442016-02-12 22:37:48 +000049
50romstage-y += boot.c
51romstage-y += stages.c
52romstage-y += rom_media.c
53romstage-y += \
54 $(top)/src/lib/memchr.c \
55 $(top)/src/lib/memcmp.c \
56 $(top)/src/lib/memcpy.c \
57 $(top)/src/lib/memmove.c \
58 $(top)/src/lib/memset.c
59
60romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
61
62# Build the romstage
63
64$(objcbfs)/romstage.debug: $$(romstage-objs)
65 @printf " LINK $(subst $(obj)/,,$(@))\n"
66 $(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 $(COMPILER_RT_romstage)
67
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010068romstage-c-ccopts += $(ppc64_flags)
69romstage-S-ccopts += $(ppc64_asm_flags)
Ronald G. Minnich98312442016-02-12 22:37:48 +000070
Ronald G. Minnich98312442016-02-12 22:37:48 +000071endif
72
73################################################################################
74## ramstage
75################################################################################
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010076ifeq ($(CONFIG_ARCH_RAMSTAGE_PPC64),y)
Ronald G. Minnich98312442016-02-12 22:37:48 +000077
78ramstage-y += rom_media.c
79ramstage-y += stages.c
Ronald G. Minnich98312442016-02-12 22:37:48 +000080ramstage-y += boot.c
81ramstage-y += tables.c
82ramstage-y += \
83 $(top)/src/lib/memchr.c \
84 $(top)/src/lib/memcmp.c \
85 $(top)/src/lib/memcpy.c \
86 $(top)/src/lib/memmove.c \
87 $(top)/src/lib/memset.c
88
89$(eval $(call create_class_compiler,rmodules,power8))
90
91ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
92
93ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mainboard.c
94
95# Build the ramstage
96
97$(objcbfs)/ramstage.debug: $$(ramstage-objs)
98 @printf " CC $(subst $(obj)/,,$(@))\n"
99 $(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 $(COMPILER_RT_ramstage)
100
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +0100101ramstage-c-ccopts += $(ppc64_flags)
102ramstage-S-ccopts += $(ppc64_asm_flags)
Ronald G. Minnich98312442016-02-12 22:37:48 +0000103
104endif