Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | /* * Low-level hardware access stuff for Jazz family machines. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1995, 1996 by Ralf Baechle */ #include <linux/delay.h> #include <linux/linkage.h> #include <linux/types.h> #include <linux/mm.h> #include <asm/addrspace.h> #include <asm/vector.h> #include <asm/jazz.h> #include <asm/jazzdma.h> #include <asm/pgtable.h> #include <asm/mc146818rtc.h> static unsigned char fd_inb(unsigned int port) { unsigned char c; c = *(volatile unsigned char *) port; udelay(1); return c; } static void fd_outb(unsigned char value, unsigned int port) { *(volatile unsigned char *) port = value; } /* * How to access the floppy DMA functions. */ static void fd_enable_dma(void) { vdma_enable(JAZZ_FLOPPY_DMA); } static void fd_disable_dma(void) { vdma_disable(JAZZ_FLOPPY_DMA); } static int fd_request_dma(void) { return 0; } static void fd_free_dma(void) { } static void fd_clear_dma_ff(void) { } static void fd_set_dma_mode(char mode) { vdma_set_mode(JAZZ_FLOPPY_DMA, mode); } static void fd_set_dma_addr(unsigned int a) { vdma_set_addr(JAZZ_FLOPPY_DMA, vdma_phys2log(PHYSADDR(a))); } static void fd_set_dma_count(unsigned int count) { vdma_set_count(JAZZ_FLOPPY_DMA, count); } static int fd_get_dma_residue(void) { return vdma_get_residue(JAZZ_FLOPPY_DMA); } static void fd_enable_irq(void) { } static void fd_disable_irq(void) { } void jazz_fd_cacheflush(const void *addr, size_t size) { flush_cache_all(); } static unsigned char rtc_read_data(unsigned long addr) { outb_p(addr, RTC_PORT(0)); return *(char *)JAZZ_RTC_BASE; } static void rtc_write_data(unsigned char data, unsigned long addr) { outb_p(addr, RTC_PORT(0)); *(char *)JAZZ_RTC_BASE = data; } struct feature jazz_feature = { /* * How to access the floppy controller's ports */ fd_inb, fd_outb, /* * How to access the floppy DMA functions. */ fd_enable_dma, fd_disable_dma, fd_request_dma, fd_free_dma, fd_clear_dma_ff, fd_set_dma_mode, fd_set_dma_addr, fd_set_dma_count, fd_get_dma_residue, fd_enable_irq, fd_disable_irq, /* * How to access the RTC functions. */ rtc_read_data, rtc_write_data }; |