diff options
author | Michael Roth <mdroth@linux.vnet.ibm.com> | 2013-11-20 01:00:31 -0600 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2013-11-22 14:45:03 +1100 |
commit | 2f8aa2de30d6632cf6301d29e8a17d355e388b7c (patch) | |
tree | 47aa4f7156ceea00551555dba920919a678cbeed | |
parent | de0e80e03ecc4e076ebbdc845589537f23d9e5f6 (diff) | |
download | SLOF-2f8aa2de30d6632cf6301d29e8a17d355e388b7c.zip SLOF-2f8aa2de30d6632cf6301d29e8a17d355e388b7c.tar.gz SLOF-2f8aa2de30d6632cf6301d29e8a17d355e388b7c.tar.bz2 |
pci-properties: add properties to enable hotplug for spaprqemu-slof-20131122
drmgr expects ibm,my-drc-index and ibm,loc-code OF properties in
the corresponding device tree node to determine whether a
pre-populated slot is hotpluggable/unpluggable. This is also
stated as a boot-time requirement for DR-capable devices in SPAPR,
though it does not specify there how these entries are to be generated.
In the case of QEMU, hotpluggable slots are allocated entries based on
bus/slotno values, so we can determine these entries statically at
boot-time, rather than relying on RTAS calls as we would during
OS-driven configuration.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | board-qemu/slof/pci-phb.fs | 1 | ||||
-rw-r--r-- | slof/fs/pci-properties.fs | 14 | ||||
-rw-r--r-- | slof/fs/pci-scan.fs | 2 |
3 files changed, 17 insertions, 0 deletions
diff --git a/board-qemu/slof/pci-phb.fs b/board-qemu/slof/pci-phb.fs index 57e778a..4f8e702 100644 --- a/board-qemu/slof/pci-phb.fs +++ b/board-qemu/slof/pci-phb.fs @@ -283,6 +283,7 @@ setup-puid puid >r \ Save old value of puid my-puid TO puid \ Set current puid phb-parse-ranges + 1 TO pci-hotplug-enabled 1 0 (probe-pci-host-bridge) r> TO puid \ Restore previous puid ; diff --git a/slof/fs/pci-properties.fs b/slof/fs/pci-properties.fs index 7816a22..f88a571 100644 --- a/slof/fs/pci-properties.fs +++ b/slof/fs/pci-properties.fs @@ -589,6 +589,20 @@ dup pci-sub-vendor@ ?dup IF encode-int s" subsystem-vendor-id" property THEN dup pci-device-assigned-addresses-prop pci-reg-props + pci-hotplug-enabled IF + \ QEMU uses static assignments for my-drc-index: + \ 40000000h + $bus << 8 + $slot << 3 + dup dup pci-addr2bus 8 lshift + swap pci-addr2dev 3 lshift or + 40000000 + encode-int s" ibm,my-drc-index" property + \ QEMU uses "Slot $bus*32$slotno" for loc-code + dup dup pci-addr2bus 20 * + swap pci-addr2dev + + a base ! + s" Slot " rot $cathex + hex + encode-string s" ibm,loc-code" property + THEN ; \ set up bridge only properties diff --git a/slof/fs/pci-scan.fs b/slof/fs/pci-scan.fs index 99eeef2..ec9bd27 100644 --- a/slof/fs/pci-scan.fs +++ b/slof/fs/pci-scan.fs @@ -36,6 +36,8 @@ VARIABLE pci-max-io \ the 3rd slot on the HostBridge bus here 100 allot CONSTANT pci-device-vec 0 VALUE pci-device-vec-len +\ enable/disable creation of hotplug-specific properties +0 VALUE pci-hotplug-enabled \ Fixme Glue to the pci-devices ... remove this later |