Improvements for switches in hw/cpu/Kconfig
Subsystems (2)
cover Improvements for switches in hw/cpu/Kconfig
First patch fixes the problem that the file hw/cpu/Kconfig is currently ignored and the switches there are duplicated in hw/arm/.
The second patch introduces a proper config switch for the cpu-cluster device.
Thomas Huth (2):
hw: Fix problem with the A*MPCORE switches in the Kconfig files
hw: Add a Kconfig switch for the TYPE_CPU_CLUSTER device
hw/Kconfig | 1 + hw/arm/Kconfig | 18 +++--------------- hw/cpu/Kconfig | 15 ++++++++++++--- hw/cpu/meson.build | 2 +- hw/riscv/Kconfig | 2 ++ 5 files changed, 19 insertions(+), 19 deletions(-)
Signature · 1 line
2.44.0
PATCH 1/2 hw: Fix problem with the A*MPCORE switches in the Kconfig files
A9MPCORE, ARM11MPCORE and A15MPCORE are defined twice, once in hw/cpu/Kconfig and once in hw/arm/Kconfig. This is only possible by accident, since hw/cpu/Kconfig is never included from hw/Kconfig. Fix it by declaring the switches only in hw/cpu/Kconfig (since the related files reside in the hw/cpu/ folder) and by making sure that the file hw/cpu/Kconfig is now properly included from hw/Kconfig.
--- hw/Kconfig | 1 + hw/arm/Kconfig | 15 --------------- hw/cpu/Kconfig | 12 +++++++++--- 3 files changed, 10 insertions(+), 18 deletions(-)
hw/Kconfig +1 -0
@@ -48,6 +48,7 @@ source watchdog/Kconfig # arch Kconfig source arm/Kconfig +source cpu/Kconfig source alpha/Kconfig source avr/Kconfig source cris/Kconfig
hw/arm/Kconfig +0 -15
@@ -678,21 +678,6 @@ config ZAURUS select NAND select ECC -config A9MPCORE - bool - select A9_GTIMER - select A9SCU # snoop control unit - select ARM_GIC - select ARM_MPTIMER - -config A15MPCORE - bool - select ARM_GIC - -config ARM11MPCORE - bool - select ARM11SCU - config ARMSSE bool select ARM_V7M
hw/cpu/Kconfig +9 -3
@@ -1,8 +1,14 @@ -config ARM11MPCORE - bool - config A9MPCORE bool + select A9_GTIMER + select A9SCU # snoop control unit + select ARM_GIC + select ARM_MPTIMER config A15MPCORE bool + select ARM_GIC + +config ARM11MPCORE + bool + select ARM11SCU
Signature · 1 line
2.44.0
Re: [PATCH 1/2] hw: Fix problem with the A*MPCORE switches in the Kconfig files
Quoted 64 lines · Thomas Huth
A9MPCORE, ARM11MPCORE and A15MPCORE are defined twice, once in hw/cpu/Kconfig and once in hw/arm/Kconfig. This is only possible by accident, since hw/cpu/Kconfig is never included from hw/Kconfig. Fix it by declaring the switches only in hw/cpu/Kconfig (since the related files reside in the hw/cpu/ folder) and by making sure that the file hw/cpu/Kconfig is now properly included from hw/Kconfig.
Signed-off-by Thomas Huth <[email protected]>--- hw/Kconfig | 1 + hw/arm/Kconfig | 15 --------------- hw/cpu/Kconfig | 12 +++++++++--- 3 files changed, 10 insertions(+), 18 deletions(-)hw/Kconfig +1
-0@@ -48,6 +48,7 @@ source watchdog/Kconfig # arch Kconfig source arm/Kconfig +source cpu/Kconfig source alpha/Kconfig source avr/Kconfig source cris/Kconfighw/arm/Kconfig +0
-15@@ -678,21 +678,6 @@ config ZAURUS select NAND select ECC -config A9MPCORE - bool - select A9_GTIMER - select A9SCU # snoop control unit - select ARM_GIC - select ARM_MPTIMER - -config A15MPCORE - bool - select ARM_GIC - -config ARM11MPCORE - bool - select ARM11SCU - config ARMSSE bool select ARM_V7Mhw/cpu/Kconfig +2
-3@@ -1,8 +1,14 @@ -config ARM11MPCORE - bool - config A9MPCORE bool + select A9_GTIMER + select A9SCU # snoop control unit
hw/cpu/Kconfig line 14
Quoted 10 lines
hw/cpu/Kconfig +7
-0+ select ARM_GIC + select ARM_MPTIMER config A15MPCORE bool + select ARM_GIC + +config ARM11MPCORE + bool + select ARM11SCU
I thought https://lore.kernel.org/qemu-devel/[email protected]/
was already merged :/ I'll look at what is missing and respin.
Re: [PATCH 1/2] hw: Fix problem with the A*MPCORE switches in the Kconfig files
Quoted 67 lines · Philippe Mathieu-Daudé
Quoted 66 lines · Thomas Huth
A9MPCORE, ARM11MPCORE and A15MPCORE are defined twice, once in hw/cpu/Kconfig and once in hw/arm/Kconfig. This is only possible by accident, since hw/cpu/Kconfig is never included from hw/Kconfig. Fix it by declaring the switches only in hw/cpu/Kconfig (since the related files reside in the hw/cpu/ folder) and by making sure that the file hw/cpu/Kconfig is now properly included from hw/Kconfig.
Signed-off-by Thomas Huth <[email protected]>---
hw/Kconfig | 1 +
hw/arm/Kconfig | 15 ---------------
hw/cpu/Kconfig | 12 +++++++++---3 files changed, 10 insertions(+), 18 deletions(-)hw/Kconfig +0
-0@@ -48,6 +48,7 @@ source watchdog/Kconfig # arch Kconfigsource arm/Kconfig
+source cpu/Kconfig
source alpha/Kconfig
source avr/Kconfig
source cris/Kconfighw/arm/Kconfig +0
-0@@ -678,21 +678,6 @@ config ZAURUSselect NAND
select ECChw/arm/Kconfig +0
-15-config A9MPCORE - bool - select A9_GTIMER - select A9SCU # snoop control unit - select ARM_GIC - select ARM_MPTIMER - -config A15MPCORE - bool - select ARM_GIC - -config ARM11MPCORE - bool - select ARM11SCU -config ARMSSE
bool
selectARM_V7Mhw/cpu/Kconfig +0
-3@@ -1,8 +1,14 @@ -config ARM11MPCORE - bool -config A9MPCORE
bool
+ selectA9_GTIMER
+ select A9SCU # snoop control unit
+ selectARM_GIC
+ selectARM_MPTIMER
config A15MPCORE
bool
Quoted 8 lines
hw/cpu/Kconfig line 14
Quoted 5 lines
+ select
ARM_GIChw/cpu/Kconfig +4
-0+ +config ARM11MPCORE + bool + select ARM11SCUI thought https://lore.kernel.org/qemu-devel/[email protected]/
was already merged :/ I'll look at what is missing and respin.
Oh, ok. But I'd prefer to keep the hw/cpu/Kconfig file since it will be used in the 2nd patch here, too.
Thomas
Philippe Mathieu-Daudé
Reviewed-byRe: [PATCH 1/2] hw: Fix problem with the A*MPCORE switches in the Kconfig files
Quoted 77 lines · Thomas Huth
Quoted 67 lines · Philippe Mathieu-Daudé
Quoted 66 lines · Thomas Huth
A9MPCORE, ARM11MPCORE and A15MPCORE are defined twice, once in hw/cpu/Kconfig and once in hw/arm/Kconfig. This is only possible by accident, since hw/cpu/Kconfig is never included from hw/Kconfig. Fix it by declaring the switches only in hw/cpu/Kconfig (since the related files reside in the hw/cpu/ folder) and by making sure that the file hw/cpu/Kconfig is now properly included from hw/Kconfig.
Signed-off-by Thomas Huth <[email protected]>---
hw/Kconfig | 1 +
hw/arm/Kconfig | 15 ---------------
hw/cpu/Kconfig | 12 +++++++++---3 files changed, 10 insertions(+), 18 deletions(-)hw/Kconfig +0
-0@@ -48,6 +48,7 @@ source watchdog/Kconfig # arch Kconfigsource arm/Kconfig
+source cpu/Kconfig
source alpha/Kconfig
source avr/Kconfig
source cris/Kconfighw/arm/Kconfig +0
-0@@ -678,21 +678,6 @@ config ZAURUSselect NAND
select ECChw/arm/Kconfig +0
-15-config A9MPCORE - bool - select A9_GTIMER - select A9SCU # snoop control unit - select ARM_GIC - select ARM_MPTIMER - -config A15MPCORE - bool - select ARM_GIC - -config ARM11MPCORE - bool - select ARM11SCU -config ARMSSE
bool
selectARM_V7Mhw/cpu/Kconfig +0
-3@@ -1,8 +1,14 @@ -config ARM11MPCORE - bool -config A9MPCORE
bool
+ selectA9_GTIMER
+ select A9SCU # snoop control unit
+ selectARM_GIC
+ selectARM_MPTIMER
config A15MPCORE
boolQuoted 8 lines
hw/cpu/Kconfig line 14
Quoted 5 lines
+ select
ARM_GIChw/cpu/Kconfig +4
-0+ +config ARM11MPCORE + bool + select ARM11SCUI thought https://lore.kernel.org/qemu-devel/[email protected]/
was already merged :/ I'll look at what is missing and respin.
Quoted 1 line
Oh, ok. But I'd prefer to keep the hw/cpu/Kconfig file since it will be used in the 2nd patch here, too.
Fine,
PATCH 2/2 hw: Add a Kconfig switch for the TYPE_CPU_CLUSTER device
In reply to Thomas HuthThe cpu-cluster device is only needed for some few arm and riscv machines. Let's avoid compiling and linking it if it is not really necessary.
--- hw/arm/Kconfig | 3 +++ hw/cpu/Kconfig | 3 +++ hw/cpu/meson.build | 2 +- hw/riscv/Kconfig | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-)
hw/arm/Kconfig +3 -0
@@ -485,6 +485,7 @@ config XLNX_ZYNQMP_ARM select AHCI select ARM_GIC select CADENCE + select CPU_CLUSTER select DDC select DPCD select SDHCI
@@ -503,6 +504,7 @@ config XLNX_VERSAL default y depends on TCG && AARCH64 select ARM_GIC + select CPU_CLUSTER select PL011 select CADENCE select VIRTIO_MMIO
@@ -688,6 +690,7 @@ config ARMSSE select CMSDK_APB_DUALTIMER select CMSDK_APB_UART select CMSDK_APB_WATCHDOG + select CPU_CLUSTER select IOTKIT_SECCTL select IOTKIT_SYSCTL select IOTKIT_SYSINFO
hw/cpu/Kconfig +3 -0
@@ -12,3 +12,6 @@ config A15MPCORE config ARM11MPCORE bool select ARM11SCU + +config CPU_CLUSTER + bool
hw/cpu/meson.build +1 -1
@@ -1,4 +1,4 @@ -system_ss.add(files('core.c', 'cluster.c')) +system_ss.add(when: 'CONFIG_CPU_CLUSTER', if_true: files('core.c', 'cluster.c')) system_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c')) system_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c'))
hw/riscv/Kconfig +2 -0
@@ -9,6 +9,7 @@ config IBEX config MICROCHIP_PFSOC bool select CADENCE_SDHCI + select CPU_CLUSTER select MCHP_PFSOC_DMC select MCHP_PFSOC_IOSCB select MCHP_PFSOC_MMUART
@@ -68,6 +69,7 @@ config SIFIVE_E config SIFIVE_U bool select CADENCE + select CPU_CLUSTER select RISCV_ACLINT select SIFIVE_GPIO select SIFIVE_PDMA
Signature · 1 line
2.44.0
Re: [PATCH 2/2] hw: Add a Kconfig switch for the TYPE_CPU_CLUSTER device
Quoted 56 lines · Thomas Huth
The cpu-cluster device is only needed for some few arm and riscv machines. Let's avoid compiling and linking it if it is not really necessary.
Signed-off-by Thomas Huth <[email protected]>--- hw/arm/Kconfig | 3 +++ hw/cpu/Kconfig | 3 +++ hw/cpu/meson.build | 2 +- hw/riscv/Kconfig | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-)hw/arm/Kconfig +3
-0@@ -485,6 +485,7 @@ config XLNX_ZYNQMP_ARM select AHCI select ARM_GIC select CADENCE + select CPU_CLUSTER select DDC select DPCD select SDHCI@@ -503,6 +504,7 @@ config XLNX_VERSAL default y depends on TCG && AARCH64 select ARM_GIC + select CPU_CLUSTER select PL011 select CADENCE select VIRTIO_MMIO@@ -688,6 +690,7 @@ config ARMSSE select CMSDK_APB_DUALTIMER select CMSDK_APB_UART select CMSDK_APB_WATCHDOG + select CPU_CLUSTER select IOTKIT_SECCTL select IOTKIT_SYSCTL select IOTKIT_SYSINFOhw/cpu/Kconfig +3
-0@@ -12,3 +12,6 @@ config A15MPCORE config ARM11MPCORE bool select ARM11SCU + +config CPU_CLUSTER + boolhw/cpu/meson.build +0
-0
hw/cpu/meson.build line 1
Quoted 2 lines
hw/cpu/meson.build +1
-1@@ -1,4 +1,4 @@ -system_ss.add(files('core.c', 'cluster.c')) +system_ss.add(when: 'CONFIG_CPU_CLUSTER', if_true: files('core.c', 'cluster.c'))
Oops, sorry, the switch should only be used for cluster.c, not for core.c. I'll change it in v2 ...
Thomas
Philippe Mathieu-Daudé
Reviewed-byRe: [PATCH 2/2] hw: Add a Kconfig switch for the TYPE_CPU_CLUSTER device
Quoted 4 lines · Thomas Huth
Quoted 3 lines · Thomas Huth
The cpu-cluster device is only needed for some few arm and riscv machines. Let's avoid compiling and linking it if it is not really necessary.
I expect clustering become the new default for heterogeneous machines, but we are not there yet.
Quoted 8 lines
Quoted 7 lines
Signed-off-by Thomas Huth <[email protected]>---
hw/arm/Kconfig | 3 +++
hw/cpu/Kconfig | 3 +++
hw/cpu/meson.build | 2 +-
hw/riscv/Kconfig | 2 ++4 files changed, 9 insertions(+), 1 deletion(-)
Quoted 10 lines
hw/cpu/meson.build line 2
Quoted 8 lines
hw/cpu/meson.build +1
-1@@ -1,4 +1,4 @@ -system_ss.add(files('core.c', 'cluster.c')) +system_ss.add(when: 'CONFIG_CPU_CLUSTER', if_true: files('core.c', 'cluster.c'))Oops, sorry, the switch should only be used for
cluster.c, not forcore.c. I'll change it in v2 ...
For v2: