diff options
author | Hirokazu Takata <takata@linux-m32r.org> | 2006-01-06 03:18:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:44 -0500 |
commit | 46ea178b7a5162405bf70954d769165cf2161309 (patch) | |
tree | d757c796068a38ffa8c2b793233805c9b0120cde /arch/m32r/kernel/io_mappi3.c | |
parent | 1b5b776aa5730cbda9cba84ba0f8ccd53a775797 (diff) |
[PATCH] m32r: Update _port2addr to use NONCACHE_OFFSET
Modify _port2addr*() routines in arch/m32r/kernel/io_*.c to use
NONCACHE_OFFSET instead of hard-coding of a constant address.
This modification is also required to support an M3A-ZA36 FPGA eva board in
case an MMU-less synthesizable m32r core is used.
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m32r/kernel/io_mappi3.c')
-rw-r--r-- | arch/m32r/kernel/io_mappi3.c | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/arch/m32r/kernel/io_mappi3.c b/arch/m32r/kernel/io_mappi3.c index f80321a58764..ed6da930bc64 100644 --- a/arch/m32r/kernel/io_mappi3.c +++ b/arch/m32r/kernel/io_mappi3.c | |||
@@ -33,7 +33,7 @@ extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); | |||
33 | 33 | ||
34 | static inline void *_port2addr(unsigned long port) | 34 | static inline void *_port2addr(unsigned long port) |
35 | { | 35 | { |
36 | return (void *)(port + NONCACHE_OFFSET); | 36 | return (void *)(port | NONCACHE_OFFSET); |
37 | } | 37 | } |
38 | 38 | ||
39 | #if defined(CONFIG_IDE) | 39 | #if defined(CONFIG_IDE) |
@@ -43,33 +43,42 @@ static inline void *__port2addr_ata(unsigned long port) | |||
43 | 43 | ||
44 | switch (port) { | 44 | switch (port) { |
45 | /* IDE0 CF */ | 45 | /* IDE0 CF */ |
46 | case 0x1f0: return (void *)0xb4002000; | 46 | case 0x1f0: return (void *)(0x14002000 | NONCACHE_OFFSET); |
47 | case 0x1f1: return (void *)0xb4012800; | 47 | case 0x1f1: return (void *)(0x14012800 | NONCACHE_OFFSET); |
48 | case 0x1f2: return (void *)0xb4012002; | 48 | case 0x1f2: return (void *)(0x14012002 | NONCACHE_OFFSET); |
49 | case 0x1f3: return (void *)0xb4012802; | 49 | case 0x1f3: return (void *)(0x14012802 | NONCACHE_OFFSET); |
50 | case 0x1f4: return (void *)0xb4012004; | 50 | case 0x1f4: return (void *)(0x14012004 | NONCACHE_OFFSET); |
51 | case 0x1f5: return (void *)0xb4012804; | 51 | case 0x1f5: return (void *)(0x14012804 | NONCACHE_OFFSET); |
52 | case 0x1f6: return (void *)0xb4012006; | 52 | case 0x1f6: return (void *)(0x14012006 | NONCACHE_OFFSET); |
53 | case 0x1f7: return (void *)0xb4012806; | 53 | case 0x1f7: return (void *)(0x14012806 | NONCACHE_OFFSET); |
54 | case 0x3f6: return (void *)0xb401200e; | 54 | case 0x3f6: return (void *)(0x1401200e | NONCACHE_OFFSET); |
55 | /* IDE1 IDE */ | 55 | /* IDE1 IDE */ |
56 | case 0x170: return (void *)0xb4810000; /* Data 16bit */ | 56 | case 0x170: /* Data 16bit */ |
57 | case 0x171: return (void *)0xb4810002; /* Features / Error */ | 57 | return (void *)(0x14810000 | NONCACHE_OFFSET); |
58 | case 0x172: return (void *)0xb4810004; /* Sector count */ | 58 | case 0x171: /* Features / Error */ |
59 | case 0x173: return (void *)0xb4810006; /* Sector number */ | 59 | return (void *)(0x14810002 | NONCACHE_OFFSET); |
60 | case 0x174: return (void *)0xb4810008; /* Cylinder low */ | 60 | case 0x172: /* Sector count */ |
61 | case 0x175: return (void *)0xb481000a; /* Cylinder high */ | 61 | return (void *)(0x14810004 | NONCACHE_OFFSET); |
62 | case 0x176: return (void *)0xb481000c; /* Device head */ | 62 | case 0x173: /* Sector number */ |
63 | case 0x177: return (void *)0xb481000e; /* Command */ | 63 | return (void *)(0x14810006 | NONCACHE_OFFSET); |
64 | case 0x376: return (void *)0xb480800c; /* Device control / Alt status */ | 64 | case 0x174: /* Cylinder low */ |
65 | return (void *)(0x14810008 | NONCACHE_OFFSET); | ||
66 | case 0x175: /* Cylinder high */ | ||
67 | return (void *)(0x1481000a | NONCACHE_OFFSET); | ||
68 | case 0x176: /* Device head */ | ||
69 | return (void *)(0x1481000c | NONCACHE_OFFSET); | ||
70 | case 0x177: /* Command */ | ||
71 | return (void *)(0x1481000e | NONCACHE_OFFSET); | ||
72 | case 0x376: /* Device control / Alt status */ | ||
73 | return (void *)(0x1480800c | NONCACHE_OFFSET); | ||
65 | 74 | ||
66 | default: return (void *)&dummy_reg; | 75 | default: return (void *)&dummy_reg; |
67 | } | 76 | } |
68 | } | 77 | } |
69 | #endif | 78 | #endif |
70 | 79 | ||
71 | #define LAN_IOSTART 0xa0000300 | 80 | #define LAN_IOSTART (0x300 | NONCACHE_OFFSET) |
72 | #define LAN_IOEND 0xa0000320 | 81 | #define LAN_IOEND (0x320 | NONCACHE_OFFSET) |
73 | static inline void *_port2addr_ne(unsigned long port) | 82 | static inline void *_port2addr_ne(unsigned long port) |
74 | { | 83 | { |
75 | return (void *)(port + 0x10000000); | 84 | return (void *)(port + 0x10000000); |