Debian Codegraph @

src/soc/intel/apollolake/Makefile.mk

raw symbols SCIP
1 ## SPDX-License-Identifier: GPL-2.0-only
2 ifeq ($(CONFIG_SOC_INTEL_APOLLOLAKE),y)
3
4 subdirs-y += ../../../cpu/intel/common
5 subdirs-y += ../../../cpu/intel/microcode
6 subdirs-y += ../../../cpu/intel/turbo
7
8 bootblock-$(CONFIG_TPM_MEASURED_BOOT) += bootblock/bootblock_measure.c
9 bootblock-y += bootblock/bootblock.c
10 bootblock-$(CONFIG_IFWI_MEASURED_BOOT) += measured_boot.c
11 bootblock-y += ../common/block/cpu/pm_timer_emulation.c
12 bootblock-y += car.c
13 bootblock-y += heci.c
14 bootblock-y += gspi.c
15 bootblock-y += i2c.c
16 bootblock-$(CONFIG_IFWI_IBBM_LOAD) += loader.c
17 bootblock-y += lpc.c
18 bootblock-y += mmap_boot.c
19 bootblock-y += pmutil.c
20 bootblock-y += spi.c
21 bootblock-y += uart.c
22
23 romstage-y += car.c
24 romstage-y += ../../../cpu/intel/car/romstage.c
25 romstage-y += romstage.c
26 romstage-y += report_platform.c
27 romstage-y += gspi.c
28 romstage-y += heci.c
29 romstage-y += i2c.c
30 romstage-y += uart.c
31 romstage-y += meminit.c
32 ifeq ($(CONFIG_SOC_INTEL_GEMINILAKE),y)
33 romstage-y += meminit_util_glk.c
34 else
35 romstage-y += meminit_util_apl.c
36 endif
37 romstage-y += mmap_boot.c
38 romstage-y += pmutil.c
39 romstage-y += reset.c
40 romstage-y += spi.c
41
42 smm-y += mmap_boot.c
43 smm-y += pmutil.c
44 smm-y += smihandler.c
45 smm-y += spi.c
46 smm-y += uart.c
47 smm-y += elog.c
48 smm-y += xhci.c
49
50 ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
51 ramstage-y += ahci.c
52 ramstage-y += cpu.c
53 ramstage-y += chip.c
54 ramstage-y += cse.c
55 ramstage-y += elog.c
56 ramstage-y += graphics.c
57 ramstage-y += gspi.c
58 ramstage-y += heci.c
59 ramstage-y += i2c.c
60 ramstage-y += lockdown.c
61 ramstage-y += lpc.c
62 ramstage-y += mmap_boot.c
63 ramstage-y += uart.c
64 ramstage-y += nhlt.c
65 ramstage-y += spi.c
66 ramstage-y += systemagent.c
67 ramstage-y += pmutil.c
68 ramstage-y += pnpconfig.c
69 ramstage-y += pmc.c
70 ramstage-y += reset.c
71 ramstage-y += xdci.c
72 ramstage-y += sd.c
73 ramstage-y += xhci.c
74
75 postcar-y += mmap_boot.c
76 postcar-y += spi.c
77 postcar-y += i2c.c
78 postcar-y += heci.c
79 postcar-y += reset.c
80 postcar-y += uart.c
81 postcar-y += gspi.c
82
83 verstage-y += car.c
84 verstage-y += i2c.c
85 verstage-y += gspi.c
86 verstage-y += heci.c
87 verstage-y += mmap_boot.c
88 verstage-y += uart.c
89 verstage-y += pmutil.c
90 verstage-y += reset.c
91 verstage-y += spi.c
92
93 ifeq ($(CONFIG_SOC_INTEL_GEMINILAKE),y)
94 bootblock-y += gpio_glk.c
95 romstage-y += gpio_glk.c
96 smm-y += gpio_glk.c
97 ramstage-y += gpio_glk.c
98 verstage-y += gpio_glk.c
99 else
100 bootblock-y += gpio_apl.c
101 romstage-y += gpio_apl.c
102 smm-y += gpio_apl.c
103 ramstage-y += gpio_apl.c
104 verstage-y += gpio_apl.c
105 endif
106
107 CPPFLAGS_common += -I$(src)/soc/intel/apollolake/include
108
109 # Since FSP-M runs in CAR we need to relocate it to a specific address
110 $(call strip_quotes,$(CONFIG_FSP_M_CBFS))-options := -b $(CONFIG_FSP_M_ADDR)
111
112 # Handle GLK paging requirements
113 ifeq ($(CONFIG_PAGING_IN_CACHE_AS_RAM),y)
114 cbfs-files-y += pt
115 pt-file := pt.c:struct
116 pt-type := raw
117 cbfs-files-y += pdpt
118 pdpt-file := pdpt.c:struct
119 pdpt-type := raw
120 endif
121
122 ifeq ($(CONFIG_NEED_LBP2),y)
123 $(objcbfs)/lbp2.bin: $(IFWITOOL)
124 ifeq ($(CONFIG_LBP2_FROM_IFWI),y)
125 $(IFWITOOL) $(CONFIG_IFWI_FILE_NAME) create -f $@ -s
126 $(IFWITOOL) $@ delete -n OBBP
127 else
128 cp $(CONFIG_LBP2_FILE_NAME) $@
129 endif
130
131 $(call add_intermediate, write_lbp2, $(objcbfs)/lbp2.bin)
132 @printf " FMAP writing lbp2 to %s\n" $(CONFIG_LBP2_FMAP_NAME)
133 $(CBFSTOOL) $< write -r $(CONFIG_LBP2_FMAP_NAME) -f $< --fill-upward
134 endif
135
136 # Bootblock on Apollolake platform lies in the IFWI region. In order to place
137 # the bootblock at the right location in IFWI image -
138 # a. Using ifwitool:
139 # 1. Create IFWI image (ifwi.bin.tmp) from input image
140 # (CONFIG_IFWI_FILE_NAME).
141 # 2. Delete OBBP sub-partition, if present.
142 # 3. Replace IBBL directory entry in IBBP sub-partition with currently
143 # generated bootblock.bin.
144 # b. Using cbfstool:
145 # 1. Write ifwi.bin.tmp to coreboot.rom using CONFIG_IFWI_FMAP_NAME.
146 ifeq ($(CONFIG_NEED_IFWI),y)
147 $(call add_intermediate, write_ifwi, $(objcbfs)/bootblock.bin $(IFWITOOL))
148 @printf " IFWI Embedding %s in %s\n" $(objcbfs)/bootblock.bin $(CONFIG_IFWI_FMAP_NAME)
149 $(IFWITOOL) $(CONFIG_IFWI_FILE_NAME) create -f $(objcbfs)/ifwi.bin.tmp
150 $(IFWITOOL) $(objcbfs)/ifwi.bin.tmp delete -n OBBP
151 $(IFWITOOL) $(objcbfs)/ifwi.bin.tmp replace -n IBBP -f $(objcbfs)/bootblock.bin -d -e IBBL
152 $(CBFSTOOL) $< write -r $(CONFIG_IFWI_FMAP_NAME) -f $(objcbfs)/ifwi.bin.tmp --fill-upward
153 endif
154
155 # When booting APL the IBBL loader places the microcode updates embedded
156 # in the IFWI image and a matching FIT table in SRAM. After copying the
157 # bootblock to SRAM, it updates the FIT pointer at 0xffffffc0 to point
158 # to that table. Before releasing the x86 cores from reset, the regular FIT
159 # mechanism does the updates. So coreboot does not need to generate a FIT
160 # table + pointer, but reserving the pointer is still needed. Otherwise the
161 # IBBL loader thrashes code there. So include fit.c so that the linker
162 # reserves that pointer.
163 bootblock-y += bootblock/fit.c
164
165 # DSP firmware settings files.
166 ifeq ($(CONFIG_SOC_INTEL_GEMINILAKE),y)
167 NHLT_BLOB_PATH = 3rdparty/blobs/soc/intel/glk/nhlt-blobs
168 else
169 NHLT_BLOB_PATH = 3rdparty/blobs/soc/intel/apollolake/nhlt-blobs
170 endif
171 DMIC_1CH_48KHZ_16B = dmic-1ch-48khz-16b.bin
172 DMIC_2CH_48KHZ_16B = dmic-2ch-48khz-16b.bin
173 DMIC_4CH_48KHZ_16B = dmic-4ch-48khz-16b.bin
174 MAX98357_RENDER = max98357-render-2ch-48khz-24b.bin
175 DA7219_RENDER_CAPTURE = dialog-2ch-48khz-24b.bin
176 RT5682_RENDER_CAPTURE = rt5682-2ch-48khz-24b.bin
177
178 cbfs-files-$(CONFIG_NHLT_DMIC_1CH_16B) += $(DMIC_1CH_48KHZ_16B)
179 $(DMIC_1CH_48KHZ_16B)-file := $(NHLT_BLOB_PATH)/$(DMIC_1CH_48KHZ_16B)
180 $(DMIC_1CH_48KHZ_16B)-type := raw
181
182 cbfs-files-$(CONFIG_NHLT_DMIC_2CH_16B) += $(DMIC_2CH_48KHZ_16B)
183 $(DMIC_2CH_48KHZ_16B)-file := $(NHLT_BLOB_PATH)/$(DMIC_2CH_48KHZ_16B)
184 $(DMIC_2CH_48KHZ_16B)-type := raw
185
186 cbfs-files-$(CONFIG_NHLT_DMIC_4CH_16B) += $(DMIC_4CH_48KHZ_16B)
187 $(DMIC_4CH_48KHZ_16B)-file := $(NHLT_BLOB_PATH)/$(DMIC_4CH_48KHZ_16B)
188 $(DMIC_4CH_48KHZ_16B)-type := raw
189
190 cbfs-files-$(CONFIG_NHLT_MAX98357) += $(MAX98357_RENDER)
191 $(MAX98357_RENDER)-file := $(NHLT_BLOB_PATH)/$(MAX98357_RENDER)
192 $(MAX98357_RENDER)-type := raw
193
194 cbfs-files-$(CONFIG_NHLT_DA7219) += $(DA7219_RENDER_CAPTURE)
195 $(DA7219_RENDER_CAPTURE)-file := $(NHLT_BLOB_PATH)/$(DA7219_RENDER_CAPTURE)
196 $(DA7219_RENDER_CAPTURE)-type := raw
197
198 cbfs-files-$(CONFIG_NHLT_RT5682) += $(RT5682_RENDER_CAPTURE)
199 $(RT5682_RENDER_CAPTURE)-file := $(NHLT_BLOB_PATH)/$(RT5682_RENDER_CAPTURE)
200 $(RT5682_RENDER_CAPTURE)-type := raw
201
202 ifeq ($(CONFIG_SOC_INTEL_GEMINILAKE),y)
203 # Gemini Lake B0 (706a1) only atm.
204 cpu_microcode_bins += $(wildcard 3rdparty/intel-microcode/intel-ucode/06-7a-*)
205 else
206 # Apollo Lake 506c2, B0 (506c9) and E0 (506ca) only atm.
207 cpu_microcode_bins += $(wildcard 3rdparty/intel-microcode/intel-ucode/06-5c-*)
208 endif
209
210 $(objcbfs)/ibbl.rom: $(objcbfs)/bootblock.bin
211 cp $(objcbfs)/bootblock.bin $@
212
213 $(objcbfs)/ibbm.rom: $(objcbfs)/$(call strip_quotes,$(CONFIG_IBBM_ROM_COMPONENT))
214 dd if=$(objcbfs)/$(call strip_quotes,$(CONFIG_IBBM_ROM_COMPONENT)) \
215 of=$@ skip=96 bs=1 count=$(call _toint,$(CONFIG_IBBM_ROM_SIZE))
216
217 obb-deps-$(CONFIG_VBOOT) := $(obj)/gbb.region $(obj)/fwid.region
218 $(objcbfs)/obb.rom: $(CBFSTOOL) $(obj)/coreboot.rom $(obb-deps-y)
219 ifeq ($(CONFIG_VBOOT),y)
220 @printf " WRITE GBB\n"
221 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r GBB -i 0 -f $(obj)/gbb.region
222 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r RO_FRID -i 0 -f $(obj)/fwid.region
223 ifeq ($(CONFIG_VBOOT_SLOTS_RW_A),y)
224 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r RW_FWID_A -i 0 -f $(obj)/fwid.region
225 endif
226 ifeq ($(CONFIG_VBOOT_SLOTS_RW_AB),y)
227 $(CBFSTOOL) $(obj)/coreboot.rom write -u -r RW_FWID_B -i 0 -f $(obj)/fwid.region
228 endif
229 endif # CONFIG_VBOOT
230 $(CBFSTOOL) $(obj)/coreboot.rom read -r OBB -f $@
231
232 ifeq ($(CONFIG_IFWI_IBBM_LOAD),y)
233 coreboot: $(objcbfs)/ibbl.rom $(objcbfs)/ibbm.rom $(objcbfs)/obb.rom
234 endif
235
236 endif # if CONFIG_SOC_INTEL_APOLLOLAKE