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

TOMOYO Linux Cross Reference
Linux/arch/alpha/include/asm/floppy.h

Version: ~ [ linux-5.9-rc6 ] ~ [ linux-5.8.10 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.66 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.146 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.198 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.236 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.236 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Architecture specific parts of the Floppy driver
  3  *
  4  * This file is subject to the terms and conditions of the GNU General Public
  5  * License.  See the file "COPYING" in the main directory of this archive
  6  * for more details.
  7  *
  8  * Copyright (C) 1995
  9  */
 10 #ifndef __ASM_ALPHA_FLOPPY_H
 11 #define __ASM_ALPHA_FLOPPY_H
 12 
 13 
 14 #define fd_inb(port)                    inb_p(port)
 15 #define fd_outb(value,port)             outb_p(value,port)
 16 
 17 #define fd_enable_dma()         enable_dma(FLOPPY_DMA)
 18 #define fd_disable_dma()        disable_dma(FLOPPY_DMA)
 19 #define fd_request_dma()        request_dma(FLOPPY_DMA,"floppy")
 20 #define fd_free_dma()           free_dma(FLOPPY_DMA)
 21 #define fd_clear_dma_ff()       clear_dma_ff(FLOPPY_DMA)
 22 #define fd_set_dma_mode(mode)   set_dma_mode(FLOPPY_DMA,mode)
 23 #define fd_set_dma_addr(addr)   set_dma_addr(FLOPPY_DMA,virt_to_bus(addr))
 24 #define fd_set_dma_count(count) set_dma_count(FLOPPY_DMA,count)
 25 #define fd_enable_irq()         enable_irq(FLOPPY_IRQ)
 26 #define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
 27 #define fd_request_irq()        request_irq(FLOPPY_IRQ, floppy_interrupt,\
 28                                             0, "floppy", NULL)
 29 #define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL)
 30 
 31 #ifdef CONFIG_PCI
 32 
 33 #include <linux/pci.h>
 34 
 35 #define fd_dma_setup(addr,size,mode,io) alpha_fd_dma_setup(addr,size,mode,io)
 36 
 37 static __inline__ int 
 38 alpha_fd_dma_setup(char *addr, unsigned long size, int mode, int io)
 39 {
 40         static unsigned long prev_size;
 41         static dma_addr_t bus_addr = 0;
 42         static char *prev_addr;
 43         static int prev_dir;
 44         int dir;
 45 
 46         dir = (mode != DMA_MODE_READ) ? PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE;
 47 
 48         if (bus_addr 
 49             && (addr != prev_addr || size != prev_size || dir != prev_dir)) {
 50                 /* different from last time -- unmap prev */
 51                 pci_unmap_single(isa_bridge, bus_addr, prev_size, prev_dir);
 52                 bus_addr = 0;
 53         }
 54 
 55         if (!bus_addr)  /* need to map it */
 56                 bus_addr = pci_map_single(isa_bridge, addr, size, dir);
 57 
 58         /* remember this one as prev */
 59         prev_addr = addr;
 60         prev_size = size;
 61         prev_dir = dir;
 62 
 63         fd_clear_dma_ff();
 64         fd_set_dma_mode(mode);
 65         set_dma_addr(FLOPPY_DMA, bus_addr);
 66         fd_set_dma_count(size);
 67         virtual_dma_port = io;
 68         fd_enable_dma();
 69 
 70         return 0;
 71 }
 72 
 73 #endif /* CONFIG_PCI */
 74 
 75 __inline__ void virtual_dma_init(void)
 76 {
 77         /* Nothing to do on an Alpha */
 78 }
 79 
 80 static int FDC1 = 0x3f0;
 81 static int FDC2 = -1;
 82 
 83 /*
 84  * Again, the CMOS information doesn't work on the alpha..
 85  */
 86 #define FLOPPY0_TYPE 6
 87 #define FLOPPY1_TYPE 0
 88 
 89 #define N_FDC 2
 90 #define N_DRIVE 8
 91 
 92 /*
 93  * Most Alphas have no problems with floppy DMA crossing 64k borders,
 94  * except for certain ones, like XL and RUFFIAN.
 95  *
 96  * However, the test is simple and fast, and this *is* floppy, after all,
 97  * so we do it for all platforms, just to make sure.
 98  *
 99  * This is advantageous in other circumstances as well, as in moving
100  * about the PCI DMA windows and forcing the floppy to start doing
101  * scatter-gather when it never had before, and there *is* a problem
102  * on that platform... ;-}
103  */
104 
105 static inline unsigned long CROSS_64KB(void *a, unsigned long s)
106 {
107         unsigned long p = (unsigned long)a;
108         return ((p + s - 1) ^ p) & ~0xffffUL;
109 }
110 
111 #define EXTRA_FLOPPY_PARAMS
112 
113 #endif /* __ASM_ALPHA_FLOPPY_H */
114 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp