1 ## SPDX-License-Identifier: GPL-2.0-only
3 ###############################################################################
5 ###############################################################################
7 ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM
),y
)
8 check-ramstage-overlap-regions
+= postram_cbfs_cache stack ttb
11 ifeq ($(CONFIG_ARCH_ARM
),y
)
13 subdirs-y
+= armv4
/ armv7
/
15 stages_c
= $(src
)/arch
/arm
/stages.c
16 stages_o
= $(obj
)/arch
/arm
/stages.o
18 $(stages_o
): $(stages_c
) $(obj
)/config.h
19 @printf
" CC $(subst $(obj)/,,$(@))\n"
20 $(CC_arm
) -I.
$(CPPFLAGS_arm
) -c
-o
$@
$< -marm
22 endif # CONFIG_ARCH_ARM
24 ###############################################################################
26 ###############################################################################
28 ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM
),y
)
30 decompressor-y
+= boot.c
32 decompressor-y
+= div0.c
34 decompressor-y
+= eabi_compat.c
35 bootblock-y
+= eabi_compat.c
36 decompressor-y
+= memset.S
37 bootblock-y
+= memset.S
38 decompressor-y
+= memcpy.S
39 bootblock-y
+= memcpy.S
40 decompressor-y
+= memmove.S
41 bootblock-y
+= memmove.S
43 bootblock-y
+= clock.c
44 bootblock-y
+= stages.c
46 $(objcbfs
)/bootblock.debug
: $$(bootblock-objs
)
47 @printf
" LINK $(subst $(obj)/,,$(@))\n"
48 $(LD_bootblock
) $(LDFLAGS_bootblock
) -o
$@
-L
$(obj
) -T
$(call src-to-obj
,bootblock
,$(CONFIG_MEMLAYOUT_LD_FILE
)) --whole-archive
--start-group
$(filter-out %.
ld,$(bootblock-objs
)) --end-group
50 $(objcbfs
)/decompressor.debug
: $$(decompressor-objs
)
51 @printf
" LINK $(subst $(obj)/,,$(@))\n"
52 $(LD_bootblock
) $(LDFLAGS_bootblock
) -o
$@
-L
$(obj
) -T
$(call src-to-obj
,decompressor
,$(CONFIG_MEMLAYOUT_LD_FILE
)) --whole-archive
--start-group
$(filter-out %.
ld,$(decompressor-objs
)) --end-group
54 endif # CONFIG_ARCH_BOOTBLOCK_ARM
56 ###############################################################################
58 ###############################################################################
60 ifeq ($(CONFIG_ARCH_VERSTAGE_ARM
),y
)
62 $(objcbfs
)/verstage.debug
: $$(verstage-objs
)
63 @printf
" LINK $(subst $(obj)/,,$(@))\n"
64 $(LD_verstage
) $(LDFLAGS_verstage
) -o
$@
-L
$(obj
) -T
$(call src-to-obj
,verstage
,$(CONFIG_MEMLAYOUT_LD_FILE
)) --whole-archive
--start-group
$(filter-out %.
ld,$(verstage-objs
)) --end-group
68 verstage-y
+= eabi_compat.c
69 verstage-y
+= memset.S
70 verstage-y
+= memcpy.S
71 verstage-y
+= memmove.S
72 verstage-y
+= stages.c
74 endif # CONFIG_ARCH_VERSTAGE_ARM
76 ###############################################################################
78 ###############################################################################
80 ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM
),y
)
83 romstage-y
+= stages.c
85 romstage-y
+= eabi_compat.c
86 romstage-y
+= memset.S
87 romstage-y
+= memcpy.S
88 romstage-y
+= memmove.S
90 rmodules_arm-y
+= memset.S
91 rmodules_arm-y
+= memcpy.S
92 rmodules_arm-y
+= memmove.S
93 rmodules_arm-y
+= eabi_compat.c
95 $(objcbfs
)/romstage.debug
: $$(romstage-objs
)
96 @printf
" LINK $(subst $(obj)/,,$(@))\n"
97 $(LD_romstage
) $(LDFLAGS_romstage
) -o
$@
-L
$(obj
) -T
$(call src-to-obj
,romstage
,$(CONFIG_MEMLAYOUT_LD_FILE
)) --whole-archive
--start-group
$(filter-out %.
ld,$(romstage-objs
)) --end-group
99 endif # CONFIG_ARCH_ROMSTAGE_ARM
101 ###############################################################################
103 ###############################################################################
105 ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM
),y
)
107 ramstage-y
+= stages.c
109 ramstage-y
+= eabi_compat.c
111 ramstage-y
+= tables.c
112 ramstage-y
+= memset.S
113 ramstage-y
+= memcpy.S
114 ramstage-y
+= memmove.S
115 ramstage-y
+= clock.c
116 ramstage-y
+= boot_linux.S
117 ramstage-
$(CONFIG_PAYLOAD_FIT_SUPPORT
) += fit_payload.c
119 rmodules_arm-y
+= memset.S
120 rmodules_arm-y
+= memcpy.S
121 rmodules_arm-y
+= memmove.S
122 rmodules_arm-y
+= eabi_compat.c
123 ramstage-srcs
+= $(wildcard src
/mainboard
/$(MAINBOARDDIR
)/mainboard.c
)
125 $(objcbfs
)/ramstage.debug
: $$(ramstage-objs
)
126 @printf
" CC $(subst $(obj)/,,$(@))\n"
127 $(LD_ramstage
) $(LDFLAGS_ramstage
) -o
$@
-L
$(obj
) -T
$(call src-to-obj
,ramstage
,$(CONFIG_MEMLAYOUT_LD_FILE
)) --whole-archive
--start-group
$(filter-out %.
ld,$(ramstage-objs
)) --end-group
129 endif # CONFIG_ARCH_RAMSTAGE_ARM