Hello All,
We are trying to implement a UART using the hardware UART peripheral of the PRU-ICSS on a custom board based on the AM4378. We would appreciate any pointers to code and documentation to accomplish this.
Thanks you in advance!
Mukundan
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello All,
We are trying to implement a UART using the hardware UART peripheral of the PRU-ICSS on a custom board based on the AM4378. We would appreciate any pointers to code and documentation to accomplish this.
Thanks you in advance!
Mukundan
Hi,
The PRU-ICSS UART is enabled for AM335x. Following are the kernel patches which enable it for AM335x. I think you only need modify AM437x device tree to add the pruss_uart node and set the pinmux.
https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/log/?h=ti-linux-5.4.y&qt=grep&q=pruss+uart
Here is the documentation about PRU-ICSS UART driver on AM335x.
Hi Bin Liu,
I guess this driver does not require a PRU firmware because it directly accesses the 16550 registers via the rproc pointer, which in turn uses the remoteproc driver to access the PRU hardware uart registers? Please correct me if my understanding is not correct.
Thank you!
Hi,
The PRU UART driver directly access the PRU HW UART in the same way as the other main UARTs, it doesn't require rproc either. It only depends on
- the pruss driver, to turn on power and clock for the PRU-ICSS module;
- the pruss-intc driver, to handling the interrupt mapping.
Hi Bin Liu,
Thank you for your reply. I have the below further questions:
Appreciate all your help!
Thanks,
Hi,
How do I use this driver for sending and receiving bytes, as I do not see any functions in it for Open, Read, Write.
In the same way as using other UARTs. This driver will expose the PRU UART device node /dev/ttyS*.
The driver seems to be setting baud to 38,400. If I replace this number by 115200, would that work?
No, the number 38400 you see in the driver source code does not hard code the baud rate. Don't change the code. The buad rate is set in user space applications.
Is there a demo app that uses this driver?
Any Linux UART program can use this PRU UART device.
Do I need to access the 16550 registers? If so how do I do it?
No, I believe you don't need to change anything in the driver, just add the device tree bindings to enable this PRU UART on your platform.
Does the driver handle Rx and Tx interrupts automatically through pruss_intc driver?
Yes.
Sorry, Just realized I had a typo in my previous response.
No, the number 38400 you see in the driver source code does hard code the baud rate.
I meant "it does NOT hard code the buad rate". I corrected it.