mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
{hw/i2c,docs/system/arm}: Allwinner TWI/I2C Emulation
This patch implements Allwinner TWI/I2C controller emulation. Only master-mode functionality is implemented. The SPL boot for Cubieboard expects AXP209 PMIC on TWI0/I2C0 bus, so this is first part enabling the TWI/I2C bus operation. Since both Allwinner A10 and H3 use the same module, it is added for both boards. Docs are also updated for Cubieboard and Orangepi-PC board to indicate I2C availability. Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> Message-id: 20221226220303.14420-4-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
edd3a59d5b
commit
9be8a82c0e
12 changed files with 551 additions and 1 deletions
|
@ -36,6 +36,7 @@
|
|||
#define AW_A10_OHCI_BASE 0x01c14400
|
||||
#define AW_A10_SATA_BASE 0x01c18000
|
||||
#define AW_A10_RTC_BASE 0x01c20d00
|
||||
#define AW_A10_I2C0_BASE 0x01c2ac00
|
||||
|
||||
static void aw_a10_init(Object *obj)
|
||||
{
|
||||
|
@ -56,6 +57,8 @@ static void aw_a10_init(Object *obj)
|
|||
|
||||
object_initialize_child(obj, "sata", &s->sata, TYPE_ALLWINNER_AHCI);
|
||||
|
||||
object_initialize_child(obj, "i2c0", &s->i2c0, TYPE_AW_I2C);
|
||||
|
||||
if (machine_usb(current_machine)) {
|
||||
int i;
|
||||
|
||||
|
@ -176,6 +179,11 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
|
|||
/* RTC */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &error_fatal);
|
||||
sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->rtc), 0, AW_A10_RTC_BASE, 10);
|
||||
|
||||
/* I2C */
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->i2c0), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c0), 0, AW_A10_I2C0_BASE);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c0), 0, qdev_get_gpio_in(dev, 7));
|
||||
}
|
||||
|
||||
static void aw_a10_class_init(ObjectClass *oc, void *data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue