Hello, Here is a serie adding the changes requires to boot a ast2400 guest directly from a flash image. These images generally start with the U-boot bootloader.
U-boot on the Aspeed SOCs makes use of the SPI controller in the Command mode. In this mode, the flash content is mapped to a memory region and accesses are treated like mmios. The proposal below adds a routine which permits us to share the memory storage between the flash object and the SPI controller handling the MMIOs. This is very close to the approach taken by the pflash_cfi object. The patchset starts with a test case for the m25p80 which now supports BE host, followed with an addon for the mx25l25635f flash modules. These modules are common in the OpenPower ecosystem. Then come the changes to support the SPI controller Command mode and the mapping of the first BMC flash at 0x0. Last, is initial support for the memory controller which is used in some occasion to retrieve the size of the RAM. Thanks, C. Cédric Le Goater (7): tests: add a m25p80 test m25p80: add mx25l25635f chip ast2400: use a mx25l25635f chip m25p80: add a m25p80_set_rom_storage() routine ast2400: handle SPI flash Command mode (read only) ast2400: use contents of first SPI flash as a rom ast2400: add a memory controller device model hw/arm/ast2400.c | 13 +++ hw/arm/palmetto-bmc.c | 22 +++- hw/block/m25p80.c | 18 ++- hw/misc/Makefile.objs | 2 +- hw/misc/aspeed_sdmc.c | 126 +++++++++++++++++++++ hw/ssi/aspeed_smc.c | 60 +++++++++- include/hw/arm/ast2400.h | 1 + include/hw/block/flash.h | 2 + include/hw/misc/aspeed_sdmc.h | 49 ++++++++ include/hw/ssi/aspeed_smc.h | 1 + tests/Makefile.include | 2 + tests/m25p80-test.c | 256 ++++++++++++++++++++++++++++++++++++++++++ 12 files changed, 544 insertions(+), 8 deletions(-) create mode 100644 hw/misc/aspeed_sdmc.c create mode 100644 include/hw/misc/aspeed_sdmc.h create mode 100644 tests/m25p80-test.c -- 2.1.4