NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/58173: gpio-line-names not used on TI ARM
>Number: 58173
>Category: kern
>Synopsis: gpio-line-names not used on TI ARM
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Apr 19 01:35:00 +0000 2024
>Originator: Lloyd Parkes
>Release: current Fri 19 Apr 2024 13:25:14 NZST
>Organization:
Must Have Coffee
>Environment:
NetBSD 10.99.10 NetBSD 10.99.10 (GENERIC) #1: Fri Apr 19 13:19:48 NZST 2024 lloyd%ceph4.must-have-coffee.gen.nz@localhost:/vol/build/gpio-line-names/objdir.evbearmv7hf-el/sys/arch/evbarm/compile/GENERIC evbarm
>Description:
The GPIO line names that are present in the FDT do not appear in the gpioN devices on a BeagleBone Black.
>How-To-Repeat:
Boot in single user mode, run the command "gpioctl gpio0 list" and note the lack of pin names on the 32 pins listed.
>Fix:
The following patch fixes this by passing the FDT device handle to config_found() so that the MI gpio device can access the FDT and extract the gpio-line-names attribute.
I also moved the call to ti_gpio_attach_ports() to the bottom of ti_gpio_attach() so that the configuration messages are printed to the console in the right order.
I copied both of these code changes from the way the Broadcom code works.
--- a/sys/arch/arm/ti/ti_gpio.c Wed Apr 17 18:10:27 2024 +0000
+++ b/sys/arch/arm/ti/ti_gpio.c Fri Apr 19 13:23:17 2024 +1200
@@ -560,7 +560,8 @@
gba.gba_gc = gp;
gba.gba_pins = sc->sc_pins;
gba.gba_npins = __arraycount(sc->sc_pins);
- sc->sc_gpiodev = config_found(sc->sc_dev, &gba, NULL, CFARGS_NONE);
+ sc->sc_gpiodev = config_found(sc->sc_dev, &gba, gpiobus_print,
+ CFARGS(.devhandle = device_handle(sc->sc_dev)));
}
static int
@@ -642,8 +643,6 @@
fdtbus_register_gpio_controller(self, phandle, &ti_gpio_funcs);
- ti_gpio_attach_ports(sc);
-
sc->sc_ih = fdtbus_intr_establish_xname(phandle, 0, IPL_VM,
FDT_INTR_MPSAFE, ti_gpio_intr, sc, device_xname(self));
if (sc->sc_ih == NULL) {
@@ -653,4 +652,6 @@
}
aprint_normal_dev(self, "interrupting on %s\n", intrstr);
fdtbus_register_interrupt_controller(self, phandle, &ti_gpio_intrfuncs);
+
+ ti_gpio_attach_ports(sc);
}
Home |
Main Index |
Thread Index |
Old Index