From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: "Steven Lee" <steven_lee@aspeedtech.com>,
"Cédric Le Goater" <clg@redhat.com>
Subject: [PULL 15/23] aspeed: ast27x0: Map unimplemented devices in SoC memory
Date: Mon, 5 May 2025 11:06:27 +0200 [thread overview]
Message-ID: <20250505090635.778785-16-clg@redhat.com> (raw)
In-Reply-To: <20250505090635.778785-1-clg@redhat.com>
From: Steven Lee <steven_lee@aspeedtech.com>
Maps following unimplemented devices in SoC memory
- dpmcu
- iomem
- iomem0
- iomem1
- ltpi
Iomem, Iomem0 and Iomem1 include unimplemented controllers in the memory ranges 0x0 - 0x1000000, 0x120000000 - 0x121000000 and
0x14000000 - 0x141000000.
For instance:
- USB hub at 0x12010000
- eSPI at 0x14C5000
- PWM at 0x140C0000
DPMCU stands for Display Port MCU controller. LTPI is used to connect to AST1700.
AST1700 is an I/O expander that supports the DC-SCM 2.1 LTPI protocol.
It provides AST2700 with additional GPIO, UART, I3C, and other interfaces.
Signed-off-by: Steven Lee <steven_lee@aspeedtech.com>
Change-Id: Iae4db49a4818af3e2c43c16a27fc76329d2405d6
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250502103449.3091642-2-steven_lee@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
include/hw/arm/aspeed_soc.h | 6 +++++
hw/arm/aspeed_ast27x0.c | 52 ++++++++++++++++++++++++++++++++-----
2 files changed, 51 insertions(+), 7 deletions(-)
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
index 4dcb1010dc28..5fcfd2fe2e62 100644
--- a/include/hw/arm/aspeed_soc.h
+++ b/include/hw/arm/aspeed_soc.h
@@ -91,6 +91,8 @@ struct AspeedSoCState {
SerialMM uart[ASPEED_UARTS_NUM];
Clock *sysclk;
UnimplementedDeviceState iomem;
+ UnimplementedDeviceState iomem0;
+ UnimplementedDeviceState iomem1;
UnimplementedDeviceState video;
UnimplementedDeviceState emmc_boot_controller;
UnimplementedDeviceState dpmcu;
@@ -98,6 +100,7 @@ struct AspeedSoCState {
UnimplementedDeviceState espi;
UnimplementedDeviceState udc;
UnimplementedDeviceState sgpiom;
+ UnimplementedDeviceState ltpi;
UnimplementedDeviceState jtag[ASPEED_JTAG_NUM];
AspeedAPB2OPBState fsi[2];
};
@@ -173,6 +176,9 @@ enum {
ASPEED_DEV_VBOOTROM,
ASPEED_DEV_SPI_BOOT,
ASPEED_DEV_IOMEM,
+ ASPEED_DEV_IOMEM0,
+ ASPEED_DEV_IOMEM1,
+ ASPEED_DEV_LTPI,
ASPEED_DEV_UART0,
ASPEED_DEV_UART1,
ASPEED_DEV_UART2,
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
index a289e65e495d..21769669df27 100644
--- a/hw/arm/aspeed_ast27x0.c
+++ b/hw/arm/aspeed_ast27x0.c
@@ -23,9 +23,17 @@
#include "qobject/qlist.h"
#include "qemu/log.h"
+#define AST2700_SOC_IO_SIZE 0x01000000
+#define AST2700_SOC_IOMEM_SIZE 0x01000000
+#define AST2700_SOC_DPMCU_SIZE 0x00040000
+#define AST2700_SOC_LTPI_SIZE 0x01000000
+
static const hwaddr aspeed_soc_ast2700_memmap[] = {
+ [ASPEED_DEV_IOMEM] = 0x00000000,
[ASPEED_DEV_VBOOTROM] = 0x00000000,
[ASPEED_DEV_SRAM] = 0x10000000,
+ [ASPEED_DEV_DPMCU] = 0x11000000,
+ [ASPEED_DEV_IOMEM0] = 0x12000000,
[ASPEED_DEV_EHCI1] = 0x12061000,
[ASPEED_DEV_EHCI2] = 0x12063000,
[ASPEED_DEV_HACE] = 0x12070000,
@@ -39,6 +47,7 @@ static const hwaddr aspeed_soc_ast2700_memmap[] = {
[ASPEED_DEV_TIMER1] = 0x12C10000,
[ASPEED_DEV_SLI] = 0x12C17000,
[ASPEED_DEV_UART4] = 0X12C1A000,
+ [ASPEED_DEV_IOMEM1] = 0x14000000,
[ASPEED_DEV_FMC] = 0x14000000,
[ASPEED_DEV_SPI0] = 0x14010000,
[ASPEED_DEV_SPI1] = 0x14020000,
@@ -73,6 +82,7 @@ static const hwaddr aspeed_soc_ast2700_memmap[] = {
[ASPEED_DEV_UART12] = 0X14C33B00,
[ASPEED_DEV_WDT] = 0x14C37000,
[ASPEED_DEV_SPI_BOOT] = 0x100000000,
+ [ASPEED_DEV_LTPI] = 0x300000000,
[ASPEED_DEV_SDRAM] = 0x400000000,
};
@@ -507,6 +517,16 @@ static void aspeed_soc_ast2700_init(Object *obj)
snprintf(typename, sizeof(typename), "aspeed.hace-%s", socname);
object_initialize_child(obj, "hace", &s->hace, typename);
+ object_initialize_child(obj, "dpmcu", &s->dpmcu,
+ TYPE_UNIMPLEMENTED_DEVICE);
+ object_initialize_child(obj, "ltpi", &s->ltpi,
+ TYPE_UNIMPLEMENTED_DEVICE);
+ object_initialize_child(obj, "iomem", &s->iomem,
+ TYPE_UNIMPLEMENTED_DEVICE);
+ object_initialize_child(obj, "iomem0", &s->iomem0,
+ TYPE_UNIMPLEMENTED_DEVICE);
+ object_initialize_child(obj, "iomem1", &s->iomem1,
+ TYPE_UNIMPLEMENTED_DEVICE);
}
/*
@@ -542,8 +562,11 @@ static bool aspeed_soc_ast2700_gic_realize(DeviceState *dev, Error **errp)
if (!sysbus_realize(gicbusdev, errp)) {
return false;
}
- sysbus_mmio_map(gicbusdev, 0, sc->memmap[ASPEED_GIC_DIST]);
- sysbus_mmio_map(gicbusdev, 1, sc->memmap[ASPEED_GIC_REDIST]);
+
+ aspeed_mmio_map(s, SYS_BUS_DEVICE(&a->gic), 0,
+ sc->memmap[ASPEED_GIC_DIST]);
+ aspeed_mmio_map(s, SYS_BUS_DEVICE(&a->gic), 1,
+ sc->memmap[ASPEED_GIC_REDIST]);
for (i = 0; i < sc->num_cpus; i++) {
DeviceState *cpudev = DEVICE(&a->cpu[i]);
@@ -911,11 +934,26 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
sysbus_connect_irq(SYS_BUS_DEVICE(&s->hace), 0,
aspeed_soc_get_irq(s, ASPEED_DEV_HACE));
- create_unimplemented_device("ast2700.dpmcu", 0x11000000, 0x40000);
- create_unimplemented_device("ast2700.iomem0", 0x12000000, 0x01000000);
- create_unimplemented_device("ast2700.iomem1", 0x14000000, 0x01000000);
- create_unimplemented_device("ast2700.ltpi", 0x30000000, 0x1000000);
- create_unimplemented_device("ast2700.io", 0x0, 0x4000000);
+ aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->dpmcu),
+ "aspeed.dpmcu",
+ sc->memmap[ASPEED_DEV_DPMCU],
+ AST2700_SOC_DPMCU_SIZE);
+ aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->ltpi),
+ "aspeed.ltpi",
+ sc->memmap[ASPEED_DEV_LTPI],
+ AST2700_SOC_LTPI_SIZE);
+ aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->iomem),
+ "aspeed.io",
+ sc->memmap[ASPEED_DEV_IOMEM],
+ AST2700_SOC_IO_SIZE);
+ aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->iomem0),
+ "aspeed.iomem0",
+ sc->memmap[ASPEED_DEV_IOMEM0],
+ AST2700_SOC_IOMEM_SIZE);
+ aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->iomem1),
+ "aspeed.iomem1",
+ sc->memmap[ASPEED_DEV_IOMEM1],
+ AST2700_SOC_IOMEM_SIZE);
}
static void aspeed_soc_ast2700a0_class_init(ObjectClass *oc, const void *data)
--
2.49.0
next prev parent reply other threads:[~2025-05-05 9:13 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-05 9:06 [PULL 00/23] aspeed queue Cédric Le Goater
2025-05-05 9:06 ` [PULL 01/23] hw/arm: ast27x0: Wire up EHCI controllers Cédric Le Goater
2025-05-05 9:06 ` [PULL 02/23] hw/ssi/aspeed_smc: Allow 64-bit wide flash accesses Cédric Le Goater
2025-05-05 9:06 ` [PULL 03/23] tests/functional/aspeed: Update test ASPEED SDK v09.06 for AST2500 Cédric Le Goater
2025-05-05 9:06 ` [PULL 04/23] tests/functional/aspeed: Update test ASPEED SDK v09.06 for AST2600 Cédric Le Goater
2025-05-05 9:06 ` [PULL 05/23] tests/functional/aspeed: Update test ASPEED SDK v03.00 for AST1030 Cédric Le Goater
2025-05-05 9:06 ` [PULL 06/23] hw/arm/aspeed_ast27x0: Rename variable sram_name to name in ast2700 realize Cédric Le Goater
2025-05-05 9:06 ` [PULL 07/23] tests/functional/aspeed: Move I2C test into shared helper for AST2700 reuse Cédric Le Goater
2025-05-05 9:06 ` [PULL 08/23] tests/functional/aspeed: Update test ASPEED SDK v09.06 Cédric Le Goater
2025-05-05 9:06 ` [PULL 09/23] tests/functional/aspeed: extract boot and login sequence into helper function Cédric Le Goater
2025-05-05 9:06 ` [PULL 10/23] hw/arm/aspeed_ast27x0 Introduce vbootrom memory region Cédric Le Goater
2025-05-05 9:06 ` [PULL 11/23] hw/arm/aspeed: Add support for loading vbootrom image via "-bios" Cédric Le Goater
2025-05-05 9:06 ` [PULL 12/23] tests/functional/aspeed: Add to test vbootrom for AST2700 Cédric Le Goater
2025-05-05 9:06 ` [PULL 13/23] docs/system/arm/aspeed: move AST2700 content to new section Cédric Le Goater
2025-05-05 9:06 ` [PULL 14/23] docs/system/arm/aspeed: Support vbootrom for AST2700 Cédric Le Goater
2025-05-05 9:06 ` Cédric Le Goater [this message]
2025-05-05 9:06 ` [PULL 16/23] aspeed: ast27x0: Correct hex notation for device addresses Cédric Le Goater
2025-05-05 9:06 ` [PULL 17/23] hw/intc/aspeed: Add support for AST2700 SSP INTC Cédric Le Goater
2025-05-05 9:06 ` [PULL 18/23] hw/intc/aspeed: Add support for AST2700 TSP INTC Cédric Le Goater
2025-05-05 9:06 ` [PULL 19/23] hw/arm/aspeed_ast27x0-ssp: Introduce AST27x0 A1 SSP SoC Cédric Le Goater
2025-05-05 9:06 ` [PULL 20/23] hw/arm/aspeed_ast27x0-tsp: Introduce AST27x0 A1 TSP SoC Cédric Le Goater
2025-05-05 9:06 ` [PULL 21/23] hw/arm: Introduce ASPEED AST2700 A1 full core machine Cédric Le Goater
2025-05-05 9:06 ` [PULL 22/23] tests/function/aspeed: Add functional test for ast2700fc Cédric Le Goater
2025-05-06 14:22 ` Peter Maydell
2025-05-06 15:14 ` Cédric Le Goater
2025-05-07 3:27 ` Steven Lee
2025-05-07 6:39 ` Cédric Le Goater
2025-05-06 21:09 ` Pierrick Bouvier
2025-05-07 6:46 ` Cédric Le Goater
2025-05-09 14:32 ` Cédric Le Goater
2025-05-09 15:27 ` Peter Maydell
2025-05-12 1:50 ` Steven Lee
2025-05-12 8:21 ` Cédric Le Goater
2025-05-05 9:06 ` [PULL 23/23] docs: Add support for ast2700fc machine Cédric Le Goater
2025-05-05 9:35 ` [PULL 00/23] aspeed queue Philippe Mathieu-Daudé
2025-05-05 9:43 ` Cédric Le Goater
2025-05-06 13:58 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250505090635.778785-16-clg@redhat.com \
--to=clg@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=steven_lee@aspeedtech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).