From: Strahinja Jankovic <strahinja.p.jankovic@gmail.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org,
Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
Fabiano Rosas <farosas@suse.de>,
Laurent Vivier <lvivier@redhat.com>,
Strahinja Jankovic <strahinja.p.jankovic@gmail.com>
Subject: [PATCH 2/3] hw/arm: Add GPIO to Allwinner A10 model
Date: Wed, 19 Aug 2026 00:04:52 +0200 [thread overview]
Message-ID: <20260819-allwinner-gpio-v1-2-2a64866dff11@gmail.com> (raw)
In-Reply-To: <20260819-allwinner-gpio-v1-0-2a64866dff11@gmail.com>
The Allwinner A10 GPIO is added to the Allwinner A10
description, so it is available when Cubieboard is emulated.
Update the documentation for Cubieboard to indicate GPIO availability.
Signed-off-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com>
---
docs/system/arm/cubieboard.rst | 1 +
hw/arm/Kconfig | 1 +
hw/arm/allwinner-a10.c | 8 ++++++++
include/hw/arm/allwinner-a10.h | 2 ++
4 files changed, 12 insertions(+)
diff --git a/docs/system/arm/cubieboard.rst b/docs/system/arm/cubieboard.rst
index 90d24c73a1..ee9f489ead 100644
--- a/docs/system/arm/cubieboard.rst
+++ b/docs/system/arm/cubieboard.rst
@@ -12,6 +12,7 @@ Emulated devices:
- RTC
- EMAC
- SDHCI
+- GPIO
- USB controller
- SATA controller
- TWI (I2C) controller
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 260d2f0751..6d326746c9 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -311,6 +311,7 @@ config ALLWINNER_A10
select ALLWINNER_EMAC
select ALLWINNER_I2C
select ALLWINNER_A10_SPI
+ select ALLWINNER_GPIO
select AXP2XX_PMU
select SERIAL_MM
select UNIMP
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index 66f30757dd..66fe484ae0 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -41,6 +41,7 @@
#define AW_A10_EHCI_BASE 0x01c14000
#define AW_A10_OHCI_BASE 0x01c14400
#define AW_A10_SATA_BASE 0x01c18000
+#define AW_A10_GPIO_BASE 0x01c20800
#define AW_A10_WDT_BASE 0x01c20c90
#define AW_A10_RTC_BASE 0x01c20d00
#define AW_A10_I2C0_BASE 0x01c2ac00
@@ -83,6 +84,8 @@ static void aw_a10_init(Object *obj)
object_initialize_child(obj, "spi0", &s->spi0, TYPE_AW_A10_SPI);
+ object_initialize_child(obj, "gpio", &s->gpio, TYPE_AW_GPIO);
+
for (size_t i = 0; i < AW_A10_NUM_USB; i++) {
object_initialize_child(obj, "ehci[*]", &s->ehci[i],
TYPE_PLATFORM_EHCI);
@@ -203,6 +206,11 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
sysbus_mmio_map(SYS_BUS_DEVICE(&s->spi0), 0, AW_A10_SPI0_BASE);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->spi0), 0, qdev_get_gpio_in(dev, 10));
+ /* GPIO */
+ sysbus_realize(SYS_BUS_DEVICE(&s->gpio), &error_fatal);
+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio), 0, AW_A10_GPIO_BASE);
+ sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0, qdev_get_gpio_in(dev, 28));
+
/* WDT */
sysbus_realize(SYS_BUS_DEVICE(&s->wdt), &error_fatal);
sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->wdt), 0, AW_A10_WDT_BASE, 1);
diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h
index 445ba1be21..8b7736c7bd 100644
--- a/include/hw/arm/allwinner-a10.h
+++ b/include/hw/arm/allwinner-a10.h
@@ -13,6 +13,7 @@
#include "hw/misc/allwinner-a10-dramc.h"
#include "hw/i2c/allwinner-i2c.h"
#include "hw/ssi/allwinner-a10-spi.h"
+#include "hw/gpio/allwinner-gpio.h"
#include "hw/watchdog/allwinner-wdt.h"
#include "system/block-backend.h"
@@ -42,6 +43,7 @@ struct AwA10State {
AwSdHostState mmc0;
AWI2CState i2c0;
AWA10SPIState spi0;
+ AWGPIOState gpio;
AwRtcState rtc;
AwWdtState wdt;
MemoryRegion sram_a;
--
2.55.0
next prev parent reply other threads:[~2026-08-18 22:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 22:04 [PATCH 0/3] Allwinner A10 GPIO support Strahinja Jankovic
2026-08-18 22:04 ` [PATCH 1/3] hw/gpio: Allwinner A10 GPIO emulation Strahinja Jankovic
2026-08-20 3:05 ` Jack Wang
2026-08-25 20:28 ` Strahinja Jankovic
2026-08-18 22:04 ` Strahinja Jankovic [this message]
2026-08-18 22:04 ` [PATCH 3/3] tests/qtest: Allwinner GPIO tests Strahinja Jankovic
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=20260819-allwinner-gpio-v1-2-2a64866dff11@gmail.com \
--to=strahinja.p.jankovic@gmail.com \
--cc=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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.