Hi

Philippe Mathieu-Daudé 於 2026/8/26 下午 04:20 寫道:
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


On 26/8/26 09:46, Kuan-Jui Chiu wrote:
Add EVK ax3005-evb built with AX3005 SoC

Signed-off-by: Kuan-Jui Chiu <[email protected]>
---
  hw/arm/ax3005-evk.c            | 64 ++++++++++++++++++++++++++++++++++
  hw/arm/meson.build             |  3 +-
  include/hw/arm/axiado-boards.h | 10 ++++++
  3 files changed, 76 insertions(+), 1 deletion(-)
  create mode 100644 hw/arm/ax3005-evk.c

Missing some description in docs/system/arm/.

No problem. I will add it in v5 patch set.
diff --git a/include/hw/arm/axiado-boards.h b/include/hw/arm/axiado-boards.h
index 4a632661e1..7a610ecfda 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)
@@ -25,4 +26,13 @@ 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;
+
+    Ax3005SoCState *soc;

When a component is not optional, our style is to allocate it in
place (IOW this shouldn't be a pointer here but the plain struct).

There are two approaches existing in current QEMU:

1. Create SoC instance in board level then add it into machine state like NXP did

With this approach, I will remove pointer from machine state and add the following code into ax3000/ax3005 board like

Ax3005SoCState *s;
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);

2. Create a common machine state which contains a pointer for different SoC models like Aspeed did

With this approach, I will integrate Ax3000 and Ax3005 machine state into a common struct like AxiadoMachineState


Do we prefer approach 1 to approach 2?

+};
  #endif


Reply via email to