* [PATCH v7 0/6] Add display support for the MT8365-EVK board
@ 2025-01-10 13:31 amergnat
2025-01-10 13:31 ` [PATCH v7 1/6] dt-bindings: display: mediatek: dpi: add power-domains example amergnat
` (7 more replies)
0 siblings, 8 replies; 19+ messages in thread
From: amergnat @ 2025-01-10 13:31 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, Alexandre Mergnat, Fabien Parent
The purpose of this series is to add the display support for the mt8365-evk.
This is the list of HWs / IPs support added:
- Connectors (HW):
- HDMI
- MIPI DSI (Mobile Industry Processor Interface Display Serial Interface)
- HDMI bridge (it66121)
- DSI pannel (startek,kd070fhfid015)
- SoC display blocks (IP):
- OVL0 (Overlay)
- RDMA0 (Data Path Read DMA)
- Color0
- CCorr0 (Color Correction)
- AAL0 (Adaptive Ambient Light)
- GAMMA0
- Dither0
- DSI0 (Display Serial Interface)
- RDMA1 (Data Path Read DMA)
- DPI0 (Display Parallel Interface)
The Mediatek DSI, DPI and DRM drivers are also improved.
The series is rebased on top of Angelo's series [1] to
use the OF graphs support.
Regards,
Alex
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
Changes in v7:
- Improve defconfig commit description
- Add comment in the DTS about pins clash with ethernet and HDMI (DPI0)
- Link to v6: https://lore.kernel.org/r/20231023-display-support-v6-0-c6af4f34f4d8@baylibre.com
Changes in v6:
- Fix DPI binding: remove the duplicated property (power-domains).
- Squash defconfig commit.
- Fix the property order in the DTS.
- Link to v5: https://lore.kernel.org/r/20231023-display-support-v5-0-3905f1e4b835@baylibre.com
Changes in v5:
- Patch merged, then removed from the series:
- dt-bindings: display: mediatek: rdma: add compatible for MT8365 SoC
- dt-bindings: display: mediatek: ovl: add compatible for MT8365 SoC
- dt-bindings: display: mediatek: gamma: add compatible for MT8365 SoC
- dt-bindings: display: mediatek: dpi: add compatible for MT8365
- dt-bindings: display: mediatek: dsi: add compatible for MT8365 SoC
- dt-bindings: display: mediatek: dither: add compatible for MT8365 SoC
- dt-bindings: display: mediatek: color: add compatible for MT8365 SoC
- dt-bindings: display: mediatek: ccorr: add compatible for MT8365 SoC
- dt-bindings: display: mediatek: aal: add compatible for MT8365 SoC
- Enable STARTEK KD070FHFID015 panel in the defconfig.
- Rebase on top of 6.13-rc6.
- Link to v4: https://lore.kernel.org/all/20231023-display-support-v4-0-ed82eb168fb1@baylibre.com
Changes in v4:
- Patch merged, then removed from the series:
- dt-bindings: display: mediatek: dpi: add power-domains property
- dt-bindings: pwm: mediatek,pwm-disp: add compatible for mt8365 SoC
- clk: mediatek: mt8365-mm: fix DPI0 parent
- Remove mediatek,mt8365-dpi compatible from mtk_drm_drv.c because it
use the mt8192's data. It's a miss.
- Add MT8365 OF graphs support, remove the hardcoded display path and
rebase on top of Angelo's series [1].
- Link to v3: https://lore.kernel.org/r/20231023-display-support-v3-0-53388f3ed34b@baylibre.com
Changes in v3:
- Drop "drm/mediatek: add mt8365 dpi support" because it's the same
config as mt8192 SoC
- Drop "dt-bindings: pwm: mediatek,pwm-disp: add power-domains property"
because an equivalent patch has been merge already.
- Add DPI clock fix in a separate commit.
- Improve DTS(I) readability.
- Link to v2: https://lore.kernel.org/r/20231023-display-support-v2-0-33ce8864b227@baylibre.com
Changes in v2:
- s/binding/compatible/ in commit messages/titles.
- Improve commit messages as Conor suggest.
- pwm-disp: Set power domain property for MT8365. This one is optionnal
and can be used for other SoC.
- Fix mediatek,dsi.yaml issue.
- Remove the extra clock in the DPI node/driver and fix the dpi clock
parenting to be consistent with the DPI clock assignement.
- Link to v1: https://lore.kernel.org/r/20231023-display-support-v1-0-5c860ed5c33b@baylibre.com
[1] https://lore.kernel.org/lkml/20240516081104.83458-1-angelogioacchino.delregno@collabora.com/
---
Alexandre Mergnat (4):
drm/mediatek: dsi: Improves the DSI lane setup robustness
arm64: defconfig: enable display support for mt8365-evk
arm64: dts: mediatek: add display blocks support for the MT8365 SoC
arm64: dts: mediatek: add display support for mt8365-evk
Fabien Parent (2):
dt-bindings: display: mediatek: dpi: add power-domains example
drm/mediatek: add MT8365 SoC support
.../bindings/display/mediatek/mediatek,dpi.yaml | 2 +
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 245 ++++++++++++++-
arch/arm64/boot/dts/mediatek/mt8365.dtsi | 336 +++++++++++++++++++++
arch/arm64/configs/defconfig | 2 +
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 8 +
drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +
6 files changed, 594 insertions(+), 1 deletion(-)
---
base-commit: 9d89551994a430b50c4fffcb1e617a057fa76e20
change-id: 20231023-display-support-c6418b30e419
Best regards,
--
Alexandre Mergnat <amergnat@baylibre.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v7 1/6] dt-bindings: display: mediatek: dpi: add power-domains example
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
@ 2025-01-10 13:31 ` amergnat
2025-03-03 13:22 ` Chun-Kuang Hu
2025-01-10 13:31 ` [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness Alexandre Mergnat
` (6 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: amergnat @ 2025-01-10 13:31 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, Alexandre Mergnat, Fabien Parent
From: Fabien Parent <fparent@baylibre.com>
DPI is part of the display / multimedia block in MediaTek SoCs, and
always have a power-domain (at least in the upstream device-trees).
Add the power-domains property to the binding example.
Fixes: 9273cf7d3942 ("dt-bindings: display: mediatek: convert the dpi bindings to yaml")
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
index 0f1e556dc8ef..d5ee52ea479b 100644
--- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
+++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
@@ -116,11 +116,13 @@ examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/mt8173-clk.h>
+ #include <dt-bindings/power/mt8173-power.h>
dpi: dpi@1401d000 {
compatible = "mediatek,mt8173-dpi";
reg = <0x1401d000 0x1000>;
interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>;
+ power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
clocks = <&mmsys CLK_MM_DPI_PIXEL>,
<&mmsys CLK_MM_DPI_ENGINE>,
<&apmixedsys CLK_APMIXED_TVDPLL>;
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
2025-01-10 13:31 ` [PATCH v7 1/6] dt-bindings: display: mediatek: dpi: add power-domains example amergnat
@ 2025-01-10 13:31 ` Alexandre Mergnat
2025-02-17 7:56 ` CK Hu (胡俊光)
2025-01-10 13:31 ` [PATCH v7 3/6] drm/mediatek: add MT8365 SoC support amergnat
` (5 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Alexandre Mergnat @ 2025-01-10 13:31 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, Alexandre Mergnat
Currently, mtk_dsi_lane_ready (which setup the DSI lane) is triggered
before mtk_dsi_poweron. lanes_ready flag toggle to true during
mtk_dsi_lane_ready function, and the DSI module is set up during
mtk_dsi_poweron.
Later, during panel driver init, mtk_dsi_lane_ready is triggered but does
nothing because lanes are considered ready. Unfortunately, when the panel
driver try to communicate, the DSI returns a timeout.
The solution found here is to put lanes_ready flag to false after the DSI
module setup into mtk_dsi_poweron to init the DSI lanes after the power /
setup of the DSI module.
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index e61b9bc68e9a..dcf0d93881b5 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -724,6 +724,8 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
mtk_dsi_config_vdo_timing(dsi);
mtk_dsi_set_interrupt_enable(dsi);
+ dsi->lanes_ready = false;
+
return 0;
err_disable_engine_clk:
clk_disable_unprepare(dsi->engine_clk);
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v7 3/6] drm/mediatek: add MT8365 SoC support
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
2025-01-10 13:31 ` [PATCH v7 1/6] dt-bindings: display: mediatek: dpi: add power-domains example amergnat
2025-01-10 13:31 ` [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness Alexandre Mergnat
@ 2025-01-10 13:31 ` amergnat
2025-02-17 7:36 ` CK Hu (胡俊光)
2025-03-03 13:15 ` Chun-Kuang Hu
2025-01-10 13:31 ` [PATCH v7 4/6] arm64: defconfig: enable display support for mt8365-evk Alexandre Mergnat
` (4 subsequent siblings)
7 siblings, 2 replies; 19+ messages in thread
From: amergnat @ 2025-01-10 13:31 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, Alexandre Mergnat, Fabien Parent
From: Fabien Parent <fparent@baylibre.com>
Add DRM support for MT8365 SoC.
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index 0829ceb9967c..5471ef744cc1 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -328,6 +328,10 @@ static const struct mtk_mmsys_driver_data mt8195_vdosys1_driver_data = {
.min_height = 1,
};
+static const struct mtk_mmsys_driver_data mt8365_mmsys_driver_data = {
+ .mmsys_dev_num = 1,
+};
+
static const struct of_device_id mtk_drm_of_ids[] = {
{ .compatible = "mediatek,mt2701-mmsys",
.data = &mt2701_mmsys_driver_data},
@@ -355,6 +359,8 @@ static const struct of_device_id mtk_drm_of_ids[] = {
.data = &mt8195_vdosys0_driver_data},
{ .compatible = "mediatek,mt8195-vdosys1",
.data = &mt8195_vdosys1_driver_data},
+ { .compatible = "mediatek,mt8365-mmsys",
+ .data = &mt8365_mmsys_driver_data},
{ }
};
MODULE_DEVICE_TABLE(of, mtk_drm_of_ids);
@@ -751,6 +757,8 @@ static const struct of_device_id mtk_ddp_comp_dt_ids[] = {
.data = (void *)MTK_DISP_MUTEX },
{ .compatible = "mediatek,mt8195-disp-mutex",
.data = (void *)MTK_DISP_MUTEX },
+ { .compatible = "mediatek,mt8365-disp-mutex",
+ .data = (void *)MTK_DISP_MUTEX },
{ .compatible = "mediatek,mt8173-disp-od",
.data = (void *)MTK_DISP_OD },
{ .compatible = "mediatek,mt2701-disp-ovl",
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v7 4/6] arm64: defconfig: enable display support for mt8365-evk
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
` (2 preceding siblings ...)
2025-01-10 13:31 ` [PATCH v7 3/6] drm/mediatek: add MT8365 SoC support amergnat
@ 2025-01-10 13:31 ` Alexandre Mergnat
2025-01-10 14:10 ` Krzysztof Kozlowski
2025-01-10 13:31 ` [PATCH v7 5/6] arm64: dts: mediatek: add display blocks support for the MT8365 SoC Alexandre Mergnat
` (3 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Alexandre Mergnat @ 2025-01-10 13:31 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, Alexandre Mergnat
Enable the DRM HDMI connector support and the MIPI-DSI display
Startek KD070FHFID015 panel to have HDMI and DSI display working
on the mt8365-evk board.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
arch/arm64/configs/defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index c62831e61586..1e2963a13500 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -897,9 +897,11 @@ CONFIG_DRM_PANEL_NOVATEK_NT36672E=m
CONFIG_DRM_PANEL_RAYDIUM_RM67191=m
CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20=m
CONFIG_DRM_PANEL_SITRONIX_ST7703=m
+CONFIG_DRM_PANEL_STARTEK_KD070FHFID015=m
CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA=m
CONFIG_DRM_PANEL_VISIONOX_VTDR6130=m
CONFIG_DRM_FSL_LDB=m
+CONFIG_DRM_DISPLAY_CONNECTOR=m
CONFIG_DRM_LONTIUM_LT8912B=m
CONFIG_DRM_LONTIUM_LT9611=m
CONFIG_DRM_LONTIUM_LT9611UXC=m
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v7 5/6] arm64: dts: mediatek: add display blocks support for the MT8365 SoC
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
` (3 preceding siblings ...)
2025-01-10 13:31 ` [PATCH v7 4/6] arm64: defconfig: enable display support for mt8365-evk Alexandre Mergnat
@ 2025-01-10 13:31 ` Alexandre Mergnat
2025-01-10 13:31 ` [PATCH v7 6/6] arm64: dts: mediatek: add display support for mt8365-evk Alexandre Mergnat
` (2 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Alexandre Mergnat @ 2025-01-10 13:31 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, Alexandre Mergnat
- Add aliases for each display components to help display drivers.
- Add the Display Pulse Width Modulation (DISP_PWM) to provide PWM signals
for the LED driver of mobile LCM.
- Add the MIPI Display Serial Interface (DSI) PHY support. (up to 4-lane
output)
- Add the display mutex support.
- Add the following display component support:
- OVL0 (Overlay)
- RDMA0 (Data Path Read DMA)
- Color0
- CCorr0 (Color Correction)
- AAL0 (Adaptive Ambient Light)
- GAMMA0
- Dither0
- DSI0 (Display Serial Interface)
- RDMA1 (Data Path Read DMA)
- DPI0 (Display Parallel Interface)
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
arch/arm64/boot/dts/mediatek/mt8365.dtsi | 336 +++++++++++++++++++++++++++++++
1 file changed, 336 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index 9c91fe8ea0f9..fdd570ca2d20 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -10,6 +10,7 @@
#include <dt-bindings/clock/mediatek,mt8365-clk.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/memory/mediatek,mt8365-larb-port.h>
#include <dt-bindings/phy/phy.h>
#include <dt-bindings/power/mediatek,mt8365-power.h>
@@ -19,6 +20,19 @@ / {
#address-cells = <2>;
#size-cells = <2>;
+ aliases {
+ aal0 = &aal0;
+ ccorr0 = &ccorr0;
+ color0 = &color0;
+ dither0 = &dither0;
+ dpi0 = &dpi0;
+ dsi0 = &dsi0;
+ gamma0 = &gamma0;
+ ovl0 = &ovl0;
+ rdma0 = &rdma0;
+ rdma1 = &rdma1;
+ };
+
cpus {
#address-cells = <1>;
#size-cells = <0>;
@@ -608,6 +622,15 @@ spi: spi@1100a000 {
status = "disabled";
};
+ disp_pwm: pwm@1100e000 {
+ compatible = "mediatek,mt8365-disp-pwm", "mediatek,mt8183-disp-pwm";
+ reg = <0 0x1100e000 0 0x1000>;
+ clock-names = "main", "mm";
+ clocks = <&topckgen CLK_TOP_DISP_PWM_SEL>, <&infracfg CLK_IFR_DISP_PWM>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ #pwm-cells = <2>;
+ };
+
i2c3: i2c@1100f000 {
compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
reg = <0 0x1100f000 0 0xa0>, <0 0x11000200 0 0x80>;
@@ -704,6 +727,15 @@ ethernet: ethernet@112a0000 {
status = "disabled";
};
+ mipi_tx0: dsi-phy@11c00000 {
+ compatible = "mediatek,mt8365-mipi-tx", "mediatek,mt8183-mipi-tx";
+ reg = <0 0x11c00000 0 0x800>;
+ clock-output-names = "mipi_tx0_pll";
+ clocks = <&clk26m>;
+ #clock-cells = <0>;
+ #phy-cells = <0>;
+ };
+
u3phy: t-phy@11cc0000 {
compatible = "mediatek,mt8365-tphy", "mediatek,generic-tphy-v2";
#address-cells = <1>;
@@ -731,6 +763,26 @@ mmsys: syscon@14000000 {
compatible = "mediatek,mt8365-mmsys", "syscon";
reg = <0 0x14000000 0 0x1000>;
#clock-cells = <1>;
+ port {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ mmsys_main: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&ovl0_in>;
+ };
+ mmsys_ext: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&rdma1_in>;
+ };
+ };
+ };
+
+ mutex: mutex@14001000 {
+ compatible = "mediatek,mt8365-disp-mutex";
+ reg = <0 0x14001000 0 0x1000>;
+ interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_LOW>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
};
smi_common: smi@14002000 {
@@ -756,6 +808,290 @@ larb0: larb@14003000 {
mediatek,larb-id = <0>;
};
+ ovl0: ovl@1400b000 {
+ compatible = "mediatek,mt8365-disp-ovl", "mediatek,mt8192-disp-ovl";
+ reg = <0 0x1400b000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MM_DISP_OVL0>;
+ interrupts = <GIC_SPI 161 IRQ_TYPE_LEVEL_LOW>;
+ iommus = <&iommu M4U_PORT_DISP_OVL0>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ ovl0_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&mmsys_main>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ ovl0_out: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&rdma0_in>;
+ };
+ };
+ };
+ };
+
+ rdma0: rdma@1400d000 {
+ compatible = "mediatek,mt8365-disp-rdma", "mediatek,mt8183-disp-rdma";
+ reg = <0 0x1400d000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MM_DISP_RDMA0>;
+ interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_LOW>;
+ iommus = <&iommu M4U_PORT_DISP_RDMA0>;
+ mediatek,rdma-fifo-size = <5120>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ rdma0_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&ovl0_out>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ rdma0_out: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&color0_in>;
+ };
+ };
+ };
+ };
+
+ color0: color@1400f000 {
+ compatible = "mediatek,mt8365-disp-color", "mediatek,mt8173-disp-color";
+ reg = <0 0x1400f000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MM_DISP_COLOR0>;
+ interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_LOW>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ color0_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&rdma0_out>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ color0_out: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&ccorr0_in>;
+ };
+ };
+ };
+ };
+
+ ccorr0: ccorr@14010000 {
+ compatible = "mediatek,mt8365-disp-ccorr", "mediatek,mt8183-disp-ccorr";
+ reg = <0 0x14010000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MM_DISP_CCORR0>;
+ interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_LOW>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ ccorr0_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&color0_out>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ ccorr0_out: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&aal0_in>;
+ };
+ };
+ };
+ };
+
+ aal0: aal@14011000 {
+ compatible = "mediatek,mt8365-disp-aal", "mediatek,mt8183-disp-aal";
+ reg = <0 0x14011000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MM_DISP_AAL0>;
+ interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_LOW>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ aal0_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&ccorr0_out>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ aal0_out: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&gamma0_in>;
+ };
+ };
+ };
+ };
+
+ gamma0: gamma@14012000 {
+ compatible = "mediatek,mt8365-disp-gamma", "mediatek,mt8183-disp-gamma";
+ reg = <0 0x14012000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MM_DISP_GAMMA0>;
+ interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_LOW>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ gamma0_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&aal0_out>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ gamma0_out: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dither0_in>;
+ };
+ };
+ };
+ };
+
+ dither0: dither@14013000 {
+ compatible = "mediatek,mt8365-disp-dither", "mediatek,mt8183-disp-dither";
+ reg = <0 0x14013000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MM_DISP_DITHER0>;
+ interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_LOW>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ dither0_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&gamma0_out>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ dither0_out: endpoint@0 {
+ reg = <0>;
+ };
+ };
+ };
+ };
+
+ dsi0: dsi@14014000 {
+ compatible = "mediatek,mt8365-dsi", "mediatek,mt8183-dsi";
+ reg = <0 0x14014000 0 0x1000>;
+ clock-names = "engine", "digital", "hs";
+ clocks = <&mmsys CLK_MM_MM_DSI0>,
+ <&mmsys CLK_MM_DSI0_DIG_DSI>,
+ <&mipi_tx0>;
+ interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_LOW>;
+ phy-names = "dphy";
+ phys = <&mipi_tx0>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ };
+
+ rdma1: rdma@14016000 {
+ compatible = "mediatek,mt8365-disp-rdma", "mediatek,mt8183-disp-rdma";
+ reg = <0 0x14016000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_MM_DISP_RDMA1>;
+ interrupts = <GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>;
+ iommus = <&iommu M4U_PORT_DISP_RDMA1>;
+ mediatek,rdma-fifo-size = <2048>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ rdma1_in: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&mmsys_ext>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ rdma1_out: endpoint@1 {
+ reg = <1>;
+ };
+ };
+ };
+ };
+
+ dpi0: dpi@14018000 {
+ compatible = "mediatek,mt8365-dpi", "mediatek,mt8192-dpi";
+ reg = <0 0x14018000 0 0x1000>;
+ clocks = <&mmsys CLK_MM_DPI0_DPI0>,
+ <&mmsys CLK_MM_MM_DPI0>,
+ <&apmixedsys CLK_APMIXED_LVDSPLL>;
+ clock-names = "pixel", "engine", "pll";
+ interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_LOW>;
+ power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+ status = "disabled";
+ };
+
camsys: syscon@15000000 {
compatible = "mediatek,mt8365-imgsys", "syscon";
reg = <0 0x15000000 0 0x1000>;
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v7 6/6] arm64: dts: mediatek: add display support for mt8365-evk
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
` (4 preceding siblings ...)
2025-01-10 13:31 ` [PATCH v7 5/6] arm64: dts: mediatek: add display blocks support for the MT8365 SoC Alexandre Mergnat
@ 2025-01-10 13:31 ` Alexandre Mergnat
2025-02-06 11:08 ` (subset) [PATCH v7 0/6] Add display support for the MT8365-EVK board AngeloGioacchino Del Regno
2025-02-07 13:37 ` Alexandre Mergnat
7 siblings, 0 replies; 19+ messages in thread
From: Alexandre Mergnat @ 2025-01-10 13:31 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, Alexandre Mergnat
MIPI DSI:
- Add "vsys_lcm_reg" regulator support and setup the "mt6357_vsim1_reg",
to power the pannel plugged to the DSI connector.
- Setup the Display Parallel Interface.
- Add the startek kd070fhfid015 pannel support.
HDMI:
- Add HDMI connector support.
- Add the "ite,it66121" HDMI bridge support, driven by I2C1.
- Setup the Display Parallel Interface.
Fix a typo in the ethernet node.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 245 +++++++++++++++++++++++++++-
1 file changed, 244 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index 7d90112a7e27..c72b2f6f8ef4 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
@@ -27,6 +27,21 @@ chosen {
stdout-path = "serial0:921600n8";
};
+ connector {
+ compatible = "hdmi-connector";
+ label = "hdmi";
+ type = "d";
+
+ port {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ hdmi_connector_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&hdmi_connector_out>;
+ };
+ };
+ };
+
firmware {
optee {
compatible = "linaro,optee-tz";
@@ -104,6 +119,16 @@ sound: sound {
pinctrl-5 = <&aud_mosi_on_pins>;
mediatek,platform = <&afe>;
};
+
+ vsys_lcm_reg: regulator-vsys-lcm {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&pio 129 GPIO_ACTIVE_HIGH>;
+ regulator-max-microvolt = <5000000>;
+ regulator-min-microvolt = <5000000>;
+ regulator-name = "vsys_lcm";
+ };
+
};
&afe {
@@ -131,13 +156,102 @@ &cpu3 {
sram-supply = <&mt6357_vsram_proc_reg>;
};
+&dither0_out {
+ remote-endpoint = <&dsi0_in>;
+};
+
+&dpi0 {
+ pinctrl-0 = <&dpi_default_pins>;
+ pinctrl-1 = <&dpi_idle_pins>;
+ pinctrl-names = "default", "sleep";
+ /*
+ * Ethernet and HDMI (DPI0) are sharing pins.
+ * Only one can be enabled at a time and require the physical switch
+ * SW2101 to be set on LAN position
+ */
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ dpi0_in: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&rdma1_out>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ dpi0_out: endpoint@1 {
+ reg = <1>;
+ remote-endpoint = <&it66121_in>;
+ };
+ };
+ };
+};
+
+&dsi0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ panel@0 {
+ compatible = "startek,kd070fhfid015";
+ reg = <0>;
+ enable-gpios = <&pio 67 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&pio 20 GPIO_ACTIVE_HIGH>;
+ iovcc-supply = <&mt6357_vsim1_reg>;
+ power-supply = <&vsys_lcm_reg>;
+
+ port {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ panel_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dsi0_out>;
+ };
+ };
+ };
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ dsi0_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dither0_out>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ dsi0_out: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&panel_in>;
+ };
+ };
+ };
+};
+
ðernet {
pinctrl-0 = <ðernet_pins>;
pinctrl-names = "default";
phy-handle = <ð_phy>;
phy-mode = "rmii";
/*
- * Ethernet and HDMI (DSI0) are sharing pins.
+ * Ethernet and HDMI (DPI0) are sharing pins.
* Only one can be enabled at a time and require the physical switch
* SW2101 to be set on LAN position
* mt6357_vibr_reg and mt6357_vsim2_reg are needed to supply ethernet
@@ -161,6 +275,56 @@ &i2c0 {
status = "okay";
};
+&i2c1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ clock-div = <2>;
+ clock-frequency = <100000>;
+ pinctrl-0 = <&i2c1_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ it66121_hdmi: hdmi@4c {
+ compatible = "ite,it66121";
+ reg = <0x4c>;
+ #sound-dai-cells = <0>;
+ interrupt-parent = <&pio>;
+ interrupts = <68 IRQ_TYPE_LEVEL_LOW>;
+ pinctrl-0 = <&ite_pins>;
+ pinctrl-names = "default";
+ reset-gpios = <&pio 69 GPIO_ACTIVE_LOW>;
+ vcn18-supply = <&mt6357_vsim2_reg>;
+ vcn33-supply = <&mt6357_vibr_reg>;
+ vrf12-supply = <&mt6357_vrf12_reg>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ it66121_in: endpoint@0 {
+ reg = <0>;
+ bus-width = <12>;
+ remote-endpoint = <&dpi0_out>;
+ };
+ };
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ hdmi_connector_out: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&hdmi_connector_in>;
+ };
+ };
+ };
+ };
+};
+
&mmc0 {
assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL>;
assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>;
@@ -205,6 +369,11 @@ &mt6357_pmic {
mediatek,micbias1-microvolt = <1700000>;
};
+&mt6357_vsim1_reg {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+};
+
&pio {
aud_default_pins: audiodefault-pins {
clk-dat-pins {
@@ -267,6 +436,49 @@ clk-dat-pins {
};
};
+ dpi_default_pins: dpi-default-pins {
+ pins {
+ pinmux = <MT8365_PIN_0_GPIO0__FUNC_DPI_D0>,
+ <MT8365_PIN_1_GPIO1__FUNC_DPI_D1>,
+ <MT8365_PIN_2_GPIO2__FUNC_DPI_D2>,
+ <MT8365_PIN_3_GPIO3__FUNC_DPI_D3>,
+ <MT8365_PIN_4_GPIO4__FUNC_DPI_D4>,
+ <MT8365_PIN_5_GPIO5__FUNC_DPI_D5>,
+ <MT8365_PIN_6_GPIO6__FUNC_DPI_D6>,
+ <MT8365_PIN_7_GPIO7__FUNC_DPI_D7>,
+ <MT8365_PIN_8_GPIO8__FUNC_DPI_D8>,
+ <MT8365_PIN_9_GPIO9__FUNC_DPI_D9>,
+ <MT8365_PIN_10_GPIO10__FUNC_DPI_D10>,
+ <MT8365_PIN_11_GPIO11__FUNC_DPI_D11>,
+ <MT8365_PIN_12_GPIO12__FUNC_DPI_DE>,
+ <MT8365_PIN_13_GPIO13__FUNC_DPI_VSYNC>,
+ <MT8365_PIN_14_GPIO14__FUNC_DPI_CK>,
+ <MT8365_PIN_15_GPIO15__FUNC_DPI_HSYNC>;
+ drive-strength = <4>;
+ };
+ };
+
+ dpi_idle_pins: dpi-idle-pins {
+ pins {
+ pinmux = <MT8365_PIN_0_GPIO0__FUNC_GPIO0>,
+ <MT8365_PIN_1_GPIO1__FUNC_GPIO1>,
+ <MT8365_PIN_2_GPIO2__FUNC_GPIO2>,
+ <MT8365_PIN_3_GPIO3__FUNC_GPIO3>,
+ <MT8365_PIN_4_GPIO4__FUNC_GPIO4>,
+ <MT8365_PIN_5_GPIO5__FUNC_GPIO5>,
+ <MT8365_PIN_6_GPIO6__FUNC_GPIO6>,
+ <MT8365_PIN_7_GPIO7__FUNC_GPIO7>,
+ <MT8365_PIN_8_GPIO8__FUNC_GPIO8>,
+ <MT8365_PIN_9_GPIO9__FUNC_GPIO9>,
+ <MT8365_PIN_10_GPIO10__FUNC_GPIO10>,
+ <MT8365_PIN_11_GPIO11__FUNC_GPIO11>,
+ <MT8365_PIN_12_GPIO12__FUNC_GPIO12>,
+ <MT8365_PIN_13_GPIO13__FUNC_GPIO13>,
+ <MT8365_PIN_14_GPIO14__FUNC_GPIO14>,
+ <MT8365_PIN_15_GPIO15__FUNC_GPIO15>;
+ };
+ };
+
ethernet_pins: ethernet-pins {
phy_reset_pins {
pinmux = <MT8365_PIN_133_TDM_TX_DATA1__FUNC_GPIO133>;
@@ -308,6 +520,33 @@ pins {
};
};
+ i2c1_pins: i2c1-pins {
+ pins {
+ pinmux = <MT8365_PIN_59_SDA1__FUNC_SDA1_0>,
+ <MT8365_PIN_60_SCL1__FUNC_SCL1_0>;
+ bias-pull-up;
+ };
+ };
+
+ ite_pins: ite-pins {
+ irq_ite_pins {
+ pinmux = <MT8365_PIN_68_CMDAT0__FUNC_GPIO68>;
+ input-enable;
+ bias-pull-up;
+ };
+
+ pwr_pins {
+ pinmux = <MT8365_PIN_70_CMDAT2__FUNC_GPIO70>,
+ <MT8365_PIN_71_CMDAT3__FUNC_GPIO71>;
+ output-high;
+ };
+
+ rst_ite_pins {
+ pinmux = <MT8365_PIN_69_CMDAT1__FUNC_GPIO69>;
+ output-high;
+ };
+ };
+
mmc0_default_pins: mmc0-default-pins {
clk-pins {
pinmux = <MT8365_PIN_99_MSDC0_CLK__FUNC_MSDC0_CLK>;
@@ -463,6 +702,10 @@ &pwm {
status = "okay";
};
+&rdma1_out {
+ remote-endpoint = <&dpi0_in>;
+};
+
&ssusb {
dr_mode = "otg";
maximum-speed = "high-speed";
--
2.25.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v7 4/6] arm64: defconfig: enable display support for mt8365-evk
2025-01-10 13:31 ` [PATCH v7 4/6] arm64: defconfig: enable display support for mt8365-evk Alexandre Mergnat
@ 2025-01-10 14:10 ` Krzysztof Kozlowski
0 siblings, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-10 14:10 UTC (permalink / raw)
To: Alexandre Mergnat, Chun-Kuang Hu, Philipp Zabel,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
AngeloGioacchino Del Regno, Jitao Shi, CK Hu, Catalin Marinas,
Will Deacon, Simona Vetter, Simona Vetter
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel
On 10/01/2025 14:31, Alexandre Mergnat wrote:
> Enable the DRM HDMI connector support and the MIPI-DSI display
> Startek KD070FHFID015 panel to have HDMI and DSI display working
> on the mt8365-evk board.
>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: (subset) [PATCH v7 0/6] Add display support for the MT8365-EVK board
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
` (5 preceding siblings ...)
2025-01-10 13:31 ` [PATCH v7 6/6] arm64: dts: mediatek: add display support for mt8365-evk Alexandre Mergnat
@ 2025-02-06 11:08 ` AngeloGioacchino Del Regno
2025-02-07 13:37 ` Alexandre Mergnat
7 siblings, 0 replies; 19+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-06 11:08 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, Jitao Shi, CK Hu, Catalin Marinas,
Will Deacon, Simona Vetter, Simona Vetter, amergnat
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel, Fabien Parent
On Fri, 10 Jan 2025 14:31:10 +0100, amergnat@baylibre.com wrote:
> The purpose of this series is to add the display support for the mt8365-evk.
>
> This is the list of HWs / IPs support added:
> - Connectors (HW):
> - HDMI
> - MIPI DSI (Mobile Industry Processor Interface Display Serial Interface)
> - HDMI bridge (it66121)
> - DSI pannel (startek,kd070fhfid015)
> - SoC display blocks (IP):
> - OVL0 (Overlay)
> - RDMA0 (Data Path Read DMA)
> - Color0
> - CCorr0 (Color Correction)
> - AAL0 (Adaptive Ambient Light)
> - GAMMA0
> - Dither0
> - DSI0 (Display Serial Interface)
> - RDMA1 (Data Path Read DMA)
> - DPI0 (Display Parallel Interface)
>
> [...]
Applied to v6.14-next/dts64, thanks!
[5/6] arm64: dts: mediatek: add display blocks support for the MT8365 SoC
commit: ec207ea7f6f9abb5b0c50394b02f434aa1ca7e52
[6/6] arm64: dts: mediatek: add display support for mt8365-evk
commit: b7b5052f6b13061db179cf2f0f16c3334e27239c
Cheers,
Angelo
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 0/6] Add display support for the MT8365-EVK board
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
` (6 preceding siblings ...)
2025-02-06 11:08 ` (subset) [PATCH v7 0/6] Add display support for the MT8365-EVK board AngeloGioacchino Del Regno
@ 2025-02-07 13:37 ` Alexandre Mergnat
7 siblings, 0 replies; 19+ messages in thread
From: Alexandre Mergnat @ 2025-02-07 13:37 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter
Cc: dri-devel, linux-mediatek, devicetree, linux-kernel,
linux-arm-kernel
Gentle ping for patch 1,2,3 and 4.
On 10/01/2025 14:31, amergnat@baylibre.com wrote:
> The purpose of this series is to add the display support for the mt8365-evk.
>
> This is the list of HWs / IPs support added:
> - Connectors (HW):
> - HDMI
> - MIPI DSI (Mobile Industry Processor Interface Display Serial Interface)
> - HDMI bridge (it66121)
> - DSI pannel (startek,kd070fhfid015)
> - SoC display blocks (IP):
> - OVL0 (Overlay)
> - RDMA0 (Data Path Read DMA)
> - Color0
> - CCorr0 (Color Correction)
> - AAL0 (Adaptive Ambient Light)
> - GAMMA0
> - Dither0
> - DSI0 (Display Serial Interface)
> - RDMA1 (Data Path Read DMA)
> - DPI0 (Display Parallel Interface)
>
> The Mediatek DSI, DPI and DRM drivers are also improved.
>
> The series is rebased on top of Angelo's series [1] to
> use the OF graphs support.
>
> Regards,
> Alex
>
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
> Changes in v7:
> - Improve defconfig commit description
> - Add comment in the DTS about pins clash with ethernet and HDMI (DPI0)
> - Link to v6: https://lore.kernel.org/r/20231023-display-support-v6-0-c6af4f34f4d8@baylibre.com
>
> Changes in v6:
> - Fix DPI binding: remove the duplicated property (power-domains).
> - Squash defconfig commit.
> - Fix the property order in the DTS.
> - Link to v5: https://lore.kernel.org/r/20231023-display-support-v5-0-3905f1e4b835@baylibre.com
>
> Changes in v5:
> - Patch merged, then removed from the series:
> - dt-bindings: display: mediatek: rdma: add compatible for MT8365 SoC
> - dt-bindings: display: mediatek: ovl: add compatible for MT8365 SoC
> - dt-bindings: display: mediatek: gamma: add compatible for MT8365 SoC
> - dt-bindings: display: mediatek: dpi: add compatible for MT8365
> - dt-bindings: display: mediatek: dsi: add compatible for MT8365 SoC
> - dt-bindings: display: mediatek: dither: add compatible for MT8365 SoC
> - dt-bindings: display: mediatek: color: add compatible for MT8365 SoC
> - dt-bindings: display: mediatek: ccorr: add compatible for MT8365 SoC
> - dt-bindings: display: mediatek: aal: add compatible for MT8365 SoC
> - Enable STARTEK KD070FHFID015 panel in the defconfig.
> - Rebase on top of 6.13-rc6.
> - Link to v4: https://lore.kernel.org/all/20231023-display-support-v4-0-ed82eb168fb1@baylibre.com
>
> Changes in v4:
> - Patch merged, then removed from the series:
> - dt-bindings: display: mediatek: dpi: add power-domains property
> - dt-bindings: pwm: mediatek,pwm-disp: add compatible for mt8365 SoC
> - clk: mediatek: mt8365-mm: fix DPI0 parent
> - Remove mediatek,mt8365-dpi compatible from mtk_drm_drv.c because it
> use the mt8192's data. It's a miss.
> - Add MT8365 OF graphs support, remove the hardcoded display path and
> rebase on top of Angelo's series [1].
> - Link to v3: https://lore.kernel.org/r/20231023-display-support-v3-0-53388f3ed34b@baylibre.com
>
> Changes in v3:
> - Drop "drm/mediatek: add mt8365 dpi support" because it's the same
> config as mt8192 SoC
> - Drop "dt-bindings: pwm: mediatek,pwm-disp: add power-domains property"
> because an equivalent patch has been merge already.
> - Add DPI clock fix in a separate commit.
> - Improve DTS(I) readability.
> - Link to v2: https://lore.kernel.org/r/20231023-display-support-v2-0-33ce8864b227@baylibre.com
>
> Changes in v2:
> - s/binding/compatible/ in commit messages/titles.
> - Improve commit messages as Conor suggest.
> - pwm-disp: Set power domain property for MT8365. This one is optionnal
> and can be used for other SoC.
> - Fix mediatek,dsi.yaml issue.
> - Remove the extra clock in the DPI node/driver and fix the dpi clock
> parenting to be consistent with the DPI clock assignement.
> - Link to v1: https://lore.kernel.org/r/20231023-display-support-v1-0-5c860ed5c33b@baylibre.com
>
> [1] https://lore.kernel.org/lkml/20240516081104.83458-1-angelogioacchino.delregno@collabora.com/
>
> ---
> Alexandre Mergnat (4):
> drm/mediatek: dsi: Improves the DSI lane setup robustness
> arm64: defconfig: enable display support for mt8365-evk
> arm64: dts: mediatek: add display blocks support for the MT8365 SoC
> arm64: dts: mediatek: add display support for mt8365-evk
>
> Fabien Parent (2):
> dt-bindings: display: mediatek: dpi: add power-domains example
> drm/mediatek: add MT8365 SoC support
>
> .../bindings/display/mediatek/mediatek,dpi.yaml | 2 +
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 245 ++++++++++++++-
> arch/arm64/boot/dts/mediatek/mt8365.dtsi | 336 +++++++++++++++++++++
> arch/arm64/configs/defconfig | 2 +
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 8 +
> drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +
> 6 files changed, 594 insertions(+), 1 deletion(-)
> ---
> base-commit: 9d89551994a430b50c4fffcb1e617a057fa76e20
> change-id: 20231023-display-support-c6418b30e419
>
> Best regards,
--
Regards,
Alexandre
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 3/6] drm/mediatek: add MT8365 SoC support
2025-01-10 13:31 ` [PATCH v7 3/6] drm/mediatek: add MT8365 SoC support amergnat
@ 2025-02-17 7:36 ` CK Hu (胡俊光)
2025-03-03 13:15 ` Chun-Kuang Hu
1 sibling, 0 replies; 19+ messages in thread
From: CK Hu (胡俊光) @ 2025-02-17 7:36 UTC (permalink / raw)
To: robh@kernel.org, Alexandre Mergnat, tzimmermann@suse.de,
simona@ffwll.ch, Jitao Shi (石记涛),
AngeloGioacchino Del Regno, mripard@kernel.org,
maarten.lankhorst@linux.intel.com, catalin.marinas@arm.com,
simona.vetter@ffwll.ch, chunkuang.hu@kernel.org,
krzk+dt@kernel.org, will@kernel.org, p.zabel@pengutronix.de,
conor+dt@kernel.org, airlied@gmail.com, matthias.bgg@gmail.com
Cc: dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org, fparent@baylibre.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
On Fri, 2025-01-10 at 14:31 +0100, amergnat@baylibre.com wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> From: Fabien Parent <fparent@baylibre.com>
>
> Add DRM support for MT8365 SoC.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Signed-off-by: Fabien Parent <fparent@baylibre.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index 0829ceb9967c..5471ef744cc1 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -328,6 +328,10 @@ static const struct mtk_mmsys_driver_data mt8195_vdosys1_driver_data = {
> .min_height = 1,
> };
>
> +static const struct mtk_mmsys_driver_data mt8365_mmsys_driver_data = {
> + .mmsys_dev_num = 1,
> +};
> +
> static const struct of_device_id mtk_drm_of_ids[] = {
> { .compatible = "mediatek,mt2701-mmsys",
> .data = &mt2701_mmsys_driver_data},
> @@ -355,6 +359,8 @@ static const struct of_device_id mtk_drm_of_ids[] = {
> .data = &mt8195_vdosys0_driver_data},
> { .compatible = "mediatek,mt8195-vdosys1",
> .data = &mt8195_vdosys1_driver_data},
> + { .compatible = "mediatek,mt8365-mmsys",
> + .data = &mt8365_mmsys_driver_data},
> { }
> };
> MODULE_DEVICE_TABLE(of, mtk_drm_of_ids);
> @@ -751,6 +757,8 @@ static const struct of_device_id mtk_ddp_comp_dt_ids[] = {
> .data = (void *)MTK_DISP_MUTEX },
> { .compatible = "mediatek,mt8195-disp-mutex",
> .data = (void *)MTK_DISP_MUTEX },
> + { .compatible = "mediatek,mt8365-disp-mutex",
> + .data = (void *)MTK_DISP_MUTEX },
> { .compatible = "mediatek,mt8173-disp-od",
> .data = (void *)MTK_DISP_OD },
> { .compatible = "mediatek,mt2701-disp-ovl",
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness
2025-01-10 13:31 ` [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness Alexandre Mergnat
@ 2025-02-17 7:56 ` CK Hu (胡俊光)
2025-02-17 15:03 ` Alexandre Mergnat
0 siblings, 1 reply; 19+ messages in thread
From: CK Hu (胡俊光) @ 2025-02-17 7:56 UTC (permalink / raw)
To: robh@kernel.org, Alexandre Mergnat, tzimmermann@suse.de,
simona@ffwll.ch, Jitao Shi (石记涛),
AngeloGioacchino Del Regno, mripard@kernel.org,
maarten.lankhorst@linux.intel.com, catalin.marinas@arm.com,
simona.vetter@ffwll.ch, chunkuang.hu@kernel.org,
krzk+dt@kernel.org, will@kernel.org, p.zabel@pengutronix.de,
conor+dt@kernel.org, airlied@gmail.com, matthias.bgg@gmail.com
Cc: dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
On Fri, 2025-01-10 at 14:31 +0100, Alexandre Mergnat wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> Currently, mtk_dsi_lane_ready (which setup the DSI lane) is triggered
> before mtk_dsi_poweron. lanes_ready flag toggle to true during
> mtk_dsi_lane_ready function, and the DSI module is set up during
> mtk_dsi_poweron.
>
> Later, during panel driver init, mtk_dsi_lane_ready is triggered but does
> nothing because lanes are considered ready. Unfortunately, when the panel
> driver try to communicate, the DSI returns a timeout.
>
> The solution found here is to put lanes_ready flag to false after the DSI
> module setup into mtk_dsi_poweron to init the DSI lanes after the power /
> setup of the DSI module.
I'm not clear about what happen.
I think this DSI flow has worked for a long time.
So only some panel has problem?
And another question.
Do you mean mtk_dsi_lane_ready() do some setting to hardware, but lane is not actually ready?
Or mtk_dsi_lane_ready() configure the hardware and lane is is actually ready,
but something make it not ready again, what's the thing which break lane ready?
If this is a bug fix, add Fixes tag.
Regards,
CK
>
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
> drivers/gpu/drm/mediatek/mtk_dsi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index e61b9bc68e9a..dcf0d93881b5 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -724,6 +724,8 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
> mtk_dsi_config_vdo_timing(dsi);
> mtk_dsi_set_interrupt_enable(dsi);
>
> + dsi->lanes_ready = false;
> +
> return 0;
> err_disable_engine_clk:
> clk_disable_unprepare(dsi->engine_clk);
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness
2025-02-17 7:56 ` CK Hu (胡俊光)
@ 2025-02-17 15:03 ` Alexandre Mergnat
2025-02-18 8:52 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 19+ messages in thread
From: Alexandre Mergnat @ 2025-02-17 15:03 UTC (permalink / raw)
To: CK Hu (胡俊光)
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
AngeloGioacchino Del Regno, krzk+dt@kernel.org,
chunkuang.hu@kernel.org, simona.vetter@ffwll.ch,
catalin.marinas@arm.com, airlied@gmail.com, conor+dt@kernel.org,
p.zabel@pengutronix.de, will@kernel.org, matthias.bgg@gmail.com,
dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, tzimmermann@suse.de,
simona@ffwll.ch, linux-arm-kernel@lists.infradead.org,
Jitao Shi (石记涛), robh@kernel.org
Hi CK.
On 17/02/2025 08:56, CK Hu (胡俊光) wrote:
> On Fri, 2025-01-10 at 14:31 +0100, Alexandre Mergnat wrote:
>> External email : Please do not click links or open attachments until you have verified the sender or the content.
>>
>>
>> Currently, mtk_dsi_lane_ready (which setup the DSI lane) is triggered
>> before mtk_dsi_poweron. lanes_ready flag toggle to true during
>> mtk_dsi_lane_ready function, and the DSI module is set up during
>> mtk_dsi_poweron.
>>
>> Later, during panel driver init, mtk_dsi_lane_ready is triggered but does
>> nothing because lanes are considered ready. Unfortunately, when the panel
>> driver try to communicate, the DSI returns a timeout.
>>
>> The solution found here is to put lanes_ready flag to false after the DSI
>> module setup into mtk_dsi_poweron to init the DSI lanes after the power /
>> setup of the DSI module.
>
> I'm not clear about what happen.
> I think this DSI flow has worked for a long time.
> So only some panel has problem?
I don't know if it's related to a specific panel or not.
>
> And another question.
> Do you mean mtk_dsi_lane_ready() do some setting to hardware, but lane is not actually ready?
The workflow should be:
... | dsi->lanes_ready = false | Power-on | setup dsi lanes | dsi->lanes_ready = true (to avoid
re-do dsi lanes setup) | ...
I observe (print function name called + dsi->lanes_ready value):
[ 9.086030] mtk_dsi_probe 0
[ 9.662319] mtk_dsi_host_attach 0
[ 9.662941] mtk_dsi_encoder_init
[ 9.984685] mtk_dsi_poweron 0
[ 10.043755] mtk_dsi_host_transfer 0
[ 10.043769] mtk_dsi_lane_ready 0
[ 10.055837] mtk_dsi_host_transfer 1
[ 10.055853] mtk_dsi_lane_ready 1
[ 10.179788] mtk_dsi_host_transfer 1
[ 10.179803] mtk_dsi_lane_ready 1
[ 10.179880] mtk_dsi_host_transfer 1
[ 10.179885] mtk_dsi_lane_ready 1
[ 10.179920] mtk_dsi_host_transfer 1
[ 10.179923] mtk_dsi_lane_ready 1
[ 10.179986] mtk_dsi_host_transfer 1
[ 10.179993] mtk_dsi_lane_ready 1
[ 10.180134] mtk_dsi_host_transfer 1
[ 10.180143] mtk_dsi_lane_ready 1
[ 10.180175] mtk_dsi_host_transfer 1
[ 10.180178] mtk_dsi_lane_ready 1
[ 10.180223] mtk_dsi_host_transfer 1
[ 10.180226] mtk_dsi_lane_ready 1
[ 10.180245] mtk_dsi_host_transfer 1
[ 10.180248] mtk_dsi_lane_ready 1
[ 10.180278] mtk_dsi_host_transfer 1
[ 10.180280] mtk_dsi_lane_ready 1
[ 10.180312] mtk_dsi_host_transfer 1
[ 10.180314] mtk_dsi_lane_ready 1
[ 10.203774] mtk_dsi_bridge_atomic_pre_enable
[ 10.203787] mtk_dsi_poweron 1
[ 10.203793] mtk_output_dsi_enable
[ 10.203795] mtk_dsi_lane_ready 1
[ 10.471517] mtk_dsi_host_transfer 1
[ 10.486962] mtk_dsi_lane_ready 1
[ 10.487244] mtk_dsi_host_transfer 1
[ 10.503733] mtk_dsi_lane_ready 1
Here the mtk_dsi_lane_ready function:
static void mtk_dsi_lane_ready(struct mtk_dsi *dsi)
{
if (!dsi->lanes_ready) {
dsi->lanes_ready = true;
mtk_dsi_rxtx_control(dsi);
usleep_range(30, 100);
mtk_dsi_reset_dphy(dsi);
mtk_dsi_clk_ulp_mode_leave(dsi);
mtk_dsi_lane0_ulp_mode_leave(dsi);
mtk_dsi_clk_hs_mode(dsi, 0);
usleep_range(1000, 3000);
/* The reaction time after pulling up the mipi signal for dsi_rx */
}
}
As you can see, something call "mtk_dsi_bridge_atomic_pre_enable" then mtk_dsi_poweron is called a
second time. This issue is probably due to the probe order (race condition).
After all, IMHO, after a poweron, the registers status should be consider as unknown (or at least HW
default value), so, lanes setup has to be done. This solution improve the driver's robustness.
> Or mtk_dsi_lane_ready() configure the hardware and lane is is actually ready,
> but something make it not ready again, what's the thing which break lane ready?
>
> If this is a bug fix, add Fixes tag.
>
> Regards,
> CK
>
>>
>> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
>> ---
>> drivers/gpu/drm/mediatek/mtk_dsi.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
>> index e61b9bc68e9a..dcf0d93881b5 100644
>> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
>> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
>> @@ -724,6 +724,8 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
>> mtk_dsi_config_vdo_timing(dsi);
>> mtk_dsi_set_interrupt_enable(dsi);
>>
>> + dsi->lanes_ready = false;
>> +
>> return 0;
>> err_disable_engine_clk:
>> clk_disable_unprepare(dsi->engine_clk);
>>
>> --
>> 2.25.1
>>
>
>
> ************* MEDIATEK Confidentiality Notice
> ********************
> The information contained in this e-mail message (including any
> attachments) may be confidential, proprietary, privileged, or otherwise
> exempt from disclosure under applicable laws. It is intended to be
> conveyed only to the designated recipient(s). Any use, dissemination,
> distribution, printing, retaining or copying of this e-mail (including its
> attachments) by unintended recipient(s) is strictly prohibited and may
> be unlawful. If you are not an intended recipient of this e-mail, or believe
>
> that you have received this e-mail in error, please notify the sender
> immediately (by replying to this e-mail), delete any and all copies of
> this e-mail (including any attachments) from your system, and do not
> disclose the content of this e-mail to any other person. Thank you!
>
--
Regards,
Alexandre
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness
2025-02-17 15:03 ` Alexandre Mergnat
@ 2025-02-18 8:52 ` AngeloGioacchino Del Regno
2025-02-26 11:35 ` Alexandre Mergnat
0 siblings, 1 reply; 19+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-18 8:52 UTC (permalink / raw)
To: Alexandre Mergnat, CK Hu (胡俊光)
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
krzk+dt@kernel.org, chunkuang.hu@kernel.org,
simona.vetter@ffwll.ch, catalin.marinas@arm.com,
airlied@gmail.com, conor+dt@kernel.org, p.zabel@pengutronix.de,
will@kernel.org, matthias.bgg@gmail.com,
dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, tzimmermann@suse.de,
simona@ffwll.ch, linux-arm-kernel@lists.infradead.org,
Jitao Shi (石记涛), robh@kernel.org
Il 17/02/25 16:03, Alexandre Mergnat ha scritto:
> Hi CK.
>
> On 17/02/2025 08:56, CK Hu (胡俊光) wrote:
>> On Fri, 2025-01-10 at 14:31 +0100, Alexandre Mergnat wrote:
>>> External email : Please do not click links or open attachments until you have
>>> verified the sender or the content.
>>>
>>>
>>> Currently, mtk_dsi_lane_ready (which setup the DSI lane) is triggered
>>> before mtk_dsi_poweron. lanes_ready flag toggle to true during
>>> mtk_dsi_lane_ready function, and the DSI module is set up during
>>> mtk_dsi_poweron.
>>>
>>> Later, during panel driver init, mtk_dsi_lane_ready is triggered but does
>>> nothing because lanes are considered ready. Unfortunately, when the panel
>>> driver try to communicate, the DSI returns a timeout.
>>>
>>> The solution found here is to put lanes_ready flag to false after the DSI
>>> module setup into mtk_dsi_poweron to init the DSI lanes after the power /
>>> setup of the DSI module.
>>
>> I'm not clear about what happen.
>> I think this DSI flow has worked for a long time.
>> So only some panel has problem?
>
> I don't know if it's related to a specific panel or not.
>
>>
>> And another question.
>> Do you mean mtk_dsi_lane_ready() do some setting to hardware, but lane is not
>> actually ready?
>
> The workflow should be:
> ... | dsi->lanes_ready = false | Power-on | setup dsi lanes | dsi->lanes_ready =
> true (to avoid re-do dsi lanes setup) | ...
>
> I observe (print function name called + dsi->lanes_ready value):
Alex, the first poweron is called by mtk_dsi_ddp_start() - and the start callback
is internal to the mediatek-drm driver.
That callback is called by mtk_crtc during setup and during bridge enable(), and
there we go with suboptimal code design backfiring - instead of using what the
DRM APIs provide, this driver uses something custom *and* the DRM APIs, giving
this issue.
Part of what mtk_crtc does is duplicated with what the DRM APIs want to do, so
there you go, that's your problem here :-)
Should I go on with describing the next step(s), or is that obvious for everyone?
:-)
Cheers,
Angelo
>
> [ 9.086030] mtk_dsi_probe 0
> [ 9.662319] mtk_dsi_host_attach 0
> [ 9.662941] mtk_dsi_encoder_init
> [ 9.984685] mtk_dsi_poweron 0
> [ 10.043755] mtk_dsi_host_transfer 0
> [ 10.043769] mtk_dsi_lane_ready 0
> [ 10.055837] mtk_dsi_host_transfer 1
> [ 10.055853] mtk_dsi_lane_ready 1
> [ 10.179788] mtk_dsi_host_transfer 1
> [ 10.179803] mtk_dsi_lane_ready 1
> [ 10.179880] mtk_dsi_host_transfer 1
> [ 10.179885] mtk_dsi_lane_ready 1
> [ 10.179920] mtk_dsi_host_transfer 1
> [ 10.179923] mtk_dsi_lane_ready 1
> [ 10.179986] mtk_dsi_host_transfer 1
> [ 10.179993] mtk_dsi_lane_ready 1
> [ 10.180134] mtk_dsi_host_transfer 1
> [ 10.180143] mtk_dsi_lane_ready 1
> [ 10.180175] mtk_dsi_host_transfer 1
> [ 10.180178] mtk_dsi_lane_ready 1
> [ 10.180223] mtk_dsi_host_transfer 1
> [ 10.180226] mtk_dsi_lane_ready 1
> [ 10.180245] mtk_dsi_host_transfer 1
> [ 10.180248] mtk_dsi_lane_ready 1
> [ 10.180278] mtk_dsi_host_transfer 1
> [ 10.180280] mtk_dsi_lane_ready 1
> [ 10.180312] mtk_dsi_host_transfer 1
> [ 10.180314] mtk_dsi_lane_ready 1
> [ 10.203774] mtk_dsi_bridge_atomic_pre_enable
> [ 10.203787] mtk_dsi_poweron 1
> [ 10.203793] mtk_output_dsi_enable
> [ 10.203795] mtk_dsi_lane_ready 1
> [ 10.471517] mtk_dsi_host_transfer 1
> [ 10.486962] mtk_dsi_lane_ready 1
> [ 10.487244] mtk_dsi_host_transfer 1
> [ 10.503733] mtk_dsi_lane_ready 1
>
> Here the mtk_dsi_lane_ready function:
>
> static void mtk_dsi_lane_ready(struct mtk_dsi *dsi)
> {
> if (!dsi->lanes_ready) {
> dsi->lanes_ready = true;
> mtk_dsi_rxtx_control(dsi);
> usleep_range(30, 100);
> mtk_dsi_reset_dphy(dsi);
> mtk_dsi_clk_ulp_mode_leave(dsi);
> mtk_dsi_lane0_ulp_mode_leave(dsi);
> mtk_dsi_clk_hs_mode(dsi, 0);
> usleep_range(1000, 3000);
> /* The reaction time after pulling up the mipi signal for dsi_rx */
> }
> }
>
>
> As you can see, something call "mtk_dsi_bridge_atomic_pre_enable" then
> mtk_dsi_poweron is called a second time. This issue is probably due to the probe
> order (race condition).
> After all, IMHO, after a poweron, the registers status should be consider as
> unknown (or at least HW default value), so, lanes setup has to be done. This
> solution improve the driver's robustness.
>
>
>> Or mtk_dsi_lane_ready() configure the hardware and lane is is actually ready,
>> but something make it not ready again, what's the thing which break lane ready?
>>
>> If this is a bug fix, add Fixes tag.
>>
>> Regards,
>> CK
>>
>>>
>>> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
>>> ---
>>> drivers/gpu/drm/mediatek/mtk_dsi.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/
>>> mtk_dsi.c
>>> index e61b9bc68e9a..dcf0d93881b5 100644
>>> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
>>> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
>>> @@ -724,6 +724,8 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
>>> mtk_dsi_config_vdo_timing(dsi);
>>> mtk_dsi_set_interrupt_enable(dsi);
>>>
>>> + dsi->lanes_ready = false;
>>> +
>>> return 0;
>>> err_disable_engine_clk:
>>> clk_disable_unprepare(dsi->engine_clk);
>>>
>>> --
>>> 2.25.1
>>>
>>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness
2025-02-18 8:52 ` AngeloGioacchino Del Regno
@ 2025-02-26 11:35 ` Alexandre Mergnat
2025-02-26 11:45 ` AngeloGioacchino Del Regno
0 siblings, 1 reply; 19+ messages in thread
From: Alexandre Mergnat @ 2025-02-26 11:35 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, CK Hu (胡俊光)
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
krzk+dt@kernel.org, chunkuang.hu@kernel.org,
simona.vetter@ffwll.ch, catalin.marinas@arm.com,
airlied@gmail.com, conor+dt@kernel.org, p.zabel@pengutronix.de,
will@kernel.org, matthias.bgg@gmail.com,
dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, tzimmermann@suse.de,
simona@ffwll.ch, linux-arm-kernel@lists.infradead.org,
Jitao Shi (石记涛), robh@kernel.org
On 18/02/2025 09:52, AngeloGioacchino Del Regno wrote:
> Il 17/02/25 16:03, Alexandre Mergnat ha scritto:
>> Hi CK.
>>
>> On 17/02/2025 08:56, CK Hu (胡俊光) wrote:
>>> On Fri, 2025-01-10 at 14:31 +0100, Alexandre Mergnat wrote:
>>>> External email : Please do not click links or open attachments until you have verified the
>>>> sender or the content.
>>>>
>>>>
>>>> Currently, mtk_dsi_lane_ready (which setup the DSI lane) is triggered
>>>> before mtk_dsi_poweron. lanes_ready flag toggle to true during
>>>> mtk_dsi_lane_ready function, and the DSI module is set up during
>>>> mtk_dsi_poweron.
>>>>
>>>> Later, during panel driver init, mtk_dsi_lane_ready is triggered but does
>>>> nothing because lanes are considered ready. Unfortunately, when the panel
>>>> driver try to communicate, the DSI returns a timeout.
>>>>
>>>> The solution found here is to put lanes_ready flag to false after the DSI
>>>> module setup into mtk_dsi_poweron to init the DSI lanes after the power /
>>>> setup of the DSI module.
>>>
>>> I'm not clear about what happen.
>>> I think this DSI flow has worked for a long time.
>>> So only some panel has problem?
>>
>> I don't know if it's related to a specific panel or not.
>>
>>>
>>> And another question.
>>> Do you mean mtk_dsi_lane_ready() do some setting to hardware, but lane is not actually ready?
>>
>> The workflow should be:
>> ... | dsi->lanes_ready = false | Power-on | setup dsi lanes | dsi->lanes_ready = true (to avoid
>> re-do dsi lanes setup) | ...
>>
>> I observe (print function name called + dsi->lanes_ready value):
>
> Alex, the first poweron is called by mtk_dsi_ddp_start() - and the start callback
> is internal to the mediatek-drm driver.
>
> That callback is called by mtk_crtc during setup and during bridge enable(), and
> there we go with suboptimal code design backfiring - instead of using what the
> DRM APIs provide, this driver uses something custom *and* the DRM APIs, giving
> this issue.
>
> Part of what mtk_crtc does is duplicated with what the DRM APIs want to do, so
> there you go, that's your problem here :-)
>
> Should I go on with describing the next step(s), or is that obvious for everyone?
>
> :-)
>
> Cheers,
Ok thanks Angelo.
Can you let me know if you agree with this change please ? This should be better:
@@ -843,25 +843,6 @@ static void mtk_dsi_bridge_atomic_enable(struct drm_bridge *bridge,
mtk_output_dsi_enable(dsi);
}
-static void mtk_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge,
- struct drm_bridge_state *old_bridge_state)
-{
- struct mtk_dsi *dsi = bridge_to_dsi(bridge);
- int ret;
-
- ret = mtk_dsi_poweron(dsi);
- if (ret < 0)
- DRM_ERROR("failed to power on dsi\n");
-}
-
-static void mtk_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge,
- struct drm_bridge_state *old_bridge_state)
-{
- struct mtk_dsi *dsi = bridge_to_dsi(bridge);
-
- mtk_dsi_poweroff(dsi);
-}
-
static enum drm_mode_status
mtk_dsi_bridge_mode_valid(struct drm_bridge *bridge,
const struct drm_display_info *info,
@@ -886,8 +867,6 @@ static const struct drm_bridge_funcs mtk_dsi_bridge_funcs = {
.atomic_disable = mtk_dsi_bridge_atomic_disable,
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_enable = mtk_dsi_bridge_atomic_enable,
- .atomic_pre_enable = mtk_dsi_bridge_atomic_pre_enable,
- .atomic_post_disable = mtk_dsi_bridge_atomic_post_disable,
.atomic_reset = drm_atomic_helper_bridge_reset,
.mode_valid = mtk_dsi_bridge_mode_valid,
.mode_set = mtk_dsi_bridge_mode_set,
--
Regards,
Alexandre
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness
2025-02-26 11:35 ` Alexandre Mergnat
@ 2025-02-26 11:45 ` AngeloGioacchino Del Regno
2025-02-26 13:16 ` Alexandre Mergnat
0 siblings, 1 reply; 19+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-26 11:45 UTC (permalink / raw)
To: Alexandre Mergnat, CK Hu (胡俊光)
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
krzk+dt@kernel.org, chunkuang.hu@kernel.org,
simona.vetter@ffwll.ch, catalin.marinas@arm.com,
airlied@gmail.com, conor+dt@kernel.org, p.zabel@pengutronix.de,
will@kernel.org, matthias.bgg@gmail.com,
dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, tzimmermann@suse.de,
simona@ffwll.ch, linux-arm-kernel@lists.infradead.org,
Jitao Shi (石记涛), robh@kernel.org
Il 26/02/25 12:35, Alexandre Mergnat ha scritto:
>
>
> On 18/02/2025 09:52, AngeloGioacchino Del Regno wrote:
>> Il 17/02/25 16:03, Alexandre Mergnat ha scritto:
>>> Hi CK.
>>>
>>> On 17/02/2025 08:56, CK Hu (胡俊光) wrote:
>>>> On Fri, 2025-01-10 at 14:31 +0100, Alexandre Mergnat wrote:
>>>>> External email : Please do not click links or open attachments until you have
>>>>> verified the sender or the content.
>>>>>
>>>>>
>>>>> Currently, mtk_dsi_lane_ready (which setup the DSI lane) is triggered
>>>>> before mtk_dsi_poweron. lanes_ready flag toggle to true during
>>>>> mtk_dsi_lane_ready function, and the DSI module is set up during
>>>>> mtk_dsi_poweron.
>>>>>
>>>>> Later, during panel driver init, mtk_dsi_lane_ready is triggered but does
>>>>> nothing because lanes are considered ready. Unfortunately, when the panel
>>>>> driver try to communicate, the DSI returns a timeout.
>>>>>
>>>>> The solution found here is to put lanes_ready flag to false after the DSI
>>>>> module setup into mtk_dsi_poweron to init the DSI lanes after the power /
>>>>> setup of the DSI module.
>>>>
>>>> I'm not clear about what happen.
>>>> I think this DSI flow has worked for a long time.
>>>> So only some panel has problem?
>>>
>>> I don't know if it's related to a specific panel or not.
>>>
>>>>
>>>> And another question.
>>>> Do you mean mtk_dsi_lane_ready() do some setting to hardware, but lane is not
>>>> actually ready?
>>>
>>> The workflow should be:
>>> ... | dsi->lanes_ready = false | Power-on | setup dsi lanes | dsi->lanes_ready =
>>> true (to avoid re-do dsi lanes setup) | ...
>>>
>>> I observe (print function name called + dsi->lanes_ready value):
>>
>> Alex, the first poweron is called by mtk_dsi_ddp_start() - and the start callback
>> is internal to the mediatek-drm driver.
>>
>> That callback is called by mtk_crtc during setup and during bridge enable(), and
>> there we go with suboptimal code design backfiring - instead of using what the
>> DRM APIs provide, this driver uses something custom *and* the DRM APIs, giving
>> this issue.
>>
>> Part of what mtk_crtc does is duplicated with what the DRM APIs want to do, so
>> there you go, that's your problem here :-)
>>
>> Should I go on with describing the next step(s), or is that obvious for everyone?
>>
>> :-)
>>
>> Cheers,
>
> Ok thanks Angelo.
> Can you let me know if you agree with this change please ? This should be better:
>
No, no, I'm saying that we should do the exact opposite of what you're doing here!
We should drop the MediaTek custom stuff that duplicates the DRM APIs behavior(s),
and conform to what the DRM APIs provide and want us to do.
To be really really clear - I'm saying to delete and avoid using:
- mtk_dsi_ddp_start()
- mtk_dsi_ddp_stop()
The spirit here should be to use kernel provided APIs, and to make custom stuff
to disappear as much as possible (again, that mtk_crtc .start/.stop).
I'm not saying that literally all of the start/stop callbacks for all of the
MTK DRM drivers should disappear *all at once* but... gradually, one by one,
these should get lost (where/if possible).
Just one more mention: that custom handling also backfired on me while writing
the hdmiv2/dpi drivers... and now backfires on dsi, and in the future it will
backfire again on something else. It's there only to give problems in the end,
not to solve them :-)
Cheers,
Angelo
> @@ -843,25 +843,6 @@ static void mtk_dsi_bridge_atomic_enable(struct drm_bridge
> *bridge,
> mtk_output_dsi_enable(dsi);
> }
>
> -static void mtk_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge,
> - struct drm_bridge_state *old_bridge_state)
> -{
> - struct mtk_dsi *dsi = bridge_to_dsi(bridge);
> - int ret;
> -
> - ret = mtk_dsi_poweron(dsi);
> - if (ret < 0)
> - DRM_ERROR("failed to power on dsi\n");
> -}
> -
> -static void mtk_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge,
> - struct drm_bridge_state *old_bridge_state)
> -{
> - struct mtk_dsi *dsi = bridge_to_dsi(bridge);
> -
> - mtk_dsi_poweroff(dsi);
> -}
> -
> static enum drm_mode_status
> mtk_dsi_bridge_mode_valid(struct drm_bridge *bridge,
> const struct drm_display_info *info,
> @@ -886,8 +867,6 @@ static const struct drm_bridge_funcs mtk_dsi_bridge_funcs = {
> .atomic_disable = mtk_dsi_bridge_atomic_disable,
> .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
> .atomic_enable = mtk_dsi_bridge_atomic_enable,
> - .atomic_pre_enable = mtk_dsi_bridge_atomic_pre_enable,
> - .atomic_post_disable = mtk_dsi_bridge_atomic_post_disable,
> .atomic_reset = drm_atomic_helper_bridge_reset,
> .mode_valid = mtk_dsi_bridge_mode_valid,
> .mode_set = mtk_dsi_bridge_mode_set,
>
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness
2025-02-26 11:45 ` AngeloGioacchino Del Regno
@ 2025-02-26 13:16 ` Alexandre Mergnat
0 siblings, 0 replies; 19+ messages in thread
From: Alexandre Mergnat @ 2025-02-26 13:16 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, CK Hu (胡俊光)
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
krzk+dt@kernel.org, chunkuang.hu@kernel.org,
simona.vetter@ffwll.ch, catalin.marinas@arm.com,
airlied@gmail.com, conor+dt@kernel.org, p.zabel@pengutronix.de,
will@kernel.org, matthias.bgg@gmail.com,
dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, tzimmermann@suse.de,
simona@ffwll.ch, linux-arm-kernel@lists.infradead.org,
Jitao Shi (石记涛), robh@kernel.org
On 26/02/2025 12:45, AngeloGioacchino Del Regno wrote:
> Il 26/02/25 12:35, Alexandre Mergnat ha scritto:
>>
>>
>> On 18/02/2025 09:52, AngeloGioacchino Del Regno wrote:
>>> Il 17/02/25 16:03, Alexandre Mergnat ha scritto:
>>>> Hi CK.
>>>>
>>>> On 17/02/2025 08:56, CK Hu (胡俊光) wrote:
>>>>> On Fri, 2025-01-10 at 14:31 +0100, Alexandre Mergnat wrote:
>>>>>> External email : Please do not click links or open attachments until you have verified the
>>>>>> sender or the content.
>>>>>>
>>>>>>
>>>>>> Currently, mtk_dsi_lane_ready (which setup the DSI lane) is triggered
>>>>>> before mtk_dsi_poweron. lanes_ready flag toggle to true during
>>>>>> mtk_dsi_lane_ready function, and the DSI module is set up during
>>>>>> mtk_dsi_poweron.
>>>>>>
>>>>>> Later, during panel driver init, mtk_dsi_lane_ready is triggered but does
>>>>>> nothing because lanes are considered ready. Unfortunately, when the panel
>>>>>> driver try to communicate, the DSI returns a timeout.
>>>>>>
>>>>>> The solution found here is to put lanes_ready flag to false after the DSI
>>>>>> module setup into mtk_dsi_poweron to init the DSI lanes after the power /
>>>>>> setup of the DSI module.
>>>>>
>>>>> I'm not clear about what happen.
>>>>> I think this DSI flow has worked for a long time.
>>>>> So only some panel has problem?
>>>>
>>>> I don't know if it's related to a specific panel or not.
>>>>
>>>>>
>>>>> And another question.
>>>>> Do you mean mtk_dsi_lane_ready() do some setting to hardware, but lane is not actually ready?
>>>>
>>>> The workflow should be:
>>>> ... | dsi->lanes_ready = false | Power-on | setup dsi lanes | dsi->lanes_ready = true (to avoid
>>>> re-do dsi lanes setup) | ...
>>>>
>>>> I observe (print function name called + dsi->lanes_ready value):
>>>
>>> Alex, the first poweron is called by mtk_dsi_ddp_start() - and the start callback
>>> is internal to the mediatek-drm driver.
>>>
>>> That callback is called by mtk_crtc during setup and during bridge enable(), and
>>> there we go with suboptimal code design backfiring - instead of using what the
>>> DRM APIs provide, this driver uses something custom *and* the DRM APIs, giving
>>> this issue.
>>>
>>> Part of what mtk_crtc does is duplicated with what the DRM APIs want to do, so
>>> there you go, that's your problem here :-)
>>>
>>> Should I go on with describing the next step(s), or is that obvious for everyone?
>>>
>>> :-)
>>>
>>> Cheers,
>>
>> Ok thanks Angelo.
>> Can you let me know if you agree with this change please ? This should be better:
>>
>
> No, no, I'm saying that we should do the exact opposite of what you're doing here!
>
> We should drop the MediaTek custom stuff that duplicates the DRM APIs behavior(s),
> and conform to what the DRM APIs provide and want us to do.
>
> To be really really clear - I'm saying to delete and avoid using:
> - mtk_dsi_ddp_start()
> - mtk_dsi_ddp_stop()
Ok, that what I though first but when I've tried to remove it, the board hung at boot as described
in this old patch:
https://patchwork.kernel.org/project/linux-mediatek/patch/1653012007-11854-3-git-send-email-xinlei.lee@mediatek.com/
Even if I do some little change that (like remove mtk_dsi_start) allow me to boot and make DRM
working for HDMI, DSI still not working at all, I need to do more effort to rework the DSI init.
In my previous suggestion I forgot to say "Since the goal of this serie is to add display support
for genio 350 but not rework/fix DSI driver, is it reasonable to do a soft fix first and then work
on another serie about legacy stuff issue?"
>
> The spirit here should be to use kernel provided APIs, and to make custom stuff
> to disappear as much as possible (again, that mtk_crtc .start/.stop).
>
> I'm not saying that literally all of the start/stop callbacks for all of the
> MTK DRM drivers should disappear *all at once* but... gradually, one by one,
> these should get lost (where/if possible).
>
> Just one more mention: that custom handling also backfired on me while writing
> the hdmiv2/dpi drivers... and now backfires on dsi, and in the future it will
> backfire again on something else. It's there only to give problems in the end,
> not to solve them :-)
Is that issue fixed for DPI ? I'm asking because the following struct still used in mtk_ddp_comp.c:
static const struct mtk_ddp_comp_funcs ddp_dpi = {
.start = mtk_dpi_start,
.stop = mtk_dpi_stop,
.encoder_index = mtk_dpi_encoder_index,
};
But maybe what you fixed for hdmiv2/dpi isn't related to this.
Can you link me the patch where you fix that please ? I think that can help me.
I'm 100% agree with you to remove MediaTek custom stuff that duplicates the DRM APIs behavior. The
genio 350 display support patches has already be stopped and reworked for of graph support, now
stopped by custom framework issue. What do you think about to validate the "DSI hotfix" to merge the
whole series and open a dedicated series to cleanup custom start/stop from MTK DRM framework ? I'm
really asking for your deliberation, not trying to force it when I say I prefer merge this in the
current state :)
--
Regards,
Alexandre
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 3/6] drm/mediatek: add MT8365 SoC support
2025-01-10 13:31 ` [PATCH v7 3/6] drm/mediatek: add MT8365 SoC support amergnat
2025-02-17 7:36 ` CK Hu (胡俊光)
@ 2025-03-03 13:15 ` Chun-Kuang Hu
1 sibling, 0 replies; 19+ messages in thread
From: Chun-Kuang Hu @ 2025-03-03 13:15 UTC (permalink / raw)
To: amergnat
Cc: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter, dri-devel, linux-mediatek, devicetree,
linux-kernel, linux-arm-kernel, Fabien Parent
Hi, Amergnat:
<amergnat@baylibre.com> 於 2025年1月10日 週五 下午9:31寫道:
>
> From: Fabien Parent <fparent@baylibre.com>
>
> Add DRM support for MT8365 SoC.
>
> Signed-off-by: Fabien Parent <fparent@baylibre.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Applied to mediatek-drm-next [1], thanks.
[1] https://web.git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
Regards,
Chun-Kuang.
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index 0829ceb9967c..5471ef744cc1 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -328,6 +328,10 @@ static const struct mtk_mmsys_driver_data mt8195_vdosys1_driver_data = {
> .min_height = 1,
> };
>
> +static const struct mtk_mmsys_driver_data mt8365_mmsys_driver_data = {
> + .mmsys_dev_num = 1,
> +};
> +
> static const struct of_device_id mtk_drm_of_ids[] = {
> { .compatible = "mediatek,mt2701-mmsys",
> .data = &mt2701_mmsys_driver_data},
> @@ -355,6 +359,8 @@ static const struct of_device_id mtk_drm_of_ids[] = {
> .data = &mt8195_vdosys0_driver_data},
> { .compatible = "mediatek,mt8195-vdosys1",
> .data = &mt8195_vdosys1_driver_data},
> + { .compatible = "mediatek,mt8365-mmsys",
> + .data = &mt8365_mmsys_driver_data},
> { }
> };
> MODULE_DEVICE_TABLE(of, mtk_drm_of_ids);
> @@ -751,6 +757,8 @@ static const struct of_device_id mtk_ddp_comp_dt_ids[] = {
> .data = (void *)MTK_DISP_MUTEX },
> { .compatible = "mediatek,mt8195-disp-mutex",
> .data = (void *)MTK_DISP_MUTEX },
> + { .compatible = "mediatek,mt8365-disp-mutex",
> + .data = (void *)MTK_DISP_MUTEX },
> { .compatible = "mediatek,mt8173-disp-od",
> .data = (void *)MTK_DISP_OD },
> { .compatible = "mediatek,mt2701-disp-ovl",
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v7 1/6] dt-bindings: display: mediatek: dpi: add power-domains example
2025-01-10 13:31 ` [PATCH v7 1/6] dt-bindings: display: mediatek: dpi: add power-domains example amergnat
@ 2025-03-03 13:22 ` Chun-Kuang Hu
0 siblings, 0 replies; 19+ messages in thread
From: Chun-Kuang Hu @ 2025-03-03 13:22 UTC (permalink / raw)
To: amergnat
Cc: Chun-Kuang Hu, Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
Jitao Shi, CK Hu, Catalin Marinas, Will Deacon, Simona Vetter,
Simona Vetter, dri-devel, linux-mediatek, devicetree,
linux-kernel, linux-arm-kernel, Fabien Parent
Hi, Amergnat:
<amergnat@baylibre.com> 於 2025年1月10日 週五 下午9:31寫道:
>
> From: Fabien Parent <fparent@baylibre.com>
>
> DPI is part of the display / multimedia block in MediaTek SoCs, and
> always have a power-domain (at least in the upstream device-trees).
> Add the power-domains property to the binding example.
Applied to mediatek-drm-next [1], thanks.
[1] https://web.git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
Regards,
Chun-Kuang.
>
> Fixes: 9273cf7d3942 ("dt-bindings: display: mediatek: convert the dpi bindings to yaml")
> Signed-off-by: Fabien Parent <fparent@baylibre.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Acked-by: Rob Herring (Arm) <robh@kernel.org>
> Reviewed-by: CK Hu <ck.hu@mediatek.com>
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
> Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> index 0f1e556dc8ef..d5ee52ea479b 100644
> --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> @@ -116,11 +116,13 @@ examples:
> - |
> #include <dt-bindings/interrupt-controller/arm-gic.h>
> #include <dt-bindings/clock/mt8173-clk.h>
> + #include <dt-bindings/power/mt8173-power.h>
>
> dpi: dpi@1401d000 {
> compatible = "mediatek,mt8173-dpi";
> reg = <0x1401d000 0x1000>;
> interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>;
> + power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
> clocks = <&mmsys CLK_MM_DPI_PIXEL>,
> <&mmsys CLK_MM_DPI_ENGINE>,
> <&apmixedsys CLK_APMIXED_TVDPLL>;
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2025-03-03 13:22 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-10 13:31 [PATCH v7 0/6] Add display support for the MT8365-EVK board amergnat
2025-01-10 13:31 ` [PATCH v7 1/6] dt-bindings: display: mediatek: dpi: add power-domains example amergnat
2025-03-03 13:22 ` Chun-Kuang Hu
2025-01-10 13:31 ` [PATCH v7 2/6] drm/mediatek: dsi: Improves the DSI lane setup robustness Alexandre Mergnat
2025-02-17 7:56 ` CK Hu (胡俊光)
2025-02-17 15:03 ` Alexandre Mergnat
2025-02-18 8:52 ` AngeloGioacchino Del Regno
2025-02-26 11:35 ` Alexandre Mergnat
2025-02-26 11:45 ` AngeloGioacchino Del Regno
2025-02-26 13:16 ` Alexandre Mergnat
2025-01-10 13:31 ` [PATCH v7 3/6] drm/mediatek: add MT8365 SoC support amergnat
2025-02-17 7:36 ` CK Hu (胡俊光)
2025-03-03 13:15 ` Chun-Kuang Hu
2025-01-10 13:31 ` [PATCH v7 4/6] arm64: defconfig: enable display support for mt8365-evk Alexandre Mergnat
2025-01-10 14:10 ` Krzysztof Kozlowski
2025-01-10 13:31 ` [PATCH v7 5/6] arm64: dts: mediatek: add display blocks support for the MT8365 SoC Alexandre Mergnat
2025-01-10 13:31 ` [PATCH v7 6/6] arm64: dts: mediatek: add display support for mt8365-evk Alexandre Mergnat
2025-02-06 11:08 ` (subset) [PATCH v7 0/6] Add display support for the MT8365-EVK board AngeloGioacchino Del Regno
2025-02-07 13:37 ` Alexandre Mergnat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).