diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:54:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:54:07 -0500 |
commit | 541ef5cbb8e68189d47272cea52a69abc30259bc (patch) | |
tree | 09c871320e6918ebb9b642a632971b364684d8a3 | |
parent | 0191b625ca5a46206d2fb862bb08f36f2fcb3b31 (diff) | |
parent | aa6eeeef78263e9891185c6cfaaf64808460a54a (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
m68k: use the new byteorder headers
fbcon: Protect free_irq() by MACH_IS_ATARI check
fbcon: remove broken mac vbl handler
m68k: fix trigraph ignored warning in setox.S
macfb annotations and compiler warning fix
m68k: mac baboon interrupt enable/disable
m68k: machw.h cleanup
m68k: Mac via cleanup and commentry
m68k: Reinstate mac rtc
-rw-r--r-- | arch/m68k/fpsp040/setox.S | 4 | ||||
-rw-r--r-- | arch/m68k/mac/baboon.c | 42 | ||||
-rw-r--r-- | arch/m68k/mac/config.c | 3 | ||||
-rw-r--r-- | arch/m68k/mac/debug.c | 1 | ||||
-rw-r--r-- | arch/m68k/mac/macints.c | 9 | ||||
-rw-r--r-- | arch/m68k/mac/misc.c | 16 | ||||
-rw-r--r-- | arch/m68k/mac/oss.c | 1 | ||||
-rw-r--r-- | arch/m68k/mac/via.c | 80 | ||||
-rw-r--r-- | drivers/ide/macide.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/via-cuda.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/via-macii.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/via-maciisi.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu68k.c | 1 | ||||
-rw-r--r-- | drivers/scsi/mac_scsi.c | 1 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 78 | ||||
-rw-r--r-- | drivers/video/macfb.c | 33 | ||||
-rw-r--r-- | include/asm-m68k/byteorder.h | 16 | ||||
-rw-r--r-- | include/asm-m68k/machw.h | 22 |
18 files changed, 105 insertions, 206 deletions
diff --git a/arch/m68k/fpsp040/setox.S b/arch/m68k/fpsp040/setox.S index 145af5447581..f1acf7e36d6b 100644 --- a/arch/m68k/fpsp040/setox.S +++ b/arch/m68k/fpsp040/setox.S | |||
@@ -36,9 +36,9 @@ | |||
36 | | depending on their values, the program may run faster or slower -- | 36 | | depending on their values, the program may run faster or slower -- |
37 | | but no worse than 10% slower even in the extreme cases. | 37 | | but no worse than 10% slower even in the extreme cases. |
38 | | | 38 | | |
39 | | The program setoxm1 takes approximately ???/??? cycles for input | 39 | | The program setoxm1 takes approximately ??? / ??? cycles for input |
40 | | argument X, 0.25 <= |X| < 70log2. For |X| < 0.25, it takes | 40 | | argument X, 0.25 <= |X| < 70log2. For |X| < 0.25, it takes |
41 | | approximately ???/??? cycles. For the less common arguments, | 41 | | approximately ??? / ??? cycles. For the less common arguments, |
42 | | depending on their values, the program may run faster or slower -- | 42 | | depending on their values, the program may run faster or slower -- |
43 | | but no worse than 10% slower even in the extreme cases. | 43 | | but no worse than 10% slower even in the extreme cases. |
44 | | | 44 | | |
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index c7b25b0aacff..245d16d078ad 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c | |||
@@ -18,11 +18,14 @@ | |||
18 | #include <asm/macints.h> | 18 | #include <asm/macints.h> |
19 | #include <asm/mac_baboon.h> | 19 | #include <asm/mac_baboon.h> |
20 | 20 | ||
21 | /* #define DEBUG_BABOON */ | ||
22 | /* #define DEBUG_IRQS */ | 21 | /* #define DEBUG_IRQS */ |
23 | 22 | ||
23 | extern void mac_enable_irq(unsigned int); | ||
24 | extern void mac_disable_irq(unsigned int); | ||
25 | |||
24 | int baboon_present; | 26 | int baboon_present; |
25 | static volatile struct baboon *baboon; | 27 | static volatile struct baboon *baboon; |
28 | static unsigned char baboon_disabled; | ||
26 | 29 | ||
27 | #if 0 | 30 | #if 0 |
28 | extern int macide_ack_intr(struct ata_channel *); | 31 | extern int macide_ack_intr(struct ata_channel *); |
@@ -88,34 +91,51 @@ static irqreturn_t baboon_irq(int irq, void *dev_id) | |||
88 | 91 | ||
89 | void __init baboon_register_interrupts(void) | 92 | void __init baboon_register_interrupts(void) |
90 | { | 93 | { |
91 | request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, | 94 | baboon_disabled = 0; |
92 | "baboon", (void *) baboon); | 95 | request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon); |
93 | } | 96 | } |
94 | 97 | ||
95 | void baboon_irq_enable(int irq) { | 98 | /* |
99 | * The means for masking individual baboon interrupts remains a mystery, so | ||
100 | * enable the umbrella interrupt only when no baboon interrupt is disabled. | ||
101 | */ | ||
102 | |||
103 | void baboon_irq_enable(int irq) | ||
104 | { | ||
105 | int irq_idx = IRQ_IDX(irq); | ||
106 | |||
96 | #ifdef DEBUG_IRQUSE | 107 | #ifdef DEBUG_IRQUSE |
97 | printk("baboon_irq_enable(%d)\n", irq); | 108 | printk("baboon_irq_enable(%d)\n", irq); |
98 | #endif | 109 | #endif |
99 | /* FIXME: figure out how to mask and unmask baboon interrupt sources */ | 110 | |
100 | enable_irq(IRQ_NUBUS_C); | 111 | baboon_disabled &= ~(1 << irq_idx); |
112 | if (!baboon_disabled) | ||
113 | mac_enable_irq(IRQ_NUBUS_C); | ||
101 | } | 114 | } |
102 | 115 | ||
103 | void baboon_irq_disable(int irq) { | 116 | void baboon_irq_disable(int irq) |
117 | { | ||
118 | int irq_idx = IRQ_IDX(irq); | ||
119 | |||
104 | #ifdef DEBUG_IRQUSE | 120 | #ifdef DEBUG_IRQUSE |
105 | printk("baboon_irq_disable(%d)\n", irq); | 121 | printk("baboon_irq_disable(%d)\n", irq); |
106 | #endif | 122 | #endif |
107 | disable_irq(IRQ_NUBUS_C); | 123 | |
124 | baboon_disabled |= 1 << irq_idx; | ||
125 | if (baboon_disabled) | ||
126 | mac_disable_irq(IRQ_NUBUS_C); | ||
108 | } | 127 | } |
109 | 128 | ||
110 | void baboon_irq_clear(int irq) { | 129 | void baboon_irq_clear(int irq) |
111 | int irq_idx = IRQ_IDX(irq); | 130 | { |
131 | int irq_idx = IRQ_IDX(irq); | ||
112 | 132 | ||
113 | baboon->mb_ifr &= ~(1 << irq_idx); | 133 | baboon->mb_ifr &= ~(1 << irq_idx); |
114 | } | 134 | } |
115 | 135 | ||
116 | int baboon_irq_pending(int irq) | 136 | int baboon_irq_pending(int irq) |
117 | { | 137 | { |
118 | int irq_idx = IRQ_IDX(irq); | 138 | int irq_idx = IRQ_IDX(irq); |
119 | 139 | ||
120 | return baboon->mb_ifr & (1 << irq_idx); | 140 | return baboon->mb_ifr & (1 << irq_idx); |
121 | } | 141 | } |
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index c45e18449f32..8819b97be324 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
@@ -162,10 +162,7 @@ void __init config_mac(void) | |||
162 | mach_init_IRQ = mac_init_IRQ; | 162 | mach_init_IRQ = mac_init_IRQ; |
163 | mach_get_model = mac_get_model; | 163 | mach_get_model = mac_get_model; |
164 | mach_gettimeoffset = mac_gettimeoffset; | 164 | mach_gettimeoffset = mac_gettimeoffset; |
165 | #warning move to adb/via init | ||
166 | #if 0 | ||
167 | mach_hwclk = mac_hwclk; | 165 | mach_hwclk = mac_hwclk; |
168 | #endif | ||
169 | mach_set_clock_mmss = mac_set_clock_mmss; | 166 | mach_set_clock_mmss = mac_set_clock_mmss; |
170 | mach_reset = mac_reset; | 167 | mach_reset = mac_reset; |
171 | mach_halt = mac_poweroff; | 168 | mach_halt = mac_poweroff; |
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c index 2165740786a5..65dd77a742a3 100644 --- a/arch/m68k/mac/debug.c +++ b/arch/m68k/mac/debug.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #define BOOTINFO_COMPAT_1_0 | 24 | #define BOOTINFO_COMPAT_1_0 |
25 | #include <asm/setup.h> | 25 | #include <asm/setup.h> |
26 | #include <asm/bootinfo.h> | 26 | #include <asm/bootinfo.h> |
27 | #include <asm/machw.h> | ||
28 | #include <asm/macints.h> | 27 | #include <asm/macints.h> |
29 | 28 | ||
30 | extern unsigned long mac_videobase; | 29 | extern unsigned long mac_videobase; |
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index ecddac4a02b9..82e560c076ce 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c | |||
@@ -127,7 +127,6 @@ | |||
127 | #include <asm/irq.h> | 127 | #include <asm/irq.h> |
128 | #include <asm/traps.h> | 128 | #include <asm/traps.h> |
129 | #include <asm/bootinfo.h> | 129 | #include <asm/bootinfo.h> |
130 | #include <asm/machw.h> | ||
131 | #include <asm/macintosh.h> | 130 | #include <asm/macintosh.h> |
132 | #include <asm/mac_via.h> | 131 | #include <asm/mac_via.h> |
133 | #include <asm/mac_psc.h> | 132 | #include <asm/mac_psc.h> |
@@ -215,8 +214,8 @@ irqreturn_t mac_debug_handler(int, void *); | |||
215 | 214 | ||
216 | /* #define DEBUG_MACINTS */ | 215 | /* #define DEBUG_MACINTS */ |
217 | 216 | ||
218 | static void mac_enable_irq(unsigned int irq); | 217 | void mac_enable_irq(unsigned int irq); |
219 | static void mac_disable_irq(unsigned int irq); | 218 | void mac_disable_irq(unsigned int irq); |
220 | 219 | ||
221 | static struct irq_controller mac_irq_controller = { | 220 | static struct irq_controller mac_irq_controller = { |
222 | .name = "mac", | 221 | .name = "mac", |
@@ -275,7 +274,7 @@ void __init mac_init_IRQ(void) | |||
275 | * These routines are just dispatchers to the VIA/OSS/PSC routines. | 274 | * These routines are just dispatchers to the VIA/OSS/PSC routines. |
276 | */ | 275 | */ |
277 | 276 | ||
278 | static void mac_enable_irq(unsigned int irq) | 277 | void mac_enable_irq(unsigned int irq) |
279 | { | 278 | { |
280 | int irq_src = IRQ_SRC(irq); | 279 | int irq_src = IRQ_SRC(irq); |
281 | 280 | ||
@@ -308,7 +307,7 @@ static void mac_enable_irq(unsigned int irq) | |||
308 | } | 307 | } |
309 | } | 308 | } |
310 | 309 | ||
311 | static void mac_disable_irq(unsigned int irq) | 310 | void mac_disable_irq(unsigned int irq) |
312 | { | 311 | { |
313 | int irq_src = IRQ_SRC(irq); | 312 | int irq_src = IRQ_SRC(irq); |
314 | 313 | ||
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index 56d1f5676ade..a44c7086ab39 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c | |||
@@ -93,7 +93,7 @@ static void cuda_write_pram(int offset, __u8 data) | |||
93 | #define cuda_write_pram NULL | 93 | #define cuda_write_pram NULL |
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | #ifdef CONFIG_ADB_PMU68K | 96 | #if 0 /* def CONFIG_ADB_PMU68K */ |
97 | static long pmu_read_time(void) | 97 | static long pmu_read_time(void) |
98 | { | 98 | { |
99 | struct adb_request req; | 99 | struct adb_request req; |
@@ -148,7 +148,7 @@ static void pmu_write_pram(int offset, __u8 data) | |||
148 | #define pmu_write_pram NULL | 148 | #define pmu_write_pram NULL |
149 | #endif | 149 | #endif |
150 | 150 | ||
151 | #ifdef CONFIG_ADB_MACIISI | 151 | #if 0 /* def CONFIG_ADB_MACIISI */ |
152 | extern int maciisi_request(struct adb_request *req, | 152 | extern int maciisi_request(struct adb_request *req, |
153 | void (*done)(struct adb_request *), int nbytes, ...); | 153 | void (*done)(struct adb_request *), int nbytes, ...); |
154 | 154 | ||
@@ -717,13 +717,18 @@ int mac_hwclk(int op, struct rtc_time *t) | |||
717 | unmktime(now, 0, | 717 | unmktime(now, 0, |
718 | &t->tm_year, &t->tm_mon, &t->tm_mday, | 718 | &t->tm_year, &t->tm_mon, &t->tm_mday, |
719 | &t->tm_hour, &t->tm_min, &t->tm_sec); | 719 | &t->tm_hour, &t->tm_min, &t->tm_sec); |
720 | #if 0 | ||
720 | printk("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n", | 721 | printk("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n", |
721 | t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); | 722 | t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, |
723 | t->tm_hour, t->tm_min, t->tm_sec); | ||
724 | #endif | ||
722 | } else { /* write */ | 725 | } else { /* write */ |
726 | #if 0 | ||
723 | printk("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n", | 727 | printk("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n", |
724 | t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); | 728 | t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, |
729 | t->tm_hour, t->tm_min, t->tm_sec); | ||
730 | #endif | ||
725 | 731 | ||
726 | #if 0 /* it trashes my rtc */ | ||
727 | now = mktime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, | 732 | now = mktime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, |
728 | t->tm_hour, t->tm_min, t->tm_sec); | 733 | t->tm_hour, t->tm_min, t->tm_sec); |
729 | 734 | ||
@@ -742,7 +747,6 @@ int mac_hwclk(int op, struct rtc_time *t) | |||
742 | case MAC_ADB_IISI: | 747 | case MAC_ADB_IISI: |
743 | maciisi_write_time(now); | 748 | maciisi_write_time(now); |
744 | } | 749 | } |
745 | #endif | ||
746 | } | 750 | } |
747 | return 0; | 751 | return 0; |
748 | } | 752 | } |
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index 43d83e054b8e..8426501119ca 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | 22 | ||
23 | #include <asm/bootinfo.h> | 23 | #include <asm/bootinfo.h> |
24 | #include <asm/machw.h> | ||
25 | #include <asm/macintosh.h> | 24 | #include <asm/macintosh.h> |
26 | #include <asm/macints.h> | 25 | #include <asm/macints.h> |
27 | #include <asm/mac_via.h> | 26 | #include <asm/mac_via.h> |
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 1bdb03c73c0f..f01d418e64fe 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c | |||
@@ -32,15 +32,10 @@ | |||
32 | #include <asm/bootinfo.h> | 32 | #include <asm/bootinfo.h> |
33 | #include <asm/macintosh.h> | 33 | #include <asm/macintosh.h> |
34 | #include <asm/macints.h> | 34 | #include <asm/macints.h> |
35 | #include <asm/machw.h> | ||
36 | #include <asm/mac_via.h> | 35 | #include <asm/mac_via.h> |
37 | #include <asm/mac_psc.h> | 36 | #include <asm/mac_psc.h> |
38 | 37 | ||
39 | volatile __u8 *via1, *via2; | 38 | volatile __u8 *via1, *via2; |
40 | #if 0 | ||
41 | /* See note in mac_via.h about how this is possibly not useful */ | ||
42 | volatile long *via_memory_bogon=(long *)&via_memory_bogon; | ||
43 | #endif | ||
44 | int rbv_present; | 39 | int rbv_present; |
45 | int via_alt_mapping; | 40 | int via_alt_mapping; |
46 | EXPORT_SYMBOL(via_alt_mapping); | 41 | EXPORT_SYMBOL(via_alt_mapping); |
@@ -66,7 +61,7 @@ static int gIER,gIFR,gBufA,gBufB; | |||
66 | #define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF) | 61 | #define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF) |
67 | #define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8) | 62 | #define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8) |
68 | 63 | ||
69 | /* To disable a NuBus slot on Quadras we make the slot IRQ lines outputs, set | 64 | /* To disable a NuBus slot on Quadras we make that slot IRQ line an output set |
70 | * high. On RBV we just use the slot interrupt enable register. On Macs with | 65 | * high. On RBV we just use the slot interrupt enable register. On Macs with |
71 | * genuine VIA chips we must use nubus_disabled to keep track of disabled slot | 66 | * genuine VIA chips we must use nubus_disabled to keep track of disabled slot |
72 | * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1 | 67 | * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1 |
@@ -180,7 +175,7 @@ void __init via_init(void) | |||
180 | via1[vT1CH] = 0; | 175 | via1[vT1CH] = 0; |
181 | via1[vT2CL] = 0; | 176 | via1[vT2CL] = 0; |
182 | via1[vT2CH] = 0; | 177 | via1[vT2CH] = 0; |
183 | via1[vACR] &= 0x3F; | 178 | via1[vACR] &= ~0xC0; /* setup T1 timer with no PB7 output */ |
184 | via1[vACR] &= ~0x03; /* disable port A & B latches */ | 179 | via1[vACR] &= ~0x03; /* disable port A & B latches */ |
185 | 180 | ||
186 | /* | 181 | /* |
@@ -203,40 +198,41 @@ void __init via_init(void) | |||
203 | 198 | ||
204 | /* Everything below this point is VIA2/RBV only... */ | 199 | /* Everything below this point is VIA2/RBV only... */ |
205 | 200 | ||
206 | if (oss_present) return; | 201 | if (oss_present) |
202 | return; | ||
207 | 203 | ||
208 | #if 1 | ||
209 | /* Some machines support an alternate IRQ mapping that spreads */ | 204 | /* Some machines support an alternate IRQ mapping that spreads */ |
210 | /* Ethernet and Sound out to their own autolevel IRQs and moves */ | 205 | /* Ethernet and Sound out to their own autolevel IRQs and moves */ |
211 | /* VIA1 to level 6. A/UX uses this mapping and we do too. Note */ | 206 | /* VIA1 to level 6. A/UX uses this mapping and we do too. Note */ |
212 | /* that the IIfx emulates this alternate mapping using the OSS. */ | 207 | /* that the IIfx emulates this alternate mapping using the OSS. */ |
213 | 208 | ||
214 | switch(macintosh_config->ident) { | 209 | via_alt_mapping = 0; |
215 | case MAC_MODEL_P475: | 210 | if (macintosh_config->via_type == MAC_VIA_QUADRA) |
216 | case MAC_MODEL_P475F: | 211 | switch (macintosh_config->ident) { |
217 | case MAC_MODEL_P575: | 212 | case MAC_MODEL_C660: |
218 | case MAC_MODEL_Q605: | 213 | case MAC_MODEL_Q840: |
219 | case MAC_MODEL_Q605_ACC: | 214 | /* not applicable */ |
220 | case MAC_MODEL_C610: | 215 | break; |
221 | case MAC_MODEL_Q610: | 216 | case MAC_MODEL_P588: |
222 | case MAC_MODEL_Q630: | 217 | case MAC_MODEL_TV: |
223 | case MAC_MODEL_C650: | 218 | case MAC_MODEL_PB140: |
224 | case MAC_MODEL_Q650: | 219 | case MAC_MODEL_PB145: |
225 | case MAC_MODEL_Q700: | 220 | case MAC_MODEL_PB160: |
226 | case MAC_MODEL_Q800: | 221 | case MAC_MODEL_PB165: |
227 | case MAC_MODEL_Q900: | 222 | case MAC_MODEL_PB165C: |
228 | case MAC_MODEL_Q950: | 223 | case MAC_MODEL_PB170: |
224 | case MAC_MODEL_PB180: | ||
225 | case MAC_MODEL_PB180C: | ||
226 | case MAC_MODEL_PB190: | ||
227 | case MAC_MODEL_PB520: | ||
228 | /* not yet tested */ | ||
229 | break; | ||
230 | default: | ||
229 | via_alt_mapping = 1; | 231 | via_alt_mapping = 1; |
230 | via1[vDirB] |= 0x40; | 232 | via1[vDirB] |= 0x40; |
231 | via1[vBufB] &= ~0x40; | 233 | via1[vBufB] &= ~0x40; |
232 | break; | 234 | break; |
233 | default: | 235 | } |
234 | via_alt_mapping = 0; | ||
235 | break; | ||
236 | } | ||
237 | #else | ||
238 | via_alt_mapping = 0; | ||
239 | #endif | ||
240 | 236 | ||
241 | /* | 237 | /* |
242 | * Now initialize VIA2. For RBV we just kill all interrupts; | 238 | * Now initialize VIA2. For RBV we just kill all interrupts; |
@@ -252,14 +248,17 @@ void __init via_init(void) | |||
252 | via2[vT1CH] = 0; | 248 | via2[vT1CH] = 0; |
253 | via2[vT2CL] = 0; | 249 | via2[vT2CL] = 0; |
254 | via2[vT2CH] = 0; | 250 | via2[vT2CH] = 0; |
255 | via2[vACR] &= 0x3F; | 251 | via2[vACR] &= ~0xC0; /* setup T1 timer with no PB7 output */ |
256 | via2[vACR] &= ~0x03; /* disable port A & B latches */ | 252 | via2[vACR] &= ~0x03; /* disable port A & B latches */ |
257 | } | 253 | } |
258 | 254 | ||
259 | /* | 255 | /* |
260 | * Set vPCR for SCSI interrupts (but not on RBV) | 256 | * Set vPCR for control line interrupts (but not on RBV) |
261 | */ | 257 | */ |
262 | if (!rbv_present) { | 258 | if (!rbv_present) { |
259 | /* For all VIA types, CA1 (SLOTS IRQ) and CB1 (ASC IRQ) | ||
260 | * are made negative edge triggered here. | ||
261 | */ | ||
263 | if (macintosh_config->scsi_type == MAC_SCSI_OLD) { | 262 | if (macintosh_config->scsi_type == MAC_SCSI_OLD) { |
264 | /* CB2 (IRQ) indep. input, positive edge */ | 263 | /* CB2 (IRQ) indep. input, positive edge */ |
265 | /* CA2 (DRQ) indep. input, positive edge */ | 264 | /* CA2 (DRQ) indep. input, positive edge */ |
@@ -466,21 +465,6 @@ irqreturn_t via1_irq(int irq, void *dev_id) | |||
466 | ++irq_num; | 465 | ++irq_num; |
467 | irq_bit <<= 1; | 466 | irq_bit <<= 1; |
468 | } while (events >= irq_bit); | 467 | } while (events >= irq_bit); |
469 | |||
470 | #if 0 /* freakin' pmu is doing weird stuff */ | ||
471 | if (!oss_present) { | ||
472 | /* This (still) seems to be necessary to get IDE | ||
473 | working. However, if you enable VBL interrupts, | ||
474 | you're screwed... */ | ||
475 | /* FIXME: should we check the SLOTIRQ bit before | ||
476 | pulling this stunt? */ | ||
477 | /* No, it won't be set. that's why we're doing this. */ | ||
478 | via_irq_disable(IRQ_MAC_NUBUS); | ||
479 | via_irq_clear(IRQ_MAC_NUBUS); | ||
480 | m68k_handle_int(IRQ_MAC_NUBUS); | ||
481 | via_irq_enable(IRQ_MAC_NUBUS); | ||
482 | } | ||
483 | #endif | ||
484 | return IRQ_HANDLED; | 468 | return IRQ_HANDLED; |
485 | } | 469 | } |
486 | 470 | ||
diff --git a/drivers/ide/macide.c b/drivers/ide/macide.c index 43f97cc1d30e..3c60064f1d4f 100644 --- a/drivers/ide/macide.c +++ b/drivers/ide/macide.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/ide.h> | 19 | #include <linux/ide.h> |
20 | 20 | ||
21 | #include <asm/machw.h> | ||
22 | #include <asm/macintosh.h> | 21 | #include <asm/macintosh.h> |
23 | #include <asm/macints.h> | 22 | #include <asm/macints.h> |
24 | #include <asm/mac_baboon.h> | 23 | #include <asm/mac_baboon.h> |
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index 741a93a3eb61..62dd1fdafecf 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #else | 23 | #else |
24 | #include <asm/macintosh.h> | 24 | #include <asm/macintosh.h> |
25 | #include <asm/macints.h> | 25 | #include <asm/macints.h> |
26 | #include <asm/machw.h> | ||
27 | #include <asm/mac_via.h> | 26 | #include <asm/mac_via.h> |
28 | #endif | 27 | #endif |
29 | #include <asm/io.h> | 28 | #include <asm/io.h> |
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c index 6e6dd17ab572..817f37a875c9 100644 --- a/drivers/macintosh/via-macii.c +++ b/drivers/macintosh/via-macii.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | #include <asm/macintosh.h> | 34 | #include <asm/macintosh.h> |
35 | #include <asm/macints.h> | 35 | #include <asm/macints.h> |
36 | #include <asm/machw.h> | ||
37 | #include <asm/mac_via.h> | 36 | #include <asm/mac_via.h> |
38 | #include <asm/system.h> | 37 | #include <asm/system.h> |
39 | 38 | ||
diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c index 2dc788042707..4d686c0bdea0 100644 --- a/drivers/macintosh/via-maciisi.c +++ b/drivers/macintosh/via-maciisi.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <asm/macintosh.h> | 25 | #include <asm/macintosh.h> |
26 | #include <asm/macints.h> | 26 | #include <asm/macints.h> |
27 | #include <asm/machw.h> | ||
28 | #include <asm/mac_via.h> | 27 | #include <asm/mac_via.h> |
29 | 28 | ||
30 | static volatile unsigned char *via; | 29 | static volatile unsigned char *via; |
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index b64741c95ac4..fb9fa614a0e8 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c | |||
@@ -35,7 +35,6 @@ | |||
35 | 35 | ||
36 | #include <asm/macintosh.h> | 36 | #include <asm/macintosh.h> |
37 | #include <asm/macints.h> | 37 | #include <asm/macints.h> |
38 | #include <asm/machw.h> | ||
39 | #include <asm/mac_via.h> | 38 | #include <asm/mac_via.h> |
40 | 39 | ||
41 | #include <asm/pgtable.h> | 40 | #include <asm/pgtable.h> |
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c index 0248919bc2df..bf2a1c516293 100644 --- a/drivers/scsi/mac_scsi.c +++ b/drivers/scsi/mac_scsi.c | |||
@@ -47,7 +47,6 @@ | |||
47 | 47 | ||
48 | #include <asm/macintosh.h> | 48 | #include <asm/macintosh.h> |
49 | #include <asm/macints.h> | 49 | #include <asm/macints.h> |
50 | #include <asm/machw.h> | ||
51 | #include <asm/mac_via.h> | 50 | #include <asm/mac_via.h> |
52 | 51 | ||
53 | #include "scsi.h" | 52 | #include "scsi.h" |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 0b2adefe9e3d..4bcff81b50e0 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -81,9 +81,6 @@ | |||
81 | #ifdef CONFIG_ATARI | 81 | #ifdef CONFIG_ATARI |
82 | #include <asm/atariints.h> | 82 | #include <asm/atariints.h> |
83 | #endif | 83 | #endif |
84 | #ifdef CONFIG_MAC | ||
85 | #include <asm/macints.h> | ||
86 | #endif | ||
87 | #if defined(__mc68000__) | 84 | #if defined(__mc68000__) |
88 | #include <asm/machdep.h> | 85 | #include <asm/machdep.h> |
89 | #include <asm/setup.h> | 86 | #include <asm/setup.h> |
@@ -160,8 +157,6 @@ static int fbcon_set_origin(struct vc_data *); | |||
160 | 157 | ||
161 | /* # VBL ints between cursor state changes */ | 158 | /* # VBL ints between cursor state changes */ |
162 | #define ATARI_CURSOR_BLINK_RATE (42) | 159 | #define ATARI_CURSOR_BLINK_RATE (42) |
163 | #define MAC_CURSOR_BLINK_RATE (32) | ||
164 | #define DEFAULT_CURSOR_BLINK_RATE (20) | ||
165 | 160 | ||
166 | static int vbl_cursor_cnt; | 161 | static int vbl_cursor_cnt; |
167 | static int fbcon_cursor_noblink; | 162 | static int fbcon_cursor_noblink; |
@@ -210,19 +205,6 @@ static void fbcon_start(void); | |||
210 | static void fbcon_exit(void); | 205 | static void fbcon_exit(void); |
211 | static struct device *fbcon_device; | 206 | static struct device *fbcon_device; |
212 | 207 | ||
213 | #ifdef CONFIG_MAC | ||
214 | /* | ||
215 | * On the Macintoy, there may or may not be a working VBL int. We need to probe | ||
216 | */ | ||
217 | static int vbl_detected; | ||
218 | |||
219 | static irqreturn_t fb_vbl_detect(int irq, void *dummy) | ||
220 | { | ||
221 | vbl_detected++; | ||
222 | return IRQ_HANDLED; | ||
223 | } | ||
224 | #endif | ||
225 | |||
226 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION | 208 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION |
227 | static inline void fbcon_set_rotation(struct fb_info *info) | 209 | static inline void fbcon_set_rotation(struct fb_info *info) |
228 | { | 210 | { |
@@ -421,7 +403,7 @@ static void fb_flashcursor(struct work_struct *work) | |||
421 | release_console_sem(); | 403 | release_console_sem(); |
422 | } | 404 | } |
423 | 405 | ||
424 | #if defined(CONFIG_ATARI) || defined(CONFIG_MAC) | 406 | #ifdef CONFIG_ATARI |
425 | static int cursor_blink_rate; | 407 | static int cursor_blink_rate; |
426 | static irqreturn_t fb_vbl_handler(int irq, void *dev_id) | 408 | static irqreturn_t fb_vbl_handler(int irq, void *dev_id) |
427 | { | 409 | { |
@@ -949,9 +931,7 @@ static const char *fbcon_startup(void) | |||
949 | struct fb_info *info = NULL; | 931 | struct fb_info *info = NULL; |
950 | struct fbcon_ops *ops; | 932 | struct fbcon_ops *ops; |
951 | int rows, cols; | 933 | int rows, cols; |
952 | int irqres; | ||
953 | 934 | ||
954 | irqres = 1; | ||
955 | /* | 935 | /* |
956 | * If num_registered_fb is zero, this is a call for the dummy part. | 936 | * If num_registered_fb is zero, this is a call for the dummy part. |
957 | * The frame buffer devices weren't initialized yet. | 937 | * The frame buffer devices weren't initialized yet. |
@@ -1040,56 +1020,11 @@ static const char *fbcon_startup(void) | |||
1040 | #ifdef CONFIG_ATARI | 1020 | #ifdef CONFIG_ATARI |
1041 | if (MACH_IS_ATARI) { | 1021 | if (MACH_IS_ATARI) { |
1042 | cursor_blink_rate = ATARI_CURSOR_BLINK_RATE; | 1022 | cursor_blink_rate = ATARI_CURSOR_BLINK_RATE; |
1043 | irqres = | 1023 | (void)request_irq(IRQ_AUTO_4, fb_vbl_handler, |
1044 | request_irq(IRQ_AUTO_4, fb_vbl_handler, | ||
1045 | IRQ_TYPE_PRIO, "framebuffer vbl", | 1024 | IRQ_TYPE_PRIO, "framebuffer vbl", |
1046 | info); | 1025 | info); |
1047 | } | 1026 | } |
1048 | #endif /* CONFIG_ATARI */ | 1027 | #endif /* CONFIG_ATARI */ |
1049 | |||
1050 | #ifdef CONFIG_MAC | ||
1051 | /* | ||
1052 | * On a Macintoy, the VBL interrupt may or may not be active. | ||
1053 | * As interrupt based cursor is more reliable and race free, we | ||
1054 | * probe for VBL interrupts. | ||
1055 | */ | ||
1056 | if (MACH_IS_MAC) { | ||
1057 | int ct = 0; | ||
1058 | /* | ||
1059 | * Probe for VBL: set temp. handler ... | ||
1060 | */ | ||
1061 | irqres = request_irq(IRQ_MAC_VBL, fb_vbl_detect, 0, | ||
1062 | "framebuffer vbl", info); | ||
1063 | vbl_detected = 0; | ||
1064 | |||
1065 | /* | ||
1066 | * ... and spin for 20 ms ... | ||
1067 | */ | ||
1068 | while (!vbl_detected && ++ct < 1000) | ||
1069 | udelay(20); | ||
1070 | |||
1071 | if (ct == 1000) | ||
1072 | printk | ||
1073 | ("fbcon_startup: No VBL detected, using timer based cursor.\n"); | ||
1074 | |||
1075 | free_irq(IRQ_MAC_VBL, fb_vbl_detect); | ||
1076 | |||
1077 | if (vbl_detected) { | ||
1078 | /* | ||
1079 | * interrupt based cursor ok | ||
1080 | */ | ||
1081 | cursor_blink_rate = MAC_CURSOR_BLINK_RATE; | ||
1082 | irqres = | ||
1083 | request_irq(IRQ_MAC_VBL, fb_vbl_handler, 0, | ||
1084 | "framebuffer vbl", info); | ||
1085 | } else { | ||
1086 | /* | ||
1087 | * VBL not detected: fall through, use timer based cursor | ||
1088 | */ | ||
1089 | irqres = 1; | ||
1090 | } | ||
1091 | } | ||
1092 | #endif /* CONFIG_MAC */ | ||
1093 | 1028 | ||
1094 | fbcon_add_cursor_timer(info); | 1029 | fbcon_add_cursor_timer(info); |
1095 | fbcon_has_exited = 0; | 1030 | fbcon_has_exited = 0; |
@@ -3520,11 +3455,8 @@ static void fbcon_exit(void) | |||
3520 | return; | 3455 | return; |
3521 | 3456 | ||
3522 | #ifdef CONFIG_ATARI | 3457 | #ifdef CONFIG_ATARI |
3523 | free_irq(IRQ_AUTO_4, fb_vbl_handler); | 3458 | if (MACH_IS_ATARI) |
3524 | #endif | 3459 | free_irq(IRQ_AUTO_4, fb_vbl_handler); |
3525 | #ifdef CONFIG_MAC | ||
3526 | if (MACH_IS_MAC && vbl_detected) | ||
3527 | free_irq(IRQ_MAC_VBL, fb_vbl_handler); | ||
3528 | #endif | 3460 | #endif |
3529 | 3461 | ||
3530 | kfree((void *)softback_buf); | 3462 | kfree((void *)softback_buf); |
diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c index ee380d5f3410..d66887e8cbb1 100644 --- a/drivers/video/macfb.c +++ b/drivers/video/macfb.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
37 | #include <asm/macintosh.h> | 37 | #include <asm/macintosh.h> |
38 | #include <asm/io.h> | 38 | #include <asm/io.h> |
39 | #include <asm/machw.h> | ||
40 | 39 | ||
41 | /* Common DAC base address for the LC, RBV, Valkyrie, and IIvx */ | 40 | /* Common DAC base address for the LC, RBV, Valkyrie, and IIvx */ |
42 | #define DAC_BASE 0x50f24000 | 41 | #define DAC_BASE 0x50f24000 |
@@ -78,34 +77,34 @@ static int csc_setpalette (unsigned int regno, unsigned int red, | |||
78 | unsigned int green, unsigned int blue, | 77 | unsigned int green, unsigned int blue, |
79 | struct fb_info *fb_info); | 78 | struct fb_info *fb_info); |
80 | 79 | ||
81 | static volatile struct { | 80 | static struct { |
82 | unsigned char addr; | 81 | unsigned char addr; |
83 | /* Note: word-aligned */ | 82 | /* Note: word-aligned */ |
84 | char pad[3]; | 83 | char pad[3]; |
85 | unsigned char lut; | 84 | unsigned char lut; |
86 | } *valkyrie_cmap_regs; | 85 | } __iomem *valkyrie_cmap_regs; |
87 | 86 | ||
88 | static volatile struct { | 87 | static struct { |
89 | unsigned char addr; | 88 | unsigned char addr; |
90 | unsigned char lut; | 89 | unsigned char lut; |
91 | } *v8_brazil_cmap_regs; | 90 | } __iomem *v8_brazil_cmap_regs; |
92 | 91 | ||
93 | static volatile struct { | 92 | static struct { |
94 | unsigned char addr; | 93 | unsigned char addr; |
95 | char pad1[3]; /* word aligned */ | 94 | char pad1[3]; /* word aligned */ |
96 | unsigned char lut; | 95 | unsigned char lut; |
97 | char pad2[3]; /* word aligned */ | 96 | char pad2[3]; /* word aligned */ |
98 | unsigned char cntl; /* a guess as to purpose */ | 97 | unsigned char cntl; /* a guess as to purpose */ |
99 | } *rbv_cmap_regs; | 98 | } __iomem *rbv_cmap_regs; |
100 | 99 | ||
101 | static volatile struct { | 100 | static struct { |
102 | unsigned long reset; | 101 | unsigned long reset; |
103 | unsigned long pad1[3]; | 102 | unsigned long pad1[3]; |
104 | unsigned char pad2[3]; | 103 | unsigned char pad2[3]; |
105 | unsigned char lut; | 104 | unsigned char lut; |
106 | } *dafb_cmap_regs; | 105 | } __iomem *dafb_cmap_regs; |
107 | 106 | ||
108 | static volatile struct { | 107 | static struct { |
109 | unsigned char addr; /* OFFSET: 0x00 */ | 108 | unsigned char addr; /* OFFSET: 0x00 */ |
110 | unsigned char pad1[15]; | 109 | unsigned char pad1[15]; |
111 | unsigned char lut; /* OFFSET: 0x10 */ | 110 | unsigned char lut; /* OFFSET: 0x10 */ |
@@ -114,16 +113,16 @@ static volatile struct { | |||
114 | unsigned char pad3[7]; | 113 | unsigned char pad3[7]; |
115 | unsigned long vbl_addr; /* OFFSET: 0x28 */ | 114 | unsigned long vbl_addr; /* OFFSET: 0x28 */ |
116 | unsigned int status2; /* OFFSET: 0x2C */ | 115 | unsigned int status2; /* OFFSET: 0x2C */ |
117 | } *civic_cmap_regs; | 116 | } __iomem *civic_cmap_regs; |
118 | 117 | ||
119 | static volatile struct { | 118 | static struct { |
120 | char pad1[0x40]; | 119 | char pad1[0x40]; |
121 | unsigned char clut_waddr; /* 0x40 */ | 120 | unsigned char clut_waddr; /* 0x40 */ |
122 | char pad2; | 121 | char pad2; |
123 | unsigned char clut_data; /* 0x42 */ | 122 | unsigned char clut_data; /* 0x42 */ |
124 | char pad3[0x3]; | 123 | char pad3[0x3]; |
125 | unsigned char clut_raddr; /* 0x46 */ | 124 | unsigned char clut_raddr; /* 0x46 */ |
126 | } *csc_cmap_regs; | 125 | } __iomem *csc_cmap_regs; |
127 | 126 | ||
128 | /* We will leave these the way they are for the time being */ | 127 | /* We will leave these the way they are for the time being */ |
129 | struct mdc_cmap_regs { | 128 | struct mdc_cmap_regs { |
@@ -507,10 +506,10 @@ static int csc_setpalette (unsigned int regno, unsigned int red, | |||
507 | struct fb_info *info) | 506 | struct fb_info *info) |
508 | { | 507 | { |
509 | mdelay(1); | 508 | mdelay(1); |
510 | csc_cmap_regs->clut_waddr = regno; | 509 | nubus_writeb(regno, &csc_cmap_regs->clut_waddr); |
511 | csc_cmap_regs->clut_data = red; | 510 | nubus_writeb(red, &csc_cmap_regs->clut_data); |
512 | csc_cmap_regs->clut_data = green; | 511 | nubus_writeb(green, &csc_cmap_regs->clut_data); |
513 | csc_cmap_regs->clut_data = blue; | 512 | nubus_writeb(blue, &csc_cmap_regs->clut_data); |
514 | return 0; | 513 | return 0; |
515 | } | 514 | } |
516 | 515 | ||
diff --git a/include/asm-m68k/byteorder.h b/include/asm-m68k/byteorder.h index 81d420b35c80..b354acdafec8 100644 --- a/include/asm-m68k/byteorder.h +++ b/include/asm-m68k/byteorder.h | |||
@@ -4,22 +4,16 @@ | |||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
6 | 6 | ||
7 | #ifdef __GNUC__ | 7 | #define __BIG_ENDIAN |
8 | #define __SWAB_64_THRU_32__ | ||
8 | 9 | ||
9 | static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 val) | 10 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) |
10 | { | 11 | { |
11 | __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); | 12 | __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); |
12 | return val; | 13 | return val; |
13 | } | 14 | } |
14 | #define __arch__swab32(x) ___arch__swab32(x) | 15 | #define __arch_swab32 __arch_swab32 |
15 | 16 | ||
16 | #endif | 17 | #include <linux/byteorder.h> |
17 | |||
18 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
19 | # define __BYTEORDER_HAS_U64__ | ||
20 | # define __SWAB_64_THRU_32__ | ||
21 | #endif | ||
22 | |||
23 | #include <linux/byteorder/big_endian.h> | ||
24 | 18 | ||
25 | #endif /* _M68K_BYTEORDER_H */ | 19 | #endif /* _M68K_BYTEORDER_H */ |
diff --git a/include/asm-m68k/machw.h b/include/asm-m68k/machw.h index 35624998291c..2b4de0c2ce4a 100644 --- a/include/asm-m68k/machw.h +++ b/include/asm-m68k/machw.h | |||
@@ -26,28 +26,6 @@ | |||
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | 27 | ||
28 | #if 0 | 28 | #if 0 |
29 | /* Mac SCSI Controller 5380 */ | ||
30 | |||
31 | #define MAC_5380_BAS (0x50F10000) /* This is definitely wrong!! */ | ||
32 | struct MAC_5380 { | ||
33 | u_char scsi_data; | ||
34 | u_char char_dummy1; | ||
35 | u_char scsi_icr; | ||
36 | u_char char_dummy2; | ||
37 | u_char scsi_mode; | ||
38 | u_char char_dummy3; | ||
39 | u_char scsi_tcr; | ||
40 | u_char char_dummy4; | ||
41 | u_char scsi_idstat; | ||
42 | u_char char_dummy5; | ||
43 | u_char scsi_dmastat; | ||
44 | u_char char_dummy6; | ||
45 | u_char scsi_targrcv; | ||
46 | u_char char_dummy7; | ||
47 | u_char scsi_inircv; | ||
48 | }; | ||
49 | #define mac_scsi ((*(volatile struct MAC_5380 *)MAC_5380_BAS)) | ||
50 | |||
51 | /* | 29 | /* |
52 | ** SCC Z8530 | 30 | ** SCC Z8530 |
53 | */ | 31 | */ |