hw/arm: Allwinner A10 enable SPL load from MMC

This patch enables copying of SPL from MMC if `-kernel` parameter is not
passed when starting QEMU. SPL is copied to SRAM_A.

The approach is reused from Allwinner H3 implementation.

Tested with Armbian and custom Yocto image.

Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com>

Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com>
Message-id: 20221226220303.14420-7-strahinja.p.jankovic@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Strahinja Jankovic 2022-12-26 23:03:02 +01:00 committed by Peter Maydell
parent 28057e490b
commit bb9271cadb
3 changed files with 44 additions and 0 deletions

View file

@ -16,6 +16,7 @@
#include "hw/misc/allwinner-a10-ccm.h"
#include "hw/misc/allwinner-a10-dramc.h"
#include "hw/i2c/allwinner-i2c.h"
#include "sysemu/block-backend.h"
#include "target/arm/cpu.h"
#include "qom/object.h"
@ -48,4 +49,24 @@ struct AwA10State {
OHCISysBusState ohci[AW_A10_NUM_USB];
};
/**
* Emulate Boot ROM firmware setup functionality.
*
* A real Allwinner A10 SoC contains a Boot ROM
* which is the first code that runs right after
* the SoC is powered on. The Boot ROM is responsible
* for loading user code (e.g. a bootloader) from any
* of the supported external devices and writing the
* downloaded code to internal SRAM. After loading the SoC
* begins executing the code written to SRAM.
*
* This function emulates the Boot ROM by copying 32 KiB
* of data at offset 8 KiB from the given block device and writes it to
* the start of the first internal SRAM memory.
*
* @s: Allwinner A10 state object pointer
* @blk: Block backend device object pointer
*/
void allwinner_a10_bootrom_setup(AwA10State *s, BlockBackend *blk);
#endif