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.

AM335x UART 8250 driver with DMA

Hello!


I have a AM335x (a phycore module, to be specific) I'm using to record some serial messages. I'd like to use Rx DMA, and I was hoping you could tell me how best to activate it.

I believe I have the 8250 driver configured correctly to enable DMA:

root@testboard:~# zcat /proc/config.gz | grep -i 8250
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_NR_UARTS=10
CONFIG_SERIAL_8250_RUNTIME_UARTS=10
# CONFIG_SERIAL_8250_EXTENDED is not set
CONFIG_SERIAL_8250_FSL=y
# CONFIG_SERIAL_8250_DW is not set
# CONFIG_SERIAL_8250_EM is not set
# CONFIG_SERIAL_8250_RT288X is not set
CONFIG_SERIAL_8250_OMAP=y
CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP=y
# CONFIG_SERIAL_8250_INGENIC is not set
# CONFIG_SERIAL_8250_MID is not set
# Non-8250 serial port support
# CONFIG_DEBUG_UART_8250 is not set


My questions are:

1. What do I need to do in my application to ensure Rx DMA is activated? Is DMA used for all reads, even those that can return after a single byte? Do I get DMA when I set c_cc[VMIN] and do a blocking read with a timeout? Can I get DMA when I read with a select? I've read some program examples, but none of them are specific about DMA.

2. I'm pretty new to this so I want to check my work to make sure I haven't messed something up. Is there a way I can verify that DMA is active and working?

3. Can I choose the size of the DMA buffer, and if so how? As I'm just logging data I don't need to access it in real time, but I'd like a big DMA buffer so nothing gets dropped even if the processor stalls for whatever reason.

Thanks for your help!