blob: 1c35f6f3f865bea2d767f54beae2c386008dabd7 [file] [log] [blame]
Ronald G. Minnich98312442016-02-12 22:37:48 +00001################################################################################
2##
Patrick Georgi0a2a6702020-03-04 14:43:23 +01003## SPDX-License-Identifier: GPL-2.0-only
Ronald G. Minnich98312442016-02-12 22:37:48 +00004## This file is part of the coreboot project.
5##
Ronald G. Minnich98312442016-02-12 22:37:48 +00006################################################################################
7
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +01008ppc64_flags = -I$(src)/arch/ppc64/ -mbig-endian -mcpu=power8 -mtune=power8
Ronald G. Minnich98312442016-02-12 22:37:48 +00009
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010010ppc64_asm_flags =
Ronald G. Minnich98312442016-02-12 22:37:48 +000011
12################################################################################
13## bootblock
14################################################################################
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010015ifeq ($(CONFIG_ARCH_BOOTBLOCK_PPC64),y)
Ronald G. Minnich98312442016-02-12 22:37:48 +000016
17bootblock-y = bootblock.S stages.c
18bootblock-y += boot.c
19bootblock-y += rom_media.c
20bootblock-y += \
21 $(top)/src/lib/memchr.c \
22 $(top)/src/lib/memcmp.c \
23 $(top)/src/lib/memcpy.c \
24 $(top)/src/lib/memmove.c \
25 $(top)/src/lib/memset.c
26
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010027bootblock-generic-ccopts += $(ppc64_flags)
Timothy Pearson66959012016-03-09 17:21:33 -060028
Ronald G. Minnich98312442016-02-12 22:37:48 +000029$(objcbfs)/bootblock.debug: $$(bootblock-objs)
30 @printf " LINK $(subst $(obj)/,,$(@))\n"
31 $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) \
32 -T $(call src-to-obj,bootblock,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) \
33 $(LIBGCC_FILE_NAME_bootblock) --end-group $(COMPILER_RT_bootblock)
34
35endif
36
37################################################################################
38## romstage
39################################################################################
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010040ifeq ($(CONFIG_ARCH_ROMSTAGE_PPC64),y)
Ronald G. Minnich98312442016-02-12 22:37:48 +000041
42romstage-y += boot.c
43romstage-y += stages.c
44romstage-y += rom_media.c
45romstage-y += \
46 $(top)/src/lib/memchr.c \
47 $(top)/src/lib/memcmp.c \
48 $(top)/src/lib/memcpy.c \
49 $(top)/src/lib/memmove.c \
50 $(top)/src/lib/memset.c
51
52romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
53
54# Build the romstage
55
56$(objcbfs)/romstage.debug: $$(romstage-objs)
57 @printf " LINK $(subst $(obj)/,,$(@))\n"
58 $(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)
59
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010060romstage-c-ccopts += $(ppc64_flags)
61romstage-S-ccopts += $(ppc64_asm_flags)
Ronald G. Minnich98312442016-02-12 22:37:48 +000062
Ronald G. Minnich98312442016-02-12 22:37:48 +000063endif
64
65################################################################################
66## ramstage
67################################################################################
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010068ifeq ($(CONFIG_ARCH_RAMSTAGE_PPC64),y)
Ronald G. Minnich98312442016-02-12 22:37:48 +000069
70ramstage-y += rom_media.c
71ramstage-y += stages.c
Ronald G. Minnich98312442016-02-12 22:37:48 +000072ramstage-y += boot.c
73ramstage-y += tables.c
74ramstage-y += \
75 $(top)/src/lib/memchr.c \
76 $(top)/src/lib/memcmp.c \
77 $(top)/src/lib/memcpy.c \
78 $(top)/src/lib/memmove.c \
79 $(top)/src/lib/memset.c
80
81$(eval $(call create_class_compiler,rmodules,power8))
82
83ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
84
85ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mainboard.c
86
87# Build the ramstage
88
89$(objcbfs)/ramstage.debug: $$(ramstage-objs)
90 @printf " CC $(subst $(obj)/,,$(@))\n"
91 $(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)
92
Jonathan Neuschäferc22ad582018-11-30 00:06:50 +010093ramstage-c-ccopts += $(ppc64_flags)
94ramstage-S-ccopts += $(ppc64_asm_flags)
Ronald G. Minnich98312442016-02-12 22:37:48 +000095
96endif