Patchwork [12/13] config: add generic pci config file

login
register
mail settings
Submitter Alexander Graf
Date Nov. 26, 2010, 7:17 p.m.
Message ID <1290799053-27282-13-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/73232/
State New
Headers show

Comments

Alexander Graf - Nov. 26, 2010, 7:17 p.m.
Currently we list PCI devices in every PCI capable architecture individually.
This is cumbersome when adding new devices and prone to failure because one
might miss out on one.

So let's instead have a generic PCI configuration file where people can throw
in their cross-platform compatible PCI devices and thus make it available to
ever architecture that supports PCI too.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 Makefile                             |   13 ++++++++++---
 create_config_mak                    |   19 +++++++++++++++++++
 default-configs/i386-softmmu.mak     |    2 ++
 default-configs/mips-softmmu.mak     |    2 ++
 default-configs/mips64-softmmu.mak   |    2 ++
 default-configs/mips64el-softmmu.mak |    2 ++
 default-configs/mipsel-softmmu.mak   |    2 ++
 default-configs/pci-devices.mak      |    2 ++
 default-configs/ppc-softmmu.mak      |    2 ++
 default-configs/ppc64-softmmu.mak    |    2 ++
 default-configs/ppcemb-softmmu.mak   |    2 ++
 default-configs/sparc64-softmmu.mak  |    2 ++
 default-configs/x86_64-softmmu.mak   |    2 ++
 13 files changed, 51 insertions(+), 3 deletions(-)
 create mode 100755 create_config_mak
 create mode 100644 default-configs/pci-devices.mak
Paul Brook - Nov. 27, 2010, 12:16 a.m.
> Currently we list PCI devices in every PCI capable architecture
> individually. This is cumbersome when adding new devices and prone to
> failure because one might miss out on one.
> 
> So let's instead have a generic PCI configuration file where people can
> throw in their cross-platform compatible PCI devices and thus make it
> available to ever architecture that supports PCI too.

I'm pretty sure this will overwrite user-edited $target/pci-devices.mak every 
time default-configs/pci-devices.mak is modified.  It also requires that the 
makefile be modified every time a new include file is added.

I've comitted a solution that fixes these issues.

Paul
Alexander Graf - Nov. 27, 2010, 12:49 a.m.
On 27.11.2010, at 01:16, Paul Brook wrote:

>> Currently we list PCI devices in every PCI capable architecture
>> individually. This is cumbersome when adding new devices and prone to
>> failure because one might miss out on one.
>> 
>> So let's instead have a generic PCI configuration file where people can
>> throw in their cross-platform compatible PCI devices and thus make it
>> available to ever architecture that supports PCI too.
> 
> I'm pretty sure this will overwrite user-edited $target/pci-devices.mak every 
> time default-configs/pci-devices.mak is modified.  It also requires that the 
> makefile be modified every time a new include file is added.
> 
> I've comitted a solution that fixes these issues.

I updated the git tree to reflect this. I ripped out the whole pci makefile stuff and moved the CONFIG_AHCI=y to pci.mak. The actual ahci emulation is still the same.


It contains the following patches now:

Alexander Graf (10):
      ide: split ide command interpretation off
      ide: fix whitespace gap in ide_exec_cmd
      ide: add DMA hooks to bus ops
      pci: add storage class for sata
      pci: add ich7 pci id
      ahci: add ahci emulation
      ahci: add -drive support
      ahci: spawn controller on demand
      ide: move pata specific parts to pata.c
      config: add ahci for pci capable machines

Roland Elek (2):
      ide: add support for ide bus ops
      ide: add ncq identify data for ahci sata drives

 Makefile.objs           |    3 +-
 blockdev.c              |   41 ++-
 blockdev.h              |    2 +
 default-configs/pci.mak |    1 +
 hw/ide/ahci.c           | 1380 +++++++++++++++++++++++++++++++++++++++++++++++
 hw/ide/core.c           |  874 ++++++++++++++-----------------
 hw/ide/internal.h       |   37 +-
 hw/ide/pata.c           |  178 ++++++
 hw/pci.h                |    1 +
 hw/pci_ids.h            |    1 +
 qemu-common.h           |    2 +-
 vl.c                    |    2 +
 12 files changed, 2031 insertions(+), 491 deletions(-)
 create mode 100644 hw/ide/ahci.c
 create mode 100644 hw/ide/pata.c

Patch

diff --git a/Makefile b/Makefile
index 4e120a2..a4fa965 100644
--- a/Makefile
+++ b/Makefile
@@ -39,9 +39,16 @@  endif
 
 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
 SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
+PCI_DEVICES_MAK=$(patsubst %, %/pci-devices.mak, $(TARGET_DIRS))
 
-config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
-	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
+config-all-devices.mak: $(SUBDIR_DEVICES_MAK) $(PCI_DEVICES_MAK)
+	$(call quiet-command,sh $(SRC_PATH)/create_config_mak $(SUBDIR_DEVICES_MAK) | sort -u > $@,"  GEN   $@")
+
+%-softmmu/pci-devices.mak: default-configs/pci-devices.mak
+	$(call quiet-command,cat $< > $@, "  GEN   $@")
+
+%-user/pci-devices.mak:
+	$(call quiet-command,echo > $@, "  GEN   $@")
 
 %/config-devices.mak: default-configs/%.mak
 	$(call quiet-command,cat $< > $@.tmp, "  GEN   $@")
