diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2012-07-03 18:16:08 +1000 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2012-07-31 16:24:30 +1000 |
commit | f21f7a3f46b557eb5923f899ce8b4401b3cc6d91 (patch) | |
tree | 85a07b4856fd8c83511d29da065f51c8ce71ded3 | |
parent | 7279655af2eba855bd2df61303d25abd1eeb2300 (diff) | |
download | SLOF-qemu-slof-20129731.zip SLOF-qemu-slof-20129731.tar.gz SLOF-qemu-slof-20129731.tar.bz2 |
Added ibm,req#msi and ibm,req#msi-x to device nodesqemu-slof-20129731qemu-slof-20120731
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
-rw-r--r-- | board-qemu/slof/pci-capabilities.fs | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/board-qemu/slof/pci-capabilities.fs b/board-qemu/slof/pci-capabilities.fs index 9ac580d..ef8c7b0 100644 --- a/board-qemu/slof/pci-capabilities.fs +++ b/board-qemu/slof/pci-capabilities.fs @@ -1,4 +1,34 @@ \ Set up all known capabilities for this board to the plugged devices + +: pci-msi-prop ( addr -- ) + 5 pci-cap-find ( capaddr ) + ?dup IF + 2+ rtas-config-w@ ( msi-control ) + 1 rshift 7 and ( msi-control:3:1 ) + + dup 6 < IF + 1 swap lshift ( vectors# ) + encode-int " ibm,req#msi" property + ELSE + ." Invalid MSI vectors number " . cr + THEN + THEN +; + +: pci-msix-prop ( addr -- ) + 11 pci-cap-find ( capaddr ) + ?dup IF + 2+ rtas-config-w@ ( msix-control ) + 7ff and ( msix-control:10:0 ) + 1+ ( vectors# ) + ?dup IF + encode-int " ibm,req#msi-x" property + THEN + THEN +; + : pci-set-capabilities ( config-addr -- ) - drop + dup pci-msi-prop + dup pci-msix-prop + drop ; |