On Wed, Aug 23, 2017 at 10:05:18AM -0700, Stephen Graf wrote:
> From the advice from Mark and the further reading that I did, I think I am
> doing the right things.
>
>
>
> I can set the status light from u-boot, but cannot configure the pin in
> OpenBSD.
>
>
>
> The attached console log shows the results of my testing with annotations in
> caps.
>
Hi,
if you can, i'd like to see the output in dmesg w/diff below,
might provide more clues.
-Artturi
diff --git a/sys/dev/fdt/sxipio.c b/sys/dev/fdt/sxipio.c
index 643226ecd19..40a742171a9 100644
--- a/sys/dev/fdt/sxipio.c
+++ b/sys/dev/fdt/sxipio.c
@@ -447,6 +447,7 @@ sxipio_attach_gpio(struct device *parent)
int port, pin;
int cfg, state;
int i;
+ int m;
for (i = 0; i < sc->sc_npins; i++) {
/* Skip pins that have no gpio function. */
@@ -461,6 +462,15 @@ sxipio_attach_gpio(struct device *parent)
reg = SXIREAD4(sc, SXIPIO_CFG(port, pin));
cfg = (reg >> (pin & 0x7)) & 0x7;
+ for (m = 0; m < 8; m++)
+ if (sc->sc_pins[i].funcs[m].mux == cfg)
+ break;
+
+ printf("%c%d mux %d<%s>%s", 'A' + (u_int)sc->sc_pins[i].port,
+ sc->sc_pins[i].pin, cfg,
+ m >= 8 ? "invalid" : sc->sc_pins[i].funcs[m].name,
+ cfg < 2 ? "- adding\n" : "- skipping\n");
+
/* Skip pins that have been assigned other functions. */
if (cfg != SXIPIO_GPIO_IN && cfg != SXIPIO_GPIO_OUT)
continue;