From: Kane Chen Date: Wed, 4 Feb 2026 08:21:24 +0000 (+0000) Subject: hw/arm/aspeed: Attach LTPI controller to AST1700 model X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f37bf01272a9acbb306a59f4fcc76bc11d18275;p=thirdparty%2Fqemu.git hw/arm/aspeed: Attach LTPI controller to AST1700 model Connect the LTPI controller to the AST1700 model by mapping its MMIO region. Signed-off-by: Kane-Chen-AS Reviewed-by: Cédric Le Goater Reviewed-by: Nabih Estefan Tested-by: Nabih Estefan Link: https://lore.kernel.org/qemu-devel/20260204082113.3955407-8-kane_chen@aspeedtech.com Signed-off-by: Cédric Le Goater --- diff --git a/hw/arm/aspeed_ast1700.c b/hw/arm/aspeed_ast1700.c index dd38b819b8..e4c8565d3f 100644 --- a/hw/arm/aspeed_ast1700.c +++ b/hw/arm/aspeed_ast1700.c @@ -13,6 +13,14 @@ #define AST2700_SOC_LTPI_SIZE 0x01000000 +enum { + ASPEED_AST1700_DEV_LTPI_CTRL, +}; + +static const hwaddr aspeed_ast1700_io_memmap[] = { + [ASPEED_AST1700_DEV_LTPI_CTRL] = 0x00C34000, +}; + static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) { AspeedAST1700SoCState *s = ASPEED_AST1700(dev); @@ -22,6 +30,25 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp) memory_region_init(&s->iomem, OBJECT(s), TYPE_ASPEED_AST1700, AST2700_SOC_LTPI_SIZE); sysbus_init_mmio(sbd, &s->iomem); + + /* LTPI controller */ + if (!sysbus_realize(SYS_BUS_DEVICE(&s->ltpi), errp)) { + return; + } + 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)); +} + +static void aspeed_ast1700_instance_init(Object *obj) +{ + AspeedAST1700SoCState *s = ASPEED_AST1700(obj); + + /* LTPI controller */ + object_initialize_child(obj, "ltpi-ctrl", + &s->ltpi, TYPE_ASPEED_LTPI); + + return; } static void aspeed_ast1700_class_init(ObjectClass *klass, const void *data) @@ -36,6 +63,7 @@ static const TypeInfo aspeed_ast1700_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(AspeedAST1700SoCState), .class_init = aspeed_ast1700_class_init, + .instance_init = aspeed_ast1700_instance_init, }; static void aspeed_ast1700_register_types(void) diff --git a/include/hw/arm/aspeed_ast1700.h b/include/hw/arm/aspeed_ast1700.h index 378dcb437a..addea3ab1f 100644 --- a/include/hw/arm/aspeed_ast1700.h +++ b/include/hw/arm/aspeed_ast1700.h @@ -9,6 +9,7 @@ #define ASPEED_AST1700_H #include "hw/core/sysbus.h" +#include "hw/misc/aspeed_ltpi.h" #define TYPE_ASPEED_AST1700 "aspeed.ast1700" @@ -18,6 +19,8 @@ struct AspeedAST1700SoCState { SysBusDevice parent_obj; MemoryRegion iomem; + + AspeedLTPIState ltpi; }; #endif /* ASPEED_AST1700_H */