A13 uart3 enable

Started by sandro, March 07, 2013, 01:05:41 PM

Previous topic - Next topic

sandro

On the Allwinner A13 cpu manual I see that I have an UART3 on PG9 and PG10.
On the standard kernel of tha Olinuxino this pin is configured as default, that is
like GPIO.
Someones knows as I can modify PG register to enable it?

Thanks
Sandro

mab

Is it possible from the script.bin / fex file?
Mine goes like this:

[spi1_para]
spi_used = 0
spi_cs0 = port:PG09<2><default><default><default>
spi_cs1 = port:PG13<2><default><default><default>
spi_sclk = port:PG10<2><default><default><default>
spi_mosi = port:PG11<2><default><default><default>
spi_miso = port:PG12<2><default><default><default>

from http://linux-sunxi.org/Fex_Guide :

Description of the GPIO configuration in the form:
    port:<port><mux feature><pullup/down><drive capability><output level>
where:
    <port> is the port to configure (ie. PH15)
    <mux feature> is the function to configure the port for (see the datasheet for details)
    ...

In the A13 datasheet the "Function" row is omitted, whereas in the A10 datasheet it is present.
Anyway, enable spi to change function of the pin sounds awkward...
It`s a pity we only have a very limited datasheet. Thats the price we pay to have an inexpensive but powerfull SoC to play with.

Hope you get it working somehow. I would like to enable it too as the other UART is shared with pins for the SD card from which I am booting...



Cris

sandro

#2
I tried to modify the fex file and recompile it on a bin file

[uart_para1]
uart_used = 1
uart_port = 1
uart_type = 2
uart_tx = port:PG03<4><1><default><default>
uart_rx = port:PG04<4><1><default><default>

[uart_para3]
uart_used = 1
uart_port = 3
uart_type = 2
uart_tx = port:PG09<3><1><default><default>
uart_rx = port:PG10<3><1><default><default>


[spi1_para]
spi_used = 0
spi_cs0 = port:PG09<2><default><default><default>
spi_cs1 = port:PG13<2><default><default><default>
spi_sclk = port:PG10<2><default><default><default>
spi_mosi = port:PG11<2><default><default><default>
spi_miso = port:PG12<2><default><default><default>

...


[gpio_para]
gpio_used = 1
gpio_num = 15
gpio_pin_1 = port:PB03<1><default><default><default>
gpio_pin_2 = port:PB04<1><default><default><default>
gpio_pin_3 = port:PB10<1><default><default><1>
gpio_pin_4 = port:PE04<0><default><default><default>
gpio_pin_5 = port:PE05<0><default><default><default>
gpio_pin_6 = port:PE06<0><default><default><default>
gpio_pin_7 = port:PE07<0><default><default><default>
gpio_pin_8 = port:PE08<1><default><default><default>
gpio_pin_9 = port:PE09<1><default><default><default>
gpio_pin_10 = port:PE10<1><default><default><default>
gpio_pin_11 = port:PE11<1><default><default><default>
gpio_pin_12 = port:PG09<3><default><default><default>
gpio_pin_13 = port:PG10<3><default><default><default>

gpio_pin_14 = port:PG11<1><default><default><default>


but it don't works

zgyarmati

Hi Sandro,

did you manage to figure out the proper configuration by any chance?

thx, br
--<br />Zoltan Gyarmati

BJFreeman

According to the schematic PG9 (pin37) is the power LED and PG10 is pin 38 the VGA_Disc
Fulltimer since 89

zgyarmati

Hi,

the the PG10/VGA_DIS pin is not connected to the FET4's gate (there is a not populated resistor there, the R44), so it's free for other usage. The PG9/LED1 pin indeed has a LED on it, but it's not the power LED, just a green LED with a 2k2 resistor, i think it shouldn't disturb the UART TX line.
I was trying several options in the .fex file to enable this UART, but no success yet, so i decided to ask around before i dig into the issue deeply :)
--<br />Zoltan Gyarmati

BJFreeman

which board do you have.
the Wifi does not have a green LED
Fulltimer since 89

JohnS

#7
Mine has a Green LED.  On schematic see PIN37 / LED1

It's on port G 9

I programmed it to flash and it does.

John

Usi

this works:

[uart_para3]
uart_used                = 1
uart_port                = 3
uart_type                = 2
uart_tx                  = port:PG9<3>
uart_rx                  = port:PG10<3>


[spi1_para]
spi_used                 = 0

[audio_para]
audio_used               = 1
audio_pa_ctrl            = port:PB4<1><default><default><0>
;default: audio_pa_ctrl  = port:PG10<1><default><default><0>


[gpio_para]
NO entry for PG9 and PG10

BJFreeman

#9
Quote from: JohnS on May 24, 2013, 10:30:18 AM
Mine has a Green LED.  On schematic see PIN37 / LED1

It's on port G 9

I programmed it to flash and it does.

John
Ok that says green on the schematic.
can only find the yellow charger LED.
cannot find the Red Power led.
Fulltimer since 89

JohnS

#10
Mine has them all.  Does yours not or can't you find them?  Is it maybe a prototype board?

They're very bright.

John

zgyarmati


Mine is a Micro, but i think the other ones have this LED as well.

Usi, could you please tell which kernel you are using, and paste the relevant part of the dmesg? For me when i try to open the ttyS1 (which is the assigned name to the uart3, according to the boot messages), either the board get frozen, or sometimes i got this message from the 8250 driver:

[  308.270000] serial8250: too much work for irq4

So probably on my side there is a driver bug, which doesn't exist at your side :)
Thanks in advance!
--<br />Zoltan Gyarmati

BJFreeman

Fulltimer since 89

zgyarmati

Yep, thanks, i now (in theorem...) how to configure the pins in the fex file.Also  managed to configure all of the pins i need as GPIO. My problem is that the uart3  doesn't work as it should. The uart3 gets listed during boot, and according to procfs, it's in place:



cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:U6_16550A mmio:0x01C28400 irq:2 tx:29757 rx:134 RTS|CTS|DTR|DSR|CD|RI
1: uart:U6_16550A mmio:0x01C28C00 irq:4 tx:0 rx:0 CTS



but when i try to open it, it doesn't work, see in my prev post. So that's why i'm interested in the kernel version used by Usi, as it seems for him it works.
--<br />Zoltan Gyarmati

Usi

I am using Android 4.0.3 ICS, Kernel 3.0.8+
found in the A13 OLinuXino Wiki