This is GPIO MUX support on AR934x and AR1321
hint.gpio.0.func.12.outmux=7
This meen GPIO12 is SPI chip select 1(7).
Value is in AR9344 datasheet at page 53.
This is dmesg.
Differential D20170
Add GPIO MUX support on AR934x and AR1321 yamori813_yahoo.co.jp on May 6 2019, 10:57 AM. Authored by Tags None Referenced Files
Subscribers
Details This is GPIO MUX support on AR934x and AR1321 hint.gpio.0.func.12.outmux=7 This meen GPIO12 is SPI chip select 1(7). Value is in AR9344 datasheet at page 53. This is dmesg. on AR1321
Diff Detail
Event TimelineComment Actions so it turns out this isn't "right". There's already a way to configure the output function for the SoC side GPIO pins. look at the existing gpiofunc/gpiomode. That's what gpiofunc does (and gpiomode=1 just says "make it output, value low as a default"). It's only useful for AR934x and later. Can you try: hint.gpio.0.func.12.gpiofunc=7 .. and see if that has the same effect? if so then great! We don't need this (but we need something different for AR933x..) Comment Actions
oe=0. I do modify for this. hint.gpio.0.func.12.gpiofunc=7 Comment Actions This is log. gpio0: <Atheros AR71XX GPIO driver> at mem 0x18040000-0x18040fff irq 2 on apb0 Comment Actions oh interesting. er, so i know this is asking a lot but I'm trying to understand explicitly what the hardware setup is. the idea was setting output would set OE to "output", which on the AR9344 clears the bit. (check ar71xx_gpio_oe_set_output()). Is the SPI chip select pin supposed to NOT be configured as an ouput? what's the value of the AR71XX_GPIO_OE register? I'd rather have it explicitly be called out. Ie, gpiomode=0 == leave, gpiomode=1 == output, gpiomode=2 == input. Does SPI work if you instead call gpio_oe_set_input() ? -a Comment Actions AR9344 data sheet say. For example, to drive the SPI_CLK signal through the GPIO4 pin:
Comment Actions ok, so can you add: if (gpiomode == 2) ar71xx_gpio_oe_set_input(sc, i); .. and then try gpiomode=2 ? That explicitly sets it to 0 on the ar9344. If that works then I'll add that! Comment Actions I checked code and I think this problem is case of ar71xx_gpio_oe_is_high(). I think same AR9341 and AR9344. But ar71xx_gpio_oe_is_high don' have AR9341. I think add AR9341 and AR9342 to ar71xx_gpio_oe_is_high. My target is AR1321. AR1321 is same as AR9341. Sorry my miss reading. Comment Actions Now work fine this hints. hint.gpio.0.func.12.gpiofunc=7 |