@samitouri / QOSamiQemu / commits / 0a62934014

hw: Move ARM_SYSCTL_GPIO definitions to arm sysctl specific header

include/hw/arm/primecell.h used to be more expansive, but now the only thing it defines is the ARM_SYSCTL_GPIO_* constants for the GPIO lines for the arm-sysctl system-control device used on the Realview, Versatile and Versatile Express boards. Replace it with a header file specific to that device. virt.c and vmapple.c included primecell.h despite not using the constants it defined; there we can simply drop the include entirely. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20260416172627.690396-1-peter.maydell@linaro.org

Peter Maydell committed Apr 16, 2026 at 18:26 UTC 0a62934014a5322ad9d3a626c6ec8c2d3862f345
8 files changed +20 -18
MAINTAINERS
+1 -1
@@ -759,7 +759,6 @@ F: hw/ssi/pl022.c
759 F: include/hw/ssi/pl022.h
760 F: hw/rtc/pl031.c
761 F: include/hw/rtc/pl031.h
762 -F: include/hw/arm/primecell.h
762 F: hw/timer/cmsdk-apb-timer.c
763 F: include/hw/timer/cmsdk-apb-timer.h
764 F: tests/qtest/cmsdk-apb-timer-test.c
@@ -1113,6 +1112,7 @@ F: hw/*/versatile*
1112 F: hw/i2c/arm_sbcon_i2c.c
1113 F: include/hw/i2c/arm_sbcon_i2c.h
1114 F: hw/misc/arm_sysctl.c
1115 +F: include/hw/misc/arm_sysctl.h
1116 F: docs/system/arm/versatile.rst
1117
1118 Virt
hw/arm/realview.c
+1 -1
@@ -12,9 +12,9 @@
12 #include "target/arm/cpu.h"
13 #include "hw/core/sysbus.h"
14 #include "hw/arm/boot.h"
15 -#include "hw/arm/primecell.h"
15 #include "hw/arm/machines-qom.h"
16 #include "hw/core/split-irq.h"
17 +#include "hw/misc/arm_sysctl.h"
18 #include "hw/net/lan9118.h"
19 #include "hw/net/smc91c111.h"
20 #include "hw/pci/pci.h"
hw/arm/vexpress.c
+1 -1
@@ -26,8 +26,8 @@
26 #include "qemu/datadir.h"
27 #include "hw/core/sysbus.h"
28 #include "hw/arm/boot.h"
29 -#include "hw/arm/primecell.h"
29 #include "hw/arm/machines-qom.h"
30 +#include "hw/misc/arm_sysctl.h"
31 #include "hw/net/lan9118.h"
32 #include "hw/i2c/i2c.h"
33 #include "net/net.h"
hw/arm/virt.c
-1
@@ -36,7 +36,6 @@
36 #include "monitor/qdev.h"
37 #include "hw/core/sysbus.h"
38 #include "hw/arm/boot.h"
39 -#include "hw/arm/primecell.h"
39 #include "hw/arm/virt.h"
40 #include "hw/arm/machines-qom.h"
41 #include "hw/block/flash.h"
hw/misc/arm_sysctl.c
+1 -1
@@ -14,8 +14,8 @@
14 #include "system/runstate.h"
15 #include "qemu/bitops.h"
16 #include "hw/core/sysbus.h"
17 +#include "hw/misc/arm_sysctl.h"
18 #include "migration/vmstate.h"
18 -#include "hw/arm/primecell.h"
19 #include "qemu/log.h"
20 #include "qemu/module.h"
21 #include "qom/object.h"
hw/vmapple/vmapple.c
-1
@@ -32,7 +32,6 @@
32 #include "hw/core/sysbus.h"
33 #include "hw/usb/usb.h"
34 #include "hw/arm/boot.h"
35 -#include "hw/arm/primecell.h"
35 #include "hw/char/pl011.h"
36 #include "hw/intc/arm_gic.h"
37 #include "hw/intc/arm_gicv3_common.h"
include/hw/arm/primecell.h deleted
-12
@@ -1,12 +0,0 @@
1 -#ifndef PRIMECELL_H
2 -#define PRIMECELL_H
3 -
4 -/* Declarations for ARM PrimeCell based periperals. */
5 -/* Also includes some devices that are currently only used by the
6 - ARM boards. */
7 -
8 -/* arm_sysctl GPIO lines */
9 -#define ARM_SYSCTL_GPIO_MMC_WPROT 0
10 -#define ARM_SYSCTL_GPIO_MMC_CARDIN 1
11 -
12 -#endif
include/hw/misc/arm_sysctl.h new
+16
@@ -0,0 +1,16 @@
1 +/*
2 + * Status and system control registers for ARM RealView/Versatile boards.
3 + *
4 + * Copyright (c) Linaro Ltd
5 + *
6 + * SPDX-License-Identifier: GPL-2.0-or-later
7 + */
8 +
9 +#ifndef HW_MISC_ARM_SYSCTL_H
10 +#define HW_MISC_ARM_SYSCTL_H
11 +
12 +/* arm_sysctl inbound GPIO lines */
13 +#define ARM_SYSCTL_GPIO_MMC_WPROT 0
14 +#define ARM_SYSCTL_GPIO_MMC_CARDIN 1
15 +
16 +#endif