]> git.baikalelectronics.ru Git - uboot.git/commit
spi: atmel-quadspi: fix possible MMIO window size overrun
authorTudor Ambarus <tudor.ambarus@microchip.com>
Fri, 20 Mar 2020 09:37:59 +0000 (09:37 +0000)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 2 Apr 2020 11:45:55 +0000 (17:15 +0530)
commit2d7c201b920d7210bfe0dcbad398a70f3b378901
tree59fdeec5c5272f2b55d2b08d0a5a8bf17c2f4340
parent6a030169afb76c2d1683ac73fb3a439857d5ec11
spi: atmel-quadspi: fix possible MMIO window size overrun

The sama5d2 QSPI controller memory space is limited to 128MB:
0x9000_00000-0x9800_00000/0XD000_0000--0XD800_0000.

There are nor flashes that are bigger in size than the memory size
supported by the controller: Micron MT25QL02G (256 MB).

Check if the address exceeds the MMIO window size. An improvement
would be to add support for regular SPI mode and fall back to it
when the flash memories overrun the controller's memory space.

Fixes: b6f2f084c610 ("spi: Add Atmel QuadSPI driver")
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/spi/atmel-quadspi.c