On Tue, Mar 07, 2023 at 06:21:36PM +0000, Christophe Leroy wrote: > > On powerpc CPM soc, SPI handles words in reversed byte order. Therefore > when some drivers like the GPIO max7301 driver request 16 bits data, > data is sent in wrong byte order. Clearly if the device is byte swapping the data incorrectly then you'll need to do an extra swap in the CPU before sending to the device, or get the DMA controller to do it if that's a feature it has, when using the 16 bit mode. > We could do as in spi-fsl-spi.c SPI driver for the QE soc and force 8 > bits transfer at all time: Right, that's the simplest thing. > What could be the best solution to force 8 bits transfer on generic > drivers like GPIO max7301 while still allowing aware drivers like my > FPGA loader to use 16 bits mode by reversing words by itself ? If your FPGA loader is already reversing words you may as well just move it into the controller driver.
Attachment:
signature.asc
Description: PGP signature