|
@@ -24,7 +24,9 @@
|
|
|
#include "sysemu/sysemu.h"
|
|
|
#include "hw/boards.h"
|
|
|
#include "hw/usb/hcd-ohci.h"
|
|
|
+#include "hw/loader.h"
|
|
|
|
|
|
+#define AW_A10_SRAM_A_BASE 0x00000000
|
|
|
#define AW_A10_DRAMC_BASE 0x01c01000
|
|
|
#define AW_A10_MMC0_BASE 0x01c0f000
|
|
|
#define AW_A10_CCM_BASE 0x01c20000
|
|
@@ -38,6 +40,22 @@
|
|
|
#define AW_A10_RTC_BASE 0x01c20d00
|
|
|
#define AW_A10_I2C0_BASE 0x01c2ac00
|
|
|
|
|
|
+void allwinner_a10_bootrom_setup(AwA10State *s, BlockBackend *blk)
|
|
|
+{
|
|
|
+ const int64_t rom_size = 32 * KiB;
|
|
|
+ g_autofree uint8_t *buffer = g_new0(uint8_t, rom_size);
|
|
|
+
|
|
|
+ if (blk_pread(blk, 8 * KiB, rom_size, buffer, 0) < 0) {
|
|
|
+ error_setg(&error_fatal, "%s: failed to read BlockBackend data",
|
|
|
+ __func__);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ rom_add_blob("allwinner-a10.bootrom", buffer, rom_size,
|
|
|
+ rom_size, AW_A10_SRAM_A_BASE,
|
|
|
+ NULL, NULL, NULL, NULL, false);
|
|
|
+}
|
|
|
+
|
|
|
static void aw_a10_init(Object *obj)
|
|
|
{
|
|
|
AwA10State *s = AW_A10(obj);
|