On Thu, Feb 6, 2014 at 4:14 AM, Florian Fainelli <flor...@openwrt.org> wrote: > Hi, > > Le 02/02/2014 12:01, dani a écrit : > >> Decrease the SPI FIFO size in BMC6348 boards to avoid random reads/writes. >> >> The parameter BCM63XX_SPI_MAX_PREPEND is causing the SPI driver exceeds >> the hardware capabilities when reading transfer lengths over 58 bytes. >> Decreasing the SPI fifo size exactly the BCM63XX_SPI_MAX_PREPEND lenght >> solves the problem. >> >> I noticed it when I connected an external SPI flash memory to my old >> livebox1, the flash memory was correctly recognized as another mtd device >> with its partition, and everything seemed to be going well. When using dd, >> with block sizes <=58 all reads went fine, but over 58 all the reads were >> totally random. I know the SPI driver is far from being perfect, but I think >> It's a good idea to fix this if someone decides to use the BCM6348 SPI >> interface in his board. >> >> With this patch the random reads never happens, when you exceed the limit >> it returns the error >> unable to do transfers larger than FIFO size (%i > %i) >> As done before the patch. It seems the driver still needs further work. > > > The patch looks correct on the principle, but I would do that in the spi > driver directly for two reasons: > > - you would not need to duplicate the prepend count value in dev-spi.c > - you would make this work for 6358 and 6368 as well
I did not encounter this problem on my 6368 with SPI connected flash, so I suspect this only affects 6338/6348. Also I still wonder why >> With this patch the random reads never happens, when you exceed the limit >> it returns the error >> unable to do transfers larger than FIFO size (%i > %i) this happens, the m25p80 fixup should prevent it (on reads) and automatically split any reads > FIFO size into appropriate chunks (writes will be broken because it does not do that yet there). Jonas _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel