OSDN Git Service

mtd: spi-nor: fsl-quadspi: dynamically map memory space for AHB read
authorHan Xu <han.xu@freescale.com>
Tue, 4 Aug 2015 15:25:22 +0000 (10:25 -0500)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 6 Aug 2015 17:07:39 +0000 (10:07 -0700)
commit49bd706aac8fe7fa90988ecd3fd5c276575b194e
treedb73c27e64a053be286acdfb0682852adf916345
parent43163022927b6e7d202a7e6f939c3f392465494d
mtd: spi-nor: fsl-quadspi: dynamically map memory space for AHB read

QSPI may failed to map enough memory (256MB) for AHB read in
previous implementation, especially in 3G/1G memory layout kernel.
Dynamically map memory to avoid such issue.

This implementation generally map QUADSPI_MAX_IOMAP (default 4MB) memory
for AHB read, it should be enough for common scenarios, and the side
effect (0.6% performance drop) is minor.

Previous implementation

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=1K count=32K
32768+0 records in
32768+0 records out
33554432 bytes (34 MB) copied, 2.16006 s, 15.5 MB/s

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=32M count=1
1+0 records in
1+0 records out
33554432 bytes (34 MB) copied, 1.43149 s, 23.4 MB/s

After applied the patch

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=1K count=32K
32768+0 records in
32768+0 records out
33554432 bytes (34 MB) copied, 2.1743 s, 15.4 MB/s

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=32M count=1
1+0 records in
1+0 records out
33554432 bytes (34 MB) copied, 1.43158 s, 23.4 MB/s

Signed-off-by: Han Xu <han.xu@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/spi-nor/fsl-quadspi.c