aboutsummaryrefslogtreecommitdiff
path: root/hw/arm
diff options
context:
space:
mode:
authorqianfan Zhao <qianfanguijin@163.com>2023-06-06 10:19:32 +0100
committerPeter Maydell <peter.maydell@linaro.org>2023-06-06 10:19:32 +0100
commita95454309269d579d936f3c9c736b436910f74f8 (patch)
treecc196321b843f7dea8197423f94a76c693ac7751 /hw/arm
parent44814e210acb589bfdab073b3bed3a6d9a306ca3 (diff)
downloadqemu-a95454309269d579d936f3c9c736b436910f74f8.zip
qemu-a95454309269d579d936f3c9c736b436910f74f8.tar.gz
qemu-a95454309269d579d936f3c9c736b436910f74f8.tar.bz2
hw/misc: Rename axp209 to axp22x and add support AXP221 PMU
This patch adds minimal support for AXP-221 PMU and connect it to bananapi M2U board. Signed-off-by: qianfan Zhao <qianfanguijin@163.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm')
-rw-r--r--hw/arm/Kconfig3
-rw-r--r--hw/arm/bananapi_m2u.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 02b2d81..007a81e 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -383,7 +383,7 @@ config ALLWINNER_A10
select ALLWINNER_WDT
select ALLWINNER_EMAC
select ALLWINNER_I2C
- select AXP209_PMU
+ select AXP2XX_PMU
select SERIAL
select UNIMP
@@ -407,6 +407,7 @@ config ALLWINNER_R40
bool
default y if TCG && ARM
select ALLWINNER_A10_PIT
+ select AXP2XX_PMU
select SERIAL
select ARM_TIMER
select ARM_GIC
diff --git a/hw/arm/bananapi_m2u.c b/hw/arm/bananapi_m2u.c
index 1d49a00..9c5360a 100644
--- a/hw/arm/bananapi_m2u.c
+++ b/hw/arm/bananapi_m2u.c
@@ -23,6 +23,7 @@
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "hw/boards.h"
+#include "hw/i2c/i2c.h"
#include "hw/qdev-properties.h"
#include "hw/arm/allwinner-r40.h"
@@ -61,6 +62,7 @@ static void bpim2u_init(MachineState *machine)
{
bool bootroom_loaded = false;
AwR40State *r40;
+ I2CBus *i2c;
/* BIOS is not supported by this board */
if (machine->firmware) {
@@ -104,6 +106,10 @@ static void bpim2u_init(MachineState *machine)
}
}
+ /* Connect AXP221 */
+ i2c = I2C_BUS(qdev_get_child_bus(DEVICE(&r40->i2c0), "i2c"));
+ i2c_slave_create_simple(i2c, "axp221_pmu", 0x34);
+
/* SDRAM */
memory_region_add_subregion(get_system_memory(),
r40->memmap[AW_R40_DEV_SDRAM], machine->ram);