On Thu, Mar 17, 2022 at 06:46:25PM +0100, Miquel Raynal wrote: > From: Phil Edworthy <phil.edworthy@xxxxxxxxxxx> > > DW based controllers like the one on Renesas RZ/N1 must be programmed as > flow controllers when using DMA. > > * Table 11.45 of the system manual, "Flow Control Combinations", states > that using UART with DMA requires setting the DMA in the peripheral > flow controller mode regardless of the direction. > > * Chapter 11.6.1.3 of the system manual, "Basic Interface Definitions", > explains that the burst size in the above case must be configured in > the peripheral's register DEST/SRC_BURST_SIZE. > > Experiments shown that upon Rx timeout, the DMA transaction needed to be > manually cleared as well. ... > +#define DW_UART_TDMACR 0x10c /* DMA Control Register Transmit Mode */ > +#define DW_UART_RDMACR 0x110 /* DMA Control Register Receive Mode */ These are not Synposys ones. ... > +static u32 dw8250_rzn1_get_dmacr_burst(int max_burst) > +{ > + if (max_burst >= 8) > + return DW_UART_xDMACR_8_WORD_BURST; > + else if (max_burst >= 4) > + return DW_UART_xDMACR_4_WORD_BURST; > + else > + return DW_UART_xDMACR_1_WORD_BURST; > +} Redundant 'else' in all cases. -- With Best Regards, Andy Shevchenko