drm: starfive: jh7110: Enable display subsystem
Subsystems (15)
A message that is not in the archive (sent off-list or not yet received): CGME20260915153213eucas1p148f013af239a334fc78cdc249c0f8a61@eucas1p1.samsung.com
v4 cover drm: starfive: jh7110: Enable display subsystem
This series enables the display subsystem on the StarFive JH7110.
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, and it has a circular clock dependency with voutcrg:
- the HDMI controller needs pclk/mclk/bclk from voutcrg
- voutcrg needs the pixel clock for its dc8200 pixel MUXes, and that clock is generated by the HDMI PHY
The loop only exists if the HDMI block is treated as one device. The PHY's reference clock is xin24m, not a voutcrg output, so splitting the node into a parent plus phy and controller children gives deferred probe a linear order: hdmi-phy, then voutcrg, then hdmi-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 10 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 11 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.
Patches 16-18 drop the PHY duplication from the RFC. The JH7110 has the same Innosilicon PHY as the RK3328, offset by 0x100 because it sits behind the controller in the shared register block. Patch 16 factors out the pre-PLL config format, table lookup, determine_rate, recalc_rate and the pre-PLL programming; patch 17 moves Rockchip onto it; patch 18 adds the JH7110 driver. Pixel clock tables, post-PLL and analog config stay SoC specific.
Patch 17 should be a no-op for Rockchip - same writes, same order, same values - and RK3228, whose pre-PLL is at different addresses, keeps its own register code and shares only the lookup. I have no Rockchip hardware, so it is build tested only (arm and riscv). A Tested-by would help.
The dc8200 driver, th1520 reset controller and inno-hdmi bridge that the RFC listed as prerequisites are all upstream now, so there are no out-of-tree dependencies.
Testing
=======
Tested on a VisionFive 2 v1.3B using modetest.
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 10, 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 PHY also for arm.
Known limitation
================
The Framework 13 (fml13v01) panel needs one more change that is not in
here: dropping v_REG_CLK_INV | v_REG_CLK_SOURCE_SYS from the HDMI_SYS_CTRL write in inno_hdmi_init_hw(), without which it flickers (Maud Spierings). Those bits are set unconditionally for every user of the generic driver, so changing them is outside the scope of this series. Input from the inno-hdmi maintainers, or from anyone with a datasheet that says when they apply, would be welcome.
Notes
=====
The JH7110 has no central MAINTAINERS entry and maintainership is fragmented, so patch 20 adds one for the display subsystem and I am happy to help maintain it. The new PHY library lives under drivers/phy/, already covered by the generic PHY framework entry.
checkpatch warns "does MAINTAINERS need updating?" on the patches adding files, because that entry comes in patch 20.
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, 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 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 (20):
dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller
dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem
dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem drm/bridge: inno-hdmi: Split probe out of bind
drm/bridge: inno-hdmi: Allow the register map to come from a parent 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
soc: starfive: Add jh7110-hdmi-subsystem driver
soc: starfive: Add jh7110-vout-subsystem driver
clk: starfive: jh7110-vout: Allow pixel clock rate propagation drm/bridge: starfive: Add JH7110 HDMI controller driver
phy: Add common Innosilicon HDMI PHY helpers
phy: rockchip: inno-hdmi: Use the common Innosilicon PHY helpers
phy: starfive: Add jh7110-inno-hdmi-phy driver
riscv: dts: starfive: jh7110: Update DT for display subsystem
MAINTAINERS: Add StarFive JH7110 display subsystem entry
.../starfive,jh7110-inno-hdmi-controller.yaml | 121 +++++ .../bindings/display/verisilicon,dc.yaml | 1 + .../mfd/starfive,jh7110-hdmi-subsystem.yaml | 95 ++++ .../phy/starfive,jh7110-inno-hdmi-phy.yaml | 49 ++ .../soc/starfive/starfive,jh7110-syscon.yaml | 1 + .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 ++++++++ MAINTAINERS | 13 + arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 121 ++++- arch/riscv/boot/dts/starfive/jh7110.dtsi | 105 +++- drivers/clk/starfive/clk-starfive-jh7110-vout.c | 6 +- drivers/gpu/drm/bridge/Kconfig | 11 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/inno-hdmi.c | 112 +++- drivers/gpu/drm/bridge/jh7110-inno-hdmi.c | 297 +++++++++++ drivers/phy/Kconfig | 8 + drivers/phy/Makefile | 1 + drivers/phy/phy-inno-hdmi.c | 298 +++++++++++ drivers/phy/rockchip/Kconfig | 1 + drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 168 +----- drivers/phy/starfive/Kconfig | 20 + drivers/phy/starfive/Makefile | 1 + drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 579 +++++++++++++++++++++ drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/starfive/Kconfig | 43 ++ drivers/soc/starfive/Makefile | 3 + drivers/soc/starfive/jh7110-hdmi-subsystem.c | 73 +++ drivers/soc/starfive/jh7110-vout-subsystem.c | 82 +++ include/drm/bridge/inno_hdmi.h | 10 +- include/linux/phy/inno-hdmi-phy.h | 85 +++ 30 files changed, 2337 insertions(+), 188 deletions(-)
---
base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
change-id: 20251031-jh7110-clean-send-7d2242118026
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
PATCH v4 1/20 dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Add the dt-binding for the StarFive JH7110 Innosilicon HDMI PHY.
This device is a child of the starfive,jh7110-hdmi-subsystem node. It functions as both a PHY provider for the controller and as a clock provider for the variable pixel clock (hdmi_pclk), which it generates from its refoclk.
--- .../phy/starfive,jh7110-inno-hdmi-phy.yaml | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+)
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml new file +49 -0
@@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/starfive,jh7110-inno-hdmi-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 Innosilicon INNO HDMI PHY + +maintainers: + - Michal Wilczynski <[email protected]> + +description: + The PHY portion of the StarFive JH7110 INNO HDMI IP. + +properties: + compatible: + const: starfive,jh7110-inno-hdmi-phy + + clocks: + maxItems: 1 + description: Reference oscillator. + + '#clock-cells': + const: 0 + + '#phy-cells': + const: 0 + +required: + - compatible + - clocks + - '#clock-cells' + - '#phy-cells' + +additionalProperties: false + +examples: + # Shown as a child of the HDMI subsystem node; see + # Documentation/devicetree/bindings/mfd/starfive,jh7110-hdmi-subsystem.yaml + # for the full node. + - | + phy { + compatible = "starfive,jh7110-inno-hdmi-phy"; + #clock-cells = <0>; + clocks = <&xin24m>; + #phy-cells = <0>; + }; + +...
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines
Add the dt-binding for the StarFive JH7110 Innosilicon HDMI PHY.
This device is a child of the starfive,jh7110-hdmi-subsystem node. It functions as both a PHY provider for the controller and as a clock provider for the variable pixel clock (
hdmi_pclk), which it generates from its refoclk.Reviewed-by Joshua Peisach <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
In reply to Michal WilczynskiQuoted 8 lines · Michal Wilczynski
Add the dt-binding for the StarFive JH7110 Innosilicon HDMI PHY.
This device is a child of the starfive,jh7110-hdmi-subsystem node. It functions as both a PHY provider for the controller and as a clock provider for the variable pixel clock (
hdmi_pclk), which it generates from its refoclk.Reviewed-by Joshua Peisach <[email protected]>
While I appreciate other people looking at this, I don't think review here applies. It was a blanket tag, given to the entire series, with exception that it is from newbie, thus I want to ask: was this binding REALLY reviewed by Joshua?
Are the rest of the patches actually reviewed or just "looks good to me"? I see no comments from Joshua on v3, v2 and v1, which is usual sign of doing review.
Quoted 22 lines
Signed-off-by Michal Wilczynski <[email protected]>--- .../phy/starfive,jh7110-inno-hdmi-phy.yaml | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+)Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml new file +11
-0@@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/starfive,jh7110-inno-hdmi-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: StarFive JH7110 Innosilicon INNO HDMI PHY + +maintainers: + - Michal Wilczynski <[email protected]> +
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml line 21
Quoted 10 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml new file +10
-0+description: + The PHY portion of the StarFive JH7110 INNO HDMI IP. + +properties: + compatible: + const: starfive,jh7110-inno-hdmi-phy + + clocks: + maxItems: 1 + description: Reference oscillator.
This barely counts as a resource, so usual question: no resources here? no MMIO? Even the user of this phy is the block itself.
This makes me wonder if this should be a device node in the first place (instead folded into the parent).
Best regards,
Krzysztof
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 10 lines · Krzysztof Kozlowski
Quoted 8 lines · Michal Wilczynski
Add the dt-binding for the StarFive JH7110 Innosilicon HDMI PHY.
This device is a child of the starfive,jh7110-hdmi-subsystem node. It functions as both a PHY provider for the controller and as a clock provider for the variable pixel clock (
hdmi_pclk), which it generates from its refoclk.Reviewed-by Joshua Peisach <[email protected]>
Quoted 10 lines
While I appreciate other people looking at this, I don't think review here applies. It was a blanket tag, given to the entire series, with exception that it is from newbie, thus I want to ask: was this binding REALLY reviewed by Joshua?
Are the rest of the patches actually reviewed or just "looks good to me"? I see no comments from Joshua on v3, v2 and v1, which is usual sign of doing review.
I commented on v3 saying that I would test if I could. I don't just throw "Reviewed-by" on everything I look at.
If anything, I've been trying to be more honest in reviews, and only review ones that I actually care about[1].
If reviewing patches isn't a good way for newbies to start getting familiar with the kernel code (especially a NEW driver), then I don't know what is.
And to be clear, I'm not using a LLM to review. I am using actual intelligence. For the JH7110 PR specifically, I did actually go through and review each commit, because I wanted to learn what was happening and why. Actually, that's why I asked where the data sheet was[2].
So if you really want to, drop the Reviewed-by tag. And if it makes you feel better, I'll leave the series alone.
-Josh
[1] I won't be reviewing PRs around devicetree since I'm not confident
(or frankly, interested) in it at this point. https://lore.kernel.org/all/[email protected]/
[2] Michal giving me the hardware info:
https://lore.kernel.org/all/[email protected]/
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 16 lines · Joshua Peisach
Quoted 15 lines · Krzysztof Kozlowski
Quoted 8 lines · Michal Wilczynski
Add the dt-binding for the StarFive JH7110 Innosilicon HDMI PHY.
This device is a child of the starfive,jh7110-hdmi-subsystem node. It functions as both a PHY provider for the controller and as a clock provider for the variable pixel clock (
hdmi_pclk), which it generates from its refoclk.Reviewed-by Joshua Peisach <[email protected]>While I appreciate other people looking at this, I don't think review here applies. It was a blanket tag, given to the entire series, with exception that it is from newbie, thus I want to ask: was this binding REALLY reviewed by Joshua?
Quoted 6 lines
Quoted 5 lines
Are the rest of the patches actually reviewed or just "looks good to me"? I see no comments from Joshua on v3, v2 and v1, which is usual sign of doing review.
I commented on v3 saying that I would test if I could. I don't just
Testing has nothing to do with reviewing.
Quoted 4 lines
throw "Reviewed-by" on everything I look at.
If anything, I've been trying to be more honest in reviews, and only review ones that I actually care about[1].
You gave blanket tag for entire series, so I do not get this argument.
Quoted 4 lines
If reviewing patches isn't a good way for newbies to start getting familiar with the kernel code (especially a NEW driver), then I don't know what is.
Writing code and receiving review is something for newbies to start with. If you do not know kernel code or bindings, why do you think your review is applicable? If I try to review design of a post-tension concrete bridge, I would probably learn something. Would my review apply? No.
Best regards,
Krzysztof
Icenowy Zheng
maintainerRe: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 51 lines · 在 2026-09-18五的 08:16 +0200,Krzysztof Kozlowski写道:
Quoted 24 lines · Joshua Peisach
Quoted 23 lines · Krzysztof Kozlowski
Quoted 11 lines · Michal Wilczynski
Add the dt-binding for the StarFive JH7110 Innosilicon HDMI PHY.
This device is a child of the starfive,jh7110-hdmi-subsystem node. It
functions as both a PHY provider for the controller and as a clock
provider for the variable pixel clock (hdmi_pclk), which it generates
from its refoclk.Quoted 1 line
Reviewed-by Joshua Peisach <[email protected]>While I appreciate other people looking at this, I don't think review
here applies. It was a blanket tag, given to the entire series, with
exception that it is from newbie, thus I want to ask: was this binding
REALLY reviewed by Joshua?Quoted 8 lines
Quoted 7 lines
Are the rest of the patches actually reviewed or just "looks good to
me"? I see no comments from Joshua on v3, v2 and v1, which is usual sign
of doing review.I commented on v3 saying that I would test if I could. I don't just
Testing has nothing to do with reviewing.
Quoted 5 lines
throw "Reviewed-by" on everything I look at.
If anything, I've been trying to be more honest in reviews, and only
review ones that I actually care about[1].You gave blanket tag for entire series, so I do not get this argument.
Quoted 5 lines
If reviewing patches isn't a good way for newbies to start getting familiar with the kernel code (especially a NEW driver), then I don't
know what is.
Quoted 6 lines
Writing code and receiving review is something for newbies to start with. If you do not know kernel code or bindings, why do you think your review is applicable? If I try to review design of a post- tension
concrete bridge, I would probably learn something. Would my review apply? No.
My personal thoughts: everyone should be able to send R-b, but the effect of the R-b depends on who sent it.
In this case, I am okay about adding Joshua's R-b, but I don't necessarily think the patchset is reviewed enough because of this R-b.
Thanks,
Icenowy
Quoted 9 lines
Best regards,
Krzysztof_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 52 lines · Icenowy Zheng
Quoted 51 lines · 在 2026-09-18五的 08:16 +0200,Krzysztof Kozlowski写道:
Quoted 24 lines · Joshua Peisach
Quoted 23 lines · Krzysztof Kozlowski
Quoted 11 lines · Michal Wilczynski
Add the dt-binding for the StarFive JH7110 Innosilicon HDMI PHY.
This device is a child of the starfive,jh7110-hdmi-subsystem node. It
functions as both a PHY provider for the controller and as a clock
provider for the variable pixel clock (hdmi_pclk), which it generates
from its refoclk.Quoted 1 line
Reviewed-by Joshua Peisach <[email protected]>While I appreciate other people looking at this, I don't think review
here applies. It was a blanket tag, given to the entire series, with
exception that it is from newbie, thus I want to ask: was this binding
REALLY reviewed by Joshua?Quoted 8 lines
Quoted 7 lines
Are the rest of the patches actually reviewed or just "looks good to
me"? I see no comments from Joshua on v3, v2 and v1, which is usual sign
of doing review.I commented on v3 saying that I would test if I could. I don't just
Testing has nothing to do with reviewing.
Quoted 5 lines
throw "Reviewed-by" on everything I look at.
If anything, I've been trying to be more honest in reviews, and only
review ones that I actually care about[1].You gave blanket tag for entire series, so I do not get this argument.
Quoted 5 lines
If reviewing patches isn't a good way for newbies to start getting familiar with the kernel code (especially a NEW driver), then I don't
know what is.
Quoted 8 lines
Quoted 6 lines
Writing code and receiving review is something for newbies to start with. If you do not know kernel code or bindings, why do you think your review is applicable? If I try to review design of a post- tension
concrete bridge, I would probably learn something. Would my review apply? No.My personal thoughts: everyone should be able to send R-b, but the
Yes, that is true and this is not questionable. We clearly documented that everyone is able.
Quoted 1 line
effect of the R-b depends on who sent it.
I question whether is applicable here.
Blanket reviews without comments leaves just such feeling. And if, like here, there is no interest in reviewing DT, which I assume the DT was not reviewed and which was my question here, then why giving Rb tag to DT?
Best regards,
Krzysztof
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
In reply to Krzysztof KozlowskiQuoted 38 lines · Krzysztof Kozlowski
Quoted 16 lines · Joshua Peisach
Quoted 15 lines · Krzysztof Kozlowski
Quoted 8 lines · Michal Wilczynski
Add the dt-binding for the StarFive JH7110 Innosilicon HDMI PHY.
This device is a child of the starfive,jh7110-hdmi-subsystem node. It functions as both a PHY provider for the controller and as a clock provider for the variable pixel clock (
hdmi_pclk), which it generates from its refoclk.Reviewed-by Joshua Peisach <[email protected]>While I appreciate other people looking at this, I don't think review here applies. It was a blanket tag, given to the entire series, with exception that it is from newbie, thus I want to ask: was this binding REALLY reviewed by Joshua?
Quoted 6 lines
Quoted 5 lines
Are the rest of the patches actually reviewed or just "looks good to me"? I see no comments from Joshua on v3, v2 and v1, which is usual sign of doing review.
I commented on v3 saying that I would test if I could. I don't just
Testing has nothing to do with reviewing.
Quoted 4 lines
throw "Reviewed-by" on everything I look at.
If anything, I've been trying to be more honest in reviews, and only review ones that I actually care about[1].
You gave blanket tag for entire series, so I do not get this argument.
Quoted 4 lines
If reviewing patches isn't a good way for newbies to start getting familiar with the kernel code (especially a NEW driver), then I don't know what is.
Quoted 10 lines
Writing code and receiving review is something for newbies to start with. If you do not know kernel code or bindings, why do you think your review is applicable? If I try to review design of a post-tension concrete bridge, I would probably learn something. Would my review apply? No.
Best regards,
Krzysztof
Well I do feel like this is at least partially my fault. I took the Reviewed-by on the cover letter and automatically applied it using b4 without asking Joshua any more clarifying questions.
In v5 I will drop it from the binding patches and keep it on the driver patches.
Joshua - please feel free to continue reviewing and testing this patchset. Your help is very welcome.
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
In reply to Krzysztof KozlowskiQuoted 56 lines · Krzysztof Kozlowski
Quoted 8 lines · Michal Wilczynski
Add the dt-binding for the StarFive JH7110 Innosilicon HDMI PHY.
This device is a child of the starfive,jh7110-hdmi-subsystem node. It functions as both a PHY provider for the controller and as a clock provider for the variable pixel clock (
hdmi_pclk), which it generates from its refoclk.Reviewed-by Joshua Peisach <[email protected]>While I appreciate other people looking at this, I don't think review here applies. It was a blanket tag, given to the entire series, with exception that it is from newbie, thus I want to ask: was this binding REALLY reviewed by Joshua?
Are the rest of the patches actually reviewed or just "looks good to me"? I see no comments from Joshua on v3, v2 and v1, which is usual sign of doing review.
Quoted 22 lines
Signed-off-by Michal Wilczynski <[email protected]>--- .../phy/starfive,jh7110-inno-hdmi-phy.yaml | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+)Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml new file +11
-0@@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: https://protect2.fireeye.com/v1/url?k=1b336029-7ab87530-1b32eb66-74fe485cbfec-59631fa23f87244c&q=1&e=7e2eb06f-7b14-4bec-84e5-b60bb954d80a&u=http%3A%2F%2Fdevicetree.org%2Fschemas%2Fphy%2Fstarfive%2Cjh7110-inno-hdmi-phy.yaml%23 +$schema: https://protect2.fireeye.com/v1/url?k=46734e4d-27f85b54-4672c502-74fe485cbfec-9b6e35999c41723e&q=1&e=7e2eb06f-7b14-4bec-84e5-b60bb954d80a&u=http%3A%2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23 + +title: StarFive JH7110 Innosilicon INNO HDMI PHY + +maintainers: + - Michal Wilczynski <[email protected]> +Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml line 21
Quoted 10 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml new file +10
-0+description: + The PHY portion of the StarFive JH7110 INNO HDMI IP. + +properties: + compatible: + const: starfive,jh7110-inno-hdmi-phy + + clocks: + maxItems: 1 + description: Reference oscillator.This barely counts as a resource, so usual question: no resources here? no MMIO? Even the user of this phy is the block itself.
Quoted 2 lines
This makes me wonder if this should be a device node in the first place (instead folded into the parent).
The PHY has no reg because the reg is shared with the controller and owned by the parent - patch 9 lets the bridge take its regmap from there.
The user of the PHY is not only the block itself. It is the pixel clock provider for the whole display subsystem, voutcrg takes hdmitx0_pixelclk as the parent of its DC8200 pixel MUXes, and while HDMI output is active it is the only intended source for that clock. The parent has to be assigned explicitly so the general PLL does not end up driving the pixel clock, and so a DSI user does not reach the HDMI PHY clock generator.
So it has to be its own node. The HDMI block has two independent functions with different clock inputs and one of them feeds back into the SoC clock tree. The PHY generates hdmitx0_pixelclk which voutcrg consumes the controller consumes pclk/mclk/bclk from voutcrg. Folded into one node that node is both a provider to and a consumer of voutcrg which is a cycle in the hardware description, not just in Linux.
Quoted 6 lines
Best regards,
Krzysztof
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 14 lines · Michal Wilczynski
Quoted 9 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml line 21
Quoted 3 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml new file +3
-0+ clocks: + maxItems: 1 + description: Reference oscillator.This barely counts as a resource, so usual question: no resources here? no MMIO? Even the user of this phy is the block itself.
This makes me wonder if this should be a device node in the first place (instead folded into the parent).
The PHY has no reg because the reg is shared with the controller and owned by the parent - patch 9 lets the bridge take its regmap from there.
Quoted 8 lines
The user of the PHY is not only the block itself. It is the pixel clock provider for the whole display subsystem, voutcrg takes
hdmitx0_pixelclkas the parent of its DC8200 pixel MUXes, and while HDMI output is active it is the only intended source for that clock. The parent has to be assigned explicitly so the general PLL does not end up driving the pixel clock, and so a DSI user does not reach the HDMI PHY clock generator.So it has to be its own node. The HDMI block has two independent
I do not see the logic which lead to this conclusion. Pixel clock provider, so a clock controller, cannot be a user of a phy. Clock controller does not have a physical layer.
And really, I have no clue what hdmitx0_pixelclk and voutcrg are. I could probably study the patches a lot to figure that out, but my review queue has still 200 more, so I'll skip.
But nevertheless assigning clock parent of HDMI clock to PHY is standard, most of the platforms have it, thus it is not a justification for odd design.
Quoted 5 lines
functions with different clock inputs and one of them feeds back into the SoC clock tree. The PHY generates
hdmitx0_pixelclkwhich voutcrg consumes the controller consumes pclk/mclk/bclk from voutcrg. Folded into one node that node is both a provider to and a consumer of voutcrg which is a cycle in the hardware description, not just in Linux.
Best regards,
Krzysztof
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 22 lines · Krzysztof Kozlowski
Quoted 21 lines · Michal Wilczynski
Quoted 9 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml line 21
Quoted 3 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml new file +3
-0+ clocks: + maxItems: 1 + description: Reference oscillator.This barely counts as a resource, so usual question: no resources here? no MMIO? Even the user of this phy is the block itself.
This makes me wonder if this should be a device node in the first place (instead folded into the parent).
The PHY has no reg because the reg is shared with the controller and owned by the parent - patch 9 lets the bridge take its regmap from there.
The user of the PHY is not only the block itself. It is the pixel clock provider for the whole display subsystem, voutcrg takes
hdmitx0_pixelclkas the parent of its DC8200 pixel MUXes, and while HDMI output is active it is the only intended source for that clock. The parent has to be assigned explicitly so the general PLL does not end up driving the pixel clock, and so a DSI user does not reach the HDMI PHY clock generator.
Quoted 5 lines
Quoted 1 line
So it has to be its own node. The HDMI block has two independent
I do not see the logic which lead to this conclusion. Pixel clock provider, so a clock controller, cannot be a user of a phy. Clock controller does not have a physical layer.
Sorry I think the wording was not perfect. I meant the PHY node is a pixel clock provider. voutcrg consumes a clock not a PHY.
voutcrg: clock-controller@295c0000 {
clocks = <&syscrg ...>, <&hdmi_phy>;
clock-names = ...,"hdmitx0_pixelclk";
};The consumer of the PHY is only the hdmi controller.
What matters for the node layout is where that clock goes. voutcrg is the SoC display clock controller - it is not part of the HDMI block:
hdmi_phy -- pixel clock -> voutcrg
|
- pclk/mclk/bclk -> hdmi_controller
- pix0/pix1 -> dc8200
hdmi_phy and hdmi_controller are the same register block with one reg owned by the parent. So if that block is described as a single node:
hdmi_node - pixel clock -> voutcrg
^ |
--- pclk/mclk/bclk --------the node provides a clock to voutcrg and consumes three clocks from voutcrg. That is a cycle in the device tree description.
Split in two there is no cycle: the PHY's only input is xin24m - the 24 MHz oscillator which gives a linear order - hdmi_phy, voutcrg, hdmi_controller.
Quoted 8 lines
And really, I have no clue what
hdmitx0_pixelclkand voutcrg are. I could probably study the patches a lot to figure that out, but my review queue has still 200 more, so I'll skip.But nevertheless assigning clock parent of HDMI clock to PHY is standard, most of the platforms have it, thus it is not a justification for odd design.
Agreed and that is what this is - I followed RK3328, which uses the same Innosilicon IP and also describes it as two nodes:
hdmi: hdmi@ff3c0000 clocks = <&cru PCLK_HDMI>, ...
hdmiphy: phy@ff430000 clocks = <&cru PCLK_HDMIPHY>, <&xin24m>,
<&cru DCLK_HDMIPHY>
clock-output-names = "hdmi_phy";
#clock-cells = <0>;
#phy-cells = <0>;The only difference is reg: RK3328 has two register ranges, the JH7110 has one, so the parent owns it and the children have none.
Quoted 11 lines
Quoted 6 lines
functions with different clock inputs and one of them feeds back into the SoC clock tree. The PHY generates
hdmitx0_pixelclkwhich voutcrg consumes the controller consumes pclk/mclk/bclk from voutcrg. Folded into one node that node is both a provider to and a consumer of voutcrg which is a cycle in the hardware description, not just in Linux.Best regards,
Krzysztof
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 52 lines · Michal Wilczynski
Quoted 22 lines · Krzysztof Kozlowski
Quoted 21 lines · Michal Wilczynski
Quoted 9 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml line 21
Quoted 3 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml new file +3
-0+ clocks: + maxItems: 1 + description: Reference oscillator.This barely counts as a resource, so usual question: no resources here? no MMIO? Even the user of this phy is the block itself.
This makes me wonder if this should be a device node in the first place (instead folded into the parent).
The PHY has no reg because the reg is shared with the controller and owned by the parent - patch 9 lets the bridge take its regmap from there.
The user of the PHY is not only the block itself. It is the pixel clock provider for the whole display subsystem, voutcrg takes
hdmitx0_pixelclkas the parent of its DC8200 pixel MUXes, and while HDMI output is active it is the only intended source for that clock. The parent has to be assigned explicitly so the general PLL does not end up driving the pixel clock, and so a DSI user does not reach the HDMI PHY clock generator.Quoted 5 lines
Quoted 1 line
So it has to be its own node. The HDMI block has two independent
I do not see the logic which lead to this conclusion. Pixel clock provider, so a clock controller, cannot be a user of a phy. Clock controller does not have a physical layer.
Sorry I think the wording was not perfect. I meant the PHY node is a pixel clock provider. voutcrg consumes a clock not a PHY.
voutcrg: clock-controller@295c0000 { clocks = <&syscrg ...>, <&hdmi_phy>; clock-names = ...,"hdmitx0_pixelclk"; };The consumer of the PHY is only the hdmi controller.
What matters for the node layout is where that clock goes. voutcrg is the SoC display clock controller - it is not part of the HDMI block:
hdmi_phy-- pixel clock -> voutcrg
|
- pclk/mclk/bclk ->hdmi_controller
- pix0/pix1 -> dc8200
hdmi_phyandhdmi_controllerare the same register block with one reg owned by the parent. So if that block is described as a single node:
Quoted 6 lines
hdmi_node- pixel clock -> voutcrg^ | --- pclk/mclk/bclk --------the node provides a clock to voutcrg and consumes three clocks from voutcrg. That is a cycle in the device tree description.
There is no cycle. Internal signals to the block are not represented in DT.
What you have is a driver problem and you create some sort of DT structure to solve that. DT purpose is NOT to solve your driver dependencies or circular connections.
Best regards,
Krzysztof
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 57 lines · Krzysztof Kozlowski
Quoted 56 lines · Michal Wilczynski
Quoted 22 lines · Krzysztof Kozlowski
Quoted 21 lines · Michal Wilczynski
Quoted 9 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml line 21
Quoted 3 lines
Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml new file +3
-0+ clocks: + maxItems: 1 + description: Reference oscillator.This barely counts as a resource, so usual question: no resources here? no MMIO? Even the user of this phy is the block itself.
This makes me wonder if this should be a device node in the first place (instead folded into the parent).
The PHY has no reg because the reg is shared with the controller and owned by the parent - patch 9 lets the bridge take its regmap from there.
The user of the PHY is not only the block itself. It is the pixel clock provider for the whole display subsystem, voutcrg takes
hdmitx0_pixelclkas the parent of its DC8200 pixel MUXes, and while HDMI output is active it is the only intended source for that clock. The parent has to be assigned explicitly so the general PLL does not end up driving the pixel clock, and so a DSI user does not reach the HDMI PHY clock generator.Quoted 5 lines
Quoted 1 line
So it has to be its own node. The HDMI block has two independent
I do not see the logic which lead to this conclusion. Pixel clock provider, so a clock controller, cannot be a user of a phy. Clock controller does not have a physical layer.
Sorry I think the wording was not perfect. I meant the PHY node is a pixel clock provider. voutcrg consumes a clock not a PHY.
voutcrg: clock-controller@295c0000 { clocks = <&syscrg ...>, <&hdmi_phy>; clock-names = ...,"hdmitx0_pixelclk"; };The consumer of the PHY is only the hdmi controller.
What matters for the node layout is where that clock goes. voutcrg is the SoC display clock controller - it is not part of the HDMI block:
hdmi_phy-- pixel clock -> voutcrg
|
- pclk/mclk/bclk ->hdmi_controller
- pix0/pix1 -> dc8200
hdmi_phyandhdmi_controllerare the same register block with one reg owned by the parent. So if that block is described as a single node:
hdmi_node- pixel clock -> voutcrg^ | --- pclk/mclk/bclk --------
Quoted 8 lines
Quoted 2 lines
the node provides a clock to voutcrg and consumes three clocks from voutcrg. That is a cycle in the device tree description.
There is no cycle. Internal signals to the block are not represented in DT.
What you have is a driver problem and you create some sort of DT structure to solve that. DT purpose is NOT to solve your driver dependencies or circular connections.
The structure is not something I added. The voutcrg binding has required an input clock named hdmitx0_pixelclk since it was merged in 2023 a097a5ec14df ("dt-bindings: clock: Add StarFive JH7110 Video-Output clock and reset generator") and this series does not touch that file:
Documentation/devicetree/bindings/clock/starfive,jh7110-voutcrg.yaml
- const: hdmitx0_pixelclk
Mainline satisfies it with a placeholder, because so far nothing provided the real clock:
hdmitx0_pixelclk: hdmitx0-pixel-clock {
compatible = "fixed-clock";
clock-output-names = "hdmitx0_pixelclk";
#clock-cells = <0>;
};All this series does is point that existing input at the device that actually generates it.
TRM [1] table 5-3 on page 529 lists the display CRG's input clocks. Most come from dom_vout_top, but three come from IP blocks inside the subsystem:
clk_hdmitx0_pixelclk 297 MHz u0_hdmi_tx.clk_pix clk_mipitx_dphy_rxesc 10 MHz u0_mipitx_dphy.clk_rxesc clk_mipitx_dphy_txbytehs 297 MHz u0_mipitx_dphy.clk_txbytehs
and on page 530 the CRG offers clk_hdmitx0_pixelclk as Source1 for:
u0_dc8200.clk_pix0 Source0 clk_dc8200_pix0 Source1 clk_hdmitx0_pixelclk u0_dc8200.clk_pix1 Source0 clk_dc8200_pix0 Source1 clk_hdmitx0_pixelclk u0_cdns_dsiTx.clk_dpi Source0 clk_dc8200_pix0 Source1 clk_hdmitx0_pixelclk
The DC8200 and the DSI TX are separate devices, so the pixel clock crosses two block boundaries to reach them.
That is also why the DT has to be able to name it. Those MUXes have two parents and the selection is made in DT:
&dc8200 {
assigned-clocks = <&voutcrg JH7110_VOUTCLK_DC8200_PIX0>, ...;
assigned-clock-parents = <&hdmi_phy>, <&hdmi_phy>;
};and voutcrg takes it as an input clock because that is what the hardware does. If the PHY is folded into the HDMI node, that input phandle points at a node which also consumes pclk/mclk/bclk from voutcrg. That is where the cycle comes from - the hardware topology not the driver.
[1] - https://doc-en.rvspace.org/JH7110/PDF/JH7110_TRM_StarFive_Preliminary_V2.pdf
Quoted 4 lines
Best regards,
Krzysztof
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 113 lines · Michal Wilczynski
Quoted 57 lines · Krzysztof Kozlowski
Quoted 56 lines · Michal Wilczynski
Quoted 22 lines · Krzysztof Kozlowski
Quoted 21 lines · Michal Wilczynski
Quoted 9 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+ clocks: + maxItems: 1 + description: Reference oscillator.This barely counts as a resource, so usual question: no resources here? no MMIO? Even the user of this phy is the block itself.
This makes me wonder if this should be a device node in the first place (instead folded into the parent).
The PHY has no reg because the reg is shared with the controller and owned by the parent - patch 9 lets the bridge take its regmap from there.
The user of the PHY is not only the block itself. It is the pixel clock provider for the whole display subsystem, voutcrg takes
hdmitx0_pixelclkas the parent of its DC8200 pixel MUXes, and while HDMI output is active it is the only intended source for that clock. The parent has to be assigned explicitly so the general PLL does not end up driving the pixel clock, and so a DSI user does not reach the HDMI PHY clock generator.Quoted 5 lines
Quoted 1 line
So it has to be its own node. The HDMI block has two independent
I do not see the logic which lead to this conclusion. Pixel clock provider, so a clock controller, cannot be a user of a phy. Clock controller does not have a physical layer.
Sorry I think the wording was not perfect. I meant the PHY node is a pixel clock provider. voutcrg consumes a clock not a PHY.
voutcrg: clock-controller@295c0000 { clocks = <&syscrg ...>, <&hdmi_phy>; clock-names = ...,"hdmitx0_pixelclk"; };The consumer of the PHY is only the hdmi controller.
What matters for the node layout is where that clock goes. voutcrg is the SoC display clock controller - it is not part of the HDMI block:
hdmi_phy-- pixel clock -> voutcrg
|
- pclk/mclk/bclk ->hdmi_controller
- pix0/pix1 -> dc8200
hdmi_phyandhdmi_controllerare the same register block with one reg owned by the parent. So if that block is described as a single node:
hdmi_node- pixel clock -> voutcrg^ | --- pclk/mclk/bclk --------Quoted 8 lines
Quoted 2 lines
the node provides a clock to voutcrg and consumes three clocks from voutcrg. That is a cycle in the device tree description.
There is no cycle. Internal signals to the block are not represented in DT.
What you have is a driver problem and you create some sort of DT structure to solve that. DT purpose is NOT to solve your driver dependencies or circular connections.
The structure is not something I added. The voutcrg binding has required an input clock named
hdmitx0_pixelclksince it was merged in 2023a097a5ec14df("dt-bindings: clock: Add StarFive JH7110 Video-Output clock and reset generator") and this series does not touch that file:
Documentation/devicetree/bindings/clock/starfive,jh7110-voutcrg.yaml
- const:hdmitx0_pixelclkMainline satisfies it with a placeholder, because so far nothing provided the real clock:
hdmitx0_pixelclk: hdmitx0-pixel-clock { compatible = "fixed-clock"; clock-output-names = "hdmitx0_pixelclk"; #clock-cells = <0>; };All this series does is point that existing input at the device that actually generates it.
TRM [1] table 5-3 on page 529 lists the display CRG's input clocks. Most come from
dom_vout_top, but three come from IP blocks inside the subsystem:clk_hdmitx0_pixelclk 297 MHz u0_hdmi_tx.clk_pix clk_mipitx_dphy_rxesc 10 MHz u0_mipitx_dphy.clk_rxesc clk_mipitx_dphy_txbytehs 297 MHz u0_mipitx_dphy.clk_txbytehsand on page 530 the CRG offers
clk_hdmitx0_pixelclkas Source1 for:u0_dc8200.clk_pix0 Source0 clk_dc8200_pix0 Source1 clk_hdmitx0_pixelclk u0_dc8200.clk_pix1 Source0 clk_dc8200_pix0 Source1 clk_hdmitx0_pixelclk u0_cdns_dsiTx.clk_dpi Source0 clk_dc8200_pix0 Source1 clk_hdmitx0_pixelclkThe DC8200 and the DSI TX are separate devices, so the pixel clock crosses two block boundaries to reach them.
That is also why the DT has to be able to name it. Those MUXes have two parents and the selection is made in DT:
&dc8200 { assigned-clocks = <&voutcrg JH7110_VOUTCLK_DC8200_PIX0>, ...; assigned-clock-parents = <&hdmi_phy>, <&hdmi_phy>; };
Quoted 4 lines
and voutcrg takes it as an input clock because that is what the hardware does. If the PHY is folded into the HDMI node, that input phandle points at a node which also consumes pclk/mclk/bclk from voutcrg. That is where the cycle comes from - the hardware topology not the driver.
Which is perfectly "fine" - present in many other SoCs as well. This is not different and your arguments are insufficient to give here exceptions. Why? Because again you use as an argument a Linux driver problem (cyclic dependency). Basically to solve Linux problem you introduce new empty nodes.
Best regards,
Krzysztof
Re: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
Quoted 119 lines · Krzysztof Kozlowski
Quoted 113 lines · Michal Wilczynski
Quoted 57 lines · Krzysztof Kozlowski
Quoted 56 lines · Michal Wilczynski
Quoted 22 lines · Krzysztof Kozlowski
Quoted 21 lines · Michal Wilczynski
Quoted 9 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+ clocks: + maxItems: 1 + description: Reference oscillator.This barely counts as a resource, so usual question: no resources here? no MMIO? Even the user of this phy is the block itself.
This makes me wonder if this should be a device node in the first place (instead folded into the parent).
The PHY has no reg because the reg is shared with the controller and owned by the parent - patch 9 lets the bridge take its regmap from there.
The user of the PHY is not only the block itself. It is the pixel clock provider for the whole display subsystem, voutcrg takes
hdmitx0_pixelclkas the parent of its DC8200 pixel MUXes, and while HDMI output is active it is the only intended source for that clock. The parent has to be assigned explicitly so the general PLL does not end up driving the pixel clock, and so a DSI user does not reach the HDMI PHY clock generator.Quoted 5 lines
Quoted 1 line
So it has to be its own node. The HDMI block has two independent
I do not see the logic which lead to this conclusion. Pixel clock provider, so a clock controller, cannot be a user of a phy. Clock controller does not have a physical layer.
Sorry I think the wording was not perfect. I meant the PHY node is a pixel clock provider. voutcrg consumes a clock not a PHY.
voutcrg: clock-controller@295c0000 { clocks = <&syscrg ...>, <&hdmi_phy>; clock-names = ...,"hdmitx0_pixelclk"; };The consumer of the PHY is only the hdmi controller.
What matters for the node layout is where that clock goes. voutcrg is the SoC display clock controller - it is not part of the HDMI block:
hdmi_phy-- pixel clock -> voutcrg
|
- pclk/mclk/bclk ->hdmi_controller
- pix0/pix1 -> dc8200
hdmi_phyandhdmi_controllerare the same register block with one reg owned by the parent. So if that block is described as a single node:
hdmi_node- pixel clock -> voutcrg^ | --- pclk/mclk/bclk --------Quoted 8 lines
Quoted 2 lines
the node provides a clock to voutcrg and consumes three clocks from voutcrg. That is a cycle in the device tree description.
There is no cycle. Internal signals to the block are not represented in DT.
What you have is a driver problem and you create some sort of DT structure to solve that. DT purpose is NOT to solve your driver dependencies or circular connections.
The structure is not something I added. The voutcrg binding has required an input clock named
hdmitx0_pixelclksince it was merged in 2023a097a5ec14df("dt-bindings: clock: Add StarFive JH7110 Video-Output clock and reset generator") and this series does not touch that file:
Documentation/devicetree/bindings/clock/starfive,jh7110-voutcrg.yaml
- const:hdmitx0_pixelclkMainline satisfies it with a placeholder, because so far nothing provided the real clock:
hdmitx0_pixelclk: hdmitx0-pixel-clock { compatible = "fixed-clock"; clock-output-names = "hdmitx0_pixelclk"; #clock-cells = <0>; };All this series does is point that existing input at the device that actually generates it.
TRM [1] table 5-3 on page 529 lists the display CRG's input clocks. Most come from
dom_vout_top, but three come from IP blocks inside the subsystem:clk_hdmitx0_pixelclk 297 MHz u0_hdmi_tx.clk_pix clk_mipitx_dphy_rxesc 10 MHz u0_mipitx_dphy.clk_rxesc clk_mipitx_dphy_txbytehs 297 MHz u0_mipitx_dphy.clk_txbytehsand on page 530 the CRG offers
clk_hdmitx0_pixelclkas Source1 for:u0_dc8200.clk_pix0 Source0 clk_dc8200_pix0 Source1 clk_hdmitx0_pixelclk u0_dc8200.clk_pix1 Source0 clk_dc8200_pix0 Source1 clk_hdmitx0_pixelclk u0_cdns_dsiTx.clk_dpi Source0 clk_dc8200_pix0 Source1 clk_hdmitx0_pixelclkThe DC8200 and the DSI TX are separate devices, so the pixel clock crosses two block boundaries to reach them.
That is also why the DT has to be able to name it. Those MUXes have two parents and the selection is made in DT:
&dc8200 { assigned-clocks = <&voutcrg JH7110_VOUTCLK_DC8200_PIX0>, ...; assigned-clock-parents = <&hdmi_phy>, <&hdmi_phy>; };Quoted 4 lines
and voutcrg takes it as an input clock because that is what the hardware does. If the PHY is folded into the HDMI node, that input phandle points at a node which also consumes pclk/mclk/bclk from voutcrg. That is where the cycle comes from - the hardware topology not the driver.
Quoted 9 lines
Which is perfectly "fine" - present in many other SoCs as well. This is not different and your arguments are insufficient to give here exceptions. Why? Because again you use as an argument a Linux driver problem (cyclic dependency). Basically to solve Linux problem you introduce new empty nodes.
Best regards,
Krzysztof
OK probe ordering is a Linux concern and can't be used it to justify the binding.
We spoke briefly about this on Monday and I came away thinking the node is acceptable as long as it is justified by what it describes rather than by probe order. Is that the right reading of what you meant?
On that basis the PHY node:
- is a clock provider, and voutcrg consumes that clock and routes it on to the DC8200 pixel MUXes and the DSI TX
- is a phy provider for the controller
- takes a different input clock than the controller - xin24m, against pclk/mclk/bclk from voutcrg
- is separate IP - the same Innosilicon PHY that RK3328 instantiates at its own address (phy@ff430000), which here shares a register window with the controller
The reg is the only thing it does not have of its own, and that is shared with the controller and owned by the parent.
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Icenowy Zheng
maintainerRe: [PATCH v4 01/20] dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
In reply to Michal WilczynskiQuoted 143 lines · 在 2026-10-04日的 00:35 +0200,Michal Wilczynski写道:
Quoted 78 lines · Krzysztof Kozlowski
Quoted 69 lines · Michal Wilczynski
Quoted 32 lines · Krzysztof Kozlowski
Quoted 31 lines · Michal Wilczynski
Quoted 11 lines
Quoted 3 lines
+ clocks:
+ maxItems: 1
+ description: Reference oscillator.This barely counts as a resource, so usual question: no resources here?
no MMIO? Even the user of this phy is the block itself.This makes me wonder if this should be a device node in the first place
(instead folded into the parent).The PHY has no reg because the reg is shared with the controller and
owned by the parent - patch 9 lets the bridge take its regmap from
there.The user of the PHY is not only the block itself. It is the pixel clock
provider for the whole display subsystem, voutcrg takeshdmitx0_pixelclk
as the parent of its DC8200 pixel MUXes, and while HDMI output is active
it is the only intended source for that clock. The parent has to be
assigned explicitly so the general PLL does not end up driving the pixel
clock, and so a DSI user does not reach the HDMI PHY clock generator.Quoted 8 lines
Quoted 2 lines
So it has to be its own node. The HDMI block has two independent
I do not see the logic which lead to this conclusion. Pixel clock
provider, so a clock controller, cannot be a user of a phy. Clock
controller does not have a physical layer.Sorry I think the wording was not perfect. I meant the PHY node is a
pixel clock provider. voutcrg consumes a clock not a PHY.voutcrg: clock-controller@295c0000 {
clocks = <&syscrg ...>, <&hdmi_phy>;
clock-names = ...,"hdmitx0_pixelclk";
};The consumer of the PHY is only the hdmi controller.
What matters for the node layout is where that clock goes. voutcrg is the
SoC display clock controller - it is not part of the HDMI block:
hdmi_phy-- pixel clock -> voutcrg
|
- pclk/mclk/bclk ->hdmi_controller
- pix0/pix1 -> dc8200
hdmi_phyandhdmi_controllerare the same register block with one reg
owned by the parent. So if that block is described as a single node:Quoted 7 lines
hdmi_node- pixel clock -> voutcrg
^ |
--- pclk/mclk/bclk --------the node provides a clock to voutcrg and consumes three clocks from
voutcrg. That is a cycle in the device tree description.Quoted 6 lines
There is no cycle. Internal signals to the block are not represented in DT.
What you have is a driver problem and you create some sort of DT structure to solve that. DT purpose is NOT to solve your driver dependencies or circular connections.
The structure is not something I added. The voutcrg binding has required
an input clock namedhdmitx0_pixelclksince it was merged in 2023a097a5ec14df("dt-bindings: clock: Add StarFive JH7110 Video-Output clock and reset generator") and this series does not touch that file:
Documentation/devicetree/bindings/clock/starfive,jh7110-voutcrg.yaml
- const:hdmitx0_pixelclkMainline satisfies it with a placeholder, because so far nothing provided the
real clock:
hdmitx0_pixelclk: hdmitx0-pixel-clock { compatible = "fixed-
clock";
clock-output-names = "hdmitx0_pixelclk"; #clock-cells = <0>;
};All this series does is point that existing input at the device that actually
generates it.TRM [1] table 5-3 on page 529 lists the display CRG's input clocks. Most come from
dom_vout_top, but three come from IP blocks inside the subsystem:clk_hdmitx0_pixelclk 297 MHz u0_hdmi_tx.clk_pix clk_mipitx_dphy_rxesc 10 MHz u0_mipitx_dphy.clk_rxesc clk_mipitx_dphy_txbytehs 297 MHz u0_mipitx_dphy.clk_txbytehs
and on page 530 the CRG offers
clk_hdmitx0_pixelclkas Source1 for:u0_dc8200.clk_pix0 Source0 clk_dc8200_pix0 Source1
clk_hdmitx0_pixelclk
u0_dc8200.clk_pix1 Source0 clk_dc8200_pix0 Source1clk_hdmitx0_pixelclk
u0_cdns_dsiTx.clk_dpi Source0 clk_dc8200_pix0 Source1clk_hdmitx0_pixelclkThe DC8200 and the DSI TX are separate devices, so the pixel clock crosses two block boundaries to reach them.
That is also why the DT has to be able to name it. Those MUXes have two
parents and the selection is made in DT:&dc8200 {
assigned-clocks = <&voutcrgJH7110_VOUTCLK_DC8200_PIX0>, ...;
assigned-clock-parents = <&hdmi_phy>, <&hdmi_phy>; };
Quoted 7 lines
and voutcrg takes it as an input clock because that is what the hardware
does. If the PHY is folded into the HDMI node, that input phandle points at
a node which also consumes pclk/mclk/bclk from voutcrg. That is where the
cycle comes from - the hardware topology not the driver.
I think the common clock framework has a "orphaned clock" feature to solve this kind of cyclic clock dependency, although this could be a pandora's box if not properly used.
Thanks,
Icenowy
Quoted 10 lines
[1] -
https://doc-en.rvspace.org/JH7110/PDF/JH7110_TRM_StarFive_Preliminary_V2.pdfQuoted 4 lines
Best regards,
KrzysztofBest regards,
PATCH v4 2/20 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/mfd/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
[email protected]
AI reviewRe: [PATCH v4 02/20] dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 10 lines
Add 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_physibling.Reviewed-by Joshua Peisach <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH v4 3/20 dt-bindings: mfd: 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 populates its two children: the PHY and the controller. This is necessary to resolve a circular clock dependency between the HDMI block and the VOUT clock generator.
--- .../mfd/starfive,jh7110-hdmi-subsystem.yaml | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+)
Documentation/devicetree/bindings/mfd/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/mfd/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
[email protected]
AI reviewRe: [PATCH v4 03/20] dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] dt-bindings: mfd: bus fault during PHY probe due to artificial node split --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] dt-bindings: mfd: bus fault during PHY probe due to artificial node split --
commit 4723344ba643109500316c0b52d890ec9a27e43e
Author: Michal Wilczynski <[email protected]>
dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem
Add 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 populates its two children: the PHY and the controller. This is necessary to resolve a circular clock dependency between the HDMI block and the VOUT clock generator.
Quoted 6 lines
Documentation/devicetree/bindings/mfd/starfive,jh7110-hdmi-subsystem.yaml new file +0
-0@@ -0,0 +1,95 @@
[ ... ]
Documentation/devicetree/bindings/mfd/starfive,jh7110-hdmi-subsystem.yaml line 30
Quoted 12 lines
Documentation/devicetree/bindings/mfd/starfive,jh7110-hdmi-subsystem.yaml new file +12
-0+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#
[Severity: High]
Does this artificial split of a monolithic block into child nodes create a probe order issue?
Because the controller depends on the phy (via clocks = <&hdmi_phy> in the example below), fw_devlink guarantees the phy driver probes first. During its probe, the phy driver calls clk_set_rate(inno->phyclk, 297000000), which accesses the shared register space via regmap.
However, since the HDMI system clock (JH7110_VOUTCLK_HDMI_TX_SYS) is assigned exclusively to the controller child, it is not enabled during the phy probe.
Will this unclocked access wedge the bus and cause a synchronous external abort when the phy accesses the shared register window?
Quoted 28 lines
Documentation/devicetree/bindings/mfd/starfive,jh7110-hdmi-subsystem.yaml new file +28
-0+ +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>;
[ ... ]
Quoted 9 lines
Documentation/devicetree/bindings/mfd/starfive,jh7110-hdmi-subsystem.yaml new file +9
-0+ hdmi_phy: phy { + compatible = "starfive,jh7110-inno-hdmi-phy"; + #clock-cells = <0>; + clocks = <&xin24m>; + #phy-cells = <0>; + }; + }; + }; +...
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Re: [PATCH v4 03/20] dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem
In reply to Michal WilczynskiQuoted 1 line · Michal Wilczynski
Add the dt-binding for the StarFive JH7110 HDMI subsystem.
Your cover letter, in the first paragraph, should explain the merging/dependencies constraints - this depends on previous patches and cannot be taken alone.
Quoted 40 lines
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 populates its two children: the PHY and the controller. This is necessary to resolve a circular clock dependency between the HDMI block and the VOUT clock generator.
Reviewed-by Joshua Peisach <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>--- .../mfd/starfive,jh7110-hdmi-subsystem.yaml | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+)Documentation/devicetree/bindings/mfd/starfive,jh7110-hdmi-subsystem.yaml new file +20
-0@@ -0,0 +1,95 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/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:
Documentation/devicetree/bindings/mfd/starfive,jh7110-hdmi-subsystem.yaml line 30
Quoted 10 lines
Documentation/devicetree/bindings/mfd/starfive,jh7110-hdmi-subsystem.yaml new file +10
-0+ 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#
This node is just too empty... but let's discuss this in the phy patch, where I already commented.
Best regards,
Krzysztof
Re: [PATCH v4 03/20] dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem
Quoted 6 lines · Krzysztof Kozlowski
Quoted 1 line · Michal Wilczynski
Add the dt-binding for the StarFive JH7110 HDMI subsystem.
Your cover letter, in the first paragraph, should explain the merging/dependencies constraints - this depends on previous patches and cannot be taken alone.
OK I will update this in the v5
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
PATCH v4 4/20 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
[email protected]
AI reviewRe: [PATCH v4 04/20] dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 6 lines
The 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.Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
Re: [PATCH v4 04/20] dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
In reply to Michal WilczynskiQuoted 9 lines · Michal Wilczynski
The 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.Signed-off-by Michal Wilczynski <[email protected]>--- .../devicetree/bindings/soc/starfive/starfive,jh7110-syscon.yaml | 1 + 1 file changed, 1 insertion(+)
Best regards,
Krzysztof
PATCH v4 5/20 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
[email protected]
AI reviewRe: [PATCH v4 05/20] dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 5 lines
The JH7110 embeds a DC8200. The binding requires an SoC specific compatible ahead of the generic one, so add the JH7110 to the enum.
Reviewed-by Joshua Peisach <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
Icenowy Zheng
maintainerRe: [PATCH v4 05/20] dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
In reply to Michal WilczynskiQuoted 18 lines · 在 2026-09-15二的 17:32 +0200,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.
Reviewed-by Joshua Peisach <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>---
Documentation/devicetree/bindings/display/verisilicon,dc.yaml | 1 +1 file changed, 1 insertion(+)diff --git
a/Documentation/devicetree/bindings/display/verisilicon,dc.yamlb/Documentation/devicetree/bindings/display/verisilicon,dc.yamlindex919a9001220120054cb62d1d01b7293367266f95..05a202633cd273fec358c095c64584d959d96d90100644Documentation/devicetree/bindings/display/verisilicon,dc.yaml +0
-0@@ -16,6 +16,7 @@ properties:
Quoted 4 lines
compatible:
items:
- enum:
+ - starfive,jh7110-dc8200
Note: this binding is being refactored as part of MA35D1 support introduction (this SoC has a single-port DC like a DC8000), after the refactor the binding string might need to appear twice.
Thanks,
Icenowy
Quoted 4 lines
- thead,th1520-dc8200
- const: verisilicon,dc # DC IPs have discoverable ID/revision registers
Re: [PATCH v4 05/20] dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
Quoted 28 lines · Icenowy Zheng
Quoted 18 lines · 在 2026-09-15二的 17:32 +0200,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.
Reviewed-by Joshua Peisach <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>--- Documentation/devicetree/bindings/display/verisilicon,dc.yaml | 1 + 1 file changed, 1 insertion(+)diff --git
a/Documentation/devicetree/bindings/display/verisilicon,dc.yamlb/Documentation/devicetree/bindings/display/verisilicon,dc.yamlindex919a9001220120054cb62d1d01b7293367266f95..05a202633cd273fec358c095c64584d959d96d90100644Documentation/devicetree/bindings/display/verisilicon,dc.yaml properties: · line 19
Quoted 4 lines
Documentation/devicetree/bindings/display/verisilicon,dc.yaml +1
-0@@ -16,6 +16,7 @@ properties: compatible: items: - enum: + - starfive,jh7110-dc8200Note: this binding is being refactored as part of MA35D1 support introduction (this SoC has a single-port DC like a DC8000), after the refactor the binding string might need to appear twice.
Quoted 2 lines
Thanks,
Icenowy
Hi,
Thank you for letting me know. I've found the patchset on the mailing list [1]. Will make sure to rebase (and fix) after it gets in (presumably before this one although I'm not 100% sure).
[1] - https://lore.kernel.org/all/[email protected]/
Quoted 7 lines
Quoted 5 lines
Documentation/devicetree/bindings/display/verisilicon,dc.yaml +0
-0- thead,th1520-dc8200 - const: verisilicon,dc # DC IPs have discoverable ID/revisionregisters
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
PATCH v4 6/20 dt-bindings: soc: 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, rather than by whichever consumer happens to probe first.
--- .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 +++++++++++++++++++++ 1 file changed, 218 insertions(+)
Documentation/devicetree/bindings/soc/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/soc/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
[email protected]
AI reviewRe: [PATCH v4 06/20] dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines
The 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_VOUTpower domain. Describe the subsystem as a bus node so those resources are owned by the block that shares them, rather than by whichever consumer happens to probe first.Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
Re: [PATCH v4 06/20] dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem
In reply to Michal WilczynskiQuoted 10 lines · Michal Wilczynski
The 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_VOUTpower domain. Describe the subsystem as a bus node so those resources are owned by the block that shares them, rather than by whichever consumer happens to probe first.
Quoted 5 lines
Signed-off-by Michal Wilczynski <[email protected]>--- .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 +++++++++++++++++++++ 1 file changed, 218 insertions(+)
PATCH v4 7/20 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(), with a matching inno_hdmi_remove(), and reduce inno_hdmi_bind() to a wrapper around it.
No functional change intended.
--- drivers/gpu/drm/bridge/inno-hdmi.c | 49 +++++++++++++++++++++++++++++++++----- include/drm/bridge/inno_hdmi.h | 4 ++++ 2 files changed, 47 insertions(+), 6 deletions(-)
drivers/gpu/drm/bridge/inno-hdmi.c +43 -6
@@ -929,7 +929,14 @@ 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); +/* +* The interrupt is requested in probe, but bridge.dev is only set once +* the DRM master binds and attaches the bridge, which may never happen. +* Drop hotplug events that arrive before then rather than dereference a +* NULL drm_device. +*/ +if (hdmi->bridge.dev) +drm_helper_hpd_irq_event (hdmi->bridge.dev);return IRQ_HANDLED ; }
@@ -1061,11 +1068,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 returns a pointer to the inno_hdmi struct on success, or an ERR_PTR +* on failure. +* +* This function is used by modern, decoupled MFD/glue drivers. It registers +* the bridge but does not attach it. +*/ +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;
@@ -1128,7 +1148,24 @@ 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 device *dev, +struct drm_encoder *encoder, +const struct inno_hdmi_plat_data *plat_data) +{ +struct platform_device *pdev =to_platform_device (dev); +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);
include/drm/bridge/inno_hdmi.h +4 -0
@@ -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);
@@ -32,4 +33,7 @@ struct inno_hdmi_plat_data {struct inno_hdmi *inno_hdmi_bind (struct 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 v4 07/20] drm/bridge: inno-hdmi: Split probe out of bind
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] drm/bridge: inno-hdmi: Meaningful code and commit message mismatch for inno_hdmi_remove()…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] drm/bridge: inno-hdmi: Meaningful code and commit message mismatch for inno_hdmi_remove()
- [Medium] drm/bridge: inno-hdmi: TOCTOU race on hdmi->bridge.dev leading to potential NULL pointer dereference --
commit 619d70bf74f8f0e498489e8aa8a7c0c9e4e2d3fb
Author: Michal Wilczynski <[email protected]>
drm/bridge: inno-hdmi: Split probe out of bind
This commit splits the bridge setup into a new exported inno_hdmi_probe() function and reduces inno_hdmi_bind() to a wrapper around it. This decoupling allows a platform device to register its own bridge without attaching it to the DRM encoder immediately.
Quoted 2 lines
Move the setup into a new exported
inno_hdmi_probe(), with a matchinginno_hdmi_remove(), and reduceinno_hdmi_bind()to a wrapper around it.
[Severity: Medium]
Is the commit message description accurate regarding the removal function?
The commit message explicitly claims to introduce a matching inno_hdmi_remove() function for teardown alongside inno_hdmi_probe(), but this function appears to be missing from the patch. Does this break the expected API contract described for external decoupled drivers?
Quoted 7 lines
drivers/gpu/drm/bridge/inno-hdmi.c +0
-0@@ -929,7 +929,14 @@ static irqreturn_t inno_hdmi_irq(int irq, void *dev_id) {struct inno_hdmi *hdmi = dev_id;
drivers/gpu/drm/bridge/inno-hdmi.c static irqreturn_t inno_hdmi_irq(int irq, void *dev_id) · line 939
Quoted 10 lines
drivers/gpu/drm/bridge/inno-hdmi.c +8
-1-drm_helper_hpd_irq_event (hdmi->bridge.dev); +/* +* The interrupt is requested in probe, but bridge.dev is only set once +* the DRM master binds and attaches the bridge, which may never happen. +* Drop hotplug events that arrive before then rather than dereference a +* NULL drm_device. +*/ +if (hdmi->bridge.dev) +drm_helper_hpd_irq_event (hdmi->bridge.dev);
[Severity: Medium]
Can this lockless check of hdmi->bridge.dev lead to a NULL pointer dereference?
Without READ_ONCE(), the compiler might double-fetch the pointer. If the pointer is cleared concurrently (for example, during a failed drm_bridge_attach() or a teardown path) after the check but before it is passed to drm_helper_hpd_irq_event(), it could result in a NULL pointer dereference.
Could we use READ_ONCE() and a local variable to prevent a potential race condition in inno_hdmi_irq()?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
PATCH v4 8/20 drm/bridge: inno-hdmi: Allow the register map to come from a parent
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.
Use a regmap supplied by the parent device when there is one, and keep mapping our own resource when there is not, so platforms that own their register window are unaffected.
--- drivers/gpu/drm/bridge/inno-hdmi.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/inno-hdmi.c +28 -3
@@ -397,6 +397,7 @@ struct inno_hdmi {struct clk *pclk;struct clk *refclk;void __iomem *regs; +struct regmap *regmap;struct regmap *grf;struct inno_hdmi_i2c *i2c;
@@ -470,11 +471,25 @@ static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi,static inline u8 hdmi_readb (struct inno_hdmi *hdmi,u16 offset) { +u32 val; + +if (hdmi->regmap) { +if (regmap_read (hdmi->regmap, offset *4 , &val)) +return 0 ; + +return val; + } +return readl_relaxed (hdmi->regs + (offset) *0x04 ); }static inline void hdmi_writeb (struct inno_hdmi *hdmi,u16 offset,u32 val) { +if (hdmi->regmap) { +regmap_write (hdmi->regmap, offset *4 , val); +return ; + } +writel_relaxed (val, hdmi->regs + (offset) *0x04 ); }
@@ -1102,9 +1117,19 @@ 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. Fall back to mapping +* our own resource where it does not. +*/ +if (dev->parent) + hdmi->regmap =dev_get_regmap (dev->parent,NULL ); + +if (!hdmi->regmap) { + hdmi->regs =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (hdmi->regs)) +return ERR_CAST (hdmi->regs); + } hdmi->pclk =devm_clk_get_enabled (hdmi->dev,"pclk" );if (IS_ERR (hdmi->pclk)) {
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v4 08/20] drm/bridge: inno-hdmi: Allow the register map to come from a parent
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines
On 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.Use a regmap supplied by the parent device when there is one, and keep mapping our own resource when there is not, so platforms that own their register window are unaffected.
Reviewed-by Joshua Peisach <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
PATCH v4 9/20 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
@@ -886,6 +886,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
[email protected]
AI reviewRe: [PATCH v4 09/20] drm/bridge: inno-hdmi: Add .disable platform operation
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] drm/bridge: inno-hdmi: sleep in atomic context via .disable hook - [Medium] drm/bridge: inno-hdmi…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/bridge: inno-hdmi: sleep in atomic context via .disable hook
- [Medium] drm/bridge: inno-hdmi: hardware teardown LIFO ordering violation --
commit f7201b9edd5364bfbb0fe7f6dfc6706a0f43adf3
Author: Michal Wilczynski <[email protected]>
drm/bridge: inno-hdmi: Add .disable platform operation
This commit introduces a new .disable platform operation to the Innosilicon HDMI driver and invokes it in inno_hdmi_bridge_atomic_disable(). It allows platform-specific drivers to implement power down sequences for PHYs and clocks.
drivers/gpu/drm/bridge/inno-hdmi.c static void inno_hdmi_bridge_atomic_disable(struct drm_bridge *bridge, · line 892
Quoted 12 lines
drivers/gpu/drm/bridge/inno-hdmi.c +4
-0@@ -886,6 +886,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);
[Severity: High]
Does this code introduce a sleep in atomic context? The inno_hdmi_bridge_atomic_disable() function runs from drm_atomic_helper_commit_tail(), which is an atomic context where sleeping is strictly forbidden. However, the commit message mentions this hook is meant for calling phy_power_off() and clk_disable_unprepare(), which can sleep.
[Severity: Medium]
Will this break LIFO teardown ordering? Disabling the platform PHY and clocks via plat_ops->disable() before calling inno_hdmi_standby() leaves the internal HDMI controller configured while its underlying hardware is powered down. To maintain proper LIFO ordering, shouldn't inno_hdmi_standby() be called first to put the internal PHY registers in standby before disabling the platform clocks and PHY?
Quoted 3 lines
drivers/gpu/drm/bridge/inno-hdmi.c +0
-0inno_hdmi_standby (hdmi); }
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=9
PATCH v4 10/20 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
@@ -823,6 +823,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;
@@ -838,6 +839,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
[email protected]
AI reviewRe: [PATCH v4 10/20] drm/bridge: inno-hdmi: Add .mode_valid platform operation
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines
inno_hdmi_bridge_mode_valid()validates the pixel clock againsthdmi->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.
Quoted 5 lines
Add a .mode_valid platform operation so platforms can reject modes they are unable to drive. Platforms that do not implement it are unaffected.
Reviewed-by Joshua Peisach <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=10
PATCH v4 11/20 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
@@ -538,8 +538,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,
@@ -549,8 +555,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 );
@@ -560,6 +564,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); };
@@ -836,7 +841,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) {
@@ -1118,11 +1124,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 v4 11/20] drm/bridge: inno-hdmi: Make the PHY configuration table optional
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines
The 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.
Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=11
PATCH v4 12/20 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/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/starfive/Kconfig | 28 +++++++++++ drivers/soc/starfive/Makefile | 2 + drivers/soc/starfive/jh7110-hdmi-subsystem.c | 73 ++++++++++++++++++++++++++++ 5 files changed, 105 insertions(+)
drivers/soc/Kconfig +1 -0
@@ -24,6 +24,7 @@ source "drivers/soc/renesas/Kconfig" source "drivers/soc/rockchip/Kconfig" source "drivers/soc/samsung/Kconfig" source "drivers/soc/sophgo/Kconfig" +source "drivers/soc/starfive/Kconfig" source "drivers/soc/sunxi/Kconfig" source "drivers/soc/tegra/Kconfig" source "drivers/soc/ti/Kconfig"
drivers/soc/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-y += renesas/ obj-y += rockchip/ obj-$(CONFIG_SOC_SAMSUNG) += samsung/ obj-y += sophgo/ +obj-y += starfive/ obj-y += sunxi/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-y += ti/
drivers/soc/starfive/Kconfig new file +28 -0
@@ -0,0 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Starfive SoC drivers +# + +if ARCH_STARFIVE || COMPILE_TEST +menu "Starfive SoC drivers" + +config SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM + tristate "StarFive JH7110 HDMI subsystem driver" + 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". This is required to + correctly manage resources and break a circular clock dependency + between the PHY and the VOUT clock generator at probe time. + +endmenu +endif
drivers/soc/starfive/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM) += jh7110-hdmi-subsystem.o
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +73 -0
73 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v4 12/20] soc: starfive: Add jh7110-hdmi-subsystem driver
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] soc: starfive: unsafe 8-bit regmap MMIO accesses for 32-bit HDMI IP --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] soc: starfive: unsafe 8-bit regmap MMIO accesses for 32-bit HDMI IP --
commit 0e53205c6430272fda82936e32d4dd11694a8847
Author: Michal Wilczynski <[email protected]>
soc: starfive: Add jh7110-hdmi-subsystem driver
This commit adds the parent driver for the monolithic JH7110 HDMI IP block. It binds to the starfive,jh7110-hdmi-subsystem node, maps the shared register block, creates a regmap, and populates child devices.
Quoted 5 lines
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +0
-0
[ ... ]
drivers/soc/starfive/jh7110-hdmi-subsystem.c line 22
Quoted 9 lines
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +9
-0+#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_platform.h> +#include <linux/platform_device.h> +#include <linux/regmap.h> + +static const struct regmap_config starfive_hdmi_regmap_config = { + .reg_bits =32 , + .val_bits =8 ,
[Severity: High]
Does configuring .val_bits = 8 cause the regmap-mmio backend to select 8-bit memory accessors (writeb()/readb())?
On many 32-bit APB/AHB bus fabrics, issuing byte-wide memory transactions to 32-bit IP registers triggers synchronous external aborts (bus errors leading to a kernel panic) or results in partial register corruption. This can be triggered autonomously when the child drivers probe and attempt to read or write HDMI registers via the shared regmap.
Since the fallback MMIO implementation in the inno-hdmi child driver uses readl_relaxed() and writel_relaxed(), it appears the IP natively expects 32-bit physical accesses.
Should .val_bits = 32 be used here to guarantee regmap-mmio maps to safe 32-bit physical accessors?
Quoted 4 lines
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +4
-0+ .max_register = 0x3fff, +}; + +static int starfive_hdmi_subsys_probe (struct platform_device *pdev)
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=12
Icenowy Zheng
maintainerRe: [PATCH v4 12/20] soc: starfive: Add jh7110-hdmi-subsystem driver
In reply to Michal WilczynskiQuoted 16 lines · 在 2026-09-15二的 17:32 +0200,Michal Wilczynski写道:
Add 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 callsdevm_of_platform_populate()to create itshdmi_phyandhdmi_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
thePD_VOUTpower 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.
Quoted 3 lines
Co-developed-by Dominique Belhachemi <[email protected]>Signed-off-by Dominique Belhachemi <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>
``` Tested-by: Icenowy Zheng <[email protected]> ```
Thanks,
Icenowy
Quoted 180 lines
---
drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/starfive/Kconfig | 28 +++++++++++ drivers/soc/starfive/Makefile | 2 +drivers/soc/starfive/jh7110-hdmi-subsystem.c| 73
++++++++++++++++++++++++++++5 files changed, 105 insertions(+)drivers/soc/Kconfig +0
-0index
a2d65adffb8052c0ac5a6b60bf33fa9c644701bb..b3b01fc38139d98076c14f626a42ae3b7ef7c5d6100644drivers/soc/Kconfig +0
-0@@ -24,6 +24,7 @@ source "drivers/soc/renesas/Kconfig"source "
drivers/soc/rockchip/Kconfig"
source "drivers/soc/samsung/Kconfig"
source "drivers/soc/sophgo/Kconfig"
+source "drivers/soc/starfive/Kconfig"
source "drivers/soc/sunxi/Kconfig"
source "drivers/soc/tegra/Kconfig"
source "drivers/soc/ti/Kconfig"drivers/soc/Makefile +0
-0index
c9e689080ceb759384f690c2b65a82b3cb451c74..009f85ff891a15e0455f92c5d5a4059d8b1fcd3f100644drivers/soc/Makefile +0
-0@@ -30,6 +30,7 @@ obj-y += renesas/obj-y += rockchip/
obj-$(CONFIG_SOC_SAMSUNG) += samsung/
obj-y += sophgo/
+obj-y += starfive/
obj-y += sunxi/
obj-$(CONFIG_ARCH_TEGRA) += tegra/
obj-y += ti/drivers/soc/starfive/Kconfig new file +0
-0index 0000000000000000000000000000000000000000..e738638ab0f755fbbabca259264
abb56f3b6101fdrivers/soc/starfive/Kconfig new file +17
-0@@ -0,0 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Starfive SoC drivers +# + +if ARCH_STARFIVE || COMPILE_TEST +menu "Starfive SoC drivers" + +config SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM + tristate "StarFive JH7110 HDMI subsystem driver" + 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 digitalcontroller
drivers/soc/starfive/Kconfig new file +1
-0+ (DRM bridge) and the analog PHY (clock/phy provider) logicwithin
drivers/soc/starfive/Kconfig new file +6
-0+ 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". This is required to + correctly manage resources and break a circular clockdependency
drivers/soc/starfive/Kconfig new file +1
-0+ between the PHY and the VOUT clock generator at probetime.
drivers/soc/starfive/Kconfig new file +3
-0+ +endmenu +endifdrivers/soc/starfive/Makefile new file +0
-0index 0000000000000000000000000000000000000000..be89d8119212b7a7038817c2f0e
8eac1984ada88drivers/soc/starfive/Makefile new file +2
-0@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM) += jh7110-hdmi-subsystem.o
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +0
-0index 0000000000000000000000000000000000000000..e64a22263045935ae69541cf8a1
44f6128170c11drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +8
-0@@ -0,0 +1,73 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Driver for the StarFive JH7110 HDMI subsystem +* +* Copyright (c) 2025 Samsung Electronics Co., Ltd. +* Author: Michal Wilczynski <[email protected]> +* +* This driver binds to the monolithic HDMI block and creates separate
+ * logical platform devices for the HDMI Controller (bridge) and the
+ * HDMI PHY (clock/phy provider), allowing them to share a single regmap
+ * and breaking the probing circular dependency.
+ */drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +22
-0+ +#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_platform.h> +#include <linux/platform_device.h> +#include <linux/regmap.h> + +static const struct regmap_config starfive_hdmi_regmap_config = { + .reg_bits =32 , + .val_bits =8 , + .max_register =0x3fff , +}; + +static int starfive_hdmi_subsys_probe (struct platform_device *pdev) +{ +struct device *dev = &pdev->dev; +struct regmap *regmap; +void __iomem *regs; +int ret; + +/* +* The NoC display bus clock and reset that gate access to this region,
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +1
-0+* and the PD_VOUT power domain it sits in, are held by the video
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +1
-0+* output subsystem parent for as long as this device exists.
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +7
-0+*/ + regs =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (regs)) +return PTR_ERR (regs); + + regmap = devm_regmap_init_mmio(dev, regs, +
&starfive_hdmi_regmap_config);drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +3
-0+if (IS_ERR (regmap)) + return dev_err_probe(dev, PTR_ERR(regmap), + "Failed to init sharedregmap\n");
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +5
-0+ + ret =devm_of_platform_populate (dev); +if (ret) + return dev_err_probe(dev, ret, + "Failed to populate childdevices\n");
drivers/soc/starfive/jh7110-hdmi-subsystem.c new file +22
-0+ +return 0 ; +} + +static const struct of_device_id starfive_hdmi_subsys_of_match[] = { + { .compatible ="starfive,jh7110-hdmi-subsystem" , }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, starfive_hdmi_subsys_of_match); + +static struct platform_driver starfive_hdmi_subsys_driver = { + .probe = starfive_hdmi_subsys_probe, + .driver = { + .name ="starfive-hdmi-subsystem" , + .of_match_table = starfive_hdmi_subsys_of_match, + }, +}; +module_platform_driver (starfive_hdmi_subsys_driver); + +MODULE_AUTHOR ("Michal Wilczynski <[email protected]>" ); +MODULE_DESCRIPTION ("StarFive JH7110 HDMI subsystem Driver" ); +MODULE_LICENSE ("GPL" );
PATCH v4 13/20 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 | 15 +++++ drivers/soc/starfive/Makefile | 1 + drivers/soc/starfive/jh7110-vout-subsystem.c | 82 ++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+)
drivers/soc/starfive/Kconfig +15 -0
@@ -6,6 +6,21 @@ if ARCH_STARFIVE || COMPILE_TEST menu "Starfive SoC drivers" +config SOC_STARFIVE_JH7110_VOUT_SUBSYSTEM + tristate "StarFive JH7110 video output subsystem driver" + 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. + config SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM tristate "StarFive JH7110 HDMI subsystem driver" depends on OF
drivers/soc/starfive/Makefile +1 -0
@@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only 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
[email protected]
AI reviewRe: [PATCH v4 13/20] soc: starfive: Add jh7110-vout-subsystem driver
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] soc: starfive: NoC bus clock leaks power during system sleep --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] soc: starfive: NoC bus clock leaks power during system sleep
--
commit f4b88d3831df8dc30fb442edb24499643c924a58
Author: Michal Wilczynski <[email protected]>
soc: starfive: Add jh7110-vout-subsystem driver
This commit adds a parent driver for the StarFive JH7110 video output subsystem. It claims the NoC display bus clock and reset, and holds a runtime PM reference to keep the PD_VOUT power domain active for as long as any child device exists.
Quoted 5 lines
drivers/soc/starfive/jh7110-vout-subsystem.c new file +0
-0
[ ... ]
drivers/soc/starfive/jh7110-vout-subsystem.c line 57
Quoted 6 lines
drivers/soc/starfive/jh7110-vout-subsystem.c new file +6
-0+ bus_clk =devm_clk_get_enabled (dev,NULL ); +if (IS_ERR (bus_clk)) +return dev_err_probe (dev,PTR_ERR (bus_clk), +"Failed to enable NoC bus clock\n" ); + + bus_rst =devm_reset_control_get_exclusive_deasserted (dev,NULL );
[Severity: Medium]
Does this cause a power leak during system suspend? The NoC bus clock is enabled here, but the pointer to bus_clk is discarded. This means it cannot be disabled later during system sleep transitions.
While the genpd framework manages the PD_VOUT domain during system sleep, the clock framework doesn't automatically disable clocks. The software enable count will remain greater than zero, which could keep the NoC bus clock and its parent PLLs active and leak power during suspend (e.g., suspend-to-RAM).
[ ... ]
drivers/soc/starfive/jh7110-vout-subsystem.c line 78
Quoted 8 lines
drivers/soc/starfive/jh7110-vout-subsystem.c new file +8
-0+static struct platform_driver jh7110_vout_subsys_driver = { + .probe = jh7110_vout_subsys_probe, + .driver = { + .name ="jh7110-vout-subsystem" , + .of_match_table = jh7110_vout_subsys_of_match, + }, +}; +module_platform_driver (jh7110_vout_subsys_driver);
[Severity: Medium]
Because the driver struct lacks a .pm field with system suspend and resume callbacks, it seems there is no mechanism to disable the NoC bus clock when the system goes to sleep. Should the driver store the clock pointer in a private structure and implement dev_pm_ops callbacks to handle disabling and re-enabling the clock?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=13
Icenowy Zheng
maintainerRe: [PATCH v4 13/20] soc: starfive: Add jh7110-vout-subsystem driver
In reply to Michal WilczynskiQuoted 10 lines · 在 2026-09-15二的 17:32 +0200,Michal Wilczynski写道:
Nothing in the video output subsystem can reach its own registers until
the NoC display bus clock and reset are up andPD_VOUTis 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.
Quoted 8 lines
Add a driver for the subsystem node that takes the bus clock and reset,
holds a runtime PM reference so genpd keepsPD_VOUTpowered, and then populates its children. All three are released only once the last child
is gone.Signed-off-by Michal Wilczynski <[email protected]>
``` Tested-by: Icenowy Zheng <[email protected]> ```
Thanks,
Icenowy
Quoted 160 lines
---
drivers/soc/starfive/Kconfig | 15 +++++ drivers/soc/starfive/Makefile | 1 +drivers/soc/starfive/jh7110-vout-subsystem.c| 82
++++++++++++++++++++++++++++3 files changed, 98 insertions(+)drivers/soc/starfive/Kconfig +0
-0index
e738638ab0f755fbbabca259264abb56f3b6101f..cf5e626b8a39a75768917eee188a79256b36f1aa100644drivers/soc/starfive/Kconfig +0
-0@@ -6,6 +6,21 @@if
ARCH_STARFIVE||COMPILE_TEST
menu "Starfive SoC drivers"drivers/soc/starfive/Kconfig +6
-0+config SOC_STARFIVE_JH7110_VOUT_SUBSYSTEM + tristate "StarFive JH7110 video output subsystem driver" + depends on OF + select PM + help + This option enables the parent driver for the StarFiveJH7110
drivers/soc/starfive/Kconfig +1
-0+ video output subsystem, which the documentation calls
dom_vout_top.drivers/soc/starfive/Kconfig +2
-0+ + The subsystem covers the DC8200 display controller, theHDMI
drivers/soc/starfive/Kconfig +1
-0+ transmitter, the video output clock generator and thevideo output
drivers/soc/starfive/Kconfig +1
-0+ system controller. They share one NoC port whose clock andreset
drivers/soc/starfive/Kconfig +1
-0+ gate access to the whole register region, and the regionsits in
drivers/soc/starfive/Kconfig +1
-0+ the PD_VOUT power domain. This driver owns those resourcesand
drivers/soc/starfive/Kconfig +2
-0+ holds them for as long as any of its children exist. +config
SOC_STARFIVE_JH7110_HDMI_SUBSYSTEMtristate "StarFive JH7110 HDMI subsystem driver" depends on OFdrivers/soc/starfive/Makefile +0
-0index
be89d8119212b7a7038817c2f0e8eac1984ada88..6c229020c1e563b37df43f6ac1665465a11333cc100644drivers/soc/starfive/Makefile +0
-0@@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-onlyobj-$(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 +0
-0index 0000000000000000000000000000000000000000..af632692e2139d9d07edd478a29
9b170ad1b7104drivers/soc/starfive/jh7110-vout-subsystem.c new file +8
-0@@ -0,0 +1,82 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Driver for the StarFive JH7110 video output subsystem +* +* Copyright (c) 2025 Samsung Electronics Co., Ltd. +* Author: Michal Wilczynski <[email protected]> +* +* The display hardware sits behind a single NoC port whose clock and reset
+ * gate access to every register in the region, inside thePD_VOUTpower
+ * domain. Nothing below this node can reach its own registers until all three
+ * are up, so bring them up here and hold them for as long as any child device
+ * exists, rather than leaving them to whichever consumer happens to probe
+ * first.
+ */drivers/soc/starfive/jh7110-vout-subsystem.c new file +22
-0+ +#include <linux/clk.h> +#include <linux/module.h> +#include <linux/of_platform.h> +#include <linux/platform_device.h> +#include <linux/pm_runtime.h> +#include <linux/reset.h> + +static void jh7110_vout_subsys_pm_put (void *data) +{ +pm_runtime_put_sync (data); +} + +static int jh7110_vout_subsys_probe (struct platform_device *pdev) +{ +struct device *dev = &pdev->dev; +struct reset_control *bus_rst; +struct clk *bus_clk; +int ret; + +/* +* Take a runtime PM reference for the lifetime of this device. genpd
drivers/soc/starfive/jh7110-vout-subsystem.c new file +1
-0+* only keeps PD_VOUT powered while something actually holds it, and
drivers/soc/starfive/jh7110-vout-subsystem.c new file +1
-0+* an unclocked or unpowered access to this region wedges the bus.
drivers/soc/starfive/jh7110-vout-subsystem.c new file +8
-0+*/ + ret =devm_pm_runtime_enable (dev); +if (ret) +return ret; + + ret =pm_runtime_resume_and_get (dev); +if (ret) + return dev_err_probe(dev, ret, "Failed to power onPD_VOUT\n");
drivers/soc/starfive/jh7110-vout-subsystem.c new file +2
-0+ + ret = devm_add_action_or_reset(dev,
jh7110_vout_subsys_pm_put, dev);drivers/soc/starfive/jh7110-vout-subsystem.c new file +7
-0+if (ret) +return ret; + + bus_clk =devm_clk_get_enabled (dev,NULL ); +if (IS_ERR (bus_clk)) + return dev_err_probe(dev, PTR_ERR(bus_clk), + "Failed to enable NoC busclock\n");
drivers/soc/starfive/jh7110-vout-subsystem.c new file +2
-0+ + bus_rst = devm_reset_control_get_exclusive_deasserted(dev,NULL);
drivers/soc/starfive/jh7110-vout-subsystem.c new file +3
-0+if (IS_ERR (bus_rst)) + return dev_err_probe(dev, PTR_ERR(bus_rst), + "Failed to deassert NoC busreset\n");
drivers/soc/starfive/jh7110-vout-subsystem.c new file +22
-0+ +return devm_of_platform_populate (dev); +} + +static const struct of_device_id jh7110_vout_subsys_of_match[] = { + { .compatible ="starfive,jh7110-vout-subsystem" , }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, jh7110_vout_subsys_of_match); + +static struct platform_driver jh7110_vout_subsys_driver = { + .probe = jh7110_vout_subsys_probe, + .driver = { + .name ="jh7110-vout-subsystem" , + .of_match_table = jh7110_vout_subsys_of_match, + }, +}; +module_platform_driver (jh7110_vout_subsys_driver); + +MODULE_AUTHOR ("Michal Wilczynski <[email protected]>" ); +MODULE_DESCRIPTION ("StarFive JH7110 video output subsystem driver" ); +MODULE_LICENSE ("GPL" );
PATCH v4 14/20 clk: starfive: jh7110-vout: Allow pixel clock rate propagation
In reply to Michal WilczynskiThe dc8200_pix0 and dc8200_pix1 MUXes feed the display controller, and the rate they carry is ultimately produced by the HDMI PHY, which registers hdmitx0_pixelclk as a clock provider.
Add CLK_SET_RATE_PARENT to both MUXes so a rate requested on them reaches that parent, instead of being clamped to whatever rate the parent already happens to run at.
--- drivers/clk/starfive/clk-starfive-jh7110-vout.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/clk/starfive/clk-starfive-jh7110-vout.c +4 -2
@@ -40,10 +40,12 @@ static const struct jh71x0_clk_data jh7110_voutclk_data[] = {JH71X0_GATE (JH7110_VOUTCLK_DC8200_AXI ,"dc8200_axi" ,0 ,JH7110_VOUTCLK_VOUT_TOP_AXI ),JH71X0_GATE (JH7110_VOUTCLK_DC8200_CORE ,"dc8200_core" ,0 ,JH7110_VOUTCLK_VOUT_TOP_AXI ),JH71X0_GATE (JH7110_VOUTCLK_DC8200_AHB ,"dc8200_ahb" ,0 ,JH7110_VOUTCLK_VOUT_TOP_AHB ), -JH71X0_GMUX (JH7110_VOUTCLK_DC8200_PIX0 ,"dc8200_pix0" ,0 ,2 , +JH71X0_GMUX (JH7110_VOUTCLK_DC8200_PIX0 ,"dc8200_pix0" , +CLK_SET_RATE_PARENT |CLK_SET_RATE_NO_REPARENT ,2 ,JH7110_VOUTCLK_DC8200_PIX ,JH7110_VOUTCLK_HDMITX0_PIXELCLK ), -JH71X0_GMUX (JH7110_VOUTCLK_DC8200_PIX1 ,"dc8200_pix1" ,0 ,2 , +JH71X0_GMUX (JH7110_VOUTCLK_DC8200_PIX1 ,"dc8200_pix1" , +CLK_SET_RATE_PARENT |CLK_SET_RATE_NO_REPARENT ,2 ,JH7110_VOUTCLK_DC8200_PIX , JH7110_VOUTCLK_HDMITX0_PIXELCLK),/* LCD */
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v4 14/20] clk: starfive: jh7110-vout: Allow pixel clock rate propagation
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 4 lines
The
dc8200_pix0anddc8200_pix1MUXes feed the display controller, and the rate they carry is ultimately produced by the HDMI PHY, which registershdmitx0_pixelclkas a clock provider.
Quoted 8 lines
Add
CLK_SET_RATE_PARENTto both MUXes so a rate requested on them reaches that parent, instead of being clamped to whatever rate the parent already happens to run at.Co-developed-by Dominique Belhachemi <[email protected]>Signed-off-by Dominique Belhachemi <[email protected]>Reviewed-by Joshua Peisach <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=14
PATCH v4 15/20 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
@@ -359,6 +359,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
[email protected]
AI reviewRe: [PATCH v4 15/20] drm/bridge: starfive: Add JH7110 HDMI controller driver
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 20 lines
Add 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_physibling.The driver calls the generic
inno_hdmi_probefunction, 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 viaclk_set_rate()and powering on the PHY viaphy_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 [ ... ]
devm_drm_bridge_add(). Releasing them in .remove runs before devres unwinds and would leave the bridge registered with its clocks already gated.
Quoted 1 line
Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=15
Icenowy Zheng
maintainerRe: [PATCH v4 15/20] drm/bridge: starfive: Add JH7110 HDMI controller driver
In reply to Michal WilczynskiQuoted 49 lines · 在 2026-09-15二的 17:32 +0200,Michal Wilczynski写道:
Add 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 itshdmi_physibling.The driver calls the generic
inno_hdmi_probefunction, 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 viaclk_set_rate()and powering on the PHY viaphy_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 modeclk_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.
Quoted 8 lines
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 withdevm_drm_bridge_add(). Releasing them in .remove runs before devres unwinds and would leave the bridge registered with its clocks already gated.Signed-off-by Michal Wilczynski <[email protected]>
``` Tested-by: Icenowy Zheng <[email protected]> ```
Thanks,
Icenowy
Quoted 399 lines
---
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 +0
-0index
4a57d49b4c6d3ab4b965228835b372d191647197..75b1cf6727d5a32310dcf9fe5734d95e14eea8fe100644drivers/gpu/drm/bridge/Kconfig +0
-0@@ -359,6 +359,17 @@ config DRM_SOLOMON_SSD2825Say M here if you want to support this hardware as a module.
The module will be named "ssd2825".drivers/gpu/drm/bridge/Kconfig +7
-0+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 specificimplementation
drivers/gpu/drm/bridge/Kconfig +2
-0+ of the Innosilicon HDMI controller. + This driver acts as a glue layer between the JH7110 HDMIsubsystem
drivers/gpu/drm/bridge/Kconfig +1
-0+ parent driver and the generic Innosilicon HDMI bridgedriver.
+
configDRM_THINE_THC63LVD1024
tristate "Thine THC63LVD1024 LVDS decoder bridge" depends on OFdrivers/gpu/drm/bridge/Makefile +0
-0index
15cc821d85b7ea6f3cdc313f3e521b028de567d7..5d843f4ad7ed50b28cb75286c5e22789d91a0836100644drivers/gpu/drm/bridge/Makefile +0
-0@@ -30,6 +30,7 @@ obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.oobj-$(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 +0
-0index 0000000000000000000000000000000000000000..e9b91787330d7b65558868017bc
36ca8f4535998drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +7
-0@@ -0,0 +1,297 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) StarFive Technology Co., Ltd. +* Copyright (c) 2025 Samsung Electronics Co., Ltd. +* Author: Michal Wilczynski <[email protected]> +* +* HDMI controller (bridge) driver for the StarFive JH7110 HDMI subsystem.
+ */drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +26
-0+ +#include <linux/bitfield.h> +#include <linux/cleanup.h> +#include <linux/clk.h> +#include <linux/mfd/syscon.h> +#include <linux/module.h> +#include <linux/of_device.h> +#include <linux/of_graph.h> +#include <linux/platform_device.h> +#include <linux/phy/phy.h> +#include <linux/regmap.h> +#include <linux/reset.h> + +#include <drm/bridge/inno_hdmi.h> +#include <drm/drm_modes.h> + +/* dom_vout_syscon: HDMI pixel data mapping */ +#define VOUT_SYSCFG_4 0x4 +#define VOUT_HDMI_DP_BIT_DEPTH BIT(25) +#define VOUT_HDMI_DP_YUV_MODE GENMASK(27, 26) +#define VOUT_HDMI_DP_YUV_MODE_RGB 3 +#define VOUT_HDMI_DPI_BIT_DEPTH GENMASK(29, 28) +#define VOUT_HDMI_DPI_BIT_DEPTH_8BIT 0 +#define VOUT_HDMI_DPI_DP_SEL BIT(30) + +/* u2_display_panel_mux feeds HDMI_Ctrl, see the block diagram in 5.1 */
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +4
-0+#define VOUT_SYSCFG_8 0x8 +#define VOUT_HDMI_PANEL_SEL BIT(4) + +enum stf_hdmi_ctrl_clocks {CLK_SYS =0 ,CLK_M ,CLK_B ,CLK_PCLK ,
CLK_CTRL_NUM};drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +14
-0+ +struct stf_inno_hdmi_controller { +struct device *dev; +struct clk_bulk_data clks[CLK_CTRL_NUM ]; +struct reset_control *tx_rst; +struct phy *phy; +bool enabled; +}; + +static enum drm_mode_status +inno_hdmi_starfive_mode_valid (struct device *dev, + const struct drm_display_mode *mode) +{ + struct stf_inno_hdmi_controller *ctrl =
dev_get_drvdata(dev);drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +5
-0+unsigned long pixelclk = mode->clock *1000 ; +long rounded; + +/* +* The PHY can only generate the discrete set of pixel clocks described
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +1
-0+* by its pre-PLL table, and clk_round_rate() fails for anything else.
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +1
-0+* Reject those modes here: without this the modeset would appear to
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +3
-0+* succeed while the PHY never produces a signal. +*/ + rounded = clk_round_rate(ctrl->clks[CLK_PCLK].clk,pixelclk);
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +10
-0+if (rounded != pixelclk) +return MODE_NOCLOCK ; + +return MODE_OK ; +} + +static void inno_hdmi_starfive_enable (struct device *dev, + struct drm_display_mode *mode) +{ + struct stf_inno_hdmi_controller *ctrl =
dev_get_drvdata(dev);drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +4
-0+int ret; + +/* +* 1. Set the pixel clock rate. This calls the PHY driver's .set_rate op.
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +2
-0+*/ + ret = clk_set_rate(ctrl->clks[CLK_PCLK].clk, mode->clock *1000);
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +8
-0+if (ret) { +dev_err (dev,"Failed to set pclk rate %d: %d\n" , + mode->clock *1000 , ret); +return ; + } + +/* +* 2. Enable the pixel clock. This calls the PHY driver's .prepare op.
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +9
-0+*/ + ret =clk_prepare_enable (ctrl->clks[CLK_PCLK ].clk); +if (ret) { +dev_err (dev,"Failed to enable pclk: %d\n" , ret); +return ; + } + +/* +* 3. Power on the PHY. This calls the PHY driver's .power_on op,
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +15
-0+* which configures the Post-PLL and analog blocks. +*/ + ret =phy_power_on (ctrl->phy); +if (ret) { +dev_err (dev,"Failed to power on PHY: %d\n" , ret); +clk_disable_unprepare (ctrl->clks[CLK_PCLK ].clk); +return ; + } + + ctrl->enabled = true; +} + +static void inno_hdmi_starfive_disable (struct device *dev) +{ + struct stf_inno_hdmi_controller *ctrl =
dev_get_drvdata(dev);drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +3
-0+ +/* +* .enable bails out early if the pixel clock rate is unsupported or
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +1
-0+* the PHY fails to power on, leaving pclk and the PHY untouched.
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +1
-0+* Only tear down what was actually brought up, otherwise the clock
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +12
-0+* refcount underflows. +*/ +if (!ctrl->enabled) +return ; + +phy_power_off (ctrl->phy); +clk_disable_unprepare (ctrl->clks[CLK_PCLK ].clk); + ctrl->enabled = false; +} + +/* +* The DC8200 has two panels, each exposing a DP and a DPI interface, and a mux
+ * indom_vout_sysconpicks which of them drives the HDMI transmitter. Derive
+ * the mux setting from the port graph: the remote port number selects the
+ * DC8200 panel, and the remote endpoint number the interface on that panel
+ * (0 for DPI, 1 for DP). Both drive 8-bit RGB, the only format this driver
+ * currently produces.
+ */drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +9
-0+static int stf_inno_hdmi_setup_mux (struct device *dev) +{ +struct of_endpoint endpoint; +struct regmap *syscon; +u32 mask, val; +int ret; + + syscon = syscon_regmap_lookup_by_phandle(dev->of_node, + "starfive,vout-syscon");
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +8
-0+if (IS_ERR (syscon)) +return dev_err_probe (dev,PTR_ERR (syscon), + "Failed to get vout syscon\n"); + + struct device_node *ep __free(device_node) = +of_graph_get_endpoint_by_regs (dev->of_node,0 ,-1 ); +if (!ep) + return dev_err_probe(dev, -ENODEV, "No inputendpoint\n");
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +6
-0+ + struct device_node *remote __free(device_node) = +of_graph_get_remote_endpoint (ep); +if (!remote) + return dev_err_probe(dev, -ENODEV, + "Input endpoint is notconnected\n");
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +5
-0+ + ret =of_graph_parse_endpoint (remote, &endpoint); +if (ret) + return dev_err_probe(dev, ret, + "Failed to parse the remoteendpoint\n");
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +4
-0+ +if (endpoint.port >1 || endpoint.id >1 ) + return dev_err_probe(dev, -EINVAL, + "Unsupported DC8200 output%u/%u\n",
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +3
-0+ endpoint.port, endpoint.id); + +/* Data mapping: 8-bit RGB on whichever interface is in use. */
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +4
-0+ mask =VOUT_HDMI_DPI_DP_SEL |VOUT_HDMI_DP_BIT_DEPTH | + VOUT_HDMI_DP_YUV_MODE | VOUT_HDMI_DPI_BIT_DEPTH; + val =FIELD_PREP (VOUT_HDMI_DPI_DP_SEL , endpoint.id) | + FIELD_PREP(VOUT_HDMI_DP_YUV_MODE,
VOUT_HDMI_DP_YUV_MODE_RGB) |drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +1
-0+ FIELD_PREP(VOUT_HDMI_DPI_BIT_DEPTH,
VOUT_HDMI_DPI_BIT_DEPTH_8BIT);drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +7
-0+ + ret =regmap_update_bits (syscon,VOUT_SYSCFG_4 , mask, val); +if (ret) +return ret; + +/* Which DC8200 panel drives the HDMI transmitter. */ + return regmap_update_bits(syscon, VOUT_SYSCFG_8,
VOUT_HDMI_PANEL_SEL,drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +17
-0+ FIELD_PREP(VOUT_HDMI_PANEL_SEL, + endpoint.port)); +} + +static void stf_inno_hdmi_clk_disable (void *data) +{ +struct stf_inno_hdmi_controller *ctrl = data; + +clk_bulk_disable_unprepare (CLK_CTRL_NUM -1 , ctrl->clks); +} + +static void stf_inno_hdmi_rst_assert (void *data) +{ +reset_control_assert (data); +} + +static int starfive_inno_hdmi_controller_probe(struct
platform_device*pdev)drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +17
-0+{ +struct device *dev = &pdev->dev; +struct stf_inno_hdmi_controller *ctrl; +const struct inno_hdmi_plat_data *plat_data; +struct inno_hdmi *inno; +int ret; + + ctrl =devm_kzalloc (dev,sizeof (*ctrl),GFP_KERNEL ); +if (!ctrl) +return -ENOMEM ; + + ctrl->dev = dev; +platform_set_drvdata (pdev, ctrl); + + ctrl->phy =devm_phy_get (dev,NULL ); +if (IS_ERR (ctrl->phy)) + return dev_err_probe(dev, PTR_ERR(ctrl->phy),"Failed to get PHY\n");
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +4
-0+ + ctrl->tx_rst =devm_reset_control_get_exclusive (dev,NULL ); +if (IS_ERR (ctrl->tx_rst)) + return dev_err_probe(dev, PTR_ERR(ctrl->tx_rst),"failed to get tx reset\n");
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +6
-0+ +/* Populate the clock names this controller *consumes* */ + ctrl->clks[CLK_SYS ].id ="pclk" ; + ctrl->clks[CLK_M ].id ="mclk" ; + ctrl->clks[CLK_B ].id ="bclk" ; + ctrl->clks[CLK_PCLK ].id ="pixel" ;/* Generated by the PHY */
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +4
-0+ + ret =devm_clk_bulk_get (dev,CLK_CTRL_NUM , ctrl->clks); +if (ret) + return dev_err_probe(dev, ret, "Unable to getcontroller clocks\n");
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +3
-0+ +/* +* Tear the clocks and the reset down through devm, so that they outlive
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +1
-0+* everything registered after them. The bridge is added with
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +1
-0+* devm_drm_bridge_add(), and unwinding in the wrong order would leave it
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +9
-0+* registered while its clocks are already gated. +* +* The pixel clock is enabled on demand during modeset. +*/ + ret =clk_bulk_prepare_enable (CLK_CTRL_NUM -1 , ctrl->clks); +if (ret) +return ret; + + ret = devm_add_action_or_reset(dev,
stf_inno_hdmi_clk_disable, ctrl);drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +8
-0+if (ret) +return ret; + + ret =reset_control_deassert (ctrl->tx_rst); +if (ret) +return ret; + + ret = devm_add_action_or_reset(dev,
stf_inno_hdmi_rst_assert,drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +29
-0+ ctrl->tx_rst); +if (ret) +return ret; + + ret =stf_inno_hdmi_setup_mux (dev); +if (ret) +return ret; + + plat_data =of_device_get_match_data (dev); + +/* Hand off to the generic library to create the bridge. */ + inno =inno_hdmi_probe (pdev, plat_data); +if (IS_ERR (inno)) +return PTR_ERR (inno); + +return 0 ; +} + +static const struct inno_hdmi_plat_ops stf_inno_hdmi_plat_ops = { + .enable = inno_hdmi_starfive_enable, + .disable = inno_hdmi_starfive_disable, + .mode_valid = inno_hdmi_starfive_mode_valid, +}; + +static const struct inno_hdmi_plat_data stf_inno_hdmi_plat_data = { + .ops = &stf_inno_hdmi_plat_ops, +}; + +static const struct of_device_id starfive_hdmi_controller_dt_ids[] ={
drivers/gpu/drm/bridge/jh7110-inno-hdmi.c new file +18
-0+ { .compatible = "starfive,jh7110-inno-hdmi-controller", + .data = &stf_inno_hdmi_plat_data }, + {} +}; +MODULE_DEVICE_TABLE (of, starfive_hdmi_controller_dt_ids); + +struct platform_driver starfive_inno_hdmi_controller_driver = { + .probe = starfive_inno_hdmi_controller_probe, + .driver = { + .name ="starfive-inno-hdmi-controller" , + .of_match_table = starfive_hdmi_controller_dt_ids, + }, +}; +module_platform_driver (starfive_inno_hdmi_controller_driver); + +MODULE_AUTHOR ("Michal Wilczynski <[email protected]>" ); +MODULE_DESCRIPTION ("StarFive INNO HDMI Controller Driver" ); +MODULE_LICENSE ("GPL" );
PATCH v4 16/20 phy: Add common Innosilicon HDMI PHY helpers
In reply to Michal WilczynskiThe Innosilicon HDMI PHY IP is used by several SoCs. They differ in where the PHY register block sits in the register space and in which pixel clocks they support, but the pre-PLL programming sequence and the layout of its registers are the same.
Add a small library holding that shared part: the pre-PLL configuration table format, a lookup, clk_ops determine_rate and recalc_rate helpers, and the pre-PLL register programming. Callers pass a regmap, a register offset for the PHY block, and their own pixel clock table.
No driver uses it yet; the users are converted separately.
--- drivers/phy/Kconfig | 8 + drivers/phy/Makefile | 1 + drivers/phy/phy-inno-hdmi.c | 298 ++++++++++++++++++++++++++++++++++++++ include/linux/phy/inno-hdmi-phy.h | 85 +++++++++++ 4 files changed, 392 insertions(+)
drivers/phy/Kconfig +8 -0
@@ -168,6 +168,14 @@ config PHY_XGENE help This option enables support for APM X-Gene SoC multi-purpose PHY. +config PHY_INNO_HDMI + tristate + depends on GENERIC_PHY + select REGMAP + help + Common helpers for the Innosilicon HDMI PHY, shared by the SoC + drivers that instantiate it. Selected by those drivers. + source "drivers/phy/allwinner/Kconfig" source "drivers/phy/amlogic/Kconfig" source "drivers/phy/apple/Kconfig"
drivers/phy/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_PHY_COMMON_PROPS) += phy-common-props.o obj-$(CONFIG_PHY_COMMON_PROPS_TEST) += phy-common-props-test.o obj-$(CONFIG_GENERIC_PHY) += phy-core.o obj-$(CONFIG_GENERIC_PHY_MIPI_DPHY) += phy-core-mipi-dphy.o +obj-$(CONFIG_PHY_INNO_HDMI) += phy-inno-hdmi.o obj-$(CONFIG_PHY_AIROHA_PCIE) += phy-airoha-pcie.o obj-$(CONFIG_PHY_CAN_TRANSCEIVER) += phy-can-transceiver.o obj-$(CONFIG_PHY_ECONET_PCIE) += phy-econet-pcie.o
drivers/phy/phy-inno-hdmi.c new file +298 -0
298 lines not on this page · raw message
include/linux/phy/inno-hdmi-phy.h new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v4 16/20] phy: Add common Innosilicon HDMI PHY helpers
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] phy: division by zero kernel panic in recalc_rate() on register read failure --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] phy: division by zero kernel panic in recalc_rate() on register read failure --
commit 543e5d00d9e079829f4ad47de05248c127f81d1c
Author: Michal Wilczynski <[email protected]>
phy: Add common Innosilicon HDMI PHY helpers
This commit adds a common library for the Innosilicon HDMI PHY IP, which is used by several SoCs. It extracts the pre-PLL configuration table format, lookups, and clock rate helpers into shared code.
Quoted 5 lines
drivers/phy/phy-inno-hdmi.c new file +0
-0
[ ... ]
Quoted 4 lines
drivers/phy/phy-inno-hdmi.c new file +4
-0+unsigned long +inno_hdmi_phy_pre_pll_recalc_rate (const struct inno_hdmi_phy_pre_pll *pll, +unsigned long parent_rate) +{
drivers/phy/phy-inno-hdmi.c line 175
Quoted 10 lines
drivers/phy/phy-inno-hdmi.c new file +10
-0+u8 nd, no_a, no_b, no_d; +unsigned long frac, rate; +u64 vco, vco_rate; +u16 nf; + + nd =inno_read (pll,INNO_PRE_PLL_DIV_1 ) &INNO_PRE_PLL_PRE_DIV_MASK ; + nf = (inno_read (pll,INNO_PRE_PLL_DIV_2 ) & +INNO_PRE_PLL_FB_DIV_11_8_MASK ) <<8 ; + nf |=inno_read (pll,INNO_PRE_PLL_DIV_3 ); + vco = parent_rate * nf;
[Severity: High]
This is a pre-existing issue, but does this code cause an integer overflow on 32-bit architectures?
When inno_hdmi_phy_pre_pll_recalc_rate() executes, parent_rate * nf multiplies two 32-bit integers, which could silently overflow before assignment to the 64-bit vco variable.
drivers/phy/phy-inno-hdmi.c line 183
Quoted 8 lines
drivers/phy/phy-inno-hdmi.c new file +8
-0+ +if (!(inno_read (pll,INNO_PRE_PLL_DIV_2 ) & +INNO_PRE_PLL_FRAC_DIV_DISABLE )) { + frac =inno_read (pll,INNO_PRE_PLL_FRAC_DIV_7_0 ) | + (inno_read (pll,INNO_PRE_PLL_FRAC_DIV_15_8 ) <<8 ) | + (inno_read (pll,INNO_PRE_PLL_FRAC_DIV_23_16 ) <<16 ); + vco +=DIV_ROUND_CLOSEST (parent_rate * frac, +BIT (INNO_FRAC_DIV_WIDTH ));
[Severity: High]
This isn't a bug introduced by this patch, but does parent_rate * frac also massively overflow before rounding on 32-bit systems?
Since parent_rate is typically 24MHz and frac is a 24-bit divider, their product exceeds the 32-bit maximum. This causes silent truncation and leads to completely incorrect calculated VCO rates.
drivers/phy/phy-inno-hdmi.c line 189
Quoted 6 lines
drivers/phy/phy-inno-hdmi.c new file +6
-0+ } + + vco_rate = vco; + +if (inno_read (pll,INNO_PRE_PLL_CONTROL ) &INNO_PCLK_VCO_DIV_5_MASK ) { +do_div (vco, nd *5 );
[Severity: High]
Can this result in a division by zero kernel panic?
inno_read() returns 0 if regmap_read() fails. If nd evaluates to 0 due to an uninitialized register or a read failure, the denominator becomes 0.
drivers/phy/phy-inno-hdmi.c line 196
Quoted 7 lines
drivers/phy/phy-inno-hdmi.c new file +7
-0+ }else { + no_a =inno_read (pll,INNO_PCLK_DIV_AB ) &INNO_PCLK_DIV_A_MASK ; + no_b =FIELD_GET (INNO_PCLK_DIV_B_MASK , +inno_read (pll,INNO_PCLK_DIV_AB )) +2 ; + no_d =inno_read (pll,INNO_PCLK_DIV_CD ) &INNO_PCLK_DIV_D_MASK ; + +do_div (vco, nd * (no_a ==1 ? no_b : no_a) * no_d *2 );
[Severity: High]
Could this also trigger a division by zero crash?
If nd, no_a, or no_d evaluates to 0 due to read failures, the denominator becomes 0.
The legacy RK3228 driver guarded against no_a being 0 with an explicit check (if (!no_a) no_a = 1;), but it appears this protection was removed when creating this shared code.
Quoted 3 lines
drivers/phy/phy-inno-hdmi.c new file +3
-0+ } + + rate =DIV_ROUND_CLOSEST ((unsigned long )vco,1000 ) *1000 ;
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=16
Vinod Koul
maintainerRe: [PATCH v4 16/20] phy: Add common Innosilicon HDMI PHY helpers
In reply to Michal WilczynskiQuoted 11 lines · Michal Wilczynski
The Innosilicon HDMI PHY IP is used by several SoCs. They differ in where the PHY register block sits in the register space and in which pixel clocks they support, but the pre-PLL programming sequence and the layout of its registers are the same.
Add a small library holding that shared part: the pre-PLL configuration table format, a lookup,
clk_opsdetermine_rateandrecalc_ratehelpers, and the pre-PLL register programming. Callers pass a regmap, a register offset for the PHY block, and their own pixel clock table.No driver uses it yet; the users are converted separately.
Is there anything in phy patches here that has dependency with rest? If not consider splitting it up...
drivers/phy/phy-inno-hdmi.c line 96
Quoted 10 lines
drivers/phy/phy-inno-hdmi.c new file +10
-0+static u8 inno_read (const struct inno_hdmi_phy_pre_pll *pll,unsigned int reg) +{ +unsigned int val; +int ret; + + ret =regmap_read (pll->regmap,inno_reg (pll, reg), &val); +if (ret) +return 0 ; + +return val;
why not just return regmap_read()
There is no logic here, nothing. This is really not ideal. Also why add a wrapper and not use regmap directly?
Quoted 7 lines
drivers/phy/phy-inno-hdmi.c new file +7
-0+/** +* inno_hdmi_phy_pre_pll_determine_rate - clk_ops.determine_rate helper +* @pll: pre-PLL instance +* @req: rate request, updated with the rate the PHY would produce +* +* The PHY can only generate the pixel clocks described by its table, so a +* request that does not appear there is rejected rather than rounded.
drivers/phy/phy-inno-hdmi.c line 144
Quoted 10 lines
drivers/phy/phy-inno-hdmi.c new file +10
-0+* +* Return: 0 on success, -EINVAL if the rate is not supported. +*/ +int inno_hdmi_phy_pre_pll_determine_rate (const struct inno_hdmi_phy_pre_pll *pll, +struct clk_rate_request *req) +{ +const struct inno_hdmi_phy_pre_pll_config *cfg; +unsigned long rate =rounddown (req->rate,1000 ); + +for (cfg = pll->table; cfg->pixclock !=0 ; cfg++) {
Is there a chance of null/garbage if we reach end of table? You dont know the size of table, and incrementing pointer without bounds does not look good to me.
Signature · 1 line
~Vinod
Re: [PATCH v4 16/20] phy: Add common Innosilicon HDMI PHY helpers
Hi Vinod,
Quoted 11 lines · Vinod Koul
Quoted 10 lines · Michal Wilczynski
The Innosilicon HDMI PHY IP is used by several SoCs. They differ in where the PHY register block sits in the register space and in which pixel clocks they support, but the pre-PLL programming sequence and the layout of its registers are the same.
Add a small library holding that shared part: the pre-PLL configuration table format, a lookup,
clk_opsdetermine_rateandrecalc_ratehelpers, and the pre-PLL register programming. Callers pass a regmap, a register offset for the PHY block, and their own pixel clock table.
Quoted 4 lines
Quoted 1 line
No driver uses it yet; the users are converted separately.
Is there anything in phy patches here that has dependency with rest? If not consider splitting it up...
The phy patches don't depend on anything else so they apply cleanly from this series alone. The helpers and the Rockchip conversion are self contained and the JH7110 phy driver only needs its parent at runtime not at build time.
I kept everything in one series so a single posting applies and boots on its own. The patches already target three separate trees and everyone testing this has been applying the full set splitting would force them to assemble two postings in the correct order, given that the JH7110 phy driver build depends on the helpers. The v5 cover letter lists which tree each patch goes to.
That being said, the helpers and the Rockchip conversion are the two patches independent of the StarFive work - happy to send those as a separate series if you'd rather take them that way.
Quoted 14 lines
drivers/phy/phy-inno-hdmi.c line 96
Quoted 11 lines
drivers/phy/phy-inno-hdmi.c new file +10
-0+static u8 inno_read (const struct inno_hdmi_phy_pre_pll *pll,unsigned int reg) +{ +unsigned int val; +int ret; + + ret =regmap_read (pll->regmap,inno_reg (pll, reg), &val); +if (ret) +return 0 ; + +return val;why not just return
regmap_read()
Quoted 2 lines
There is no logic here, nothing. This is really not ideal. Also why add a wrapper and not use regmap directly?
The same IP block is used by both Rockchip and the JH7110 but on the JH7110 the registers sit at a 0x100 offset.That is what inno_reg() is for.
Dropping the error is wrong though - nd comes from one of those reads and then becomes the divisor in do_div(vco, nd * 5 ) so a failed read feeds in 0. I will make it return int and have recalc_rate check.
Quoted 14 lines
Quoted 14 lines
drivers/phy/phy-inno-hdmi.c new file +13
-0+/** +* inno_hdmi_phy_pre_pll_determine_rate - clk_ops.determine_rate helper +* @pll: pre-PLL instance +* @req: rate request, updated with the rate the PHY would produce +* +* The PHY can only generate the pixel clocks described by its table, so a +* request that does not appear there is rejected rather than rounded. +* +* Return: 0 on success, -EINVAL if the rate is not supported. +*/ +int inno_hdmi_phy_pre_pll_determine_rate (const struct inno_hdmi_phy_pre_pll *pll, +struct clk_rate_request *req) +{
Quoted 8 lines
drivers/phy/phy-inno-hdmi.c line 144
Quoted 4 lines
drivers/phy/phy-inno-hdmi.c new file +4
-0+const struct inno_hdmi_phy_pre_pll_config *cfg; +unsigned long rate =rounddown (req->rate,1000 ); + +for (cfg = pll->table; cfg->pixclock !=0 ; cfg++) {Is there a chance of null/garbage if we reach end of table? You dont know the size of table, and incrementing pointer without bounds does not look good to me.
Fair. For now both config tables end with a sentinel, so it cannot happen. I can add the count of the bounds though.
Quoted 2 lines
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Re: [PATCH v4 16/20] phy: Add common Innosilicon HDMI PHY helpers
Quoted 19 lines · Michal Wilczynski
Hi Vinod,
Quoted 15 lines · Vinod Koul
Quoted 11 lines · Michal Wilczynski
The Innosilicon HDMI PHY IP is used by several SoCs. They differ in where the PHY register block sits in the register space and in which pixel clocks they support, but the pre-PLL programming sequence and the layout of its registers are the same.
Add a small library holding that shared part: the pre-PLL configuration table format, a lookup,
clk_opsdetermine_rateandrecalc_ratehelpers, and the pre-PLL register programming. Callers pass a regmap, a register offset for the PHY block, and their own pixel clock table.No driver uses it yet; the users are converted separately.
Is there anything in phy patches here that has dependency with rest? If not consider splitting it up...
On second thought, I agree it will be easier for maintainers to merge, so I'll split it in v6. The PHY patches (the binding, the helpers, the Rockchip conversion and the JH7110 PHY driver) will go as a separate mini series.
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
PATCH v4 17/20 phy: rockchip: inno-hdmi: Use the common Innosilicon PHY helpers
In reply to Michal WilczynskiThe RK3328 pre-PLL programming, its table lookup and its recalc_rate and determine_rate implementations are the generic Innosilicon ones, so drop the local copies and use the shared helpers instead.
The RK3228 pre-PLL sits at different register addresses, so it keeps its own register level code and only shares the table lookup.
The now unused RK3328 pre-PLL register macros go with it, as does the local pre-PLL config lookup wrapper; both call sites already have the TMDS clock to hand and call inno_hdmi_phy_pre_pll_lookup() directly.
The RK3328 recalc_rate used to log the pre-PLL output as "vco". The shared helper logs it too, and reports the actual VCO frequency alongside the rate, which is the value with the 1.4-3.2 GHz constraint.
The register writes, their order and the values written are unchanged. No functional change intended.
--- drivers/phy/rockchip/Kconfig | 1 + drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 168 ++++---------------------- 2 files changed, 25 insertions(+), 144 deletions(-)
drivers/phy/rockchip/Kconfig +1 -0
@@ -34,6 +34,7 @@ config PHY_ROCKCHIP_INNO_HDMI depends on COMMON_CLK depends on HAS_IOMEM select GENERIC_PHY + select PHY_INNO_HDMI help Enable this to support the Rockchip Innosilicon HDMI PHY.
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +24 -144
281 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v4 17/20] phy: rockchip: inno-hdmi: Use the common Innosilicon PHY helpers
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines
The RK3328 pre-PLL programming, its table lookup and its
recalc_rateanddetermine_rateimplementations are the generic Innosilicon ones, so drop the local copies and use the shared helpers instead.The RK3228 pre-PLL sits at different register addresses, so it keeps its own register level code and only shares the table lookup.
The now unused RK3328 pre-PLL register macros go with it, as does the local pre-PLL config lookup wrapper; both call sites already have the TMDS clock to hand and call
inno_hdmi_phy_pre_pll_lookup()directly.
Quoted 8 lines
The RK3328
recalc_rateused to log the pre-PLL output as "vco". The shared helper logs it too, and reports the actual VCO frequency alongside the rate, which is the value with the 1.4-3.2 GHz constraint.The register writes, their order and the values written are unchanged. No functional change intended.
Signed-off-by Michal Wilczynski <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=17
PATCH v4 18/20 phy: starfive: Add jh7110-inno-hdmi-phy driver
In reply to Michal WilczynskiAdd the HDMI PHY driver for the StarFive JH7110.
This driver binds to the starfive,jh7110-inno-hdmi-phy node and gets its regmap from the parent. It has no dependencies on voutcrg, only on its reference oscillator (xin24m), which breaks the probe-time circular dependency.
This driver provides two main functions:
- Clock Provider: It registers clk_ops to provide the variable pixel clock. The .set_rate operation configures the Pre-PLL registers (0x1a0+) based on the requested rate.
- PHY Provider: It registers phy_ops for the controller. The .power_on op configures and enables the Post-PLL and other analog blocks (BIAS, LDO, Serializer, etc.).
The clock ops reach registers in the window shared with the HDMI controller, and access to that window is gated by the controller's system clock, which only the sibling controller driver holds. The clock framework walks every registered clock regardless of which drivers have bound, so deliberately do not implement .is_prepared, which lets the framework fall back to the software prepare count, and return the cached rate from .recalc_rate whenever the clock is not prepared. Without this, clk_disable_unused() reads a PHY register with that clock gated and the resulting stalled bus transaction wedges the CPU hard enough that it stops responding to NMIs. It is reproducible by building the bridge driver as a module so that the controller has not bound by then.
The JH7110 instantiates the same Innosilicon IP as the Rockchip RK3328, with the PHY register block shifted by 0x100 because it sits behind the HDMI controller in the shared register space. The pre-PLL programming therefore comes from the common Innosilicon helpers; this driver adds the JH7110 pixel clock table, the post-PLL and the analog configuration.
--- drivers/phy/starfive/Kconfig | 20 + drivers/phy/starfive/Makefile | 1 + drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 579 ++++++++++++++++++++++++++++ 3 files changed, 600 insertions(+)
drivers/phy/starfive/Kconfig +20 -0
@@ -25,6 +25,26 @@ config PHY_STARFIVE_JH7110_DPHY_TX system. If M is selected, the module will be called phy-jh7110-dphy-tx.ko. +config PHY_STARFIVE_JH7110_INNO_HDMI + tristate "Starfive JH7110 INNO HDMI PHY" + select PHY_INNO_HDMI + depends on COMMON_CLK + select GENERIC_PHY + help + This option enables the driver for the analog HDMI PHY (Physical + Layer) on the StarFive JH7110 SoC. + + This driver binds to a child node of the 'starfive,jh7110-hdmi-subsystem' + parent driver and gets its register map from that parent. + + It is responsible for two main functions: + 1. PHY Provider: It provides standard PHY operations (.power_on, + .power_off) for the HDMI controller (bridge) driver. This + involves configuring the Post-PLL and analog TMDS blocks. + 2. Clock Provider: It registers as a clock provider to supply the + variable pixel clock (hdmi_pclk) to the HDMI controller and + the VOUT subsystem, which it generates using the Pre-PLL. + config PHY_STARFIVE_JH7110_PCIE tristate "Starfive JH7110 PCIE 2.0/USB 3.0 PHY support" depends on HAS_IOMEM
drivers/phy/starfive/Makefile +1 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_RX) += phy-jh7110-dphy-rx.o obj-$(CONFIG_PHY_STARFIVE_JH7110_DPHY_TX) += phy-jh7110-dphy-tx.o +obj-$(CONFIG_PHY_STARFIVE_JH7110_INNO_HDMI) += phy-jh7110-inno-hdmi.o obj-$(CONFIG_PHY_STARFIVE_JH7110_PCIE) += phy-jh7110-pcie.o obj-$(CONFIG_PHY_STARFIVE_JH7110_USB) += phy-jh7110-usb.o
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +579 -0
579 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v4 18/20] phy: starfive: Add jh7110-inno-hdmi-phy driver
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [High] clk: starfive: Unsafe hardware access in .set_rate causes CPU stall during probe - [Medium] clk…
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] clk: starfive: Unsafe hardware access in .set_rate causes CPU stall during probe
- [Medium] clk: starfive: Pre-PLL is unconditionally powered on in .set_rate causing a power leak
- [Medium] clk: starfive: Resource lifecycle inversion with refoclk and devres clock provider
- [Medium] clk: starfive: Data race on cached clock state variables between CCF and PHY frameworks --
commit 5469b7909aa9bb8690ee9fbfe18ef57f4c2d5820
Author: Michal Wilczynski <[email protected]>
phy: starfive: Add jh7110-inno-hdmi-phy driver
Add the HDMI PHY driver for the StarFive JH7110.
Quoted 6 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +0
-0@@ -0,0 +1,579 @@
[ ... ]
Quoted 12 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +12
-0+static int starfive_hdmi_phy_clk_set_rate (struct clk_hw *hw,unsigned long rate, +unsigned long parent_rate) +{ +struct starfive_hdmi_phy *inno =to_starfive_hdmi_phy (hw); +const struct inno_hdmi_phy_pre_pll_config *cfg; + +/* +* The JH7110 only drives 8bpc, so the TMDS clock always matches the +* pixel clock. +*/ + cfg =inno_hdmi_phy_pre_pll_lookup (&inno->pre_pll, rate, rate); +if (IS_ERR (cfg))
drivers/phy/starfive/phy-jh7110-inno-hdmi.c line 312
Quoted 10 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +10
-0+return PTR_ERR (cfg); + +dev_dbg (inno->dev,"%s rate %lu tmdsclk %lu\n" , + __func__, rate, cfg->tmdsclock); + +if (inno->pixclock == rate && inno->tmdsclock == cfg->tmdsclock) +return 0 ; + +inno_update_bits (inno,STF_INNO_BIAS_CONTROL , +STF_INNO_BIAS_ENABLE ,STF_INNO_BIAS_ENABLE );
[Severity: High]
Does this execute an unclocked hardware access if the clock is gated?
The commit message notes that accessing the PHY registers while the HDMI controller's system clock is gated wedges the CPU. Because starfive_hdmi_phy_probe() unconditionally calls clk_set_rate() before the sibling HDMI bridge driver has bound and enabled the shared system clock, the hardware is gated.
Could a clk_hw_is_prepared(hw) check be added here similarly to how it was used in .recalc_rate?
drivers/phy/starfive/phy-jh7110-inno-hdmi.c line 317
Quoted 5 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +5
-0+inno_write (inno,STF_INNO_RX_CONTROL ,STF_INNO_RX_ENABLE ); + +inno_hdmi_phy_pre_pll_power_down (&inno->pre_pll, true); +inno_hdmi_phy_pre_pll_configure (&inno->pre_pll, cfg); +inno_hdmi_phy_pre_pll_power_down (&inno->pre_pll, false);
[Severity: Medium]
Will the Pre-PLL remain powered on indefinitely if the clock isn't prepared?
Since .set_rate turns the Pre-PLL on, and the driver omits the .is_prepared callback in starfive_hdmi_phy_clk_ops, the CCF relies on the software prepare count (which is 0). When clk_disable_unused() runs, it skips unprepared clocks with a 0 count, meaning .unprepare() won't be invoked to turn the PLL off.
drivers/phy/starfive/phy-jh7110-inno-hdmi.c line 320
Quoted 3 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +3
-0+ + inno->pixclock = rate; + inno->tmdsclock = cfg->tmdsclock;
[Severity: Medium]
Could there be a data race on inno->pixclock and inno->tmdsclock between the CCF and PHY frameworks?
The CCF callbacks (such as .set_rate and .recalc_rate) read and write inno->pixclock and inno->tmdsclock under the CCF core's prepare_lock. Concurrently, the PHY framework operations (such as .power_off calling starfive_hdmi_phy_power_down()) write to these exact same variables under the PHY framework's internal phy->mutex.
If userspace triggers a sysfs clock summary read (triggering .recalc_rate) concurrently with a DRM display modeset or power down sequence, could .recalc_rate overwrite the 0 set by power_down with stale hardware values? This might prevent a subsequent set_rate from applying the correct settings.
drivers/phy/starfive/phy-jh7110-inno-hdmi.c line 331
Quoted 11 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +11
-0+ +return 0 ; +} + +static const struct clk_ops starfive_hdmi_phy_clk_ops = { + .prepare = starfive_hdmi_phy_clk_prepare, + .unprepare = starfive_hdmi_phy_clk_unprepare, + .recalc_rate = starfive_hdmi_phy_clk_recalc_rate, + .determine_rate = starfive_hdmi_phy_clk_determine_rate, + .set_rate = starfive_hdmi_phy_clk_set_rate, +};
[Severity: Medium]
The omission of the .is_prepared callback here is what causes clk_disable_unused() to assume the clock is already physically disabled, leading to the power leak mentioned in .set_rate.
Quoted 7 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +7
-0+ +static void starfive_hdmi_phy_power_down (struct starfive_hdmi_phy *inno) +{ +inno_write (inno,STF_INNO_TMDS_CONTROL ,0x00 ); +inno_write (inno,STF_INNO_SERIALIER_CONTROL ,0x00 ); +inno_write (inno,STF_INNO_LDO_CONTROL ,0x00 ); + inno_update_bits(inno, STF_INNO_BIAS_CONTROL,
drivers/phy/starfive/phy-jh7110-inno-hdmi.c line 348
Quoted 10 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +10
-0+ STF_INNO_BIAS_ENABLE, 0x00); +inno_write (inno,STF_INNO_RX_CONTROL ,0x00 ); + +/* Power down Post-PLL */ +inno_update_bits (inno,STF_INNO_POST_PLL_DIV_1 , +STF_INNO_POST_PLL_POWER_DOWN , +STF_INNO_POST_PLL_POWER_DOWN ); + + inno->tmdsclock =0 ; + inno->pixclock =0 ;
[Severity: Medium]
This is where the concurrent writes from the PHY framework happen, as noted in the previous comment about the data race with the CCF callbacks.
Quoted 1 line
+}
[ ... ]
Quoted 2 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +2
-0+static int starfive_hdmi_phy_probe (struct platform_device *pdev) +{
[ ... ]
drivers/phy/starfive/phy-jh7110-inno-hdmi.c line 522
Quoted 7 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +7
-0+ ret =of_clk_add_provider (dev->of_node, of_clk_src_simple_get, inno->phyclk); +if (ret) { +dev_err (dev,"Failed to add clock provider: %d\n" , ret); + goto err_disable_refoclk; + } + + ret =clk_set_rate (inno->phyclk,297000000 );
[Severity: High]
This unconditionally triggers a rate change during probe, which leads to the unsafe hardware access in .set_rate described earlier, since the sibling bridge driver is not guaranteed to have enabled the shared system clock yet.
Quoted 18 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +18
-0+if (ret) { +dev_err (dev,"Failed to set default rate: %d\n" , ret); + goto err_del_clk_provider; + } + +/* Create and register the PHY provider */ + inno->phy =devm_phy_create (inno->dev,NULL , &starfive_hdmi_phy_ops); +if (IS_ERR (inno->phy)) { + ret =PTR_ERR (inno->phy); +dev_err (inno->dev,"failed to create HDMI PHY: %d\n" , ret); + goto err_del_clk_provider; + } + +phy_set_drvdata (inno->phy, inno); + + phy_provider =devm_of_phy_provider_register (inno->dev, + of_phy_simple_xlate); + ret =PTR_ERR_OR_ZERO (phy_provider);
drivers/phy/starfive/phy-jh7110-inno-hdmi.c line 550
Quoted 10 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +10
-0+if (ret) + goto err_del_clk_provider; + +return 0 ; + +err_del_clk_provider: +of_clk_del_provider (dev->of_node); +err_disable_refoclk: +clk_disable_unprepare (inno->refoclk); +return ret;
[Severity: Medium]
Is it safe to manually disable the reference clock here before devres unregisters the clock and PHY providers?
The clock and PHY providers are registered using devm_clk_register() and devm_of_phy_provider_register(). Disabling refoclk manually here (and in remove) creates a window where operations could execute with a disabled parent clock if a consumer triggers a clock or PHY operation before devres cleans up the providers.
Would it be better to bind the refoclk enable state to devres via devm_clk_get_enabled() or devm_add_action_or_reset()?
drivers/phy/starfive/phy-jh7110-inno-hdmi.c line 558
Quoted 8 lines
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +8
-0+} + +static void starfive_hdmi_phy_remove (struct platform_device *pdev) +{ +struct starfive_hdmi_phy *inno =platform_get_drvdata (pdev); + +of_clk_del_provider (pdev->dev.of_node); +clk_disable_unprepare (inno->refoclk);
[Severity: Medium]
As in the probe error path, manually disabling the reference clock before devres unregisters the providers creates a use-after-disable window.
Quoted 1 line
+}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=18
Re: [PATCH v4 18/20] phy: starfive: Add jh7110-inno-hdmi-phy driver
In reply to Michal Wilczynskidrivers/phy/starfive/phy-jh7110-inno-hdmi.c line 526
Quoted 8 lines · Michal Wilczynski
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +7
-0+static int starfive_hdmi_phy_probe (struct platform_device *pdev) +{ + ret =clk_set_rate (inno->phyclk,297000000 ); +if (ret) { +dev_err (dev,"Failed to set default rate: %d\n" , ret); + goto err_del_clk_provider; + }
Hi Michal,
Can we drop these 5 lines?
When my 4K monitor comes up in mode (3840x2160@30, 297 MHz) the screen stays blank.
When the first real modeset requests a mode whose pixel clock is also 297 MHz, clk_set_rate(hdmi_pclk, 297000000) then sees cur == want and does nothing. So the pre-PLL is never actually programmed.
Without these 5 lines inno->pixclock stays 0,
so the first modeset's clk_set_rate() always runs .set_rate() for real.
Together with my forgotten fix from May we can have working 4K@30 on the VF2.
https://lore.kernel.org/all/[email protected]/
Best
-Dominique
Re: [PATCH v4 18/20] phy: starfive: Add jh7110-inno-hdmi-phy driver
Hi Dominique,
Quoted 21 lines · Dominique Belhachemi
drivers/phy/starfive/phy-jh7110-inno-hdmi.c line 526
Quoted 8 lines · Michal Wilczynski
drivers/phy/starfive/phy-jh7110-inno-hdmi.c new file +7
-0+static int starfive_hdmi_phy_probe (struct platform_device *pdev) +{ + ret =clk_set_rate (inno->phyclk,297000000 ); +if (ret) { +dev_err (dev,"Failed to set default rate: %d\n" , ret); + goto err_del_clk_provider; + }Hi Michal,
Can we drop these 5 lines?
When my 4K monitor comes up in mode (3840x2160@30, 297 MHz) the screen stays blank.When the first real modeset requests a mode whose pixel clock is also 297 MHz,
clk_set_rate(hdmi_pclk, 297000000)then sees cur == want and does nothing. So the pre-PLL is never actually programmed.
Quoted 5 lines
Without these 5 lines
inno->pixclockstays 0,
so the first modeset'sclk_set_rate()always runs .set_rate() for real.Together with my forgotten fix from May we can have working 4K@30 on the VF2.
https://lore.kernel.org/all/[email protected]/
Yeah, these lines are a problem in another way too. Marek Szyprowski reported that v4 hangs when everything is built as modules, which is what made me look at them.
The write lands in registers gated by the controller's system clock, inside PD_VOUT and the PHY holds neither - it cannot hold that clock without creating a probe cycle with voutcrg. His config is as follows:CONFIG_CLK_STARFIVE_JH7110_VOUT=y with the vout subsystem, hdmi subsystem, controller and phy all as modules so voutcrg is up long before the PHY arrives from userspace. If nothing is holding hdmi_tx_sys by then - clk_disable_unused() gates it at late_initcall_sync and the write wedges the bus. I could not reproduce his exact failure, but could reproduce this with fw_devlink=off hopefully this is fixing his issue as well.
Anyway this code will be removed in v5.
Quoted 4 lines
Best
-Dominique
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
PATCH v4 19/20 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 rather than by whichever consumer happens to probe first, 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. This lets the PHY (clock provider, depending only on xin24m) and the controller (clock consumer) probe independently, breaking the circular clock dependency with 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 {
@@ -351,6 +430,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,
@@ -629,3 +742,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 v4 19/20] riscv: dts: starfive: jh7110: Update DT for display subsystem
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] dts: CMA allocation failure on 1GB boards - [Medium] dts: missing 'status = "disabled"' in SoC…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] dts: CMA allocation failure on 1GB boards
- [Medium] dts: missing 'status = "disabled"' in SoC DTSI for display IPs
- [Low] dts: redundant reg property on display-subsystem bus node
--
commit d9fbb93d7964da0ec9e48356030bc459050f3218
Author: Michal Wilczynski <[email protected]>
riscv: dts: starfive: jh7110: Update DT for display subsystem
This commit activates the display subsystem on the JH7110 SoC by describing the video output subsystem, HDMI block, and voutcrg in the device tree. It restructures the HDMI node into a container with phy and controller children to break a circular clock dependency. Additionally, the CMA pool is expanded and constrained to memory addressable by the display controller.
Quoted 15 lines
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +7
-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,
arch/riscv/boot/dts/starfive/jh7110-common.dtsi memory@40000000 { · line 52
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +10
-0+ * 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>;
[Severity: High]
Will this unconditionally fail to allocate the CMA pool on 1GB boards?
On boards like the 1GB Milk-V Mars, physical RAM starts at 0x40000000 and ends at 0x80000000. With alloc-ranges starting at 0x70000000, there is only 256MB of physical memory available within the requested bounds, making a 512MB allocation mathematically impossible.
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +4
-0+ linux,cma-default; + }; + }; +
[ ... ]
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-0
[ ... ]
Quoted 13 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-9@@ -1199,22 +1200,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>;
arch/riscv/boot/dts/starfive/jh7110.dtsi csi_phy: phy@19820000 { · line 1206
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +4
-6- 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;
[Severity: Low]
Is this reg property redundant on the bus node?
It assigns a memory region to a bus node that does not own configuration registers, simply to represent the aggregated bounds of its children. The dc8200 child claims the exact same starting physical registers.
arch/riscv/boot/dts/starfive/jh7110.dtsi csi_phy: phy@19820000 { · line 1215
Quoted 9 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +8
-0+ #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";
[Severity: Medium]
Should this SoC-level IP definition include status = "disabled"?
Custom boards that include jh7110.dtsi but do not include jh7110-common.dtsi will attempt to probe this IP by default. Headless boards lacking physical HDMI connectors and necessary board-level pinmuxing may experience probe errors or unwanted resource consumption.
Quoted 3 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +3
-0+ reg = <0x0 0x29400000 0x0 0x2800>; + clocks = <&voutcrg JH7110_VOUTCLK_DC8200_CORE>, + <&voutcrg JH7110_VOUTCLK_DC8200_AXI>,
[ ... ]
arch/riscv/boot/dts/starfive/jh7110.dtsi csi_phy: phy@19820000 { · line 1234
Quoted 8 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +8
-0+ 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";
[Severity: Medium]
Should the hdmi_subsystem IP definition also be disabled by default at the SoC level?
Like the dc8200 node above, enabling this by default in the SoC devicetree may cause unintended probe attempts on boards that do not utilize the display subsystem.
Quoted 3 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +3
-0+ reg = <0x0 0x29590000 0x0 0x4000>; + + hdmi_controller: controller {
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=19
Icenowy Zheng
maintainerRe: [PATCH v4 19/20] riscv: dts: starfive: jh7110: Update DT for display subsystem
In reply to Michal WilczynskiQuoted 37 lines · 在 2026-09-15二的 17:32 +0200,Michal Wilczynski写道:
Activate the display subsystem by describing the video output subsystem,
which the documentation callsdom_vout_top, as a bus node covering the
whole0x29400000region, 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
thePD_VOUTpower domain. Modelling it this way keeps a shared gate owned
by the block that shares it rather than by whichever consumer happens to
probe first, 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
andhdmi_controllerchildren. This lets the PHY (clock provider, depending only on xin24m) and the controller (clock consumer) probe independently, breaking the circular clock dependency with voutcrg.voutcrg consumes the pixel clock from the
&hdmi_phynode 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.
Quoted 6 lines
CMA is enlarged and constrained to memory the display controller can address, because the default pool is too small for its framebuffers.
Co-developed-by Dominique Belhachemi <[email protected]>Signed-off-by Dominique Belhachemi <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>
``` Tested-by: Icenowy Zheng <[email protected]> ```
But,
Quoted 39 lines
---
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 +0
-0index
a7a1c09a2c9075711f3a214a49618911fdc7b421..a4c3daf712a63b177f744e8c613416d22e0c9dbd100644arch/riscv/boot/dts/starfive/jh7110-common.dtsi +0
-0@@ -33,6 +33,27 @@ memory@40000000 { bootph-pre-ram; };arch/riscv/boot/dts/starfive/jh7110-common.dtsi +7
-0+ reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* + * The display controller allocates its framebuffersfrom CMA,
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +1
-0+ * and the default pool is too small for them. Keepthe pool
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +1
-0+ * inside the range the controller can address; itfits in the
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +8
-0+ * 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>;
arch/riscv/boot/dts/starfive/jh7110-common.dtsi memory@40000000 { · line 56
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +4
-0+ linux,cma-default; + }; + }; +
I don't know whether constraining the CMA pool in the DT is a good idea.
Thanks,
Icenowy
Quoted 315 lines
gpio-restart {
compatible = "gpio-restart"; gpios = <&sysgpio 35GPIO_ACTIVE_HIGH>;arch/riscv/boot/dts/starfive/jh7110-common.dtsi +11
-0@@ -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 {arch/riscv/boot/dts/starfive/jh7110-common.dtsi +23
-0+ 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>;
};arch/riscv/boot/dts/starfive/jh7110-common.dtsi +0
-0@@ -99,8 +155,31 @@ &gmac1_rmii_refin { clock-frequency = <50000000>; };
-&hdmitx0_pixelclk {arch/riscv/boot/dts/starfive/jh7110-common.dtsi +25
-1- 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 {arch/riscv/boot/dts/starfive/jh7110-common.dtsi +0
-0@@ -351,6 +430,40 @@ &syscrg { };
&sysgpio {arch/riscv/boot/dts/starfive/jh7110-common.dtsi +3
-0+ hdmi_pins: hdmi-0 { + hdmi-cec-pins { + pinmux = <GPIOMUX(14,
GPOUT_SYS_HDMI_CEC_SDA,arch/riscv/boot/dts/starfive/jh7110-common.dtsi +1
-0+
GPOEN_SYS_HDMI_CEC_SDA,arch/riscv/boot/dts/starfive/jh7110-common.dtsi +1
-0+
GPI_SYS_HDMI_CEC_SDA)>;arch/riscv/boot/dts/starfive/jh7110-common.dtsi +29
-0+ 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,arch/riscv/boot/dts/starfive/jh7110-common.dtsi +4
-0@@ -629,3 +742,7 @@ &U74_3 { &U74_4 { cpu-supply = <&vdd_cpu>; }; + +&voutcrg { + status = "okay"; +};arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-0index
9c3e4598747eb5541effe697044484715569a285..bc2470963520eef30d7524370fcb013f0631f509100644arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-0@@ -290,12 +290,6 @@ gmac1_rmii_refin: gmac1-rmii-refin-clock { #clock-cells = <0>; };arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-6- hdmitx0_pixelclk: hdmitx0-pixel-clock { - compatible = "fixed-clock"; - clock-output-names = "hdmitx0_pixelclk"; - #clock-cells = <0>; - }; -
i2srx_bclk_ext: i2srx-bclk-ext-clock { compatible = "fixed-clock"; clock-output-names = "i2srx_bclk_ext";arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-0@@ -352,6 +346,13 @@ tdm_ext: tdm-ext-clock { #clock-cells = <0>; };arch/riscv/boot/dts/starfive/jh7110.dtsi +7
-0+ xin24m: xin24m-clock { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + clock-output-names = "xin24m"; + }; +soc {
compatible = "simple-bus";
interrupt-parent = <&plic>;arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-0@@ -1199,22 +1200,84 @@ csi_phy: phy@19820000 { #phy-cells = <0>; };arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-5- 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>,arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1- <&syscrg
JH7110_SYSCLK_VOUT_TOP_AXI>,arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1- <&syscrg
JH7110_SYSCLK_VOUT_TOP_HDMITX0_MCLK>,arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1- <&syscrg
JH7110_SYSCLK_I2STX0_BCLK>,arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-3- <&hdmitx0_pixelclk>; - clock-names = "vout_src", "vout_top_ahb", - "vout_top_axi","
vout_top_hdmitx0_mclk",arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1- "i2stx0_bclk","
hdmitx0_pixelclk";arch/riscv/boot/dts/starfive/jh7110.dtsi +0
-1- resets = <&syscrg
JH7110_SYSRST_VOUT_TOP_SRC>;arch/riscv/boot/dts/starfive/jh7110.dtsi +2
-2- #clock-cells = <1>; - #reset-cells = <1>; + vout_subsystem: display-subsystem@29400000 { + compatible = "starfive,jh7110-vout-subsystem";
arch/riscv/boot/dts/starfive/jh7110.dtsi +5
-0+ reg = <0x0 0x29400000 0x0 0x200000>; + ranges; + #address-cells = <2>; + #size-cells = <2>; + clocks = <&syscrg
JH7110_SYSCLK_NOC_BUS_DISP_AXI>;arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ dma-noncoherent;power-domains = <&pwrc
JH7110_PD_VOUT>;arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ resets = <&syscrg
JH7110_SYSRST_NOC_BUS_DISP_AXI>;arch/riscv/boot/dts/starfive/jh7110.dtsi +3
-0+ + dc8200: display@29400000 { + compatible = "starfive,jh7110-dc8200", "verisilicon,dc";
arch/riscv/boot/dts/starfive/jh7110.dtsi +2
-0+ reg = <0x0 0x29400000 0x0 0x2800>; + clocks = <&voutcrg
JH7110_VOUTCLK_DC8200_CORE>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&voutcrg
JH7110_VOUTCLK_DC8200_AXI>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&voutcrg
JH7110_VOUTCLK_DC8200_AHB>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&voutcrg
JH7110_VOUTCLK_DC8200_PIX0>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&voutcrg
JH7110_VOUTCLK_DC8200_PIX1>;arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ clock-names = "core", "axi", "ahb","pix0", "pix1";
arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ assigned-clocks = <&voutcrg
JH7110_VOUTCLK_DC8200_PIX0>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&voutcrg
JH7110_VOUTCLK_DC8200_PIX1>;arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ assigned-clock-parents =<
&hdmi_phy>, <&hdmi_phy>;arch/riscv/boot/dts/starfive/jh7110.dtsi +2
-0+ interrupts = <95>; + resets = <&voutcrg
JH7110_VOUTRST_DC8200_CORE>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&voutcrg
JH7110_VOUTRST_DC8200_AXI>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&voutcrg
JH7110_VOUTRST_DC8200_AHB>;arch/riscv/boot/dts/starfive/jh7110.dtsi +5
-0+ reset-names = "core", "axi", "ahb"; + }; + + hdmi_subsystem: hdmi@29590000 { + compatible = "starfive,jh7110-hdmi-subsystem";
arch/riscv/boot/dts/starfive/jh7110.dtsi +5
-0+ reg = <0x0 0x29590000 0x0 0x4000>; + + hdmi_controller: controller { + compatible = + "starfive,jh7110-inno-hdmi-controller";
arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ clocks = <&voutcrg
JH7110_VOUTCLK_HDMI_TX_SYS>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&voutcrg
JH7110_VOUTCLK_HDMI_TX_MCLK>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&voutcrg
JH7110_VOUTCLK_HDMI_TX_BCLK>,arch/riscv/boot/dts/starfive/jh7110.dtsi +2
-0+ <&hdmi_phy>; + clock-names = "pclk","mclk", "bclk", "pixel";
arch/riscv/boot/dts/starfive/jh7110.dtsi +3
-0+ interrupts = <99>; + phys = <&hdmi_phy>; + resets = <&voutcrg
JH7110_VOUTRST_HDMI_TX_HDMI>;arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ starfive,vout-syscon =<
&vout_syscon>;arch/riscv/boot/dts/starfive/jh7110.dtsi +4
-0+ }; + + hdmi_phy: phy { + compatible ="starfive,jh7110-inno-hdmi-phy";
arch/riscv/boot/dts/starfive/jh7110.dtsi +8
-0+ clocks = <&xin24m>; + #clock-cells = <0>; + #phy-cells = <0>; + }; + }; + + vout_syscon: syscon@295b0000 { + compatible = "starfive,jh7110-vout-syscon", "syscon";
arch/riscv/boot/dts/starfive/jh7110.dtsi +5
-0+ reg = <0x0 0x295b0000 0x0 0x10000>; + }; + + voutcrg: clock-controller@295c0000 { + compatible = "starfive,jh7110-voutcrg";
arch/riscv/boot/dts/starfive/jh7110.dtsi +2
-0+ reg = <0x0 0x295c0000 0x0 0x10000>; + clocks = <&syscrg
JH7110_SYSCLK_VOUT_SRC>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&syscrg
JH7110_SYSCLK_VOUT_TOP_AHB>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&syscrg
JH7110_SYSCLK_VOUT_TOP_AXI>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&syscrg
JH7110_SYSCLK_VOUT_TOP_HDMITX0_MCLK>,arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ <&syscrg
JH7110_SYSCLK_I2STX0_BCLK>,arch/riscv/boot/dts/starfive/jh7110.dtsi +2
-0+ <&hdmi_phy>; + clock-names = "vout_src","
vout_top_ahb",arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ "vout_top_axi","
vout_top_hdmitx0_mclk",arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ "i2stx0_bclk","
hdmitx0_pixelclk";arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ power-domains = <&pwrc
JH7110_PD_VOUT>;arch/riscv/boot/dts/starfive/jh7110.dtsi +1
-0+ resets = <&syscrg
JH7110_SYSRST_VOUT_TOP_SRC>;arch/riscv/boot/dts/starfive/jh7110.dtsi +3
-0+ #clock-cells = <1>; + #reset-cells = <1>; + };};
pcie0: pcie@940000000 {
Re: [PATCH v4 19/20] riscv: dts: starfive: jh7110: Update DT for display subsystem
Quoted 98 lines · Icenowy Zheng
Quoted 37 lines · 在 2026-09-15二的 17:32 +0200,Michal Wilczynski写道:
Activate the display subsystem by describing the video output subsystem,
which the documentation callsdom_vout_top, as a bus node covering the
whole0x29400000region, 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
thePD_VOUTpower domain. Modelling it this way keeps a shared gate owned
by the block that shares it rather than by whichever consumer happens to
probe first, 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
andhdmi_controllerchildren. This lets the PHY (clock provider, depending only on xin24m) and the controller (clock consumer) probe independently, breaking the circular clock dependency with voutcrg.voutcrg consumes the pixel clock from the
&hdmi_phynode 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.Quoted 6 lines
CMA is enlarged and constrained to memory the display controller can address, because the default pool is too small for its framebuffers.
Co-developed-by Dominique Belhachemi <[email protected]>Signed-off-by Dominique Belhachemi <[email protected]>Signed-off-by Michal Wilczynski <[email protected]>``` Tested-by: Icenowy Zheng <[email protected]> ```But,
Quoted 39 lines
--- 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 +0
-0index
a7a1c09a2c9075711f3a214a49618911fdc7b421..a4c3daf712a63b177f744e8c613416d22e0c9dbd100644arch/riscv/boot/dts/starfive/jh7110-common.dtsi +8
-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. Keepthe pool
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +1
-0+ * inside the range the controller can address; itfits in the
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +8
-0+ * 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>;arch/riscv/boot/dts/starfive/jh7110-common.dtsi memory@40000000 { · line 56
Quoted 4 lines
arch/riscv/boot/dts/starfive/jh7110-common.dtsi +4
-0+ linux,cma-default; + }; + }; +I don't know whether constraining the CMA pool in the DT is a good idea.
Quoted 3 lines
Thanks,
Icenowy
So I've tested the version without alloc-ranges and some of the modetest runs failed especially the higher resolutions. It seems this is because without alloc-ranges __reserved_mem_alloc_size() allocates top down with MEMBLOCK_ALLOC_ANYWHERE so the pool lands above 4 GB, which the DC8200 cannot reach - vs_dc.c sets a 32-bit DMA mask.
25 of the 42 advertised modes failed with "failed to create dumb buffer:
Cannot allocate memory" - every 4K and 1080p mode, down to 1360x768. Only 1280x800 and below survive.
So the range seems to be a hardware limit which is why I think it belongs in the DT. I'd like to keep it in v6.
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
PATCH v4 20/20 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+)
MAINTAINERS +13 -0
@@ -26072,6 +26072,19 @@ 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/mfd/starfive,jh7110-hdmi-subsystem.yaml +F: Documentation/devicetree/bindings/phy/starfive,jh7110-inno-hdmi-phy.yaml +F: Documentation/devicetree/bindings/soc/starfive/starfive,jh7110-vout-subsystem.yaml +F: drivers/gpu/drm/bridge/jh7110-inno-hdmi.c +F: drivers/phy/starfive/phy-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
Quoted 5 lines · Michal Wilczynski
Testing
=======Tested on a VisionFive 2 v1.3B using modetest.
I.. got nothing. I did have to manually modprobe the modules, but unless I am doing something wrong.. I didn't get anything and modetest just gave -2.
Quoted 54 lines
---
Michal Wilczynski (20):
dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller
dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem
dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem drm/bridge: inno-hdmi: Split probe out of bind
drm/bridge: inno-hdmi: Allow the register map to come from a parent 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
soc: starfive: Add jh7110-hdmi-subsystem driver
soc: starfive: Add jh7110-vout-subsystem driver
clk: starfive: jh7110-vout: Allow pixel clock rate propagation drm/bridge: starfive: Add JH7110 HDMI controller driver
phy: Add common Innosilicon HDMI PHY helpers
phy: rockchip: inno-hdmi: Use the common Innosilicon PHY helpers
phy: starfive: Add jh7110-inno-hdmi-phy driver
riscv: dts: starfive: jh7110: Update DT for display subsystem
MAINTAINERS: Add StarFive JH7110 display subsystem entry.../starfive,jh7110-inno-hdmi-controller.yaml | 121 +++++ .../bindings/display/verisilicon,dc.yaml | 1 + .../mfd/starfive,jh7110-hdmi-subsystem.yaml | 95 ++++ .../phy/starfive,jh7110-inno-hdmi-phy.yaml | 49 ++ .../soc/starfive/starfive,jh7110-syscon.yaml | 1 + .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 ++++++++ MAINTAINERS | 13 + arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 121 ++++- arch/riscv/boot/dts/starfive/jh7110.dtsi | 105 +++- drivers/clk/starfive/clk-starfive-jh7110-vout.c | 6 +- drivers/gpu/drm/bridge/Kconfig | 11 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/inno-hdmi.c | 112 +++- drivers/gpu/drm/bridge/jh7110-inno-hdmi.c | 297 +++++++++++ drivers/phy/Kconfig | 8 + drivers/phy/Makefile | 1 + drivers/phy/phy-inno-hdmi.c | 298 +++++++++++ drivers/phy/rockchip/Kconfig | 1 + drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 168 +----- drivers/phy/starfive/Kconfig | 20 + drivers/phy/starfive/Makefile | 1 + drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 579 +++++++++++++++++++++ drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/starfive/Kconfig | 43 ++ drivers/soc/starfive/Makefile | 3 + drivers/soc/starfive/jh7110-hdmi-subsystem.c | 73 +++ drivers/soc/starfive/jh7110-vout-subsystem.c | 82 +++ include/drm/bridge/inno_hdmi.h | 10 +- include/linux/phy/inno-hdmi-phy.h | 85 +++ 30 files changed, 2337 insertions(+), 188 deletions(-)
Quoted 5 lines
---
base-commit:fd73f4a6659897191fa0d40695fe370925dd3780
change-id: 20251031-jh7110-clean-send-7d2242118026Best regards,
By the way, something weird happenined while I applied the patches using git am. Somehow, some were out of order. The 10th patch adding .mode_valid tried to be applied before .disable even though in the series, the order is correctly set? git would obviously fail because the .disable entry did not exist in the header, so I had to manually put those in.
I guess it's possible that something went wrong here? I personally pulled the mailbox from the lore.kernel.org mbox.gz file.
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 10 lines · Joshua Peisach
Quoted 5 lines · Michal Wilczynski
Testing
=======Tested on a VisionFive 2 v1.3B using modetest.
I.. got nothing. I did have to manually modprobe the modules, but unless I am doing something wrong.. I didn't get anything and modetest just gave -2.
Hmm have you also changed the DTB not just the kernel and the modules (you can also built in everything).
Also note modetest needs -M verisilicon.
If that is not it, could you send "dmesg | grep -iE 'verisilicon|inno|hdmi|vout'" and "ls /sys/class/drm/"?
Quoted 68 lines
Quoted 55 lines
---
Michal Wilczynski (20):
dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller
dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem
dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem drm/bridge: inno-hdmi: Split probe out of bind
drm/bridge: inno-hdmi: Allow the register map to come from a parent 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
soc: starfive: Add jh7110-hdmi-subsystem driver
soc: starfive: Add jh7110-vout-subsystem driver
clk: starfive: jh7110-vout: Allow pixel clock rate propagation drm/bridge: starfive: Add JH7110 HDMI controller driver
phy: Add common Innosilicon HDMI PHY helpers
phy: rockchip: inno-hdmi: Use the common Innosilicon PHY helpers
phy: starfive: Add jh7110-inno-hdmi-phy driver
riscv: dts: starfive: jh7110: Update DT for display subsystem
MAINTAINERS: Add StarFive JH7110 display subsystem entry.../starfive,jh7110-inno-hdmi-controller.yaml | 121 +++++ .../bindings/display/verisilicon,dc.yaml | 1 + .../mfd/starfive,jh7110-hdmi-subsystem.yaml | 95 ++++ .../phy/starfive,jh7110-inno-hdmi-phy.yaml | 49 ++ .../soc/starfive/starfive,jh7110-syscon.yaml | 1 + .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 ++++++++ MAINTAINERS | 13 + arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 121 ++++- arch/riscv/boot/dts/starfive/jh7110.dtsi | 105 +++- drivers/clk/starfive/clk-starfive-jh7110-vout.c | 6 +- drivers/gpu/drm/bridge/Kconfig | 11 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/inno-hdmi.c | 112 +++- drivers/gpu/drm/bridge/jh7110-inno-hdmi.c | 297 +++++++++++ drivers/phy/Kconfig | 8 + drivers/phy/Makefile | 1 + drivers/phy/phy-inno-hdmi.c | 298 +++++++++++ drivers/phy/rockchip/Kconfig | 1 + drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 168 +----- drivers/phy/starfive/Kconfig | 20 + drivers/phy/starfive/Makefile | 1 + drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 579 +++++++++++++++++++++ drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/starfive/Kconfig | 43 ++ drivers/soc/starfive/Makefile | 3 + drivers/soc/starfive/jh7110-hdmi-subsystem.c | 73 +++ drivers/soc/starfive/jh7110-vout-subsystem.c | 82 +++ include/drm/bridge/inno_hdmi.h | 10 +- include/linux/phy/inno-hdmi-phy.h | 85 +++ 30 files changed, 2337 insertions(+), 188 deletions(-)Quoted 5 lines
---
base-commit:fd73f4a6659897191fa0d40695fe370925dd3780
change-id: 20251031-jh7110-clean-send-7d2242118026Best regards,
By the way, something weird happenined while I applied the patches using git am. Somehow, some were out of order. The 10th patch adding .mode_valid tried to be applied before .disable even though in the series, the order is correctly set? git would obviously fail because the .disable entry did not exist in the header, so I had to manually put those in.
Quoted 2 lines
I guess it's possible that something went wrong here? I personally pulled the mailbox from the lore.kernel.org mbox.gz file.
I would recommend using b4 shazam instead
Quoted 1 line
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Quoted 8 lines · Michal Wilczynski
Quoted 5 lines · Joshua Peisach
Quoted 4 lines · Michal Wilczynski
Testing
=======
Quoted 9 lines
Quoted 5 lines
Quoted 1 line
Tested on a VisionFive 2 v1.3B using modetest.
I.. got nothing. I did have to manually modprobe the modules, but unless I am doing something wrong.. I didn't get anything and modetest just gave -2.
Hmm have you also changed the DTB not just the kernel and the modules (you can also built in everything).
Yes (I didn't built-in everything, but I did make sure the DTB was copied and flash-kernel was run)
Quoted 2 lines
Also note modetest needs -M verisilicon.
"failed to open device 'versilicon' with busid '(null)': No such file or directory"
Quoted 3 lines
If that is not it, could you send "dmesg | grep -iE 'verisilicon|inno|hdmi|vout'" and "ls
/sys/class/drm/"?
the dmesg output:
[ 0.090950] /soc/display-subsystem@29400000/hdmi@29590000/controller: Fixed dependency cycle(s) with /soc/display-subsystem@29400000/display@29400000 [ 0.091029] /soc/display-subsystem@29400000/display@29400000: Fixed dependency cycle(s) with /soc/display-subsystem@29400000/hdmi@29590000/controller [ 0.104227] /hdmi-connector: Fixed dependency cycle(s) with /soc/display-subsystem@29400000/hdmi@29590000/controller [ 0.104272] /soc/display-subsystem@29400000/hdmi@29590000/controller: Fixed dependency cycle(s) with /hdmi-connector
/sys/class/drm only contains the file "version"
-Josh
Quoted 76 lines
Quoted 68 lines
Quoted 55 lines
---
Michal Wilczynski (20):
dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller
dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem
dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem drm/bridge: inno-hdmi: Split probe out of bind
drm/bridge: inno-hdmi: Allow the register map to come from a parent 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
soc: starfive: Add jh7110-hdmi-subsystem driver
soc: starfive: Add jh7110-vout-subsystem driver
clk: starfive: jh7110-vout: Allow pixel clock rate propagation drm/bridge: starfive: Add JH7110 HDMI controller driver
phy: Add common Innosilicon HDMI PHY helpers
phy: rockchip: inno-hdmi: Use the common Innosilicon PHY helpers
phy: starfive: Add jh7110-inno-hdmi-phy driver
riscv: dts: starfive: jh7110: Update DT for display subsystem
MAINTAINERS: Add StarFive JH7110 display subsystem entry.../starfive,jh7110-inno-hdmi-controller.yaml | 121 +++++ .../bindings/display/verisilicon,dc.yaml | 1 + .../mfd/starfive,jh7110-hdmi-subsystem.yaml | 95 ++++ .../phy/starfive,jh7110-inno-hdmi-phy.yaml | 49 ++ .../soc/starfive/starfive,jh7110-syscon.yaml | 1 + .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 ++++++++ MAINTAINERS | 13 + arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 121 ++++- arch/riscv/boot/dts/starfive/jh7110.dtsi | 105 +++- drivers/clk/starfive/clk-starfive-jh7110-vout.c | 6 +- drivers/gpu/drm/bridge/Kconfig | 11 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/inno-hdmi.c | 112 +++- drivers/gpu/drm/bridge/jh7110-inno-hdmi.c | 297 +++++++++++ drivers/phy/Kconfig | 8 + drivers/phy/Makefile | 1 + drivers/phy/phy-inno-hdmi.c | 298 +++++++++++ drivers/phy/rockchip/Kconfig | 1 + drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 168 +----- drivers/phy/starfive/Kconfig | 20 + drivers/phy/starfive/Makefile | 1 + drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 579 +++++++++++++++++++++ drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/starfive/Kconfig | 43 ++ drivers/soc/starfive/Makefile | 3 + drivers/soc/starfive/jh7110-hdmi-subsystem.c | 73 +++ drivers/soc/starfive/jh7110-vout-subsystem.c | 82 +++ include/drm/bridge/inno_hdmi.h | 10 +- include/linux/phy/inno-hdmi-phy.h | 85 +++ 30 files changed, 2337 insertions(+), 188 deletions(-)Quoted 5 lines
---
base-commit:fd73f4a6659897191fa0d40695fe370925dd3780
change-id: 20251031-jh7110-clean-send-7d2242118026Best regards,
By the way, something weird happenined while I applied the patches using git am. Somehow, some were out of order. The 10th patch adding .mode_valid tried to be applied before .disable even though in the series, the order is correctly set? git would obviously fail because the .disable entry did not exist in the header, so I had to manually put those in.
Quoted 2 lines
I guess it's possible that something went wrong here? I personally pulled the mailbox from the lore.kernel.org mbox.gz file.
I would recommend using b4 shazam instead
Quoted 1 line
Best regards,
Quoted 33 lines · Joshua Peisach
Quoted 8 lines · Michal Wilczynski
Quoted 5 lines · Joshua Peisach
Quoted 4 lines · Michal Wilczynski
Testing
=======Quoted 9 lines
Quoted 5 lines
Quoted 1 line
Tested on a VisionFive 2 v1.3B using modetest.
I.. got nothing. I did have to manually modprobe the modules, but unless I am doing something wrong.. I didn't get anything and modetest just gave -2.
Hmm have you also changed the DTB not just the kernel and the modules (you can also built in everything).
Yes (I didn't built-in everything, but I did make sure the DTB was copied and flash-kernel was run)
Quoted 2 lines
Also note modetest needs -M verisilicon.
"failed to open device 'versilicon' with busid '(null)': No such file or directory"
Quoted 3 lines
If that is not it, could you send "dmesg | grep -iE 'verisilicon|inno|hdmi|vout'" and "ls
/sys/class/drm/"?the dmesg output:
Quoted 7 lines
[ 0.090950] /soc/display-subsystem@29400000/hdmi@29590000/controller: Fixed dependency cycle(s) with /soc/display-subsystem@29400000/display@29400000 [ 0.091029] /soc/display-subsystem@29400000/display@29400000: Fixed dependency cycle(s) with /soc/display-subsystem@29400000/hdmi@29590000/controller [ 0.104227] /hdmi-connector: Fixed dependency cycle(s) with /soc/display-subsystem@29400000/hdmi@29590000/controller [ 0.104272] /soc/display-subsystem@29400000/hdmi@29590000/controller: Fixed dependency cycle(s) with /hdmi-connector
/sys/class/drmonly contains the file "version"
Typo - it is "verisilicon" you are missing the i.
But that is not the real problem: /sys/class/drm holding only "version" means no DRM device registered at all and your dmesg shows no probe output from any of the drivers, so they are not being loaded.
I would suspect something is missing from the .config.
Those are relevant options for this series:
CONFIG_DRM_VERISILICON_DC=yCONFIG_CLK_STARFIVE_JH7110_VOUT=yCONFIG_SOC_STARFIVE_JH7110_VOUT_SUBSYSTEM=yCONFIG_SOC_STARFIVE_JH7110_HDMI_SUBSYSTEM=yCONFIG_PHY_STARFIVE_JH7110_INNO_HDMI=yCONFIG_DRM_STARFIVE_JH7110_INNO_HDMI=y
easiest to build them in.
Run "make olddefconfig" after editing .config - DRM_VERISILICON_DC selects DRM_BRIDGE_CONNECTOR, DRM_DISPLAY_HELPER and DRM_GEM_DMA_HELPER, and if those did not get pulled in the DC never registers. Also verify after building how .config actually looks like.
With those options and correct dtb the drivers should probe correctly and there would be a trace in dmesg.
Quoted 81 lines
-Josh
Quoted 76 lines
Quoted 68 lines
Quoted 55 lines
---
Michal Wilczynski (20):
dt-bindings: phy: Add starfive,jh7110-inno-hdmi-phy
dt-bindings: display: bridge: Add starfive,jh7110-inno-hdmi-controller
dt-bindings: mfd: Add starfive,jh7110-hdmi-subsystem
dt-bindings: soc: starfive: Add starfive,jh7110-vout-syscon
dt-bindings: display: verisilicon: Add starfive,jh7110-dc8200
dt-bindings: soc: starfive: Add starfive,jh7110-vout-subsystem drm/bridge: inno-hdmi: Split probe out of bind
drm/bridge: inno-hdmi: Allow the register map to come from a parent 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
soc: starfive: Add jh7110-hdmi-subsystem driver
soc: starfive: Add jh7110-vout-subsystem driver
clk: starfive: jh7110-vout: Allow pixel clock rate propagation drm/bridge: starfive: Add JH7110 HDMI controller driver
phy: Add common Innosilicon HDMI PHY helpers
phy: rockchip: inno-hdmi: Use the common Innosilicon PHY helpers
phy: starfive: Add jh7110-inno-hdmi-phy driver
riscv: dts: starfive: jh7110: Update DT for display subsystem
MAINTAINERS: Add StarFive JH7110 display subsystem entry.../starfive,jh7110-inno-hdmi-controller.yaml | 121 +++++ .../bindings/display/verisilicon,dc.yaml | 1 + .../mfd/starfive,jh7110-hdmi-subsystem.yaml | 95 ++++ .../phy/starfive,jh7110-inno-hdmi-phy.yaml | 49 ++ .../soc/starfive/starfive,jh7110-syscon.yaml | 1 + .../starfive/starfive,jh7110-vout-subsystem.yaml | 218 ++++++++ MAINTAINERS | 13 + arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 121 ++++- arch/riscv/boot/dts/starfive/jh7110.dtsi | 105 +++- drivers/clk/starfive/clk-starfive-jh7110-vout.c | 6 +- drivers/gpu/drm/bridge/Kconfig | 11 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/inno-hdmi.c | 112 +++- drivers/gpu/drm/bridge/jh7110-inno-hdmi.c | 297 +++++++++++ drivers/phy/Kconfig | 8 + drivers/phy/Makefile | 1 + drivers/phy/phy-inno-hdmi.c | 298 +++++++++++ drivers/phy/rockchip/Kconfig | 1 + drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 168 +----- drivers/phy/starfive/Kconfig | 20 + drivers/phy/starfive/Makefile | 1 + drivers/phy/starfive/phy-jh7110-inno-hdmi.c | 579 +++++++++++++++++++++ drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/starfive/Kconfig | 43 ++ drivers/soc/starfive/Makefile | 3 + drivers/soc/starfive/jh7110-hdmi-subsystem.c | 73 +++ drivers/soc/starfive/jh7110-vout-subsystem.c | 82 +++ include/drm/bridge/inno_hdmi.h | 10 +- include/linux/phy/inno-hdmi-phy.h | 85 +++ 30 files changed, 2337 insertions(+), 188 deletions(-)Quoted 5 lines
---
base-commit:fd73f4a6659897191fa0d40695fe370925dd3780
change-id: 20251031-jh7110-clean-send-7d2242118026Best regards,
By the way, something weird happenined while I applied the patches using git am. Somehow, some were out of order. The 10th patch adding .mode_valid tried to be applied before .disable even though in the series, the order is correctly set? git would obviously fail because the .disable entry did not exist in the header, so I had to manually put those in.
Quoted 2 lines
I guess it's possible that something went wrong here? I personally pulled the mailbox from the lore.kernel.org mbox.gz file.
I would recommend using b4 shazam instead
Quoted 1 line
Best regards,
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Quoted 1 line · Michal Wilczynski
This series enables the display subsystem on the StarFive JH7110.
Hi Michal,
I tested your v4 patch series on my VisionFive2 1.3B with kernel 7.3-rc3 today and it works very well, except for 2 issues. Note, to make the screen refresh properly, I am using the noncoherent cache fixes from
https://github.com/ganboing-jh7110/linux/commits/ganboing-jh7110-cache-fix-v1/
(specifically commits 3683d97, ef93e2c, 277db0b, and 26ce3e6) in addition to your patch.
Issue 1: I have a Dell U2711 monitor which has limited HDMI 1.3 capability, so I invented my own Xorg mode to get a good frame rate:
"2560x1440_40.22" 162.00 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
With this mode and your new driver, I started getting rows of black pixels flickering in the upper-left corner of my LCD screen. These weren't there back when I was running the same mode under the Keith Zhao driver from StarFive (drm/verisilicon v5 plus a bunch of patches for dma cache coherency)
(https://patchwork.kernel.org/project/dri-devel/cover/[email protected]/).
The glitches I saw suggested the sync polarity was being set incorrectly; the number of glitched rows was exactly the vsync pulse width plus 1 (i.e. "1440 1443 1448 1481" produced 6 bad rows, "1440 1443 1456 1481" produced 14, "1440 1441 1442 1481" produced 2, and so forth).
I did a register dump between the two drivers and found that, although the DC8200 HSYNC and VSYNC registers were identical between the two versions, the hsync and vsync bits on the inno hdmi tx were swapped between the two. When I manually set the VIDEO_TIMING_CTL register from 0x09 to 0x05 (matching the output of Keith's driver), the glitches went away.
Keith Zhao driver:
=== DC8200 display 0 ===
DC PANEL_CONFIG 0x1418 = 0x00001111 DC HSIZE 0x1430 = 0x0AA00A00 DC HSYNC 0x1438 = 0x45280A30 DC VSIZE 0x1440 = 0x05C905A0 DC VSYNC 0x1448 = 0xC2D405A3 DC DPI_CONFIG 0x14B8 = 0x00000005 DC FB_CONFIG 0x1518 = 0x14000000 DC FB_ADDRESS 0x1400 = 0x71200000 DC FB_STRIDE 0x1408 = 0x00002800 DC FB_SIZE 0x1810 = 0x02D00A00 DC FB_CONFIG_EX 0x1CC0 = 0x00002000 DC PANEL_START 0x1CCC = 0x00000001 DC DP_CONFIG 0x1CD0 = 0x0000000A DC FB_WATER_MARK 0x1CE8 = 0x00000000 DC PANEL_CONFIG_EX 0x2518 = 0x00000000
=== INNO HDMI TX video timing ===
HDMI VIDEO_TIMING_CTL 0x08 = 0x05 HDMI EXT_HTOTAL_L 0x09 = 0xA0 HDMI EXT_HTOTAL_H 0x0A = 0x0A HDMI EXT_HBLANK_L 0x0B = 0xA0 HDMI EXT_HBLANK_H 0x0C = 0x00 HDMI EXT_HDELAY_L 0x0D = 0x70 HDMI EXT_HDELAY_H 0x0E = 0x00 HDMI EXT_HDURATION_L 0x0F = 0x20 HDMI EXT_HDURATION_H 0x10 = 0x00 HDMI EXT_VTOTAL_L 0x11 = 0xC9 HDMI EXT_VTOTAL_H 0x12 = 0x05 HDMI EXT_VBLANK 0x13 = 0x29 HDMI EXT_VDELAY 0x14 = 0x26 HDMI EXT_VDURATION 0x15 = 0x05
Your driver (showing only the changed values):
DC DP_CONFIG 0x1CD0 = 0x00000000 DC PANEL_CONFIG_EX 0x2518 = 0x00000001 HDMI VIDEO_TIMING_CTL 0x08 = 0x09
Specifically the bit#s are different between the two drivers:
inno_hdmi-starfive.h (Keith Zhao): inno-hdmi.c (generic):
v_HSYNC_POLARITY_SF(n) ((n) << 2) v_HSYNC_POLARITY bit 3 v_VSYNC_POLARITY_SF(n) ((n) << 3) v_VSYNC_POLARITY bit 2
"_SF" suggests this change is specific to StarFive. The correct positions are HSYNC=bit 2 and VSYNC=bit 3 for the JH7110.
I'm guessing that your 42-mode test passed because most CEA modes are +hsync +vsync, and this wouldn't show any difference if the two bits were transposed.
Once the sync polarity is sorted, I'd be happy to give a Tested-by: on the series.
--
Issue 2: This is more a feature request than an issue. Originally, I tried running this Xorg modeline, which worked well under Keith's driver:
"2560x1440_49.90" 201.00 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
However, your driver would not accept this pixel clock. I then noticed you have a pre-PLL table of fixed clocks. Is there any chance you can change the code to compute the pre-PLL on the fly like how Keith does it, rather than use a table?
Thanks for all your great work!
Best regards,
-Byron
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Icenowy Zheng
maintainerQuoted 95 lines · 在 2026-09-20日的 02:09 -0400,Byron Stanoszek写道:
Quoted 1 line · Michal Wilczynski
This series enables the display subsystem on the StarFive JH7110.
Hi Michal,
I tested your v4 patch series on my VisionFive2 1.3B with kernel 7.3- rc3 today
and it works very well, except for 2 issues. Note, to make the screen refresh
properly, I am using the noncoherent cache fixes from
https://github.com/ganboing-jh7110/linux/commits/ganboing-jh7110-cache-fix-v1/
(specifically commits 3683d97, ef93e2c, 277db0b, and 26ce3e6) in addition to
your patch.Issue 1: I have a Dell U2711 monitor which has limited HDMI 1.3 capability, so
I invented my own Xorg mode to get a good frame rate:"2560x1440_40.22" 162.00 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
With this mode and your new driver, I started getting rows of black pixels
flickering in the upper-left corner of my LCD screen. These weren't there back
when I was running the same mode under the Keith Zhao driver from StarFive
(drm/verisilicon v5 plus a bunch of patches for dma cache coherency) (
https://patchwork.kernel.org/project/dri-devel/cover/[email protected]
/).The glitches I saw suggested the sync polarity was being set incorrectly; the
number of glitched rows was exactly the vsync pulse width plus 1 (i.e.
"1440 1443 1448 1481" produced 6 bad rows, "1440 1443 1456 1481" produced 14,
"1440 1441 1442 1481" produced 2, and so forth).I did a register dump between the two drivers and found that, although the
DC8200 HSYNC and VSYNC registers were identical between the two versions, the
hsync and vsync bits on the inno hdmi tx were swapped between the two. When I
manually set theVIDEO_TIMING_CTLregister from0x09to0x05(matching the
output of Keith's driver), the glitches went away.Keith Zhao driver:
=== DC8200 display 0 ===
DC PANEL_CONFIG0x1418=0x00001111DC HSIZE0x1430=0x0AA00A00DC HSYNC0x1438=0x45280A30DC VSIZE0x1440=0x05C905A0DC VSYNC0x1448=0xC2D405A3DC DPI_CONFIG0x14B8=0x00000005DC FB_CONFIG0x1518=0x14000000DC FB_ADDRESS0x1400=0x71200000DC FB_STRIDE0x1408=0x00002800DC FB_SIZE0x1810=0x02D00A00DC FB_CONFIG_EX0x1CC0=0x00002000DC PANEL_START0x1CCC=0x00000001DC DP_CONFIG0x1CD0=0x0000000ADC FB_WATER_MARK0x1CE8=0x00000000DC PANEL_CONFIG_EX0x2518=0x00000000=== INNO HDMI TX video timing ===
HDMI VIDEO_TIMING_CTL 0x08 =0x05HDMI EXT_HTOTAL_L 0x09 =0xA0HDMI EXT_HTOTAL_H 0x0A =0x0AHDMI EXT_HBLANK_L 0x0B =0xA0HDMI EXT_HBLANK_H 0x0C =0x00HDMI EXT_HDELAY_L 0x0D =0x70HDMI EXT_HDELAY_H 0x0E =0x00HDMI EXT_HDURATION_L 0x0F =0x20HDMI EXT_HDURATION_H 0x10 =0x00HDMI EXT_VTOTAL_L 0x11 =0xC9HDMI EXT_VTOTAL_H 0x12 =0x05HDMI EXT_VBLANK 0x13 =0x29HDMI EXT_VDELAY 0x14 =0x26HDMI EXT_VDURATION 0x15 =0x05Your driver (showing only the changed values):
DC DP_CONFIG
0x1CD0=0x00000000DC PANEL_CONFIG_EX0x2518=0x00000001HDMI VIDEO_TIMING_CTL 0x08 =0x09Specifically the bit#s are different between the two drivers:
Quoted 7 lines
inno_hdmi-starfive.h(Keith Zhao):inno-hdmi.c(generic):
v_HSYNC_POLARITY_SF(n) ((n) << 2) v_HSYNC_POLARITY bit 3 v_VSYNC_POLARITY_SF(n) ((n) << 3) v_VSYNC_POLARITY bit 2"
_SF" suggests this change is specific to StarFive. The correct positions are
HSYNC=bit 2 and VSYNC=bit 3 for the JH7110.
In fact it's not SF specific, [1] pg.13 (full manual page 979) also shows the same for RK.
It could be an error from Rockchip developers since the beginning.
[1]
https://github.com/DeciHD/rockchip_docs/blob/main/rk3128/TRM-chapter-24-hdmi-tx.pdf
Thanks,
Icenowy
Quoted 36 lines
I'm guessing that your 42-mode test passed because most CEA modes are
(quoted diff) +2
-0+hsync +vsync, and this wouldn't show any difference if the two bits weretransposed.
Once the sync polarity is sorted, I'd be happy to give a Tested-by:
on the
series.--
Issue 2: This is more a feature request than an issue. Originally, I tried
running this Xorg modeline, which worked well under Keith's driver:"2560x1440_49.90" 201.00 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
However, your driver would not accept this pixel clock. I then noticed you have
a pre-PLL table of fixed clocks. Is there any chance you can change the code to
compute the pre-PLL on the fly like how Keith does it, rather than use a table?Thanks for all your great work!
Best regards,
-Byron_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Hi Bryan and Icenowy,
Quoted 100 lines · Icenowy Zheng
Quoted 99 lines · 在 2026-09-20日的 02:09 -0400,Byron Stanoszek写道:
Quoted 1 line · Michal Wilczynski
This series enables the display subsystem on the StarFive JH7110.
Hi Michal,
I tested your v4 patch series on my VisionFive2 1.3B with kernel 7.3- rc3 today
and it works very well, except for 2 issues. Note, to make the screen refresh
properly, I am using the noncoherent cache fixes from
https://protect2.fireeye.com/v1/url?k=3d78ed45-62e3d45a-3d79660a-000babdfecba-dbc6e750c3338bb9&q=1&e=d9589fcd-304c-4065-91c9-c5043969df15&u=https%3A%2F%2Fgithub.com%2Fganboing-jh7110%2Flinux%2Fcommits%2Fganboing-jh7110-cache-fix-v1%2F
(specifically commits 3683d97, ef93e2c, 277db0b, and 26ce3e6) in addition to
your patch.Issue 1: I have a Dell U2711 monitor which has limited HDMI 1.3 capability, so
I invented my own Xorg mode to get a good frame rate:"2560x1440_40.22" 162.00 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
With this mode and your new driver, I started getting rows of black pixels
flickering in the upper-left corner of my LCD screen. These weren't there back
when I was running the same mode under the Keith Zhao driver from StarFive
(drm/verisilicon v5 plus a bunch of patches for dma cache coherency) (
https://patchwork.kernel.org/project/dri-devel/cover/[email protected]
/).The glitches I saw suggested the sync polarity was being set incorrectly; the
number of glitched rows was exactly the vsync pulse width plus 1 (i.e.
"1440 1443 1448 1481" produced 6 bad rows, "1440 1443 1456 1481" produced 14,
"1440 1441 1442 1481" produced 2, and so forth).I did a register dump between the two drivers and found that, although the
DC8200 HSYNC and VSYNC registers were identical between the two versions, the
hsync and vsync bits on the inno hdmi tx were swapped between the two. When I
manually set theVIDEO_TIMING_CTLregister from0x09to0x05(matching the
output of Keith's driver), the glitches went away.Keith Zhao driver:
=== DC8200 display 0 ===
DC PANEL_CONFIG 0x1418 = 0x00001111 DC HSIZE 0x1430 = 0x0AA00A00 DC HSYNC 0x1438 = 0x45280A30 DC VSIZE 0x1440 = 0x05C905A0 DC VSYNC 0x1448 = 0xC2D405A3 DC DPI_CONFIG 0x14B8 = 0x00000005 DC FB_CONFIG 0x1518 = 0x14000000 DC FB_ADDRESS 0x1400 = 0x71200000 DC FB_STRIDE 0x1408 = 0x00002800 DC FB_SIZE 0x1810 = 0x02D00A00 DC FB_CONFIG_EX 0x1CC0 = 0x00002000 DC PANEL_START 0x1CCC = 0x00000001 DC DP_CONFIG 0x1CD0 = 0x0000000A DC FB_WATER_MARK 0x1CE8 = 0x00000000 DC PANEL_CONFIG_EX 0x2518 = 0x00000000=== INNO HDMI TX video timing ===
HDMI VIDEO_TIMING_CTL 0x08 = 0x05 HDMI EXT_HTOTAL_L 0x09 = 0xA0 HDMI EXT_HTOTAL_H 0x0A = 0x0A HDMI EXT_HBLANK_L 0x0B = 0xA0 HDMI EXT_HBLANK_H 0x0C = 0x00 HDMI EXT_HDELAY_L 0x0D = 0x70 HDMI EXT_HDELAY_H 0x0E = 0x00 HDMI EXT_HDURATION_L 0x0F = 0x20 HDMI EXT_HDURATION_H 0x10 = 0x00 HDMI EXT_VTOTAL_L 0x11 = 0xC9 HDMI EXT_VTOTAL_H 0x12 = 0x05 HDMI EXT_VBLANK 0x13 = 0x29 HDMI EXT_VDELAY 0x14 = 0x26 HDMI EXT_VDURATION 0x15 = 0x05Your driver (showing only the changed values):
DC DP_CONFIG 0x1CD0 = 0x00000000 DC PANEL_CONFIG_EX 0x2518 = 0x00000001 HDMI VIDEO_TIMING_CTL 0x08 = 0x09Specifically the bit#s are different between the two drivers:
inno_hdmi-starfive.h(Keith Zhao):inno-hdmi.c(generic):v_HSYNC_POLARITY_SF(n) ((n) << 2) v_HSYNC_POLARITY bit 3 v_VSYNC_POLARITY_SF(n) ((n) << 3) v_VSYNC_POLARITY bit 2
Quoted 8 lines
Quoted 3 lines
"
_SF" suggests this change is specific to StarFive. The correct positions are
HSYNC=bit 2 and VSYNC=bit 3 for the JH7110.In fact it's not SF specific, [1] pg.13 (full manual page 979) also shows the same for RK.
It could be an error from Rockchip developers since the beginning.
Yeah I agree; Maud Spierings reported similar issue and Dominuque Belhachemi also figured that v_HSYNC_POLARITY and v_VSYNC_POLARITY are simply swapped ininno-hdmi.c.
As Icenowy stated Rockhip TRM also confirms this. I intend to send a fix as part of this series (as suggested by Maud).
Quoted 26 lines
Thanks,
IcenowyQuoted 19 lines
I'm guessing that your 42-mode test passed because most CEA modes are
(quoted diff) +2
-0+hsync +vsync, and this wouldn't show any difference if the two bits weretransposed.
Once the sync polarity is sorted, I'd be happy to give a Tested-by:
on the
series.--
Issue 2: This is more a feature request than an issue. Originally, I tried
running this Xorg modeline, which worked well under Keith's driver:"2560x1440_49.90" 201.00 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
Quoted 6 lines
Quoted 6 lines
However, your driver would not accept this pixel clock. I then noticed you have
a pre-PLL table of fixed clocks. Is there any chance you can change the code to
compute the pre-PLL on the fly like how Keith does it, rather than use a table?
I can add the entry, hopefully you can let me know in the v5 whether it works for you.
inno_hdmi_phy_pre_pll_determine_rate() returns -EINVAL for any rate not in the table, and .mode_valid is built entirely on that:
rounded = clk_round_rate(ctrl->clks[CLK_PCLK].clk, pixelclk); if (rounded != pixelclk)
return MODE_NOCLOCK;
If the PHY computes dividers on demand, clk_round_rate() starts succeeding for almost every rate .mode_valid stops rejecting anything and we're back to advertising modes the PHY can't drive the blank screen bug patch 11 exists to fix.
To keep the rejection you'd have to replace the table with a real constraint model.
The fracdiv values doesn't seem to be cleanly derivable and the Rockchip has the datasheet and still chose a table.
Quoted 11 lines
Quoted 11 lines
Thanks for all your great work!
Best regards,
-Byron_______________________________________________
linux-riscv mailing list
[email protected]
https://protect2.fireeye.com/v1/url?k=46fbedc2-1960d4dd-46fa668d-000babdfecba-e6e7fb64f005c1b3&q=1&e=d9589fcd-304c-4065-91c9-c5043969df15&u=http%3A%2F%2Flists.infradead.org%2Fmailman%2Flistinfo%2Flinux-riscv
Best regards,
Signature · 1 line
Michal Wilczynski <[email protected]>
Brian Masney
AppliedRe: (subset) [PATCH v4 00/20] drm: starfive: jh7110: Enable display subsystem
In reply to Michal WilczynskiQuoted 10 lines · Michal Wilczynski
drm: starfive: jh7110: Enable display subsystem
This series enables the display subsystem on the StarFive JH7110.
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, and it has a circular clock dependency with voutcrg:[...]
Applied, thanks!
[14/20] clk: starfive: jh7110-vout: Allow pixel clock rate propagation
commit: af384d6e0573b416a7a28e0ab6300d797cae369d
Best regards,
Signature · 1 line
Brian Masney <[email protected]>