aboutsummaryrefslogtreecommitdiff
path: root/slof
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2011-11-17 10:57:37 +0100
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-11-24 10:21:56 +0100
commit2d3eabca483fcab04c00efa456aa77f48f6efc0e (patch)
treedc60cb046321e213fe8bce42c7487c06496863c8 /slof
parent0be6560d6589781867a11d3a3847842cf1d9f935 (diff)
downloadSLOF-2d3eabca483fcab04c00efa456aa77f48f6efc0e.zip
SLOF-2d3eabca483fcab04c00efa456aa77f48f6efc0e.tar.gz
SLOF-2d3eabca483fcab04c00efa456aa77f48f6efc0e.tar.bz2
Provide PCI memory mapping and dma memory handling in PHB node on board-qemu
According to the PCI Bus Binding to IEEE 1275, the dma-alloc, dma-free, dma-map-in, dma-map-out and dma-sync functions have to be provided by the PCI bus node, not by the PCI device node, so I moved these functions to the PHB node now. Since the "ibm,dma-window" property is still located in the device node instead, I had to add a little hack to the $call-parent method to remember the calling child, so that the parent node (the PHB node) can access that property of the calling child. Also added map-in and map-out functions now according the the PCI Bus Binding. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'slof')
-rw-r--r--slof/fs/instance.fs19
-rw-r--r--slof/fs/pci-device.fs12
2 files changed, 21 insertions, 10 deletions
diff --git a/slof/fs/instance.fs b/slof/fs/instance.fs
index 38e1414..4ba42e5 100644
--- a/slof/fs/instance.fs
+++ b/slof/fs/instance.fs
@@ -139,6 +139,19 @@ CONSTANT <instancevariable>
\ cr ." call for " 3dup -rot type ." on node " .
find-method IF execute ELSE -1 throw THEN
;
-: $call-my-method ( str len -- ) my-self ihandle>phandle $call-static ;
-: $call-method push-my-self $call-my-method pop-my-self ;
-: $call-parent my-parent $call-method ;
+
+: $call-my-method ( str len -- )
+ my-self ihandle>phandle $call-static
+;
+
+: $call-method ( str len ihandle -- )
+ push-my-self $call-my-method pop-my-self
+;
+
+0 VALUE calling-child
+
+: $call-parent
+ my-self TO calling-child
+ my-parent $call-method
+ 0 TO calling-child
+;
diff --git a/slof/fs/pci-device.fs b/slof/fs/pci-device.fs
index 191135c..3e90464 100644
--- a/slof/fs/pci-device.fs
+++ b/slof/fs/pci-device.fs
@@ -10,10 +10,8 @@
\ * IBM Corporation - initial implementation
\ ****************************************************************************/
-get-node parent CONSTANT node-parent
-
\ get the PUID from the node above
-s" my-puid" node-parent $call-static CONSTANT my-puid
+s" my-puid" get-node parent $call-static CONSTANT my-puid
\ define the config reads
: config-b@ puid >r my-puid TO puid my-space + rtas-config-b@ r> TO puid ;
@@ -56,19 +54,19 @@ s" my-puid" node-parent $call-static CONSTANT my-puid
\ DMA memory allocation functions
: dma-alloc ( size -- virt )
- s" dma-alloc" node-parent $call-static
+ s" dma-alloc" $call-parent
;
: dma-free ( virt size -- )
- s" dma-free" node-parent $call-static
+ s" dma-free" $call-parent
;
: dma-map-in ( virt size cacheable? -- devaddr )
- s" dma-map-in" node-parent $call-static
+ s" dma-map-in" $call-parent
;
: dma-map-out ( virt devaddr size -- )
- s" dma-map-out" node-parent $call-static
+ s" dma-map-out" $call-parent
;