Skip to contentSkip to conversation

Move AST1030 machine to a separate file

PATCH In review Jamin Lin via 3 participants 5 messages Oct 15, 2025 – Oct 17, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Move AST1030 machine to a separate file

v1:
1. Move AST1030 machine to a separate file

Jamin Lin (1):
hw/arm/aspeed: Move AST1030 machine to a separate file

 include/hw/arm/aspeed.h        |  18 ++++++
 hw/arm/aspeed.c                | 106 ++------------------------------
 hw/arm/aspeed_ast10x0_boards.c | 107 +++++++++++++++++++++++++++++++++
 hw/arm/meson.build             |   1 +
 4 files changed, 130 insertions(+), 102 deletions(-)
 create mode 100644 hw/arm/aspeed_ast10x0_boards.c
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 hw/arm/aspeed: Move AST1030 machine to a separate file

This change moves the AST1030 (MiniBMC) machine definition out of aspeed.c into a new dedicated file, aspeed_ast10x0_boards.c.

The aspeed.c file has grown considerably over time and now contains definitions for more than 25 machines and 5 SoC families. To improve maintainability and consistency with other Aspeed SoC files (aspeed_ast2400.c, aspeed_ast2600.c, aspeed_ast27x0.c, etc.), this patch separates the AST1030 machine into its own source file.

This is part of an ongoing effort discussed with Cédric to refactor and organize Aspeed machine models by SoC revision, following the same "aspeed_ast<rev>_*.c" naming pattern.

No functional change intended.

---
 include/hw/arm/aspeed.h        |  18 ++++++
 hw/arm/aspeed.c                | 106 ++------------------------------
 hw/arm/aspeed_ast10x0_boards.c | 107 +++++++++++++++++++++++++++++++++
 hw/arm/meson.build             |   1 +
 4 files changed, 130 insertions(+), 102 deletions(-)
 create mode 100644 hw/arm/aspeed_ast10x0_boards.c
include/hw/arm/aspeed.h +18 -0
index 6c36455656..1e907a7448 100644
@@ -11,6 +11,7 @@
 
 #include "hw/boards.h"
 #include "qom/object.h"
+#include "hw/arm/aspeed_soc.h"
 
 typedef struct AspeedMachineState AspeedMachineState;
 
@@ -24,6 +25,19 @@ DECLARE_OBJ_CHECKERS(AspeedMachineState, AspeedMachineClass,
 #define ASPEED_MAC2_ON   (1 << 2)
 #define ASPEED_MAC3_ON   (1 << 3)
 
+struct AspeedMachineState {
+    /* Private */
+    MachineState parent_obj;
+    /* Public */
+
+    AspeedSoCState *soc;
+    MemoryRegion boot_rom;
+    bool mmio_exec;
+    uint32_t uart_chosen;
+    char *fmc_model;
+    char *spi_model;
+    uint32_t hw_strap1;
+};
 
 struct AspeedMachineClass {
     MachineClass parent_obj;
@@ -45,5 +59,9 @@ struct AspeedMachineClass {
     bool vbootrom;
 };
 
+void aspeed_machine_class_init_cpus_defaults(MachineClass *mc);
+void connect_serial_hds_to_uarts(AspeedMachineState *bmc);
+void aspeed_machine_class_init(ObjectClass *oc, const void *data);
+void aspeed_machine_instance_init(Object *obj);
 
 #endif
hw/arm/aspeed.c +4 -102

148 lines not on this page · raw message

hw/arm/aspeed_ast10x0_boards.c new file +107 -0

107 lines not on this page · raw message

hw/arm/meson.build +1 -0
index b88b5b06d7..8f20f8ed3d 100644
@@ -46,6 +46,7 @@ arm_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files(
   'aspeed_ast2400.c',
   'aspeed_ast2600.c',
   'aspeed_ast10x0.c',
+  'aspeed_ast10x0_boards.c',
   'aspeed_eeprom.c',
   'fby35.c'))
 arm_common_ss.add(when: ['CONFIG_ASPEED_SOC', 'TARGET_AARCH64'], if_true: files(
Signature · 1 line
2.43.0
#2 lore raw
In reply to Jamin Lin via

Jamin,

Quoted 6 lines · Jamin Lin

v1:
1. Move AST1030 machine to a separate file

Jamin Lin (1):
hw/arm/aspeed: Move AST1030 machine to a separate file

Quoted 7 lines
  include/hw/arm/aspeed.h        |  18 ++++++
  hw/arm/aspeed.c                | 106 ++------------------------------
  hw/arm/aspeed_ast10x0_boards.c | 107 +++++++++++++++++++++++++++++++++
  hw/arm/meson.build             |   1 +
  4 files changed, 130 insertions(+), 102 deletions(-)

create mode 100644 hw/arm/aspeed_ast10x0_boards.c

I will wait for your proposal reorganizing the aspeed machine files.

Thanks,

C.

#3 lore raw

Hi Cédric

Quoted 14 lines

Subject: Re: [SPAM] [PATCH v1 0/1] Move AST1030 machine to a separate file

Jamin,

Quoted 9 lines · Jamin Lin

v1:
1. Move AST1030 machine to a separate file

Jamin Lin (1):
hw/arm/aspeed: Move AST1030 machine to a separate file

  include/hw/arm/aspeed.h        |  18 ++++++
  hw/arm/aspeed.c                | 106 ++------------------------------
  hw/arm/aspeed_ast10x0_boards.c | 107
Quoted 8 lines

+++++++++++++++++++++++++++++++++

Quoted 4 lines
  hw/arm/meson.build             |   1 +
  4 files changed, 130 insertions(+), 102 deletions(-)

create mode 100644 hw/arm/aspeed_ast10x0_boards.c

I will wait for your proposal reorganizing the aspeed machine files.

Thank you for your comments.
I will provide an update later in another email. It appears that this patch can be dropped, as we intend to have one C file and one commit per board/machine.

Thanks,
Jamin

Quoted 5 lines

Thanks,

C.

#4 lore raw

Peter,

Quoted 3 lines

I will provide an update later in another email. It appears that this patch can be dropped, as we intend to have one C file and one commit per board/machine.

Do you have any opinion on this approach ?

Thanks,

C.