aboutsummaryrefslogtreecommitdiff
path: root/arch/m68k/apollo/dma.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/m68k/apollo/dma.c
Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/m68k/apollo/dma.c')
-rw-r--r--arch/m68k/apollo/dma.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/m68k/apollo/dma.c b/arch/m68k/apollo/dma.c
new file mode 100644
index 00000000000..aed8be177ef
--- /dev/null
+++ b/arch/m68k/apollo/dma.c
@@ -0,0 +1,50 @@
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/kd.h>
+#include <linux/tty.h>
+#include <linux/console.h>
+
+#include <asm/setup.h>
+#include <asm/bootinfo.h>
+#include <asm/system.h>
+#include <asm/pgtable.h>
+#include <asm/apollodma.h>
+#include <asm/io.h>
+
+/* note only works for 16 Bit 1 page DMA's */
+
+static unsigned short next_free_xlat_entry=0;
+
+unsigned short dma_map_page(unsigned long phys_addr,int count,int type) {
+
+ unsigned long page_aligned_addr=phys_addr & (~((1<<12)-1));
+ unsigned short start_map_addr=page_aligned_addr >> 10;
+ unsigned short free_xlat_entry, *xlat_map_entry;
+ int i;
+
+ free_xlat_entry=next_free_xlat_entry;
+ for(i=0,xlat_map_entry=addr_xlat_map+(free_xlat_entry<<2);i<8;i++,xlat_map_entry++) {
+#if 0
+ printk("phys_addr: %x, page_aligned_addr: %x, start_map_addr: %x\n",phys_addr,page_aligned_addr,start_map_addr+i);
+#endif
+ out_be16(xlat_map_entry, start_map_addr+i);
+ }
+
+ next_free_xlat_entry+=2;
+ if(next_free_xlat_entry>125)
+ next_free_xlat_entry=0;
+
+#if 0
+ printk("next_free_xlat_entry: %d\n",next_free_xlat_entry);
+#endif
+
+ return free_xlat_entry<<10;
+}
+
+void dma_unmap_page(unsigned short dma_addr) {
+
+ return ;
+
+}
+