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

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

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  *  arch/arm/include/asm/floppy.h
  4  *
  5  *  Copyright (C) 1996-2000 Russell King
  6  *
  7  *  Note that we don't touch FLOPPY_DMA nor FLOPPY_IRQ here
  8  */
  9 #ifndef __ASM_ARM_FLOPPY_H
 10 #define __ASM_ARM_FLOPPY_H
 11 
 12 #define fd_outb(val, base, reg)                                         \
 13         do {                                                            \
 14                 int new_val = (val);                                    \
 15                 if ((reg) == FD_DOR) {                                  \
 16                         if (new_val & 0xf0)                             \
 17                                 new_val = (new_val & 0x0c) |            \
 18                                           floppy_selects[new_val & 3];  \
 19                         else                                            \
 20                                 new_val &= 0x0c;                        \
 21                 }                                                       \
 22                 outb(new_val, (base) + (reg));                          \
 23         } while(0)
 24 
 25 #define fd_inb(base, reg)       inb((base) + (reg))
 26 #define fd_request_irq()        request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
 27                                             0,"floppy",NULL)
 28 #define fd_free_irq()           free_irq(IRQ_FLOPPYDISK,NULL)
 29 #define fd_disable_irq()        disable_irq(IRQ_FLOPPYDISK)
 30 #define fd_enable_irq()         enable_irq(IRQ_FLOPPYDISK)
 31 
 32 static inline int fd_dma_setup(void *data, unsigned int length,
 33                                unsigned int mode, unsigned long addr)
 34 {
 35         set_dma_mode(DMA_FLOPPY, mode);
 36         __set_dma_addr(DMA_FLOPPY, data);
 37         set_dma_count(DMA_FLOPPY, length);
 38         virtual_dma_port = addr;
 39         enable_dma(DMA_FLOPPY);
 40         return 0;
 41 }
 42 #define fd_dma_setup            fd_dma_setup
 43 
 44 #define fd_request_dma()        request_dma(DMA_FLOPPY,"floppy")
 45 #define fd_free_dma()           free_dma(DMA_FLOPPY)
 46 #define fd_disable_dma()        disable_dma(DMA_FLOPPY)
 47 
 48 /* need to clean up dma.h */
 49 #define DMA_FLOPPYDISK          DMA_FLOPPY
 50 
 51 /* Floppy_selects is the list of DOR's to select drive fd
 52  *
 53  * On initialisation, the floppy list is scanned, and the drives allocated
 54  * in the order that they are found.  This is done by seeking the drive
 55  * to a non-zero track, and then restoring it to track 0.  If an error occurs,
 56  * then there is no floppy drive present.       [to be put back in again]
 57  */
 58 static unsigned char floppy_selects[4] = { 0x10, 0x21, 0x23, 0x33 };
 59 
 60 #define FDC1 (0x3f0)
 61 
 62 #define FLOPPY0_TYPE 4
 63 #define FLOPPY1_TYPE 4
 64 
 65 #define N_FDC 1
 66 #define N_DRIVE 4
 67 
 68 #define CROSS_64KB(a,s) (0)
 69 
 70 /*
 71  * This allows people to reverse the order of
 72  * fd0 and fd1, in case their hardware is
 73  * strangely connected (as some RiscPCs
 74  * and A5000s seem to be).
 75  */
 76 static void driveswap(int *ints, int dummy, int dummy2)
 77 {
 78         swap(floppy_selects[0], floppy_selects[1]);
 79 }
 80 
 81 #define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
 82         
 83 #endif
 84 

~ [ 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