All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB
@ 2026-11-19  7:13 Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 01/13] hw/char/cadence_uart: Reduce the size of MMIO to 0x80 Kuan-Jui Chiu
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

This patchset introduces Axiado SoC AX3005 and evaluation board for emulation
The model for Axiado SoC AX3005 supports
  4 Cortex-A53 CPUs
  Arm Generic Interrupt Controller v3
  9 Cadence UARTs
  1 SDHCI controller with PHY
  8 Cadence GPIOs

Refer Axiado website for more product information
https://axiado.com/products/

and minor changes for the compatibility with existing AX3000 SoC model

Test plan:
1. Verified the machine "ax3005-evb" with following command

qemu-system-aarch64 \
    -machine ax3005-evb \
    -device loader,file=bl31.bin,addr=0x88300000 \
    -device loader,file=tee-raw.bin,addr=0x88400000 \
    -device loader,file=u-boot.bin,addr=0x80000000 \
    -device loader,file=fitImage,addr=0x80100000 \
    -device loader,file=obmc-phosphor-image-evk-ax3005-qemu.squashfs-xz,addr=0x80B00000 \
    -device loader,cpu-num=0,addr=0x88300000 \
    -device loader,cpu-num=1,addr=0x88300000 \
    -device loader,cpu-num=2,addr=0x88300000 \
    -device loader,cpu-num=3,addr=0x88300000 \
    -nographic \
    -serial null \
    -serial null \
    -serial null \
    -serial mon:stdio \
    -drive if=sd,file=obmc-phosphor-image-evk-ax3005-qemu.wic.qcow2,format=qcow2

2. Run QEMU test suite
make check
Ok:                369
Fail:              0
Skipped:           22

make check-functional
Ok:                31
Fail:              0
Skipped:           6

Changes in v8:
  1. Fix C0103 invalid-name error during check-functional test
  2. Correct the file path of functional test in MAINTAINERS

Changes in v7:
  1. Add patch ("hw/arm/ax3000-soc: Revise variables accodring to QEMU idioms")
     to revise the name of the first member in struct and remove redundant
     typedef keyword
  2. Add Prasad Bolisetty into maintainer list
  3. Fix typo

Changes in v6:
  1. Drop patch ("hw/sd/axiado_sdhci: Add header guard") since it had been
     merged
  2. Remove redundant machines-qom.h

Changes in v5:
  1. Add patch ("hw/char/cadence_uart: Add BXRS register definition") to add
     BXRS register into CADENCE UART model and add new property to control this
     feature.
  2. Drop patch ("hw/char/cadence_uart: Reserve MMIO with dynamic size")
  3. Add patch ("hw/arm/ax3000-soc: Enable BXRS support of CADENCE UART") to
     enable BXRS support in Ax3000 SoC
  4. Add patch ("hw/char/cadence_uart: Reduce the size of MMIO to 0x80") to
     change the MMIO size to 0x80 from 0x1000.
  5. Add patch for Ax3000 SoC
     ("hw/arm/ax3000-boards: Add modify_dtb for discontiguous memory") to fix
     memory issue while -dtb option is applied
  6. Add patch for Ax3000 SoC
     ("hw/arm/ax3000-boards: Remove redundant pointer from struct") to create
     SoC instance during init() and remove redundant pointer from struct
  7. Add document for Axiado SoCs and EVKs
  8. Add functional test for Axiado SoCs and EVKs

Changes in v4:
  1. Add patch ("hw/char/cadence_uart: Reserve MMIO with dynamic size") which
     allow other models to revise the MMIO size of Cadence UART
  2. Change the MMIO size of Cadence UART to 512 KiB in Ax3000/Ax3005 SoC to
     resolve the overlapping region issue
  3. Add memory guard in Ax3000/Ax3005 EVK to check the memory size specified by
     -m option and set the default_ram_size to the RAM size supported by Axiado
     SoC

Changes in v3:
  1. Remove patch ("hw/arm/ax3000-soc: Add missing class_size to TypeInfo")
     because it was fixed by commit 4f50d637e2
     ("hw/arm/ax3000-soc: fix heap overflow from missing class_size")

Changes in v2:
  1. Add patch "hw/arm/ax3000-soc: Add missing class_size to TypeInfo"
     to fix incorrect class size
  2. Add missing class_size "Ax3005SoCClass" to ax3005_soc_types

Kuan-Jui Chiu (13):
  hw/char/cadence_uart: Reduce the size of MMIO to 0x80
  hw/char/cadence_uart: Add BXRS register definition
  hw/arm/ax3000-soc: Enable BXRS support of CADENCE UART
  hw/arm: Rename ax3000-boards as axiado-boards
  hw/arm/ax3000: Specify SoC name in header and variable
  hw/arm/ax3000-boards: Add memory guard
  hw/arm/ax3000-boards: Add modify_dtb for discontiguous memory
  hw/arm/ax3000-boards: Remove redundant pointer from struct
  hw/arm/ax3000-soc: Revise variables accodring to QEMU idioms
  hw/arm: Add Axiado SoC AX3005
  hw/arm: Add Axiado Ax3005 EVB
  docs/system/arm: Document Axiado boards
  tests/functional/aarch64: Add functional test for Axiado EVKs

 MAINTAINERS                                   |   6 +
 docs/system/arm/axiado.rst                    | 128 ++++++++++
 docs/system/target-arm.rst                    |   1 +
 hw/arm/ax3000-boards.c                        |  71 +++++-
 hw/arm/ax3000-evk.c                           |   4 +-
 hw/arm/ax3000-soc.c                           |   5 +-
 hw/arm/ax3005-evk.c                           | 115 +++++++++
 hw/arm/ax3005-soc.c                           | 226 ++++++++++++++++++
 hw/arm/meson.build                            |   6 +-
 hw/char/cadence_uart.c                        |  17 +-
 include/hw/arm/ax3000-soc.h                   |  13 +-
 include/hw/arm/ax3005-soc.h                   | 102 ++++++++
 .../arm/{ax3000-boards.h => axiado-boards.h}  |  10 +-
 include/hw/char/cadence_uart.h                |   4 +-
 tests/functional/aarch64/meson.build          |   4 +
 tests/functional/aarch64/test_ax3005_evb.py   | 140 +++++++++++
 .../functional/aarch64/test_axiado_scm3003.py |  62 +++++
 17 files changed, 889 insertions(+), 25 deletions(-)
 create mode 100644 docs/system/arm/axiado.rst
 create mode 100644 hw/arm/ax3005-evk.c
 create mode 100644 hw/arm/ax3005-soc.c
 create mode 100644 include/hw/arm/ax3005-soc.h
 rename include/hw/arm/{ax3000-boards.h => axiado-boards.h} (71%)
 create mode 100755 tests/functional/aarch64/test_ax3005_evb.py
 create mode 100755 tests/functional/aarch64/test_axiado_scm3003.py

-- 
2.34.1



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v8 01/13] hw/char/cadence_uart: Reduce the size of MMIO to 0x80
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 02/13] hw/char/cadence_uart: Add BXRS register definition Kuan-Jui Chiu
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

We don't need to reserve 4 KiB for MMIO since the last register implemented
is R_TTRIG at address 0x44

This patch reduces the size of MMIO to 0x80 from 0x1000

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 hw/char/cadence_uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index eff6a3c4d1..8e23a378c4 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -559,7 +559,7 @@ static void cadence_uart_init(Object *obj)
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
     CadenceUARTState *s = CADENCE_UART(obj);
 
-    memory_region_init_io(&s->iomem, obj, &uart_ops, s, "uart", 0x1000);
+    memory_region_init_io(&s->iomem, obj, &uart_ops, s, "uart", 0x80);
     sysbus_init_mmio(sbd, &s->iomem);
     sysbus_init_irq(sbd, &s->irq);
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 02/13] hw/char/cadence_uart: Add BXRS register definition
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 01/13] hw/char/cadence_uart: Reduce the size of MMIO to 0x80 Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 03/13] hw/arm/ax3000-soc: Enable BXRS support of CADENCE UART Kuan-Jui Chiu
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

The RXBS (RX FIFO Byte Status) register at 0x48 is only exposed to
the guest when the brk_support property is set, so the accessible size
should be CADENCE_UART_R_MAX_BRK in that case and CADENCE_UART_R_MAX
otherwise.

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 hw/char/cadence_uart.c         | 15 ++++++++++++---
 include/hw/char/cadence_uart.h |  4 +++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index 8e23a378c4..8746a96619 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -120,6 +120,13 @@
 #define R_PMIN     (0x3C/4)
 #define R_PWID     (0x40/4)
 #define R_TTRIG    (0x44/4)
+#define R_RXBS     (0x48/4)
+
+/* Number of registers reachable by the guest, depending on brk_support */
+static inline unsigned int uart_r_max(const CadenceUARTState *s)
+{
+    return s->brk_support ? CADENCE_UART_R_MAX_BRK : CADENCE_UART_R_MAX;
+}
 
 
 static void uart_update_status(CadenceUARTState *s)