@@ -66,7 +73,7 @@  config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
 	 fi
 
 defconfig:
-	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
+	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK) $(PCI_DEVICES_MAK)
 
 -include config-all-devices.mak
 
diff --git a/create_config_mak b/create_config_mak
new file mode 100755
index 0000000..3dddb95
--- /dev/null
+++ b/create_config_mak
@@ -0,0 +1,19 @@ 
+#!/bin/sh
+
+echo "# Automatically generated by create_config_mak - do not modify"
+
+for CONF in "$@"; do
+  DIR=$(dirname "$CONF")
+  cat "$CONF" | while read line; do
+    case $line in
+      include*)
+        $0 $DIR/${line#* }
+        ;;
+      CONFIG_*=y)
+        name=${line%=*}
+        echo "$line"
+        ;;
+    esac
+  done
+done
+
diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index ed00471..14d156e 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -23,3 +23,5 @@  CONFIG_NE2000_ISA=y
 CONFIG_PIIX_PCI=y
 CONFIG_SOUND=y
 CONFIG_VIRTIO_PCI=y
+
+include pci-devices.mak
diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak
index 3d0af83..41303c9 100644
--- a/default-configs/mips-softmmu.mak
+++ b/default-configs/mips-softmmu.mak
@@ -30,3 +30,5 @@  CONFIG_DP8393X=y
 CONFIG_DS1225Y=y
 CONFIG_MIPSNET=y
 CONFIG_PFLASH_CFI01=y
+
+include pci-devices.mak
diff --git a/default-configs/mips64-softmmu.mak b/default-configs/mips64-softmmu.mak
index 0030de4..5920d28 100644
--- a/default-configs/mips64-softmmu.mak
+++ b/default-configs/mips64-softmmu.mak
@@ -30,3 +30,5 @@  CONFIG_DP8393X=y
 CONFIG_DS1225Y=y
 CONFIG_MIPSNET=y
 CONFIG_PFLASH_CFI01=y
+
+include pci-devices.mak
diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/mips64el-softmmu.mak
index fa2a3ff..9724b33 100644
--- a/default-configs/mips64el-softmmu.mak
+++ b/default-configs/mips64el-softmmu.mak
@@ -32,3 +32,5 @@  CONFIG_DS1225Y=y
 CONFIG_MIPSNET=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_FULONG=y
+
+include pci-devices.mak
diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/mipsel-softmmu.mak
index 238b73a..8587baf 100644
--- a/default-configs/mipsel-softmmu.mak
+++ b/default-configs/mipsel-softmmu.mak
@@ -30,3 +30,5 @@  CONFIG_DP8393X=y
 CONFIG_DS1225Y=y
 CONFIG_MIPSNET=y
 CONFIG_PFLASH_CFI01=y
+
+include pci-devices.mak
diff --git a/default-configs/pci-devices.mak b/default-configs/pci-devices.mak
new file mode 100644
index 0000000..b3a55bf
--- /dev/null
+++ b/default-configs/pci-devices.mak
@@ -0,0 +1,2 @@ 
+# Default configuration options for PCI capable machines
+
diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak
index 940f4bf..732db30 100644
--- a/default-configs/ppc-softmmu.mak
+++ b/default-configs/ppc-softmmu.mak
@@ -35,3 +35,5 @@  CONFIG_VIRTIO_PCI=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_PFLASH_CFI02=y
 CONFIG_PTIMER=y
+
+include pci-devices.mak
diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak
index e1bc6b8..b98bf88 100644
--- a/default-configs/ppc64-softmmu.mak
+++ b/default-configs/ppc64-softmmu.mak
@@ -35,3 +35,5 @@  CONFIG_VIRTIO_PCI=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_PFLASH_CFI02=y
 CONFIG_PTIMER=y
+
+include pci-devices.mak
diff --git a/default-configs/ppcemb-softmmu.mak b/default-configs/ppcemb-softmmu.mak
index 8f1cc09..02e1fec 100644
--- a/default-configs/ppcemb-softmmu.mak
+++ b/default-configs/ppcemb-softmmu.mak
@@ -35,3 +35,5 @@  CONFIG_VIRTIO_PCI=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_PFLASH_CFI02=y
 CONFIG_PTIMER=y
+
+include pci-devices.mak
diff --git a/default-configs/sparc64-softmmu.mak b/default-configs/sparc64-softmmu.mak
index 1cc3f13..810d1c5 100644
--- a/default-configs/sparc64-softmmu.mak
+++ b/default-configs/sparc64-softmmu.mak
@@ -14,3 +14,5 @@  CONFIG_IDE_PCI=y
 CONFIG_IDE_ISA=y
 CONFIG_IDE_CMD646=y
 CONFIG_VIRTIO_PCI=y
+
+include pci-devices.mak
diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index 5183203..d2be175 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
@@ -23,3 +23,5 @@  CONFIG_NE2000_ISA=y
 CONFIG_PIIX_PCI=y
 CONFIG_SOUND=y
 CONFIG_VIRTIO_PCI=y
+
+include pci-devices.mak