kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 1 | /* |
| 2 | * arch/sh/boards/landisk/io.c |
| 3 | * |
| 4 | * Copyright (C) 2001 Ian da Silva, Jeremy Siegel |
| 5 | * Based largely on io_se.c. |
| 6 | * |
| 7 | * I/O routine for I-O Data Device, Inc. LANDISK. |
| 8 | * |
| 9 | * Initial version only to support LAN access; some |
| 10 | * placeholder code from io_landisk.c left in with the |
| 11 | * expectation of later SuperIO and PCMCIA access. |
| 12 | */ |
| 13 | /* |
| 14 | * modifed by kogiidena |
| 15 | * 2005.03.03 |
| 16 | */ |
| 17 | |
| 18 | #include <linux/kernel.h> |
| 19 | #include <linux/types.h> |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 20 | #include <asm/landisk/iodata_landisk.h> |
| 21 | #include <asm/addrspace.h> |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 22 | #include <asm/io.h> |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 23 | |
| 24 | #include <linux/module.h> |
| 25 | #include <linux/pci.h> |
| 26 | #include "../../drivers/pci/pci-sh7751.h" |
| 27 | |
| 28 | extern void *area5_io_base; /* Area 5 I/O Base address */ |
| 29 | extern void *area6_io_base; /* Area 6 I/O Base address */ |
| 30 | |
| 31 | /* |
| 32 | * The 7751R LANDISK uses the built-in PCI controller (PCIC) |
| 33 | * of the 7751R processor, and has a SuperIO accessible via the PCI. |
| 34 | * The board also includes a PCMCIA controller on its memory bus, |
| 35 | * like the other Solution Engine boards. |
| 36 | */ |
| 37 | |
| 38 | #define PCIIOBR (volatile long *)PCI_REG(SH7751_PCIIOBR) |
| 39 | #define PCIMBR (volatile long *)PCI_REG(SH7751_PCIMBR) |
| 40 | #define PCI_IO_AREA SH7751_PCI_IO_BASE |
| 41 | #define PCI_MEM_AREA SH7751_PCI_CONFIG_BASE |
| 42 | |
| 43 | #define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK)) |
| 44 | |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 45 | static inline void delay(void) |
| 46 | { |
| 47 | ctrl_inw(0xa0000000); |
| 48 | } |
| 49 | |
| 50 | static inline unsigned long port2adr(unsigned int port) |
| 51 | { |
| 52 | if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6) |
| 53 | if (port == 0x3f6) |
| 54 | return ((unsigned long)area5_io_base + 0x2c); |
| 55 | else |
| 56 | return ((unsigned long)area5_io_base + PA_PIDE_OFFSET + |
| 57 | ((port - 0x1f0) << 1)); |
| 58 | else if ((0x170 <= port && port < 0x178) || port == 0x376) |
| 59 | if (port == 0x376) |
| 60 | return ((unsigned long)area6_io_base + 0x2c); |
| 61 | else |
| 62 | return ((unsigned long)area6_io_base + PA_SIDE_OFFSET + |
| 63 | ((port - 0x170) << 1)); |
| 64 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 65 | maybebadio((unsigned long)port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 66 | |
| 67 | return port; |
| 68 | } |
| 69 | |
| 70 | /* In case someone configures the kernel w/o PCI support: in that */ |
| 71 | /* scenario, don't ever bother to check for PCI-window addresses */ |
| 72 | |
| 73 | /* NOTE: WINDOW CHECK MAY BE A BIT OFF, HIGH PCIBIOS_MIN_IO WRAPS? */ |
| 74 | #if defined(CONFIG_PCI) |
| 75 | #define CHECK_SH7751_PCIIO(port) \ |
| 76 | ((port >= PCIBIOS_MIN_IO) && (port < (PCIBIOS_MIN_IO + SH7751_PCI_IO_SIZE))) |
| 77 | #else |
| 78 | #define CHECK_SH_7751_PCIIO(port) (0) |
| 79 | #endif |
| 80 | |
| 81 | /* |
| 82 | * General outline: remap really low stuff [eventually] to SuperIO, |
| 83 | * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO) |
| 84 | * is mapped through the PCI IO window. Stuff with high bits (PXSEG) |
| 85 | * should be way beyond the window, and is used w/o translation for |
| 86 | * compatibility. |
| 87 | */ |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 88 | u8 landisk_inb(unsigned long port) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 89 | { |
| 90 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 91 | return ctrl_inb(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 92 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 93 | return ctrl_inb(PCI_IOMAP(port)); |
| 94 | |
| 95 | return ctrl_inw(port2adr(port)) & 0xff; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 96 | } |
| 97 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 98 | u8 landisk_inb_p(unsigned long port) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 99 | { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 100 | u8 v; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 101 | |
| 102 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 103 | v = ctrl_inb(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 104 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 105 | v = ctrl_inb(PCI_IOMAP(port)); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 106 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 107 | v = ctrl_inw(port2adr(port)) & 0xff; |
| 108 | |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 109 | delay(); |
| 110 | |
| 111 | return v; |
| 112 | } |
| 113 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 114 | u16 landisk_inw(unsigned long port) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 115 | { |
| 116 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 117 | return ctrl_inw(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 118 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 119 | return ctrl_inw(PCI_IOMAP(port)); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 120 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 121 | maybebadio(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 122 | |
| 123 | return 0; |
| 124 | } |
| 125 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 126 | u32 landisk_inl(unsigned long port) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 127 | { |
| 128 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 129 | return ctrl_inl(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 130 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 131 | return ctrl_inl(PCI_IOMAP(port)); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 132 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 133 | maybebadio(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 134 | |
| 135 | return 0; |
| 136 | } |
| 137 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 138 | void landisk_outb(u8 value, unsigned long port) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 139 | { |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 140 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 141 | ctrl_outb(value, port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 142 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 143 | ctrl_outb(value, PCI_IOMAP(port)); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 144 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 145 | ctrl_outw(value, port2adr(port)); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 146 | } |
| 147 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 148 | void landisk_outb_p(u8 value, unsigned long port) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 149 | { |
| 150 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 151 | ctrl_outb(value, port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 152 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 153 | ctrl_outb(value, PCI_IOMAP(port)); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 154 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 155 | ctrl_outw(value, port2adr(port)); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 156 | delay(); |
| 157 | } |
| 158 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 159 | void landisk_outw(u16 value, unsigned long port) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 160 | { |
| 161 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 162 | ctrl_outw(value, port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 163 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 164 | ctrl_outw(value, PCI_IOMAP(port)); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 165 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 166 | maybebadio(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 167 | } |
| 168 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 169 | void landisk_outl(u32 value, unsigned long port) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 170 | { |
| 171 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 172 | ctrl_outl(value, port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 173 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 174 | ctrl_outl(value, PCI_IOMAP(port)); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 175 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 176 | maybebadio(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 177 | } |
| 178 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 179 | void landisk_insb(unsigned long port, void *dst, unsigned long count) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 180 | { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 181 | volatile u16 *p; |
| 182 | u8 *buf = dst; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 183 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 184 | if (PXSEG(port)) { |
| 185 | while (count--) |
| 186 | *buf++ = *(volatile u8 *)port; |
| 187 | } else if (CHECK_SH7751_PCIIO(port)) { |
| 188 | volatile u8 *bp = (volatile u8 *)PCI_IOMAP(port); |
| 189 | |
| 190 | while (count--) |
| 191 | *buf++ = *bp; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 192 | } else { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 193 | p = (volatile u16 *)port2adr(port); |
| 194 | while (count--) |
| 195 | *buf++ = *p & 0xff; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 196 | } |
| 197 | } |
| 198 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 199 | void landisk_insw(unsigned long port, void *dst, unsigned long count) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 200 | { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 201 | volatile u16 *p; |
| 202 | u16 *buf = dst; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 203 | |
| 204 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 205 | p = (volatile u16 *)port; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 206 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 207 | p = (volatile u16 *)PCI_IOMAP(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 208 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 209 | p = (volatile u16 *)port2adr(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 210 | while (count--) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 211 | *buf++ = *p; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 212 | } |
| 213 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 214 | void landisk_insl(unsigned long port, void *dst, unsigned long count) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 215 | { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 216 | u32 *buf = dst; |
| 217 | |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 218 | if (CHECK_SH7751_PCIIO(port)) { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 219 | volatile u32 *p = (volatile u32 *)PCI_IOMAP(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 220 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 221 | while (count--) |
| 222 | *buf++ = *p; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 223 | } else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 224 | maybebadio(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 225 | } |
| 226 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 227 | void landisk_outsb(unsigned long port, const void *src, unsigned long count) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 228 | { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 229 | volatile u16 *p; |
| 230 | const u8 *buf = src; |
| 231 | |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 232 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 233 | while (count--) |
| 234 | ctrl_outb(*buf++, port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 235 | else if (CHECK_SH7751_PCIIO(port)) { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 236 | volatile u8 *bp = (volatile u8 *)PCI_IOMAP(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 237 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 238 | while (count--) |
| 239 | *bp = *buf++; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 240 | } else { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 241 | p = (volatile u16 *)port2adr(port); |
| 242 | while (count--) |
| 243 | *p = *buf++; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 244 | } |
| 245 | } |
| 246 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 247 | void landisk_outsw(unsigned long port, const void *src, unsigned long count) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 248 | { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 249 | volatile u16 *p; |
| 250 | const u16 *buf = src; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 251 | |
| 252 | if (PXSEG(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 253 | p = (volatile u16 *)port; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 254 | else if (CHECK_SH7751_PCIIO(port)) |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 255 | p = (volatile u16 *)PCI_IOMAP(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 256 | else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 257 | p = (volatile u16 *)port2adr(port); |
| 258 | |
| 259 | while (count--) |
| 260 | *p = *buf++; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 261 | } |
| 262 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 263 | void landisk_outsl(unsigned long port, const void *src, unsigned long count) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 264 | { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 265 | const u32 *buf = src; |
| 266 | |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 267 | if (CHECK_SH7751_PCIIO(port)) { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 268 | volatile u32 *p = (volatile u32 *)PCI_IOMAP(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 269 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 270 | while (count--) |
| 271 | *p = *buf++; |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 272 | } else |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 273 | maybebadio(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 274 | } |
| 275 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 276 | void __iomem *landisk_ioport_map(unsigned long port, unsigned int size) |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 277 | { |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 278 | if (PXSEG(port)) |
| 279 | return (void __iomem *)port; |
| 280 | else if (CHECK_SH7751_PCIIO(port)) |
| 281 | return (void __iomem *)PCI_IOMAP(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 282 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame^] | 283 | return (void __iomem *)port2adr(port); |
kogiidena | 94c0fa5 | 2006-09-27 14:53:35 +0900 | [diff] [blame] | 284 | } |