aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-21 15:43:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-21 15:43:54 -0400
commit881bcabbde8bc13854a2cb30847abe181d31c5fd (patch)
tree4903428777c03b76d8f2b6cdc782098213300126 /arch/m68k
parente60b9a0346ee08af4715ee5b2d82f705fbe6e309 (diff)
parentf25e918e3546477948be999c3a7d56b316d74e4b (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
Pull m68k updates from Geert Uytterhoeven. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: Setup CROSS_COMPILE at the top m68k: Correct the Atari ALLOWINT definition m68k/video: Create <asm/vga.h> m68k: Make sure {read,write}s[bwl]() are always defined m68k/mm: Port OOM changes to do_page_fault() scsi/atari: Make more functions static scsi/atari: Revive "atascsi=" setup option net/ariadne: Improve debug prints m68k/atari: Change VME irq numbers from unsigned long to unsigned int m68k/amiga: Use arch_initcall() for registering platform devices m68k/amiga: Add error checks when registering platform devices m68k/amiga: Mark z_dev_present() __init m68k: Remove unused MAX_NOINT_IPL definition
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/Makefile13
-rw-r--r--arch/m68k/amiga/platform.c126
-rw-r--r--arch/m68k/atari/ataints.c4
-rw-r--r--arch/m68k/include/asm/atariints.h4
-rw-r--r--arch/m68k/include/asm/entry.h6
-rw-r--r--arch/m68k/include/asm/io_mm.h7
-rw-r--r--arch/m68k/include/asm/vga.h27
-rw-r--r--arch/m68k/mm/fault.c42
8 files changed, 173 insertions, 56 deletions
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index cf318f20c64d..41b3bc926bb1 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -16,6 +16,13 @@
16 16
17KBUILD_DEFCONFIG := multi_defconfig 17KBUILD_DEFCONFIG := multi_defconfig
18 18
19ifneq ($(SUBARCH),$(ARCH))
20 ifeq ($(CROSS_COMPILE),)
21 CROSS_COMPILE := $(call cc-cross-prefix, \
22 m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
23 endif
24endif
25
19# 26#
20# Enable processor type. Ordering of these is important - we want to 27# Enable processor type. Ordering of these is important - we want to
21# use the minimum processor type of the range we support. The logic 28# use the minimum processor type of the range we support. The logic
@@ -62,12 +69,6 @@ endif
62 69
63LDFLAGS := -m m68kelf 70LDFLAGS := -m m68kelf
64KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds 71KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
65ifneq ($(SUBARCH),$(ARCH))
66 ifeq ($(CROSS_COMPILE),)
67 CROSS_COMPILE := $(call cc-cross-prefix, \
68 m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
69 endif
70endif
71 72
72ifdef CONFIG_SUN3 73ifdef CONFIG_SUN3
73LDFLAGS_vmlinux = -N 74LDFLAGS_vmlinux = -N
diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c
index 7fd8b41723ea..80076d368b7e 100644
--- a/arch/m68k/amiga/platform.c
+++ b/arch/m68k/amiga/platform.c
@@ -6,6 +6,7 @@
6 * for more details. 6 * for more details.
7 */ 7 */
8 8
9#include <linux/err.h>
9#include <linux/init.h> 10#include <linux/init.h>
10#include <linux/platform_device.h> 11#include <linux/platform_device.h>
11#include <linux/zorro.h> 12#include <linux/zorro.h>
@@ -46,18 +47,25 @@ static const struct resource zorro_resources[] __initconst = {
46 47
47static int __init amiga_init_bus(void) 48static int __init amiga_init_bus(void)
48{ 49{
50 struct platform_device *pdev;
51 unsigned int n;
52
49 if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) 53 if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
50 return -ENODEV; 54 return -ENODEV;
51 55
52 platform_device_register_simple("amiga-zorro", -1, zorro_resources, 56 n = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
53 AMIGAHW_PRESENT(ZORRO3) ? 4 : 2); 57 pdev = platform_device_register_simple("amiga-zorro", -1,
58 zorro_resources, n);
59 if (IS_ERR(pdev))
60 return PTR_ERR(pdev);
61
54 return 0; 62 return 0;
55} 63}
56 64
57subsys_initcall(amiga_init_bus); 65subsys_initcall(amiga_init_bus);
58 66
59 67
60static int z_dev_present(zorro_id id) 68static int __init z_dev_present(zorro_id id)
61{ 69{
62 unsigned int i; 70 unsigned int i;
63 71
@@ -126,72 +134,122 @@ static const struct resource amiga_rtc_resource __initconst = {
126static int __init amiga_init_devices(void) 134static int __init amiga_init_devices(void)
127{ 135{
128 struct platform_device *pdev; 136 struct platform_device *pdev;
137 int error;
129 138
130 if (!MACH_IS_AMIGA) 139 if (!MACH_IS_AMIGA)
131 return -ENODEV; 140 return -ENODEV;
132 141
133 /* video hardware */ 142 /* video hardware */
134 if (AMIGAHW_PRESENT(AMI_VIDEO)) 143 if (AMIGAHW_PRESENT(AMI_VIDEO)) {
135 platform_device_register_simple("amiga-video", -1, NULL, 0); 144 pdev = platform_device_register_simple("amiga-video", -1, NULL,
145 0);
146 if (IS_ERR(pdev))
147 return PTR_ERR(pdev);
148 }
136 149
137 150
138 /* sound hardware */ 151 /* sound hardware */
139 if (AMIGAHW_PRESENT(AMI_AUDIO)) 152 if (AMIGAHW_PRESENT(AMI_AUDIO)) {
140 platform_device_register_simple("amiga-audio", -1, NULL, 0); 153 pdev = platform_device_register_simple("amiga-audio", -1, NULL,
154 0);
155 if (IS_ERR(pdev))
156 return PTR_ERR(pdev);
157 }
141 158
142 159
143 /* storage interfaces */ 160 /* storage interfaces */
144 if (AMIGAHW_PRESENT(AMI_FLOPPY)) 161 if (AMIGAHW_PRESENT(AMI_FLOPPY)) {
145 platform_device_register_simple("amiga-floppy", -1, NULL, 0); 162 pdev = platform_device_register_simple("amiga-floppy", -1,
163 NULL, 0);
164 if (IS_ERR(pdev))
165 return PTR_ERR(pdev);
166 }
146 167
147 if (AMIGAHW_PRESENT(A3000_SCSI)) 168 if (AMIGAHW_PRESENT(A3000_SCSI)) {
148 platform_device_register_simple("amiga-a3000-scsi", -1, 169 pdev = platform_device_register_simple("amiga-a3000-scsi", -1,
149 &a3000_scsi_resource, 1); 170 &a3000_scsi_resource, 1);
171 if (IS_ERR(pdev))
172 return PTR_ERR(pdev);
173 }
150 174
151 if (AMIGAHW_PRESENT(A4000_SCSI)) 175 if (AMIGAHW_PRESENT(A4000_SCSI)) {
152 platform_device_register_simple("amiga-a4000t-scsi", -1, 176 pdev = platform_device_register_simple("amiga-a4000t-scsi", -1,
153 &a4000t_scsi_resource, 1); 177 &a4000t_scsi_resource,
178 1);
179 if (IS_ERR(pdev))
180 return PTR_ERR(pdev);
181 }
154 182
155 if (AMIGAHW_PRESENT(A1200_IDE) || 183 if (AMIGAHW_PRESENT(A1200_IDE) ||
156 z_dev_present(ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE)) { 184 z_dev_present(ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE)) {
157 pdev = platform_device_register_simple("amiga-gayle-ide", -1, 185 pdev = platform_device_register_simple("amiga-gayle-ide", -1,
158 &a1200_ide_resource, 1); 186 &a1200_ide_resource, 1);
159 platform_device_add_data(pdev, &a1200_ide_pdata, 187 if (IS_ERR(pdev))
160 sizeof(a1200_ide_pdata)); 188 return PTR_ERR(pdev);
189 error = platform_device_add_data(pdev, &a1200_ide_pdata,
190 sizeof(a1200_ide_pdata));
191 if (error)
192 return error;
161 } 193 }
162 194
163 if (AMIGAHW_PRESENT(A4000_IDE)) { 195 if (AMIGAHW_PRESENT(A4000_IDE)) {
164 pdev = platform_device_register_simple("amiga-gayle-ide", -1, 196 pdev = platform_device_register_simple("amiga-gayle-ide", -1,
165 &a4000_ide_resource, 1); 197 &a4000_ide_resource, 1);
166 platform_device_add_data(pdev, &a4000_ide_pdata, 198 if (IS_ERR(pdev))
167 sizeof(a4000_ide_pdata)); 199 return PTR_ERR(pdev);
200 error = platform_device_add_data(pdev, &a4000_ide_pdata,
201 sizeof(a4000_ide_pdata));
202 if (error)
203 return error;
168 } 204 }
169 205
170 206
171 /* other I/O hardware */ 207 /* other I/O hardware */
172 if (AMIGAHW_PRESENT(AMI_KEYBOARD)) 208 if (AMIGAHW_PRESENT(AMI_KEYBOARD)) {
173 platform_device_register_simple("amiga-keyboard", -1, NULL, 0); 209 pdev = platform_device_register_simple("amiga-keyboard", -1,
210 NULL, 0);
211 if (IS_ERR(pdev))
212 return PTR_ERR(pdev);
213 }
174 214
175 if (AMIGAHW_PRESENT(AMI_MOUSE)) 215 if (AMIGAHW_PRESENT(AMI_MOUSE)) {
176 platform_device_register_simple("amiga-mouse", -1, NULL, 0); 216 pdev = platform_device_register_simple("amiga-mouse", -1, NULL,
217 0);
218 if (IS_ERR(pdev))
219 return PTR_ERR(pdev);
220 }
177 221
178 if (AMIGAHW_PRESENT(AMI_SERIAL)) 222 if (AMIGAHW_PRESENT(AMI_SERIAL)) {
179 platform_device_register_simple("amiga-serial", -1, NULL, 0); 223 pdev = platform_device_register_simple("amiga-serial", -1,
224 NULL, 0);
225 if (IS_ERR(pdev))
226 return PTR_ERR(pdev);
227 }
180 228
181 if (AMIGAHW_PRESENT(AMI_PARALLEL)) 229 if (AMIGAHW_PRESENT(AMI_PARALLEL)) {
182 platform_device_register_simple("amiga-parallel", -1, NULL, 0); 230 pdev = platform_device_register_simple("amiga-parallel", -1,
231 NULL, 0);
232 if (IS_ERR(pdev))
233 return PTR_ERR(pdev);
234 }
183 235
184 236
185 /* real time clocks */ 237 /* real time clocks */
186 if (AMIGAHW_PRESENT(A2000_CLK)) 238 if (AMIGAHW_PRESENT(A2000_CLK)) {
187 platform_device_register_simple("rtc-msm6242", -1, 239 pdev = platform_device_register_simple("rtc-msm6242", -1,
188 &amiga_rtc_resource, 1); 240 &amiga_rtc_resource, 1);
241 if (IS_ERR(pdev))
242 return PTR_ERR(pdev);
243 }
189 244
190 if (AMIGAHW_PRESENT(A3000_CLK)) 245 if (AMIGAHW_PRESENT(A3000_CLK)) {
191 platform_device_register_simple("rtc-rp5c01", -1, 246 pdev = platform_device_register_simple("rtc-rp5c01", -1,
192 &amiga_rtc_resource, 1); 247 &amiga_rtc_resource, 1);
248 if (IS_ERR(pdev))
249 return PTR_ERR(pdev);
250 }
193 251
194 return 0; 252 return 0;
195} 253}
196 254
197device_initcall(amiga_init_devices); 255arch_initcall(amiga_init_devices);
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index 783d8f02360d..3f41092d1b70 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -206,7 +206,7 @@ void __init atari_init_IRQ(void)
206 * hardware with a programmable int vector (probably a VME board). 206 * hardware with a programmable int vector (probably a VME board).
207 */ 207 */
208 208
209unsigned long atari_register_vme_int(void) 209unsigned int atari_register_vme_int(void)
210{ 210{
211 int i; 211 int i;
212 212
@@ -223,7 +223,7 @@ unsigned long atari_register_vme_int(void)
223EXPORT_SYMBOL(atari_register_vme_int); 223EXPORT_SYMBOL(atari_register_vme_int);
224 224
225 225
226void atari_unregister_vme_int(unsigned long irq) 226void atari_unregister_vme_int(unsigned int irq)
227{ 227{
228 if (irq >= VME_SOURCE_BASE && irq < VME_SOURCE_BASE + VME_MAX_SOURCES) { 228 if (irq >= VME_SOURCE_BASE && irq < VME_SOURCE_BASE + VME_MAX_SOURCES) {
229 irq -= VME_SOURCE_BASE; 229 irq -= VME_SOURCE_BASE;
diff --git a/arch/m68k/include/asm/atariints.h b/arch/m68k/include/asm/atariints.h
index 656bbbf5a6ff..5fc13bdf9044 100644
--- a/arch/m68k/include/asm/atariints.h
+++ b/arch/m68k/include/asm/atariints.h
@@ -198,7 +198,7 @@ static inline int atari_irq_pending( unsigned irq )
198 return( get_mfp_bit( irq, MFP_PENDING ) ); 198 return( get_mfp_bit( irq, MFP_PENDING ) );
199} 199}
200 200
201unsigned long atari_register_vme_int( void ); 201unsigned int atari_register_vme_int(void);
202void atari_unregister_vme_int( unsigned long ); 202void atari_unregister_vme_int(unsigned int);
203 203
204#endif /* linux/atariints.h */ 204#endif /* linux/atariints.h */
diff --git a/arch/m68k/include/asm/entry.h b/arch/m68k/include/asm/entry.h
index 622138dc7288..d7de0f1a8957 100644
--- a/arch/m68k/include/asm/entry.h
+++ b/arch/m68k/include/asm/entry.h
@@ -33,13 +33,11 @@
33 33
34/* the following macro is used when enabling interrupts */ 34/* the following macro is used when enabling interrupts */
35#if defined(MACH_ATARI_ONLY) 35#if defined(MACH_ATARI_ONLY)
36 /* block out HSYNC on the atari */ 36 /* block out HSYNC = ipl 2 on the atari */
37#define ALLOWINT (~0x400) 37#define ALLOWINT (~0x500)
38#define MAX_NOINT_IPL 3
39#else 38#else
40 /* portable version */ 39 /* portable version */
41#define ALLOWINT (~0x700) 40#define ALLOWINT (~0x700)
42#define MAX_NOINT_IPL 0
43#endif /* machine compilation types */ 41#endif /* machine compilation types */
44 42
45#ifdef __ASSEMBLY__ 43#ifdef __ASSEMBLY__
diff --git a/arch/m68k/include/asm/io_mm.h b/arch/m68k/include/asm/io_mm.h
index 0fb3468000e7..fa4324bcf566 100644
--- a/arch/m68k/include/asm/io_mm.h
+++ b/arch/m68k/include/asm/io_mm.h
@@ -278,6 +278,13 @@ static inline void isa_delay(void)
278#define readl(addr) in_le32(addr) 278#define readl(addr) in_le32(addr)
279#define writel(val,addr) out_le32((addr),(val)) 279#define writel(val,addr) out_le32((addr),(val))
280 280
281#define readsb(port, buf, nr) raw_insb((port), (u8 *)(buf), (nr))
282#define readsw(port, buf, nr) raw_insw((port), (u16 *)(buf), (nr))
283#define readsl(port, buf, nr) raw_insl((port), (u32 *)(buf), (nr))
284#define writesb(port, buf, nr) raw_outsb((port), (u8 *)(buf), (nr))
285#define writesw(port, buf, nr) raw_outsw((port), (u16 *)(buf), (nr))
286#define writesl(port, buf, nr) raw_outsl((port), (u32 *)(buf), (nr))
287
281#define mmiowb() 288#define mmiowb()
282 289
283static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) 290static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
diff --git a/arch/m68k/include/asm/vga.h b/arch/m68k/include/asm/vga.h
new file mode 100644
index 000000000000..d3aa1401e7aa
--- /dev/null
+++ b/arch/m68k/include/asm/vga.h
@@ -0,0 +1,27 @@
1#ifndef _ASM_M68K_VGA_H
2#define _ASM_M68K_VGA_H
3
4#include <asm/raw_io.h>
5
6/*
7 * FIXME
8 * Ugh, we don't have PCI space, so map readb() and friends to use raw I/O
9 * accessors, which are identical to the z_*() Zorro bus accessors.
10 * This should make cirrusfb work again on Amiga
11 */
12#undef inb_p
13#undef inw_p
14#undef outb_p
15#undef outw
16#undef readb
17#undef writeb
18#undef writew
19#define inb_p(port) 0
20#define inw_p(port) 0
21#define outb_p(port, val) do { } while (0)
22#define outw(port, val) do { } while (0)
23#define readb raw_inb
24#define writeb raw_outb
25#define writew raw_outw
26
27#endif /* _ASM_M68K_VGA_H */
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index 6b020a8461e7..aeebbb7b30f0 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -72,7 +72,8 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
72{ 72{
73 struct mm_struct *mm = current->mm; 73 struct mm_struct *mm = current->mm;
74 struct vm_area_struct * vma; 74 struct vm_area_struct * vma;
75 int write, fault; 75 int fault;
76 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
76 77
77#ifdef DEBUG 78#ifdef DEBUG
78 printk ("do page fault:\nregs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld, %p\n", 79 printk ("do page fault:\nregs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld, %p\n",
@@ -87,6 +88,7 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
87 if (in_atomic() || !mm) 88 if (in_atomic() || !mm)
88 goto no_context; 89 goto no_context;
89 90
91retry:
90 down_read(&mm->mmap_sem); 92 down_read(&mm->mmap_sem);
91 93
92 vma = find_vma(mm, address); 94 vma = find_vma(mm, address);
@@ -117,14 +119,13 @@ good_area:
117#ifdef DEBUG 119#ifdef DEBUG
118 printk("do_page_fault: good_area\n"); 120 printk("do_page_fault: good_area\n");
119#endif 121#endif
120 write = 0;
121 switch (error_code & 3) { 122 switch (error_code & 3) {
122 default: /* 3: write, present */ 123 default: /* 3: write, present */
123 /* fall through */ 124 /* fall through */
124 case 2: /* write, not present */ 125 case 2: /* write, not present */
125 if (!(vma->vm_flags & VM_WRITE)) 126 if (!(vma->vm_flags & VM_WRITE))
126 goto acc_err; 127 goto acc_err;
127 write++; 128 flags |= FAULT_FLAG_WRITE;
128 break; 129 break;
129 case 1: /* read, present */ 130 case 1: /* read, present */
130 goto acc_err; 131 goto acc_err;
@@ -139,10 +140,14 @@ good_area:
139 * the fault. 140 * the fault.
140 */ 141 */
141 142
142 fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); 143 fault = handle_mm_fault(mm, vma, address, flags);
143#ifdef DEBUG 144#ifdef DEBUG
144 printk("handle_mm_fault returns %d\n",fault); 145 printk("handle_mm_fault returns %d\n",fault);
145#endif 146#endif
147
148 if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
149 return 0;
150
146 if (unlikely(fault & VM_FAULT_ERROR)) { 151 if (unlikely(fault & VM_FAULT_ERROR)) {
147 if (fault & VM_FAULT_OOM) 152 if (fault & VM_FAULT_OOM)
148 goto out_of_memory; 153 goto out_of_memory;
@@ -150,10 +155,31 @@ good_area:
150 goto bus_err; 155 goto bus_err;
151 BUG(); 156 BUG();
152 } 157 }
153 if (fault & VM_FAULT_MAJOR) 158
154 current->maj_flt++; 159 /*
155 else 160 * Major/minor page fault accounting is only done on the
156 current->min_flt++; 161 * initial attempt. If we go through a retry, it is extremely
162 * likely that the page will be found in page cache at that point.
163 */
164 if (flags & FAULT_FLAG_ALLOW_RETRY) {
165 if (fault & VM_FAULT_MAJOR)
166 current->maj_flt++;
167 else
168 current->min_flt++;
169 if (fault & VM_FAULT_RETRY) {
170 /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
171 * of starvation. */
172 flags &= ~FAULT_FLAG_ALLOW_RETRY;
173
174 /*
175 * No need to up_read(&mm->mmap_sem) as we would
176 * have already released it in __lock_page_or_retry
177 * in mm/filemap.c.
178 */
179
180 goto retry;
181 }
182 }
157 183
158 up_read(&mm->mmap_sem); 184 up_read(&mm->mmap_sem);
159 return 0; 185 return 0;