This series adds HDMI support for MT8188 based boards, such as the Genio
510 and Genio 700 EVKs, in order to display a boot logo over HDMI. It
builds on top of the HDMI PHY driver [1], the DDC (I2C) driver [2], the
clock series [3] and a clock fix [4] already sent earlier.

The drivers here, were inspired by the corresponding kernel driver, but
were largely modified, mainly because U-Boot has no DRM framework and
the goal is only to display a framebuffer. The HDMI driver locates each
pipeline component through phandles in the hdmi node and programs them
directly. The framebuffer and splash screen live in dedicated
reserved-memory regions.

The video pipeline looks like this:

        reserved-memory (framebuffer, in DRAM)
                       |
          +------------+------------+
          v                         v
      mdp_rdma4                 mdp_rdma5      two DMA read engines,
     (left half)               (right half)   each fetching one frame half
          |                         |
       padding4                  padding5      (bypass)
          |                         |
          +------------+------------+
                       v
                  vpp merge (merge3)           recombine the two halves
                       |
                       v
                 ethdr mixer (ethdr0)
                       |
                       v
                  hdr back-end
                       |
                       v
                  vpp merge (merge5)
                       |
                       v
                     dpi1                       timing generator -> HDMI TX
                       |
                       v
      ddc/i2c ---> hdmi tx controller
    (read EDID)        |
                       v
                   hdmi phy
                       |
                       v
              hdmi connector ---> sink

  mutex1  : hardware SOF synchronization across the pipeline
  vdosys1 : routing muxes (SEL_IN/SOUT) wiring the blocks above

The series adds the HDMI TX controller (UCLASS_VIDEO), a set of shared
display-component helpers and the individual pipeline components (mixer,
merge, mutex, padding, rdma, vdosys1, dpi1), and the device-tree glue
and config that enable the pipeline.

Tested on  Genio 700 EVK: the U-Boot splash logo shows up on an HDMI display.

[1]: 
https://patchwork.ozlabs.org/project/uboot/patch/20260717-mt8188-add-hdmi-phy-driver-v1-1-4278457fe...@baylibre.com/
[2]: 
https://patchwork.ozlabs.org/project/uboot/cover/20260717-mt8188-add-ddc-i2c-driver-v1-0-e89ccd173...@baylibre.com/
[3]: 
https://patchwork.ozlabs.org/project/uboot/patch/20260715-mt8188-add-clk-add-display-related-clocks-v2-1-0aaf7acca...@baylibre.com/
[4]: 
https://patchwork.ozlabs.org/project/uboot/patch/20260728-mt8188-clk-fix-top0-gate-polarity-v1-1-56bc92ba6...@baylibre.com/

Signed-off-by: Julien Stephan <[email protected]>
---
Changes in v4:
- refresh config fragment with savedefconfig: remove CONFIG_VIDEO_LOGO,
  correctly place CONFIG_WATCHDOG_AUTOSTART
  that is enabled by default
- reword commit message on patch 13: remove useless mentions to larb/vdosys1 
aliases that were removed in v3
- Link to v3: 
https://patch.msgid.link/20260901-add-genio-510-and-genio-700-hdmi-v3-0-38194a531...@baylibre.com

Changes in v3:
Across the whole series
- Re-based every register definition on the mainline Linux kernel definitions 
(upstream names, values and
BIT()/GENMASK()/FIELD_PREP()) instead of the downstream U-Boot ones.
- SPDX fixes: GPL-2.0 / GPL-2.0+ -> GPL-2.0-only on all new driver files, 
Makefile and Kconfig; relicensed
include/linux/hdmi.h to MIT (it's a partial port of Linux' MIT-licensed header) 
and added the full MIT permission text.
- Bind on the generic mediatek,mt8195-* fallback compatible (shared IP) rather 
than the SoC-specific mediatek,mt8188-*:
dpi, ethdr, merge, rdma.
- Makefile/Kconfig header cleanup: copyright set to BayLibre and the obj- list 
sorted alphabetically.

