]> xenbits.xensource.com Git - people/pauldu/qemu.git/commitdiff
hw/arm: Add AXP209 to Cubieboard
authorStrahinja Jankovic <strahinjapjankovic@gmail.com>
Mon, 26 Dec 2022 22:03:01 +0000 (23:03 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 12 Jan 2023 16:50:19 +0000 (16:50 +0000)
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>
hw/arm/Kconfig
hw/arm/cubieboard.c

index 3e9b2a23fd57c260b17e446b348033daaf46f0b4..19d6b9d95f543777b8026f01f37ed92556be110f 100644 (file)
@@ -327,6 +327,7 @@ config ALLWINNER_A10
     select ALLWINNER_A10_DRAMC
     select ALLWINNER_EMAC
     select ALLWINNER_I2C
+    select AXP209_PMU
     select SERIAL
     select UNIMP
 
index 5e3372a3c7bda54c4a456323080bf9f18aca0068..dca257620d068b98eeb4d3e6c4d408a207a73cf4 100644 (file)
@@ -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;