Skip to content

[Aspeed][Nexthop]: Add gpio-line-names to the B27 gpio1 node - #616

Open
jack-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:jack.b27-gpio-line-names
Open

[Aspeed][Nexthop]: Add gpio-line-names to the B27 gpio1 node#616
jack-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:jack.b27-gpio-line-names

Conversation

@jack-nexthop

Copy link
Copy Markdown
Contributor

Why I did it

libgpiod v2 (shipped in Debian Trixie) dropped gpiofind and addresses GPIO lines by name. The NextHop B27 device tree names none of its GPIO lines, so userspace cannot request them by name. In particular cpe_ctrl (GPIOE2, line offset 34 on the AST2700 gpio1 controller at 0x14c0b000) drives the switch-host CPU reset and is managed at boot by the cpe-ctrl-init service added in sonic-net/sonic-buildimage#29142 — without the line names, that service has no line to request and skips.

How I did it

Add a gpio-line-names property to the &gpio1 node in patches-sonic/nexthop-b27-dts.patch, copied verbatim from the device tree NextHop ships on these boards.

No gpio-hogs are added: cpe_ctrl must not be hogged, because a hog is re-applied on every gpiochip probe and would clobber the level that the pin's reset-tolerance bit preserved across a BMC warm reset — holding that level across BMC reboots is the point of the service in sonic-net/sonic-buildimage#29142.

How to verify it

On a NextHop B27 BMC running an image with this kernel:

gpioinfo | grep cpe_ctrl        # line 34 on the 14c0b000 chip, named
systemctl status cpe-ctrl-init  # active (exited) instead of skipping
busybox devmem 0x14C0B208 32    # 0x42/0x43 pattern: reset-tolerant output

Verified on B27 hardware with the equivalent change in NextHop's internal kernel tree.

Name the lines on the AST2700 gpio1 controller (0x14c0b000) so
userspace can address them by name with libgpiod v2, which dropped
gpiofind and addresses lines by name. In particular cpe_ctrl (GPIOE2,
line offset 34) drives the switch-host CPU reset and is managed at
boot by the cpe-ctrl-init service added in sonic-buildimage PR #29142;
without the line names that service has no line to request and skips.

Names are copied verbatim from the device tree NextHop ships on these
boards. No gpio-hogs are added: cpe_ctrl must not be hogged, because a
hog is re-applied on every gpiochip probe and would clobber the level
the pin's reset-tolerance bit preserved across a BMC warm reset.

Signed-off-by: Jack Cai <jack@nexthop.ai>
@jack-nexthop
jack-nexthop requested a review from a team as a code owner August 26, 2026 22:03
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants