Uartf without losing gpio11, 12, 13, 14

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Uartf without losing gpio11, 12, 13, 14

Sun Nov 01, 2015 4:27 pm

Here is a patch against the current OpenWrt trunk that opens uartf on pio's 7, 8, 9 & 10 and exports gpio 10, 11,12 & 13. You should be able to drop it in the base directory of the buildroot, apply it with patch -p1 <allow_functions_use_mulitple_groups.patch and then build as normal. It should also allow the other shared functions listed in Table 1-5 UARTF Pin Sharing Scheme in the data sheet.

allow_functions_use_mulitple_groups.patch

Uartf will be on /dev/ttyS1 and Uartlite will be on /dev/ttyS0 as normal. If you hook a USB TTL adapter to GPIO 8&10 and open a terminal session you should be able to see whatever you send to /dev/ttyS1.

Here are the relevant parts of the kernel log:
Code: Select all
root@OpenWrt:/# dmesg|grep uart
[    0.120000] rt2880-pinmux pinctrl: found group selector 4 for uartf_high
[    0.470000] rt2880-pinmux pinctrl: found group selector 5 for uartlite
[    0.470000] rt2880-pinmux pinctrl: request pin 15 (io15) for 10000c00.uartlite
[    0.470000] rt2880-pinmux pinctrl: request pin 16 (io16) for 10000c00.uartlite
[    0.470000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a 16550A
[    0.520000] rt2880-pinmux pinctrl: found group selector 3 for uartf_low
[    0.520000] rt2880-pinmux pinctrl: request pin 7 (io7) for 10000500.uart
[    0.520000] rt2880-pinmux pinctrl: request pin 8 (io8) for 10000500.uart
[    0.520000] rt2880-pinmux pinctrl: request pin 9 (io9) for 10000500.uart
[    0.520000] rt2880-pinmux pinctrl: request pin 10 (io10) for 10000500.uart
[    0.520000] 10000500.uart: ttyS1 at MMIO 0x10000500 (irq = 13, base_baud = 2500000) is a 16550A
root@OpenWrt:/# dmesg|grep pio
[    0.160000] rt2880_gpio 10000600.gpio: registering 22 gpios
[    0.170000] rt2880_gpio 10000600.gpio: registering 22 irq handlers
[    0.180000] rt2880_gpio 10000660.gpio: registering 6 gpios
[    0.190000] rt2880_gpio 10000660.gpio: registering 6 irq handlers
[    0.440000] rt2880-pinmux pinctrl: request pin 0 (io0) for pio:0
[    0.440000] rt2880-pinmux pinctrl: request pin 11 (io11) for pio:11
[    0.440000] rt2880-pinmux pinctrl: request pin 12 (io12) for pio:12
[    0.440000] rt2880-pinmux pinctrl: request pin 13 (io13) for pio:13
[    0.440000] rt2880-pinmux pinctrl: request pin 14 (io14) for pio:14
[    0.440000] rt2880-pinmux pinctrl: request pin 17 (io17) for pio:17
[    0.440000] rt2880-pinmux pinctrl: request pin 18 (io18) for pio:18
[    0.440000] rt2880-pinmux pinctrl: request pin 19 (io19) for pio:19
[    0.440000] rt2880-pinmux pinctrl: request pin 20 (io20) for pio:20
[    0.440000] rt2880-pinmux pinctrl: request pin 21 (io21) for pio:21
[    0.440000] rt2880-pinmux pinctrl: request pin 22 (io22) for pio:22
[    0.440000] rt2880-pinmux pinctrl: request pin 23 (io23) for pio:23
[    0.440000] rt2880-pinmux pinctrl: request pin 24 (io24) for pio:24
[    0.440000] rt2880-pinmux pinctrl: request pin 25 (io25) for pio:25
[    0.440000] rt2880-pinmux pinctrl: request pin 26 (io26) for pio:26
[    0.440000] gpio-export gpio-export: 15 gpio(s) exported
[    7.490000] rt2880-pinmux pinctrl: request pin 10 (io10) for pio:10
[    7.490000] rt2880-pinmux pinctrl: pin 10 is not set to gpio mux
[    7.510000] rt2880-pinmux pinctrl: pin-10 (pio:10) status -22


Please let me know if it works for you.

Return to VoCore & VoCore+Dock

Who is online

Users browsing this forum: Google [Bot] and 6 guests