~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/include/asm/mach-jazz/floppy.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * Copyright (C) 1998, 2003 by Ralf Baechle
  7  */
  8 #ifndef __ASM_MACH_JAZZ_FLOPPY_H
  9 #define __ASM_MACH_JAZZ_FLOPPY_H
 10 
 11 #include <linux/delay.h>
 12 #include <linux/linkage.h>
 13 #include <linux/types.h>
 14 #include <linux/mm.h>
 15 #include <asm/addrspace.h>
 16 #include <asm/jazz.h>
 17 #include <asm/jazzdma.h>
 18 
 19 static inline unsigned char fd_inb(unsigned int base, unsigned int reg)
 20 {
 21         unsigned char c;
 22 
 23         c = *(volatile unsigned char *) (base + reg);
 24         udelay(1);
 25 
 26         return c;
 27 }
 28 
 29 static inline void fd_outb(unsigned char value, unsigned int base, unsigned int reg)
 30 {
 31         *(volatile unsigned char *) (base + reg) = value;
 32 }
 33 
 34 /*
 35  * How to access the floppy DMA functions.
 36  */
 37 static inline void fd_enable_dma(void)
 38 {
 39         vdma_enable(JAZZ_FLOPPY_DMA);
 40 }
 41 
 42 static inline void fd_disable_dma(void)
 43 {
 44         vdma_disable(JAZZ_FLOPPY_DMA);
 45 }
 46 
 47 static inline int fd_request_dma(void)
 48 {
 49         return 0;
 50 }
 51 
 52 static inline void fd_free_dma(void)
 53 {
 54 }
 55 
 56 static inline void fd_clear_dma_ff(void)
 57 {
 58 }
 59 
 60 static inline void fd_set_dma_mode(char mode)
 61 {
 62         vdma_set_mode(JAZZ_FLOPPY_DMA, mode);
 63 }
 64 
 65 static inline void fd_set_dma_addr(char *a)
 66 {
 67         vdma_set_addr(JAZZ_FLOPPY_DMA, vdma_phys2log(CPHYSADDR((unsigned long)a)));
 68 }
 69 
 70 static inline void fd_set_dma_count(unsigned int count)
 71 {
 72         vdma_set_count(JAZZ_FLOPPY_DMA, count);
 73 }
 74 
 75 static inline int fd_get_dma_residue(void)
 76 {
 77         return vdma_get_residue(JAZZ_FLOPPY_DMA);
 78 }
 79 
 80 static inline void fd_enable_irq(void)
 81 {
 82 }
 83 
 84 static inline void fd_disable_irq(void)
 85 {
 86 }
 87 
 88 static inline int fd_request_irq(void)
 89 {
 90         return request_irq(FLOPPY_IRQ, floppy_interrupt,
 91                            0, "floppy", NULL);
 92 }
 93 
 94 static inline void fd_free_irq(void)
 95 {
 96         free_irq(FLOPPY_IRQ, NULL);
 97 }
 98 
 99 static inline unsigned long fd_getfdaddr1(void)
100 {
101         return JAZZ_FDC_BASE;
102 }
103 
104 static inline unsigned long fd_dma_mem_alloc(unsigned long size)
105 {
106         unsigned long mem;
107 
108         mem = __get_dma_pages(GFP_KERNEL, get_order(size));
109         if(!mem)
110                 return 0;
111         vdma_alloc(CPHYSADDR(mem), size);       /* XXX error checking */
112 
113         return mem;
114 }
115 
116 static inline void fd_dma_mem_free(unsigned long addr, unsigned long size)
117 {
118         vdma_free(vdma_phys2log(CPHYSADDR(addr)));
119         free_pages(addr, get_order(size));
120 }
121 
122 static inline unsigned long fd_drive_type(unsigned long n)
123 {
124         /* XXX This is wrong for machines with ED 2.88mb disk drives like the
125            Olivetti M700.  Anyway, we should suck this from the ARC
126            firmware.  */
127         if (n == 0)
128                 return 4;       /* 3,5", 1.44mb */
129 
130         return 0;
131 }
132 
133 #endif /* __ASM_MACH_JAZZ_FLOPPY_H */
134 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php