From 319fce53c83f78834986ebdfc3fd33b2f60a3ffa Mon Sep 17 00:00:00 2001 From: Bo-Chen Chen Date: Thu, 29 Sep 2022 14:13:51 +0800 Subject: [PATCH] soc/mediatek: Move DP drivers to common DP drivers can be shared for both MT8195 and MT8188, so move them to common folder. BUG=b:244208960 TEST=emerge-cherry coreboot. Signed-off-by: Bo-Chen Chen Change-Id: Ic80c03aa6b13e6c9c39fd63b5c1c1cbdbe93a7c4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68484 Tested-by: build bot (Jenkins) Reviewed-by: Yidi Lin Reviewed-by: Yu-Ping Wu --- src/soc/mediatek/{mt8195 => common/dp}/dp_intf.c | 0 src/soc/mediatek/{mt8195 => common/dp}/dptx.c | 0 src/soc/mediatek/{mt8195 => common/dp}/dptx_hal.c | 0 .../mediatek/{mt8195 => common/dp}/include/soc/dp_intf.h | 6 +++--- src/soc/mediatek/{mt8195 => common/dp}/include/soc/dptx.h | 6 +++--- .../mediatek/{mt8195 => common/dp}/include/soc/dptx_hal.h | 6 +++--- .../mediatek/{mt8195 => common/dp}/include/soc/dptx_reg.h | 6 +++--- src/soc/mediatek/mt8195/Makefile.inc | 3 ++- 8 files changed, 14 insertions(+), 13 deletions(-) rename src/soc/mediatek/{mt8195 => common/dp}/dp_intf.c (100%) rename src/soc/mediatek/{mt8195 => common/dp}/dptx.c (100%) rename src/soc/mediatek/{mt8195 => common/dp}/dptx_hal.c (100%) rename src/soc/mediatek/{mt8195 => common/dp}/include/soc/dp_intf.h (98%) rename src/soc/mediatek/{mt8195 => common/dp}/include/soc/dptx.h (91%) rename src/soc/mediatek/{mt8195 => common/dp}/include/soc/dptx_hal.h (96%) rename src/soc/mediatek/{mt8195 => common/dp}/include/soc/dptx_reg.h (99%) diff --git a/src/soc/mediatek/mt8195/dp_intf.c b/src/soc/mediatek/common/dp/dp_intf.c similarity index 100% rename from src/soc/mediatek/mt8195/dp_intf.c rename to src/soc/mediatek/common/dp/dp_intf.c diff --git a/src/soc/mediatek/mt8195/dptx.c b/src/soc/mediatek/common/dp/dptx.c similarity index 100% rename from src/soc/mediatek/mt8195/dptx.c rename to src/soc/mediatek/common/dp/dptx.c diff --git a/src/soc/mediatek/mt8195/dptx_hal.c b/src/soc/mediatek/common/dp/dptx_hal.c similarity index 100% rename from src/soc/mediatek/mt8195/dptx_hal.c rename to src/soc/mediatek/common/dp/dptx_hal.c diff --git a/src/soc/mediatek/mt8195/include/soc/dp_intf.h b/src/soc/mediatek/common/dp/include/soc/dp_intf.h similarity index 98% rename from src/soc/mediatek/mt8195/include/soc/dp_intf.h rename to src/soc/mediatek/common/dp/include/soc/dp_intf.h index ee142bfdc4..bb04716f4b 100644 --- a/src/soc/mediatek/mt8195/include/soc/dp_intf.h +++ b/src/soc/mediatek/common/dp/include/soc/dp_intf.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef SOC_MEDIATEK_MT8195_DP_INTF_H -#define SOC_MEDIATEK_MT8195_DP_INTF_H +#ifndef SOC_MEDIATEK_COMMON_DP_DP_INTF_H +#define SOC_MEDIATEK_COMMON_DP_DP_INTF_H #include @@ -255,4 +255,4 @@ struct mtk_dpintf_yc_limit { void dp_intf_config(const struct edid *edid); -#endif /* SOC_MEDIATEK_MT8195_DP_INTF_H */ +#endif /* SOC_MEDIATEK_COMMON_DP_DP_INTF_H */ diff --git a/src/soc/mediatek/mt8195/include/soc/dptx.h b/src/soc/mediatek/common/dp/include/soc/dptx.h similarity index 91% rename from src/soc/mediatek/mt8195/include/soc/dptx.h rename to src/soc/mediatek/common/dp/include/soc/dptx.h index 54b28ec283..b473301d6a 100644 --- a/src/soc/mediatek/mt8195/include/soc/dptx.h +++ b/src/soc/mediatek/common/dp/include/soc/dptx.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef SOC_MEDIATEK_MT8195_DPTX_H -#define SOC_MEDIATEK_MT8195_DPTX_H +#ifndef SOC_MEDIATEK_COMMON_DP_DPTX_H +#define SOC_MEDIATEK_COMMON_DP_DPTX_H #define DPTX_TBC_BUF_READSTARTADRTHRD 0x08 #define ENABLE_DPTX_EF_MODE 0x1 @@ -74,4 +74,4 @@ struct mtk_dp { int mtk_edp_init(struct edid *edid); -#endif /* SOC_MEDIATEK_MT8195_DPTX_H */ +#endif /* SOC_MEDIATEK_COMMON_DP_DPTX_H */ diff --git a/src/soc/mediatek/mt8195/include/soc/dptx_hal.h b/src/soc/mediatek/common/dp/include/soc/dptx_hal.h similarity index 96% rename from src/soc/mediatek/mt8195/include/soc/dptx_hal.h rename to src/soc/mediatek/common/dp/include/soc/dptx_hal.h index dcb171705b..d430b6a60c 100644 --- a/src/soc/mediatek/mt8195/include/soc/dptx_hal.h +++ b/src/soc/mediatek/common/dp/include/soc/dptx_hal.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef SOC_MEDIATEK_MT8195_DPTX_HAL_H -#define SOC_MEDIATEK_MT8195_DPTX_HAL_H +#ifndef SOC_MEDIATEK_COMMON_DP_DPTX_HAL_H +#define SOC_MEDIATEK_COMMON_DP_DPTX_HAL_H #define AUX_CMD_I2C_R_MOT0 0x1 #define AUX_CMD_I2C_R 0x5 @@ -100,4 +100,4 @@ void dptx_hal_set_color_format(struct mtk_dp *mtk_dp, u8 color_format); void dptx_hal_set_txrate(struct mtk_dp *mtk_dp, int value); void dptx_hal_analog_power_en(struct mtk_dp *mtk_dp, bool enable); -#endif /* SOC_MEDIATEK_MT8195_DPTX_HAL_H */ +#endif /* SOC_MEDIATEK_COMMON_DP_DPTX_HAL_H */ diff --git a/src/soc/mediatek/mt8195/include/soc/dptx_reg.h b/src/soc/mediatek/common/dp/include/soc/dptx_reg.h similarity index 99% rename from src/soc/mediatek/mt8195/include/soc/dptx_reg.h rename to src/soc/mediatek/common/dp/include/soc/dptx_reg.h index a010517320..a385eb8136 100644 --- a/src/soc/mediatek/mt8195/include/soc/dptx_reg.h +++ b/src/soc/mediatek/common/dp/include/soc/dptx_reg.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef SOC_MEDIATEK_MT8195_DRTX_REG_H -#define SOC_MEDIATEK_MT8195_DRTX_REG_H +#ifndef SOC_MEDIATEK_COMMON_DP_DPTX_REG_H +#define SOC_MEDIATEK_COMMON_DP_DPTX_REG_H #define TOP_OFFSET 0x2000 #define ENC0_OFFSET 0x3000 @@ -4737,4 +4737,4 @@ #define DPCD_69494 0x69494 #define DPCD_69518 0x69518 -#endif /* SOC_MEDIATEK_MT8195_DRTX_REG_H */ +#endif /* SOC_MEDIATEK_COMMON_DP_DPTX_REG_H */ diff --git a/src/soc/mediatek/mt8195/Makefile.inc b/src/soc/mediatek/mt8195/Makefile.inc index 2d50506ba4..f8b3510c11 100644 --- a/src/soc/mediatek/mt8195/Makefile.inc +++ b/src/soc/mediatek/mt8195/Makefile.inc @@ -46,7 +46,7 @@ ramstage-y += ../common/devapc.c devapc.c ramstage-y += ../common/dfd.c ramstage-y += ../common/dpm.c ramstage-$(CONFIG_DPM_FOUR_CHANNEL) += ../common/dpm_4ch.c -ramstage-y += dp_intf.c dptx.c dptx_hal.c +ramstage-y += ../common/dp/dp_intf.c ../common/dp/dptx.c ../common/dp/dptx_hal.c ramstage-y += emi.c ramstage-y += hdmi.c ramstage-y += ../common/mcu.c @@ -66,6 +66,7 @@ ramstage-y += ../common/ufs.c ramstage-y += ../common/usb.c usb.c CPPFLAGS_common += -Isrc/soc/mediatek/mt8195/include +CPPFLAGS_common += -Isrc/soc/mediatek/common/dp/include CPPFLAGS_common += -Isrc/soc/mediatek/common/include CPPFLAGS_common += -Isrc/vendorcode/mediatek/mt8195/include