blob: 98f9db196c6dcff79bac6bd597a3ae0e59c73a49 [file] [log] [blame]
Ronald G. Minnich98312442016-02-12 22:37:48 +00001################################################################################
2##
3## This file is part of the coreboot project.
4##
Timothy Pearson66959012016-03-09 17:21:33 -06005## Copyright (C) 2016 Raptor Engineering, LLC
Ronald G. Minnich98312442016-02-12 22:37:48 +00006## Copyright (C) 2014 The ChromiumOS Authors
7##
8## This program is free software; you can redistribute it and/or modify
9## it under the terms of the GNU General Public License as published by
10## the Free Software Foundation; version 2 of the License.
11##
12## This program is distributed in the hope that it will be useful,
13## but WITHOUT ANY WARRANTY; without even the implied warranty of
14## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15## GNU General Public License for more details.
16##
17################################################################################
18
Timothy Pearson66959012016-03-09 17:21:33 -060019power8_flags = -I$(src)/arch/power8/ -mbig-endian -mcpu=power8 -mtune=power8
Ronald G. Minnich98312442016-02-12 22:37:48 +000020
21power8_asm_flags =
22
23################################################################################
24## bootblock
25################################################################################
26ifeq ($(CONFIG_ARCH_BOOTBLOCK_POWER8),y)
27
28bootblock-y = bootblock.S stages.c
29bootblock-y += boot.c
30bootblock-y += rom_media.c
31bootblock-y += \
32 $(top)/src/lib/memchr.c \
33 $(top)/src/lib/memcmp.c \
34 $(top)/src/lib/memcpy.c \
35 $(top)/src/lib/memmove.c \
36 $(top)/src/lib/memset.c
37
Timothy Pearson66959012016-03-09 17:21:33 -060038bootblock-generic-ccopts += $(power8_flags)
39
Ronald G. Minnich98312442016-02-12 22:37:48 +000040$(objcbfs)/bootblock.debug: $$(bootblock-objs)
41 @printf " LINK $(subst $(obj)/,,$(@))\n"
42 $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) \
43 -T $(call src-to-obj,bootblock,src/mainboard/$(MAINBOARDDIR)/memlayout.ld) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) \
44 $(LIBGCC_FILE_NAME_bootblock) --end-group $(COMPILER_RT_bootblock)
45
46endif
47
48################################################################################
49## romstage
50################################################################################
51ifeq ($(CONFIG_ARCH_ROMSTAGE_POWER8),y)
52
53romstage-y += boot.c
54romstage-y += stages.c
55romstage-y += rom_media.c
56romstage-y += \
57 $(top)/src/lib/memchr.c \
58 $(top)/src/lib/memcmp.c \
59 $(top)/src/lib/memcpy.c \
60 $(top)/src/lib/memmove.c \
61 $(top)/src/lib/memset.c
62
63romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
64
65# Build the romstage
66
67$(objcbfs)/romstage.debug: $$(romstage-objs)
68 @printf " LINK $(subst $(obj)/,,$(@))\n"
69 $(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)
70
71romstage-c-ccopts += $(power8_flags)
72romstage-S-ccopts += $(power8_asm_flags)
73
Ronald G. Minnich98312442016-02-12 22:37:48 +000074endif
75
76################################################################################
77## ramstage
78################################################################################
79ifeq ($(CONFIG_ARCH_RAMSTAGE_POWER8),y)
80
81ramstage-y += rom_media.c
82ramstage-y += stages.c
83ramstage-y += misc.c
84ramstage-y += boot.c
85ramstage-y += tables.c
86ramstage-y += \
87 $(top)/src/lib/memchr.c \
88 $(top)/src/lib/memcmp.c \
89 $(top)/src/lib/memcpy.c \
90 $(top)/src/lib/memmove.c \
91 $(top)/src/lib/memset.c
92
93$(eval $(call create_class_compiler,rmodules,power8))
94
95ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
96
97ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mainboard.c
98
99# Build the ramstage
100
101$(objcbfs)/ramstage.debug: $$(ramstage-objs)
102 @printf " CC $(subst $(obj)/,,$(@))\n"
103 $(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)
104
105ramstage-c-ccopts += $(power8_flags)
106ramstage-S-ccopts += $(power8_asm_flags)
107
108endif