@@ -424,7 +431,7 @@ static MemTxResult uart_write(void *opaque, hwaddr offset,
 
     DB_PRINT(" offset:%x data:%08x\n", (unsigned)offset, (unsigned)value);
     offset >>= 2;
-    if (offset >= CADENCE_UART_R_MAX) {
+    if (offset >= uart_r_max(s)) {
         return MEMTX_DECODE_ERROR;
     }
     switch (offset) {
@@ -492,7 +499,7 @@ static MemTxResult uart_read(void *opaque, hwaddr offset,
     }
 
     offset >>= 2;
-    if (offset >= CADENCE_UART_R_MAX) {
+    if (offset >= uart_r_max(s)) {
         return MEMTX_DECODE_ERROR;
     }
     if (offset == R_TX_RX) {
@@ -523,6 +530,7 @@ static void cadence_uart_reset_init(Object *obj, ResetType type)
     s->r[R_BRGR] = 0x0000028B;
     s->r[R_BDIV] = 0x0000000F;
     s->r[R_TTRIG] = 0x00000020;
+    s->r[R_RXBS] = 0;
 }
 
 static void cadence_uart_reset_hold(Object *obj, ResetType type)
@@ -603,7 +611,7 @@ static const VMStateDescription vmstate_cadence_uart = {
     .pre_load = cadence_uart_pre_load,
     .post_load = cadence_uart_post_load,
     .fields = (const VMStateField[]) {
-        VMSTATE_UINT32_ARRAY(r, CadenceUARTState, CADENCE_UART_R_MAX),
+        VMSTATE_UINT32_ARRAY(r, CadenceUARTState, CADENCE_UART_R_MAX_BRK),
         VMSTATE_UINT8_ARRAY(rx_fifo, CadenceUARTState,
                             CADENCE_UART_RX_FIFO_SIZE),
         VMSTATE_UINT8_ARRAY(tx_fifo, CadenceUARTState,
@@ -619,6 +627,7 @@ static const VMStateDescription vmstate_cadence_uart = {
 
 static const Property cadence_uart_properties[] = {
     DEFINE_PROP_CHR("chardev", CadenceUARTState, chr),
+    DEFINE_PROP_BOOL("brk-support", CadenceUARTState, brk_support, false),
 };
 
 static void cadence_uart_class_init(ObjectClass *klass, const void *data)
diff --git a/include/hw/char/cadence_uart.h b/include/hw/char/cadence_uart.h
index 751a751248..1d5fc7f328 100644
--- a/include/hw/char/cadence_uart.h
+++ b/include/hw/char/cadence_uart.h
@@ -30,6 +30,7 @@
 #define CADENCE_UART_TX_FIFO_SIZE           16
 
 #define CADENCE_UART_R_MAX (0x48/4)
+#define CADENCE_UART_R_MAX_BRK (0x4C/4)
 
 #define TYPE_CADENCE_UART "cadence_uart"
 OBJECT_DECLARE_SIMPLE_TYPE(CadenceUARTState, CADENCE_UART)
@@ -40,7 +41,7 @@ struct CadenceUARTState {
 
     /*< public >*/
     MemoryRegion iomem;
-    uint32_t r[CADENCE_UART_R_MAX];
+    uint32_t r[CADENCE_UART_R_MAX_BRK];
     uint8_t rx_fifo[CADENCE_UART_RX_FIFO_SIZE];
     uint8_t tx_fifo[CADENCE_UART_TX_FIFO_SIZE];
     uint32_t rx_wpos;
@@ -51,6 +52,7 @@ struct CadenceUARTState {
     qemu_irq irq;
     QEMUTimer *fifo_trigger_handle;
     Clock *refclk;
+    bool brk_support;
 };
 
 #endif
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 03/13] hw/arm/ax3000-soc: Enable BXRS support of CADENCE UART
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 01/13] hw/char/cadence_uart: Reduce the size of MMIO to 0x80 Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 02/13] hw/char/cadence_uart: Add BXRS register definition Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 04/13] hw/arm: Rename ax3000-boards as axiado-boards Kuan-Jui Chiu
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

In order to access BXRS (RX FIFO Byte Status) register at runtime, set
property brk-support of CADENCE UART to true

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 hw/arm/ax3000-soc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/arm/ax3000-soc.c b/hw/arm/ax3000-soc.c
index ebe174fb97..7b96466860 100644
--- a/hw/arm/ax3000-soc.c
+++ b/hw/arm/ax3000-soc.c
@@ -155,6 +155,7 @@ static void ax3000_realize(DeviceState *dev, Error **errp)
 
     for (int i = 0; i < AX3000_NUM_UARTS; i++) {
         qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i));
+        qdev_prop_set_bit(DEVICE(&s->uart[i]), "brk-support", true);
         if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), errp)) {
             return;
         }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 04/13] hw/arm: Rename ax3000-boards as axiado-boards
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (2 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 03/13] hw/arm/ax3000-soc: Enable BXRS support of CADENCE UART Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 05/13] hw/arm/ax3000: Specify SoC name in header and variable Kuan-Jui Chiu
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

Rename header file ax3000-boards.h as axiado-boards.h for sharing across
different Axiado SoC series

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
Reviewed-by: Jack Wang <163wangjack@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 hw/arm/ax3000-boards.c                              | 2 +-
 hw/arm/ax3000-evk.c                                 | 2 +-
 include/hw/arm/{ax3000-boards.h => axiado-boards.h} | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename include/hw/arm/{ax3000-boards.h => axiado-boards.h} (100%)

diff --git a/hw/arm/ax3000-boards.c b/hw/arm/ax3000-boards.c
index dc98ee7b71..b4e7ec6f1c 100644
--- a/hw/arm/ax3000-boards.c
+++ b/hw/arm/ax3000-boards.c
@@ -7,7 +7,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hw/arm/ax3000-boards.h"
+#include "hw/arm/axiado-boards.h"
 #include "hw/arm/boot.h"
 #include "qemu/error-report.h"
 #include "qom/object.h"
diff --git a/hw/arm/ax3000-evk.c b/hw/arm/ax3000-evk.c
index a170848871..f491de7521 100644
--- a/hw/arm/ax3000-evk.c
+++ b/hw/arm/ax3000-evk.c
@@ -7,7 +7,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hw/arm/ax3000-boards.h"
+#include "hw/arm/axiado-boards.h"
 
 static void axiado_scm3003_class_init(ObjectClass *oc, const void *data)
 {
diff --git a/include/hw/arm/ax3000-boards.h b/include/hw/arm/axiado-boards.h
similarity index 100%
rename from include/hw/arm/ax3000-boards.h
rename to include/hw/arm/axiado-boards.h
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 05/13] hw/arm/ax3000: Specify SoC name in header and variable
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (3 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 04/13] hw/arm: Rename ax3000-boards as axiado-boards Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 06/13] hw/arm/ax3000-boards: Add memory guard Kuan-Jui Chiu
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 hw/arm/ax3000-boards.c | 2 +-
 hw/arm/ax3000-evk.c    | 2 +-
 hw/arm/ax3000-soc.c    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/arm/ax3000-boards.c b/hw/arm/ax3000-boards.c
