From 8a604bdbae9d5ddb1ba4ae699d978ebb38746663 Mon Sep 17 00:00:00 2001 From: Bo-Chen Chen Date: Thu, 29 Sep 2022 17:31:23 +0800 Subject: [PATCH] soc/mediatek/mt8188: Add eDP support for firmware display MT8188 supports eDP as internal display interface. BUG=b:244208960 TEST=emerge-geralt coreboot. Signed-off-by: Bo-Chen Chen Change-Id: I6441a36557b097e041bc081b907eb60b56c9fbe6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68488 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu Reviewed-by: Yidi Lin --- src/soc/mediatek/mt8188/Makefile.inc | 2 ++ src/soc/mediatek/mt8188/dp_intf.c | 13 +++++++++++++ src/soc/mediatek/mt8188/include/soc/addressmap.h | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 src/soc/mediatek/mt8188/dp_intf.c diff --git a/src/soc/mediatek/mt8188/Makefile.inc b/src/soc/mediatek/mt8188/Makefile.inc index 63c7f4aec0..ded5dfcab4 100644 --- a/src/soc/mediatek/mt8188/Makefile.inc +++ b/src/soc/mediatek/mt8188/Makefile.inc @@ -33,6 +33,7 @@ ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += ../common/bl31.c ramstage-y += ../common/ddp.c ddp.c ramstage-y += ../common/devapc.c devapc.c ramstage-y += ../common/dfd.c +ramstage-y += ../common/dp/dp_intf.c ../common/dp/dptx.c ../common/dp/dptx_hal.c dp_intf.c ramstage-y += ../common/dpm.c ramstage-$(CONFIG_DPM_FOUR_CHANNEL) += ../common/dpm_4ch.c ramstage-y += ../common/emi.c @@ -51,6 +52,7 @@ ramstage-y += ../common/usb.c usb.c BL31_MAKEARGS += PLAT=mt8188 CPPFLAGS_common += -Isrc/soc/mediatek/mt8188/include +CPPFLAGS_common += -Isrc/soc/mediatek/common/dp/include CPPFLAGS_common += -Isrc/soc/mediatek/common/include MT8188_BLOB_DIR := 3rdparty/blobs/soc/mediatek/mt8188 diff --git a/src/soc/mediatek/mt8188/dp_intf.c b/src/soc/mediatek/mt8188/dp_intf.c new file mode 100644 index 0000000000..911cf6fb65 --- /dev/null +++ b/src/soc/mediatek/mt8188/dp_intf.c @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ + +#include +#include + +const struct mtk_dpintf dpintf_data = { + .regs = (void *)(DP_INTF0_BASE), + .color_format = MTK_DPINTF_COLOR_FORMAT_RGB, + .yc_map = MTK_DPINTF_OUT_YC_MAP_RGB, + .bit_num = MTK_DPINTF_OUT_BIT_NUM_8BITS, + .channel_swap = MTK_DPINTF_OUT_CHANNEL_SWAP_RGB, + .input_mode = MTK_DPINTF_INPUT_MODE_1P, +}; diff --git a/src/soc/mediatek/mt8188/include/soc/addressmap.h b/src/soc/mediatek/mt8188/include/soc/addressmap.h index 904e77eee1..da95952231 100644 --- a/src/soc/mediatek/mt8188/include/soc/addressmap.h +++ b/src/soc/mediatek/mt8188/include/soc/addressmap.h @@ -96,9 +96,11 @@ enum { DISP_GAMMA0_BASE = IO_PHYS + 0x0C006000, DISP_DITHER0_BASE = IO_PHYS + 0x0C007000, DISP_OVL1_BASE = IO_PHYS + 0x0C00A000, + DP_INTF0_BASE = IO_PHYS + 0x0C015000, DISP_MUTEX_BASE = IO_PHYS + 0x0C016000, DISP_POSTMASK0_BASE = IO_PHYS + 0x0C01A000, VDOSYS0_BASE = IO_PHYS + 0x0C01D000, SMI_LARB0 = IO_PHYS + 0x0C022000, + EDP_BASE = IO_PHYS + 0x0C500000, }; #endif