hw/sh4: Kconfig cleanups
v4 cover hw/sh4: Kconfig cleanups
Missing review: 1 (license)
Since v3:
- Include full MIT license text (Peter)
Since v2:
- Added missing TC58128/SH_PCI Kconfig entries (Peter)
Since v1:
- Addressed Peter Maydell review comments from
https://www.mail-archive.com/[email protected]/msg80599.html
Philippe Mathieu-Daudé (8):
hw/sh4: Add missing license
hw/sh4: Add missing Kconfig dependency on SH7750 for the R2D board hw/intc: Introduce SH_INTC Kconfig entry
hw/char: Introduce SH_SCI Kconfig entry
hw/timer: Introduce SH_TIMER Kconfig entry
hw/block: Introduce TC58128 eeprom Kconfig entry hw/pci-host: Introduce SH_PCI Kconfig entry
hw/sh4: Remove now unused CONFIG_SH4 from Kconfig
include/hw/sh4/sh.h | 31 ++++++++++++++++++++++++++++---
hw/block/tc58128.c | 26 ++++++++++++++++++++++++++
hw/{sh4 => pci-host}/sh_pci.c | 0
MAINTAINERS | 6 ++++++
hw/block/Kconfig | 3 +++
hw/block/meson.build | 2 +-
hw/char/Kconfig | 3 +++
hw/char/meson.build | 2 +-
hw/intc/Kconfig | 3 +++
hw/intc/meson.build | 2 +-
hw/pci-host/Kconfig | 4 ++++
hw/pci-host/meson.build | 1 +
hw/sh4/Kconfig | 12 ++++++------
hw/sh4/meson.build | 1 -
hw/timer/Kconfig | 4 ++++
hw/timer/meson.build | 2 +-
16 files changed, 88 insertions(+), 14 deletions(-)
rename hw/{sh4 => pci-host}/sh_pci.c (100%)Signature · 1 line
2.26.2
PATCH v4 1/8 hw/sh4: Add missing license
This code was introduced in commit 27c7ca7e775,
("SHIX board emulation (Samuel Tardieu)"). Use
the same license.
--- include/hw/sh4/sh.h | 31 ++++++++++++++++++++++++++++--- hw/block/tc58128.c | 26 ++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-)
include/hw/sh4/sh.h +28 -3
@@ -1,6 +1,31 @@ -#ifndef QEMU_SH_H -#define QEMU_SH_H -/* Definitions for SH board emulation. */ +/* +* Definitions for SH board emulation +* +* Copyright (c) 2005 Samuel Tardieu +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +* SPDX-License-Identifier: MIT +*/ +#ifndef QEMU_HW_SH_H +#define QEMU_HW_SH_H #include "hw/sh4/sh_intc.h" #include "target/sh4/cpu-qom.h"
hw/block/tc58128.c +26 -0
@@ -1,3 +1,29 @@ +/* +* TC58128 NAND EEPROM emulation +* +* Copyright (c) 2005 Samuel Tardieu +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +* SPDX-License-Identifier: MIT +*/ #include "qemu/osdep.h" #include "qemu/units.h" #include "hw/sh4/sh.h"
Signature · 1 line
2.26.2
PATCH v4 2/8 hw/sh4: Add missing Kconfig dependency on SH7750 for the R2D board
In reply to Philippe Mathieu-Daudér2d_init() calls sh7750_init() so depends on SH7750.Harmless at the moment because nothing actually uses CONFIG_SH7750 (hw/sh4/meson.build always compiles sh7750.c and sh7750_regnames.c unconditionally).
--- hw/sh4/Kconfig | 1 + 1 file changed, 1 insertion(+)
hw/sh4/Kconfig +1 -0
@@ -10,6 +10,7 @@ config R2D select PCI select SM501 select SH4 + select SH7750 config SHIX bool
Signature · 1 line
2.26.2
PATCH v4 3/8 hw/intc: Introduce SH_INTC Kconfig entry
In reply to Philippe Mathieu-DaudéWe want to be able to use the 'SH4' config for architecture specific features. Add more fine-grained selection by adding a CONFIG_SH_INTC selector for the SH4 interrupt controller.
--- hw/intc/Kconfig | 3 +++ hw/intc/meson.build | 2 +- hw/sh4/Kconfig | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)
hw/intc/Kconfig +3 -0
@@ -53,6 +53,9 @@ config OMPIC config PPC_UIC bool +config SH_INTC + bool + config RX_ICU bool
hw/intc/meson.build +1 -1
@@ -47,7 +47,7 @@ specific_ss.add(when: 'CONFIG_RX_ICU', if_true: files('rx_icu.c')) specific_ss.add(when: 'CONFIG_S390_FLIC', if_true: files('s390_flic.c')) specific_ss.add(when: 'CONFIG_S390_FLIC_KVM', if_true: files('s390_flic_kvm.c')) -specific_ss.add(when: 'CONFIG_SH4', if_true: files('sh_intc.c')) +specific_ss.add(when: 'CONFIG_SH_INTC', if_true: files('sh_intc.c')) specific_ss.add(when: 'CONFIG_SIFIVE_CLINT', if_true: files('sifive_clint.c')) specific_ss.add(when: 'CONFIG_SIFIVE_PLIC', if_true: files('sifive_plic.c')) specific_ss.add(when: 'CONFIG_XICS', if_true: files('xics.c'))
hw/sh4/Kconfig +1 -0
@@ -19,6 +19,7 @@ config SHIX config SH7750 bool + select SH_INTC config SH4 bool
Signature · 1 line
2.26.2
PATCH v4 4/8 hw/char: Introduce SH_SCI Kconfig entry
In reply to Philippe Mathieu-DaudéWe want to be able to use the 'SH4' config for architecture specific features. Add more fine-grained selection by adding a CONFIG_SH_SCI selector for the SH4 serial controller.
Add the missing MAINTAINERS entries.
--- MAINTAINERS | 2 ++ hw/char/Kconfig | 3 +++ hw/char/meson.build | 2 +- hw/sh4/Kconfig | 1 + 4 files changed, 7 insertions(+), 1 deletion(-)
MAINTAINERS +2 -0
@@ -1388,6 +1388,7 @@ R2D M: Yoshinori Sato <[email protected]> R: Magnus Damm <[email protected]> S: Odd Fixes +F: hw/char/sh_serial.c F: hw/sh4/r2d.c F: hw/intc/sh_intc.c F: include/hw/sh4/sh_intc.h
@@ -1396,6 +1397,7 @@ Shix M: Yoshinori Sato <[email protected]> R: Magnus Damm <[email protected]> S: Odd Fixes +F: hw/char/sh_serial.c F: hw/sh4/shix.c F: hw/intc/sh_intc.c F: include/hw/sh4/sh_intc.h
hw/char/Kconfig +3 -0
@@ -50,6 +50,9 @@ config SCLPCONSOLE config TERMINAL3270 bool +config SH_SCI + bool + config RENESAS_SCI bool
hw/char/meson.build +1 -1
@@ -31,7 +31,7 @@ softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_aux.c')) softmmu_ss.add(when: 'CONFIG_RENESAS_SCI', if_true: files('renesas_sci.c')) softmmu_ss.add(when: 'CONFIG_SIFIVE_UART', if_true: files('sifive_uart.c')) -softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('sh_serial.c')) +softmmu_ss.add(when: 'CONFIG_SH_SCI', if_true: files('sh_serial.c')) softmmu_ss.add(when: 'CONFIG_STM32F2XX_USART', if_true: files('stm32f2xx_usart.c')) softmmu_ss.add(when: 'CONFIG_MCHP_PFSOC_MMUART', if_true: files('mchp_pfsoc_mmuart.c'))
hw/sh4/Kconfig +1 -0
@@ -20,6 +20,7 @@ config SHIX config SH7750 bool select SH_INTC + select SH_SCI config SH4 bool
Signature · 1 line
2.26.2
PATCH v4 5/8 hw/timer: Introduce SH_TIMER Kconfig entry
In reply to Philippe Mathieu-DaudéWe want to be able to use the 'SH4' config for architecture specific features. Add more fine-grained selection by adding a CONFIG_SH_TIMER selector for the SH4 timer control unit.
Add the missing MAINTAINERS entries.
--- MAINTAINERS | 2 ++ hw/sh4/Kconfig | 2 +- hw/timer/Kconfig | 4 ++++ hw/timer/meson.build | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-)
MAINTAINERS +2 -0
@@ -1391,6 +1391,7 @@ S: Odd Fixes F: hw/char/sh_serial.c F: hw/sh4/r2d.c F: hw/intc/sh_intc.c +F: hw/timer/sh_timer.c F: include/hw/sh4/sh_intc.h Shix
@@ -1400,6 +1401,7 @@ S: Odd Fixes F: hw/char/sh_serial.c F: hw/sh4/shix.c F: hw/intc/sh_intc.c +F: hw/timer/sh_timer.c F: include/hw/sh4/sh_intc.h SPARC Machines
hw/sh4/Kconfig +1 -1
@@ -21,7 +21,7 @@ config SH7750 bool select SH_INTC select SH_SCI + select SH_TIMER config SH4 bool - select PTIMER
hw/timer/Kconfig +4 -0
@@ -36,6 +36,10 @@ config CMSDK_APB_DUALTIMER bool select PTIMER +config SH_TIMER + bool + select PTIMER + config RENESAS_TMR bool
hw/timer/meson.build +1 -1
@@ -30,7 +30,7 @@ softmmu_ss.add(when: 'CONFIG_PUV3', if_true: files('puv3_ost.c')) softmmu_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx_timer.c')) softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_systmr.c')) -softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('sh_timer.c')) +softmmu_ss.add(when: 'CONFIG_SH_TIMER', if_true: files('sh_timer.c')) softmmu_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_timer.c')) softmmu_ss.add(when: 'CONFIG_STM32F2XX_TIMER', if_true: files('stm32f2xx_timer.c')) softmmu_ss.add(when: 'CONFIG_XILINX', if_true: files('xilinx_timer.c'))
Signature · 1 line
2.26.2
PATCH v4 6/8 hw/block: Introduce TC58128 eeprom Kconfig entry
In reply to Philippe Mathieu-DaudéAdd more fine-grained selection by adding a CONFIG_TC58128 selector for the TC58128 eeprom.
As this device is only used by the Shix machine, add an entry to the proper section in MAINTAINERS.
--- MAINTAINERS | 1 + hw/block/Kconfig | 3 +++ hw/block/meson.build | 2 +- hw/sh4/Kconfig | 1 + 4 files changed, 6 insertions(+), 1 deletion(-)
MAINTAINERS +1 -0
@@ -1398,6 +1398,7 @@ Shix M: Yoshinori Sato <[email protected]> R: Magnus Damm <[email protected]> S: Odd Fixes +F: hw/block/tc58128.c F: hw/char/sh_serial.c F: hw/sh4/shix.c F: hw/intc/sh_intc.c
hw/block/Kconfig +3 -0
@@ -22,6 +22,9 @@ config ECC config ONENAND bool +config TC58128 + bool + config NVME_PCI bool default y if PCI_DEVICES
hw/block/meson.build +1 -1
@@ -12,7 +12,7 @@ softmmu_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('m25p80.c')) softmmu_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c')) softmmu_ss.add(when: 'CONFIG_XEN', if_true: files('xen-block.c')) -softmmu_ss.add(when: 'CONFIG_SH4', if_true: files('tc58128.c')) +softmmu_ss.add(when: 'CONFIG_TC58128', if_true: files('tc58128.c')) softmmu_ss.add(when: 'CONFIG_NVME_PCI', if_true: files('nvme.c', 'nvme-ns.c')) specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
hw/sh4/Kconfig +1 -0
@@ -16,6 +16,7 @@ config SHIX bool select SH7750 select SH4 + select TC58128 config SH7750 bool
Signature · 1 line
2.26.2
PATCH v4 7/8 hw/pci-host: Introduce SH_PCI Kconfig entry
In reply to Philippe Mathieu-DaudéWe want to be able to use the 'SH4' config for architecture specific features. Add more fine-grained selection by adding a CONFIG_SH_PCI selector for the SH4 PCI controller. Move the file with the other PCI host devices in hw/pci-host and add its missing MAINTAINERS entries.
---
hw/{sh4 => pci-host}/sh_pci.c | 0
MAINTAINERS | 1 +
hw/pci-host/Kconfig | 4 ++++
hw/pci-host/meson.build | 1 +
hw/sh4/Kconfig | 1 +
hw/sh4/meson.build | 1 -
6 files changed, 7 insertions(+), 1 deletion(-)
rename hw/{sh4 => pci-host}/sh_pci.c (100%)hw/pci-host/sh_pci.c renamed from hw/sh4/sh_pci.c +0 -0
MAINTAINERS +1 -0
@@ -1391,6 +1391,7 @@ S: Odd Fixes F: hw/char/sh_serial.c F: hw/sh4/r2d.c F: hw/intc/sh_intc.c +F: hw/pci-host/sh_pci.c F: hw/timer/sh_timer.c F: include/hw/sh4/sh_intc.h
hw/pci-host/Kconfig +4 -0
@@ -68,3 +68,7 @@ config PCI_POWERNV config REMOTE_PCIHOST bool + +config SH_PCI + bool + select PCI
hw/pci-host/meson.build +1 -0
@@ -10,6 +10,7 @@ pci_ss.add(when: 'CONFIG_PCI_SABRE', if_true: files('sabre.c')) pci_ss.add(when: 'CONFIG_XEN_IGD_PASSTHROUGH', if_true: files('xen_igd_pt.c')) pci_ss.add(when: 'CONFIG_REMOTE_PCIHOST', if_true: files('remote.c')) +pci_ss.add(when: 'CONFIG_SH_PCI', if_true: files('sh_pci.c')) # PPC devices pci_ss.add(when: 'CONFIG_PREP_PCI', if_true: files('prep.c'))
hw/sh4/Kconfig +1 -0
@@ -11,6 +11,7 @@ config R2D select SM501 select SH4 select SH7750 + select SH_PCI config SHIX bool
hw/sh4/meson.build +0 -1
@@ -2,7 +2,6 @@ sh4_ss.add(files( 'sh7750.c', 'sh7750_regnames.c', - 'sh_pci.c' )) sh4_ss.add(when: 'CONFIG_R2D', if_true: files('r2d.c')) sh4_ss.add(when: 'CONFIG_SHIX', if_true: files('shix.c'))
Signature · 1 line
2.26.2
PATCH v4 8/8 hw/sh4: Remove now unused CONFIG_SH4 from Kconfig
In reply to Philippe Mathieu-DaudéAs replaced the generic CONFIG_SH4 by more fine-grained selectors, we can remove this now unused config variable.
--- hw/sh4/Kconfig | 5 ----- 1 file changed, 5 deletions(-)
hw/sh4/Kconfig +0 -5
@@ -9,14 +9,12 @@ config R2D select USB_OHCI_PCI select PCI select SM501 - select SH4 select SH7750 select SH_PCI config SHIX bool select SH7750 - select SH4 select TC58128 config SH7750
@@ -24,6 +22,3 @@ config SH7750 select SH_INTC select SH_SCI select SH_TIMER - -config SH4 - bool
Signature · 1 line
2.26.2
Quoted 9 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (8):
hw/sh4: Add missing license
hw/sh4: Add missingKconfigdependency on SH7750 for the R2D board hw/intc: IntroduceSH_INTCKconfigentry
hw/char: IntroduceSH_SCIKconfigentry
hw/timer: IntroduceSH_TIMERKconfigentry
hw/block: Introduce TC58128 eepromKconfigentry hw/pci-host: IntroduceSH_PCIKconfigentry
hw/sh4: Remove now unusedCONFIG_SH4fromKconfig
r~
Quoted 39 lines · Philippe Mathieu-Daudé
Missing review: 1 (license)
Since v3:
- Include full MIT license text (Peter)Since v2:
- Added missing TC58128/SH_PCIKconfigentries (Peter)Since v1:
- Addressed Peter Maydell review comments from
https://www.mail-archive.com/[email protected]/msg80599.htmlPhilippe Mathieu-Daudé (8):
hw/sh4: Add missing license
hw/sh4: Add missingKconfigdependency on SH7750 for the R2D board hw/intc: IntroduceSH_INTCKconfigentry
hw/char: IntroduceSH_SCIKconfigentry
hw/timer: IntroduceSH_TIMERKconfigentry
hw/block: Introduce TC58128 eepromKconfigentry hw/pci-host: IntroduceSH_PCIKconfigentry
hw/sh4: Remove now unusedCONFIG_SH4fromKconfiginclude/hw/sh4/sh.h | 31 ++++++++++++++++++++++++++++--- hw/block/tc58128.c | 26 ++++++++++++++++++++++++++ hw/{sh4 => pci-host}/sh_pci.c | 0 MAINTAINERS | 6 ++++++ hw/block/Kconfig | 3 +++ hw/block/meson.build | 2 +- hw/char/Kconfig | 3 +++ hw/char/meson.build | 2 +- hw/intc/Kconfig | 3 +++ hw/intc/meson.build | 2 +- hw/pci-host/Kconfig | 4 ++++ hw/pci-host/meson.build | 1 + hw/sh4/Kconfig | 12 ++++++------ hw/sh4/meson.build | 1 - hw/timer/Kconfig | 4 ++++ hw/timer/meson.build | 2 +- 16 files changed, 88 insertions(+), 14 deletions(-)
Quoted 2 lines
rename hw/{sh4 =>
pci-host}/sh_pci.c(100%)
Paolo
Quoted 20 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (8):
hw/sh4: Add missing license
hw/sh4: Add missingKconfigdependency on SH7750 for the R2D board hw/intc: IntroduceSH_INTCKconfigentry
hw/char: IntroduceSH_SCIKconfigentry
hw/timer: IntroduceSH_TIMERKconfigentry
hw/block: Introduce TC58128 eepromKconfigentry hw/pci-host: IntroduceSH_PCIKconfigentry
hw/sh4: Remove now unusedCONFIG_SH4fromKconfiginclude/hw/sh4/sh.h | 31 ++++++++++++++++++++++++++++--- hw/block/tc58128.c | 26 ++++++++++++++++++++++++++ hw/{sh4 => pci-host}/sh_pci.c | 0 MAINTAINERS | 6 ++++++ hw/block/Kconfig | 3 +++ hw/block/meson.build | 2 +- hw/char/Kconfig | 3 +++ hw/char/meson.build | 2 +- hw/intc/Kconfig | 3 +++ hw/intc/meson.build | 2 +-
Quoted 8 lines
hw/pci-host/Kconfig | 4 ++++
hw/pci-host/meson.build | 1 +
hw/sh4/Kconfig | 12 ++++++------
hw/sh4/meson.build | 1 -
hw/timer/Kconfig | 4 ++++
hw/timer/meson.build | 2 +-
16 files changed, 88 insertions(+), 14 deletions(-)
rename hw/{sh4 => pci-host}/sh_pci.c (100%)As SH4 is not very active, I'm queuing this and will send a pull request in a few days.