fh8856: fix JL1101 PHY detection, PHY reset GPIO and SD1 pinctrl on V100 boards - #54
fh8856: fix JL1101 PHY detection, PHY reset GPIO and SD1 pinctrl on V100 boards#54kasperiio wants to merge 1 commit into
Conversation
PR Summary by QodoFix FH8856 V100 JL1101 detection, PHY reset, and SD1 pinctrl
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1. FH8852 PHY reset disabled
|
| * the JL1101 unresponsive on MDIO. The vendor firmware never resets | ||
| * the PHY; U-Boot has already brought it up, so leave it alone. | ||
| */ | ||
| return; |
There was a problem hiding this comment.
1. Fh8852 phy reset disabled 🐞 Bug ≡ Correctness
The unconditional return disables PHY reset for FH8852 as well as FH8856, because both machines share this board file and GMAC callback. FH8852 explicitly defines GPIO11 as its Ethernet PHY reset, so its PHY may remain uninitialized or fail detection during boot.
Agent Prompt
## Issue description
The new unconditional return in `fh_phy_reset()` disables the hardware PHY reset for every machine using the shared FH8856 architecture code, including FH8852 boards whose configuration explicitly identifies GPIO11 as the Ethernet PHY reset.
## Issue Context
Keep the no-reset behavior for the affected FH8856 board configuration, but retain the existing GPIO reset sequence for FH8852 and any other configuration where the reset line is wired. A board-specific callback or compile-time board guard can provide this distinction.
## Fix Focus Areas
- arch/arm/mach-fh/board-fh8856.c[411-447]
- arch/arm/mach-fh/include/mach/board_config.fh8852.appboard[17-24]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
…100 boards Three fixes for the FH8856 (V100) as fitted to the Vatilon PB1 / Asecam board, each verified on that hardware. Squashed from three commits; their messages: fh_gmac: recognise JLSemi JL1101 PHY id 0x937c4024 The JL1101 stepping fitted on FH8856 boards such as the Asecam PB1 (IF5653-V2) reports PHY id 0x937c4024 instead of 0x937c4023. Without this the RMII/page-7 setup is skipped and the link never comes up. fh8856: let a board declare the PHY reset GPIO unwired CONFIG_GPIO_EMACPHY_RESET maps to pad 46, which is PWM7 on the Asecam PB1 and not connected to the PHY. Toggling it during boot left the JL1101 dead on MDIO (no PHY found, no network). U-Boot has already configured the PHY, and the vendor kernel never resets it either. board-fh8856.c is shared by every machine built with CONFIG_ARCH_FH8856, so the reset is skipped only where the board config defines CONFIG_GPIO_EMACPHY_RESET_UNWIRED. That is set in the FH8856 configs and deliberately not in board_config.fh8852.appboard, which documents GPIO11 as the EMAC PHY reset and keeps the existing sequence. fh8856: drop SD1_NO_WP from the default pinctrl selection Muxing the SD1 pads at boot hangs the SoC on the Asecam PB1 (IF5653-V2), which has no SD1 slot and uses those pads for other functions (the pad-51 GPIO16 path is where fh_pinctrl_init_devices() stalls). No supported FH8856 target uses SD1.
12192bf to
856b5ae
Compare
|
Good catch — thank you. Fixed in
Verified by compiling
|
Three fixes for the FH8856 (V100) as found on the Vatilon PB1 / Asecam board, on top of
fullhan-fh8852v100.1.
fh_gmac: recognise the JLSemi JL1101 PHY id0x937c4024— a newer stepping of the JL1101 the driver already knows as0x937c4023; same RMII setup. Without it the PHY is not recognised andeth0never links.2.
fh8856: do not pulse the (unwired) PHY reset GPIO —CONFIG_GPIO_EMACPHY_RESETmaps to pad 46, which isPWM7on this board and not connected to the PHY. Toggling it during boot left the JL1101 dead on MDIO (no PHY found, no network). U-Boot has already configured the PHY, and the vendor kernel never resets it either.3.
fh8856: dropSD1_NO_WPfrom the default pinctrl selection — muxing the SD1 pads at boot hangs the SoC on this board, which has no SD1 slot and uses those pads for other functions (the pad-51GPIO16path is wherefh_pinctrl_init_devices()stalls). No supported FH8856 target uses SD1.Verification
Built through the OpenIPC firmware tree (
fh8856v100_lite) with the kernel fetched from this branch and only the tree-wide gcc-compatibility patches applied — no per-board patches — and booted on the board from RAM against a flashed OpenIPC rootfs:eth0links,udhcpcruns, the streamer starts, login prompt reached, no oops. The same three changes, previously carried as buildroot patches, are running on three converted cameras.Known, deliberately not in this PR
Netlink link dumps (
RTM_GETLINK) oops this kernel inrtnl_fill_ifinfo()—devinrtnl_dump_ifinfo'shlist_for_each_entry_rcuoverdev_index_headis a garbage pointer. Reproduced with no vendor modules loaded (onlyloandeth0), so it is in the base kernel +fh_gmac, not the SDK blobs — but it is not yet pinned to a line. The firmware side ships a/sbin/ipwrapper that avoids netlink for the common operations. Separate issue/PR once it is understood.Before / after (Vatilon PB1, FH8856, GC4653; serial console)
Before — stock
fullhan-fh8852v100kernel on this board:fh_gmacfinds no PHY (id0x937c4024unknown),eth0never links; withSD1_NO_WPin the default pinctrl selection the SoC stalls infh_pinctrl_init_devices()on pad 51 and the console is lost.After — kernel built from this branch with only the tree-wide gcc-compat patches, booted from RAM against the OpenIPC rootfs:
ping0 % loss; tcp 22/554/8080 open; divinus reportschip=FH8856 sensor=gc4653_mipi. Zero oops. Kernel image 1750724 bytes, unchanged in size from the patched-in-buildroot build it replaces (1750732).One commit; the three changes are described in its message.