drm: starfive: jh7110: Enable display subsystem
Subsystems (12)
A message that is not in the archive (sent off-list or not yet received): CGME20261106135849eucas1p242718d72fa1f38e31477210fd9ee30bc@eucas1p2.samsung.com
v7 cover drm: starfive: jh7110: Enable display subsystem
This series enables the display subsystem on the StarFive JH7110.
Merging: the series splits by subsystem, there is no build dependency between the blocks, and each block lands in the tree that already owns those files:
drm-misc 1-3, 6, 8-14, 17
drivers/gpu/drm/bridge/, include/drm/bridge/ and the display bindings. Patches 1 and 2 are inno-hdmi fixes with Fixes: tags; they apply to Rockchip as much as to StarFive and are independent of the rest, so they can go on their own.
Conor's tree 4, 5, 7, 15-16, 18
drivers/soc/starfive/, together with
the bindings for its two drivers (patches 4 and 7, under bindings/display/starfive/) and the vout-syscon compatible in bindings/soc/starfive/ (STARFIVE SOC DRIVERS), and arch/riscv/boot/dts/starfive/ (STARFIVE DEVICETREES).
- 19
MAINTAINERS.
The PHY patches are now a separate series for linux-phy, as Vinod
suggested: "phy: Add the StarFive JH7110 Innosilicon HDMI PHY" [1]. This series depends on it, and the DT needs the PHY driver at runtime. There is no build dependency.
[1] https://lore.kernel.org/all/[email protected]/
Ordering: patch 4 references the bindings from patch 3 and the PHY series, the example in patch 7 instantiates nodes from patches 3 and 6 and the PHY series, and the DT in patch 18 uses all of them. Patches 4, 7 and 18 therefore need the drm-misc bindings and the PHY series in place to pass dt_binding_check and dtbs_check. Patches 5, 15 and 16 have no such dependency.
There are no out-of-tree dependencies: the dc8200 driver, the th1520 reset controller and the inno-hdmi bridge that the RFC listed as prerequisites are all upstream now.
The clk patch that was 14/20 in v4 went in through the clk tree and is in v7.4-rc1 (af384d6e0573). The DT patch needs it at runtime for the pixel MUXes to follow the PHY.
The dom_vout block holds the display controller (dc8200), the clock generator (voutcrg) and the HDMI IP, all inside PD_VOUT. The HDMI IP is a single register block containing both the controller and the PHY, which are described as separate children because they have separate resources:
- the PHY takes only the 24 MHz reference clock, and provides the pixel clock that voutcrg routes on to the dc8200 pixel MUXes, and the phy the controller uses
- the controller takes pclk/mclk/bclk from voutcrg
It is the same Innosilicon PHY that the RK3328 describes as its own hdmiphy node; here it shares a register window with the controller.
The parent maps the register block and owns the regmap its two children share. Everything in the region sits behind one NoC port whose clock and reset gate access to it, inside PD_VOUT, so the vout subsystem node from the RFC is back and owns those for as long as any child exists.
Patch 11 adds a .mode_valid platform op to inno-hdmi. inno_hdmi_bridge_mode_valid() checks the pixel clock against hdmi->refclk, but that clock only exists where a "ref" clock is described. The JH7110 gets its pixel clock from the PHY, so refclk is NULL and the check was skipped: unsupported modes were advertised, the modeset then "succeeded" because the atomic enable path cannot fail, and the display stayed blank.
Patch 12 makes the inno-hdmi PHY configuration table optional. The JH7110 drives its PHY through a separate driver, so the table only ever existed to get past a probe time check, and the register writes it fed belong to the integrated PHY the JH7110 does not have.
Patch 14 makes the HDMI version inno-hdmi advertises selectable. Since v7.4-rc1 it advertises HDMI 1.2 for every integration, which caps the TMDS character rate at 165 MHz. That fits Rockchip, but on the JH7110, which supports HDMI 1.4b, it hid all eight 3840x2160 and 4096x2160 modes. Rockchip keeps HDMI 1.2.
Patches 1, 2 and 8-14 change the inno-hdmi bridge, which the Rockchip RK3036 and RK3128 use as well. Patch 9 moves its register access to a regmap, Rockchip included. I have no Rockchip hardware, so on Rockchip they are build tested only (arm and riscv). A Tested-by would help.
Testing
=======
Tested on a VisionFive 2 v1.3B using modetest, with the PHY series applied.
All 42 modes the sink advertises work, with nothing in dmesg. Pixel clocks run from 25.175 MHz ([email protected]) up to 297 MHz (4096x2160@30), including 3840x2160 and the full 1920x1080 and 1280x720 rate families.
The four modes the RFC reported as broken work now too: [email protected], [email protected], [email protected] and [email protected].
Before patch 11, four of the advertised modes failed: [email protected] (146.250 MHz), [email protected] (121.750), [email protected] (81.768) and [email protected] (80.140). Those pixel clocks are not in the PHY pre-PLL table, so clk_set_rate() returned -EINVAL and the screen stayed black while userspace saw a successful modeset. They are rejected in .mode_valid now; the other refresh rates of those resolutions still work.
The mux the HDMI controller programs in dom_vout_syscon has a DP and a DPI branch, and the DT wires the DPI one, so the DP branch was checked separately by moving the input endpoint to the DC8200's DP output on a throwaway branch. SYSCFG_4 reads 0x4c0b0000 instead of 0x0c0b0000, the output is identical to the DPI path and all 42 modes set. Sweeping VOUT_HDMI_DP_YUV_MODE over its four values with a mode held shows only RGB giving a correct picture, as documented.
Every commit builds for riscv, and the Rockchip inno-hdmi glue also for arm.
Notes
=====
The JH7110 has no central MAINTAINERS entry and maintainership is fragmented, so patch 19 adds one for the display subsystem and I am happy to help maintain it. The PHY series adds its own entry for the JH7110 HDMI PHY.
checkpatch warns "does MAINTAINERS need updating?" on the patches adding files, because that entry comes in patch 19.
Thanks to Icenowy Zheng for the dc8200 driver and for explaining how the SoC and the display pipeline fit together.
Thanks also to Dominique Belhachemi, who got rid of the vout-subsystem wrapper and helped with the testing, to Maud Spierings for testing on a Framework 13 panel, to Byron Stanoszek and OOHehir for testing v5, and to Graham Markall for testing the JH7110 display patches independently and writing up the results:
https://big-grey.co.uk/2026/01/26/testing-starfive-jh7110-display-controller-patches/
Link to v1: https://lore.kernel.org/all/[email protected]/
---
Changes in v7:
- Moved the hdmi-subsystem and vout-subsystem bindings from bindings/soc/starfive/ to bindings/display/starfive/ (Conor)
- inno-hdmi: access the registers only through a regmap, the parent's
or an MMIO one over the controller's own resource, instead of keeping
two register paths (Heiko). Patch 9 is renamed to "Use a regmap for
register access" and drops its Reviewed-by and Tested-by tags, since
the Rockchip path changed
- Trimmed the comment in the NULL drm_device fix (Heiko)
- Collected Heiko's Reviewed-by on patches 1 and 2
- Rebased onto v7.4-rc1, which has the clk patch and now creates drivers/soc/starfive/ itself, so patches 15 and 16 add their Kconfig
entries to its existing menu
- New patch 14 makes the advertised HDMI version selectable, and the
JH7110 advertises HDMI 1.4. The HDMI 1.2 that v7.4-rc1 advertises for
every inno-hdmi user hid the 3840x2160 and 4096x2160 modes
- Link to v6: https://lore.kernel.org/r/[email protected]
Changes in v6:
- Split the PHY patches into their own series (Vinod)
- New patch 2: the hotplug NULL drm_device guard is split out of "Split
probe out of bind" into its own patch (Heiko)
- inno_hdmi_bind() takes a platform_device, like dw_hdmi_bind() (Heiko)
- Describe the HDMI PHY node by its resources rather than by the probe
cycle, in the commit messages and the Kconfig help (Krzysztof)
- Rebased onto v7.3, collected tags
- Link to v5: https://lore.kernel.org/r/[email protected]
Changes in v5:
- Rebased onto v7.3-rc5.
- Dropped the clk patch, applied as af384d6e0573.
- New patch 13 makes the HDMI_SYS_CTRL register clock source selectable
per platform, and the JH7110 selects the TMDS clock. The driver drove
the register interface from the system clock for everyone, and a
Framework 13 panel flickers continuously that way (Maud Spierings).
Rockchip keeps the system clock, so this is a no-op there. This was
listed as a known limitation in v4.
- New patch 1 fixes v_HSYNC_POLARITY and v_VSYNC_POLARITY, which have
been swapped in inno-hdmi since the driver was merged. The hardware
puts HSYNC in bit 2 and VSYNC in bit 3, and the driver had them the
other way round. Almost all CEA modes drive both syncs with the same
polarity, so the two writes are indistinguishable and the bug only
shows on a mode whose polarities differ - a band of black rows at the
top of the screen, vsync_end - vsync_start + 1 rows tall. Reported independently by Dominique Belhachemi, Maud Spierings and Byron
Stanoszek, and confirmed against the RK3128 TRM by Icenowy Zheng, so
this is a Rockchip fix too.
- Added a 201 MHz entry to the JH7110 pre-PLL table for a 2560x1440
mode Byron Stanoszek runs on a Dell U2711. It is derived the same way
as the neighbouring entries (fbdiv 134, /16, VCO 3.216 GHz) but I have
no sink that asks for it, so it is untested on my hardware.
- Moved the hdmi-subsystem binding from bindings/mfd/ to
bindings/soc/starfive/, next to the vout-subsystem binding and matching
its driver in drivers/soc/starfive/. The mfd/ path was left over from
when the driver was called hdmi-mfd; nothing in the series is an MFD
device, and it meant one isolated binding patch would have had to go
through the MFD tree on its own.
- The commit message for "Split probe out of bind" claimed a matching inno_hdmi_remove(); no such function exists, so the claim is gone.
- Dropped Joshua Peisach's Reviewed-by from the PHY driver patch as well,
since that patch changed in v5.
- Dropped Joshua Peisach's Reviewed-by from the binding patches; he said
he is not reviewing DT (Krzysztof Kozlowski). It is kept on the driver
patches he did look at.
- Removed a probe-time clk_set_rate() from the PHY driver. It programmed
a default rate, and .set_rate writes PHY registers that live in the
window gated by the controller's system clock - a clock the PHY cannot
hold without creating a probe cycle with voutcrg.
- Link to v4: https://lore.kernel.org/r/[email protected]
Changes in v4:
- New patch 11 makes the inno-hdmi PHY configuration table optional, so
the JH7110 controller can drop the dummy two entry table it carried
only to satisfy the probe time check, along with the integrated PHY
register writes that table fed (Icenowy Zheng). That table was also
acting as an upper bound: inno_hdmi_find_phy_config() runs before the
platform .mode_valid and returns early, so its 297 MHz sentinel
rejected every mode above that even though the PHY pre-PLL table has a
594 MHz entry. Nothing here advertises such a mode, so it was latent.
- Fixed a v3 regression: CLK_SET_RATE_NO_REPARENT stops clk_set_rate()
from reparenting the dc8200 pixel MUXes, so they kept whatever the
bootloader had selected and the display stayed black on boards where
that was not the HDMI PHY. They get assigned-clock-parents now (Maud Spierings, Dominique Belhachemi).
- vout-subsystem binding: describe the children by compatible instead of
$ref, as qcom,sm8750-mdss does, and show the whole subsystem with all
four children in the example (Krzysztof Kozlowski).
- Dropped the vout-syscon example from starfive,jh7110-syscon.yaml, it
is part of the vout subsystem example now (Krzysztof Kozlowski).
- Renamed the xin24m node to xin24m-clock (Krzysztof Kozlowski).
- Fixed the HDMI HPD pinmux: it drove the pin high (GPOUT_HIGH with the
output enabled) while also reading it as the hotplug input, so HPD
could only ever read asserted. It is an input now.
- jh7110-inno-hdmi: dropped a regmap lookup whose result was never used; inno_hdmi_probe() fetches the parent regmap itself. The commit message
claimed otherwise and is corrected.
- phy: rockchip: dropped two now unused RK3328 spread spectrum macros
the v3 cleanup missed. The register write itself moved to the shared
helper and is unchanged, so Chaoyi's Reviewed-by is carried over.
- inno-hdmi: the hotplug handler dereferenced bridge.dev unconditionally. Splitting probe out of bind moved the interrupt request to probe, so
an HPD event before the DRM master attaches the bridge would oops.
Guarded.
- Dropped the <linux/mod_devicetable.h> includes (Uwe Kleine-König).
- jh7110-inno-hdmi: __free(device_node) for the graph lookups, and
dropped the redundant negative check on clk_round_rate() (Chaoyi Chen).
- phy: rockchip: dropped the recalc_rate debug print that the shared
helper already emits (Chaoyi Chen).
- Rebased onto v7.3-rc3.
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- Brought back the vout subsystem node and driver, now owning the NoC
bus clock, its reset and PD_VOUT for the whole region, with dc8200,
the HDMI block, the syscon and voutcrg as its children (Icenowy Zheng).
- Fixed a hard hang when the bridge is built as a module: the PHY's
.is_prepared read a register in the window gated by the controller's
system clock, so clk_disable_unused() wedged the CPU before the
controller had bound. The op is gone; the framework uses the software
prepare count instead. (Marek Szyprowski)
- The HDMI controller now programs the display mux in dom_vout_syscon
from the port graph rather than inheriting whatever the bootloader
left, with a phandle to the syscon (Icenowy Zheng).
- The register access clock is named "pclk" to match the existing
inno-hdmi binding, so the generic driver no longer picks up the pixel
clock. Previously it held the pre-PLL powered from probe and sized the
DDC divider from the wrong rate.
- Dropped the clk suffixes and the single-entry -names properties from
the bindings (Conor Dooley). mclk and bclk keep their names: per TRM
5.3 they are the HDMI audio clocks, not module and bus clocks, so the descriptions say that instead.
- Replaced patternProperties with plain properties in the hdmi-subsystem
binding (Conor Dooley).
- dc8200 gets an SoC specific compatible, and inherits dma-noncoherent
from the subsystem bus node, so it validates against verisilicon,dc.
- Added the pre-PLL entry for the Framework 13 panel and fixed two
devicetree whitespace nits (Maud Spierings).
- select REGMAP_MMIO, CLK_SET_RATE_NO_REPARENT on the dc8200 pixel MUXes
so clk_set_rate() cannot reroute them, and inno-hdmi register reads
return 0 instead of stack garbage when regmap_read() fails.
- phy: rockchip: dropped the local pre-PLL lookup wrapper and the 28 now
unused RK3328 pre-PLL macros, and restored the VCO debug output, this
time in the shared helper so both drivers get it (Jonas Karlman).
- Rebased onto v7.3-rc1.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes since the RFC:
- Dropped the vout-subsystem wrapper driver and its binding, along with the patch relaxing the voutcrg binding; genpd handles PD_VOUT per node.
- Renamed the compatible to starfive,jh7110-hdmi-subsystem, dropping "mfd" as a Linux term (Conor Dooley).
- Absolute $refs in the bindings, unused example labels dropped, and the examples deduplicated between parent and children (Conor Dooley).
- Added the .mode_valid platform operation (patch 7).
- Split the inno-hdmi rework into a mechanical probe/bind split (patch
4)
and the regmap-from-parent change (patch 5). struct inno_hdmi is no longer exported; no platform glue dereferences it.
- Replaced the duplicated PHY driver with a shared Innosilicon library and moved Rockchip onto it (patches 11-13).
- Fixed pre-PLL lock detection, which masked the status read with the register address instead of the lock bit.
- Fixed a pixel clock refcount underflow: enable returns early on failure while disable tore down unconditionally.
- voutcrg patch reduced to adding CLK_SET_RATE_PARENT to the two dc8200 pixel MUXes.
- Rebased onto v7.2.
---
Michal Wilczynski (19):
drm/bridge: inno-hdmi: fix swapped HSYNC and VSYNC polarity drm/bridge: inno-hdmi: Don't dereference a NULL drm_device on hotplug
dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller
dt-bindings: display: starfive: Add starfive,jh7110-hdmi-subsystem
dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
dt-bindings: display: starfive: Add starfive,jh7110-vout-subsystem drm/bridge: inno-hdmi: Split probe out of bind
drm/bridge: inno-hdmi: Use a regmap for register access drm/bridge: inno-hdmi: Add .disable platform operation drm/bridge: inno-hdmi: Add .mode_valid platform operation drm/bridge: inno-hdmi: Make the PHY configuration table optional drm/bridge: inno-hdmi: Make the register clock source selectable drm/bridge: inno-hdmi: Make the supported HDMI version selectable
soc: starfive: Add jh7110-hdmi-subsystem driver
soc: starfive: Add jh7110-vout-subsystem driver drm/bridge: starfive: Add JH7110 HDMI controller driver
riscv: dts: starfive: jh7110: Update DT for display subsystem
MAINTAINERS: Add StarFive JH7110 display subsystem entry
.../starfive,jh7110-inno-hdmi-controller.yaml | 121 +++++++++ .../starfive/starfive,jh7110-hdmi-subsystem.yaml | 95 +++++++ .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 +++++++++++++++ .../bindings/display/verisilicon,dc.yaml | 1 + .../soc/starfive/starfive,jh7110-syscon.yaml | 1 + MAINTAINERS | 11 + arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 121 ++++++++- arch/riscv/boot/dts/starfive/jh7110.dtsi | 105 ++++++-- drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/inno-hdmi.c | 125 +++++++-- drivers/gpu/drm/bridge/jh7110-inno-hdmi.c | 297 +++++++++++++++++++++ drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c | 2 +- drivers/soc/starfive/Kconfig | 34 +++ drivers/soc/starfive/Makefile | 2 + drivers/soc/starfive/jh7110-hdmi-subsystem.c | 72 +++++ drivers/soc/starfive/jh7110-vout-subsystem.c | 82 ++++++ include/drm/bridge/inno_hdmi.h | 17 +- 18 files changed, 1266 insertions(+), 51 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20251031-jh7110-clean-send-7d2242118026
prerequisite-change-id: 20261028-jh7110-inno-hdmi-phy-83e5cfa643e3:v7
prerequisite-patch-id: e78b1dab85d70fa7ec3e551560dfc90891546de9
prerequisite-patch-id: 7ffec3af58389aa090d5a9947889060dd5493138
prerequisite-patch-id: 4a3488cc151ae0e9ef053ea67e8e520520c7df15
prerequisite-patch-id: 37de8eb6867db62f75e39908a136684a1cc14743
prerequisite-patch-id: 27aeff98d5c0b0bdb3eb9e9bbc2bf5e982864774
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
PATCH v7 1/19 drm/bridge: inno-hdmi: fix swapped HSYNC and VSYNC polarity
v_HSYNC_POLARITY() and v_VSYNC_POLARITY() write the wrong bits: the hardware puts HSYNC in bit 2 and VSYNC in bit 3, the macros do the opposite. Most CEA modes drive both syncs with the same polarity so it goes unnoticed; it only shows up on modes where the two differ.
--- drivers/gpu/drm/bridge/inno-hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/inno-hdmi.c +2 -2
@@ -122,8 +122,8 @@ enum {#define v_VIDEO_MUTE (n) ((n) << 0)#define HDMI_VIDEO_TIMING_CTL 0x08 -#define v_HSYNC_POLARITY (n) ((n) << 3) -#define v_VSYNC_POLARITY (n) ((n) << 2) +#define v_VSYNC_POLARITY (n) ((n) << 3) +#define v_HSYNC_POLARITY (n) ((n) << 2)#define v_INETLACE (n) ((n) << 1)#define v_EXTERANL_VIDEO (n) ((n) << 0)
Signature · 1 line
2.34.1
PATCH v7 2/19 drm/bridge: inno-hdmi: Don't dereference a NULL drm_device on hotplug
In reply to Michal Wilczynskiinno_hdmi_irq() passes hdmi->bridge.dev to drm_helper_hpd_irq_event(), which dereferences it in its first statement:
if (!dev->mode_config.poll_enabled)
bridge.dev is assigned only by drm_bridge_attach(), but inno_hdmi_bind() unmutes the hotplug interrupt in inno_hdmi_init_hw() and installs the handler well before it attaches the bridge:
inno_hdmi_init_hw(hdmi); /* unmutes hotplug */ devm_request_threaded_irq(...); /* handler goes live */ ... hdmi->bridge.ddc = inno_hdmi_i2c_adapter(hdmi); devm_drm_bridge_add(dev, &hdmi->bridge); drm_bridge_attach(...); /* bridge.dev set here */
The bridge is allocated by devm_drm_bridge_alloc(), which kzalloc()s it, so bridge.dev is NULL for all of that window, and a hotplug event arriving in it enters drm_helper_hpd_irq_event(NULL).
Before the conversion to a bridge the ordering was safe:inno_hdmi_register() called drmm_connector_hdmi_init(), which set connector.dev, before the interrupt was requested.
Drop hotplug events that arrive before the bridge is attached.
--- drivers/gpu/drm/bridge/inno-hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/inno-hdmi.c +3 -1
@@ -929,7 +929,9 @@ static irqreturn_t inno_hdmi_irq(int irq, void *dev_id) {struct inno_hdmi *hdmi = dev_id; -drm_helper_hpd_irq_event (hdmi->bridge.dev); +/* bridge.dev is NULL until drm_bridge_attach() */ +if (hdmi->bridge.dev) +drm_helper_hpd_irq_event (hdmi->bridge.dev);return IRQ_HANDLED ; }
Signature · 1 line
2.34.1
PATCH v7 3/19 dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller
In reply to Michal WilczynskiAdd the dt-binding for the StarFive JH7110 Innosilicon HDMI controller (DRM bridge).
This device is the second child of the starfive,jh7110-hdmi-subsystem node. It consumes its register access, audio master and audio bit clocks (pclk, mclk, bclk) from voutcrg, and both the pixel clock (pixel) and the PHY from its hdmi_phy sibling.
--- .../starfive,jh7110-inno-hdmi-controller.yaml | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+)
Documentation/devicetree/bindings/display/bridge/starfive,jh7110-inno-hdmi-controller.yaml new file +121 -0
@@ -0,0 +1,121 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/starfive,jh7110-inno-hdmi-controller.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 Innosilicon HDMI Controller + +maintainers: + - Michal Wilczynski <[email protected]> + +description: + The controller portion of the StarFive JH7110 INNO HDMI IP. + +properties: + compatible: + const: starfive,jh7110-inno-hdmi-controller + + interrupts: + maxItems: 1 + + clocks: + items: + - description: The HDMI controller main clock + - description: Audio master clock + - description: Audio bit clock, from the I2S transmitter + - description: The pixel clock, generated by the PHY + + clock-names: + items: + - const: pclk + - const: mclk + - const: bclk + - const: pixel + + resets: + maxItems: 1 + + phys: + maxItems: 1 + + starfive,vout-syscon: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the dom_vout_syscon system controller, which holds the mux + selecting the DC8200 output that drives the HDMI transmitter. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: + Input from the DC8200. The remote port number selects the DC8200 + panel and the remote endpoint number the interface on that panel, + 0 for DPI and 1 for DP. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output to the HDMI connector. + + required: + - port@0 + - port@1 + +required: + - compatible + - interrupts + - clocks + - clock-names + - resets + - phys + - starfive,vout-syscon + - ports + +additionalProperties: false + +examples: + # Shown as a child of the HDMI subsystem node; see + # Documentation/devicetree/bindings/display/starfive/starfive,jh7110-hdmi-subsystem.yaml + # for the full node. + - | + #include <dt-bindings/clock/starfive,jh7110-crg.h> + #include <dt-bindings/reset/starfive,jh7110-crg.h> + + controller { + compatible = "starfive,jh7110-inno-hdmi-controller"; + clocks = <&voutcrg JH7110_VOUTCLK_HDMI_TX_SYS>, + <&voutcrg JH7110_VOUTCLK_HDMI_TX_MCLK>, + <&voutcrg JH7110_VOUTCLK_HDMI_TX_BCLK>, + <&hdmi_phy>; + clock-names = "pclk", "mclk", "bclk", "pixel"; + interrupts = <99>; + phys = <&hdmi_phy>; + resets = <&voutcrg JH7110_VOUTRST_HDMI_TX_HDMI>; + starfive,vout-syscon = <&vout_syscon>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + endpoint { + remote-endpoint = <&dpu_out_dpi0>; + }; + }; + + port@1 { + reg = <1>; + + endpoint { + remote-endpoint = <&hdmi_con_in>; + }; + }; + }; + }; + +...
Signature · 1 line
2.34.1
PATCH v7 4/19 dt-bindings: display: starfive: Add starfive,jh7110-hdmi-subsystem
In reply to Michal WilczynskiAdd the dt-binding for the StarFive JH7110 HDMI subsystem.
The JH7110 HDMI IP is a monolithic block containing both the digital controller and analog PHY in a single register space. This binding defines the parent device, which holds the shared register map, and its two children: the PHY and the controller.
The two have separate resources. The PHY takes the 24 MHz reference clock and provides both the pixel clock, which the VOUT clock generator routes on to the display controller, and the phy the controller uses. The controller takes its clocks from the VOUT clock generator. What they share is the register space, which the parent maps.
--- .../starfive/starfive,jh7110-hdmi-subsystem.yaml | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+)
Documentation/devicetree/bindings/display/starfive/starfive,jh7110-hdmi-subsystem.yaml new file +95 -0
@@ -0,0 +1,95 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/starfive/starfive,jh7110-hdmi-subsystem.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 HDMI subsystem + +maintainers: + - Michal Wilczynski <[email protected]> + +description: + The StarFive JH7110 HDMI block is a monolithic IP containing both + the digital controller logic and the analog PHY logic in a single + register space. It sits inside the video output subsystem, which owns + the NoC bus clock and reset gating this region and the power domain it + belongs to. + +properties: + compatible: + const: starfive,jh7110-hdmi-subsystem + + reg: + maxItems: 1 + + phy: + $ref: /schemas/phy/starfive,jh7110-inno-hdmi-phy.yaml# + + controller: + $ref: /schemas/display/bridge/starfive,jh7110-inno-hdmi-controller.yaml# + +required: + - compatible + - reg + - phy + - controller + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/starfive,jh7110-crg.h> + #include <dt-bindings/reset/starfive,jh7110-crg.h> + + soc { + #address-cells = <1>; + #size-cells = <1>; + + hdmi@29590000 { + compatible = "starfive,jh7110-hdmi-subsystem"; + reg = <0x29590000 0x4000>; + + controller { + compatible = "starfive,jh7110-inno-hdmi-controller"; + clocks = <&voutcrg JH7110_VOUTCLK_HDMI_TX_SYS>, + <&voutcrg JH7110_VOUTCLK_HDMI_TX_MCLK>, + <&voutcrg JH7110_VOUTCLK_HDMI_TX_BCLK>, + <&hdmi_phy>; + clock-names = "pclk", "mclk", "bclk", "pixel"; + interrupts = <99>; + phys = <&hdmi_phy>; + resets = <&voutcrg JH7110_VOUTRST_HDMI_TX_HDMI>; + starfive,vout-syscon = <&vout_syscon>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + endpoint { + remote-endpoint = <&dpu_out_dpi0>; + }; + }; + + port@1 { + reg = <1>; + + endpoint { + remote-endpoint = <&hdmi_con_in>; + }; + }; + }; + }; + + hdmi_phy: phy { + compatible = "starfive,jh7110-inno-hdmi-phy"; + #clock-cells = <0>; + clocks = <&xin24m>; + #phy-cells = <0>; + }; + }; + }; +...
Signature · 1 line
2.34.1
PATCH v7 5/19 dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
In reply to Michal WilczynskiThe video output subsystem has its own system controller, documented as dom_vout_syscon. Among other things it holds the mux that selects which DC8200 output drives the HDMI transmitter, so the HDMI controller needs to reach it.
--- .../devicetree/bindings/soc/starfive/starfive,jh7110-syscon.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/soc/starfive/starfive,jh7110-syscon.yaml +1 -0
@@ -24,6 +24,7 @@ properties: - enum: - starfive,jh7110-aon-syscon - starfive,jh7110-stg-syscon + - starfive,jh7110-vout-syscon - const: syscon reg:
Signature · 1 line
2.34.1
PATCH v7 6/19 dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
In reply to Michal WilczynskiThe JH7110 embeds a DC8200. The binding requires an SoC specific compatible ahead of the generic one, so add the JH7110 to the enum.
--- Documentation/devicetree/bindings/display/verisilicon,dc.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/verisilicon,dc.yaml +1 -0
@@ -16,6 +16,7 @@ properties: compatible: items: - enum: + - starfive,jh7110-dc8200 - thead,th1520-dc8200 - const: verisilicon,dc # DC IPs have discoverable ID/revision registers
Signature · 1 line
2.34.1
Re: [PATCH v7 06/19] dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
Quoted 5 lines · 在 2026-11-06五的 14:58 +0100,Michal Wilczynski写道:
The JH7110 embeds a DC8200. The binding requires an SoC specific compatible ahead of the generic one, so add the JH7110 to the enum.
Signed-off-by Michal Wilczynski <[email protected]>
Applied this patch to drm-misc-next.
Thanks,
Icenowy
Quoted 16 lines
--- Documentation/devicetree/bindings/display/verisilicon,dc.yaml | 1 + 1 file changed, 1 insertion(+)Documentation/devicetree/bindings/display/verisilicon,dc.yaml +1
-0@@ -16,6 +16,7 @@ properties: compatible: items: - enum: + - starfive,jh7110-dc8200 - thead,th1520-dc8200 - const: verisilicon,dc # DC IPs have discoverable ID/revision registers
PATCH v7 7/19 dt-bindings: display: starfive: Add starfive,jh7110-vout-subsystem
In reply to Michal WilczynskiThe JH7110 groups its display hardware into a video output subsystem, dom_vout_top, covering the DC8200, the HDMI transmitter, the video output clock generator and the video output system controller.
They share one NoC port whose clock and reset gate access to every register in the region, and the region sits in the PD_VOUT power domain. Describe the subsystem as a bus node so those resources are owned by the block that shares them.
--- .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 +++++++++++++++++++++ 1 file changed, 218 insertions(+)
Documentation/devicetree/bindings/display/starfive/starfive,jh7110-vout-subsystem.yaml new file +218 -0
@@ -0,0 +1,218 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/starfive/starfive,jh7110-vout-subsystem.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 video output subsystem + +maintainers: + - Michal Wilczynski <[email protected]> + +description: + The JH7110 groups its display hardware into a video output subsystem, named + dom_vout_top in the documentation. It covers the DC8200 display controller, + the HDMI transmitter, the video output clock generator and the video output + system controller, all behind one NoC port. That port's clock and reset gate + access to every register in the region, and the region sits in the PD_VOUT + power domain, so this node owns those resources on behalf of its children. + +properties: + compatible: + const: starfive,jh7110-vout-subsystem + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + description: NoC display bus clock. + + resets: + maxItems: 1 + description: NoC display bus reset. + + power-domains: + maxItems: 1 + + dma-noncoherent: true + + ranges: true + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + +patternProperties: + "^display@[0-9a-f]+$": + type: object + additionalProperties: true + properties: + compatible: + contains: + const: starfive,jh7110-dc8200 + + "^hdmi@[0-9a-f]+$": + type: object + additionalProperties: true + properties: + compatible: + const: starfive,jh7110-hdmi-subsystem + + "^syscon@[0-9a-f]+$": + type: object + additionalProperties: true + properties: + compatible: + contains: + const: starfive,jh7110-vout-syscon + + "^clock-controller@[0-9a-f]+$": + type: object + additionalProperties: true + properties: + compatible: + const: starfive,jh7110-voutcrg + +required: + - compatible + - reg + - clocks + - resets + - power-domains + - ranges + - "#address-cells" + - "#size-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/starfive,jh7110-crg.h> + #include <dt-bindings/power/starfive,jh7110-pmu.h> + #include <dt-bindings/reset/starfive,jh7110-crg.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + display-subsystem@29400000 { + compatible = "starfive,jh7110-vout-subsystem"; + reg = <0x0 0x29400000 0x0 0x200000>; + ranges; + #address-cells = <2>; + clocks = <&syscrg JH7110_SYSCLK_NOC_BUS_DISP_AXI>; + dma-noncoherent; + power-domains = <&pwrc JH7110_PD_VOUT>; + resets = <&syscrg JH7110_SYSRST_NOC_BUS_DISP_AXI>; + #size-cells = <2>; + + display@29400000 { + compatible = "starfive,jh7110-dc8200", "verisilicon,dc"; + reg = <0x0 0x29400000 0x0 0x2800>; + clocks = <&voutcrg JH7110_VOUTCLK_DC8200_CORE>, + <&voutcrg JH7110_VOUTCLK_DC8200_AXI>, + <&voutcrg JH7110_VOUTCLK_DC8200_AHB>, + <&voutcrg JH7110_VOUTCLK_DC8200_PIX0>, + <&voutcrg JH7110_VOUTCLK_DC8200_PIX1>; + clock-names = "core", "axi", "ahb", "pix0", "pix1"; + interrupts = <95>; + resets = <&voutcrg JH7110_VOUTRST_DC8200_CORE>, + <&voutcrg JH7110_VOUTRST_DC8200_AXI>, + <&voutcrg JH7110_VOUTRST_DC8200_AHB>; + reset-names = "core", "axi", "ahb"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + dpu_out_dpi0: endpoint@0 { + reg = <0>; + remote-endpoint = <&hdmi_in>; + }; + }; + + port@1 { + reg = <1>; + }; + }; + }; + + hdmi@29590000 { + compatible = "starfive,jh7110-hdmi-subsystem"; + reg = <0x0 0x29590000 0x0 0x4000>; + + controller { + compatible = "starfive,jh7110-inno-hdmi-controller"; + clocks = <&voutcrg JH7110_VOUTCLK_HDMI_TX_SYS>, + <&voutcrg JH7110_VOUTCLK_HDMI_TX_MCLK>, + <&voutcrg JH7110_VOUTCLK_HDMI_TX_BCLK>, + <&hdmi_phy>; + clock-names = "pclk", "mclk", "bclk", "pixel"; + interrupts = <99>; + phys = <&hdmi_phy>; + resets = <&voutcrg JH7110_VOUTRST_HDMI_TX_HDMI>; + starfive,vout-syscon = <&vout_syscon>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + hdmi_in: endpoint { + remote-endpoint = <&dpu_out_dpi0>; + }; + }; + + port@1 { + reg = <1>; + + endpoint { + remote-endpoint = <&hdmi_con_in>; + }; + }; + }; + }; + + hdmi_phy: phy { + compatible = "starfive,jh7110-inno-hdmi-phy"; + #clock-cells = <0>; + clocks = <&xin24m>; + #phy-cells = <0>; + }; + }; + + vout_syscon: syscon@295b0000 { + compatible = "starfive,jh7110-vout-syscon", "syscon"; + reg = <0x0 0x295b0000 0x0 0x10000>; + }; + + voutcrg: clock-controller@295c0000 { + compatible = "starfive,jh7110-voutcrg"; + reg = <0x0 0x295c0000 0x0 0x10000>; + #clock-cells = <1>; + clocks = <&syscrg JH7110_SYSCLK_VOUT_SRC>, + <&syscrg JH7110_SYSCLK_VOUT_TOP_AHB>, + <&syscrg JH7110_SYSCLK_VOUT_TOP_AXI>, + <&syscrg JH7110_SYSCLK_VOUT_TOP_HDMITX0_MCLK>, + <&syscrg JH7110_SYSCLK_I2STX0_BCLK>, + <&hdmi_phy>; + clock-names = "vout_src", "vout_top_ahb", + "vout_top_axi", "vout_top_hdmitx0_mclk", + "i2stx0_bclk", "hdmitx0_pixelclk"; + power-domains = <&pwrc JH7110_PD_VOUT>; + #reset-cells = <1>; + resets = <&syscrg JH7110_SYSRST_VOUT_TOP_SRC>; + }; + }; + }; +...
Signature · 1 line
2.34.1
PATCH v7 8/19 drm/bridge: inno-hdmi: Split probe out of bind
In reply to Michal Wilczynskiinno_hdmi_bind() both sets up the bridge and attaches it to a DRM encoder. A platform whose HDMI controller is a child of a larger device needs the first half without the second, since it registers as its own platform driver and lets the DRM core bind the bridge later.
Move the setup into a new exported inno_hdmi_probe(), and reduce inno_hdmi_bind() to a wrapper around it. Like inno_hdmi_probe() and dw_hdmi_bind(), it now takes the platform_device, so the Rockchip glue does the to_platform_device() conversion instead.
No functional change intended.
--- drivers/gpu/drm/bridge/inno-hdmi.c | 39 +++++++++++++++++++++++---- drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c | 2 +- include/drm/bridge/inno_hdmi.h | 6 ++++- 3 files changed, 40 insertions(+), 7 deletions(-)
drivers/gpu/drm/bridge/inno-hdmi.c +34 -5
@@ -1063,11 +1063,24 @@ static struct i2c_adapter *inno_hdmi_i2c_adapter(struct inno_hdmi *hdmi)return adap; } -struct inno_hdmi *inno_hdmi_bind (struct device *dev, -struct drm_encoder *encoder, -const struct inno_hdmi_plat_data *plat_data) +/** +* inno_hdmi_probe - Internal helper to perform common setup +* @pdev: platform device +* @plat_data: SoC-specific platform data +* +* This function handles all the common hardware setup: allocating the main +* struct, mapping registers, getting clocks, initializing the hardware, +* setting up the IRQ, and initializing the DDC adapter and bridge struct. +* +* It registers the bridge but does not attach it, for glue drivers that probe +* as their own platform device rather than through a component bind. +* +* Return: the inno_hdmi instance on success, or an ERR_PTR() on failure. +*/ +struct inno_hdmi *inno_hdmi_probe (struct platform_device *pdev, +const struct inno_hdmi_plat_data *plat_data) { -struct platform_device *pdev =to_platform_device (dev); +struct device *dev = &pdev->dev;struct inno_hdmi *hdmi;int irq;int ret;
@@ -1131,7 +1144,23 @@ struct inno_hdmi *inno_hdmi_bind(struct device *dev,if (ret)return ERR_PTR (ret); - ret =drm_bridge_attach (encoder, &hdmi->bridge,NULL ,DRM_BRIDGE_ATTACH_NO_CONNECTOR ); +return hdmi; +} +EXPORT_SYMBOL_GPL (inno_hdmi_probe); + +struct inno_hdmi *inno_hdmi_bind (struct platform_device *pdev, +struct drm_encoder *encoder, +const struct inno_hdmi_plat_data *plat_data) +{ +struct inno_hdmi *hdmi; +int ret; + + hdmi =inno_hdmi_probe (pdev, plat_data); +if (IS_ERR (hdmi)) +return hdmi; + + ret =drm_bridge_attach (encoder, &hdmi->bridge,NULL , +DRM_BRIDGE_ATTACH_NO_CONNECTOR );if (ret)return ERR_PTR (ret);
drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c +1 -1
@@ -127,7 +127,7 @@ static int inno_hdmi_rockchip_bind(struct device *dev, struct device *master, vodev_set_drvdata (dev, hdmi); - hdmi->base =inno_hdmi_bind (dev, encoder, plat_data); + hdmi->base =inno_hdmi_bind (to_platform_device (dev), encoder, plat_data); connector =drm_bridge_connector_init (drm, encoder);if (IS_ERR (connector)) {
include/drm/bridge/inno_hdmi.h +5 -1
@@ -12,6 +12,7 @@ struct device;struct drm_encoder ;struct drm_display_mode ;struct inno_hdmi ; +struct platform_device ;struct inno_hdmi_plat_ops {void (*enable)(struct device *pdev,struct drm_display_mode *mode);
@@ -29,7 +30,10 @@ struct inno_hdmi_plat_data { struct inno_hdmi_phy_config *default_phy_config; }; -struct inno_hdmi *inno_hdmi_bind (struct device *pdev, +struct inno_hdmi *inno_hdmi_bind (struct platform_device *pdev,struct drm_encoder *encoder,const struct inno_hdmi_plat_data *plat_data); + +struct inno_hdmi *inno_hdmi_probe (struct platform_device *pdev, +const struct inno_hdmi_plat_data *plat_data);#endif /* __INNO_HDMI__ */
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v7 08/19] drm/bridge: inno-hdmi: Split probe out of bind
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/bridge: inno-hdmi: race on bridge.dev in inno_hdmi_irq() after probe split --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] drm/bridge: inno-hdmi: race on bridge.dev in inno_hdmi_irq() after probe split
--
commit b0209990726be89f8d7446a146a593a4fe328e8b
Author: Michal Wilczynski <[email protected]>
drm/bridge: inno-hdmi: Split probe out of bind
This commit splits hardware and bridge setup out of inno_hdmi_bind() into an exported inno_hdmi_probe() helper so standalone platform drivers can register the bridge without immediately attaching it to an encoder.
Quoted 34 lines
drivers/gpu/drm/bridge/inno-hdmi.c +17
-4@@ -1063,11 +1063,24 @@ static struct i2c_adapter *inno_hdmi_i2c_adapter(struct inno_hdmi *hdmi)return adap; } -struct inno_hdmi *inno_hdmi_bind (struct device *dev, -struct drm_encoder *encoder, -const struct inno_hdmi_plat_data *plat_data) +/** +* inno_hdmi_probe - Internal helper to perform common setup +* @pdev: platform device +* @plat_data: SoC-specific platform data +* +* This function handles all the common hardware setup: allocating the main +* struct, mapping registers, getting clocks, initializing the hardware, +* setting up the IRQ, and initializing the DDC adapter and bridge struct. +* +* It registers the bridge but does not attach it, for glue drivers that probe +* as their own platform device rather than through a component bind. +* +* Return: the inno_hdmi instance on success, or an ERR_PTR() on failure. +*/ +struct inno_hdmi *inno_hdmi_probe (struct platform_device *pdev, +const struct inno_hdmi_plat_data *plat_data) { -struct platform_device *pdev =to_platform_device (dev); +struct device *dev = &pdev->dev;struct inno_hdmi *hdmi;int irq;int ret;
drivers/gpu/drm/bridge/inno-hdmi.c struct inno_hdmi *inno_hdmi_bind(struct device *dev, · line 1149
Quoted 7 lines
drivers/gpu/drm/bridge/inno-hdmi.c +3
-1@@ -1131,7 +1144,23 @@ struct inno_hdmi *inno_hdmi_bind(struct device *dev,if (ret)return ERR_PTR (ret); - ret =drm_bridge_attach (encoder, &hdmi->bridge,NULL ,DRM_BRIDGE_ATTACH_NO_CONNECTOR ); +return hdmi; +} +EXPORT_SYMBOL_GPL (inno_hdmi_probe);
[Severity: Medium]
Can inno_hdmi_irq() race with drm_bridge_detach() on hdmi->bridge.dev when a standalone bridge driver uses inno_hdmi_probe()?
Previously, inno_hdmi_bind() was called from component bind, so component_unbind_all() released the devm_request_threaded_irq() handler before drm_dev_put() detached the bridge and freed the drm_device. When a standalone platform driver calls inno_hdmi_probe(), the threaded IRQ stays active for the lifetime of the bridge platform_device while the display driver attaches and detaches the bridge.
drivers/gpu/drm/bridge/inno-hdmi.c:inno_hdmi_irq() {
/* bridge.dev is NULL until drm_bridge_attach() */
if (hdmi->bridge.dev)
drm_helper_hpd_irq_event(hdmi->bridge.dev);
}If an HPD interrupt fires while the display driver is tearing down its drm_device, inno_hdmi_irq() reads hdmi->bridge.dev without synchronization against drm_bridge_detach() and drm_dev_put():
CPU0 CPU1 (irq/inno_hdmi_irq)drm_dev_put(drm)
...
drm_encoder_cleanup(encoder)
drm_bridge_detach(&hdmi->bridge)
if (hdmi->bridge.dev)
bridge->dev = NULL; kfree(drm)
drm_helper_hpd_irq_event(...)
<-- use-after-free or NULL deref
Depending on timing, this causes either a use-after-free of the drm_device or a NULL pointer dereference in drm_helper_hpd_irq_event() if the compiler reloads hdmi->bridge.dev. Calling drm_bridge_hpd_notify(&hdmi->bridge, status) instead of drm_helper_hpd_irq_event() would serialize against HPD disable through bridge->hpd_mutex.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
PATCH v7 9/19 drm/bridge: inno-hdmi: Use a regmap for register access
In reply to Michal WilczynskiOn some SoCs the HDMI controller does not own its register window. The StarFive JH7110 documents one 64 KB block, u0_hdmitx, that holds both the controller and the PHY, so the parent device maps it and owns the regmap while the two children share it.
Access the registers through a regmap. Use the one supplied by the parent device when there is one, and otherwise create an MMIO regmap over our own resource. The MMIO regmap uses 32-bit accesses with a 4-byte stride, matching the readl_relaxed() and writel_relaxed() calls it replaces, so the Rockchip platforms see the same register accesses.
--- drivers/gpu/drm/bridge/Kconfig | 1 + drivers/gpu/drm/bridge/inno-hdmi.c | 39 ++++++++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 6 deletions(-)
drivers/gpu/drm/bridge/Kconfig +1 -0
@@ -105,6 +105,7 @@ config DRM_INNO_HDMI select DRM_DISPLAY_HDMI_HELPER select DRM_DISPLAY_HELPER select DRM_KMS_HELPER + select REGMAP_MMIO config DRM_ITE_IT6263 tristate "ITE IT6263 LVDS/HDMI bridge"
drivers/gpu/drm/bridge/inno-hdmi.c +33 -6
@@ -396,7 +396,7 @@ struct inno_hdmi {struct drm_bridge bridge;struct clk *pclk;struct clk *refclk; -void __iomem *regs; +struct regmap *regmap;struct regmap *grf;struct inno_hdmi_i2c *i2c;
@@ -468,14 +468,25 @@ static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi,return -EINVAL ; } +static const struct regmap_config inno_hdmi_regmap_config = { + .reg_bits =32 , + .val_bits =32 , + .reg_stride =4 , +}; +static inline u8 hdmi_readb (struct inno_hdmi *hdmi,u16 offset) { -return readl_relaxed (hdmi->regs + (offset) *0x04 ); +u32 val; + +if (regmap_read (hdmi->regmap, offset *4 , &val)) +return 0 ; + +return val; }static inline void hdmi_writeb (struct inno_hdmi *hdmi,u16 offset,u32 val) { -writel_relaxed (val, hdmi->regs + (offset) *0x04 ); +regmap_write (hdmi->regmap, offset *4 , val); } static inline void hdmi_modb(struct inno_hdmi *hdmi, u16 offset,
@@ -1082,6 +1093,7 @@ struct inno_hdmi *inno_hdmi_probe(struct platform_device *pdev, {struct device *dev = &pdev->dev;struct inno_hdmi *hdmi; +void __iomem *regs;int irq;int ret;
@@ -1097,9 +1109,24 @@ struct inno_hdmi *inno_hdmi_probe(struct platform_device *pdev, hdmi->dev = dev; hdmi->plat_data = plat_data; - hdmi->regs =devm_platform_ioremap_resource (pdev,0 ); -if (IS_ERR (hdmi->regs)) -return ERR_CAST (hdmi->regs); +/* +* On platforms where the controller shares a register space with +* other blocks, the parent owns the regmap. Otherwise map our own +* resource. +*/ +if (dev->parent) + hdmi->regmap =dev_get_regmap (dev->parent,NULL ); + +if (!hdmi->regmap) { + regs =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (regs)) +return ERR_CAST (regs); + + hdmi->regmap =devm_regmap_init_mmio (dev, regs, + &inno_hdmi_regmap_config); +if (IS_ERR (hdmi->regmap)) +return ERR_CAST (hdmi->regmap); + } hdmi->pclk =devm_clk_get_enabled (hdmi->dev,"pclk" );if (IS_ERR (hdmi->pclk)) {
Signature · 1 line
2.34.1
PATCH v7 10/19 drm/bridge: inno-hdmi: Add .disable platform operation
In reply to Michal WilczynskiThe Innosilicon HDMI driver supports platform-specific behavior through the inno_hdmi_plat_ops. While it provides an .enable hook for platform-specific power up sequences (like enabling PHYs), it lacks a corresponding hook for power down.
This patch adds a new .disable op to the inno_hdmi_plat_ops struct and calls it at the beginning of inno_hdmi_bridge_atomic_disable().
This allows platform specific drivers, such as the StarFive JH7110, to implement their own power down sequence (e.g., calling phy_power_off() and clk_disable_unprepare()).
--- drivers/gpu/drm/bridge/inno-hdmi.c | 4 ++++ include/drm/bridge/inno_hdmi.h | 1 + 2 files changed, 5 insertions(+)
drivers/gpu/drm/bridge/inno-hdmi.c +4 -0
@@ -882,6 +882,10 @@ static void inno_hdmi_bridge_atomic_disable(struct drm_bridge *bridge, struct drm_atomic_commit *state) {struct inno_hdmi *hdmi =bridge_to_inno_hdmi (bridge); +const struct inno_hdmi_plat_ops *plat_ops = hdmi->plat_data->ops; + +if (plat_ops && plat_ops->disable) + plat_ops->disable (hdmi->dev);inno_hdmi_standby (hdmi); }
include/drm/bridge/inno_hdmi.h +1 -0
@@ -16,6 +16,7 @@ struct platform_device;struct inno_hdmi_plat_ops {void (*enable)(struct device *pdev,struct drm_display_mode *mode); +void (*disable)(struct device *pdev); };struct inno_hdmi_phy_config {
Signature · 1 line
2.34.1
PATCH v7 11/19 drm/bridge: inno-hdmi: Add .mode_valid platform operation
In reply to Michal Wilczynskiinno_hdmi_bridge_mode_valid() validates the pixel clock against hdmi->refclk, but that clock is optional and is only present on platforms that describe a "ref" clock. Platforms where the pixel clock is produced by a separate device - such as the StarFive JH7110, whose PHY is both the clock and the PHY provider - have no "ref" clock, so the check is skipped entirely and every mode is reported as valid.
A mode the platform cannot generate is then advertised to userspace. The subsequent modeset appears to succeed, since the atomic enable path cannot fail, and the display silently stays blank.
Add a .mode_valid platform operation so platforms can reject modes they are unable to drive. Platforms that do not implement it are unaffected.
--- drivers/gpu/drm/bridge/inno-hdmi.c | 9 +++++++++ include/drm/bridge/inno_hdmi.h | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/inno-hdmi.c +9 -0
@@ -819,6 +819,7 @@ static enum drm_mode_status inno_hdmi_bridge_mode_valid(struct drm_bridge *bridg const struct drm_display_mode *mode) {struct inno_hdmi *hdmi =bridge_to_inno_hdmi (bridge); +const struct inno_hdmi_plat_ops *plat_ops = hdmi->plat_data->ops;unsigned long mpixelclk, max_tolerance;long rounded_refclk;
@@ -834,6 +835,14 @@ static enum drm_mode_status inno_hdmi_bridge_mode_valid(struct drm_bridge *bridgif (inno_hdmi_find_phy_config (hdmi, mpixelclk) <0 )return MODE_CLOCK_HIGH ; +if (plat_ops && plat_ops->mode_valid) { +enum drm_mode_status status; + + status = plat_ops->mode_valid (hdmi->dev, mode); +if (status !=MODE_OK ) +return status; + } +if (hdmi->refclk) { rounded_refclk =clk_round_rate (hdmi->refclk, mpixelclk);if (rounded_refclk <0 )
include/drm/bridge/inno_hdmi.h +4 -1
@@ -8,15 +8,18 @@#include <linux/types.h> +#include <drm/drm_modes.h> +struct device ;struct drm_encoder ; -struct drm_display_mode ;struct inno_hdmi ;struct platform_device ;struct inno_hdmi_plat_ops {void (*enable)(struct device *pdev,struct drm_display_mode *mode);void (*disable)(struct device *pdev); +enum drm_mode_status (*mode_valid)(struct device *pdev, +const struct drm_display_mode *mode); };struct inno_hdmi_phy_config {
Signature · 1 line
2.34.1
PATCH v7 12/19 drm/bridge: inno-hdmi: Make the PHY configuration table optional
In reply to Michal WilczynskiThe pre-emphasis and drive-strength values in inno_hdmi_phy_config, and the registers they are written to, belong to the PHY integrated into the controller. A platform whose PHY is a separate device has neither, and its own .mode_valid already validates the pixel clock against the real PHY, so the table only bounds the generic check.
Let such a platform omit the table: skip the integrated-PHY register writes in the power-up path and the table lookup in .mode_valid when it is absent. Platforms that supply one are unaffected.
--- drivers/gpu/drm/bridge/inno-hdmi.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/gpu/drm/bridge/inno-hdmi.c +10 -9
@@ -534,8 +534,14 @@ static void inno_hdmi_power_up(struct inno_hdmi *hdmi, unsigned long mpixelclock) {struct inno_hdmi_phy_config *phy_config; -int ret =inno_hdmi_find_phy_config (hdmi, mpixelclock); +int ret; + +inno_hdmi_sys_power (hdmi, false); + +if (!hdmi->plat_data->phy_configs) + goto out; + ret =inno_hdmi_find_phy_config (hdmi, mpixelclock);if (ret <0 ) { phy_config = hdmi->plat_data->default_phy_config; DRM_DEV_ERROR(hdmi->dev,
@@ -545,8 +551,6 @@ static void inno_hdmi_power_up(struct inno_hdmi *hdmi, phy_config = &hdmi->plat_data->phy_configs[ret]; } -inno_hdmi_sys_power (hdmi, false); -hdmi_writeb (hdmi,HDMI_PHY_PRE_EMPHASIS , phy_config->pre_emphasis);hdmi_writeb (hdmi,HDMI_PHY_DRIVER , phy_config->voltage_level_control);hdmi_writeb (hdmi,HDMI_PHY_SYS_CTL ,0x15 );
@@ -556,6 +560,7 @@ static void inno_hdmi_power_up(struct inno_hdmi *hdmi,hdmi_writeb (hdmi,HDMI_PHY_SYNC ,0x00 );hdmi_writeb (hdmi,HDMI_PHY_SYNC ,0x01 ); +out:inno_hdmi_sys_power (hdmi, true); };
@@ -832,7 +837,8 @@ static enum drm_mode_status inno_hdmi_bridge_mode_valid(struct drm_bridge *bridgif (mpixelclk <HDMI_TMDS_CHAR_RATE_MIN_HZ )return MODE_CLOCK_LOW ; -if (inno_hdmi_find_phy_config (hdmi, mpixelclk) <0 ) +if (hdmi->plat_data->phy_configs && +inno_hdmi_find_phy_config (hdmi, mpixelclk) <0 )return MODE_CLOCK_HIGH ;if (plat_ops && plat_ops->mode_valid) {
@@ -1110,11 +1116,6 @@ struct inno_hdmi *inno_hdmi_probe(struct platform_device *pdev,int irq;int ret; -if (!plat_data->phy_configs || !plat_data->default_phy_config) { -dev_err (dev,"Missing platform PHY ops\n" ); -return ERR_PTR (-ENODEV ); - } - hdmi = devm_drm_bridge_alloc(dev, struct inno_hdmi, bridge, &inno_hdmi_bridge_funcs);if (IS_ERR (hdmi))return ERR_CAST (hdmi);
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v7 12/19] drm/bridge: inno-hdmi: Make the PHY configuration table optional
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/bridge: inno-hdmi: unguarded integrated-PHY writes when phy_configs is NULL --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] drm/bridge: inno-hdmi: unguarded integrated-PHY writes when phy_configs is NULL
--
commit f1f2bae7d85c6c615ff85796724277a1cd86c36d
Author: Michal Wilczynski <[email protected]>
drm/bridge: inno-hdmi: Make the PHY configuration table optional
This commit makes plat_data->phy_configs optional so platforms with a separate PHY device skip the integrated-PHY register writes in inno_hdmi_power_up() and the table lookup in inno_hdmi_bridge_mode_valid().
Quoted 5 lines
drivers/gpu/drm/bridge/inno-hdmi.c +0
-0
drivers/gpu/drm/bridge/inno-hdmi.c static void inno_hdmi_power_up(struct inno_hdmi *hdmi, · line 542
Quoted 10 lines
drivers/gpu/drm/bridge/inno-hdmi.c +6
-1@@ -534,8 +534,14 @@ static void inno_hdmi_power_up(struct inno_hdmi *hdmi, unsigned long mpixelclock) {struct inno_hdmi_phy_config *phy_config; -int ret =inno_hdmi_find_phy_config (hdmi, mpixelclock); +int ret; + +inno_hdmi_sys_power (hdmi, false); + +if (!hdmi->plat_data->phy_configs) + goto out;
[Severity: Medium]
Should inno_hdmi_standby() and inno_hdmi_config_video_timing() also skip the integrated-PHY register writes when hdmi->plat_data->phy_configs is NULL?
inno_hdmi_standby() (called from inno_hdmi_init_hw() at probe and inno_hdmi_bridge_atomic_disable() on disable) still unconditionally writes to the same HDMI_PHY_DRIVER, HDMI_PHY_PRE_EMPHASIS, HDMI_PHY_CHG_PWR, and HDMI_PHY_SYS_CTL registers that inno_hdmi_power_up() now skips restoring. inno_hdmi_config_video_timing() likewise still writes to HDMI_PHY_PRE_DIV_RATIO, HDMI_PHY_FEEDBACK_DIV_RATIO_LOW, and HDMI_PHY_FEEDBACK_DIV_RATIO_HIGH on modeset.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=12
PATCH v7 13/19 drm/bridge: inno-hdmi: Make the register clock source selectable
In reply to Michal Wilczynskiinno_hdmi_init_hw() drives the register interface from the system clock on every platform, by setting v_REG_CLK_SOURCE_SYS unconditionally in HDMI_SYS_CTRL.
That is not right everywhere. On the JH7110 a Framework 13 (fml13v01) panel flickers continuously with the system clock selected and behaves once the TMDS clock drives the register interface instead. Maud Spierings found this by diffing HDMI_SYS_CTRL against the StarFive vendor kernel, which leaves the bit clear.
Add a plat_data flag for it rather than changing the bit for everyone. The Rockchip integrations keep the system clock, so this is a no-op for them; only a platform that asks for it gets the TMDS clock.
--- drivers/gpu/drm/bridge/inno-hdmi.c | 4 +++- include/drm/bridge/inno_hdmi.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/inno-hdmi.c +3 -1
@@ -576,7 +576,9 @@ static void inno_hdmi_init_hw(struct inno_hdmi *hdmi)usleep_range (100 ,150 ); msk = m_REG_CLK_INV | m_REG_CLK_SOURCE | m_POWER | m_INT_POL; - val = v_REG_CLK_INV | v_REG_CLK_SOURCE_SYS | v_PWR_ON | v_INT_POL_HIGH; + val = v_REG_CLK_INV | v_PWR_ON | v_INT_POL_HIGH; + val |= hdmi->plat_data->reg_clk_source_tmds ? v_REG_CLK_SOURCE_TMDS : + v_REG_CLK_SOURCE_SYS;hdmi_modb (hdmi,HDMI_SYS_CTRL , msk, val);inno_hdmi_standby (hdmi);
include/drm/bridge/inno_hdmi.h +2 -0
@@ -32,6 +32,8 @@ struct inno_hdmi_plat_data {const struct inno_hdmi_plat_ops *ops;struct inno_hdmi_phy_config *phy_configs;struct inno_hdmi_phy_config *default_phy_config; +/* Clock the register interface from the TMDS clock, not the system clock. */ +bool reg_clk_source_tmds; }; struct inno_hdmi *inno_hdmi_bind(struct platform_device *pdev,
Signature · 1 line
2.34.1
PATCH v7 14/19 drm/bridge: inno-hdmi: Make the supported HDMI version selectable
In reply to Michal Wilczynskiinno_hdmi_probe() advertises HDMI 1.2 for every integration, which caps the TMDS character rate at 165 MHz. That matches the Rockchip variants, whose PHY configuration tables stop at 165 MHz, but not every SoC that uses this controller: the StarFive JH7110 supports HDMI 1.4b and drives pixel clocks up to 297 MHz for 3840x2160 and 4096x2160 at 30 Hz.
Add a plat_data field for the supported version and keep HDMI 1.2 when it is left unset, so the Rockchip integrations are unchanged.
--- drivers/gpu/drm/bridge/inno-hdmi.c | 3 ++- include/drm/bridge/inno_hdmi.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/inno-hdmi.c +2 -1
@@ -1177,7 +1177,8 @@ struct inno_hdmi *inno_hdmi_probe(struct platform_device *pdev, hdmi->bridge.type =DRM_MODE_CONNECTOR_HDMIA ; hdmi->bridge.vendor ="Inno" ; hdmi->bridge.product ="Inno HDMI" ; - hdmi->bridge.supported_hdmi_ver =HDMI_VERSION_1_2 ; + hdmi->bridge.supported_hdmi_ver = plat_data->supported_hdmi_ver ?: +HDMI_VERSION_1_2 ; hdmi->bridge.ddc =inno_hdmi_i2c_adapter (hdmi);if (IS_ERR (hdmi->bridge.ddc))
include/drm/bridge/inno_hdmi.h +3 -0
@@ -6,6 +6,7 @@#ifndef __INNO_HDMI__#define __INNO_HDMI__ +#include <linux/hdmi.h> #include <linux/types.h> #include <drm/drm_modes.h>
@@ -34,6 +35,8 @@ struct inno_hdmi_plat_data {struct inno_hdmi_phy_config *default_phy_config;/* Clock the register interface from the TMDS clock, not the system clock. */ bool reg_clk_source_tmds; +/* HDMI version the integration supports; HDMI 1.2 if left unset. */ +enum hdmi_version supported_hdmi_ver; }; struct inno_hdmi *inno_hdmi_bind(struct platform_device *pdev,
Signature · 1 line
2.34.1
PATCH v7 15/19 soc: starfive: Add jh7110-hdmi-subsystem driver
In reply to Michal WilczynskiAdd the parent driver for the monolithic JH7110 HDMI IP block.
This driver binds to the starfive,jh7110-hdmi-subsystem node. It maps the shared register block, creates a regmap, and calls devm_of_platform_populate() to create its hdmi_phy and hdmi_controller child devices, which retrieve the shared regmap from this parent.
The NoC display bus clock and reset that gate access to this region, and the PD_VOUT power domain it sits in, are held by the video output subsystem parent for as long as this device exists, so there is nothing for this driver to bring up itself.
--- drivers/soc/starfive/Kconfig | 18 +++++++ drivers/soc/starfive/Makefile | 1 + drivers/soc/starfive/jh7110-hdmi-subsystem.c | 72 ++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+)
drivers/soc/starfive/Kconfig +18 -0
@@ -3,4 +3,22 @@ menu "StarFive SoC (System On Chip) specific Drivers" source "drivers/soc/starfive/socinfo/Kconfig" +config SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM + tristate "StarFive JH7110 HDMI subsystem driver" + depends on ARCH_STARFIVE || COMPILE_TEST + depends on OF + select REGMAP_MMIO + help + This option enables the parent driver + for the monolithic StarFive JH7110 HDMI peripheral. + + The JH7110 HDMI IP block contains both the digital controller + (DRM bridge) and the analog PHY (clock/phy provider) logic within + a single shared register space. + + This driver acts as a wrapper. Its only job is to map the + shared registers and create separate logical child devices + for the "PHY" and the "controller", which have their own clocks + and roles but share the register space. + endmenu
drivers/soc/starfive/Makefile +1 -0
@@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only obj-y += socinfo/ +obj-$(CONFIG_SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM) += jh7110-hdmi-subsystem.o
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +72 -0
72 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v7 15/19] soc: starfive: Add jh7110-hdmi-subsystem driver
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] soc: starfive: wrong regmap stride and val_bits in jh7110-hdmi-subsystem --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] soc: starfive: wrong regmap stride and val_bits in jh7110-hdmi-subsystem
--
commit 7b3e8ed6b5c2397fee05f3afbf224c172c611228
Author: Michal Wilczynski <[email protected]>
soc: starfive: Add jh7110-hdmi-subsystem driver
This commit adds a platform driver for the StarFive JH7110 HDMI subsystem that initializes a shared MMIO regmap and populates the child HDMI PHY and controller devices.
Quoted 6 lines
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +0
-0@@ -0,0 +1,72 @@
[ ... ]
drivers/soc/starfive/jh7110-hdmi-subsystem.c line 23
Quoted 5 lines
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +5
-0+static const struct regmap_config starfive_hdmi_regmap_config = { + .reg_bits =32 , + .val_bits =8 , + .max_register =0x3fff , +};
[Severity: Medium]
Should starfive_hdmi_regmap_config set .val_bits = 32, .reg_stride = 4, and .max_register = 0x3ffc to match the 4-byte register layout expected by the child drivers?
Both the HDMI controller and PHY drivers address this shared regmap at 4-byte-strided offsets (offset * 4 and reg * 4), and the controller's own inno_hdmi_regmap_config uses 32-bit values with a 4-byte stride:
drivers/gpu/drm/bridge/inno-hdmi.c:
static const struct regmap_config inno_hdmi_regmap_config = {
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
};
static inline u8 hdmi_readb(struct inno_hdmi *hdmi, u16 offset)
{
u32 val;
if (regmap_read(hdmi->regmap, offset * 4, &val))
return 0;
return val;
}With .val_bits = 8 and .reg_stride left at its default of 1, regmap_mmio uses readb()/writeb() instead of 32-bit MMIO accessors, does not check 4-byte register alignment, and steps through 0x0000..0x3fff byte-by-byte in regmap debugfs, issuing unaligned byte reads to the upper three bytes of every 32-bit register word.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=15
PATCH v7 16/19 soc: starfive: Add jh7110-vout-subsystem driver
In reply to Michal WilczynskiNothing in the video output subsystem can reach its own registers until the NoC display bus clock and reset are up and PD_VOUT is powered, and those are shared by every device in the region. Leaving them to whichever consumer probes first works by accident and stops working as soon as the probe order changes.
Add a driver for the subsystem node that takes the bus clock and reset, holds a runtime PM reference so genpd keeps PD_VOUT powered, and then populates its children. All three are released only once the last child is gone.
--- drivers/soc/starfive/Kconfig | 16 ++++++ drivers/soc/starfive/Makefile | 1 + drivers/soc/starfive/jh7110-vout-subsystem.c | 82 ++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+)
drivers/soc/starfive/Kconfig +16 -0
@@ -21,4 +21,20 @@ config SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM for the "PHY" and the "controller", which have their own clocks and roles but share the register space. +config SOC_STARFIVE_JH7110_VOUT_SUBSYSTEM + tristate "StarFive JH7110 video output subsystem driver" + depends on ARCH_STARFIVE || COMPILE_TEST + depends on OF + select PM + help + This option enables the parent driver for the StarFive JH7110 + video output subsystem, which the documentation calls dom_vout_top. + + The subsystem covers the DC8200 display controller, the HDMI + transmitter, the video output clock generator and the video output + system controller. They share one NoC port whose clock and reset + gate access to the whole register region, and the region sits in + the PD_VOUT power domain. This driver owns those resources and + holds them for as long as any of its children exist. + endmenu
drivers/soc/starfive/Makefile +1 -0
@@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only obj-y += socinfo/ obj-$(CONFIG_SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM) += jh7110-hdmi-subsystem.o +obj-$(CONFIG_SOC_STARFIVE_JH7110_VOUT_SUBSYSTEM) += jh7110-vout-subsystem.o
drivers/soc/starfive/jh7110-vout-subsystem.c new file +82 -0
82 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v7 17/19 drm/bridge: starfive: Add JH7110 HDMI controller driver
In reply to Michal WilczynskiAdd the HDMI controller (bridge) driver for the StarFive JH7110.
This driver binds to the starfive,jh7110-inno-hdmi-controller node. It gets its register access, module and bus clocks from voutcrg, and consumes the pixel clock and the PHY from its hdmi_phy sibling.
The driver calls the generic inno_hdmi_probe function, which picks up the regmap shared with the PHY from the parent device and registers a DRM bridge. The .enable hook is responsible for setting the PHY's pixel clock rate via clk_set_rate() and powering on the PHY via phy_power_on().
The DC8200 has two panels, each exposing a DP and a DPI interface, and a mux in the video output system controller picks which of them drives the HDMI transmitter. It comes out of reset on panel 0 / DPI, which happens to be what the default wiring needs, so nothing has had to program it so far. Derive it from the port graph instead, taking the panel from the remote port number and the interface from the remote endpoint number, so that a board describing a different output is honoured.
The generic driver holds the clock it looks up as the register access clock enabled for its lifetime, and derives the DDC divider from that clock's rate, so point it at the system clock. Naming the pixel clock there instead would keep the PHY pre-PLL powered from probe onwards and size the divider from the wrong rate.
The PHY can only generate the discrete set of pixel clocks described by its pre-PLL table, so .mode_valid rejects any mode clk_round_rate() cannot satisfy. Without it such a mode would be advertised to userspace and the modeset would appear to succeed while the display stayed blank.
.enable returns early when the rate is unsupported or the PHY fails to power on, so track whether the pixel clock was actually enabled and let .disable tear down only what was brought up, otherwise the clock refcount underflows.
The clocks and the reset are torn down through devm rather than from .remove, so that they outlive the bridge that inno_hdmi_probe() adds with devm_drm_bridge_add(). Releasing them in .remove runs before devres unwinds and would leave the bridge registered with its clocks already gated.
--- drivers/gpu/drm/bridge/Kconfig | 11 ++ drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/jh7110-inno-hdmi.c | 297 ++++++++++++++++++++++++++++++ 3 files changed, 309 insertions(+)
drivers/gpu/drm/bridge/Kconfig +11 -0
@@ -357,6 +357,17 @@ config DRM_SOLOMON_SSD2825 Say M here if you want to support this hardware as a module. The module will be named "ssd2825". +config DRM_STARFIVE_JH7110_INNO_HDMI + tristate "Starfive JH7110 Innosilicon HDMI bridge" + depends on OF + depends on ARCH_STARFIVE || COMPILE_TEST + select DRM_INNO_HDMI + help + Enable support for the StarFive JH7110 specific implementation + of the Innosilicon HDMI controller. + This driver acts as a glue layer between the JH7110 HDMI subsystem + parent driver and the generic Innosilicon HDMI bridge driver. + config DRM_THINE_THC63LVD1024 tristate "Thine THC63LVD1024 LVDS decoder bridge" depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o obj-$(CONFIG_DRM_SII902X) += sii902x.o obj-$(CONFIG_DRM_SII9234) += sii9234.o obj-$(CONFIG_DRM_SIMPLE_BRIDGE) += simple-bridge.o +obj-$(CONFIG_DRM_STARFIVE_JH7110_INNO_HDMI) += jh7110-inno-hdmi.o obj-$(CONFIG_DRM_SOLOMON_SSD2825) += ssd2825.o obj-$(CONFIG_DRM_THEAD_TH1520_DW_HDMI) += th1520-dw-hdmi.o obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +297 -0
297 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v7 18/19 riscv: dts: starfive: jh7110: Update DT for display subsystem
In reply to Michal WilczynskiActivate the display subsystem by describing the video output subsystem, which the documentation calls dom_vout_top, as a bus node covering the whole 0x29400000 region, with dc8200, the HDMI block, the video output system controller and voutcrg as its children.
The subsystem node owns the resources its children share: the NoC display bus clock and reset that gate access to every register in the region, and the PD_VOUT power domain. Modelling it this way keeps a shared gate owned by the block that shares it, and lets dc8200 inherit dma-noncoherent for framebuffer DMA from the bus it sits on.
The monolithic hdmi node is in turn modelled as a container with hdmi_phy and hdmi_controller children, which share its register window: the PHY takes only xin24m and provides the pixel clock and the phy, while the controller takes its clocks from voutcrg.
voutcrg consumes the pixel clock from the &hdmi_phy node instead of the old fixed-clock, and dc8200 gets its pixel clocks from voutcrg's MUXes. The old, incorrect hdmitx0-pixel-clock fixed-clock node is removed.
The HDMI controller gets a phandle to the video output system controller, which holds the mux selecting the DC8200 output that drives the HDMI transmitter.
CMA is enlarged and constrained to memory the display controller can address, because the default pool is too small for its framebuffers.
--- arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 121 +++++++++++++++++++++++- arch/riscv/boot/dts/starfive/jh7110.dtsi | 105 ++++++++++++++++---- 2 files changed, 203 insertions(+), 23 deletions(-)
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +119 -2
@@ -33,6 +33,27 @@ memory@40000000 { bootph-pre-ram; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* + * The display controller allocates its framebuffers from CMA, + * and the default pool is too small for them. Keep the pool + * inside the range the controller can address; it fits in the + * memory every VisionFive 2 variant has. + */ + linux,cma { + compatible = "shared-dma-pool"; + reusable; + size = <0x0 0x20000000>; + alignment = <0x0 0x1000>; + alloc-ranges = <0x0 0x70000000 0x0 0x20000000>; + linux,cma-default; + }; + }; + gpio-restart { compatible = "gpio-restart"; gpios = <&sysgpio 35 GPIO_ACTIVE_HIGH>;
@@ -73,12 +94,47 @@ codec { }; }; }; + + hdmi-connector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; }; &cpus { timebase-frequency = <4000000>; }; +&dc8200 { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dpu_port0: port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + dpu_out_dpi0: endpoint@0 { + reg = <0>; + remote-endpoint = <&hdmi_in>; + }; + }; + + dpu_port1: port@1 { + reg = <1>; + }; + }; +}; + &dvp_clk { clock-frequency = <74250000>; };
@@ -99,8 +155,31 @@ &gmac1_rmii_refin { clock-frequency = <50000000>; }; -&hdmitx0_pixelclk { - clock-frequency = <297000000>; +&hdmi_controller { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&hdmi_pins>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + hdmi_in: endpoint { + remote-endpoint = <&dpu_out_dpi0>; + }; + }; + + hdmi_out_port: port@1 { + reg = <1>; + + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; + }; + }; }; &i2srx_bclk_ext {
@@ -356,6 +435,40 @@ &syscrg { }; &sysgpio { + hdmi_pins: hdmi-0 { + hdmi-cec-pins { + pinmux = <GPIOMUX(14, GPOUT_SYS_HDMI_CEC_SDA, + GPOEN_SYS_HDMI_CEC_SDA, + GPI_SYS_HDMI_CEC_SDA)>; + input-enable; + bias-pull-up; + }; + + hdmi-hpd-pins { + pinmux = <GPIOMUX(15, GPOUT_LOW, + GPOEN_DISABLE, + GPI_SYS_HDMI_HPD)>; + input-enable; + bias-disable; /* external pull-up */ + }; + + hdmi-scl-pins { + pinmux = <GPIOMUX(0, GPOUT_SYS_HDMI_DDC_SCL, + GPOEN_SYS_HDMI_DDC_SCL, + GPI_SYS_HDMI_DDC_SCL)>; + input-enable; + bias-pull-up; + }; + + hdmi-sda-pins { + pinmux = <GPIOMUX(1, GPOUT_SYS_HDMI_DDC_SDA, + GPOEN_SYS_HDMI_DDC_SDA, + GPI_SYS_HDMI_DDC_SDA)>; + input-enable; + bias-pull-up; + }; + }; + i2c0_pins: i2c0-0 { i2c-pins { pinmux = <GPIOMUX(57, GPOUT_LOW,
@@ -644,3 +757,7 @@ &U74_3 { &U74_4 { cpu-supply = <&vdd_cpu>; }; + +&voutcrg { + status = "okay"; +};
arch/riscv/boot/dts/starfive/jh7110.dtsi +84 -21
124 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v7 18/19] riscv: dts: starfive: jh7110: Update DT for display subsystem
Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [High] riscv: dts: starfive: CMA alloc-ranges in jh7110-common.dtsi breaks 1 GiB RAM - [Low] riscv: dts…
Thank you for your contribution! Sashiko AI review found 3 potential issues to consider:
- [High] riscv: dts: starfive: CMA alloc-ranges in jh7110-common.dtsi breaks 1 GiB RAM
- [Low] riscv: dts: starfive: missing status disabled on jh7110.dtsi display nodes
- [Low] riscv: dts: starfive: duplicate 24 MHz xin24m clock node in jh7110.dtsi
--
commit e4e97f0b932284258aa4795e30b6380ab560afa7
Author: Michal Wilczynski <[email protected]>
riscv: dts: starfive: jh7110: Update DT for display subsystem
This commit describes the JH7110 video output subsystem, DC8200 display controller, HDMI controller and PHY in the SoC device tree, and enables the display pipeline with a 512 MiB default CMA pool in the common board device tree.
Quoted 18 lines
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +10
-0@@ -33,6 +33,27 @@ memory@40000000 { bootph-pre-ram; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* + * The display controller allocates its framebuffers from CMA, + * and the default pool is too small for them. Keep the pool + * inside the range the controller can address; it fits in the + * memory every VisionFive 2 variant has.
arch/riscv/boot/dts/starfive/jh7110-common.dtsi memory@40000000 { · line 55
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +10
-0+ */ + linux,cma { + compatible = "shared-dma-pool"; + reusable; + size = <0x0 0x20000000>; + alignment = <0x0 0x1000>; + alloc-ranges = <0x0 0x70000000 0x0 0x20000000>; + linux,cma-default; + }; + };
[Severity: High]
Does this alloc-ranges setting cause linux,cma reservation to fail on 1 GiB JH7110 boards, or whenever an earlier reservation overlaps 0x70000000.. 0x90000000?
jh7110-common.dtsi is also included by 1 GiB boards such as Milk-V Mars and Mars CM, where physical RAM at 0x40000000..0x80000000 only covers 256 MiB of the 0x70000000..0x90000000 window, so __reserved_mem_alloc_size() fails with -ENOMEM and leaves the system without a default CMA pool. Because the window size equals the 512 MiB allocation size with no slack, any bootloader or initrd reservation in 0x70000000..0x90000000 also causes CMA allocation to fail on larger boards even though DC8200 uses a 32-bit DMA mask and can address any RAM below 0x100000000.
[ ... ]
Quoted 12 lines
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +4
-0@@ -644,3 +757,7 @@ &U74_3 { &U74_4 { cpu-supply = <&vdd_cpu>; }; + +&voutcrg { + status = "okay"; +};arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-0
[ ... ]
arch/riscv/boot/dts/starfive/jh7110.dtsi tdm_ext: tdm-ext-clock { · line 354
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +6
-0@@ -352,6 +346,13 @@ tdm_ext: tdm-ext-clock { #clock-cells = <0>; }; + xin24m: xin24m-clock { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + clock-output-names = "xin24m"; + };
[Severity: Low]
Can hdmi_phy use the existing <&osc> node in jh7110.dtsi instead of adding a duplicate 24 MHz xin24m fixed-clock node?
jh7110.dtsi already defines the 24 MHz reference crystal as osc: oscillator (with its frequency set in jh7110-common.dtsi), and neither the starfive,jh7110-inno-hdmi-phy binding nor starfive_hdmi_phy_probe() requires the clock to be named xin24m.
Quoted 56 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +36
-15@@ -1262,22 +1263,84 @@ csi_phy: phy@19820000 { #phy-cells = <0>; }; - voutcrg: clock-controller@295c0000 { - compatible = "starfive,jh7110-voutcrg"; - reg = <0x0 0x295c0000 0x0 0x10000>; - clocks = <&syscrg JH7110_SYSCLK_VOUT_SRC>, - <&syscrg JH7110_SYSCLK_VOUT_TOP_AHB>, - <&syscrg JH7110_SYSCLK_VOUT_TOP_AXI>, - <&syscrg JH7110_SYSCLK_VOUT_TOP_HDMITX0_MCLK>, - <&syscrg JH7110_SYSCLK_I2STX0_BCLK>, - <&hdmitx0_pixelclk>; - clock-names = "vout_src", "vout_top_ahb", - "vout_top_axi", "vout_top_hdmitx0_mclk", - "i2stx0_bclk", "hdmitx0_pixelclk"; - resets = <&syscrg JH7110_SYSRST_VOUT_TOP_SRC>; - #clock-cells = <1>; - #reset-cells = <1>; + vout_subsystem: display-subsystem@29400000 { + compatible = "starfive,jh7110-vout-subsystem"; + reg = <0x0 0x29400000 0x0 0x200000>; + ranges; + #address-cells = <2>; + #size-cells = <2>; + clocks = <&syscrg JH7110_SYSCLK_NOC_BUS_DISP_AXI>; + dma-noncoherent; power-domains = <&pwrc JH7110_PD_VOUT>; + resets = <&syscrg JH7110_SYSRST_NOC_BUS_DISP_AXI>; + + dc8200: display@29400000 { + compatible = "starfive,jh7110-dc8200", "verisilicon,dc"; + reg = <0x0 0x29400000 0x0 0x2800>; + clocks = <&voutcrg JH7110_VOUTCLK_DC8200_CORE>, + <&voutcrg JH7110_VOUTCLK_DC8200_AXI>, + <&voutcrg JH7110_VOUTCLK_DC8200_AHB>, + <&voutcrg JH7110_VOUTCLK_DC8200_PIX0>, + <&voutcrg JH7110_VOUTCLK_DC8200_PIX1>; + clock-names = "core", "axi", "ahb", "pix0", "pix1"; + assigned-clocks = <&voutcrg JH7110_VOUTCLK_DC8200_PIX0>, + <&voutcrg JH7110_VOUTCLK_DC8200_PIX1>; + assigned-clock-parents = <&hdmi_phy>, <&hdmi_phy>; + interrupts = <95>; + resets = <&voutcrg JH7110_VOUTRST_DC8200_CORE>, + <&voutcrg JH7110_VOUTRST_DC8200_AXI>, + <&voutcrg JH7110_VOUTRST_DC8200_AHB>; + reset-names = "core", "axi", "ahb"; + }; + + hdmi_subsystem: hdmi@29590000 { + compatible = "starfive,jh7110-hdmi-subsystem"; + reg = <0x0 0x29590000 0x0 0x4000>; + + hdmi_controller: controller { + compatible = + "starfive,jh7110-inno-hdmi-controller";
arch/riscv/boot/dts/starfive/jh7110.dtsi csi_phy: phy@19820000 { · line 1312
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +10
-0+ clocks = <&voutcrg JH7110_VOUTCLK_HDMI_TX_SYS>, + <&voutcrg JH7110_VOUTCLK_HDMI_TX_MCLK>, + <&voutcrg JH7110_VOUTCLK_HDMI_TX_BCLK>, + <&hdmi_phy>; + clock-names = "pclk", "mclk", "bclk", "pixel"; + interrupts = <99>; + phys = <&hdmi_phy>; + resets = <&voutcrg JH7110_VOUTRST_HDMI_TX_HDMI>; + starfive,vout-syscon = <&vout_syscon>; + };
[Severity: Low]
Should dc8200 and hdmi_controller have status = "disabled" in jh7110.dtsi, and should the &voutcrg override in jh7110-common.dtsi be dropped?
Both dc8200 and hdmi_controller require board-specific port graphs and pinctrl properties that are only populated in jh7110-common.dtsi (which explicitly sets status = "okay" on both nodes), so leaving them enabled by default in jh7110.dtsi leaves them incomplete for any board not using jh7110-common.dtsi. Conversely, voutcrg is never disabled in jh7110.dtsi, so the &voutcrg block setting status = "okay" in jh7110-common.dtsi has no effect.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=18
PATCH v7 19/19 MAINTAINERS: Add StarFive JH7110 display subsystem entry
In reply to Michal WilczynskiThe JH7110 display subsystem spans a PHY driver, a DRM bridge driver, a parent device and their bindings, and has no existing maintainer entry.
Add an entry covering them so patches reach someone who can review them.
--- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+)
MAINTAINERS +11 -0
@@ -26718,6 +26718,17 @@ S: Maintained F: Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml F: drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c +STARFIVE JH7110 DISPLAY SUBSYSTEM +M: Michal Wilczynski <[email protected]> +R: Icenowy Zheng <[email protected]> +S: Maintained +F: Documentation/devicetree/bindings/display/bridge/starfive,jh7110-inno-hdmi-controller.yaml +F: Documentation/devicetree/bindings/display/starfive/starfive,jh7110-hdmi-subsystem.yaml +F: Documentation/devicetree/bindings/display/starfive/starfive,jh7110-vout-subsystem.yaml +F: drivers/gpu/drm/bridge/jh7110-inno-hdmi.c +F: drivers/soc/starfive/jh7110-hdmi-subsystem.c +F: drivers/soc/starfive/jh7110-vout-subsystem.c + STARFIVE JH7110 DPHY RX DRIVER M: Jack Zhu <[email protected]> M: Changhuang Liang <[email protected]>
Signature · 1 line
2.34.1
Tested on a VisionFive 2 v1.3B with this series and the v7 PHY series on next-20261105. All 24 modes the sink advertises set with modetest, from 1920x1080@60 down to 640x480, including the mixed sync polarity modes [email protected], [email protected] and [email protected], with nothing in dmesg.
One thing outside this series: the modetest pattern showed small black bars until I wrote 200 MB of other data, which pushed the pattern out of the CPU cache into memory, after which it was clean. The U74 has no Svpbmt, so the dumb buffer mapping stays cached here. My v5 run had the SiFive uncached-alias errata patches applied and did not show it.
Quoted 363 lines · Michal Wilczynski
This series enables the display subsystem on the StarFive JH7110.
Merging: the series splits by subsystem, there is no build dependency between the blocks, and each block lands in the tree that already owns those files:
drm-misc 1-3, 6, 8-14, 17
drivers/gpu/drm/bridge/,include/drm/bridge/and the display bindings. Patches 1 and 2 are inno-hdmi fixes with Fixes: tags; they apply to Rockchip as much as to StarFive and are independent of the rest, so they can go on their own.Conor's tree 4, 5, 7, 15-16, 18
drivers/soc/starfive/, together with
the bindings for its two drivers (patches 4 and 7, under bindings/display/starfive/) and the vout-syscon compatible in bindings/soc/starfive/ (STARFIVE SOC DRIVERS), andarch/riscv/boot/dts/starfive/(STARFIVE DEVICETREES).- 19
MAINTAINERS.The PHY patches are now a separate series for linux-phy, as Vinod
suggested: "phy: Add the StarFive JH7110 Innosilicon HDMI PHY" [1]. This series depends on it, and the DT needs the PHY driver at runtime. There is no build dependency.[1] https://lore.kernel.org/all/[email protected]/
Ordering: patch 4 references the bindings from patch 3 and the PHY series, the example in patch 7 instantiates nodes from patches 3 and 6 and the PHY series, and the DT in patch 18 uses all of them. Patches 4, 7 and 18 therefore need the drm-misc bindings and the PHY series in place to pass
dt_binding_checkanddtbs_check. Patches 5, 15 and 16 have no such dependency.There are no out-of-tree dependencies: the dc8200 driver, the th1520 reset controller and the inno-hdmi bridge that the RFC listed as prerequisites are all upstream now.
The clk patch that was 14/20 in v4 went in through the clk tree and is in v7.4-rc1 (
af384d6e0573). The DT patch needs it at runtime for the pixel MUXes to follow the PHY.The
dom_voutblock holds the display controller (dc8200), the clock generator (voutcrg) and the HDMI IP, all insidePD_VOUT. The HDMI IP is a single register block containing both the controller and the PHY, which are described as separate children because they have separate resources:- the PHY takes only the 24 MHz reference clock, and provides the pixel clock that voutcrg routes on to the dc8200 pixel MUXes, and the phy the controller uses
- the controller takes pclk/mclk/bclk from voutcrgIt is the same Innosilicon PHY that the RK3328 describes as its own hdmiphy node; here it shares a register window with the controller.
The parent maps the register block and owns the regmap its two children share. Everything in the region sits behind one NoC port whose clock and reset gate access to it, inside
PD_VOUT, so the vout subsystem node from the RFC is back and owns those for as long as any child exists.Patch 11 adds a .mode_valid platform op to inno-hdmi.
inno_hdmi_bridge_mode_valid()checks the pixel clock againsthdmi->refclk, but that clock only exists where a "ref" clock is described. The JH7110 gets its pixel clock from the PHY, so refclk is NULL and the check was skipped: unsupported modes were advertised, the modeset then "succeeded" because the atomic enable path cannot fail, and the display stayed blank.Patch 12 makes the inno-hdmi PHY configuration table optional. The JH7110 drives its PHY through a separate driver, so the table only ever existed to get past a probe time check, and the register writes it fed belong to the integrated PHY the JH7110 does not have.
Patch 14 makes the HDMI version inno-hdmi advertises selectable. Since v7.4-rc1 it advertises HDMI 1.2 for every integration, which caps the TMDS character rate at 165 MHz. That fits Rockchip, but on the JH7110, which supports HDMI 1.4b, it hid all eight 3840x2160 and 4096x2160 modes. Rockchip keeps HDMI 1.2.
Patches 1, 2 and 8-14 change the inno-hdmi bridge, which the Rockchip RK3036 and RK3128 use as well. Patch 9 moves its register access to a regmap, Rockchip included. I have no Rockchip hardware, so on Rockchip they are build tested only (arm and riscv). A Tested-by would help.
Testing
=======Tested on a VisionFive 2 v1.3B using modetest, with the PHY series applied.
All 42 modes the sink advertises work, with nothing in dmesg. Pixel clocks run from 25.175 MHz ([email protected]) up to 297 MHz (4096x2160@30), including 3840x2160 and the full 1920x1080 and 1280x720 rate families.
The four modes the RFC reported as broken work now too: [email protected], [email protected], [email protected] and [email protected].
Before patch 11, four of the advertised modes failed: [email protected] (146.250 MHz), [email protected] (121.750), [email protected] (81.768) and [email protected] (80.140). Those pixel clocks are not in the PHY pre-PLL table, so
clk_set_rate()returned-EINVALand the screen stayed black while userspace saw a successful modeset. They are rejected in .mode_valid now; the other refresh rates of those resolutions still work.The mux the HDMI controller programs in
dom_vout_sysconhas a DP and a DPI branch, and the DT wires the DPI one, so the DP branch was checked separately by moving the input endpoint to the DC8200's DP output on a throwaway branch.SYSCFG_4reads0x4c0b0000instead of0x0c0b0000, the output is identical to the DPI path and all 42 modes set. SweepingVOUT_HDMI_DP_YUV_MODEover its four values with a mode held shows only RGB giving a correct picture, as documented.Every commit builds for riscv, and the Rockchip inno-hdmi glue also for arm.
Notes
=====The JH7110 has no central
MAINTAINERSentry and maintainership is fragmented, so patch 19 adds one for the display subsystem and I am happy to help maintain it. The PHY series adds its own entry for the JH7110 HDMI PHY.checkpatch warns "does
MAINTAINERSneed updating?" on the patches adding files, because that entry comes in patch 19.Thanks to Icenowy Zheng for the dc8200 driver and for explaining how the SoC and the display pipeline fit together.
Thanks also to Dominique Belhachemi, who got rid of the vout-subsystem wrapper and helped with the testing, to Maud Spierings for testing on a Framework 13 panel, to Byron Stanoszek and OOHehir for testing v5, and to Graham Markall for testing the JH7110 display patches independently and writing up the results:
https://big-grey.co.uk/2026/01/26/testing-starfive-jh7110-display-controller-patches/Link to v1: https://lore.kernel.org/all/[email protected]/
---
Changes in v7:
- Moved the hdmi-subsystem and vout-subsystem bindings from bindings/soc/starfive/ to bindings/display/starfive/ (Conor)
- inno-hdmi: access the registers only through a regmap, the parent's
or an MMIO one over the controller's own resource, instead of keeping
two register paths (Heiko). Patch 9 is renamed to "Use a regmap for
register access" and drops its Reviewed-by and Tested-by tags, since
the Rockchip path changed
- Trimmed the comment in the NULLdrm_devicefix (Heiko)
- Collected Heiko's Reviewed-by on patches 1 and 2
- Rebased onto v7.4-rc1, which has the clk patch and now createsdrivers/soc/starfive/itself, so patches 15 and 16 add theirKconfig
entries to its existing menu
- New patch 14 makes the advertised HDMI version selectable, and the
JH7110 advertises HDMI 1.4. The HDMI 1.2 that v7.4-rc1 advertises for
every inno-hdmi user hid the 3840x2160 and 4096x2160 modes
- Link to v6: https://lore.kernel.org/r/[email protected]Changes in v6:
- Split the PHY patches into their own series (Vinod)
- New patch 2: the hotplug NULLdrm_deviceguard is split out of "Split
probe out of bind" into its own patch (Heiko)
-inno_hdmi_bind()takes aplatform_device, likedw_hdmi_bind()(Heiko)
- Describe the HDMI PHY node by its resources rather than by the probe
cycle, in the commit messages and theKconfighelp (Krzysztof)
- Rebased onto v7.3, collected tags
- Link to v5: https://lore.kernel.org/r/[email protected]Changes in v5:
- Rebased onto v7.3-rc5.
- Dropped the clk patch, applied asaf384d6e0573.
- New patch 13 makes theHDMI_SYS_CTRLregister clock source selectable
per platform, and the JH7110 selects the TMDS clock. The driver drove
the register interface from the system clock for everyone, and a
Framework 13 panel flickers continuously that way (Maud Spierings).
Rockchip keeps the system clock, so this is a no-op there. This was
listed as a known limitation in v4.
- New patch 1 fixesv_HSYNC_POLARITYandv_VSYNC_POLARITY, which have
been swapped in inno-hdmi since the driver was merged. The hardware
puts HSYNC in bit 2 and VSYNC in bit 3, and the driver had them the
other way round. Almost all CEA modes drive both syncs with the same
polarity, so the two writes are indistinguishable and the bug only
shows on a mode whose polarities differ - a band of black rows at the
top of the screen,vsync_end-vsync_start+ 1 rows tall. Reported independently by Dominique Belhachemi, Maud Spierings and Byron
Stanoszek, and confirmed against the RK3128 TRM by Icenowy Zheng, so
this is a Rockchip fix too.
- Added a 201 MHz entry to the JH7110 pre-PLL table for a 2560x1440
mode Byron Stanoszek runs on a Dell U2711. It is derived the same way
as the neighbouring entries (fbdiv 134, /16, VCO 3.216 GHz) but I have
no sink that asks for it, so it is untested on my hardware.
- Moved the hdmi-subsystem binding from bindings/mfd/ to
bindings/soc/starfive/, next to the vout-subsystem binding and matching
its driver indrivers/soc/starfive/. The mfd/ path was left over from
when the driver was called hdmi-mfd; nothing in the series is an MFD
device, and it meant one isolated binding patch would have had to go
through the MFD tree on its own.
- The commit message for "Split probe out of bind" claimed a matchinginno_hdmi_remove(); no such function exists, so the claim is gone.
- Dropped Joshua Peisach's Reviewed-by from the PHY driver patch as well,
since that patch changed in v5.
- Dropped Joshua Peisach's Reviewed-by from the binding patches; he said
he is not reviewing DT (Krzysztof Kozlowski). It is kept on the driver
patches he did look at.
- Removed a probe-timeclk_set_rate()from the PHY driver. It programmed
a default rate, and .set_rate writes PHY registers that live in the
window gated by the controller's system clock - a clock the PHY cannot
hold without creating a probe cycle with voutcrg.
- Link to v4: https://lore.kernel.org/r/[email protected]Changes in v4:
- New patch 11 makes the inno-hdmi PHY configuration table optional, so
the JH7110 controller can drop the dummy two entry table it carried
only to satisfy the probe time check, along with the integrated PHY
register writes that table fed (Icenowy Zheng). That table was also
acting as an upper bound:inno_hdmi_find_phy_config()runs before the
platform .mode_valid and returns early, so its 297 MHz sentinel
rejected every mode above that even though the PHY pre-PLL table has a
594 MHz entry. Nothing here advertises such a mode, so it was latent.
- Fixed a v3 regression:CLK_SET_RATE_NO_REPARENTstopsclk_set_rate()
from reparenting the dc8200 pixel MUXes, so they kept whatever the
bootloader had selected and the display stayed black on boards where
that was not the HDMI PHY. They get assigned-clock-parents now (Maud Spierings, Dominique Belhachemi).
- vout-subsystem binding: describe the children by compatible instead of
$ref, as qcom,sm8750-mdss does, and show the whole subsystem with all
four children in the example (Krzysztof Kozlowski).
- Dropped the vout-syscon example from starfive,jh7110-syscon.yaml, it
is part of the vout subsystem example now (Krzysztof Kozlowski).
- Renamed the xin24m node to xin24m-clock (Krzysztof Kozlowski).
- Fixed the HDMI HPD pinmux: it drove the pin high (GPOUT_HIGHwith the
output enabled) while also reading it as the hotplug input, so HPD
could only ever read asserted. It is an input now.
- jh7110-inno-hdmi: dropped a regmap lookup whose result was never used;inno_hdmi_probe()fetches the parent regmap itself. The commit message
claimed otherwise and is corrected.
- phy: rockchip: dropped two now unused RK3328 spread spectrum macros
the v3 cleanup missed. The register write itself moved to the shared
helper and is unchanged, so Chaoyi's Reviewed-by is carried over.
- inno-hdmi: the hotplug handler dereferenced bridge.dev unconditionally. Splitting probe out of bind moved the interrupt request to probe, so
an HPD event before the DRM master attaches the bridge would oops.
Guarded.
- Dropped the <linux/mod_devicetable.h> includes (Uwe Kleine-König).
- jh7110-inno-hdmi:__free(device_node)for the graph lookups, and
dropped the redundant negative check onclk_round_rate()(Chaoyi Chen).
- phy: rockchip: dropped therecalc_ratedebug print that the shared
helper already emits (Chaoyi Chen).
- Rebased onto v7.3-rc3.
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- Brought back the vout subsystem node and driver, now owning the NoC
bus clock, its reset andPD_VOUTfor the whole region, with dc8200,
the HDMI block, the syscon and voutcrg as its children (Icenowy Zheng).
- Fixed a hard hang when the bridge is built as a module: the PHY's
.is_prepared read a register in the window gated by the controller's
system clock, soclk_disable_unused()wedged the CPU before the
controller had bound. The op is gone; the framework uses the software
prepare count instead. (Marek Szyprowski)
- The HDMI controller now programs the display mux indom_vout_syscon
from the port graph rather than inheriting whatever the bootloader
left, with a phandle to the syscon (Icenowy Zheng).
- The register access clock is named "pclk" to match the existing
inno-hdmi binding, so the generic driver no longer picks up the pixel
clock. Previously it held the pre-PLL powered from probe and sized the
DDC divider from the wrong rate.
- Dropped the clk suffixes and the single-entry -names properties from
the bindings (Conor Dooley). mclk and bclk keep their names: per TRM
5.3 they are the HDMI audio clocks, not module and bus clocks, so the descriptions say that instead.
- Replaced patternProperties with plain properties in the hdmi-subsystem
binding (Conor Dooley).
- dc8200 gets an SoC specific compatible, and inherits dma-noncoherent
from the subsystem bus node, so it validates against verisilicon,dc.
- Added the pre-PLL entry for the Framework 13 panel and fixed two
devicetree whitespace nits (Maud Spierings).
- selectREGMAP_MMIO,CLK_SET_RATE_NO_REPARENTon the dc8200 pixel MUXes
soclk_set_rate()cannot reroute them, and inno-hdmi register reads
return 0 instead of stack garbage whenregmap_read()fails.
- phy: rockchip: dropped the local pre-PLL lookup wrapper and the 28 now
unused RK3328 pre-PLL macros, and restored the VCO debug output, this
time in the shared helper so both drivers get it (Jonas Karlman).
- Rebased onto v7.3-rc1.
- Link to v2: https://lore.kernel.org/r/[email protected]Changes since the RFC:
- Dropped the vout-subsystem wrapper driver and its binding, along with the patch relaxing the voutcrg binding; genpd handlesPD_VOUTper node.
- Renamed the compatible to starfive,jh7110-hdmi-subsystem, dropping "mfd" as a Linux term (Conor Dooley).
- Absolute $refs in the bindings, unused example labels dropped, and the examples deduplicated between parent and children (Conor Dooley).
- Added the .mode_valid platform operation (patch 7).
- Split the inno-hdmi rework into a mechanical probe/bind split (patch
4)
and the regmap-from-parent change (patch 5). structinno_hdmiis no longer exported; no platform glue dereferences it.
- Replaced the duplicated PHY driver with a shared Innosilicon library and moved Rockchip onto it (patches 11-13).
- Fixed pre-PLL lock detection, which masked the status read with the register address instead of the lock bit.
- Fixed a pixel clock refcount underflow: enable returns early on failure while disable tore down unconditionally.
- voutcrg patch reduced to addingCLK_SET_RATE_PARENTto the two dc8200 pixel MUXes.
- Rebased onto v7.2.---
Michal Wilczynski (19):
drm/bridge: inno-hdmi: fix swapped HSYNC and VSYNC polarity drm/bridge: inno-hdmi: Don't dereference a NULLdrm_deviceon hotplug
dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller
dt-bindings: display: starfive: Add starfive,jh7110-hdmi-subsystem
dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
dt-bindings: display: starfive: Add starfive,jh7110-vout-subsystem drm/bridge: inno-hdmi: Split probe out of bind
drm/bridge: inno-hdmi: Use a regmap for register access drm/bridge: inno-hdmi: Add .disable platform operation drm/bridge: inno-hdmi: Add .mode_valid platform operation drm/bridge: inno-hdmi: Make the PHY configuration table optional drm/bridge: inno-hdmi: Make the register clock source selectable drm/bridge: inno-hdmi: Make the supported HDMI version selectable
soc: starfive: Add jh7110-hdmi-subsystem driver
soc: starfive: Add jh7110-vout-subsystem driver drm/bridge: starfive: Add JH7110 HDMI controller driver
riscv: dts: starfive: jh7110: Update DT for display subsystem
MAINTAINERS: Add StarFive JH7110 display subsystem entry.../starfive,jh7110-inno-hdmi-controller.yaml | 121 +++++++++ .../starfive/starfive,jh7110-hdmi-subsystem.yaml | 95 +++++++ .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 +++++++++++++++ .../bindings/display/verisilicon,dc.yaml | 1 + .../soc/starfive/starfive,jh7110-syscon.yaml | 1 + MAINTAINERS | 11 + arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 121 ++++++++- arch/riscv/boot/dts/starfive/jh7110.dtsi | 105 ++++++-- drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/inno-hdmi.c | 125 +++++++-- drivers/gpu/drm/bridge/jh7110-inno-hdmi.c | 297 +++++++++++++++++++++ drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c | 2 +- drivers/soc/starfive/Kconfig | 34 +++ drivers/soc/starfive/Makefile | 2 + drivers/soc/starfive/jh7110-hdmi-subsystem.c | 72 +++++ drivers/soc/starfive/jh7110-vout-subsystem.c | 82 ++++++ include/drm/bridge/inno_hdmi.h | 17 +- 18 files changed, 1266 insertions(+), 51 deletions(-)---
base-commit:6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20251031-jh7110-clean-send-7d2242118026
prerequisite-change-id: 20261028-jh7110-inno-hdmi-phy-83e5cfa643e3:v7
prerequisite-patch-id:e78b1dab85d70fa7ec3e551560dfc90891546de9
prerequisite-patch-id:7ffec3af58389aa090d5a9947889060dd5493138
prerequisite-patch-id:4a3488cc151ae0e9ef053ea67e8e520520c7df15
prerequisite-patch-id:37de8eb6867db62f75e39908a136684a1cc14743
prerequisite-patch-id:27aeff98d5c0b0bdb3eb9e9bbc2bf5e982864774
Quoted 1 line
Best regards,
Gentle ping on this series. It depends on the Innosilicon HDMI PHY series [1], but only for dt_binding_check/dtbs_check (the PHY binding is referenced from the jh7110-hdmi-subsystem binding) and at runtime. Everything else builds and can be reviewed independently.
Any comments on the DRM bridge / inno-hdmi parts would be much appreciated.
[1] - https://lore.kernel.org/all/[email protected]/
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Quoted 14 lines · Michal Wilczynski
Quoted 12 lines · Michal Wilczynski
This series enables the display subsystem on the StarFive JH7110.
Merging: the series splits by subsystem, there is no build dependency between the blocks, and each block lands in the tree that already owns those files:
drm-misc 1-3, 6, 8-14, 17
drivers/gpu/drm/bridge/,include/drm/bridge/and the display bindings. Patches 1 and 2 are inno-hdmi fixes with Fixes: tags; they apply to Rockchip as much as to StarFive and are independent of the rest, so they can go on their own.
Quoted 6 lines
Quoted 6 lines
Conor's tree 4, 5, 7, 15-16, 18
drivers/soc/starfive/, together with
the bindings for its two drivers (patches 4 and 7, under bindings/display/starfive/) and the vout-syscon compatible in bindings/soc/starfive/ (STARFIVE SOC DRIVERS), andarch/riscv/boot/dts/starfive/(STARFIVE DEVICETREES).
Other than for the dts patch,
I don't want to take the display binding because I won't have the child nodes, and I won't take the driver without the binding for it. At then at that point, the remaining trivial binding and driver may as well go with the rest of the code.
Please resubmit the dts patch to me individually when the rest of this has been applied.
Quoted 8 lines
Gentle ping on this series. It depends on the Innosilicon HDMI PHY series [1], but only for dt_binding_check/dtbs_check (the PHY binding is referenced from the jh7110-hdmi-subsystem binding) and at runtime. Everything else builds and can be reviewed independently.
Any comments on the DRM bridge / inno-hdmi parts would be much appreciated.