blob: 94dae625b2f24c48dece52a00dfa009efe8f44a9 [file] [log] [blame]
Angel Pons118a9c72020-04-02 23:48:34 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Peter Stuge483b7bb2009-04-14 07:40:01 +00002
Aaron Durbin899d13d2015-05-15 23:39:23 -05003#include <assert.h>
Aaron Durbin899d13d2015-05-15 23:39:23 -05004#include <boot_device.h>
5#include <cbfs.h>
Julius Werner0d9072b2020-03-05 12:51:08 -08006#include <cbfs_private.h>
Julius Werner1e37c9c2019-12-11 17:09:39 -08007#include <cbmem.h>
Julius Werner98eeb962019-12-11 15:47:42 -08008#include <commonlib/bsd/compression.h>
Aaron Durbin0b418bd2020-10-08 14:56:03 -06009#include <commonlib/endian.h>
Bill XIEc79e96b2019-08-22 20:28:36 +080010#include <console/console.h>
Bill XIEc79e96b2019-08-22 20:28:36 +080011#include <fmap.h>
Aaron Durbin899d13d2015-05-15 23:39:23 -050012#include <lib.h>
Bill XIEc79e96b2019-08-22 20:28:36 +080013#include <security/tpm/tspi/crtm.h>
14#include <security/vboot/vboot_common.h>
15#include <stdlib.h>
16#include <string.h>
Aaron Durbin899d13d2015-05-15 23:39:23 -050017#include <symbols.h>
Julius Werner09f29212015-09-29 13:51:35 -070018#include <timestamp.h>
Patrick Georgi58a150a2016-05-02 17:22:29 +080019
Julius Werner0d9072b2020-03-05 12:51:08 -080020cb_err_t cbfs_boot_lookup(const char *name, bool force_ro,
21 union cbfs_mdata *mdata, struct region_device *rdev)
Julius Werner1e37c9c2019-12-11 17:09:39 -080022{
Julius Werner0d9072b2020-03-05 12:51:08 -080023 const struct cbfs_boot_device *cbd = cbfs_get_boot_device(force_ro);
24 if (!cbd)
25 return CB_ERR;
26
27 size_t data_offset;
Julius Werner1e37c9c2019-12-11 17:09:39 -080028 cb_err_t err = CB_CBFS_CACHE_FULL;
29 if (!CONFIG(NO_CBFS_MCACHE) && !ENV_SMM)
30 err = cbfs_mcache_lookup(cbd->mcache, cbd->mcache_size,
Julius Werner0d9072b2020-03-05 12:51:08 -080031 name, mdata, &data_offset);
Julius Werner1e37c9c2019-12-11 17:09:39 -080032 if (err == CB_CBFS_CACHE_FULL)
Julius Werner0d9072b2020-03-05 12:51:08 -080033 err = cbfs_lookup(&cbd->rdev, name, mdata, &data_offset, NULL);
34
35 if (CONFIG(VBOOT_ENABLE_CBFS_FALLBACK) && !force_ro &&
36 err == CB_CBFS_NOT_FOUND) {
37 printk(BIOS_INFO, "CBFS: Fall back to RO region for %s\n",
38 name);
39 return cbfs_boot_lookup(name, true, mdata, rdev);
40 }
41 if (err)
42 return err;
43
44 if (rdev_chain(rdev, &cbd->rdev, data_offset, be32toh(mdata->h.len)))
45 return CB_ERR;
46
47 if (tspi_measure_cbfs_hook(rdev, name, be32toh(mdata->h.type)))
48 return CB_ERR;
49
50 return CB_SUCCESS;
Julius Werner1e37c9c2019-12-11 17:09:39 -080051}
52
Aaron Durbin37a5d152015-09-17 16:09:30 -050053int cbfs_boot_locate(struct cbfsf *fh, const char *name, uint32_t *type)
Aaron Durbin899d13d2015-05-15 23:39:23 -050054{
Julius Werner0d9072b2020-03-05 12:51:08 -080055 if (cbfs_boot_lookup(name, false, &fh->mdata, &fh->data))
Julius Werner1cd013b2019-12-11 16:50:02 -080056 return -1;
57
58 size_t msize = be32toh(fh->mdata.h.offset);
59 if (rdev_chain(&fh->metadata, &addrspace_32bit.rdev,
Julius Werner0d9072b2020-03-05 12:51:08 -080060 (uintptr_t)&fh->mdata, msize))
Julius Werner1cd013b2019-12-11 16:50:02 -080061 return -1;
Julius Werner0d9072b2020-03-05 12:51:08 -080062
Julius Werner1cd013b2019-12-11 16:50:02 -080063 if (type) {
64 if (!*type)
65 *type = be32toh(fh->mdata.h.type);
66 else if (*type != be32toh(fh->mdata.h.type))
67 return -1;
Wim Vervoorn114e2e82019-11-05 14:09:16 +010068 }
69
Julius Werner1cd013b2019-12-11 16:50:02 -080070 return 0;
Aaron Durbin899d13d2015-05-15 23:39:23 -050071}
72
73void *cbfs_boot_map_with_leak(const char *name, uint32_t type, size_t *size)
74{
Aaron Durbin37a5d152015-09-17 16:09:30 -050075 struct cbfsf fh;
Aaron Durbin899d13d2015-05-15 23:39:23 -050076 size_t fsize;
77
78 if (cbfs_boot_locate(&fh, name, &type))
79 return NULL;
80
Aaron Durbin37a5d152015-09-17 16:09:30 -050081 fsize = region_device_sz(&fh.data);
Aaron Durbin899d13d2015-05-15 23:39:23 -050082
83 if (size != NULL)
84 *size = fsize;
85
Aaron Durbin37a5d152015-09-17 16:09:30 -050086 return rdev_mmap(&fh.data, 0, fsize);
Aaron Durbin899d13d2015-05-15 23:39:23 -050087}
88
Pratik Prajapati2a7708a2016-11-30 17:29:10 -080089int cbfs_locate_file_in_region(struct cbfsf *fh, const char *region_name,
Philipp Deppenwiese66f9a092018-11-08 10:59:40 +010090 const char *name, uint32_t *type)
Pratik Prajapati2a7708a2016-11-30 17:29:10 -080091{
92 struct region_device rdev;
Bill XIEbad08c22020-02-13 11:11:35 +080093 int ret = 0;
Pratik Prajapati2a7708a2016-11-30 17:29:10 -080094 if (fmap_locate_area_as_rdev(region_name, &rdev)) {
95 LOG("%s region not found while looking for %s\n",
Philipp Deppenwiese66f9a092018-11-08 10:59:40 +010096 region_name, name);
Pratik Prajapati2a7708a2016-11-30 17:29:10 -080097 return -1;
98 }
99
Julius Werner0d9072b2020-03-05 12:51:08 -0800100 uint32_t dummy_type = 0;
101 if (!type)
102 type = &dummy_type;
103
Bill XIEbad08c22020-02-13 11:11:35 +0800104 ret = cbfs_locate(fh, &rdev, name, type);
105 if (!ret)
Julius Werner0d9072b2020-03-05 12:51:08 -0800106 if (tspi_measure_cbfs_hook(&rdev, name, *type))
Bill XIEbad08c22020-02-13 11:11:35 +0800107 return -1;
108 return ret;
Pratik Prajapati2a7708a2016-11-30 17:29:10 -0800109}
110
Aaron Durbina85febc2020-05-15 15:09:10 -0600111static inline bool fsps_env(void)
112{
113 /* FSP-S is assumed to be loaded in ramstage. */
114 if (ENV_RAMSTAGE)
115 return true;
116 return false;
117}
118
Aaron Durbinecbfa992020-05-15 17:01:58 -0600119static inline bool fspm_env(void)
120{
121 /* FSP-M is assumed to be loaded in romstage. */
122 if (ENV_ROMSTAGE)
123 return true;
124 return false;
125}
126
Aaron Durbina121f952020-05-26 15:48:10 -0600127static inline bool cbfs_lz4_enabled(void)
128{
Aaron Durbina85febc2020-05-15 15:09:10 -0600129 if (fsps_env() && CONFIG(FSP_COMPRESS_FSP_S_LZ4))
130 return true;
Aaron Durbinecbfa992020-05-15 17:01:58 -0600131 if (fspm_env() && CONFIG(FSP_COMPRESS_FSP_M_LZ4))
132 return true;
Aaron Durbina85febc2020-05-15 15:09:10 -0600133
Aaron Durbina121f952020-05-26 15:48:10 -0600134 if ((ENV_BOOTBLOCK || ENV_SEPARATE_VERSTAGE) && !CONFIG(COMPRESS_PRERAM_STAGES))
135 return false;
136
137 return true;
138}
139
140static inline bool cbfs_lzma_enabled(void)
141{
Aaron Durbina85febc2020-05-15 15:09:10 -0600142 if (fsps_env() && CONFIG(FSP_COMPRESS_FSP_S_LZMA))
143 return true;
Aaron Durbinecbfa992020-05-15 17:01:58 -0600144 if (fspm_env() && CONFIG(FSP_COMPRESS_FSP_M_LZMA))
145 return true;
Aaron Durbina121f952020-05-26 15:48:10 -0600146 /* We assume here romstage and postcar are never compressed. */
147 if (ENV_BOOTBLOCK || ENV_SEPARATE_VERSTAGE)
148 return false;
149 if (ENV_ROMSTAGE && CONFIG(POSTCAR_STAGE))
150 return false;
151 if ((ENV_ROMSTAGE || ENV_POSTCAR)
152 && !CONFIG(COMPRESS_RAMSTAGE))
153 return false;
154 return true;
155}
156
Julius Werner09f29212015-09-29 13:51:35 -0700157size_t cbfs_load_and_decompress(const struct region_device *rdev, size_t offset,
158 size_t in_size, void *buffer, size_t buffer_size, uint32_t compression)
Aaron Durbin899d13d2015-05-15 23:39:23 -0500159{
Julius Werner09f29212015-09-29 13:51:35 -0700160 size_t out_size;
Aaron Durbin84f394e2020-05-26 16:16:42 -0600161 void *map;
Julius Werner09f29212015-09-29 13:51:35 -0700162
163 switch (compression) {
164 case CBFS_COMPRESS_NONE:
Julius Wernerf975e552016-08-19 15:43:06 -0700165 if (buffer_size < in_size)
166 return 0;
Julius Werner09f29212015-09-29 13:51:35 -0700167 if (rdev_readat(rdev, buffer, offset, in_size) != in_size)
168 return 0;
169 return in_size;
170
171 case CBFS_COMPRESS_LZ4:
Aaron Durbina121f952020-05-26 15:48:10 -0600172 if (!cbfs_lz4_enabled())
Julius Werner09f29212015-09-29 13:51:35 -0700173 return 0;
174
Aaron Durbin84f394e2020-05-26 16:16:42 -0600175 /* cbfs_stage_load_and_decompress() takes care of in-place
176 lz4 decompression by setting up the rdev to be in memory. */
177 map = rdev_mmap(rdev, offset, in_size);
178 if (map == NULL)
Julius Werner09f29212015-09-29 13:51:35 -0700179 return 0;
180
181 timestamp_add_now(TS_START_ULZ4F);
Aaron Durbin84f394e2020-05-26 16:16:42 -0600182 out_size = ulz4fn(map, in_size, buffer, buffer_size);
Julius Werner09f29212015-09-29 13:51:35 -0700183 timestamp_add_now(TS_END_ULZ4F);
Aaron Durbin84f394e2020-05-26 16:16:42 -0600184
185 rdev_munmap(rdev, map);
186
Julius Werner09f29212015-09-29 13:51:35 -0700187 return out_size;
188
189 case CBFS_COMPRESS_LZMA:
Aaron Durbina121f952020-05-26 15:48:10 -0600190 if (!cbfs_lzma_enabled())
Julius Werner09f29212015-09-29 13:51:35 -0700191 return 0;
Aaron Durbin84f394e2020-05-26 16:16:42 -0600192 map = rdev_mmap(rdev, offset, in_size);
Julius Werner09f29212015-09-29 13:51:35 -0700193 if (map == NULL)
194 return 0;
195
196 /* Note: timestamp not useful for memory-mapped media (x86) */
197 timestamp_add_now(TS_START_ULZMA);
198 out_size = ulzman(map, in_size, buffer, buffer_size);
199 timestamp_add_now(TS_END_ULZMA);
200
201 rdev_munmap(rdev, map);
202
203 return out_size;
204
205 default:
Aaron Durbin899d13d2015-05-15 23:39:23 -0500206 return 0;
Julius Werner09f29212015-09-29 13:51:35 -0700207 }
Aaron Durbin899d13d2015-05-15 23:39:23 -0500208}
209
Aaron Durbin84f394e2020-05-26 16:16:42 -0600210static size_t cbfs_stage_load_and_decompress(const struct region_device *rdev,
211 size_t offset, size_t in_size, void *buffer, size_t buffer_size,
212 uint32_t compression)
213{
214 struct region_device rdev_src;
215
216 if (compression == CBFS_COMPRESS_LZ4) {
217 if (!cbfs_lz4_enabled())
218 return 0;
219 /* Load the compressed image to the end of the available memory
220 * area for in-place decompression. It is the responsibility of
221 * the caller to ensure that buffer_size is large enough
222 * (see compression.h, guaranteed by cbfstool for stages). */
223 void *compr_start = buffer + buffer_size - in_size;
224 if (rdev_readat(rdev, compr_start, offset, in_size) != in_size)
225 return 0;
226 /* Create a region device backed by memory. */
227 rdev_chain(&rdev_src, &addrspace_32bit.rdev,
228 (uintptr_t)compr_start, in_size);
229
230 return cbfs_load_and_decompress(&rdev_src, 0, in_size, buffer,
231 buffer_size, compression);
232 }
233
234 /* All other algorithms can use the generic implementation. */
235 return cbfs_load_and_decompress(rdev, offset, in_size, buffer,
236 buffer_size, compression);
237}
238
Stefan Reinauer800379f2010-03-01 08:34:19 +0000239static inline int tohex4(unsigned int c)
Patrick Georgib203c2f2009-08-20 14:48:03 +0000240{
Hung-Te Lin6fe0cab2013-01-22 18:57:56 +0800241 return (c <= 9) ? (c + '0') : (c - 10 + 'a');
Patrick Georgib203c2f2009-08-20 14:48:03 +0000242}
243
Martin Rotha616a4b2020-01-21 09:28:40 -0700244static void tohex8(unsigned int val, char *dest)
245{
246 dest[0] = tohex4((val >> 4) & 0xf);
247 dest[1] = tohex4(val & 0xf);
248}
249
Lee Leahyb2d834a2017-03-08 16:52:22 -0800250static void tohex16(unsigned int val, char *dest)
Patrick Georgib203c2f2009-08-20 14:48:03 +0000251{
Philipp Deppenwiese66f9a092018-11-08 10:59:40 +0100252 dest[0] = tohex4(val >> 12);
253 dest[1] = tohex4((val >> 8) & 0xf);
254 dest[2] = tohex4((val >> 4) & 0xf);
Hung-Te Lin6fe0cab2013-01-22 18:57:56 +0800255 dest[3] = tohex4(val & 0xf);
Patrick Georgib203c2f2009-08-20 14:48:03 +0000256}
257
Aaron Durbin899d13d2015-05-15 23:39:23 -0500258void *cbfs_boot_map_optionrom(uint16_t vendor, uint16_t device)
Peter Stuge483b7bb2009-04-14 07:40:01 +0000259{
Hung-Te Lin6fe0cab2013-01-22 18:57:56 +0800260 char name[17] = "pciXXXX,XXXX.rom";
Peter Stuge483b7bb2009-04-14 07:40:01 +0000261
Philipp Deppenwiese66f9a092018-11-08 10:59:40 +0100262 tohex16(vendor, name + 3);
263 tohex16(device, name + 8);
Peter Stuge483b7bb2009-04-14 07:40:01 +0000264
Aaron Durbin899d13d2015-05-15 23:39:23 -0500265 return cbfs_boot_map_with_leak(name, CBFS_TYPE_OPTIONROM, NULL);
Peter Stuge483b7bb2009-04-14 07:40:01 +0000266}
267
Martin Rotha616a4b2020-01-21 09:28:40 -0700268void *cbfs_boot_map_optionrom_revision(uint16_t vendor, uint16_t device, uint8_t rev)
269{
270 char name[20] = "pciXXXX,XXXX,XX.rom";
271
272 tohex16(vendor, name + 3);
273 tohex16(device, name + 8);
274 tohex8(rev, name + 13);
275
276 return cbfs_boot_map_with_leak(name, CBFS_TYPE_OPTIONROM, NULL);
277}
278
T Michael Turney809fa7b2018-04-12 13:36:40 -0700279size_t cbfs_boot_load_file(const char *name, void *buf, size_t buf_size,
280 uint32_t type)
Julius Wernerf975e552016-08-19 15:43:06 -0700281{
282 struct cbfsf fh;
283 uint32_t compression_algo;
284 size_t decompressed_size;
Julius Wernerf975e552016-08-19 15:43:06 -0700285
286 if (cbfs_boot_locate(&fh, name, &type) < 0)
287 return 0;
288
289 if (cbfsf_decompression_info(&fh, &compression_algo,
Philipp Deppenwiese66f9a092018-11-08 10:59:40 +0100290 &decompressed_size)
291 < 0
292 || decompressed_size > buf_size)
Julius Wernerf975e552016-08-19 15:43:06 -0700293 return 0;
294
295 return cbfs_load_and_decompress(&fh.data, 0, region_device_sz(&fh.data),
296 buf, buf_size, compression_algo);
297}
298
Aaron Durbin899d13d2015-05-15 23:39:23 -0500299int cbfs_prog_stage_load(struct prog *pstage)
300{
301 struct cbfs_stage stage;
302 uint8_t *load;
303 void *entry;
304 size_t fsize;
305 size_t foffset;
Aaron Durbin37a5d152015-09-17 16:09:30 -0500306 const struct region_device *fh = prog_rdev(pstage);
Hung-Te Lin6fe0cab2013-01-22 18:57:56 +0800307
Aaron Durbin899d13d2015-05-15 23:39:23 -0500308 if (rdev_readat(fh, &stage, 0, sizeof(stage)) != sizeof(stage))
Julius Wernerb29bd27b2015-12-03 11:29:12 -0800309 return -1;
Aaron Durbin899d13d2015-05-15 23:39:23 -0500310
311 fsize = region_device_sz(fh);
312 fsize -= sizeof(stage);
313 foffset = 0;
314 foffset += sizeof(stage);
315
Aaron Durbin0b418bd2020-10-08 14:56:03 -0600316 /* cbfs_stage fields are written in little endian despite the other
317 cbfs data types being encoded in big endian. */
318 stage.compression = read_le32(&stage.compression);
319 stage.entry = read_le64(&stage.entry);
320 stage.load = read_le64(&stage.load);
321 stage.len = read_le32(&stage.len);
322 stage.memlen = read_le32(&stage.memlen);
323
Aaron Durbin899d13d2015-05-15 23:39:23 -0500324 assert(fsize == stage.len);
325
Aaron Durbin899d13d2015-05-15 23:39:23 -0500326 load = (void *)(uintptr_t)stage.load;
327 entry = (void *)(uintptr_t)stage.entry;
328
Aaron Durbined253c82015-10-07 17:22:42 -0500329 /* Hacky way to not load programs over read only media. The stages
330 * that would hit this path initialize themselves. */
Julius Werner21a40532020-04-21 16:03:53 -0700331 if ((ENV_BOOTBLOCK || ENV_SEPARATE_VERSTAGE) &&
332 !CONFIG(NO_XIP_EARLY_STAGES) && CONFIG(BOOT_DEVICE_MEMORY_MAPPED)) {
Aaron Durbined253c82015-10-07 17:22:42 -0500333 void *mapping = rdev_mmap(fh, foffset, fsize);
334 rdev_munmap(fh, mapping);
335 if (mapping == load)
336 goto out;
337 }
338
Aaron Durbin84f394e2020-05-26 16:16:42 -0600339 fsize = cbfs_stage_load_and_decompress(fh, foffset, fsize, load,
Julius Werner09f29212015-09-29 13:51:35 -0700340 stage.memlen, stage.compression);
341 if (!fsize)
Aaron Durbin899d13d2015-05-15 23:39:23 -0500342 return -1;
343
344 /* Clear area not covered by file. */
345 memset(&load[fsize], 0, stage.memlen - fsize);
346
Aaron Durbin096f4572016-03-31 13:49:00 -0500347 prog_segment_loaded((uintptr_t)load, stage.memlen, SEG_FINAL);
Aaron Durbined253c82015-10-07 17:22:42 -0500348
349out:
Aaron Durbin899d13d2015-05-15 23:39:23 -0500350 prog_set_area(pstage, load, stage.memlen);
351 prog_set_entry(pstage, entry, NULL);
352
353 return 0;
Hung-Te Lin6fe0cab2013-01-22 18:57:56 +0800354}
Aaron Durbin6d720f32015-12-08 17:00:23 -0600355
Julius Werner1e37c9c2019-12-11 17:09:39 -0800356void cbfs_boot_device_find_mcache(struct cbfs_boot_device *cbd, uint32_t id)
Aaron Durbin6d720f32015-12-08 17:00:23 -0600357{
Julius Werner1e37c9c2019-12-11 17:09:39 -0800358 if (CONFIG(NO_CBFS_MCACHE) || ENV_SMM)
359 return;
360
361 const struct cbmem_entry *entry;
362 if (cbmem_possibly_online() &&
363 (entry = cbmem_entry_find(id))) {
364 cbd->mcache = cbmem_entry_start(entry);
365 cbd->mcache_size = cbmem_entry_size(entry);
366 } else if (ENV_ROMSTAGE_OR_BEFORE) {
367 u8 *boundary = _ecbfs_mcache - REGION_SIZE(cbfs_mcache) *
368 CONFIG_CBFS_MCACHE_RW_PERCENTAGE / 100;
369 boundary = (u8 *)ALIGN_DOWN((uintptr_t)boundary,
370 CBFS_MCACHE_ALIGNMENT);
371 if (id == CBMEM_ID_CBFS_RO_MCACHE) {
372 cbd->mcache = _cbfs_mcache;
373 cbd->mcache_size = boundary - _cbfs_mcache;
374 } else if (id == CBMEM_ID_CBFS_RW_MCACHE) {
375 cbd->mcache = boundary;
376 cbd->mcache_size = _ecbfs_mcache - boundary;
377 }
378 }
Aaron Durbin6d720f32015-12-08 17:00:23 -0600379}
Julius Werner1e37c9c2019-12-11 17:09:39 -0800380
381const struct cbfs_boot_device *cbfs_get_boot_device(bool force_ro)
382{
383 static struct cbfs_boot_device ro;
384
385 /* Ensure we always init RO mcache, even if first file is from RW.
386 Otherwise it may not be available when needed in later stages. */
387 if (ENV_INITIAL_STAGE && !force_ro && !region_device_sz(&ro.rdev))
388 cbfs_get_boot_device(true);
389
390 if (!force_ro) {
391 const struct cbfs_boot_device *rw = vboot_get_cbfs_boot_device();
392 /* This will return NULL if vboot isn't enabled, didn't run yet
393 or decided to boot into recovery mode. */
394 if (rw)
395 return rw;
396 }
397
398 if (region_device_sz(&ro.rdev))
399 return &ro;
400
401 if (fmap_locate_area_as_rdev("COREBOOT", &ro.rdev))
402 return NULL;
403
404 cbfs_boot_device_find_mcache(&ro, CBMEM_ID_CBFS_RO_MCACHE);
405
406 if (ENV_INITIAL_STAGE && !CONFIG(NO_CBFS_MCACHE)) {
407 cb_err_t err = cbfs_mcache_build(&ro.rdev, ro.mcache,
408 ro.mcache_size, NULL);
409 if (err && err != CB_CBFS_CACHE_FULL)
410 die("Failed to build RO mcache");
411 }
412
413 return &ro;
414}
415
416#if !CONFIG(NO_CBFS_MCACHE)
417static void mcache_to_cbmem(const struct cbfs_boot_device *cbd, u32 cbmem_id)
418{
419 if (!cbd)
420 return;
421
422 size_t real_size = cbfs_mcache_real_size(cbd->mcache, cbd->mcache_size);
423 void *cbmem_mcache = cbmem_add(cbmem_id, real_size);
424 if (!cbmem_mcache) {
425 printk(BIOS_ERR, "ERROR: Cannot allocate CBMEM mcache %#x (%#zx bytes)!\n",
426 cbmem_id, real_size);
427 return;
428 }
429 memcpy(cbmem_mcache, cbd->mcache, real_size);
430}
431
432static void cbfs_mcache_migrate(int unused)
433{
434 mcache_to_cbmem(vboot_get_cbfs_boot_device(), CBMEM_ID_CBFS_RW_MCACHE);
435 mcache_to_cbmem(cbfs_get_boot_device(true), CBMEM_ID_CBFS_RO_MCACHE);
436}
437ROMSTAGE_CBMEM_INIT_HOOK(cbfs_mcache_migrate)
438#endif