[Qemu-devel] [RFC PATCH 2/5] ppc: Express dependencies of the 'prep' and '40p' machines with kconfig

Thomas Huth posted 5 patches 6 years, 9 months ago
There is a newer version of this series
[Qemu-devel] [RFC PATCH 2/5] ppc: Express dependencies of the 'prep' and '40p' machines with kconfig
Posted by Thomas Huth 6 years, 9 months ago
Select the required devices in hw/ppc/Kconfig instead, so that
ppc-softmmu.mak only contains the user-selectable PREP switch.
Plug-in devices like NE2000_ISA are pulled in automatically by the
Kconfig build system now.

Cc: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 default-configs/ppc-softmmu.mak | 8 --------
 hw/ppc/Kconfig                  | 8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak
index 05ba726..422f1b7 100644
--- a/default-configs/ppc-softmmu.mak
+++ b/default-configs/ppc-softmmu.mak
@@ -57,11 +57,3 @@ CONFIG_MAC_NEWWORLD=y
 
 # For PReP
 CONFIG_PREP=y
-CONFIG_PREP_PCI=y
-CONFIG_RS6000_MC=y
-CONFIG_I82374=y
-CONFIG_I82378=y
-CONFIG_PCKBD=y
-CONFIG_NE2000_ISA=y
-CONFIG_PC87312=y
-CONFIG_CS4231A=y
diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index b44e3bd..809830e 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -30,6 +30,14 @@ config SAM460EX
 
 config PREP
     bool
+    select CS4231A
+    select PREP_PCI
+    select I82374
+    select I82378
+    select LSI_SCSI_PCI
+    select M48T59
+    select PC87312
+    select RS6000_MC
 
 config RS6000_MC
     bool
-- 
1.8.3.1


Re: [Qemu-devel] [RFC PATCH 2/5] ppc: Express dependencies of the 'prep' and '40p' machines with kconfig
Posted by Paolo Bonzini 6 years, 9 months ago
On 30/01/19 10:43, Thomas Huth wrote:
> +    select LSI_SCSI_PCI

Should NE2000_ISA and LSI_SCSI_PCI be handled the same?  Either rely on
"default y" for both, or select both (I think I prefer the former).

Paolo

Re: [Qemu-devel] [RFC PATCH 2/5] ppc: Express dependencies of the 'prep' and '40p' machines with kconfig
Posted by Thomas Huth 6 years, 9 months ago
On 2019-01-30 11:17, Paolo Bonzini wrote:
> On 30/01/19 10:43, Thomas Huth wrote:
>> +    select LSI_SCSI_PCI
> 
> Should NE2000_ISA and LSI_SCSI_PCI be handled the same?  Either rely on
> "default y" for both, or select both (I think I prefer the former).

Yes. IMHO we should use "select XXX" if the machine has a hard
requirement for a device, and "default y" if it can also somehow work
without the device. In this case, I did not look carefully enough, since
it is apparently possible to use the 40p machine also without the LSI
controller when you specify "-nodefaults". So I'll remove this in v2 and
rely on the "default y" instead.

 Thomas

Re: [Qemu-devel] [RFC PATCH 2/5] ppc: Express dependencies of the 'prep' and '40p' machines with kconfig
Posted by Thomas Huth 6 years, 9 months ago
On 2019-01-30 11:25, Thomas Huth wrote:
> On 2019-01-30 11:17, Paolo Bonzini wrote:
>> On 30/01/19 10:43, Thomas Huth wrote:
>>> +    select LSI_SCSI_PCI
>>
>> Should NE2000_ISA and LSI_SCSI_PCI be handled the same?  Either rely on
>> "default y" for both, or select both (I think I prefer the former).
> 
> Yes. IMHO we should use "select XXX" if the machine has a hard
> requirement for a device, and "default y" if it can also somehow work
> without the device. In this case, I did not look carefully enough, since
> it is apparently possible to use the 40p machine also without the LSI
> controller when you specify "-nodefaults". So I'll remove this in v2 and
> rely on the "default y" instead.

Scratch that. The "select LSI_SCSI_PCI" is currently a hard requirement
here, otherwise I get a linker error like this:

 hw/ppc/prep.c:705: undefined reference to `lsi53c8xx_handle_legacy_cmdline'

So I think we should keep this patch in its current shape. Of course
we still can clean that up later, but this should not be part of the
initial Kconfig patch series (which is already big enough).

 Thomas

Re: [Qemu-devel] [RFC PATCH 2/5] ppc: Express dependencies of the 'prep' and '40p' machines with kconfig
Posted by Paolo Bonzini 6 years, 9 months ago
On 30/01/19 12:02, Thomas Huth wrote:
> On 2019-01-30 11:25, Thomas Huth wrote:
>> On 2019-01-30 11:17, Paolo Bonzini wrote:
>>> On 30/01/19 10:43, Thomas Huth wrote:
>>>> +    select LSI_SCSI_PCI
>>>
>>> Should NE2000_ISA and LSI_SCSI_PCI be handled the same?  Either rely on
>>> "default y" for both, or select both (I think I prefer the former).
>>
>> Yes. IMHO we should use "select XXX" if the machine has a hard
>> requirement for a device, and "default y" if it can also somehow work
>> without the device. In this case, I did not look carefully enough, since
>> it is apparently possible to use the 40p machine also without the LSI
>> controller when you specify "-nodefaults". So I'll remove this in v2 and
>> rely on the "default y" instead.
> 
> Scratch that. The "select LSI_SCSI_PCI" is currently a hard requirement
> here, otherwise I get a linker error like this:
> 
>  hw/ppc/prep.c:705: undefined reference to `lsi53c8xx_handle_legacy_cmdline'
> 
> So I think we should keep this patch in its current shape. Of course
> we still can clean that up later, but this should not be part of the
> initial Kconfig patch series (which is already big enough).

Sounds good!

Paolo


Re: [Qemu-devel] [RFC PATCH 2/5] ppc: Express dependencies of the 'prep' and '40p' machines with kconfig
Posted by Paolo Bonzini 6 years, 9 months ago
On 30/01/19 11:25, Thomas Huth wrote:
> On 2019-01-30 11:17, Paolo Bonzini wrote:
>> On 30/01/19 10:43, Thomas Huth wrote:
>>> +    select LSI_SCSI_PCI
>>
>> Should NE2000_ISA and LSI_SCSI_PCI be handled the same?  Either rely on
>> "default y" for both, or select both (I think I prefer the former).
> 
> Yes. IMHO we should use "select XXX" if the machine has a hard
> requirement for a device, and "default y" if it can also somehow work
> without the device.

I agree.

Paolo