index b4e7ec6f1c..b3ee6c4a69 100644
--- a/hw/arm/ax3000-boards.c
+++ b/hw/arm/ax3000-boards.c
@@ -1,5 +1,5 @@
 /*
- * Axiado Boards
+ * Axiado Ax3000 Boards
  *
  * Author: Kuan-Jui Chiu <kchiu@axiado.com>
  *
diff --git a/hw/arm/ax3000-evk.c b/hw/arm/ax3000-evk.c
index f491de7521..adcad2f340 100644
--- a/hw/arm/ax3000-evk.c
+++ b/hw/arm/ax3000-evk.c
@@ -1,5 +1,5 @@
 /*
- * Axiado Evaluation Kit Emulation
+ * Axiado Ax3000 Evaluation Kit Emulation
  *
  * Author: Kuan-Jui Chiu <kchiu@axiado.com>
  *
diff --git a/hw/arm/ax3000-soc.c b/hw/arm/ax3000-soc.c
index 7b96466860..37c938d942 100644
--- a/hw/arm/ax3000-soc.c
+++ b/hw/arm/ax3000-soc.c
@@ -230,7 +230,7 @@ static void ax3000_class_init(ObjectClass *oc, const void *data)
     sc->num_cpus = AX3000_NUM_CPUS;
 }
 
-static const TypeInfo axiado_soc_types[] = {
+static const TypeInfo ax3000_soc_types[] = {
     {
         .name           = TYPE_AX3000_SOC,
         .parent         = TYPE_SYS_BUS_DEVICE,
@@ -241,4 +241,4 @@ static const TypeInfo axiado_soc_types[] = {
     }
 };
 
-DEFINE_TYPES(axiado_soc_types)
+DEFINE_TYPES(ax3000_soc_types)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 06/13] hw/arm/ax3000-boards: Add memory guard
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (4 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 05/13] hw/arm/ax3000: Specify SoC name in header and variable Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 07/13] hw/arm/ax3000-boards: Add modify_dtb for discontiguous memory Kuan-Jui Chiu
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

Ax3000 SoC reserves 3136 MiB memory for access totally
QEMU allows -m option to set the ram_size which would cause the
inconsistent size issue while running in QMP

This patch adds a guard to check if ram_size is different from RAM size
of SoC and setup the default_ram_size

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 hw/arm/ax3000-boards.c      | 9 +++++++++
 include/hw/arm/ax3000-soc.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/hw/arm/ax3000-boards.c b/hw/arm/ax3000-boards.c
index b3ee6c4a69..bc1f818d74 100644
--- a/hw/arm/ax3000-boards.c
+++ b/hw/arm/ax3000-boards.c
@@ -9,6 +9,7 @@
 #include "qemu/osdep.h"
 #include "hw/arm/axiado-boards.h"
 #include "hw/arm/boot.h"
+#include "qemu/cutils.h"
 #include "qemu/error-report.h"
 #include "qom/object.h"
 
@@ -21,6 +22,13 @@ static void ax3000_machine_init(MachineState *machine)
 {
     Ax3000MachineState *ams = AX3000_MACHINE(machine);
 
+    if (machine->ram_size != AX3000_DRAM_SIZE) {
+        g_autofree char *size_str = size_to_str(AX3000_DRAM_SIZE);
+
+        error_report("Invalid RAM size, should be %s", size_str);
+        exit(1);
+    }
+
     ams->soc = AX3000_SOC(object_new(TYPE_AX3000_SOC));
     object_property_add_child(OBJECT(machine), "soc", OBJECT(ams->soc));
     sysbus_realize_and_unref(SYS_BUS_DEVICE(ams->soc), &error_fatal);
@@ -38,6 +46,7 @@ static void ax3000_machine_class_init(ObjectClass *oc, const void *data)
     mc->min_cpus = AX3000_NUM_CPUS;
     mc->max_cpus = AX3000_NUM_CPUS;
     mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a53");
+    mc->default_ram_size = AX3000_DRAM_SIZE;
 }
 
 static const TypeInfo ax3000_machine_types[] = {
diff --git a/include/hw/arm/ax3000-soc.h b/include/hw/arm/ax3000-soc.h
index 344fcb6f3c..4987ee3834 100644
--- a/include/hw/arm/ax3000-soc.h
+++ b/include/hw/arm/ax3000-soc.h
@@ -25,6 +25,7 @@ OBJECT_DECLARE_TYPE(Ax3000SoCState, Ax3000SoCClass, AX3000_SOC)
 #define AX3000_DRAM0_SIZE       (1088 * MiB)
 #define AX3000_DRAM1_BASE       0x400000000
 #define AX3000_DRAM1_SIZE       (2 * GiB)
+#define AX3000_DRAM_SIZE        (AX3000_DRAM0_SIZE + AX3000_DRAM1_SIZE)
 
 #define AX3000_GIC_DIST_BASE    0x80300000
 #define AX3000_GIC_DIST_SIZE    (64 * KiB)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 07/13] hw/arm/ax3000-boards: Add modify_dtb for discontiguous memory
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (5 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 06/13] hw/arm/ax3000-boards: Add memory guard Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 08/13] hw/arm/ax3000-boards: Remove redundant pointer from struct Kuan-Jui Chiu
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

Ax3000 SoC has two memory banks:
  1. 0x3C000000 with 1088 MiB
  2. 0x400000000 wit 2 GiB

When user boot kernel directly on axiado-scm3003 models, kernel would
believe these memory are contiguous which cause the crash

This patch add modify_dtb callback to revise the memory block

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 hw/arm/ax3000-boards.c | 48 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/hw/arm/ax3000-boards.c b/hw/arm/ax3000-boards.c
index bc1f818d74..75e0aedb4d 100644
--- a/hw/arm/ax3000-boards.c
+++ b/hw/arm/ax3000-boards.c
@@ -12,10 +12,58 @@
 #include "qemu/cutils.h"
 #include "qemu/error-report.h"
 #include "qom/object.h"
+#include "system/device_tree.h"
+
+/*
+ * arm_load_dtb() drops every /memory node found in the DTB and replaces them
+ * with a single node spanning [loader_start, loader_start + ram_size).  The
+ * AX3000 DRAM is split into two banks with the MMIO region in between, so the
+ * generated node would describe unbacked addresses as RAM.  Describe the banks
+ * ourselves instead.
+ */
+static void ax3000_modify_dtb(const struct arm_boot_info *info, void *fdt)
+{
+    g_autofree char *nodename = NULL;
+    uint64_t reg[AX3000_NUM_BANKS * 2];
+    char **node_path;
+    Error *err = NULL;
+    int i;
+
+    node_path = qemu_fdt_node_unit_path(fdt, "memory", &err);
+    if (err) {
+        error_report_err(err);
+        exit(1);
+    }
+    for (i = 0; node_path[i]; i++) {
+        if (g_str_has_prefix(node_path[i], "/memory")) {
+            qemu_fdt_nop_node(fdt, node_path[i]);
+        }
+    }
+    g_strfreev(node_path);
+
+    const struct {
+        hwaddr addr;
+        size_t size;
+    } dram_table[] = {
+        { AX3000_DRAM0_BASE, AX3000_DRAM0_SIZE},
+        { AX3000_DRAM1_BASE, AX3000_DRAM1_SIZE}
+    };
+
+    for (i = 0; i < AX3000_NUM_BANKS; i++) {
+        reg[i * 2] = cpu_to_be64(dram_table[i].addr);
+        reg[i * 2 + 1] = cpu_to_be64(dram_table[i].size);
+    }
+
+    nodename = g_strdup_printf("/memory@%" HWADDR_PRIx, dram_table[0].addr);
+    qemu_fdt_add_subnode(fdt, nodename);
+    qemu_fdt_setprop_string(fdt, nodename, "device_type", "memory");
+    qemu_fdt_setprop(fdt, nodename, "reg", reg, sizeof(reg));
+}
 
 static struct arm_boot_info ax3000_binfo = {
     .loader_start = AX3000_DRAM0_BASE,
     .board_id = -1,
+    .modify_dtb = ax3000_modify_dtb,
 };
 
 static void ax3000_machine_init(MachineState *machine)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 08/13] hw/arm/ax3000-boards: Remove redundant pointer from struct
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (6 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 07/13] hw/arm/ax3000-boards: Add modify_dtb for discontiguous memory Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 09/13] hw/arm/ax3000-soc: Revise variables accodring to QEMU idioms Kuan-Jui Chiu
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

Since ax3000-boards is bound with Ax3000 SoC, we don't need to have a
pointer in struct for SoC type

This patch remove pointer soc from Ax3000MachineState and create instance
in init() directly

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 hw/arm/ax3000-boards.c         | 10 +++++-----
 include/hw/arm/axiado-boards.h |  1 -
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/hw/arm/ax3000-boards.c b/hw/arm/ax3000-boards.c
index 75e0aedb4d..3ca4a6f93a 100644
--- a/hw/arm/ax3000-boards.c
+++ b/hw/arm/ax3000-boards.c
@@ -68,7 +68,7 @@ static struct arm_boot_info ax3000_binfo = {
 
 static void ax3000_machine_init(MachineState *machine)
 {
-    Ax3000MachineState *ams = AX3000_MACHINE(machine);
+    Ax3000SoCState *s;
 
     if (machine->ram_size != AX3000_DRAM_SIZE) {
         g_autofree char *size_str = size_to_str(AX3000_DRAM_SIZE);
@@ -77,12 +77,12 @@ static void ax3000_machine_init(MachineState *machine)
         exit(1);
     }
 
-    ams->soc = AX3000_SOC(object_new(TYPE_AX3000_SOC));
-    object_property_add_child(OBJECT(machine), "soc", OBJECT(ams->soc));
-    sysbus_realize_and_unref(SYS_BUS_DEVICE(ams->soc), &error_fatal);
+    s = AX3000_SOC(object_new_with_props(TYPE_AX3000_SOC, OBJECT(machine),
+                                         "soc", &error_fatal, NULL));
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal);
 
     ax3000_binfo.ram_size = machine->ram_size;
-    arm_load_kernel(&ams->soc->cpu[0], machine, &ax3000_binfo);
+    arm_load_kernel(&s->cpu[0], machine, &ax3000_binfo);
 }
 
 static void ax3000_machine_class_init(ObjectClass *oc, const void *data)
diff --git a/include/hw/arm/axiado-boards.h b/include/hw/arm/axiado-boards.h
index 4a632661e1..566f22cd96 100644
--- a/include/hw/arm/axiado-boards.h
+++ b/include/hw/arm/axiado-boards.h
@@ -18,7 +18,6 @@ OBJECT_DECLARE_TYPE(Ax3000MachineState, Ax3000MachineClass, AX3000_MACHINE)
 typedef struct Ax3000MachineState {
     MachineState parent;
 
-    Ax3000SoCState *soc;
 } Ax3000MachineState;
 
 typedef struct Ax3000MachineClass {
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 09/13] hw/arm/ax3000-soc: Revise variables accodring to QEMU idioms
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (7 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 08/13] hw/arm/ax3000-boards: Remove redundant pointer from struct Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 10/13] hw/arm: Add Axiado SoC AX3005 Kuan-Jui Chiu
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

1. Change the first declaration of struct to parent_obj/parent_class
2. Remove unnecessary typedef since macros add it automatically

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 include/hw/arm/ax3000-soc.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/hw/arm/ax3000-soc.h b/include/hw/arm/ax3000-soc.h
index 4987ee3834..e09cd56c30 100644
--- a/include/hw/arm/ax3000-soc.h
+++ b/include/hw/arm/ax3000-soc.h
@@ -60,8 +60,8 @@ enum Ax3000Configuration {
     AX3000_NUM_GPIOS    = 8,
 };
 
