aboutsummaryrefslogtreecommitdiff
path: root/slof
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-01-10 22:39:42 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2012-01-11 12:48:40 +1100
commitc1394c3d2a8af1b64dd677f3b572236109fe453d (patch)
tree031a565ed80e194b585851512605785a7575f81d /slof
parentc90d5abd0d047acb7c37fc5b67ccc9f3a9a942e5 (diff)
downloadSLOF-c1394c3d2a8af1b64dd677f3b572236109fe453d.zip
SLOF-c1394c3d2a8af1b64dd677f3b572236109fe453d.tar.gz
SLOF-c1394c3d2a8af1b64dd677f3b572236109fe453d.tar.bz2
Support new-style PCI for qemu boardqemu-slof-20120111.1
We now support populating the device-nodes ourselves when using a newer qemu which doesn't do it anymore. Note: I have removed the support for working with the existing device nodes, so qemu needs to be updated in sync with slof Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'slof')
-rw-r--r--slof/fs/pci-properties.fs4
-rw-r--r--slof/fs/pci-scan.fs17
2 files changed, 14 insertions, 7 deletions
diff --git a/slof/fs/pci-properties.fs b/slof/fs/pci-properties.fs
index 312f431..0e67a18 100644
--- a/slof/fs/pci-properties.fs
+++ b/slof/fs/pci-properties.fs
@@ -604,7 +604,11 @@
pci-device-slots encode-int s" slot-names" property
dup pci-bridge-range-props
dup pci-bridge-assigned-addresses-prop
+ \ Only create interrupt-map when it doesn't already exist
+ \ (it can be provided by qemu)
+ s" interrupt-map" get-node get-property IF
pci-bridge-interrupt-map
+ ELSE 2drop THEN
pci-reg-props
;
diff --git a/slof/fs/pci-scan.fs b/slof/fs/pci-scan.fs
index 9114670..1132751 100644
--- a/slof/fs/pci-scan.fs
+++ b/slof/fs/pci-scan.fs
@@ -297,6 +297,15 @@ DEFER func-pci-probe-bus
LOOP \ else next bus
;
+: (probe-pci-host-bridge) ( bus-max bus-min -- )
+ 0d emit ." Adapters on " puid 10 0.r cr \ print the puid we're looking at
+ ( bus-max bus-min ) pci-probe-all \ and walk the bus
+ pci-device-number 0= IF \ IF no devices found
+ 15 spaces \ | indent the output
+ ." None" cr \ | tell the world our result
+ THEN \ FI
+;
+
\ probe the hostbridge that is specified in my-puid
\ for the mmio mem and io addresses:
\ base is the least available address
@@ -309,13 +318,7 @@ DEFER func-pci-probe-bus
pci-max-mem ! \ save the max mem-space address
pci-next-mmio ! \ save the next mmio-base address
pci-max-mmio ! \ save the max mmio-space address
-
- 0d emit ." Adapters on " puid 10 0.r cr \ print the puid we're looking at
- ( bus-max bus-min ) pci-probe-all \ and walk the bus
- pci-device-number 0= IF \ IF no devices found
- 15 spaces \ | indent the output
- ." None" cr \ | tell the world our result
- THEN \ FI
+ (probe-pci-host-bridge)
r> TO puid \ restore puid
;