mtd: spi-nor: aspeed: configure chip window on AHB bus
authorCédric Le Goater <clg@kaod.org>
Thu, 20 Apr 2017 11:56:36 +0000 (13:56 +0200)
committerCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Wed, 21 Jun 2017 22:22:51 +0000 (00:22 +0200)
commit7ef0e5e16d18a38af489bea7193ba3b2be31ee58
tree63acfd8ee5bb5daac03d5be2867091b7375700d4
parenta9f127bb5f92379ecb135a66bb89f8403e998d96
mtd: spi-nor: aspeed: configure chip window on AHB bus

The segment registers of the SMC controller provide a way to configure
the mapping windows of the chips on the AHB bus. The settings are
required to be correct when the controller operates in Command mode,
which is the case for DMAs and the LPC mapping.

This tries to set the segment registers of each chip depending on the
size of the flash device and depending on the previous segment
settings, in order to have a contiguous window across multiple chips.

Unfortunately, the AST2500 SPI controller has a bug and it is not
possible to configure a full 128MB window for a chip of the same
size. The window size needs to be restricted to 120MB. This issue only
applies to CE0.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
drivers/mtd/spi-nor/aspeed-smc.c