-typedef struct Ax3000SoCState {
-    SysBusDevice        parent;
+struct Ax3000SoCState {
+    SysBusDevice        parent_obj;
 
     ARMCPU              cpu[AX3000_NUM_CPUS];
     GICv3State          gic;
@@ -70,13 +70,13 @@ typedef struct Ax3000SoCState {
     CadenceUARTState    uart[AX3000_NUM_UARTS];
     CadenceGPIOState    gpio[AX3000_NUM_GPIOS];
     AxiadoSDHCIState    sdhci0;
-} Ax3000SoCState;
+};
 
-typedef struct Ax3000SoCClass {
-    SysBusDeviceClass   parent;
+struct Ax3000SoCClass {
+    SysBusDeviceClass   parent_class;
 
     uint32_t            num_cpus;
-} Ax3000SoCClass;
+};
 
 enum Ax3000Irqs {
     AX3000_UART0_IRQ    = 112,
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 10/13] hw/arm: Add Axiado SoC AX3005
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (8 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 09/13] hw/arm/ax3000-soc: Revise variables accodring to QEMU idioms Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 11/13] hw/arm: Add Axiado Ax3005 EVB Kuan-Jui Chiu
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

This patch adds new model for Axiado SoC AX3005 which supports
    4 Cortex-A53 ARM64 CPUs
    Arm Generic Interrupt Controller v3
    9 Cadence UARTs
    1 SDHCI controller with PHY
    8 Cadence GPIOs

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 MAINTAINERS                 |   3 +
 hw/arm/ax3005-soc.c         | 226 ++++++++++++++++++++++++++++++++++++
 hw/arm/meson.build          |   3 +-
 include/hw/arm/ax3005-soc.h | 102 ++++++++++++++++
 4 files changed, 333 insertions(+), 1 deletion(-)
 create mode 100644 hw/arm/ax3005-soc.c
 create mode 100644 include/hw/arm/ax3005-soc.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 15942aaba3..e5f37262cf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1324,11 +1324,14 @@ F: rust/hw/char/pl011/
 
 Axiado SoCs and EVKs
 M: Kuan-Jui Chiu <kchiu@axiado.com>
+M: Prasad Bolisetty <pbolisetty@axiado.com>
 L: qemu-arm@nongnu.org
 S: Maintained
 F: hw/arm/ax3000*.c
+F: hw/arm/ax3005*.c
 F: hw/*/axiado*.c
 F: include/hw/arm/ax3000*.h
+F: include/hw/arm/ax3005*.h
 F: include/hw/*/axiado*.h
 
 AVR Machines
diff --git a/hw/arm/ax3005-soc.c b/hw/arm/ax3005-soc.c
new file mode 100644
index 0000000000..e555b156f4
--- /dev/null
+++ b/hw/arm/ax3005-soc.c
@@ -0,0 +1,226 @@
+/*
+ * Axiado SoC AX3005
+ *
+ * Author: Kuan-Jui Chiu <kchiu@axiado.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "system/address-spaces.h"
+#include "hw/arm/bsa.h"
+#include "hw/arm/ax3005-soc.h"
+#include "hw/misc/unimp.h"
+#include "system/system.h"
+#include "qobject/qlist.h"
+#include "qom/object.h"
+#include "hw/core/boards.h"
+
+static void ax3005_init(Object *obj)
+{
+    Ax3005SoCState *s = AX3005_SOC(obj);
+    Ax3005SoCClass *sc = AX3005_SOC_GET_CLASS(s);
+
+    for (int i = 0; i < sc->num_cpus; i++) {
+        g_autofree char *name = g_strdup_printf("cpu%d", i);
+        object_initialize_child(obj, name, &s->cpu[i],
+                                ARM_CPU_TYPE_NAME("cortex-a53"));
+    }
+
+    object_initialize_child(obj, "gic", &s->gic, gicv3_class_name());
+
+    for (int i = 0; i < AX3005_NUM_UARTS; i++) {
+        g_autofree char *name = g_strdup_printf("uart%d", i);
+        object_initialize_child(obj, name, &s->uart[i], TYPE_CADENCE_UART);
+    }
+
+    object_initialize_child(obj, "sdhci0", &s->sdhci0, TYPE_AXIADO_SDHCI);
+
+    for (int i = 0; i < AX3005_NUM_GPIOS; i++) {
+        g_autofree char *name = g_strdup_printf("gpio%d", i);
+        object_initialize_child(obj, name, &s->gpio[i], TYPE_CADENCE_GPIO);
+    }
+}
+
+static void ax3005_realize(DeviceState *dev, Error **errp)
+{
+    Ax3005SoCState *s = AX3005_SOC(dev);
+    Ax3005SoCClass *sc = AX3005_SOC_GET_CLASS(s);
+    SysBusDevice *gic_sbd = SYS_BUS_DEVICE(&s->gic);
+    DeviceState *gic_dev = DEVICE(&s->gic);
+    QList *redist_region_count;
+    SysBusDevice *sdhci0_sbd;
+    DeviceState *card;
+    DriveInfo *dinfo;
+
+    /* CPUs */
+    for (int i = 0; i < sc->num_cpus; i++) {
+        object_property_set_int(OBJECT(&s->cpu[i]), "cntfrq", 1000000000,
+                                &error_abort);
+
+        if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, errp)) {
+            return;
+        }
+    }
+
+    /* GIC */
+    qdev_prop_set_uint32(gic_dev, "num-cpu", sc->num_cpus);
+    qdev_prop_set_uint32(gic_dev, "num-irq",
+                         AX3005_NUM_IRQS + GIC_INTERNAL);
+
+    redist_region_count = qlist_new();
+    qlist_append_int(redist_region_count, sc->num_cpus);
+    qdev_prop_set_array(gic_dev, "redist-region-count", redist_region_count);
+
+    if (!sysbus_realize(gic_sbd, errp)) {
+        return;
+    }
+
+    sysbus_mmio_map(gic_sbd, 0, AX3005_GIC_DIST_BASE);
+    sysbus_mmio_map(gic_sbd, 1, AX3005_GIC_REDIST_BASE);
+
+    /*
+     * Mapping from the output timer irq lines from the CPU to the
+     * GIC PPI inputs.
+     */
+    const int timer_irqs[] = {
+        [GTIMER_PHYS] = ARCH_TIMER_NS_EL1_IRQ,
+        [GTIMER_VIRT] = ARCH_TIMER_VIRT_IRQ,
+        [GTIMER_HYP]  = ARCH_TIMER_NS_EL2_IRQ,
+        [GTIMER_SEC]  = ARCH_TIMER_S_EL1_IRQ
+    };
+
+    /*
+     * Wire the outputs from each CPU's generic timer and the GICv3
+     * maintenance interrupt signal to the appropriate GIC PPI inputs, and
+     * the GIC's IRQ/FIQ interrupt outputs to the CPU's inputs.
+     */
+    for (int i = 0; i < sc->num_cpus; i++) {
+        DeviceState *cpu_dev = DEVICE(&s->cpu[i]);
+        int intidbase = AX3005_NUM_IRQS + i * GIC_INTERNAL;
+        qemu_irq irq;
+
+        for (int j = 0; j < ARRAY_SIZE(timer_irqs); j++) {
+            irq = qdev_get_gpio_in(gic_dev, intidbase + timer_irqs[j]);
+            qdev_connect_gpio_out(cpu_dev, j, irq);
+        }
+
+        irq = qdev_get_gpio_in(gic_dev, intidbase + ARCH_GIC_MAINT_IRQ);
+        qdev_connect_gpio_out_named(cpu_dev, "gicv3-maintenance-interrupt",
+                                        0, irq);
+
+        sysbus_connect_irq(gic_sbd, i,
+                           qdev_get_gpio_in(cpu_dev, ARM_CPU_IRQ));
+        sysbus_connect_irq(gic_sbd, i + sc->num_cpus,
+                           qdev_get_gpio_in(cpu_dev, ARM_CPU_FIQ));
+        sysbus_connect_irq(gic_sbd, i + 2 * sc->num_cpus,
+                           qdev_get_gpio_in(cpu_dev, ARM_CPU_VIRQ));
+        sysbus_connect_irq(gic_sbd, i + 3 * sc->num_cpus,
+                           qdev_get_gpio_in(cpu_dev, ARM_CPU_VFIQ));
+    }
+
+    /* DRAM */
+    memory_region_init_ram(&s->dram, OBJECT(s), "dram", AX3005_DRAM_SIZE,
+                           &error_fatal);
+    memory_region_add_subregion(get_system_memory(), AX3005_DRAM_BASE,
+                                &s->dram);
+
+    /* UARTs */
+    const struct {
+        hwaddr addr;
+        unsigned int irq;
+    } serial_table[] = {
+        { AX3005_UART0_BASE, AX3005_UART0_IRQ },
+        { AX3005_UART1_BASE, AX3005_UART1_IRQ },
+        { AX3005_UART2_BASE, AX3005_UART2_IRQ },
+        { AX3005_UART3_BASE, AX3005_UART3_IRQ },
+        { AX3005_UART4_BASE, AX3005_UART4_IRQ },
+        { AX3005_UART5_BASE, AX3005_UART5_IRQ },
+        { AX3005_UART6_BASE, AX3005_UART6_IRQ },
+        { AX3005_UART7_BASE, AX3005_UART7_IRQ },
+        { AX3005_UART8_BASE, AX3005_UART8_IRQ }
+    };
+
+    for (int i = 0; i < AX3005_NUM_UARTS; i++) {
+        qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i));
+        qdev_prop_set_bit(DEVICE(&s->uart[i]), "brk-support", true);
+        if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), errp)) {
+            return;
+        }
+
+        sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart[i]), 0, serial_table[i].addr);
+        sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart[i]), 0,
+                           qdev_get_gpio_in(gic_dev, serial_table[i].irq));
+    }
+
+    /* Timer control */
+    create_unimplemented_device("ax3005.timerctrl", AX3005_TIMER_CTRL, 32);
+
+    /* SDHCI */
+    sdhci0_sbd = SYS_BUS_DEVICE(&s->sdhci0);
+    if (!sysbus_realize(sdhci0_sbd, errp)) {
+        return;
+    }
+
+    sysbus_mmio_map(sdhci0_sbd, 0, AX3005_SDHCI0_BASE);
+    sysbus_mmio_map(sdhci0_sbd, 1, AX3005_EMMC_PHY_BASE);
+    sysbus_connect_irq(sdhci0_sbd, 0,
+                       qdev_get_gpio_in(gic_dev, AX3005_SDHCI0_IRQ));
+
+    dinfo = drive_get(IF_SD, 0, 0);
+    if (dinfo) {
+        card = qdev_new(TYPE_SD_CARD);
+        qdev_prop_set_drive_err(card, "drive",
+                                blk_by_legacy_dinfo(dinfo),
+                                &error_fatal);
+        qdev_realize_and_unref(card, s->sdhci0.sd_bus, &error_fatal);
+    }
+
+    /* GPIOs */
+    const struct {
+        hwaddr addr;
+        unsigned int irq;
+    } gpio_table[] = {
+        { AX3005_GPIO0_BASE, AX3005_GPIO0_IRQ },
+        { AX3005_GPIO1_BASE, AX3005_GPIO1_IRQ },
+        { AX3005_GPIO2_BASE, AX3005_GPIO2_IRQ },
+        { AX3005_GPIO3_BASE, AX3005_GPIO3_IRQ },
+        { AX3005_GPIO4_BASE, AX3005_GPIO4_IRQ },
+        { AX3005_GPIO5_BASE, AX3005_GPIO5_IRQ },
+        { AX3005_GPIO6_BASE, AX3005_GPIO6_IRQ },
+        { AX3005_GPIO7_BASE, AX3005_GPIO7_IRQ }
+    };
+
+    for (int i = 0; i < AX3005_NUM_GPIOS; i++) {
+        if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), errp)) {
+            return;
+        }
+
+        sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio[i]), 0, gpio_table[i].addr);
+        sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 0,
+                           qdev_get_gpio_in(gic_dev, gpio_table[i].irq));
+    }
+}
+
+static void ax3005_class_init(ObjectClass *oc, const void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(oc);
+    Ax3005SoCClass *sc = AX3005_SOC_CLASS(oc);
+
+    dc->desc = "Axiado SoC AX3005";
+    dc->realize = ax3005_realize;
+    sc->num_cpus = AX3005_NUM_CPUS;
+}
+
+static const TypeInfo ax3005_soc_types[] = {
+    {
+        .name           = TYPE_AX3005_SOC,
+        .parent         = TYPE_SYS_BUS_DEVICE,
+        .instance_size  = sizeof(Ax3005SoCState),
+        .instance_init  = ax3005_init,
+        .class_size     = sizeof(Ax3005SoCClass),
+        .class_init     = ax3005_class_init,
+    }
+};
+
+DEFINE_TYPES(ax3005_soc_types)
diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index f3c1b0e00f..f54aaffef2 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -113,7 +113,8 @@ arm_common_ss.add(when: 'CONFIG_VERSATILE', if_true: files('versatilepb.c'))
 arm_common_ss.add(when: 'CONFIG_VEXPRESS', if_true: files('vexpress.c'))
 
 arm_common_ss.add(when: ['CONFIG_AXIADO_SOC', 'TARGET_AARCH64'], if_true: files(
-  'ax3000-soc.c'))
+  'ax3000-soc.c',
+  'ax3005-soc.c'))
 arm_common_ss.add(when: ['CONFIG_AXIADO_EVK', 'TARGET_AARCH64'], if_true: files(
   'ax3000-boards.c',
   'ax3000-evk.c'))
