mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
hw/arm/allwinner: add SD/MMC host controller
The Allwinner System on Chip families sun4i and above contain an integrated storage controller for Secure Digital (SD) and Multi Media Card (MMC) interfaces. This commit adds support for the Allwinner SD/MMC storage controller with the following emulated features: * DMA transfers * Direct FIFO I/O * Short/Long format command responses * Auto-Stop command (CMD12) * Insert & remove card detection The following boards are extended with the SD host controller: * Cubieboard (hw/arm/cubieboard.c) * Orange Pi PC (hw/arm/orangepi.c) Signed-off-by: Niek Linnenbank <nieklinnenbank@gmail.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20200311221854.30370-9-nieklinnenbank@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
6556617ce1
commit
82e4838249
11 changed files with 1059 additions and 1 deletions
|
@ -27,6 +27,7 @@
|
|||
#include "hw/boards.h"
|
||||
#include "hw/usb/hcd-ohci.h"
|
||||
|
||||
#define AW_A10_MMC0_BASE 0x01c0f000
|
||||
#define AW_A10_PIC_REG_BASE 0x01c20400
|
||||
#define AW_A10_PIT_REG_BASE 0x01c20c00
|
||||
#define AW_A10_UART0_REG_BASE 0x01c28000
|
||||
|
@ -64,6 +65,9 @@ static void aw_a10_init(Object *obj)
|
|||
sizeof(s->ohci[i]), TYPE_SYSBUS_OHCI);
|
||||
}
|
||||
}
|
||||
|
||||
sysbus_init_child_obj(obj, "mmc0", &s->mmc0, sizeof(s->mmc0),
|
||||
TYPE_AW_SDHOST_SUN4I);
|
||||
}
|
||||
|
||||
static void aw_a10_realize(DeviceState *dev, Error **errp)
|
||||
|
@ -164,6 +168,13 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
|
|||
qdev_get_gpio_in(dev, 64 + i));
|
||||
}
|
||||
}
|
||||
|
||||
/* SD/MMC */
|
||||
qdev_init_nofail(DEVICE(&s->mmc0));
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->mmc0), 0, AW_A10_MMC0_BASE);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->mmc0), 0, qdev_get_gpio_in(dev, 32));
|
||||
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->mmc0),
|
||||
"sd-bus", &error_abort);
|
||||
}
|
||||
|
||||
static void aw_a10_class_init(ObjectClass *oc, void *data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue