Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
qianfan-Zhao authored and pm215 committed Jun 6, 2023
1 parent 44814e2 commit a954543
Show file tree
Hide file tree
Showing 7 changed files with 297 additions and 245 deletions.
3 changes: 2 additions & 1 deletion hw/arm/Kconfig
Expand Up @@ -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

Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions hw/arm/bananapi_m2u.c
Expand Up @@ -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"

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion hw/misc/Kconfig
Expand Up @@ -176,7 +176,7 @@ config ALLWINNER_A10_CCM
config ALLWINNER_A10_DRAMC
bool

config AXP209_PMU
config AXP2XX_PMU
bool
depends on I2C

Expand Down
238 changes: 0 additions & 238 deletions hw/misc/axp209.c

This file was deleted.

0 comments on commit a954543

Please sign in to comment.