diff --git a/src/include/symbols.h b/src/include/symbols.h index 48ff832afd..ad8231c089 100644 --- a/src/include/symbols.h +++ b/src/include/symbols.h @@ -75,7 +75,7 @@ DECLARE_REGION(ttb) DECLARE_OPTIONAL_REGION(ttb_subtables) DECLARE_REGION(dma_coherent) DECLARE_REGION(soc_registers) -DECLARE_REGION(framebuffer) +DECLARE_OPTIONAL_REGION(framebuffer) DECLARE_REGION(pdpt) DECLARE_OPTIONAL_REGION(opensbi) DECLARE_OPTIONAL_REGION(bl31) diff --git a/src/soc/mediatek/common/display.c b/src/soc/mediatek/common/display.c index 84981f059e..163b900769 100644 --- a/src/soc/mediatek/common/display.c +++ b/src/soc/mediatek/common/display.c @@ -11,6 +11,7 @@ #include #include #include +#include static struct panel_serializable_data *get_mipi_cmd_from_cbfs(struct panel_description *desc) { @@ -70,6 +71,7 @@ int mtk_display_init(void) struct fb_info *info; const char *name; struct panel_description *panel = get_active_panel(); + uintptr_t fb_addr; if (!panel || panel->disp_path == DISP_PATH_NONE) { printk(BIOS_ERR, "%s: Failed to get the active panel\n", __func__); @@ -143,7 +145,10 @@ int mtk_display_init(void) } } - info = fb_new_framebuffer_info_from_edid(&edid, (uintptr_t)0); + fb_addr = (REGION_SIZE(framebuffer)) ? (uintptr_t)_framebuffer : 0; + + info = fb_new_framebuffer_info_from_edid(&edid, fb_addr); + if (info) fb_set_orientation(info, panel->orientation); diff --git a/src/soc/mediatek/common/mmu_operations.c b/src/soc/mediatek/common/mmu_operations.c index 1bbe4dc319..68ac77d515 100644 --- a/src/soc/mediatek/common/mmu_operations.c +++ b/src/soc/mediatek/common/mmu_operations.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -51,6 +52,10 @@ void mtk_mmu_after_dram(void) mmu_config_range(_dram_dma, REGION_SIZE(dram_dma), NONSECURE_UNCACHED_MEM); + if (display_init_required()) + mmu_config_range(_framebuffer, REGION_SIZE(framebuffer), + NONSECURE_UNCACHED_MEM); + mtk_soc_after_dram(); }