Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the flashrom project. |
| 3 | * |
| 4 | * Copyright (C) 2009 Carl-Daniel Hailfinger |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Uwe Hermann | 4395970 | 2010-03-13 17:28:29 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | /* |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 21 | * Header file for hardware access and OS abstraction. Included from flash.h. |
| 22 | */ |
| 23 | |
| 24 | #ifndef __HWACCESS_H__ |
| 25 | #define __HWACCESS_H__ 1 |
| 26 | |
Carl-Daniel Hailfinger | cceafa2 | 2010-05-26 01:45:41 +0000 | [diff] [blame] | 27 | #if defined (__i386__) || defined (__x86_64__) |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 28 | #if defined(__GLIBC__) |
| 29 | #include <sys/io.h> |
| 30 | #endif |
Carl-Daniel Hailfinger | cceafa2 | 2010-05-26 01:45:41 +0000 | [diff] [blame] | 31 | #endif |
| 32 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 33 | #if NEED_PCI == 1 |
Carl-Daniel Hailfinger | 7237683 | 2010-06-25 13:18:48 +0000 | [diff] [blame] | 34 | /* |
| 35 | * libpci headers use the variable name "index" which triggers shadowing |
| 36 | * warnings on systems which have the index() function in a default #include |
| 37 | * or as builtin. |
| 38 | */ |
| 39 | #define index shadow_workaround_index |
Stefan Tauner | c65b855 | 2013-09-12 15:48:39 +0000 | [diff] [blame] | 40 | |
| 41 | #if !defined (__NetBSD__) && !defined (__DragonFly__) |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 42 | #include <pci/pci.h> |
Stefan Tauner | c65b855 | 2013-09-12 15:48:39 +0000 | [diff] [blame] | 43 | #else |
| 44 | #include <pciutils/pci.h> |
| 45 | #endif |
| 46 | |
Carl-Daniel Hailfinger | 7237683 | 2010-06-25 13:18:48 +0000 | [diff] [blame] | 47 | #undef index |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 48 | #endif |
| 49 | |
Carl-Daniel Hailfinger | cceafa2 | 2010-05-26 01:45:41 +0000 | [diff] [blame] | 50 | #if defined (__i386__) || defined (__x86_64__) |
| 51 | |
| 52 | /* All x86 is little-endian. */ |
| 53 | #define __FLASHROM_LITTLE_ENDIAN__ 1 |
| 54 | |
| 55 | #elif defined (__mips) || defined (__mips__) || defined (_mips) || defined (mips) |
| 56 | |
| 57 | /* MIPS can be either endian. */ |
| 58 | #if defined (__MIPSEL) || defined (__MIPSEL__) || defined (_MIPSEL) || defined (MIPSEL) |
| 59 | #define __FLASHROM_LITTLE_ENDIAN__ 1 |
| 60 | #elif defined (__MIPSEB) || defined (__MIPSEB__) || defined (_MIPSEB) || defined (MIPSEB) |
| 61 | #define __FLASHROM_BIG_ENDIAN__ 1 |
| 62 | #endif |
| 63 | |
| 64 | #elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__) |
| 65 | |
| 66 | /* PowerPC can be either endian. */ |
| 67 | #if defined (_BIG_ENDIAN) || defined (__BIG_ENDIAN__) |
| 68 | #define __FLASHROM_BIG_ENDIAN__ 1 |
| 69 | /* Error checking in case some weird header has #defines for LE as well. */ |
| 70 | #if defined (_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) |
| 71 | #error Conflicting endianness #define |
| 72 | #endif |
| 73 | #else |
| 74 | #error Little-endian PowerPC #defines are unknown |
| 75 | #endif |
| 76 | |
David Hendricks | b286da7 | 2012-02-13 00:35:35 +0000 | [diff] [blame] | 77 | #elif defined (__arm__) |
| 78 | #if defined (__ARMEL__) |
| 79 | #define __FLASHROM_LITTLE_ENDIAN__ 1 |
| 80 | #else |
| 81 | #error Big-endian ARM #defines are unknown |
| 82 | #endif |
| 83 | |
Carl-Daniel Hailfinger | cceafa2 | 2010-05-26 01:45:41 +0000 | [diff] [blame] | 84 | #endif |
| 85 | |
| 86 | #if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__) |
| 87 | /* Nonstandard libc-specific macros for determining endianness. */ |
| 88 | #if defined(__GLIBC__) |
| 89 | #include <endian.h> |
| 90 | #if BYTE_ORDER == LITTLE_ENDIAN |
| 91 | #define __FLASHROM_LITTLE_ENDIAN__ 1 |
| 92 | #elif BYTE_ORDER == BIG_ENDIAN |
| 93 | #define __FLASHROM_BIG_ENDIAN__ 1 |
| 94 | #endif |
| 95 | #endif |
| 96 | #endif |
| 97 | |
| 98 | #if !defined (__FLASHROM_BIG_ENDIAN__) && !defined (__FLASHROM_LITTLE_ENDIAN__) |
| 99 | #error Unable to determine endianness. Please add support for your arch or libc. |
| 100 | #endif |
| 101 | |
| 102 | #define ___constant_swab8(x) ((uint8_t) ( \ |
| 103 | (((uint8_t)(x) & (uint8_t)0xffU)))) |
| 104 | |
| 105 | #define ___constant_swab16(x) ((uint16_t) ( \ |
| 106 | (((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \ |
| 107 | (((uint16_t)(x) & (uint16_t)0xff00U) >> 8))) |
| 108 | |
| 109 | #define ___constant_swab32(x) ((uint32_t) ( \ |
| 110 | (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \ |
| 111 | (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \ |
| 112 | (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \ |
| 113 | (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24))) |
| 114 | |
| 115 | #define ___constant_swab64(x) ((uint64_t) ( \ |
| 116 | (((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \ |
| 117 | (((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \ |
| 118 | (((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \ |
| 119 | (((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \ |
| 120 | (((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \ |
| 121 | (((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \ |
| 122 | (((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \ |
| 123 | (((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56))) |
| 124 | |
| 125 | #if defined (__FLASHROM_BIG_ENDIAN__) |
| 126 | |
| 127 | #define cpu_to_le(bits) \ |
| 128 | static inline uint##bits##_t cpu_to_le##bits(uint##bits##_t val) \ |
| 129 | { \ |
| 130 | return ___constant_swab##bits(val); \ |
| 131 | } |
| 132 | |
| 133 | cpu_to_le(8) |
| 134 | cpu_to_le(16) |
| 135 | cpu_to_le(32) |
| 136 | cpu_to_le(64) |
| 137 | |
| 138 | #define cpu_to_be8 |
| 139 | #define cpu_to_be16 |
| 140 | #define cpu_to_be32 |
| 141 | #define cpu_to_be64 |
| 142 | |
| 143 | #elif defined (__FLASHROM_LITTLE_ENDIAN__) |
| 144 | |
| 145 | #define cpu_to_be(bits) \ |
| 146 | static inline uint##bits##_t cpu_to_be##bits(uint##bits##_t val) \ |
| 147 | { \ |
| 148 | return ___constant_swab##bits(val); \ |
| 149 | } |
| 150 | |
| 151 | cpu_to_be(8) |
| 152 | cpu_to_be(16) |
| 153 | cpu_to_be(32) |
| 154 | cpu_to_be(64) |
| 155 | |
| 156 | #define cpu_to_le8 |
| 157 | #define cpu_to_le16 |
| 158 | #define cpu_to_le32 |
| 159 | #define cpu_to_le64 |
| 160 | |
| 161 | #else |
| 162 | |
| 163 | #error Could not determine endianness. |
| 164 | |
| 165 | #endif |
| 166 | |
| 167 | #define be_to_cpu8 cpu_to_be8 |
| 168 | #define be_to_cpu16 cpu_to_be16 |
| 169 | #define be_to_cpu32 cpu_to_be32 |
| 170 | #define be_to_cpu64 cpu_to_be64 |
| 171 | #define le_to_cpu8 cpu_to_le8 |
| 172 | #define le_to_cpu16 cpu_to_le16 |
| 173 | #define le_to_cpu32 cpu_to_le32 |
| 174 | #define le_to_cpu64 cpu_to_le64 |
| 175 | |
Carl-Daniel Hailfinger | 41bea03 | 2010-07-29 13:17:37 +0000 | [diff] [blame] | 176 | #if NEED_PCI == 1 |
Carl-Daniel Hailfinger | cceafa2 | 2010-05-26 01:45:41 +0000 | [diff] [blame] | 177 | #if defined (__i386__) || defined (__x86_64__) |
| 178 | |
| 179 | #define __FLASHROM_HAVE_OUTB__ 1 |
| 180 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 181 | /* for iopl and outb under Solaris */ |
| 182 | #if defined (__sun) && (defined(__i386) || defined(__amd64)) |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 183 | #include <sys/sysi86.h> |
| 184 | #include <sys/psw.h> |
| 185 | #include <asm/sunddi.h> |
| 186 | #endif |
| 187 | |
Carl-Daniel Hailfinger | 0d974e7 | 2010-07-17 12:54:09 +0000 | [diff] [blame] | 188 | /* Clarification about OUTB/OUTW/OUTL argument order: |
| 189 | * OUT[BWL](val, port) |
| 190 | */ |
| 191 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 192 | #if defined(__FreeBSD__) || defined(__DragonFly__) |
Carl-Daniel Hailfinger | a5eecda | 2012-02-25 22:50:21 +0000 | [diff] [blame] | 193 | /* Note that Debian/kFreeBSD (FreeBSD kernel with glibc) has conflicting |
| 194 | * out[bwl] definitions in machine/cpufunc.h and sys/io.h at least in some |
| 195 | * versions. Use machine/cpufunc.h only for plain FreeBSD/DragonFlyBSD. |
| 196 | */ |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 197 | #include <machine/cpufunc.h> |
Michael Karcher | e7f3209 | 2010-01-12 15:36:24 +0000 | [diff] [blame] | 198 | #define OUTB(x, y) do { u_int outb_tmp = (y); outb(outb_tmp, (x)); } while (0) |
| 199 | #define OUTW(x, y) do { u_int outw_tmp = (y); outw(outw_tmp, (x)); } while (0) |
| 200 | #define OUTL(x, y) do { u_int outl_tmp = (y); outl(outl_tmp, (x)); } while (0) |
| 201 | #define INB(x) __extension__ ({ u_int inb_tmp = (x); inb(inb_tmp); }) |
| 202 | #define INW(x) __extension__ ({ u_int inw_tmp = (x); inw(inw_tmp); }) |
| 203 | #define INL(x) __extension__ ({ u_int inl_tmp = (x); inl(inl_tmp); }) |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 204 | #else |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 205 | #if defined(__MACH__) && defined(__APPLE__) |
Carl-Daniel Hailfinger | f992c19 | 2010-10-06 23:16:10 +0000 | [diff] [blame] | 206 | /* Header is part of the DirectHW library. */ |
Stefan Reinauer | 83704c5 | 2011-03-18 22:00:15 +0000 | [diff] [blame] | 207 | #include <DirectHW/DirectHW.h> |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 208 | #endif |
| 209 | #if defined (__sun) && (defined(__i386) || defined(__amd64)) |
| 210 | /* Note different order for outb */ |
| 211 | #define OUTB(x,y) outb(y, x) |
| 212 | #define OUTW(x,y) outw(y, x) |
| 213 | #define OUTL(x,y) outl(y, x) |
| 214 | #define INB inb |
| 215 | #define INW inw |
| 216 | #define INL inl |
| 217 | #else |
Rudolf Marek | 03ae5c1 | 2010-03-16 23:59:19 +0000 | [diff] [blame] | 218 | |
| 219 | #ifdef __DJGPP__ |
| 220 | |
| 221 | #include <pc.h> |
| 222 | |
| 223 | #define OUTB(x,y) outportb(y, x) |
| 224 | #define OUTW(x,y) outportw(y, x) |
| 225 | #define OUTL(x,y) outportl(y, x) |
| 226 | |
| 227 | #define INB inportb |
| 228 | #define INW inportw |
| 229 | #define INL inportl |
| 230 | |
Uwe Hermann | 91f4afa | 2011-07-28 08:13:25 +0000 | [diff] [blame] | 231 | #else |
Carl-Daniel Hailfinger | a5eecda | 2012-02-25 22:50:21 +0000 | [diff] [blame] | 232 | /* This is the usual glibc interface. */ |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 233 | #define OUTB outb |
| 234 | #define OUTW outw |
| 235 | #define OUTL outl |
| 236 | #define INB inb |
| 237 | #define INW inw |
| 238 | #define INL inl |
Rudolf Marek | 03ae5c1 | 2010-03-16 23:59:19 +0000 | [diff] [blame] | 239 | |
| 240 | #endif |
| 241 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 242 | #endif |
| 243 | #endif |
| 244 | |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 245 | #if defined(__NetBSD__) || defined (__OpenBSD__) |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 246 | #if defined(__i386__) || defined(__x86_64__) |
| 247 | #include <sys/types.h> |
| 248 | #include <machine/sysarch.h> |
Stefan Tauner | 0554ca5 | 2013-07-25 22:54:25 +0000 | [diff] [blame] | 249 | #if defined(__NetBSD__) |
| 250 | #if defined(__i386__) |
| 251 | #define iopl i386_iopl |
| 252 | #elif defined(__x86_64__) |
| 253 | #define iopl x86_64_iopl |
| 254 | #endif |
| 255 | #elif defined (__OpenBSD__) |
| 256 | #if defined(__i386__) |
| 257 | #define iopl i386_iopl |
| 258 | #elif defined(__amd64__) |
| 259 | #define iopl amd64_iopl |
| 260 | #endif |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 261 | #endif |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 262 | |
Uwe Hermann | 4395970 | 2010-03-13 17:28:29 +0000 | [diff] [blame] | 263 | static inline void outb(uint8_t value, uint16_t port) |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 264 | { |
Carl-Daniel Hailfinger | 1c6d2ff | 2012-08-27 00:44:42 +0000 | [diff] [blame] | 265 | __asm__ volatile ("outb %b0,%w1": :"a" (value), "Nd" (port)); |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 266 | } |
| 267 | |
Uwe Hermann | 4395970 | 2010-03-13 17:28:29 +0000 | [diff] [blame] | 268 | static inline uint8_t inb(uint16_t port) |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 269 | { |
| 270 | uint8_t value; |
Carl-Daniel Hailfinger | 1c6d2ff | 2012-08-27 00:44:42 +0000 | [diff] [blame] | 271 | __asm__ volatile ("inb %w1,%0":"=a" (value):"Nd" (port)); |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 272 | return value; |
| 273 | } |
| 274 | |
Uwe Hermann | 4395970 | 2010-03-13 17:28:29 +0000 | [diff] [blame] | 275 | static inline void outw(uint16_t value, uint16_t port) |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 276 | { |
Carl-Daniel Hailfinger | 1c6d2ff | 2012-08-27 00:44:42 +0000 | [diff] [blame] | 277 | __asm__ volatile ("outw %w0,%w1": :"a" (value), "Nd" (port)); |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 278 | } |
| 279 | |
Uwe Hermann | 4395970 | 2010-03-13 17:28:29 +0000 | [diff] [blame] | 280 | static inline uint16_t inw(uint16_t port) |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 281 | { |
| 282 | uint16_t value; |
Carl-Daniel Hailfinger | 1c6d2ff | 2012-08-27 00:44:42 +0000 | [diff] [blame] | 283 | __asm__ volatile ("inw %w1,%0":"=a" (value):"Nd" (port)); |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 284 | return value; |
| 285 | } |
| 286 | |
Uwe Hermann | 4395970 | 2010-03-13 17:28:29 +0000 | [diff] [blame] | 287 | static inline void outl(uint32_t value, uint16_t port) |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 288 | { |
Carl-Daniel Hailfinger | 1c6d2ff | 2012-08-27 00:44:42 +0000 | [diff] [blame] | 289 | __asm__ volatile ("outl %0,%w1": :"a" (value), "Nd" (port)); |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 290 | } |
| 291 | |
Uwe Hermann | 4395970 | 2010-03-13 17:28:29 +0000 | [diff] [blame] | 292 | static inline uint32_t inl(uint16_t port) |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 293 | { |
| 294 | uint32_t value; |
Carl-Daniel Hailfinger | 1c6d2ff | 2012-08-27 00:44:42 +0000 | [diff] [blame] | 295 | __asm__ volatile ("inl %1,%0":"=a" (value):"Nd" (port)); |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 296 | return value; |
| 297 | } |
| 298 | #endif |
| 299 | #endif |
| 300 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 301 | #if !(defined(__MACH__) && defined(__APPLE__)) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__DragonFly__) && !defined(__LIBPAYLOAD__) |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 302 | typedef struct { uint32_t hi, lo; } msr_t; |
| 303 | msr_t rdmsr(int addr); |
| 304 | int wrmsr(int addr, msr_t msr); |
| 305 | #endif |
Carl-Daniel Hailfinger | a5eecda | 2012-02-25 22:50:21 +0000 | [diff] [blame] | 306 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 307 | /* FreeBSD already has conflicting definitions for wrmsr/rdmsr. */ |
| 308 | #undef rdmsr |
| 309 | #undef wrmsr |
| 310 | #define rdmsr freebsd_rdmsr |
| 311 | #define wrmsr freebsd_wrmsr |
| 312 | typedef struct { uint32_t hi, lo; } msr_t; |
| 313 | msr_t freebsd_rdmsr(int addr); |
| 314 | int freebsd_wrmsr(int addr, msr_t msr); |
| 315 | #endif |
Patrick Georgi | a9095a9 | 2010-09-30 17:03:32 +0000 | [diff] [blame] | 316 | #if defined(__LIBPAYLOAD__) |
| 317 | #include <arch/io.h> |
| 318 | #include <arch/msr.h> |
| 319 | typedef struct { uint32_t hi, lo; } msr_t; |
| 320 | msr_t libpayload_rdmsr(int addr); |
| 321 | int libpayload_wrmsr(int addr, msr_t msr); |
| 322 | #undef rdmsr |
| 323 | #define rdmsr libpayload_rdmsr |
| 324 | #define wrmsr libpayload_wrmsr |
| 325 | #endif |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 326 | |
Carl-Daniel Hailfinger | cceafa2 | 2010-05-26 01:45:41 +0000 | [diff] [blame] | 327 | #elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__) |
| 328 | |
| 329 | /* PCI port I/O is not yet implemented on PowerPC. */ |
| 330 | |
| 331 | #elif defined (__mips) || defined (__mips__) || defined (_mips) || defined (mips) |
| 332 | |
| 333 | /* PCI port I/O is not yet implemented on MIPS. */ |
| 334 | |
David Hendricks | b286da7 | 2012-02-13 00:35:35 +0000 | [diff] [blame] | 335 | #elif defined(__arm__) |
| 336 | |
| 337 | /* Non memory mapped I/O is not supported on ARM. */ |
| 338 | |
Carl-Daniel Hailfinger | cceafa2 | 2010-05-26 01:45:41 +0000 | [diff] [blame] | 339 | #else |
| 340 | |
| 341 | #error Unknown architecture, please check if it supports PCI port IO. |
| 342 | |
| 343 | #endif |
Carl-Daniel Hailfinger | 41bea03 | 2010-07-29 13:17:37 +0000 | [diff] [blame] | 344 | #endif |
Carl-Daniel Hailfinger | cceafa2 | 2010-05-26 01:45:41 +0000 | [diff] [blame] | 345 | |
Carl-Daniel Hailfinger | 5d5c072 | 2009-12-14 03:32:24 +0000 | [diff] [blame] | 346 | #endif /* !__HWACCESS_H__ */ |