[SLOF] [PATCH] Fix dma-alloc and dma-map-in functions on board-js2x

Thomas Huth thuth at redhat.com
Tue Jan 12 19:07:18 AEDT 2016


Since slof/fs/dma-function.fs has been introduced for board-qemu,
these function definitions shadow the original js2x functions from
slof/fs/pci-config-bridge.fs, because dma-functions.fs is included
after pci-config-bridge.fs in slof/fs/pci-bridge.fs.
To restore the original behavior, move the js2x functions into
a board-specific dma-function.fs file instead and include that
one into the ROM-fs instead of the version for board-qemu.

Signed-off-by: Thomas Huth <thuth at redhat.com>
---
 board-js2x/slof/Makefile        |  2 +-
 board-js2x/slof/dma-function.fs | 31 +++++++++++++++++++++++++++++++
 slof/fs/pci-config-bridge.fs    | 20 --------------------
 3 files changed, 32 insertions(+), 21 deletions(-)
 create mode 100644 board-js2x/slof/dma-function.fs

diff --git a/board-js2x/slof/Makefile b/board-js2x/slof/Makefile
index fdc716f..4cdd5fa 100644
--- a/board-js2x/slof/Makefile
+++ b/board-js2x/slof/Makefile
@@ -57,6 +57,7 @@ OF_FFS_FILES = \
 	$(SLOFBRDDIR)/attu.fs \
 	$(SLOFBRDDIR)/cpu.fs \
 	$(SLOFBRDDIR)/ioapic.fs \
+	$(SLOFBRDDIR)/dma-function.fs \
 	$(SLOFBRDDIR)/pci-bridge_1022_7460.fs \
 	$(SLOFBRDDIR)/pci-device_1014_028c.fs \
 	$(SLOFBRDDIR)/pci-device_1014_02bd.fs \
@@ -82,7 +83,6 @@ OF_FFS_FILES = \
 	$(SLOFCMNDIR)/fs/scsi-host-helpers.fs \
 	$(SLOFCMNDIR)/fs/scsi-probe-helpers.fs \
 	$(SLOFCMNDIR)/fs/scsi-support.fs \
-	$(SLOFCMNDIR)/fs/dma-function.fs \
 	$(SLOFCMNDIR)/fs/pci-device.fs \
 	$(SLOFCMNDIR)/fs/pci-bridge.fs \
 	$(SLOFCMNDIR)/fs/pci-properties.fs \
diff --git a/board-js2x/slof/dma-function.fs b/board-js2x/slof/dma-function.fs
new file mode 100644
index 0000000..2e314cd
--- /dev/null
+++ b/board-js2x/slof/dma-function.fs
@@ -0,0 +1,31 @@
+\ *****************************************************************************
+\ * Copyright (c) 2004, 2011 IBM Corporation
+\ * All rights reserved.
+\ * This program and the accompanying materials
+\ * are made available under the terms of the BSD License
+\ * which accompanies this distribution, and is available at
+\ * http://www.opensource.org/licenses/bsd-license.php
+\ *
+\ * Contributors:
+\ *     IBM Corporation - initial implementation
+\ ****************************************************************************/
+
+: dma-alloc ( ... size -- virt )
+   \ ." dma-alloc called: " .s cr
+   alloc-mem
+;
+
+: dma-free ( virt size -- )
+   \ ." dma-free called: " .s cr
+   free-mem
+;
+
+: dma-map-in ( ... virt size cacheable? -- devaddr )
+   \ ." dma-map-in called: " .s cr
+   2drop
+;
+
+: dma-map-out ( virt devaddr size -- )
+   \ ." dma-map-out called: " .s cr
+   2drop drop
+;
diff --git a/slof/fs/pci-config-bridge.fs b/slof/fs/pci-config-bridge.fs
index 6893253..1efbcd8 100644
--- a/slof/fs/pci-config-bridge.fs
+++ b/slof/fs/pci-config-bridge.fs
@@ -81,26 +81,6 @@
    2drop 
 ;
 
-: dma-alloc ( ... size -- virt )
-   \ ." dma-alloc called: " .s cr
-   alloc-mem
-;
-
-: dma-free ( virt size -- )
-   \ ." dma-free called: " .s cr
-   free-mem
-;
-
-: dma-map-in ( ... virt size cacheable? -- devaddr )
-   \ ." dma-map-in called: " .s cr
-   2drop
-;
-
-: dma-map-out ( virt devaddr size -- )
-   \ ." dma-map-out called: " .s cr
-   2drop drop
-;
-
 : dma-sync ( virt devaddr size -- )
    \ XXX should we add at least a memory barrier here?
    \ ." dma-sync called: " .s cr
-- 
1.8.3.1



More information about the SLOF mailing list