diff --git a/include/hw/arm/ax3005-soc.h b/include/hw/arm/ax3005-soc.h
new file mode 100644
index 0000000000..e9faa80dbd
--- /dev/null
+++ b/include/hw/arm/ax3005-soc.h
@@ -0,0 +1,102 @@
+/*
+ * Axiado SoC AX3005
+ *
+ * Author: Kuan-Jui Chiu <kchiu@axiado.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef AXIADO_AX3005_H
+#define AXIADO_AX3005_H
+
+#include "cpu.h"
+#include "hw/intc/arm_gicv3_common.h"
+#include "hw/char/cadence_uart.h"
+#include "hw/gpio/cadence_gpio.h"
+#include "hw/sd/axiado_sdhci.h"
+#include "hw/core/sysbus.h"
+#include "qemu/units.h"
+
+#define TYPE_AX3005_SOC "ax3005"
+OBJECT_DECLARE_TYPE(Ax3005SoCState, Ax3005SoCClass, AX3005_SOC)
+
+#define AX3005_DRAM_BASE        0x80000000
+#define AX3005_DRAM_SIZE        (2 * GiB)
+
+#define AX3005_GIC_DIST_BASE    0x40400000
+#define AX3005_GIC_DIST_SIZE    (64 * KiB)
+#define AX3005_GIC_REDIST_BASE  0x40500000
+#define AX3005_GIC_REDIST_SIZE  (768 * KiB)
+
+#define AX3005_UART0_BASE       0x33020000
+#define AX3005_UART1_BASE       0x330A0000
+#define AX3005_UART2_BASE       0x33120000
+#define AX3005_UART3_BASE       0x33020800
+#define AX3005_UART4_BASE       0x331A0400
+#define AX3005_UART5_BASE       0x33381D00
+#define AX3005_UART6_BASE       0x33381E00
+#define AX3005_UART7_BASE       0x33381F00
+#define AX3005_UART8_BASE       0x330C0000
+
+#define AX3005_SDHCI0_BASE      0x46000000
+#define AX3005_EMMC_PHY_BASE    0x33301C00
+
+#define AX3005_GPIO0_BASE       0x33000000
+#define AX3005_GPIO1_BASE       0x33080000
+#define AX3005_GPIO2_BASE       0x33100000
+#define AX3005_GPIO3_BASE       0x33180000
+#define AX3005_GPIO4_BASE       0x33200000
+#define AX3005_GPIO5_BASE       0x33280000
+#define AX3005_GPIO6_BASE       0x33300000
+#define AX3005_GPIO7_BASE       0x33380000
+
+#define AX3005_TIMER_CTRL       0x48016000
+
+enum Ax3005Configuration {
+    AX3005_NUM_CPUS     = 4,
+    AX3005_NUM_IRQS     = 224,
+    AX3005_NUM_UARTS    = 9,
+    AX3005_NUM_GPIOS    = 8,
+};
+
+struct Ax3005SoCState {
+    SysBusDevice        parent_obj;
+
+    ARMCPU              cpu[AX3005_NUM_CPUS];
+    GICv3State          gic;
+    MemoryRegion        dram;
+    CadenceUARTState    uart[AX3005_NUM_UARTS];
+    CadenceGPIOState    gpio[AX3005_NUM_GPIOS];
+    AxiadoSDHCIState    sdhci0;
+};
+
+struct Ax3005SoCClass {
+    SysBusDeviceClass   parent_class;
+
+    uint32_t            num_cpus;
+};
+
+enum Ax3005Irqs {
+    AX3005_UART0_IRQ    = 112,
+    AX3005_UART1_IRQ    = 113,
+    AX3005_UART2_IRQ    = 114,
+    AX3005_UART3_IRQ    = 170,
+    AX3005_UART4_IRQ    = 208,
+    AX3005_UART5_IRQ    = 209,
+    AX3005_UART6_IRQ    = 210,
+    AX3005_UART7_IRQ    = 211,
+    AX3005_UART8_IRQ    = 212,
+
+    AX3005_SDHCI0_IRQ   = 123,
+
+    AX3005_GPIO0_IRQ    = 183,
+    AX3005_GPIO1_IRQ    = 184,
+    AX3005_GPIO2_IRQ    = 185,
+    AX3005_GPIO3_IRQ    = 186,
+    AX3005_GPIO4_IRQ    = 187,
+    AX3005_GPIO5_IRQ    = 188,
+    AX3005_GPIO6_IRQ    = 189,
+    AX3005_GPIO7_IRQ    = 190,
+};
+
+#endif /* AXIADO_AX3005_H */
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 11/13] hw/arm: Add Axiado Ax3005 EVB
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (9 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 10/13] hw/arm: Add Axiado SoC AX3005 Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 12/13] docs/system/arm: Document Axiado boards Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 13/13] tests/functional/aarch64: Add functional test for Axiado EVKs Kuan-Jui Chiu
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