Per patch
- display pipeline component helpers: reworded the commit message (probe and 
enable sequence).
- ethdr: use the kernel's parameterized MIX_L_SRC_CON(n)/MIX_L_SRC_SIZE(n) 
macros, drop the unused *_CK_EN defines, add
BACKGROUND_RELAY to the datapath write; keep the downstream-only L2 select bits 
behind a comment.
- merge: rename registers to the kernel's DISP_REG_MERGE_* / MERGE_EN; keep the 
downstream-only CFG_30 behind a comment.
- mutex: make the register offsets index-based (DISP_MUTEX_*(id)) and rename 
the helper to mtk_disp_mutex_config_hdmi()
so a future DSI user can reuse it.
- padding: rename registers to the kernel's PADDING_CONTROL_REG / 
PADDING_ENABLE / PADDING_PIC_SIZE_REG.
- rdma: use the kernel's FLD_* fields with FIELD_PREP(); take the stride from 
the framebuffer line_length instead of
recomputing it; error out if the framebuffer base is above 4 GB (the 
source-base register is 32-bit), add larb configuration.
- dpi: import mtk_dpi_regs.h verbatim from the mainline kernel and adjust the 
driver to the upstream names (DPI_RET,
DPI_INPUT_2P_EN, DPI_OUTPUT_1T1P_EN); keep the one downstream-only matrix value 
(MATRIX_SEL_RGB_TO_BT709) locally.
- include/linux/hdmi.h: MIT relicense (see above).
- hdmi driver: move the register defines into a new mtk_hdmi_regs_v2.h imported 
verbatim from the mainline kernel;
correct VID_DOWNSAMPLE_CONFIG to 0x8f0 per the MT8390 datasheet (mainline has a 
wrong 0x8d0 — a separate kernel fix was
sent); remove the dead deep-color code path (the driver only ever drives 8 
bpc); drop the unused length argument of the
infoframe helpers; check the RDMA config return value; resolve the vdosys1 
syscon via ofnode_by_compatible() instead of
a U-Boot-invented alias.
- dts (reserved-memory): drop the unused splashscreen carveout, keep only the 
framebuffer region; retitle the patch to
"add framebuffer reserved-memory".
- dts (hdmi override): drop the U-Boot-invented vdosys1 alias (resolved by 
compatible now) and larb2/larb3 aliases
now resolved using iommus and DT directly inside rdma component.
- configs: use CONFIG_VIDEO_LOGO (show the U-Boot logo) instead of 
CONFIG_SPLASH_SCREEN, since upstream lacks the
plumbing to make the splash actually work — this also keeps CONFIG_EXPO enabled 
and drops the now-unneeded CMD_BMP /
BMP_24BPP.
- Link to v2: 
https://patch.msgid.link/20260826-add-genio-510-and-genio-700-hdmi-v2-0-68ebb1bf1...@baylibre.com

Changes in v2:
- Add a common `get_unaligned_le24()` helper for reading 24-bit little-endian 
values, ported from kernel
- Add a common `linux/hdmi.h` header with HDMI colorspace and colorimetry 
enums, based on the corresponding Linux header.
- Refactor the HDMI driver to use the new common HDMI definitions and unaligned 
access helper.
- Rename the mixer component to ETHDR and configure the ETHDR before the 
remaining display pipeline components.
- Add the SMI LARB components and configure the VDOSYS1 routing directly from 
the HDMI driver.
- Switch display component lookup from phandles to DT aliases and add proper 
error unwinding for component clocks, HDMI PHY power, and clock resources.
- Refactor HDMI register access and InfoFrame handling.
- Improve HDMI mode handling, YUV420 downsampling, TMDS scrambling, deep-color 
handling, and InfoFrame generation.
- Move framebuffer/splash reserved-memory definitions to the Genio common 
U-Boot DTSI and add the corresponding HDMI override node for MT8390/Genio EVKs.
- Drop the dedicated MT8188 VDOSYS1 pipeline component and its corresponding 
DTS node, to avoid having 2 nodes with same reg address.
- Remove the unnecessary `dm_scan_fdt_dev` bind hook from the HDMI driver.
- Link to v1: 
https://patch.msgid.link/20260728-add-genio-510-and-genio-700-hdmi-v1-0-ac54bd75f...@baylibre.com

