Thread (13 messages) 13 messages, 4 authors, 2018-10-08

[PATCH v3 1/5] spi: spi-mem: Add driver for NXP FlexSPI controller

From: Boris Brezillon <hidden>
Date: 2018-10-08 12:32:45
Also in: linux-devicetree, linux-spi, lkml

On Mon, 8 Oct 2018 11:21:13 +0000
Yogesh Narayan Gaur [off-list ref] wrote:
quoted
quoted
+static void nxp_fspi_read_ahb(struct nxp_fspi *f, const struct
+spi_mem_op *op) {
+	u32 len = op->data.nbytes;
+
+	/* Read out the data directly from the AHB buffer. */
+	memcpy_fromio(op->data.buf.in, (f->ahb_addr + op->addr.val), len);  
Don't know if it's supported, but if it is, I recommend using DMA to do this copy,
because otherwise you might stall the CPU for quite a long time if the flash is
operating in a low-speed mode, and RT maintainers will complain about that at
some point ;-).
  
Read using DMA is not supported by the controller in AHB mode, only supported in IP mode.
Have to use memcpy_fromio() calls. Maximum data size can be read in single call is 0x800 using AHB read.
Still, blocking the CPU until the SPI controller has read 0x800 bytes
is enough to make you miss a real-time deadline. Don't you have a
controller that supports mem2mem transfers (I'm pretty sure a mem2mem
DMA transfer would do the trick here)?

Regards,

Boris
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help