Add EVK ax3005-evb built with AX3005 SoC

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 hw/arm/ax3005-evk.c            | 115 +++++++++++++++++++++++++++++++++
 hw/arm/meson.build             |   3 +-
 include/hw/arm/axiado-boards.h |   9 +++
 3 files changed, 126 insertions(+), 1 deletion(-)
 create mode 100644 hw/arm/ax3005-evk.c

diff --git a/hw/arm/ax3005-evk.c b/hw/arm/ax3005-evk.c
new file mode 100644
index 0000000000..0bc309f244
--- /dev/null
+++ b/hw/arm/ax3005-evk.c
@@ -0,0 +1,115 @@
+/*
+ * Axiado Ax3005 Evaluation Kit Emulation
+ *
+ * Author: Kuan-Jui Chiu <kchiu@axiado.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include <libfdt.h>
+#include "hw/arm/axiado-boards.h"
+#include "hw/arm/boot.h"
+#include "qemu/cutils.h"
+#include "qemu/error-report.h"
+#include "qom/object.h"
+#include "system/device_tree.h"
+
+#define RAMROFS_BASE     0x90000000
+#define RAMROFS_SIZE     (100 * MiB)
+
+/*
+ * Reserve the ramrofs window so that Linux keeps it out of the linear map and
+ * the phram driver can hand it to the guest as a block device.  Any ramrofs
+ * reservation the supplied DTB carries is replaced, so that the reservation
+ * cannot drift away from RAMROFS_BASE.
+ */
+static void ax3005_modify_dtb(const struct arm_boot_info *info, void *fdt)
+{
+    g_autofree char *nodename = NULL;
+    uint64_t reg[2];
+    char **node_path;
+    Error *err = NULL;
+    int offset;
+    int i;
+
+    node_path = qemu_fdt_node_unit_path(fdt, "ramrofs", &err);
+    if (err) {
+        error_report_err(err);
+        exit(1);
+    }
+    for (i = 0; node_path[i]; i++) {
+        qemu_fdt_nop_node(fdt, node_path[i]);
+    }
+    g_strfreev(node_path);
+
+    offset = fdt_path_offset(fdt, "/reserved-memory");
+    if (offset < 0) {
+        qemu_fdt_add_subnode(fdt, "/reserved-memory");
+        qemu_fdt_setprop_cell(fdt, "/reserved-memory", "#address-cells", 2);
+        qemu_fdt_setprop_cell(fdt, "/reserved-memory", "#size-cells", 2);
+        qemu_fdt_setprop(fdt, "/reserved-memory", "ranges", NULL, 0);
+    } else if (fdt_address_cells(fdt, offset) != 2 ||
+               fdt_size_cells(fdt, offset) != 2) {
+        error_report("/reserved-memory must use two address and size cells");
+        exit(1);
+    }
+
+    nodename = g_strdup_printf("/reserved-memory/ramrofs@%" HWADDR_PRIx,
+                               (hwaddr)RAMROFS_BASE);
+    reg[0] = cpu_to_be64(RAMROFS_BASE);
+    reg[1] = cpu_to_be64(RAMROFS_SIZE);
+
+    qemu_fdt_add_subnode(fdt, nodename);
+    qemu_fdt_setprop(fdt, nodename, "reg", reg, sizeof(reg));
+    qemu_fdt_setprop(fdt, nodename, "no-map", NULL, 0);
+}
+
+static struct arm_boot_info ax3005_binfo = {
+    .loader_start = AX3005_DRAM_BASE,
+    .board_id = -1,
+    .modify_dtb = ax3005_modify_dtb,
+};
+
+static void ax3005_evb_machine_init(MachineState *machine)
+{
+    Ax3005SoCState *s;
+
+    if (machine->ram_size != AX3005_DRAM_SIZE) {
+        g_autofree char *size_str = size_to_str(AX3005_DRAM_SIZE);
+
+        error_report("Invalid RAM size, should be %s", size_str);
+        exit(1);
+    }
+
+    s = AX3005_SOC(object_new_with_props(TYPE_AX3005_SOC, OBJECT(machine),
+                                         "soc", &error_fatal, NULL));
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal);
+
+    ax3005_binfo.ram_size = machine->ram_size;
+    arm_load_kernel(&s->cpu[0], machine, &ax3005_binfo);
+}
+
+static void ax3005_evb_class_init(ObjectClass *oc, const void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->desc = "Axiado AX3005 Evaluation Board";
+    mc->init = ax3005_evb_machine_init;
+    mc->default_cpus = AX3005_NUM_CPUS;
+    mc->min_cpus = AX3005_NUM_CPUS;
+    mc->max_cpus = AX3005_NUM_CPUS;
+    mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a53");
+    mc->default_ram_size = AX3005_DRAM_SIZE;
+}
+
+static const TypeInfo ax3005_evk_types[] = {
+    {
+        .name          = TYPE_AX3005_MACHINE,
+        .parent        = TYPE_MACHINE,
+        .instance_size = sizeof(Ax3005MachineState),
+        .class_init    = ax3005_evb_class_init,
+    }
+};
+
+DEFINE_TYPES(ax3005_evk_types)
diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index f54aaffef2..434cabdfd0 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -117,7 +117,8 @@ arm_common_ss.add(when: ['CONFIG_AXIADO_SOC', 'TARGET_AARCH64'], if_true: files(
   'ax3005-soc.c'))
 arm_common_ss.add(when: ['CONFIG_AXIADO_EVK', 'TARGET_AARCH64'], if_true: files(
   'ax3000-boards.c',
-  'ax3000-evk.c'))
+  'ax3000-evk.c',
+  'ax3005-evk.c'))
 
 arm_common_ss.add(files('boot.c'))
 
diff --git a/include/hw/arm/axiado-boards.h b/include/hw/arm/axiado-boards.h
index 566f22cd96..0f2c586d40 100644
--- a/include/hw/arm/axiado-boards.h
+++ b/include/hw/arm/axiado-boards.h
@@ -11,6 +11,7 @@
 
 #include "hw/core/boards.h"
 #include "hw/arm/ax3000-soc.h"
+#include "hw/arm/ax3005-soc.h"
 
 #define TYPE_AX3000_MACHINE       MACHINE_TYPE_NAME("ax3000")
 OBJECT_DECLARE_TYPE(Ax3000MachineState, Ax3000MachineClass, AX3000_MACHINE)
@@ -24,4 +25,12 @@ typedef struct Ax3000MachineClass {
     MachineClass parent;
 
 } Ax3000MachineClass;