To: [email protected]
Cc: GSS_MTK_Uboot_upstream <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Anatolij Gustschin <[email protected]>
Cc: Ryder Lee <[email protected]>
Cc: Weijie Gao <[email protected]>
Cc: Chunfeng Yun <[email protected]>
Cc: Igor Belwon <[email protected]>
Cc: David Lechner <[email protected]>
Cc: Julien Stephan <[email protected]>
Cc: Dario Binacchi <[email protected]>
Cc: Johan Jonker <[email protected]>
Cc: Patrice Chotard <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Pavlo Yadvychuk <[email protected]>
Cc: Macpaul Lin <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Mattijs Korpershoek <[email protected]>
Cc: Carlo Caione <[email protected]>

---
Julien Stephan (14):
      video: mediatek: add display pipeline component helpers
      video: mediatek: add ethdr component
      video: mediatek: add merge component
      video: mediatek: add mutex component
      video: mediatek: add padding component
      video: mediatek: add rdma component
      video: mediatek: add smi larb driver
      video: mediatek: add dpi1 component
      asm-generic: unaligned: add get_unaligned_le24()
      include: linux/hdmi.h: add HDMI colorspace and colorimetry enums
      video: mediatek: add new hdmi driver
      arm: dts: mt8390: add framebuffer reserved-memory
      arm: dts: mt8390: add hdmi override node
      configs: mediatek: mt8188: enable hdmi pipeline

 arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi |   1 +
 arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi |   1 +
 arch/arm/dts/mt8390-genio-common-u-boot.dtsi  |  26 +
 configs/mt8188.config                         |   5 +
 drivers/video/Kconfig                         |   1 +
 drivers/video/Makefile                        |   1 +
 drivers/video/mediatek/Kconfig                |  21 +
 drivers/video/mediatek/Makefile               |  16 +
 drivers/video/mediatek/mtk_disp_comp.c        |  78 +++
 drivers/video/mediatek/mtk_disp_comp.h        |  32 +
 drivers/video/mediatek/mtk_disp_merge.c       | 108 ++++
 drivers/video/mediatek/mtk_disp_merge.h       |  19 +
 drivers/video/mediatek/mtk_disp_mutex.c       |  67 ++
 drivers/video/mediatek/mtk_disp_mutex.h       |  14 +
 drivers/video/mediatek/mtk_disp_padding.c     |  40 ++
 drivers/video/mediatek/mtk_disp_padding.h     |  16 +
 drivers/video/mediatek/mtk_dpi.c              | 383 +++++++++++
 drivers/video/mediatek/mtk_dpi.h              |  20 +
 drivers/video/mediatek/mtk_dpi_regs.h         | 247 +++++++
 drivers/video/mediatek/mtk_ethdr.c            |  72 +++
 drivers/video/mediatek/mtk_ethdr.h            |  16 +
 drivers/video/mediatek/mtk_hdmi.c             | 894 ++++++++++++++++++++++++++
 drivers/video/mediatek/mtk_hdmi_regs_v2.h     | 267 ++++++++
 drivers/video/mediatek/mtk_mdp_rdma.c         | 159 +++++
 drivers/video/mediatek/mtk_mdp_rdma.h         |  20 +
 drivers/video/mediatek/mtk_smi_larb.c         |  30 +
 include/asm-generic/unaligned.h               |   7 +
 include/linux/hdmi.h                          |  49 ++
 28 files changed, 2610 insertions(+)
---
base-commit: 677a768c91b2baaefdf09633d1fdb5c9f758674f
change-id: 20260701-add-genio-510-and-genio-700-hdmi-ca62c6b8210c

Best regards,
--  
Julien Stephan <[email protected]>

Reply via email to