Jump to content

problem R_UART


Dmitriy

Recommended Posts

                 Hello to all!

I have banana pi m2+ with Allwinner H3.

OS: ARMBIAN Debian GNU/Linux 8 (jessie) 3.4.112-sun8i

I program linux kernel driver.

And I am can't run R_UART.

I write to register any value, and read value alway zero.

It seems that APB0 bus is not cloked. Or device R_UART reset asserted.

 

What I do wrong?

 

Sincerely, Dmitriy.

Link to comment
Share on other sites

What are you trying to do? R_UART is only meant to be used by ARISC coprocessor. You can first enable R_UART in script.bin, then connect it to PC and while booting or suspend/resume procedure you can observe output from ARISC. It will be mostly about current RAM settings, etc. Basically, it is just for debugging.

Link to comment
Share on other sites

R_UART is only meant to be used by ARISC coprocessor. Basically, it is just for debugging.

Why do you think so?

R_UART connected to pins PL2 and PL 3.

It has address 0X01F0 2800 and interrupt vector.

And from datasheet: There are 5 UART controllers. All UART controllers can be configured as Serial IrDA.

UART0, UART1, UART2, UART3,R_UART?

Where do you find this information?

Link to comment
Share on other sites

Well, for one, I already connected R_UART port for debugging sleep/resume and I received output. Secondly, all things in script.bin which starts with "s_" are meant for ARISC. Check those comments here: https://github.com/igorpecovnik/lib/blob/master/config/fex/bananapim2plus.fex#L1187Why they are here named "s_" instead of "r_" I don't know, but if you check pins, it's the same. Third, I checked kernel source code, s_uart is referenced in arisc.c as ARISC resource:

https://github.com/igorpecovnik/linux/blob/sun8i/drivers/arisc/arisc.c#L483

 

And while it is true that s_uart port is referenced in sunxi-uart.c:

https://github.com/igorpecovnik/linux/blob/sun8i/drivers/tty/serial/sunxi-uart.c#L787

 

It is dependent on SUNXI_S_UART macro, which is defined here:

https://github.com/igorpecovnik/linux/blob/sun8i/drivers/tty/serial/sunxi-uart.h#L202

 

but only for sun8iw5 platform. H3 is sun8iw7.

 

Hope this answers all your questions.

Link to comment
Share on other sites

Thank you for detailed answer.

Do I right understand, what in banana pi m2+ not possible to use R_UART for general purposes such as UART1-UART3?

Maybe is possible change some config for it? Or any other solution?

Link to comment
Share on other sites

Currently it is not possible to use it on any H3 board with BSP kernel or mainline (vanilla). Maybe it would work if you modify kernel, but AFAIK noone has done this. Why do you need exactly this port so badly? Aren't others enough?

Link to comment
Share on other sites

You can use some I2C to UART chips such SC16IS740 (or dual UARTs SC16IS752), but Linux kernel drivers are not aware of them, you would need to deal with your own self-written driver.

 

EDIT : I was wrong, Linux Kernel has a driver with SERIAL_SC16IS7XX_I2C kernel config.

Link to comment
Share on other sites

martinayotte, thank you for advice.

jernej

I have resolved my problem.

I chenged

[s_uart0]
s_uart_used       = 0
s_uart_tx         = port:PL02<2><default><default><default>
s_uart_rx         = port:PL03<2><default><default><default>

to s_uart_used =1

and re-compile kernel.

After it, the registers R_UART write correct.

And I am using R_UART as general UART.

Thank you for hint.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines