aspeed/smc: handle SPI flash Command mode

The Aspeed SMC controllers have a mode (Command mode) in which
accesses to the flash content are no different than doing MMIOs. The
controller generates all the necessary commands to load (or store)
data in memory.

However, accesses are restricted to the segment window assigned the
the flash module by the controller. This window is defined by the
Segment Address Register.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Message-id: 1483979087-32663-8-git-send-email-clg@kaod.org
[PMM: Deleted now-unused aspeed_smc_is_usermode() function]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Cédric Le Goater 2017-01-20 11:15:08 +00:00 committed by Peter Maydell
parent 087b57c993
commit fcdf2c5945
2 changed files with 132 additions and 27 deletions

View file

@ -49,7 +49,7 @@ typedef struct AspeedSMCController {
} AspeedSMCController;
typedef struct AspeedSMCFlash {
const struct AspeedSMCState *controller;
struct AspeedSMCState *controller;
uint8_t id;
uint32_t size;