From: Kuan-Jui Chiu <kchiu@axiado.com>
Cc: Kuan-Jui Chiu <kchiu@axiado.com>,
mark.caveayland@nutanix.com, philmd@oss.qualcomm.com,
163wangjack@gmail.com, peter.maydell@linaro.org,
qemu-devel@nongnu.org, qemu-arm@nongnu.org
Subject: [PATCH v8 11/13] hw/arm: Add Axiado Ax3005 EVB
Date: Wed, 18 Nov 2026 23:13:51 -0800 [thread overview]
Message-ID: <20261119071355.3520249-12-kchiu@axiado.com> (raw)
In-Reply-To: <20261119071355.3520249-1-kchiu@axiado.com>
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
next prev parent reply other threads:[~2026-11-19 7:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Kuan-Jui Chiu [this message]
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
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=20261119071355.3520249-12-kchiu@axiado.com \
--to=kchiu@axiado.com \
--cc=163wangjack@gmail.com \
--cc=mark.caveayland@nutanix.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@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.