Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46930 )
Change subject: soc/mediatek/common: A common API for loading the blob file ......................................................................
Patch Set 14:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46930/14/src/soc/mediatek/common/mt... File src/soc/mediatek/common/mtlib.c:
https://review.coreboot.org/c/coreboot/+/46930/14/src/soc/mediatek/common/mt... PS14, Line 25: memcpy((void *)addr, blob_data, blob_bytes);
Hi Hung-te, do you mean feed the addr to cbfs_boot_load_file() ?
Yes
https://review.coreboot.org/c/coreboot/+/46930/14/src/soc/mediatek/common/mt... PS14, Line 27: /* Memory barrier to ensure that all firmware code is loaded : * before we release the reset pin. : */
Let me clarify how those blobs are loaded. […]
You can change the description, but I think the point is, from this function <load_blob_file> people can't understand why there's some code related to 'all firmware code', also 'release reset pin'. For example, maybe you can change the function to
load_and_run_mcu(const char *fw_name, void *addr, size_t size, int (*reset_mcu)(void *));
So it's very clear we'll cbfs load, mb, and then invoke reset_mcu callback. The SPMDMA thing can be part of reset_mcu. Or if you think there'll be more components need extra DMA flow, then we can also refactor that.