[OpenWrt-Devel] ath79: pinctrl question, ar71xx migration

Sebastian Kemper sebastian_ml at gmx.net
Sun Nov 25 16:09:29 EST 2018

Hello all,

I'm still working on the dts file for d-link dir-825-c1. I'm trying to
get the usb led to work. Configuring the led with gpio 11 alone is not
enough, the led stays dark, even if it appears in

 gpio-11  (                    |d-link:blue:usb     ) out hi

On ar71xx in the mach file

 ath79_gpio_output_select(11, AR934X_GPIO_OUT_GPIO);

is called to make it work. In a chat on irc it was suggested that this
could probably be done with some pinctrl magic, possibly with
"pinctrl-single,bits". But I have trouble coming up with the arguments.

I did an ar71xx compile before which I put some extra printk into

void __init ath79_gpio_output_select(unsigned gpio, u8 val)

        printk("Here comes GPIO %u\n", gpio);
        printk("t is %u and reg is %u\n", t, reg);
        printk("base is %p and base + reg is %p\n", base, base + reg);
        __raw_writel(t, base + reg);

        /* flush write */
        (void) __raw_readl(base + reg);

In dmesg I got this:

[    0.135479] Here comes GPIO 11
[    0.139500] t is 1572864 and reg is 52
[    0.145149] base is b8040000 and base + reg is b8040034

These numbers are the same on every reboot. 1572864 is 0x180000.

I checked the mem area's content:

root at OpenWrt:~# devmem 0xb8040000 64

I compiled an image that doesn't call ath79_gpio_output_select(). So usb
led was dark. I checked the same area again:

root at OpenWrt:~# devmem 0xb8040000 64

But really this doesn't tell me anything :)

Anybody knows if I can use pinctrl to get what I need and how to go
about it?

Thanks for reading!

Best regards,

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list