]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/arm/aspeed: Move ASPEED_RAM_SIZE() macro to common header for reuse
authorJamin Lin <jamin_lin@aspeedtech.com>
Tue, 4 Nov 2025 03:12:55 +0000 (11:12 +0800)
committerCédric Le Goater <clg@redhat.com>
Tue, 4 Nov 2025 08:27:58 +0000 (09:27 +0100)
Moving it into aspeed.h allows all Aspeed machine source files
(AST2400, AST2500, AST2600, AST2700, etc.) to reuse the same macro
definition for consistent behavior and maintainability.

No functional changes.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251104031325.146374-18-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/arm/aspeed.c
include/hw/arm/aspeed.h

index 15d3b045ac444e8822938dd2ebbcd204e2c6932c..ba0c9a62ff66db157695a82e417581b7a290ba6d 100644 (file)
@@ -36,13 +36,6 @@ static struct arm_boot_info aspeed_board_binfo = {
     .board_id = -1, /* device-tree-only board */
 };
 
-/* On 32-bit hosts, lower RAM to 1G because of the 2047 MB limit */
-#if HOST_LONG_BITS == 32
-#define ASPEED_RAM_SIZE(sz) MIN((sz), 1 * GiB)
-#else
-#define ASPEED_RAM_SIZE(sz) (sz)
-#endif
-
 /* AST2600 evb hardware value */
 #define AST2600_EVB_HW_STRAP1 0x000000C0
 #define AST2600_EVB_HW_STRAP2 0x00000003
index 16b24e68870a31db25a50a64abb0d949847be60e..84620f49ed2dd452d702121675b41e42bbf402b8 100644 (file)
@@ -25,6 +25,13 @@ DECLARE_OBJ_CHECKERS(AspeedMachineState, AspeedMachineClass,
 #define ASPEED_MAC2_ON   (1 << 2)
 #define ASPEED_MAC3_ON   (1 << 3)
 
+/* On 32-bit hosts, lower RAM to 1G because of the 2047 MB limit */
+#if HOST_LONG_BITS == 32
+#define ASPEED_RAM_SIZE(sz) MIN((sz), 1 * GiB)
+#else
+#define ASPEED_RAM_SIZE(sz) (sz)
+#endif
+
 struct AspeedMachineState {
     MachineState parent_obj;