aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/cubieboard.c
diff options
context:
space:
mode:
authorStrahinja Jankovic <strahinjapjankovic@gmail.com>2022-12-26 23:03:01 +0100
committerPeter Maydell <peter.maydell@linaro.org>2023-01-12 16:50:19 +0000
commit28057e490b970390e3a94fce1a36098ddeb0026d (patch)
treef7d1d90ed02ab936913969df2d3ebaca1acad4b4 /hw/arm/cubieboard.c
parent632dfea36bbd1b754c6f42e10fef111bf4d3f612 (diff)
hw/arm: Add AXP209 to Cubieboard
SPL Boot for Cubieboard expects AXP209 connected to I2C0 bus. Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20221226220303.14420-6-strahinja.p.jankovic@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm/cubieboard.c')
-rw-r--r--hw/arm/cubieboard.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c
index 5e3372a3c7..dca257620d 100644
--- a/hw/arm/cubieboard.c
+++ b/hw/arm/cubieboard.c
@@ -20,6 +20,7 @@
#include "hw/boards.h"
#include "hw/qdev-properties.h"
#include "hw/arm/allwinner-a10.h"
+#include "hw/i2c/i2c.h"
static struct arm_boot_info cubieboard_binfo = {
.loader_start = AW_A10_SDRAM_BASE,
@@ -34,6 +35,7 @@ static void cubieboard_init(MachineState *machine)
BlockBackend *blk;
BusState *bus;
DeviceState *carddev;
+ I2CBus *i2c;
/* BIOS is not supported by this board */
if (machine->firmware) {
@@ -80,6 +82,10 @@ static void cubieboard_init(MachineState *machine)
exit(1);
}
+ /* Connect AXP 209 */
+ i2c = I2C_BUS(qdev_get_child_bus(DEVICE(&a10->i2c0), "i2c"));
+ i2c_slave_create_simple(i2c, "axp209_pmu", 0x34);
+
/* Retrieve SD bus */
di = drive_get(IF_SD, 0, 0);
blk = di ? blk_by_legacy_dinfo(di) : NULL;