linux-sunxi / u-boot-sunxi

Allwinner A1x native u-boot support
https://github.com/linux-sunxi/u-boot-sunxi/wiki
315 stars 333 forks source link

UART_2 usage on A20 #85

Open nico-meetprizm opened 9 years ago

nico-meetprizm commented 9 years ago

Hi everybody,

I'm using the u-boot from the lichee-dev-a20 branch and my goal is to use the A20's UART2 in uboot to communicate with some other component on my board but I can't quite figure it out.

From what i've gathered 'drivers/serial/serial.c' is the one responsible for initialising the serial in the function 'int serial_init (void)'. So i modified the code to also init the UART_2, the one refered as 'CONFIG_SYS_NS16550_COM3' in the driver 'ns16550'.

When I modify any of the UARTs registers either using the 'NS16550_t' structure, or directly with a pointer to the right address, it doesn't work, meaning I always read back 0x00 for every register I write. For instance I tried to write 0xBB in the 'UART_SCH' register (offset = 0x1C) for UART_1,2,3,4 and when I read it back only the one for UART_1 retained my value, all of the others are read as 0.

It almost feels like I can't modify them, as if the MMU or something prevented me from configuring my UART's but as far as I know it's supposed to be disabled.

Any help would be greatly appreciated ! Thanks !!