All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "Cédric Le Goater" <clg@kaod.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Kane Chen" <kane_chen@aspeedtech.com>,
	"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Cc: "Jamin Lin" <jamin_lin@aspeedtech.com>,
	"Troy Lee" <troy_lee@aspeedtech.com>,
	"Cédric Le Goater" <clg@redhat.com>
Subject: [PATCH v3 11/12] hw/arm/aspeed_ast10x0: Add the USB device controller
Date: Tue, 10 Nov 2026 08:29:30 +0000	[thread overview]
Message-ID: <20261110082917.240329-12-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20261110082917.240329-1-jamin_lin@aspeedtech.com>

Add the USB UDC device at 0x7E6A2000 with IRQ 9. The AST10x0 UDC
controller is compatible with the AST2600 one, so reuse TYPE_ASPEED_UDC.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
---
 include/hw/arm/aspeed_soc.h |  1 +
 hw/arm/aspeed_ast10x0.c     | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
index 338496a421..fc1adcb6c1 100644
--- a/include/hw/arm/aspeed_soc.h
+++ b/include/hw/arm/aspeed_soc.h
@@ -157,6 +157,7 @@ struct Aspeed10x0SoCState {
     AspeedSoCState parent;
 
     ARMv7MState armv7m;
+    AspeedUDCState udc;
 };
 
 #define TYPE_ASPEED10X0_SOC "aspeed10x0-soc"
diff --git a/hw/arm/aspeed_ast10x0.c b/hw/arm/aspeed_ast10x0.c
index 0790859735..04e7650e7e 100644
--- a/hw/arm/aspeed_ast10x0.c
+++ b/hw/arm/aspeed_ast10x0.c
@@ -101,7 +101,6 @@ static const UnimplementedDeviceConfig aspeed_soc_ast10x0_unimp_devs[] = {
     { "iomem", "aspeed.io", 0x7E600000, 0x00200000, -1000 },
     { "pwm", "aspeed.pwm", 0x7E610000, 0x100, -1000 },
     { "espi", "aspeed.espi", 0x7E6EE000, 0x800, -1000 },
-    { "udc", "aspeed.udc", 0x7E6A2000, 0x1000, -1000 },
     { "sgpiom", "aspeed.sgpiom", 0x7E780500, 0x100, -1000 },
     { "jtag[0]", "aspeed.jtag0", 0x7E6E4000, 0x20, -1000 },
     { "jtag[1]", "aspeed.jtag1", 0x7E6E4100, 0x20, -1000 },
@@ -170,6 +169,7 @@ static void aspeed_soc_ast10x0_init(Object *obj, const char *socname)
 
     snprintf(typename, sizeof(typename), "aspeed.hace-%s", socname);
     object_initialize_child(obj, "hace", &s->hace, typename);
+    object_initialize_child(obj, "udc", &a->udc, TYPE_ASPEED_UDC);
 }
 
 static void aspeed_soc_ast1030_init(Object *obj)
@@ -389,6 +389,17 @@ static bool aspeed_soc_ast10x0_realize(Aspeed10x0SoCState *a, Error **errp)
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0,
                        aspeed_soc_ast1030_get_irq(s, ASPEED_DEV_GPIO));
 
+    /* UDC - USB 2.0 Device Controller */
+    object_property_set_link(OBJECT(&a->udc), "dram",
+                             OBJECT(&s->sram[0]), &error_abort);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&a->udc), errp)) {
+        return false;
+    }
+    aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&a->udc), 0,
+                    sc->memmap[ASPEED_DEV_UDC]);
+    sysbus_connect_irq(SYS_BUS_DEVICE(&a->udc), 0,
+                       aspeed_soc_ast1030_get_irq(s, ASPEED_DEV_UDC));
+
     return true;
 }
 
-- 
2.43.0


  parent reply	other threads:[~2026-11-10  8:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  8:29 [PATCH v3 00/12] hw/usb/aspeed-udc: Add AST1030 UDC support Jamin Lin
2026-11-10  8:29 ` [PATCH v3 01/12] hw/usb/aspeed-udc: Make the SETUP buffer byte addressable Jamin Lin
2026-11-10  8:29 ` [PATCH v3 02/12] hw/usb/aspeed-udc: Finish an EP0 IN transfer at the status stage Jamin Lin
2026-11-10  8:29 ` [PATCH v3 03/12] hw/usb/aspeed-udc: Mask the reserved bits on register writes Jamin Lin
2026-11-10  8:29 ` [PATCH v3 04/12] hw/usb/aspeed-udc: Clear EP_POOL_ACK when no endpoint ack is left Jamin Lin
2026-11-10  8:29 ` [PATCH v3 05/12] hw/usb/aspeed-udc: Rename the transfer helpers after their DMA mode Jamin Lin
2026-11-10  8:29 ` [PATCH v3 06/12] hw/usb/aspeed-udc: Store the EP_DMA_STS write first Jamin Lin
2026-11-10  8:29 ` [PATCH v3 07/12] hw/usb/aspeed-udc: Pick the EP_DMA_STS path by direction Jamin Lin
2026-11-10  8:29 ` [PATCH v3 08/12] hw/usb/aspeed-udc: Support single-stage IN transfers Jamin Lin
2026-11-10  8:29 ` [PATCH v3 09/12] hw/usb/aspeed-udc: Use the endpoint max packet size for OUT transfers Jamin Lin
2026-11-10  8:29 ` [PATCH v3 10/12] hw/usb/aspeed-udc: Add trace events for the transfer paths Jamin Lin
2026-11-10  8:29 ` Jamin Lin [this message]
2026-11-10  8:29 ` [PATCH v3 12/12] tests/functional/arm/test_aspeed_ast1030: Test the usbredir server transport Jamin Lin

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=20261110082917.240329-12-jamin_lin@aspeedtech.com \
    --to=jamin_lin@aspeedtech.com \
    --cc=clg@kaod.org \
    --cc=clg@redhat.com \
    --cc=kane_chen@aspeedtech.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=troy_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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.