+
+#define TYPE_AX3005_MACHINE       MACHINE_TYPE_NAME("ax3005-evb")
+OBJECT_DECLARE_SIMPLE_TYPE(Ax3005MachineState, AX3005_MACHINE)
+
+struct Ax3005MachineState {
+    MachineState parent;
+
+};
 #endif
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 12/13] docs/system/arm: Document Axiado boards
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (10 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 11/13] hw/arm: Add Axiado Ax3005 EVB Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  2026-11-19  7:13 ` [PATCH v8 13/13] tests/functional/aarch64: Add functional test for Axiado EVKs Kuan-Jui Chiu
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 MAINTAINERS                |   1 +
 docs/system/arm/axiado.rst | 128 +++++++++++++++++++++++++++++++++++++
 docs/system/target-arm.rst |   1 +
 3 files changed, 130 insertions(+)
 create mode 100644 docs/system/arm/axiado.rst

diff --git a/MAINTAINERS b/MAINTAINERS
index e5f37262cf..53e15069ed 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1333,6 +1333,7 @@ F: hw/*/axiado*.c
 F: include/hw/arm/ax3000*.h
 F: include/hw/arm/ax3005*.h
 F: include/hw/*/axiado*.h
+F: docs/system/arm/axiado.rst
 
 AVR Machines
 -------------
diff --git a/docs/system/arm/axiado.rst b/docs/system/arm/axiado.rst
new file mode 100644
index 0000000000..bceaa77d83
--- /dev/null
+++ b/docs/system/arm/axiado.rst
@@ -0,0 +1,128 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
+Axiado family boards (``axiado-scm3003``, ``ax3005-evb``)
+================================================================
+
+The Axiado AX3000 and AX3005 are Arm-based system-on-chip devices intended
+to be used as the management and security processor of a server platform,
+in the same role as a traditional Baseboard Management Controller (BMC).
+
+Two machines are modelled:
+
+- ``axiado-scm3003``  Axiado SCM3003 evaluation kit, based on the AX3000
+- ``ax3005-evb``      Axiado AX3005 evaluation board, based on the AX3005
+
+Neither SoC is supported by the upstream Linux kernel or by upstream
+U-Boot, so there is currently no way to build a bootable image for these
+machines from mainline sources. Axiado intends to publish a firmware
+package suitable for QEMU; until then no ready-to-run image is publicly
+available.
+
+Firmware download
+-----------------
+
+Images can be downloaded from the Axiado Forked OpenBMC Github release repository :
+
+    https://github.com/axiado/openbmc/releases
+
+AX3000 (``axiado-scm3003``)
+---------------------------
+
+Supported devices
+~~~~~~~~~~~~~~~~~
+
+ * SMP (4 x Cortex-A53)
+ * GICv3 interrupt controller
+ * Arm generic timers
+ * DRAM
+ * Cadence UARTs
+ * Cadence GPIO controllers
+ * SD/eMMC host controller (SDHCI) with its eMMC PHY register block
+ * Clock/reset controller (PLL) registers polled by the boot firmware
+
+Running
+~~~~~~~
+
+Boot a kernel directly on the SCM3003 evaluation kit, with an eMMC/SD
+image attached to the SD host controller:
+
+.. code-block:: bash
+
+  qemu-system-aarch64 -M axiado-scm3003 -nographic \
+      -kernel Image \
+      -dtb ax3000-scm3003-qemu.dtb \
+      -initrd obmc-phosphor-initramfs-evk-axiado-qemu.cpio.xz \
+      -serial null \
+      -serial null \
+      -serial null \
+      -serial mon:stdio \
+      -drive if=sd,file=obmc-phosphor-image-evk-axiado-qemu.wic.qcow2,format=qcow2 \
+      -append "console=ttyPS3,115200 earlycon nr_cpus=1 rootwait root=PARTLABEL=rofs-a"
+
+or boot via u-boot:
+
+.. code-block:: bash
+
+  qemu-system-aarch64 -M axiado-scm3003 -nographic \
+      -device loader,file=u-boot.bin,addr=0x3C000000,cpu-num=0 \
+      -serial null \
+      -serial null \
+      -serial null \
+      -serial mon:stdio \
+      -drive if=sd,file=obmc-phosphor-image-evk-axiado-qemu.wic.qcow2,format=qcow2
+
+AX3005 (``ax3005-evb``)
+-----------------------
+
+Supported devices
+~~~~~~~~~~~~~~~~~
+
+ * SMP (4 x Cortex-A53)
+ * GICv3 interrupt controller
+ * Arm generic timers
+ * DRAM
+ * Cadence UARTs
+ * Cadence GPIO controllers
+ * SD/eMMC host controller (SDHCI) with its eMMC PHY register block
+
+Running
+~~~~~~~
+
+Boot a kernel directly on the AX3005 evaluation board, with an eMMC/SD
+image attached to the SD host controller:
+
+.. code-block:: bash
+
+  qemu-system-aarch64 -M ax3005-evb -nographic \
+      -M ax3005-evb \
+      -kernel Image \
+      -dtb ax3005-evb-qemu.dtb \
+      -initrd obmc-phosphor-initramfs-evk-ax3005-qemu.cpio.xz \
+      -device loader,file=obmc-phosphor-image-evk-ax3005-qemu.squashfs-xz,addr=0x90000000 \
+      -serial null \
+      -serial null \
+      -serial null \
+      -serial mon:stdio \
+      -drive if=sd,file=obmc-phosphor-image-evk-ax3005-qemu.wic.qcow2,format=qcow2 \
+      -append "console=ttyPS3,115200 earlycon nr_cpus=1 root=/dev/ram rw phram.phram=ramrofs,0x90000000,0x6400000"
+
+or boot with ARM TrustZone:
+
+.. code-block:: bash
+
+  qemu-system-aarch64 -nographic \
+      -M ax3005-evb \
+      -device loader,file=bl31.bin,addr=0x88300000 \
+      -device loader,file=tee-raw.bin,addr=0x88400000 \
+      -device loader,file=u-boot.bin,addr=0x80000000 \
+      -device loader,file=fitImage,addr=0x80100000 \
+      -device loader,file=obmc-phosphor-image-evk-ax3005-qemu.squashfs-xz,addr=0x80B00000 \
+      -device loader,cpu-num=0,addr=0x88300000 \
+      -device loader,cpu-num=1,addr=0x88300000 \
+      -device loader,cpu-num=2,addr=0x88300000 \
+      -device loader,cpu-num=3,addr=0x88300000 \
+      -serial null \
+      -serial null \
+      -serial null \
+      -serial mon:stdio \
+      -drive if=sd,file=obmc-phosphor-image-evk-ax3005-qemu.wic.qcow2,format=qcow2
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
index 260cd7e4d6..1b038b41de 100644
--- a/docs/system/target-arm.rst
+++ b/docs/system/target-arm.rst
@@ -80,6 +80,7 @@ Board-specific documentation
    arm/versatile
    arm/vexpress
    arm/aspeed
+   arm/axiado
    arm/bananapi_m2u.rst
    arm/b-l475e-iot01a.rst
    arm/sabrelite
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v8 13/13] tests/functional/aarch64: Add functional test for Axiado EVKs
  2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
                   ` (11 preceding siblings ...)
  2026-11-19  7:13 ` [PATCH v8 12/13] docs/system/arm: Document Axiado boards Kuan-Jui Chiu
@ 2026-11-19  7:13 ` Kuan-Jui Chiu
  12 siblings, 0 replies; 14+ messages in thread
From: Kuan-Jui Chiu @ 2026-11-19  7:13 UTC (permalink / raw)
  Cc: Kuan-Jui Chiu, mark.caveayland, philmd, 163wangjack,
	peter.maydell, qemu-devel, qemu-arm

Introduce funtional test for boot process from the kernel to systemd

Add additional subtest to include ARM TrustedZone firmware into boot
process for ax3005-evb model

Signed-off-by: Kuan-Jui Chiu <kchiu@axiado.com>
---
 MAINTAINERS                                   |   2 +
 tests/functional/aarch64/meson.build          |   4 +
 tests/functional/aarch64/test_ax3005_evb.py   | 140 ++++++++++++++++++
 .../functional/aarch64/test_axiado_scm3003.py |  62 ++++++++
 4 files changed, 208 insertions(+)
 create mode 100755 tests/functional/aarch64/test_ax3005_evb.py
 create mode 100755 tests/functional/aarch64/test_axiado_scm3003.py

diff --git a/MAINTAINERS b/MAINTAINERS
index 53e15069ed..297c8685d6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1333,6 +1333,8 @@ F: hw/*/axiado*.c
 F: include/hw/arm/ax3000*.h
 F: include/hw/arm/ax3005*.h
 F: include/hw/*/axiado*.h
+F: tests/functional/aarch64/test_axiado_scm3003.py
+F: tests/functional/aarch64/test_ax3005_evb.py
 F: docs/system/arm/axiado.rst
 
 AVR Machines
