This source file includes following definitions.
- deskstation_tyne_fd_inb
- deskstation_tyne_fd_outb
- deskstation_tyne_fd_enable_dma
- deskstation_tyne_fd_disable_dma
- deskstation_tyne_fd_request_dma
- deskstation_tyne_fd_free_dma
- deskstation_tyne_fd_clear_dma_ff
- deskstation_tyne_fd_set_dma_mode
- deskstation_tyne_fd_set_dma_addr
- deskstation_tyne_fd_set_dma_count
- deskstation_tyne_fd_get_dma_residue
- deskstation_tyne_fd_enable_irq
- deskstation_tyne_fd_disable_irq
- deskstation_tyne_fd_cacheflush
- deskstation_tyne_dma_alloc
- deskstation_tyne_dma_init
1
2
3
4
5
6
7
8
9
10 #include <linux/delay.h>
11 #include <linux/kernel.h>
12 #include <linux/types.h>
13 #include <asm/bootinfo.h>
14 #include <asm/cachectl.h>
15 #include <asm/dma.h>
16 #include <asm/io.h>
17
18
19
20
21 unsigned char deskstation_tyne_fd_inb(unsigned int port)
22 {
23 return inb_p(port);
24 }
25
26 void deskstation_tyne_fd_outb(unsigned char value, unsigned int port)
27 {
28 outb_p(value, port);
29 }
30
31
32
33
34 void deskstation_tyne_fd_enable_dma(void)
35 {
36 enable_dma(FLOPPY_DMA);
37 }
38
39 void deskstation_tyne_fd_disable_dma(void)
40 {
41 disable_dma(FLOPPY_DMA);
42 }
43
44 int deskstation_tyne_fd_request_dma(void)
45 {
46 return request_dma(FLOPPY_DMA, "floppy");
47 }
48
49 void deskstation_tyne_fd_free_dma(void)
50 {
51 free_dma(FLOPPY_DMA);
52 }
53
54 void deskstation_tyne_fd_clear_dma_ff(void)
55 {
56 clear_dma_ff(FLOPPY_DMA);
57 }
58
59 int deskstation_tyne_fd_set_dma_mode(char mode)
60 {
61 return set_dma_mode(FLOPPY_DMA, mode);
62 }
63
64 void deskstation_tyne_fd_set_dma_addr(unsigned int a)
65 {
66 set_dma_addr(FLOPPY_DMA, addr);
67 }
68
69 void deskstation_tyne_fd_set_dma_count(unsigned int count)
70 {
71 set_dma_count(FLOPPY_DMA, count);
72 }
73
74 int deskstation_tyne_fd_get_dma_residue(void)
75 {
76 return get_dma_residue(FLOPPY_DMA);
77 }
78
79 void deskstation_tyne_fd_enable_irq(void)
80 {
81 enable_irq(FLOPPY_IRQ);
82 }
83
84 void deskstation_tyne_fd_disable_irq(void)
85 {
86 disable_irq(FLOPPY_IRQ);
87 }
88
89 void deskstation_tyne_fd_cacheflush(unsigned char *addr, unsigned int)
90 {
91 sys_cacheflush((void *)addr, size, DCACHE);
92 }
93
94
95
96
97
98
99
100
101 static unsigned long allocated;
102
103
104
105
106 unsigned long deskstation_tyne_dma_alloc(size_t size)
107 {
108 unsigned long ret = allocated;
109 allocated += size;
110 if (allocated > boot_info.dma_cache_size)
111 ret = -1;
112 return ret;
113 }
114
115 void deskstation_tyne_dma_init(void)
116 {
117 if (boot_info.machtype != MACH_DESKSTATION_TYNE)
118 return;
119 allocated = 0;
120 printk ("Deskstation Tyne DMA (%luk) buffer initialized.\n",
121 boot_info.dma_cache_size >> 10);
122 }