Commit 8cb4865429 for qemu.org
commit 8cb486542992ec796bbc43a03533e74e3ead5ef4
Author: Kane Chen <kane_chen@aspeedtech.com>
Date: Wed Feb 4 08:21:39 2026 +0000
hw/arm/aspeed: Attach SGPIOM device to AST1700 model
Connect the SGPIOM device to AST1700 model.
Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Tested-by: Nabih Estefan <nabihestefan@google.com>
Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-18-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
diff --git a/hw/arm/aspeed_ast1700.c b/hw/arm/aspeed_ast1700.c
index c0b288a0fc..174186964e 100644
--- a/hw/arm/aspeed_ast1700.c
+++ b/hw/arm/aspeed_ast1700.c
@@ -23,6 +23,8 @@ enum {
ASPEED_AST1700_DEV_ADC,
ASPEED_AST1700_DEV_SCU,
ASPEED_AST1700_DEV_GPIO,
+ ASPEED_AST1700_DEV_SGPIOM0,
+ ASPEED_AST1700_DEV_SGPIOM1,
ASPEED_AST1700_DEV_I2C,
ASPEED_AST1700_DEV_UART12,
ASPEED_AST1700_DEV_LTPI_CTRL,
@@ -37,6 +39,8 @@ static const hwaddr aspeed_ast1700_io_memmap[] = {
[ASPEED_AST1700_DEV_ADC] = 0x00C00000,
[ASPEED_AST1700_DEV_SCU] = 0x00C02000,
[ASPEED_AST1700_DEV_GPIO] = 0x00C0B000,
+ [ASPEED_AST1700_DEV_SGPIOM0] = 0x00C0C000,
+ [ASPEED_AST1700_DEV_SGPIOM1] = 0x00C0D000,
[ASPEED_AST1700_DEV_I2C] = 0x00C0F000,
[ASPEED_AST1700_DEV_UART12] = 0x00C33B00,
[ASPEED_AST1700_DEV_LTPI_CTRL] = 0x00C34000,
@@ -147,6 +151,17 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion(&s->iomem,
aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_LTPI_CTRL],
sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->ltpi), 0));
+
+ /* SGPIOM */
+ for (int i = 0; i < AST1700_SGPIO_NUM; i++) {
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->sgpiom[i]), errp)) {
+ return;
+ }
+ memory_region_add_subregion(&s->iomem,
+ aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SGPIOM0 + i],
+ sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->sgpiom[i]), 0));
+ }
+
/* WDT */
for (int i = 0; i < AST1700_WDT_NUM; i++) {
AspeedWDTClass *awc = ASPEED_WDT_GET_CLASS(&s->wdt[i]);
@@ -200,6 +215,12 @@ static void aspeed_ast1700_instance_init(Object *obj)
object_initialize_child(obj, "ltpi-ctrl",
&s->ltpi, TYPE_ASPEED_LTPI);
+ /* SGPIOM */
+ for (int i = 0; i < AST1700_SGPIO_NUM; i++) {
+ object_initialize_child(obj, "ioexp-sgpiom[*]", &s->sgpiom[i],
+ "aspeed.sgpio-ast2700");
+ }
+
/* WDT */
for (int i = 0; i < AST1700_WDT_NUM; i++) {
object_initialize_child(obj, "ioexp-wdt[*]",
diff --git a/include/hw/arm/aspeed_ast1700.h b/include/hw/arm/aspeed_ast1700.h
index 8db513a38c..b5cb0a9010 100644
--- a/include/hw/arm/aspeed_ast1700.h
+++ b/include/hw/arm/aspeed_ast1700.h
@@ -12,6 +12,7 @@
#include "hw/misc/aspeed_scu.h"
#include "hw/adc/aspeed_adc.h"
#include "hw/gpio/aspeed_gpio.h"
+#include "hw/gpio/aspeed_sgpio.h"
#include "hw/i2c/aspeed_i2c.h"
#include "hw/misc/aspeed_ltpi.h"
#include "hw/misc/aspeed_pwm.h"
@@ -19,6 +20,7 @@
#include "hw/watchdog/wdt_aspeed.h"
#include "hw/char/serial-mm.h"
+#define AST1700_SGPIO_NUM 2
#define AST1700_WDT_NUM 9
#define TYPE_ASPEED_AST1700 "aspeed.ast1700"
@@ -40,6 +42,7 @@ struct AspeedAST1700SoCState {
AspeedADCState adc;
AspeedSCUState scu;
AspeedGPIOState gpio;
+ AspeedSGPIOState sgpiom[AST1700_SGPIO_NUM];
AspeedI2CState i2c;
AspeedPWMState pwm;
AspeedWDTState wdt[AST1700_WDT_NUM];