diff --git a/tests/functional/aarch64/meson.build b/tests/functional/aarch64/meson.build
index f0881bed16..3e3d918486 100644
--- a/tests/functional/aarch64/meson.build
+++ b/tests/functional/aarch64/meson.build
@@ -4,6 +4,8 @@ test_aarch64_timeouts = {
   'aspeed_ast2700a1' : 600,
   'aspeed_ast2700a2' : 600,
   'aspeed_ast2700fc' : 600,
+  'ax3005_evb' : 180,
+  'axiado_scm3003' : 240,
   'device_passthrough' : 720,
   'imx8mm_evk' : 240,
   'imx8mp_evk' : 240,
@@ -33,6 +35,8 @@ tests_aarch64_system_thorough = [
   'aspeed_ast2700a1',
   'aspeed_ast2700a2',
   'aspeed_ast2700fc',
+  'ax3005_evb',
+  'axiado_scm3003',
   'device_passthrough',
   'hotplug_pci',
   'imx8mm_evk',
diff --git a/tests/functional/aarch64/test_ax3005_evb.py b/tests/functional/aarch64/test_ax3005_evb.py
new file mode 100755
index 0000000000..5ca75b1599
--- /dev/null
+++ b/tests/functional/aarch64/test_ax3005_evb.py
@@ -0,0 +1,140 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots an OpenBMC image on the Axiado AX3005 EVB
+#
+# Author: Kuan-Jui Chiu <kchiu@axiado.com>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset, wait_for_console_pattern
+
+
+class Ax3005EvbMachine(LinuxKernelTest):
+
+    ASSET_SDK_IMAGES = Asset(
+        ('https://github.com/axiado/openbmc/releases/download/v0.1.0/'
+         'evk-ax3005-qemu.tar.gz'),
+        'e07e89151981fb4730223dfe399a7111a0367e3c4122e21d65ef4aa8a2ba04c7')
+
+    ATF_BASE = 0x88300000
+    OPTEE_BASE = 0x88400000
+    UBOOT_BASE = 0x80000000
+    FIT_BASE = 0x80100000
+    RAMROFS_BASE = 0x80B00000
+    RAMROFS_SIZE = 0x6400000
+
+    def setUp(self):
+        super().setUp()
+
+        sdk_image_dir = 'evk-ax3005-qemu'
+
+        self.archive_extract(self.ASSET_SDK_IMAGES)
+        self.atf_path = self.scratch_file(sdk_image_dir,
+                                          'trusted-firmware-a/bl31.bin')
+        self.optee_path = self.scratch_file(sdk_image_dir, 'optee/tee-raw.bin')
+        self.uboot_path = self.scratch_file(sdk_image_dir, 'u-boot.bin')
+        self.fit_path = self.scratch_file(sdk_image_dir, 'fitImage')
+        self.kernel_path = self.scratch_file(sdk_image_dir, 'Image')
+        self.dtb_path = self.scratch_file(sdk_image_dir, 'ax3005-evb-qemu.dtb')
+        self.initrd_path = self.scratch_file(
+            sdk_image_dir, 'obmc-phosphor-initramfs-evk-ax3005-qemu.cpio.xz')
+        self.rofs_path = self.scratch_file(
+            sdk_image_dir, 'obmc-phosphor-image-evk-ax3005-qemu.squashfs-xz')
+        self.disk_path = self.scratch_file(
+            sdk_image_dir, 'obmc-phosphor-image-evk-ax3005-qemu.wic.qcow2')
+
+    def test_aarch64_ax3005_evb_boot(self):
+        self.require_accelerator('tcg')
+        self.set_machine('ax3005-evb')
+
+        ramrofs_base = 0x90000000
+
+        # The SoC has nine Cadence UARTs; the console is the fourth one.
+        self.vm.set_console(console_index=3)
+        self.vm.add_args(
+            '-kernel', self.kernel_path,
+            '-dtb', self.dtb_path,
+            '-initrd', self.initrd_path,
+            '-device', 'loader,file=%s,addr=0x%x' % (self.rofs_path,
+                                                     ramrofs_base),
+            '-drive', 'file=%s,if=sd,format=qcow2,snapshot=on' % self.disk_path,
+            '-append', 'console=ttyPS3,115200 earlycon nr_cpus=1 '
+                       'root=/dev/ram rw '
+                       'phram.phram=ramrofs,0x%x,0x%x' % (ramrofs_base,
+                                                          self.RAMROFS_SIZE))
+
+        self.vm.launch()
+
+        self.wait_for_console_pattern('Linux version')
+        self.wait_for_console_pattern('Machine model: Axiado AX3005 EVB QEMU')
+
+        # The reservation comes from the board's modify_dtb() hook, not from
+        # the supplied DTB, which still carries the old address.
+        self.wait_for_console_pattern(
+            'OF: reserved mem: 0x0000000090000000..0x00000000963fffff')
+
+        # phram claims the reserved window and exposes it as an MTD device.
+        wait_for_console_pattern(
+            self, 'phram: ramrofs device: 0x6400000 at 0x90000000',
+            failure_message='phram: Failed to register new device')
+
+        self.wait_for_console_pattern('Run /init as init process')
+
+        # The initramfs prints this after probing the SD card for the rwfs.
+        self.wait_for_console_pattern('blkdev: /dev/mmcblk0 sector_size: 512')
+
+        # Reaching systemd proves the initramfs mounted the squashfs out of
+        # the phram window and switch_root'ed into it.
+        self.wait_for_console_pattern('Hostname set to <evk-ax3005-qemu>')
+
+    def test_aarch64_ax3005_evb_tzboot(self):
+        self.require_accelerator('tcg')
+        self.set_machine('ax3005-evb')
+
+        # The SoC has nine Cadence UARTs; the console is the fourth one.
+        self.vm.set_console(console_index=3)
+        self.vm.add_args(
+            '-device', 'loader,file=%s,addr=0x%x' % (self.atf_path,
+                                                     self.ATF_BASE),
+            '-device', 'loader,file=%s,addr=0x%x' % (self.optee_path,
+                                                     self.OPTEE_BASE),
+            '-device', 'loader,file=%s,addr=0x%x' % (self.uboot_path,
+                                                     self.UBOOT_BASE),
+            '-device', 'loader,file=%s,addr=0x%x' % (self.fit_path,
+                                                     self.FIT_BASE),
+            '-device', 'loader,file=%s,addr=0x%x' % (self.rofs_path,
+                                                     self.RAMROFS_BASE),
+            '-device', 'loader,cpu-num=0,addr=0x%x' % self.ATF_BASE,
+            '-device', 'loader,cpu-num=1,addr=0x%x' % self.ATF_BASE,
+            '-device', 'loader,cpu-num=2,addr=0x%x' % self.ATF_BASE,
+            '-device', 'loader,cpu-num=3,addr=0x%x' % self.ATF_BASE,
+            '-drive', 'file=%s,if=sd,format=qcow2,snapshot=on' % self.disk_path)
+
+        self.vm.launch()
+
+        self.wait_for_console_pattern('BL31: Initializing BL32')
+        self.wait_for_console_pattern('OP-TEE version:')
+        self.wait_for_console_pattern('Primary CPU switching to normal world')
+
+        self.wait_for_console_pattern('U-Boot 2026.04')
+        self.wait_for_console_pattern('Starting kernel')
+
+        self.wait_for_console_pattern('Linux version')
+        self.wait_for_console_pattern('Machine model: Axiado AX3005 EVB QEMU')
+
+        # phram claims the reserved window and exposes it as an MTD device.
+        wait_for_console_pattern(
+            self, 'phram: ramrofs device: 0x6400000 at 0x80b00000',
+            failure_message='phram: Failed to register new device')
+
+        self.wait_for_console_pattern('Run /init as init process')
+
+        # The initramfs prints this after probing the SD card for the rwfs.
+        self.wait_for_console_pattern('blkdev: /dev/mmcblk0 sector_size: 512')
+
+        # Reaching systemd proves the initramfs mounted the squashfs out of
+        # the phram window and switch_root'ed into it.
+        self.wait_for_console_pattern('Hostname set to <evk-ax3005-qemu>')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
diff --git a/tests/functional/aarch64/test_axiado_scm3003.py b/tests/functional/aarch64/test_axiado_scm3003.py
new file mode 100755
index 0000000000..4d80931b4d
--- /dev/null
+++ b/tests/functional/aarch64/test_axiado_scm3003.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots an OpenBMC image on the Axiado SCM3003 EVK
+#
+# Author: Kuan-Jui Chiu <kchiu@axiado.com>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset, wait_for_console_pattern
+
+
+class AxiadoScm3003Machine(LinuxKernelTest):
+
+    ASSET_SDK_IMAGES = Asset(
+        ('https://github.com/axiado/openbmc/releases/download/v0.1.0/'
+         'evk-axiado-qemu.tar.gz'),
+        'a163b78ed07a43e08323395e2df63c213fbc98b8bc412083a11e94564e26548b')
+
+    def setUp(self):
+        super().setUp()
+
+        sdk_image_dir = 'evk-axiado-qemu'
+
+        self.archive_extract(self.ASSET_SDK_IMAGES)
+        self.kernel_path = self.scratch_file(sdk_image_dir, 'Image')
+        self.dtb_path = self.scratch_file(sdk_image_dir,
+                                          'ax3000-scm3003-qemu.dtb')
+        self.initrd_path = self.scratch_file(
+            sdk_image_dir, 'obmc-phosphor-initramfs-evk-axiado-qemu.cpio.xz')
+        self.disk_path = self.scratch_file(
+            sdk_image_dir, 'obmc-phosphor-image-evk-axiado-qemu.wic.qcow2')
+
+    def test_aarch64_axiado_scm3003_boot(self):
+        self.require_accelerator('tcg')
+        self.set_machine('axiado-scm3003')
+
+        # The SoC has four Cadence UARTs; the console is the fourth one.
+        self.vm.set_console(console_index=3)
+        self.vm.add_args(
+            '-kernel', self.kernel_path,
+            '-dtb', self.dtb_path,
+            '-initrd', self.initrd_path,
+            '-drive', 'file=%s,if=sd,format=qcow2,snapshot=on' % self.disk_path,
+            '-append', 'console=ttyPS3,115200 earlycon nr_cpus=1 '
+                       'rootwait root=PARTLABEL=rofs-a')
+
+        self.vm.launch()
+
+        self.wait_for_console_pattern('Linux version')
+        self.wait_for_console_pattern('Machine model: Axiado AX3000-SCM3003')
+
+        self.wait_for_console_pattern('Run /init as init process')
+
+        # The initramfs prints this after probing the SD card for the rwfs.
+        self.wait_for_console_pattern('blkdev: /dev/mmcblk0 sector_size: 512')
+
+        # Reaching systemd proves the initramfs mounted the squashfs out of
+        # the phram window and switch_root'ed into it.
+        self.wait_for_console_pattern('Hostname set to <evk-axiado-qemu>')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-11-19  7:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19  7:13 [PATCH v8 00/13] Add Axiado SoC AX3005 and EVB Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 01/13] hw/char/cadence_uart: Reduce the size of MMIO to 0x80 Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 02/13] hw/char/cadence_uart: Add BXRS register definition Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 03/13] hw/arm/ax3000-soc: Enable BXRS support of CADENCE UART Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 04/13] hw/arm: Rename ax3000-boards as axiado-boards Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 05/13] hw/arm/ax3000: Specify SoC name in header and variable Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 06/13] hw/arm/ax3000-boards: Add memory guard Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 07/13] hw/arm/ax3000-boards: Add modify_dtb for discontiguous memory Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 08/13] hw/arm/ax3000-boards: Remove redundant pointer from struct Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 09/13] hw/arm/ax3000-soc: Revise variables accodring to QEMU idioms Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 10/13] hw/arm: Add Axiado SoC AX3005 Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 11/13] hw/arm: Add Axiado Ax3005 EVB Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 12/13] docs/system/arm: Document Axiado boards Kuan-Jui Chiu
2026-11-19  7:13 ` [PATCH v8 13/13] tests/functional/aarch64: Add functional test for Axiado EVKs Kuan-Jui Chiu

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.