aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 20:48:00 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 20:48:00 -0500
commit1480d0a31db62b9803f829cc0e5cc71935ffe3cc (patch)
treec7c18939b5a0d51f23f7ca8606ecf00fa69741aa
parentfc8e3d177fa8073895d37b50282489dbeec89eb1 (diff)
parent46595ffbfc8ba79f27cdf8a029ee068b3b34c69f (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-arm
-rw-r--r--arch/arm/common/dmabounce.c165
-rw-r--r--arch/arm/configs/ixdp2400_defconfig2
-rw-r--r--arch/arm/configs/ixdp2800_defconfig2
-rw-r--r--arch/arm/kernel/traps.c29
-rw-r--r--arch/arm/lib/ashldi3.S48
-rw-r--r--arch/arm/lib/ashldi3.c56
-rw-r--r--arch/arm/lib/ashrdi3.S48
-rw-r--r--arch/arm/lib/ashrdi3.c57
-rw-r--r--arch/arm/lib/gcclib.h22
-rw-r--r--arch/arm/lib/lshrdi3.S48
-rw-r--r--arch/arm/lib/lshrdi3.c56
-rw-r--r--arch/arm/lib/muldi3.S44
-rw-r--r--arch/arm/lib/muldi3.c72
-rw-r--r--arch/arm/lib/ucmpdi2.S35
-rw-r--r--arch/arm/lib/ucmpdi2.c49
-rw-r--r--arch/arm/mach-pxa/corgi.c20
-rw-r--r--arch/arm/mach-pxa/poodle.c21
-rw-r--r--arch/arm/mach-pxa/spitz.c19
-rw-r--r--arch/arm/mm/copypage-v6.c16
-rw-r--r--drivers/acorn/char/pcf8583.c80
-rw-r--r--drivers/mfd/ucb1x00-ts.c74
-rw-r--r--drivers/net/irda/pxaficp_ir.c14
-rw-r--r--drivers/pcmcia/Makefile1
-rw-r--r--drivers/pcmcia/pxa2xx_sharpsl.c31
-rw-r--r--drivers/pcmcia/sa1100_generic.c7
-rw-r--r--include/asm-arm/arch-ixp2000/ixdp2x01.h2
-rw-r--r--include/asm-arm/arch-ixp4xx/io.h6
27 files changed, 557 insertions, 467 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index cbf2165476b0..ad6c89a555bb 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -33,8 +33,8 @@
33#include <asm/cacheflush.h> 33#include <asm/cacheflush.h>
34 34
35#undef DEBUG 35#undef DEBUG
36
37#undef STATS 36#undef STATS
37
38#ifdef STATS 38#ifdef STATS
39#define DO_STATS(X) do { X ; } while (0) 39#define DO_STATS(X) do { X ; } while (0)
40#else 40#else
@@ -52,26 +52,31 @@ struct safe_buffer {
52 int direction; 52 int direction;
53 53
54 /* safe buffer info */ 54 /* safe buffer info */
55 struct dma_pool *pool; 55 struct dmabounce_pool *pool;
56 void *safe; 56 void *safe;
57 dma_addr_t safe_dma_addr; 57 dma_addr_t safe_dma_addr;
58}; 58};
59 59
60struct dmabounce_pool {
61 unsigned long size;
62 struct dma_pool *pool;
63#ifdef STATS
64 unsigned long allocs;
65#endif
66};
67
60struct dmabounce_device_info { 68struct dmabounce_device_info {
61 struct list_head node; 69 struct list_head node;
62 70
63 struct device *dev; 71 struct device *dev;
64 struct dma_pool *small_buffer_pool;
65 struct dma_pool *large_buffer_pool;
66 struct list_head safe_buffers; 72 struct list_head safe_buffers;
67 unsigned long small_buffer_size, large_buffer_size;
68#ifdef STATS 73#ifdef STATS
69 unsigned long sbp_allocs;
70 unsigned long lbp_allocs;
71 unsigned long total_allocs; 74 unsigned long total_allocs;
72 unsigned long map_op_count; 75 unsigned long map_op_count;
73 unsigned long bounce_count; 76 unsigned long bounce_count;
74#endif 77#endif
78 struct dmabounce_pool small;
79 struct dmabounce_pool large;
75}; 80};
76 81
77static LIST_HEAD(dmabounce_devs); 82static LIST_HEAD(dmabounce_devs);
@@ -82,9 +87,9 @@ static void print_alloc_stats(struct dmabounce_device_info *device_info)
82 printk(KERN_INFO 87 printk(KERN_INFO
83 "%s: dmabounce: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n", 88 "%s: dmabounce: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n",
84 device_info->dev->bus_id, 89 device_info->dev->bus_id,
85 device_info->sbp_allocs, device_info->lbp_allocs, 90 device_info->small.allocs, device_info->large.allocs,
86 device_info->total_allocs - device_info->sbp_allocs - 91 device_info->total_allocs - device_info->small.allocs -
87 device_info->lbp_allocs, 92 device_info->large.allocs,
88 device_info->total_allocs); 93 device_info->total_allocs);
89} 94}
90#endif 95#endif
@@ -106,18 +111,22 @@ find_dmabounce_dev(struct device *dev)
106/* allocate a 'safe' buffer and keep track of it */ 111/* allocate a 'safe' buffer and keep track of it */
107static inline struct safe_buffer * 112static inline struct safe_buffer *
108alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr, 113alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
109 size_t size, enum dma_data_direction dir) 114 size_t size, enum dma_data_direction dir)
110{ 115{
111 struct safe_buffer *buf; 116 struct safe_buffer *buf;
112 struct dma_pool *pool; 117 struct dmabounce_pool *pool;
113 struct device *dev = device_info->dev; 118 struct device *dev = device_info->dev;
114 void *safe;
115 dma_addr_t safe_dma_addr;
116 119
117 dev_dbg(dev, "%s(ptr=%p, size=%d, dir=%d)\n", 120 dev_dbg(dev, "%s(ptr=%p, size=%d, dir=%d)\n",
118 __func__, ptr, size, dir); 121 __func__, ptr, size, dir);
119 122
120 DO_STATS ( device_info->total_allocs++ ); 123 if (size <= device_info->small.size) {
124 pool = &device_info->small;
125 } else if (size <= device_info->large.size) {
126 pool = &device_info->large;
127 } else {
128 pool = NULL;
129 }
121 130
122 buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC); 131 buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC);
123 if (buf == NULL) { 132 if (buf == NULL) {
@@ -125,41 +134,35 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
125 return NULL; 134 return NULL;
126 } 135 }
127 136
128 if (size <= device_info->small_buffer_size) { 137 buf->ptr = ptr;
129 pool = device_info->small_buffer_pool; 138 buf->size = size;
130 safe = dma_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr); 139 buf->direction = dir;
131 140 buf->pool = pool;
132 DO_STATS ( device_info->sbp_allocs++ );
133 } else if (size <= device_info->large_buffer_size) {
134 pool = device_info->large_buffer_pool;
135 safe = dma_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr);
136 141
137 DO_STATS ( device_info->lbp_allocs++ ); 142 if (pool) {
143 buf->safe = dma_pool_alloc(pool->pool, GFP_ATOMIC,
144 &buf->safe_dma_addr);
138 } else { 145 } else {
139 pool = NULL; 146 buf->safe = dma_alloc_coherent(dev, size, &buf->safe_dma_addr,
140 safe = dma_alloc_coherent(dev, size, &safe_dma_addr, GFP_ATOMIC); 147 GFP_ATOMIC);
141 } 148 }
142 149
143 if (safe == NULL) { 150 if (buf->safe == NULL) {
144 dev_warn(device_info->dev, 151 dev_warn(dev,
145 "%s: could not alloc dma memory (size=%d)\n", 152 "%s: could not alloc dma memory (size=%d)\n",
146 __func__, size); 153 __func__, size);
147 kfree(buf); 154 kfree(buf);
148 return NULL; 155 return NULL;
149 } 156 }
150 157
151#ifdef STATS 158#ifdef STATS
159 if (pool)
160 pool->allocs++;
161 device_info->total_allocs++;
152 if (device_info->total_allocs % 1000 == 0) 162 if (device_info->total_allocs % 1000 == 0)
153 print_alloc_stats(device_info); 163 print_alloc_stats(device_info);
154#endif 164#endif
155 165
156 buf->ptr = ptr;
157 buf->size = size;
158 buf->direction = dir;
159 buf->pool = pool;
160 buf->safe = safe;
161 buf->safe_dma_addr = safe_dma_addr;
162
163 list_add(&buf->node, &device_info->safe_buffers); 166 list_add(&buf->node, &device_info->safe_buffers);
164 167
165 return buf; 168 return buf;
@@ -186,7 +189,7 @@ free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer *
186 list_del(&buf->node); 189 list_del(&buf->node);
187 190
188 if (buf->pool) 191 if (buf->pool)
189 dma_pool_free(buf->pool, buf->safe, buf->safe_dma_addr); 192 dma_pool_free(buf->pool->pool, buf->safe, buf->safe_dma_addr);
190 else 193 else
191 dma_free_coherent(device_info->dev, buf->size, buf->safe, 194 dma_free_coherent(device_info->dev, buf->size, buf->safe,
192 buf->safe_dma_addr); 195 buf->safe_dma_addr);
@@ -197,12 +200,10 @@ free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer *
197/* ************************************************** */ 200/* ************************************************** */
198 201
199#ifdef STATS 202#ifdef STATS
200
201static void print_map_stats(struct dmabounce_device_info *device_info) 203static void print_map_stats(struct dmabounce_device_info *device_info)
202{ 204{
203 printk(KERN_INFO 205 dev_info(device_info->dev,
204 "%s: dmabounce: map_op_count=%lu, bounce_count=%lu\n", 206 "dmabounce: map_op_count=%lu, bounce_count=%lu\n",
205 device_info->dev->bus_id,
206 device_info->map_op_count, device_info->bounce_count); 207 device_info->map_op_count, device_info->bounce_count);
207} 208}
208#endif 209#endif
@@ -258,13 +259,13 @@ map_single(struct device *dev, void *ptr, size_t size,
258 __func__, ptr, buf->safe, size); 259 __func__, ptr, buf->safe, size);
259 memcpy(buf->safe, ptr, size); 260 memcpy(buf->safe, ptr, size);
260 } 261 }
261 consistent_sync(buf->safe, size, dir); 262 ptr = buf->safe;
262 263
263 dma_addr = buf->safe_dma_addr; 264 dma_addr = buf->safe_dma_addr;
264 } else {
265 consistent_sync(ptr, size, dir);
266 } 265 }
267 266
267 consistent_sync(ptr, size, dir);
268
268 return dma_addr; 269 return dma_addr;
269} 270}
270 271
@@ -278,7 +279,7 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
278 /* 279 /*
279 * Trying to unmap an invalid mapping 280 * Trying to unmap an invalid mapping
280 */ 281 */
281 if (dma_addr == ~0) { 282 if (dma_mapping_error(dma_addr)) {
282 dev_err(dev, "Trying to unmap invalid mapping\n"); 283 dev_err(dev, "Trying to unmap invalid mapping\n");
283 return; 284 return;
284 } 285 }
@@ -570,11 +571,25 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
570 local_irq_restore(flags); 571 local_irq_restore(flags);
571} 572}
572 573
574static int
575dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, const char *name,
576 unsigned long size)
577{
578 pool->size = size;
579 DO_STATS(pool->allocs = 0);
580 pool->pool = dma_pool_create(name, dev, size,
581 0 /* byte alignment */,
582 0 /* no page-crossing issues */);
583
584 return pool->pool ? 0 : -ENOMEM;
585}
586
573int 587int
574dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size, 588dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
575 unsigned long large_buffer_size) 589 unsigned long large_buffer_size)
576{ 590{
577 struct dmabounce_device_info *device_info; 591 struct dmabounce_device_info *device_info;
592 int ret;
578 593
579 device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC); 594 device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
580 if (!device_info) { 595 if (!device_info) {
@@ -584,45 +599,31 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
584 return -ENOMEM; 599 return -ENOMEM;
585 } 600 }
586 601
587 device_info->small_buffer_pool = 602 ret = dmabounce_init_pool(&device_info->small, dev,
588 dma_pool_create("small_dmabounce_pool", 603 "small_dmabounce_pool", small_buffer_size);
589 dev, 604 if (ret) {
590 small_buffer_size, 605 dev_err(dev,
591 0 /* byte alignment */, 606 "dmabounce: could not allocate DMA pool for %ld byte objects\n",
592 0 /* no page-crossing issues */); 607 small_buffer_size);
593 if (!device_info->small_buffer_pool) { 608 goto err_free;
594 printk(KERN_ERR
595 "dmabounce: could not allocate small DMA pool for %s\n",
596 dev->bus_id);
597 kfree(device_info);
598 return -ENOMEM;
599 } 609 }
600 610
601 if (large_buffer_size) { 611 if (large_buffer_size) {
602 device_info->large_buffer_pool = 612 ret = dmabounce_init_pool(&device_info->large, dev,
603 dma_pool_create("large_dmabounce_pool", 613 "large_dmabounce_pool",
604 dev, 614 large_buffer_size);
605 large_buffer_size, 615 if (ret) {
606 0 /* byte alignment */, 616 dev_err(dev,
607 0 /* no page-crossing issues */); 617 "dmabounce: could not allocate DMA pool for %ld byte objects\n",
608 if (!device_info->large_buffer_pool) { 618 large_buffer_size);
609 printk(KERN_ERR 619 goto err_destroy;
610 "dmabounce: could not allocate large DMA pool for %s\n",
611 dev->bus_id);
612 dma_pool_destroy(device_info->small_buffer_pool);
613
614 return -ENOMEM;
615 } 620 }
616 } 621 }
617 622
618 device_info->dev = dev; 623 device_info->dev = dev;
619 device_info->small_buffer_size = small_buffer_size;
620 device_info->large_buffer_size = large_buffer_size;
621 INIT_LIST_HEAD(&device_info->safe_buffers); 624 INIT_LIST_HEAD(&device_info->safe_buffers);
622 625
623#ifdef STATS 626#ifdef STATS
624 device_info->sbp_allocs = 0;
625 device_info->lbp_allocs = 0;
626 device_info->total_allocs = 0; 627 device_info->total_allocs = 0;
627 device_info->map_op_count = 0; 628 device_info->map_op_count = 0;
628 device_info->bounce_count = 0; 629 device_info->bounce_count = 0;
@@ -634,6 +635,12 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
634 dev->bus_id, dev->bus->name); 635 dev->bus_id, dev->bus->name);
635 636
636 return 0; 637 return 0;
638
639 err_destroy:
640 dma_pool_destroy(device_info->small.pool);
641 err_free:
642 kfree(device_info);
643 return ret;
637} 644}
638 645
639void 646void
@@ -655,10 +662,10 @@ dmabounce_unregister_dev(struct device *dev)
655 BUG(); 662 BUG();
656 } 663 }
657 664
658 if (device_info->small_buffer_pool) 665 if (device_info->small.pool)
659 dma_pool_destroy(device_info->small_buffer_pool); 666 dma_pool_destroy(device_info->small.pool);
660 if (device_info->large_buffer_pool) 667 if (device_info->large.pool)
661 dma_pool_destroy(device_info->large_buffer_pool); 668 dma_pool_destroy(device_info->large.pool);
662 669
663#ifdef STATS 670#ifdef STATS
664 print_alloc_stats(device_info); 671 print_alloc_stats(device_info);
diff --git a/arch/arm/configs/ixdp2400_defconfig b/arch/arm/configs/ixdp2400_defconfig
index 678720fa2e2e..ddeb9f99d662 100644
--- a/arch/arm/configs/ixdp2400_defconfig
+++ b/arch/arm/configs/ixdp2400_defconfig
@@ -559,7 +559,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
559# 559#
560CONFIG_SERIAL_8250=y 560CONFIG_SERIAL_8250=y
561CONFIG_SERIAL_8250_CONSOLE=y 561CONFIG_SERIAL_8250_CONSOLE=y
562CONFIG_SERIAL_8250_NR_UARTS=2 562CONFIG_SERIAL_8250_NR_UARTS=1
563# CONFIG_SERIAL_8250_EXTENDED is not set 563# CONFIG_SERIAL_8250_EXTENDED is not set
564 564
565# 565#
diff --git a/arch/arm/configs/ixdp2800_defconfig b/arch/arm/configs/ixdp2800_defconfig
index 261e2343903b..81d3a0606f95 100644
--- a/arch/arm/configs/ixdp2800_defconfig
+++ b/arch/arm/configs/ixdp2800_defconfig
@@ -559,7 +559,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
559# 559#
560CONFIG_SERIAL_8250=y 560CONFIG_SERIAL_8250=y
561CONFIG_SERIAL_8250_CONSOLE=y 561CONFIG_SERIAL_8250_CONSOLE=y
562CONFIG_SERIAL_8250_NR_UARTS=2 562CONFIG_SERIAL_8250_NR_UARTS=1
563# CONFIG_SERIAL_8250_EXTENDED is not set 563# CONFIG_SERIAL_8250_EXTENDED is not set
564 564
565# 565#
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 66e5a0516f23..45e9ea6cd2a5 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -198,25 +198,16 @@ void show_stack(struct task_struct *tsk, unsigned long *sp)
198 barrier(); 198 barrier();
199} 199}
200 200
201DEFINE_SPINLOCK(die_lock); 201static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs)
202
203/*
204 * This function is protected against re-entrancy.
205 */
206NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
207{ 202{
208 struct task_struct *tsk = current; 203 struct task_struct *tsk = thread->task;
209 static int die_counter; 204 static int die_counter;
210 205
211 console_verbose();
212 spin_lock_irq(&die_lock);
213 bust_spinlocks(1);
214
215 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter); 206 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter);
216 print_modules(); 207 print_modules();
217 __show_regs(regs); 208 __show_regs(regs);
218 printk("Process %s (pid: %d, stack limit = 0x%p)\n", 209 printk("Process %s (pid: %d, stack limit = 0x%p)\n",
219 tsk->comm, tsk->pid, tsk->thread_info + 1); 210 tsk->comm, tsk->pid, thread + 1);
220 211
221 if (!user_mode(regs) || in_interrupt()) { 212 if (!user_mode(regs) || in_interrupt()) {
222 dump_mem("Stack: ", regs->ARM_sp, 213 dump_mem("Stack: ", regs->ARM_sp,
@@ -224,7 +215,21 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
224 dump_backtrace(regs, tsk); 215 dump_backtrace(regs, tsk);
225 dump_instr(regs); 216 dump_instr(regs);
226 } 217 }
218}
227 219
220DEFINE_SPINLOCK(die_lock);
221
222/*
223 * This function is protected against re-entrancy.
224 */
225NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
226{
227 struct thread_info *thread = current_thread_info();
228
229 console_verbose();
230 spin_lock_irq(&die_lock);
231 bust_spinlocks(1);
232 __die(str, err, thread, regs);
228 bust_spinlocks(0); 233 bust_spinlocks(0);
229 spin_unlock_irq(&die_lock); 234 spin_unlock_irq(&die_lock);
230 do_exit(SIGSEGV); 235 do_exit(SIGSEGV);
diff --git a/arch/arm/lib/ashldi3.S b/arch/arm/lib/ashldi3.S
new file mode 100644
index 000000000000..561e20717b30
--- /dev/null
+++ b/arch/arm/lib/ashldi3.S
@@ -0,0 +1,48 @@
1/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2 Free Software Foundation, Inc.
3
4This file is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the
6Free Software Foundation; either version 2, or (at your option) any
7later version.
8
9In addition to the permissions in the GNU General Public License, the
10Free Software Foundation gives you unlimited permission to link the
11compiled version of this file into combinations with other programs,
12and to distribute those combinations without any restriction coming
13from the use of this file. (The General Public License restrictions
14do apply in other respects; for example, they cover modification of
15the file, and distribution when not linked into a combine
16executable.)
17
18This file is distributed in the hope that it will be useful, but
19WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; see the file COPYING. If not, write to
25the Free Software Foundation, 51 Franklin Street, Fifth Floor,
26Boston, MA 02110-1301, USA. */
27
28
29#include <linux/linkage.h>
30
31#ifdef __ARMEB__
32#define al r1
33#define ah r0
34#else
35#define al r0
36#define ah r1
37#endif
38
39ENTRY(__ashldi3)
40
41 subs r3, r2, #32
42 rsb ip, r2, #32
43 movmi ah, ah, lsl r2
44 movpl ah, al, lsl r3
45 orrmi ah, ah, al, lsr ip
46 mov al, al, lsl r2
47 mov pc, lr
48
diff --git a/arch/arm/lib/ashldi3.c b/arch/arm/lib/ashldi3.c
deleted file mode 100644
index b62875cfd8f8..000000000000
--- a/arch/arm/lib/ashldi3.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34s64 __ashldi3(s64 u, int b)
35{
36 DIunion w;
37 int bm;
38 DIunion uu;
39
40 if (b == 0)
41 return u;
42
43 uu.ll = u;
44
45 bm = (sizeof(s32) * BITS_PER_UNIT) - b;
46 if (bm <= 0) {
47 w.s.low = 0;
48 w.s.high = (u32) uu.s.low << -bm;
49 } else {
50 u32 carries = (u32) uu.s.low >> bm;
51 w.s.low = (u32) uu.s.low << b;
52 w.s.high = ((u32) uu.s.high << b) | carries;
53 }
54
55 return w.ll;
56}
diff --git a/arch/arm/lib/ashrdi3.S b/arch/arm/lib/ashrdi3.S
new file mode 100644
index 000000000000..86fb2a90c301
--- /dev/null
+++ b/arch/arm/lib/ashrdi3.S
@@ -0,0 +1,48 @@
1/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2 Free Software Foundation, Inc.
3
4This file is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the
6Free Software Foundation; either version 2, or (at your option) any
7later version.
8
9In addition to the permissions in the GNU General Public License, the
10Free Software Foundation gives you unlimited permission to link the
11compiled version of this file into combinations with other programs,
12and to distribute those combinations without any restriction coming
13from the use of this file. (The General Public License restrictions
14do apply in other respects; for example, they cover modification of
15the file, and distribution when not linked into a combine
16executable.)
17
18This file is distributed in the hope that it will be useful, but
19WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; see the file COPYING. If not, write to
25the Free Software Foundation, 51 Franklin Street, Fifth Floor,
26Boston, MA 02110-1301, USA. */
27
28
29#include <linux/linkage.h>
30
31#ifdef __ARMEB__
32#define al r1
33#define ah r0
34#else
35#define al r0
36#define ah r1
37#endif
38
39ENTRY(__ashrdi3)
40
41 subs r3, r2, #32
42 rsb ip, r2, #32
43 movmi al, al, lsr r2
44 movpl al, ah, asr r3
45 orrmi al, al, ah, lsl ip
46 mov ah, ah, asr r2
47 mov pc, lr
48
diff --git a/arch/arm/lib/ashrdi3.c b/arch/arm/lib/ashrdi3.c
deleted file mode 100644
index 9a8600a7543f..000000000000
--- a/arch/arm/lib/ashrdi3.c
+++ /dev/null
@@ -1,57 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34s64 __ashrdi3(s64 u, int b)
35{
36 DIunion w;
37 int bm;
38 DIunion uu;
39
40 if (b == 0)
41 return u;
42
43 uu.ll = u;
44
45 bm = (sizeof(s32) * BITS_PER_UNIT) - b;
46 if (bm <= 0) {
47 /* w.s.high = 1..1 or 0..0 */
48 w.s.high = uu.s.high >> (sizeof(s32) * BITS_PER_UNIT - 1);
49 w.s.low = uu.s.high >> -bm;
50 } else {
51 u32 carries = (u32) uu.s.high << bm;
52 w.s.high = uu.s.high >> b;
53 w.s.low = ((u32) uu.s.low >> b) | carries;
54 }
55
56 return w.ll;
57}
diff --git a/arch/arm/lib/gcclib.h b/arch/arm/lib/gcclib.h
deleted file mode 100644
index 8b6dcc656de7..000000000000
--- a/arch/arm/lib/gcclib.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* gcclib.h -- definitions for various functions 'borrowed' from gcc-2.95.3 */
2/* I Molton 29/07/01 */
3
4#include <linux/types.h>
5
6#define BITS_PER_UNIT 8
7#define SI_TYPE_SIZE (sizeof(s32) * BITS_PER_UNIT)
8
9#ifdef __ARMEB__
10struct DIstruct {
11 s32 high, low;
12};
13#else
14struct DIstruct {
15 s32 low, high;
16};
17#endif
18
19typedef union {
20 struct DIstruct s;
21 s64 ll;
22} DIunion;
diff --git a/arch/arm/lib/lshrdi3.S b/arch/arm/lib/lshrdi3.S
new file mode 100644
index 000000000000..46c2ed19ec95
--- /dev/null
+++ b/arch/arm/lib/lshrdi3.S
@@ -0,0 +1,48 @@
1/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2 Free Software Foundation, Inc.
3
4This file is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the
6Free Software Foundation; either version 2, or (at your option) any
7later version.
8
9In addition to the permissions in the GNU General Public License, the
10Free Software Foundation gives you unlimited permission to link the
11compiled version of this file into combinations with other programs,
12and to distribute those combinations without any restriction coming
13from the use of this file. (The General Public License restrictions
14do apply in other respects; for example, they cover modification of
15the file, and distribution when not linked into a combine
16executable.)
17
18This file is distributed in the hope that it will be useful, but
19WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; see the file COPYING. If not, write to
25the Free Software Foundation, 51 Franklin Street, Fifth Floor,
26Boston, MA 02110-1301, USA. */
27
28
29#include <linux/linkage.h>
30
31#ifdef __ARMEB__
32#define al r1
33#define ah r0
34#else
35#define al r0
36#define ah r1
37#endif
38
39ENTRY(__lshrdi3)
40
41 subs r3, r2, #32
42 rsb ip, r2, #32
43 movmi al, al, lsr r2
44 movpl al, ah, lsr r3
45 orrmi al, al, ah, lsl ip
46 mov ah, ah, lsr r2
47 mov pc, lr
48
diff --git a/arch/arm/lib/lshrdi3.c b/arch/arm/lib/lshrdi3.c
deleted file mode 100644
index 3681f49d2b6e..000000000000
--- a/arch/arm/lib/lshrdi3.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34s64 __lshrdi3(s64 u, int b)
35{
36 DIunion w;
37 int bm;
38 DIunion uu;
39
40 if (b == 0)
41 return u;
42
43 uu.ll = u;
44
45 bm = (sizeof(s32) * BITS_PER_UNIT) - b;
46 if (bm <= 0) {
47 w.s.high = 0;
48 w.s.low = (u32) uu.s.high >> -bm;
49 } else {
50 u32 carries = (u32) uu.s.high << bm;
51 w.s.high = (u32) uu.s.high >> b;
52 w.s.low = ((u32) uu.s.low >> b) | carries;
53 }
54
55 return w.ll;
56}
diff --git a/arch/arm/lib/muldi3.S b/arch/arm/lib/muldi3.S
new file mode 100644
index 000000000000..c7fbdf005319
--- /dev/null
+++ b/arch/arm/lib/muldi3.S
@@ -0,0 +1,44 @@
1/*
2 * linux/arch/arm/lib/muldi3.S
3 *
4 * Author: Nicolas Pitre
5 * Created: Oct 19, 2005
6 * Copyright: Monta Vista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/linkage.h>
14
15#ifdef __ARMEB__
16#define xh r0
17#define xl r1
18#define yh r2
19#define yl r3
20#else
21#define xl r0
22#define xh r1
23#define yl r2
24#define yh r3
25#endif
26
27ENTRY(__muldi3)
28
29 mul xh, yl, xh
30 mla xh, xl, yh, xh
31 mov ip, xl, asr #16
32 mov yh, yl, asr #16
33 bic xl, xl, ip, lsl #16
34 bic yl, yl, yh, lsl #16
35 mla xh, yh, ip, xh
36 mul yh, xl, yh
37 mul xl, yl, xl
38 mul ip, yl, ip
39 adds xl, xl, yh, lsl #16
40 adc xh, xh, yh, lsr #16
41 adds xl, xl, ip, lsl #16
42 adc xh, xh, ip, lsr #16
43 mov pc, lr
44
diff --git a/arch/arm/lib/muldi3.c b/arch/arm/lib/muldi3.c
deleted file mode 100644
index 0a3b93313f18..000000000000
--- a/arch/arm/lib/muldi3.c
+++ /dev/null
@@ -1,72 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34#define umul_ppmm(xh, xl, a, b) \
35{register u32 __t0, __t1, __t2; \
36 __asm__ ("%@ Inlined umul_ppmm \n\
37 mov %2, %5, lsr #16 \n\
38 mov %0, %6, lsr #16 \n\
39 bic %3, %5, %2, lsl #16 \n\
40 bic %4, %6, %0, lsl #16 \n\
41 mul %1, %3, %4 \n\
42 mul %4, %2, %4 \n\
43 mul %3, %0, %3 \n\
44 mul %0, %2, %0 \n\
45 adds %3, %4, %3 \n\
46 addcs %0, %0, #65536 \n\
47 adds %1, %1, %3, lsl #16 \n\
48 adc %0, %0, %3, lsr #16" \
49 : "=&r" ((u32) (xh)), \
50 "=r" ((u32) (xl)), \
51 "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
52 : "r" ((u32) (a)), \
53 "r" ((u32) (b)));}
54
55#define __umulsidi3(u, v) \
56 ({DIunion __w; \
57 umul_ppmm (__w.s.high, __w.s.low, u, v); \
58 __w.ll; })
59
60s64 __muldi3(s64 u, s64 v)
61{
62 DIunion w;
63 DIunion uu, vv;
64
65 uu.ll = u, vv.ll = v;
66
67 w.ll = __umulsidi3(uu.s.low, vv.s.low);
68 w.s.high += ((u32) uu.s.low * (u32) vv.s.high
69 + (u32) uu.s.high * (u32) vv.s.low);
70
71 return w.ll;
72}
diff --git a/arch/arm/lib/ucmpdi2.S b/arch/arm/lib/ucmpdi2.S
new file mode 100644
index 000000000000..112630f93e5d
--- /dev/null
+++ b/arch/arm/lib/ucmpdi2.S
@@ -0,0 +1,35 @@
1/*
2 * linux/arch/arm/lib/ucmpdi2.S
3 *
4 * Author: Nicolas Pitre
5 * Created: Oct 19, 2005
6 * Copyright: Monta Vista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/linkage.h>
14
15#ifdef __ARMEB__
16#define xh r0
17#define xl r1
18#define yh r2
19#define yl r3
20#else
21#define xl r0
22#define xh r1
23#define yl r2
24#define yh r3
25#endif
26
27ENTRY(__ucmpdi2)
28
29 cmp xh, yh
30 cmpeq xl, yl
31 movlo r0, #0
32 moveq r0, #1
33 movhi r0, #2
34 mov pc, lr
35
diff --git a/arch/arm/lib/ucmpdi2.c b/arch/arm/lib/ucmpdi2.c
deleted file mode 100644
index 57f3f2df3850..000000000000
--- a/arch/arm/lib/ucmpdi2.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22/* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License.
28 */
29/* support functions required by the kernel. based on code from gcc-2.95.3 */
30/* I Molton 29/07/01 */
31
32#include "gcclib.h"
33
34int __ucmpdi2(s64 a, s64 b)
35{
36 DIunion au, bu;
37
38 au.ll = a, bu.ll = b;
39
40 if ((u32) au.s.high < (u32) bu.s.high)
41 return 0;
42 else if ((u32) au.s.high > (u32) bu.s.high)
43 return 2;
44 if ((u32) au.s.low < (u32) bu.s.low)
45 return 0;
46 else if ((u32) au.s.low > (u32) bu.s.low)
47 return 2;
48 return 1;
49}
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 60c8b9d8bb9c..656f73bbcb5a 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -33,6 +33,7 @@
33 33
34#include <asm/arch/pxa-regs.h> 34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/irq.h> 35#include <asm/arch/irq.h>
36#include <asm/arch/irda.h>
36#include <asm/arch/mmc.h> 37#include <asm/arch/mmc.h>
37#include <asm/arch/udc.h> 38#include <asm/arch/udc.h>
38#include <asm/arch/corgi.h> 39#include <asm/arch/corgi.h>
@@ -224,6 +225,22 @@ static struct pxamci_platform_data corgi_mci_platform_data = {
224}; 225};
225 226
226 227
228/*
229 * Irda
230 */
231static void corgi_irda_transceiver_mode(struct device *dev, int mode)
232{
233 if (mode & IR_OFF)
234 GPSR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
235 else
236 GPCR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
237}
238
239static struct pxaficp_platform_data corgi_ficp_platform_data = {
240 .transceiver_cap = IR_SIRMODE | IR_OFF,
241 .transceiver_mode = corgi_irda_transceiver_mode,
242};
243
227 244
228/* 245/*
229 * USB Device Controller 246 * USB Device Controller
@@ -269,10 +286,13 @@ static void __init corgi_init(void)
269 286
270 corgi_ssp_set_machinfo(&corgi_ssp_machinfo); 287 corgi_ssp_set_machinfo(&corgi_ssp_machinfo);
271 288
289 pxa_gpio_mode(CORGI_GPIO_IR_ON | GPIO_OUT);
272 pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT); 290 pxa_gpio_mode(CORGI_GPIO_USB_PULLUP | GPIO_OUT);
273 pxa_gpio_mode(CORGI_GPIO_HSYNC | GPIO_IN); 291 pxa_gpio_mode(CORGI_GPIO_HSYNC | GPIO_IN);
292
274 pxa_set_udc_info(&udc_info); 293 pxa_set_udc_info(&udc_info);
275 pxa_set_mci_info(&corgi_mci_platform_data); 294 pxa_set_mci_info(&corgi_mci_platform_data);
295 pxa_set_ficp_info(&corgi_ficp_platform_data);
276 296
277 scoop_num = 1; 297 scoop_num = 1;
278 scoop_devs = &corgi_pcmcia_scoop[0]; 298 scoop_devs = &corgi_pcmcia_scoop[0];
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index f25638810017..6d413f6701a7 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -32,6 +32,7 @@
32#include <asm/arch/irq.h> 32#include <asm/arch/irq.h>
33#include <asm/arch/mmc.h> 33#include <asm/arch/mmc.h>
34#include <asm/arch/udc.h> 34#include <asm/arch/udc.h>
35#include <asm/arch/irda.h>
35#include <asm/arch/poodle.h> 36#include <asm/arch/poodle.h>
36#include <asm/arch/pxafb.h> 37#include <asm/arch/pxafb.h>
37 38
@@ -152,6 +153,24 @@ static struct pxamci_platform_data poodle_mci_platform_data = {
152 153
153 154
154/* 155/*
156 * Irda
157 */
158static void poodle_irda_transceiver_mode(struct device *dev, int mode)
159{
160 if (mode & IR_OFF) {
161 GPSR(POODLE_GPIO_IR_ON) = GPIO_bit(POODLE_GPIO_IR_ON);
162 } else {
163 GPCR(POODLE_GPIO_IR_ON) = GPIO_bit(POODLE_GPIO_IR_ON);
164 }
165}
166
167static struct pxaficp_platform_data poodle_ficp_platform_data = {
168 .transceiver_cap = IR_SIRMODE | IR_OFF,
169 .transceiver_mode = poodle_irda_transceiver_mode,
170};
171
172
173/*
155 * USB Device Controller 174 * USB Device Controller
156 */ 175 */
157static void poodle_udc_command(int cmd) 176static void poodle_udc_command(int cmd)
@@ -244,8 +263,10 @@ static void __init poodle_init(void)
244 263
245 set_pxa_fb_info(&poodle_fb_info); 264 set_pxa_fb_info(&poodle_fb_info);
246 pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT); 265 pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT);
266 pxa_gpio_mode(POODLE_GPIO_IR_ON | GPIO_OUT);
247 pxa_set_udc_info(&udc_info); 267 pxa_set_udc_info(&udc_info);
248 pxa_set_mci_info(&poodle_mci_platform_data); 268 pxa_set_mci_info(&poodle_mci_platform_data);
269 pxa_set_ficp_info(&poodle_ficp_platform_data);
249 270
250 scoop_num = 1; 271 scoop_num = 1;
251 scoop_devs = &poodle_pcmcia_scoop[0]; 272 scoop_devs = &poodle_pcmcia_scoop[0];
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index d0ab428c2d7d..b838842b6a20 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -34,6 +34,7 @@
34 34
35#include <asm/arch/pxa-regs.h> 35#include <asm/arch/pxa-regs.h>
36#include <asm/arch/irq.h> 36#include <asm/arch/irq.h>
37#include <asm/arch/irda.h>
37#include <asm/arch/mmc.h> 38#include <asm/arch/mmc.h>
38#include <asm/arch/udc.h> 39#include <asm/arch/udc.h>
39#include <asm/arch/pxafb.h> 40#include <asm/arch/pxafb.h>
@@ -277,6 +278,23 @@ static struct pxamci_platform_data spitz_mci_platform_data = {
277 278
278 279
279/* 280/*
281 * Irda
282 */
283static void spitz_irda_transceiver_mode(struct device *dev, int mode)
284{
285 if (mode & IR_OFF)
286 set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
287 else
288 reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
289}
290
291static struct pxaficp_platform_data spitz_ficp_platform_data = {
292 .transceiver_cap = IR_SIRMODE | IR_OFF,
293 .transceiver_mode = spitz_irda_transceiver_mode,
294};
295
296
297/*
280 * Spitz PXA Framebuffer 298 * Spitz PXA Framebuffer
281 */ 299 */
282static struct pxafb_mach_info spitz_pxafb_info __initdata = { 300static struct pxafb_mach_info spitz_pxafb_info __initdata = {
@@ -326,6 +344,7 @@ static void __init common_init(void)
326 344
327 platform_add_devices(devices, ARRAY_SIZE(devices)); 345 platform_add_devices(devices, ARRAY_SIZE(devices));
328 pxa_set_mci_info(&spitz_mci_platform_data); 346 pxa_set_mci_info(&spitz_mci_platform_data);
347 pxa_set_ficp_info(&spitz_ficp_platform_data);
329 set_pxa_fb_parent(&spitzssp_device.dev); 348 set_pxa_fb_parent(&spitzssp_device.dev);
330 set_pxa_fb_info(&spitz_pxafb_info); 349 set_pxa_fb_info(&spitz_pxafb_info);
331} 350}
diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c
index 27d041574ea7..269ce6913ee9 100644
--- a/arch/arm/mm/copypage-v6.c
+++ b/arch/arm/mm/copypage-v6.c
@@ -22,9 +22,7 @@
22#endif 22#endif
23 23
24#define from_address (0xffff8000) 24#define from_address (0xffff8000)
25#define from_pgprot PAGE_KERNEL
26#define to_address (0xffffc000) 25#define to_address (0xffffc000)
27#define to_pgprot PAGE_KERNEL
28 26
29#define TOP_PTE(x) pte_offset_kernel(top_pmd, x) 27#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
30 28
@@ -34,7 +32,7 @@ static DEFINE_SPINLOCK(v6_lock);
34 * Copy the user page. No aliasing to deal with so we can just 32 * Copy the user page. No aliasing to deal with so we can just
35 * attack the kernel's existing mapping of these pages. 33 * attack the kernel's existing mapping of these pages.
36 */ 34 */
37void v6_copy_user_page_nonaliasing(void *kto, const void *kfrom, unsigned long vaddr) 35static void v6_copy_user_page_nonaliasing(void *kto, const void *kfrom, unsigned long vaddr)
38{ 36{
39 copy_page(kto, kfrom); 37 copy_page(kto, kfrom);
40} 38}
@@ -43,7 +41,7 @@ void v6_copy_user_page_nonaliasing(void *kto, const void *kfrom, unsigned long v
43 * Clear the user page. No aliasing to deal with so we can just 41 * Clear the user page. No aliasing to deal with so we can just
44 * attack the kernel's existing mapping of this page. 42 * attack the kernel's existing mapping of this page.
45 */ 43 */
46void v6_clear_user_page_nonaliasing(void *kaddr, unsigned long vaddr) 44static void v6_clear_user_page_nonaliasing(void *kaddr, unsigned long vaddr)
47{ 45{
48 clear_page(kaddr); 46 clear_page(kaddr);
49} 47}
@@ -51,7 +49,7 @@ void v6_clear_user_page_nonaliasing(void *kaddr, unsigned long vaddr)
51/* 49/*
52 * Copy the page, taking account of the cache colour. 50 * Copy the page, taking account of the cache colour.
53 */ 51 */
54void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vaddr) 52static void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vaddr)
55{ 53{
56 unsigned int offset = CACHE_COLOUR(vaddr); 54 unsigned int offset = CACHE_COLOUR(vaddr);
57 unsigned long from, to; 55 unsigned long from, to;
@@ -72,8 +70,8 @@ void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vadd
72 */ 70 */
73 spin_lock(&v6_lock); 71 spin_lock(&v6_lock);
74 72
75 set_pte(TOP_PTE(from_address) + offset, pfn_pte(__pa(kfrom) >> PAGE_SHIFT, from_pgprot)); 73 set_pte(TOP_PTE(from_address) + offset, pfn_pte(__pa(kfrom) >> PAGE_SHIFT, PAGE_KERNEL));
76 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kto) >> PAGE_SHIFT, to_pgprot)); 74 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kto) >> PAGE_SHIFT, PAGE_KERNEL));
77 75
78 from = from_address + (offset << PAGE_SHIFT); 76 from = from_address + (offset << PAGE_SHIFT);
79 to = to_address + (offset << PAGE_SHIFT); 77 to = to_address + (offset << PAGE_SHIFT);
@@ -91,7 +89,7 @@ void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned long vadd
91 * so remap the kernel page into the same cache colour as the user 89 * so remap the kernel page into the same cache colour as the user
92 * page. 90 * page.
93 */ 91 */
94void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr) 92static void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr)
95{ 93{
96 unsigned int offset = CACHE_COLOUR(vaddr); 94 unsigned int offset = CACHE_COLOUR(vaddr);
97 unsigned long to = to_address + (offset << PAGE_SHIFT); 95 unsigned long to = to_address + (offset << PAGE_SHIFT);
@@ -112,7 +110,7 @@ void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr)
112 */ 110 */
113 spin_lock(&v6_lock); 111 spin_lock(&v6_lock);
114 112
115 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kaddr) >> PAGE_SHIFT, to_pgprot)); 113 set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kaddr) >> PAGE_SHIFT, PAGE_KERNEL));
116 flush_tlb_kernel_page(to); 114 flush_tlb_kernel_page(to);
117 clear_page((void *)to); 115 clear_page((void *)to);
118 116
diff --git a/drivers/acorn/char/pcf8583.c b/drivers/acorn/char/pcf8583.c
index 2b850e5860a0..e26f007a1417 100644
--- a/drivers/acorn/char/pcf8583.c
+++ b/drivers/acorn/char/pcf8583.c
@@ -9,6 +9,7 @@
9 * 9 *
10 * Driver for PCF8583 RTC & RAM chip 10 * Driver for PCF8583 RTC & RAM chip
11 */ 11 */
12#include <linux/module.h>
12#include <linux/i2c.h> 13#include <linux/i2c.h>
13#include <linux/slab.h> 14#include <linux/slab.h>
14#include <linux/string.h> 15#include <linux/string.h>
@@ -32,7 +33,8 @@ static struct i2c_client_address_data addr_data = {
32 .forces = forces, 33 .forces = forces,
33}; 34};
34 35
35#define DAT(x) ((unsigned int)(x->dev.driver_data)) 36#define set_ctrl(x, v) i2c_set_clientdata(x, (void *)(unsigned int)(v))
37#define get_ctrl(x) ((unsigned int)i2c_get_clientdata(x))
36 38
37static int 39static int
38pcf8583_attach(struct i2c_adapter *adap, int addr, int kind) 40pcf8583_attach(struct i2c_adapter *adap, int addr, int kind)
@@ -40,8 +42,17 @@ pcf8583_attach(struct i2c_adapter *adap, int addr, int kind)
40 struct i2c_client *c; 42 struct i2c_client *c;
41 unsigned char buf[1], ad[1] = { 0 }; 43 unsigned char buf[1], ad[1] = { 0 };
42 struct i2c_msg msgs[2] = { 44 struct i2c_msg msgs[2] = {
43 { addr, 0, 1, ad }, 45 {
44 { addr, I2C_M_RD, 1, buf } 46 .addr = addr,
47 .flags = 0,
48 .len = 1,
49 .buf = ad,
50 }, {
51 .addr = addr,
52 .flags = I2C_M_RD,
53 .len = 1,
54 .buf = buf,
55 }
45 }; 56 };
46 57
47 c = kmalloc(sizeof(*c), GFP_KERNEL); 58 c = kmalloc(sizeof(*c), GFP_KERNEL);
@@ -54,7 +65,7 @@ pcf8583_attach(struct i2c_adapter *adap, int addr, int kind)
54 c->driver = &pcf8583_driver; 65 c->driver = &pcf8583_driver;
55 66
56 if (i2c_transfer(c->adapter, msgs, 2) == 2) 67 if (i2c_transfer(c->adapter, msgs, 2) == 2)
57 DAT(c) = buf[0]; 68 set_ctrl(c, buf[0]);
58 69
59 return i2c_attach_client(c); 70 return i2c_attach_client(c);
60} 71}
@@ -78,8 +89,17 @@ pcf8583_get_datetime(struct i2c_client *client, struct rtc_tm *dt)
78{ 89{
79 unsigned char buf[8], addr[1] = { 1 }; 90 unsigned char buf[8], addr[1] = { 1 };
80 struct i2c_msg msgs[2] = { 91 struct i2c_msg msgs[2] = {
81 { client->addr, 0, 1, addr }, 92 {
82 { client->addr, I2C_M_RD, 6, buf } 93 .addr = client->addr,
94 .flags = 0,
95 .len = 1,
96 .buf = addr,
97 }, {
98 .addr = client->addr,
99 .flags = I2C_M_RD,
100 .len = 6,
101 .buf = buf,
102 }
83 }; 103 };
84 int ret = -EIO; 104 int ret = -EIO;
85 105
@@ -113,7 +133,7 @@ pcf8583_set_datetime(struct i2c_client *client, struct rtc_tm *dt, int datetoo)
113 int ret, len = 6; 133 int ret, len = 6;
114 134
115 buf[0] = 0; 135 buf[0] = 0;
116 buf[1] = DAT(client) | 0x80; 136 buf[1] = get_ctrl(client) | 0x80;
117 buf[2] = BIN_TO_BCD(dt->cs); 137 buf[2] = BIN_TO_BCD(dt->cs);
118 buf[3] = BIN_TO_BCD(dt->secs); 138 buf[3] = BIN_TO_BCD(dt->secs);
119 buf[4] = BIN_TO_BCD(dt->mins); 139 buf[4] = BIN_TO_BCD(dt->mins);
@@ -129,7 +149,7 @@ pcf8583_set_datetime(struct i2c_client *client, struct rtc_tm *dt, int datetoo)
129 if (ret == len) 149 if (ret == len)
130 ret = 0; 150 ret = 0;
131 151
132 buf[1] = DAT(client); 152 buf[1] = get_ctrl(client);
133 i2c_master_send(client, (char *)buf, 2); 153 i2c_master_send(client, (char *)buf, 2);
134 154
135 return ret; 155 return ret;
@@ -138,7 +158,7 @@ pcf8583_set_datetime(struct i2c_client *client, struct rtc_tm *dt, int datetoo)
138static int 158static int
139pcf8583_get_ctrl(struct i2c_client *client, unsigned char *ctrl) 159pcf8583_get_ctrl(struct i2c_client *client, unsigned char *ctrl)
140{ 160{
141 *ctrl = DAT(client); 161 *ctrl = get_ctrl(client);
142 return 0; 162 return 0;
143} 163}
144 164
@@ -149,7 +169,7 @@ pcf8583_set_ctrl(struct i2c_client *client, unsigned char *ctrl)
149 169
150 buf[0] = 0; 170 buf[0] = 0;
151 buf[1] = *ctrl; 171 buf[1] = *ctrl;
152 DAT(client) = *ctrl; 172 set_ctrl(client, *ctrl);
153 173
154 return i2c_master_send(client, (char *)buf, 2); 174 return i2c_master_send(client, (char *)buf, 2);
155} 175}
@@ -159,15 +179,23 @@ pcf8583_read_mem(struct i2c_client *client, struct mem *mem)
159{ 179{
160 unsigned char addr[1]; 180 unsigned char addr[1];
161 struct i2c_msg msgs[2] = { 181 struct i2c_msg msgs[2] = {
162 { client->addr, 0, 1, addr }, 182 {
163 { client->addr, I2C_M_RD, 0, mem->data } 183 .addr = client->addr,
184 .flags = 0,
185 .len = 1,
186 .buf = addr,
187 }, {
188 .addr = client->addr,
189 .flags = I2C_M_RD,
190 .len = mem->nr,
191 .buf = mem->data,
192 }
164 }; 193 };
165 194
166 if (mem->loc < 8) 195 if (mem->loc < 8)
167 return -EINVAL; 196 return -EINVAL;
168 197
169 addr[0] = mem->loc; 198 addr[0] = mem->loc;
170 msgs[1].len = mem->nr;
171 199
172 return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO; 200 return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO;
173} 201}
@@ -177,15 +205,23 @@ pcf8583_write_mem(struct i2c_client *client, struct mem *mem)
177{ 205{
178 unsigned char addr[1]; 206 unsigned char addr[1];
179 struct i2c_msg msgs[2] = { 207 struct i2c_msg msgs[2] = {
180 { client->addr, 0, 1, addr }, 208 {
181 { client->addr, 0, 0, mem->data } 209 .addr = client->addr,
210 .flags = 0,
211 .len = 1,
212 .buf = addr,
213 }, {
214 .addr = client->addr,
215 .flags = I2C_M_NOSTART,
216 .len = mem->nr,
217 .buf = mem->data,
218 }
182 }; 219 };
183 220
184 if (mem->loc < 8) 221 if (mem->loc < 8)
185 return -EINVAL; 222 return -EINVAL;
186 223
187 addr[0] = mem->loc; 224 addr[0] = mem->loc;
188 msgs[1].len = mem->nr;
189 225
190 return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO; 226 return i2c_transfer(client->adapter, msgs, 2) == 2 ? 0 : -EIO;
191} 227}
@@ -234,4 +270,14 @@ static __init int pcf8583_init(void)
234 return i2c_add_driver(&pcf8583_driver); 270 return i2c_add_driver(&pcf8583_driver);
235} 271}
236 272
237__initcall(pcf8583_init); 273static __exit void pcf8583_exit(void)
274{
275 i2c_del_driver(&pcf8583_driver);
276}
277
278module_init(pcf8583_init);
279module_exit(pcf8583_exit);
280
281MODULE_AUTHOR("Russell King");
282MODULE_DESCRIPTION("PCF8583 I2C RTC driver");
283MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c
index 585cded3d365..a984c0efabf0 100644
--- a/drivers/mfd/ucb1x00-ts.c
+++ b/drivers/mfd/ucb1x00-ts.c
@@ -32,9 +32,12 @@
32#include <linux/suspend.h> 32#include <linux/suspend.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <linux/kthread.h> 34#include <linux/kthread.h>
35#include <linux/delay.h>
35 36
36#include <asm/dma.h> 37#include <asm/dma.h>
37#include <asm/semaphore.h> 38#include <asm/semaphore.h>
39#include <asm/arch/collie.h>
40#include <asm/mach-types.h>
38 41
39#include "ucb1x00.h" 42#include "ucb1x00.h"
40 43
@@ -85,12 +88,23 @@ static inline void ucb1x00_ts_mode_int(struct ucb1x00_ts *ts)
85 */ 88 */
86static inline unsigned int ucb1x00_ts_read_pressure(struct ucb1x00_ts *ts) 89static inline unsigned int ucb1x00_ts_read_pressure(struct ucb1x00_ts *ts)
87{ 90{
88 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 91 if (machine_is_collie()) {
89 UCB_TS_CR_TSMX_POW | UCB_TS_CR_TSPX_POW | 92 ucb1x00_io_write(ts->ucb, COLLIE_TC35143_GPIO_TBL_CHK, 0);
90 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_GND | 93 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
91 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 94 UCB_TS_CR_TSPX_POW | UCB_TS_CR_TSMX_POW |
95 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA);
92 96
93 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_TSPY, ts->adcsync); 97 udelay(55);
98
99 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_AD2, ts->adcsync);
100 } else {
101 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
102 UCB_TS_CR_TSMX_POW | UCB_TS_CR_TSPX_POW |
103 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_GND |
104 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
105
106 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_TSPY, ts->adcsync);
107 }
94} 108}
95 109
96/* 110/*
@@ -101,12 +115,16 @@ static inline unsigned int ucb1x00_ts_read_pressure(struct ucb1x00_ts *ts)
101 */ 115 */
102static inline unsigned int ucb1x00_ts_read_xpos(struct ucb1x00_ts *ts) 116static inline unsigned int ucb1x00_ts_read_xpos(struct ucb1x00_ts *ts)
103{ 117{
104 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 118 if (machine_is_collie())
105 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW | 119 ucb1x00_io_write(ts->ucb, 0, COLLIE_TC35143_GPIO_TBL_CHK);
106 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 120 else {
107 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 121 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
108 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW | 122 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW |
109 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 123 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
124 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
125 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW |
126 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
127 }
110 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 128 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
111 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW | 129 UCB_TS_CR_TSMX_GND | UCB_TS_CR_TSPX_POW |
112 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA); 130 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA);
@@ -124,12 +142,17 @@ static inline unsigned int ucb1x00_ts_read_xpos(struct ucb1x00_ts *ts)
124 */ 142 */
125static inline unsigned int ucb1x00_ts_read_ypos(struct ucb1x00_ts *ts) 143static inline unsigned int ucb1x00_ts_read_ypos(struct ucb1x00_ts *ts)
126{ 144{
127 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 145 if (machine_is_collie())
128 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW | 146 ucb1x00_io_write(ts->ucb, 0, COLLIE_TC35143_GPIO_TBL_CHK);
129 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 147 else {
130 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 148 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
131 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW | 149 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW |
132 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA); 150 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
151 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
152 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW |
153 UCB_TS_CR_MODE_PRES | UCB_TS_CR_BIAS_ENA);
154 }
155
133 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 156 ucb1x00_reg_write(ts->ucb, UCB_TS_CR,
134 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW | 157 UCB_TS_CR_TSMY_GND | UCB_TS_CR_TSPY_POW |
135 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA); 158 UCB_TS_CR_MODE_POS | UCB_TS_CR_BIAS_ENA);
@@ -163,6 +186,15 @@ static inline unsigned int ucb1x00_ts_read_yres(struct ucb1x00_ts *ts)
163 return ucb1x00_adc_read(ts->ucb, 0, ts->adcsync); 186 return ucb1x00_adc_read(ts->ucb, 0, ts->adcsync);
164} 187}
165 188
189static inline int ucb1x00_ts_pen_down(struct ucb1x00_ts *ts)
190{
191 unsigned int val = ucb1x00_reg_read(ts->ucb, UCB_TS_CR);
192 if (machine_is_collie())
193 return (!(val & (UCB_TS_CR_TSPX_LOW)));
194 else
195 return (val & (UCB_TS_CR_TSPX_LOW | UCB_TS_CR_TSMX_LOW));
196}
197
166/* 198/*
167 * This is a RT kernel thread that handles the ADC accesses 199 * This is a RT kernel thread that handles the ADC accesses
168 * (mainly so we can use semaphores in the UCB1200 core code 200 * (mainly so we can use semaphores in the UCB1200 core code
@@ -186,7 +218,7 @@ static int ucb1x00_thread(void *_ts)
186 218
187 add_wait_queue(&ts->irq_wait, &wait); 219 add_wait_queue(&ts->irq_wait, &wait);
188 while (!kthread_should_stop()) { 220 while (!kthread_should_stop()) {
189 unsigned int x, y, p, val; 221 unsigned int x, y, p;
190 signed long timeout; 222 signed long timeout;
191 223
192 ts->restart = 0; 224 ts->restart = 0;
@@ -206,12 +238,12 @@ static int ucb1x00_thread(void *_ts)
206 msleep(10); 238 msleep(10);
207 239
208 ucb1x00_enable(ts->ucb); 240 ucb1x00_enable(ts->ucb);
209 val = ucb1x00_reg_read(ts->ucb, UCB_TS_CR);
210 241
211 if (val & (UCB_TS_CR_TSPX_LOW | UCB_TS_CR_TSMX_LOW)) { 242
243 if (ucb1x00_ts_pen_down(ts)) {
212 set_task_state(tsk, TASK_INTERRUPTIBLE); 244 set_task_state(tsk, TASK_INTERRUPTIBLE);
213 245
214 ucb1x00_enable_irq(ts->ucb, UCB_IRQ_TSPX, UCB_FALLING); 246 ucb1x00_enable_irq(ts->ucb, UCB_IRQ_TSPX, machine_is_collie() ? UCB_RISING : UCB_FALLING);
215 ucb1x00_disable(ts->ucb); 247 ucb1x00_disable(ts->ucb);
216 248
217 /* 249 /*
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index aef80f5e7c9c..b886b07412a6 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -704,15 +704,12 @@ static int pxa_irda_stop(struct net_device *dev)
704 return 0; 704 return 0;
705} 705}
706 706
707static int pxa_irda_suspend(struct device *_dev, pm_message_t state, u32 level) 707static int pxa_irda_suspend(struct device *_dev, pm_message_t state)
708{ 708{
709 struct net_device *dev = dev_get_drvdata(_dev); 709 struct net_device *dev = dev_get_drvdata(_dev);
710 struct pxa_irda *si; 710 struct pxa_irda *si;
711 711
712 if (!dev || level != SUSPEND_DISABLE) 712 if (dev && netif_running(dev)) {
713 return 0;
714
715 if (netif_running(dev)) {
716 si = netdev_priv(dev); 713 si = netdev_priv(dev);
717 netif_device_detach(dev); 714 netif_device_detach(dev);
718 pxa_irda_shutdown(si); 715 pxa_irda_shutdown(si);
@@ -721,15 +718,12 @@ static int pxa_irda_suspend(struct device *_dev, pm_message_t state, u32 level)
721 return 0; 718 return 0;
722} 719}
723 720
724static int pxa_irda_resume(struct device *_dev, u32 level) 721static int pxa_irda_resume(struct device *_dev)
725{ 722{
726 struct net_device *dev = dev_get_drvdata(_dev); 723 struct net_device *dev = dev_get_drvdata(_dev);
727 struct pxa_irda *si; 724 struct pxa_irda *si;
728 725
729 if (!dev || level != RESUME_ENABLE) 726 if (dev && netif_running(dev)) {
730 return 0;
731
732 if (netif_running(dev)) {
733 si = netdev_priv(dev); 727 si = netdev_priv(dev);
734 pxa_irda_startup(si); 728 pxa_irda_startup(si);
735 netif_device_attach(dev); 729 netif_device_attach(dev);
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 77ecee7f987b..da7a8f2dab24 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -59,6 +59,7 @@ sa1111_cs-$(CONFIG_SA1100_JORNADA720) += sa1100_jornada720.o
59sa1100_cs-y += sa1100_generic.o 59sa1100_cs-y += sa1100_generic.o
60sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o 60sa1100_cs-$(CONFIG_SA1100_ASSABET) += sa1100_assabet.o
61sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o 61sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o
62sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o
62sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o 63sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o
63sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o 64sa1100_cs-$(CONFIG_SA1100_SHANNON) += sa1100_shannon.o
64sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o 65sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o
diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c
index a1178a600e3c..bd924336a49f 100644
--- a/drivers/pcmcia/pxa2xx_sharpsl.c
+++ b/drivers/pcmcia/pxa2xx_sharpsl.c
@@ -18,10 +18,15 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/device.h> 19#include <linux/device.h>
20 20
21#include <asm/mach-types.h>
21#include <asm/hardware.h> 22#include <asm/hardware.h>
22#include <asm/irq.h> 23#include <asm/irq.h>
23#include <asm/hardware/scoop.h> 24#include <asm/hardware/scoop.h>
24#include <asm/arch/pxa-regs.h> 25#ifdef CONFIG_SA1100_COLLIE
26#include <asm/arch-sa1100/collie.h>
27#else
28#include <asm/arch-pxa/pxa-regs.h>
29#endif
25 30
26#include "soc_common.h" 31#include "soc_common.h"
27 32
@@ -38,6 +43,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
38{ 43{
39 int ret; 44 int ret;
40 45
46#ifndef CONFIG_SA1100_COLLIE
41 /* 47 /*
42 * Setup default state of GPIO outputs 48 * Setup default state of GPIO outputs
43 * before we enable them as outputs. 49 * before we enable them as outputs.
@@ -60,6 +66,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
60 pxa_gpio_mode(GPIO55_nPREG_MD); 66 pxa_gpio_mode(GPIO55_nPREG_MD);
61 pxa_gpio_mode(GPIO56_nPWAIT_MD); 67 pxa_gpio_mode(GPIO56_nPWAIT_MD);
62 pxa_gpio_mode(GPIO57_nIOIS16_MD); 68 pxa_gpio_mode(GPIO57_nIOIS16_MD);
69#endif
63 70
64 /* Register interrupts */ 71 /* Register interrupts */
65 if (scoop_devs[skt->nr].cd_irq >= 0) { 72 if (scoop_devs[skt->nr].cd_irq >= 0) {
@@ -213,12 +220,20 @@ static void sharpsl_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
213 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_IMR, 0x00C0); 220 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_IMR, 0x00C0);
214 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_MCR, 0x0101); 221 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_MCR, 0x0101);
215 scoop_devs[skt->nr].keep_vs = NO_KEEP_VS; 222 scoop_devs[skt->nr].keep_vs = NO_KEEP_VS;
223
224 if (machine_is_collie())
225 /* We need to disable SS_OUTPUT_ENA here. */
226 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR, read_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR) & ~0x0080);
216} 227}
217 228
218static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) 229static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
219{ 230{
220 /* CF_BUS_OFF */ 231 /* CF_BUS_OFF */
221 sharpsl_pcmcia_init_reset(&scoop_devs[skt->nr]); 232 sharpsl_pcmcia_init_reset(&scoop_devs[skt->nr]);
233
234 if (machine_is_collie())
235 /* We need to disable SS_OUTPUT_ENA here. */
236 write_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR, read_scoop_reg(scoop_devs[skt->nr].dev, SCOOP_CPR) & ~0x0080);
222} 237}
223 238
224static struct pcmcia_low_level sharpsl_pcmcia_ops = { 239static struct pcmcia_low_level sharpsl_pcmcia_ops = {
@@ -235,6 +250,19 @@ static struct pcmcia_low_level sharpsl_pcmcia_ops = {
235 250
236static struct platform_device *sharpsl_pcmcia_device; 251static struct platform_device *sharpsl_pcmcia_device;
237 252
253#ifdef CONFIG_SA1100_COLLIE
254int __init pcmcia_collie_init(struct device *dev)
255{
256 int ret = -ENODEV;
257
258 if (machine_is_collie())
259 ret = sa11xx_drv_pcmcia_probe(dev, &sharpsl_pcmcia_ops, 0, 1);
260
261 return ret;
262}
263
264#else
265
238static int __init sharpsl_pcmcia_init(void) 266static int __init sharpsl_pcmcia_init(void)
239{ 267{
240 int ret; 268 int ret;
@@ -269,6 +297,7 @@ static void __exit sharpsl_pcmcia_exit(void)
269 297
270fs_initcall(sharpsl_pcmcia_init); 298fs_initcall(sharpsl_pcmcia_init);
271module_exit(sharpsl_pcmcia_exit); 299module_exit(sharpsl_pcmcia_exit);
300#endif
272 301
273MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support"); 302MODULE_DESCRIPTION("Sharp SL Series PCMCIA Support");
274MODULE_LICENSE("GPL"); 303MODULE_LICENSE("GPL");
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index b768fa81f043..acf60ffc8a12 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -38,8 +38,12 @@
38#include <pcmcia/cs.h> 38#include <pcmcia/cs.h>
39#include <pcmcia/ss.h> 39#include <pcmcia/ss.h>
40 40
41#include <asm/hardware/scoop.h>
42
41#include "sa1100_generic.h" 43#include "sa1100_generic.h"
42 44
45int __init pcmcia_collie_init(struct device *dev);
46
43static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { 47static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
44#ifdef CONFIG_SA1100_ASSABET 48#ifdef CONFIG_SA1100_ASSABET
45 pcmcia_assabet_init, 49 pcmcia_assabet_init,
@@ -56,6 +60,9 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {
56#ifdef CONFIG_SA1100_SIMPAD 60#ifdef CONFIG_SA1100_SIMPAD
57 pcmcia_simpad_init, 61 pcmcia_simpad_init,
58#endif 62#endif
63#ifdef CONFIG_SA1100_COLLIE
64 pcmcia_collie_init,
65#endif
59}; 66};
60 67
61static int sa11x0_drv_pcmcia_probe(struct device *dev) 68static int sa11x0_drv_pcmcia_probe(struct device *dev)
diff --git a/include/asm-arm/arch-ixp2000/ixdp2x01.h b/include/asm-arm/arch-ixp2000/ixdp2x01.h
index b768009c3a51..c6d51426e98f 100644
--- a/include/asm-arm/arch-ixp2000/ixdp2x01.h
+++ b/include/asm-arm/arch-ixp2000/ixdp2x01.h
@@ -22,7 +22,7 @@
22#define IXDP2X01_CPLD_REGION_SIZE 0x00100000 22#define IXDP2X01_CPLD_REGION_SIZE 0x00100000
23 23
24#define IXDP2X01_CPLD_VIRT_REG(reg) (volatile unsigned long*)(IXDP2X01_VIRT_CPLD_BASE | reg) 24#define IXDP2X01_CPLD_VIRT_REG(reg) (volatile unsigned long*)(IXDP2X01_VIRT_CPLD_BASE | reg)
25#define IXDP2X01_CPLD_PHYS_REG(reg) (volatile u32*)(IXDP2X01_PHYS_CPLD_BASE | reg) 25#define IXDP2X01_CPLD_PHYS_REG(reg) (IXDP2X01_PHYS_CPLD_BASE | reg)
26 26
27#define IXDP2X01_UART1_VIRT_BASE IXDP2X01_CPLD_VIRT_REG(0x40) 27#define IXDP2X01_UART1_VIRT_BASE IXDP2X01_CPLD_VIRT_REG(0x40)
28#define IXDP2X01_UART1_PHYS_BASE IXDP2X01_CPLD_PHYS_REG(0x40) 28#define IXDP2X01_UART1_PHYS_BASE IXDP2X01_CPLD_PHYS_REG(0x40)
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h
index e350dcb544e8..80d05ecad2f0 100644
--- a/include/asm-arm/arch-ixp4xx/io.h
+++ b/include/asm-arm/arch-ixp4xx/io.h
@@ -113,7 +113,7 @@ __ixp4xx_writeb(u8 value, u32 addr)
113} 113}
114 114
115static inline void 115static inline void
116__ixp4xx_writesb(u32 bus_addr, u8 *vaddr, int count) 116__ixp4xx_writesb(u32 bus_addr, const u8 *vaddr, int count)
117{ 117{
118 while (count--) 118 while (count--)
119 writeb(*vaddr++, bus_addr); 119 writeb(*vaddr++, bus_addr);
@@ -136,7 +136,7 @@ __ixp4xx_writew(u16 value, u32 addr)
136} 136}
137 137
138static inline void 138static inline void
139__ixp4xx_writesw(u32 bus_addr, u16 *vaddr, int count) 139__ixp4xx_writesw(u32 bus_addr, const u16 *vaddr, int count)
140{ 140{
141 while (count--) 141 while (count--)
142 writew(*vaddr++, bus_addr); 142 writew(*vaddr++, bus_addr);
@@ -154,7 +154,7 @@ __ixp4xx_writel(u32 value, u32 addr)
154} 154}
155 155
156static inline void 156static inline void
157__ixp4xx_writesl(u32 bus_addr, u32 *vaddr, int count) 157__ixp4xx_writesl(u32 bus_addr, const u32 *vaddr, int count)
158{ 158{
159 while (count--) 159 while (count--)
160 writel(*vaddr++, bus_addr); 160 writel(*vaddr++, bus_addr);