diff options
Diffstat (limited to 'arch/arm')
191 files changed, 5077 insertions, 1261 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 233a222752c0..b0c3c0d89e05 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -18,6 +18,8 @@ config ARM | |||
18 | select HAVE_KRETPROBES if (HAVE_KPROBES) | 18 | select HAVE_KRETPROBES if (HAVE_KPROBES) |
19 | select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) | 19 | select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) |
20 | select HAVE_GENERIC_DMA_COHERENT | 20 | select HAVE_GENERIC_DMA_COHERENT |
21 | select HAVE_KERNEL_GZIP | ||
22 | select HAVE_KERNEL_LZO | ||
21 | help | 23 | help |
22 | The ARM series is a line of low-power-consumption RISC chip designs | 24 | The ARM series is a line of low-power-consumption RISC chip designs |
23 | licensed by ARM Ltd and targeted at embedded applications and | 25 | licensed by ARM Ltd and targeted at embedded applications and |
@@ -548,6 +550,15 @@ config ARCH_W90X900 | |||
548 | <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ | 550 | <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/ |
549 | ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller> | 551 | ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller> |
550 | 552 | ||
553 | config ARCH_NUC93X | ||
554 | bool "Nuvoton NUC93X CPU" | ||
555 | select CPU_ARM926T | ||
556 | select HAVE_CLK | ||
557 | select COMMON_CLKDEV | ||
558 | help | ||
559 | Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a | ||
560 | low-power and high performance MPEG-4/JPEG multimedia controller chip. | ||
561 | |||
551 | config ARCH_PNX4008 | 562 | config ARCH_PNX4008 |
552 | bool "Philips Nexperia PNX4008 Mobile" | 563 | bool "Philips Nexperia PNX4008 Mobile" |
553 | select CPU_ARM926T | 564 | select CPU_ARM926T |
@@ -688,6 +699,7 @@ config ARCH_DAVINCI | |||
688 | select HAVE_IDE | 699 | select HAVE_IDE |
689 | select COMMON_CLKDEV | 700 | select COMMON_CLKDEV |
690 | select GENERIC_ALLOCATOR | 701 | select GENERIC_ALLOCATOR |
702 | select ARCH_HAS_HOLES_MEMORYMODEL | ||
691 | help | 703 | help |
692 | Support for TI's DaVinci platform. | 704 | Support for TI's DaVinci platform. |
693 | 705 | ||
@@ -757,6 +769,8 @@ source "arch/arm/plat-pxa/Kconfig" | |||
757 | 769 | ||
758 | source "arch/arm/mach-mmp/Kconfig" | 770 | source "arch/arm/mach-mmp/Kconfig" |
759 | 771 | ||
772 | source "arch/arm/mach-nuc93x/Kconfig" | ||
773 | |||
760 | source "arch/arm/mach-sa1100/Kconfig" | 774 | source "arch/arm/mach-sa1100/Kconfig" |
761 | 775 | ||
762 | source "arch/arm/plat-omap/Kconfig" | 776 | source "arch/arm/plat-omap/Kconfig" |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index e9da08483b3c..3eaef160d468 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -170,6 +170,7 @@ machine-$(CONFIG_ARCH_U300) := u300 | |||
170 | machine-$(CONFIG_ARCH_U8500) := ux500 | 170 | machine-$(CONFIG_ARCH_U8500) := ux500 |
171 | machine-$(CONFIG_ARCH_VERSATILE) := versatile | 171 | machine-$(CONFIG_ARCH_VERSATILE) := versatile |
172 | machine-$(CONFIG_ARCH_W90X900) := w90x900 | 172 | machine-$(CONFIG_ARCH_W90X900) := w90x900 |
173 | machine-$(CONFIG_ARCH_NUC93X) := nuc93x | ||
173 | machine-$(CONFIG_FOOTBRIDGE) := footbridge | 174 | machine-$(CONFIG_FOOTBRIDGE) := footbridge |
174 | machine-$(CONFIG_ARCH_MXC91231) := mxc91231 | 175 | machine-$(CONFIG_ARCH_MXC91231) := mxc91231 |
175 | 176 | ||
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index ce39dc540085..2d4d88ba73bf 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
@@ -63,8 +63,12 @@ endif | |||
63 | 63 | ||
64 | SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ | 64 | SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ |
65 | 65 | ||
66 | targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \ | 66 | suffix_$(CONFIG_KERNEL_GZIP) = gzip |
67 | head.o misc.o $(OBJS) | 67 | suffix_$(CONFIG_KERNEL_LZO) = lzo |
68 | |||
69 | targets := vmlinux vmlinux.lds \ | ||
70 | piggy.$(suffix_y) piggy.$(suffix_y).o \ | ||
71 | font.o font.c head.o misc.o $(OBJS) | ||
68 | 72 | ||
69 | ifeq ($(CONFIG_FUNCTION_TRACER),y) | 73 | ifeq ($(CONFIG_FUNCTION_TRACER),y) |
70 | ORIG_CFLAGS := $(KBUILD_CFLAGS) | 74 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
@@ -87,22 +91,34 @@ endif | |||
87 | ifneq ($(PARAMS_PHYS),) | 91 | ifneq ($(PARAMS_PHYS),) |
88 | LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS) | 92 | LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS) |
89 | endif | 93 | endif |
90 | LDFLAGS_vmlinux += -p --no-undefined -X \ | 94 | # ? |
91 | $(shell $(CC) $(KBUILD_CFLAGS) --print-libgcc-file-name) -T | 95 | LDFLAGS_vmlinux += -p |
96 | # Report unresolved symbol references | ||
97 | LDFLAGS_vmlinux += --no-undefined | ||
98 | # Delete all temporary local symbols | ||
99 | LDFLAGS_vmlinux += -X | ||
100 | # Next argument is a linker script | ||
101 | LDFLAGS_vmlinux += -T | ||
102 | |||
103 | # For __aeabi_uidivmod | ||
104 | lib1funcs = $(obj)/lib1funcs.o | ||
105 | |||
106 | $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE | ||
107 | $(call cmd,shipped) | ||
92 | 108 | ||
93 | # Don't allow any static data in misc.o, which | 109 | # Don't allow any static data in misc.o, which |
94 | # would otherwise mess up our GOT table | 110 | # would otherwise mess up our GOT table |
95 | CFLAGS_misc.o := -Dstatic= | 111 | CFLAGS_misc.o := -Dstatic= |
96 | 112 | ||
97 | $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \ | 113 | $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ |
98 | $(addprefix $(obj)/, $(OBJS)) FORCE | 114 | $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE |
99 | $(call if_changed,ld) | 115 | $(call if_changed,ld) |
100 | @: | 116 | @: |
101 | 117 | ||
102 | $(obj)/piggy.gz: $(obj)/../Image FORCE | 118 | $(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE |
103 | $(call if_changed,gzip) | 119 | $(call if_changed,$(suffix_y)) |
104 | 120 | ||
105 | $(obj)/piggy.o: $(obj)/piggy.gz FORCE | 121 | $(obj)/piggy.$(suffix_y).o: $(obj)/piggy.$(suffix_y) FORCE |
106 | 122 | ||
107 | CFLAGS_font.o := -Dstatic= | 123 | CFLAGS_font.o := -Dstatic= |
108 | 124 | ||
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c index 17153b54613b..7e0fe4d42c7b 100644 --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c | |||
@@ -18,10 +18,15 @@ | |||
18 | 18 | ||
19 | unsigned int __machine_arch_type; | 19 | unsigned int __machine_arch_type; |
20 | 20 | ||
21 | #define _LINUX_STRING_H_ | ||
22 | |||
21 | #include <linux/compiler.h> /* for inline */ | 23 | #include <linux/compiler.h> /* for inline */ |
22 | #include <linux/types.h> /* for size_t */ | 24 | #include <linux/types.h> /* for size_t */ |
23 | #include <linux/stddef.h> /* for NULL */ | 25 | #include <linux/stddef.h> /* for NULL */ |
24 | #include <asm/string.h> | 26 | #include <asm/string.h> |
27 | #include <linux/linkage.h> | ||
28 | |||
29 | #include <asm/unaligned.h> | ||
25 | 30 | ||
26 | #ifdef STANDALONE_DEBUG | 31 | #ifdef STANDALONE_DEBUG |
27 | #define putstr printf | 32 | #define putstr printf |
@@ -188,34 +193,8 @@ static inline __ptr_t memcpy(__ptr_t __dest, __const __ptr_t __src, | |||
188 | /* | 193 | /* |
189 | * gzip delarations | 194 | * gzip delarations |
190 | */ | 195 | */ |
191 | #define OF(args) args | ||
192 | #define STATIC static | 196 | #define STATIC static |
193 | 197 | ||
194 | typedef unsigned char uch; | ||
195 | typedef unsigned short ush; | ||
196 | typedef unsigned long ulg; | ||
197 | |||
198 | #define WSIZE 0x8000 /* Window size must be at least 32k, */ | ||
199 | /* and a power of two */ | ||
200 | |||
201 | static uch *inbuf; /* input buffer */ | ||
202 | static uch window[WSIZE]; /* Sliding window buffer */ | ||
203 | |||
204 | static unsigned insize; /* valid bytes in inbuf */ | ||
205 | static unsigned inptr; /* index of next byte to be processed in inbuf */ | ||
206 | static unsigned outcnt; /* bytes in output buffer */ | ||
207 | |||
208 | /* gzip flag byte */ | ||
209 | #define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ | ||
210 | #define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */ | ||
211 | #define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ | ||
212 | #define ORIG_NAME 0x08 /* bit 3 set: original file name present */ | ||
213 | #define COMMENT 0x10 /* bit 4 set: file comment present */ | ||
214 | #define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */ | ||
215 | #define RESERVED 0xC0 /* bit 6,7: reserved */ | ||
216 | |||
217 | #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf()) | ||
218 | |||
219 | /* Diagnostic functions */ | 198 | /* Diagnostic functions */ |
220 | #ifdef DEBUG | 199 | #ifdef DEBUG |
221 | # define Assert(cond,msg) {if(!(cond)) error(msg);} | 200 | # define Assert(cond,msg) {if(!(cond)) error(msg);} |
@@ -233,24 +212,20 @@ static unsigned outcnt; /* bytes in output buffer */ | |||
233 | # define Tracecv(c,x) | 212 | # define Tracecv(c,x) |
234 | #endif | 213 | #endif |
235 | 214 | ||
236 | static int fill_inbuf(void); | ||
237 | static void flush_window(void); | ||
238 | static void error(char *m); | 215 | static void error(char *m); |
239 | 216 | ||
240 | extern char input_data[]; | 217 | extern char input_data[]; |
241 | extern char input_data_end[]; | 218 | extern char input_data_end[]; |
242 | 219 | ||
243 | static uch *output_data; | 220 | static unsigned char *output_data; |
244 | static ulg output_ptr; | 221 | static unsigned long output_ptr; |
245 | static ulg bytes_out; | ||
246 | 222 | ||
247 | static void error(char *m); | 223 | static void error(char *m); |
248 | 224 | ||
249 | static void putstr(const char *); | 225 | static void putstr(const char *); |
250 | 226 | ||
251 | extern int end; | 227 | static unsigned long free_mem_ptr; |
252 | static ulg free_mem_ptr; | 228 | static unsigned long free_mem_end_ptr; |
253 | static ulg free_mem_end_ptr; | ||
254 | 229 | ||
255 | #ifdef STANDALONE_DEBUG | 230 | #ifdef STANDALONE_DEBUG |
256 | #define NO_INFLATE_MALLOC | 231 | #define NO_INFLATE_MALLOC |
@@ -258,46 +233,13 @@ static ulg free_mem_end_ptr; | |||
258 | 233 | ||
259 | #define ARCH_HAS_DECOMP_WDOG | 234 | #define ARCH_HAS_DECOMP_WDOG |
260 | 235 | ||
261 | #include "../../../../lib/inflate.c" | 236 | #ifdef CONFIG_KERNEL_GZIP |
262 | 237 | #include "../../../../lib/decompress_inflate.c" | |
263 | /* =========================================================================== | 238 | #endif |
264 | * Fill the input buffer. This is called only when the buffer is empty | ||
265 | * and at least one byte is really needed. | ||
266 | */ | ||
267 | int fill_inbuf(void) | ||
268 | { | ||
269 | if (insize != 0) | ||
270 | error("ran out of input data"); | ||
271 | |||
272 | inbuf = input_data; | ||
273 | insize = &input_data_end[0] - &input_data[0]; | ||
274 | |||
275 | inptr = 1; | ||
276 | return inbuf[0]; | ||
277 | } | ||
278 | 239 | ||
279 | /* =========================================================================== | 240 | #ifdef CONFIG_KERNEL_LZO |
280 | * Write the output window window[0..outcnt-1] and update crc and bytes_out. | 241 | #include "../../../../lib/decompress_unlzo.c" |
281 | * (Used for the decompressed data only.) | 242 | #endif |
282 | */ | ||
283 | void flush_window(void) | ||
284 | { | ||
285 | ulg c = crc; | ||
286 | unsigned n; | ||
287 | uch *in, *out, ch; | ||
288 | |||
289 | in = window; | ||
290 | out = &output_data[output_ptr]; | ||
291 | for (n = 0; n < outcnt; n++) { | ||
292 | ch = *out++ = *in++; | ||
293 | c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8); | ||
294 | } | ||
295 | crc = c; | ||
296 | bytes_out += (ulg)outcnt; | ||
297 | output_ptr += (ulg)outcnt; | ||
298 | outcnt = 0; | ||
299 | putstr("."); | ||
300 | } | ||
301 | 243 | ||
302 | #ifndef arch_error | 244 | #ifndef arch_error |
303 | #define arch_error(x) | 245 | #define arch_error(x) |
@@ -314,22 +256,33 @@ static void error(char *x) | |||
314 | while(1); /* Halt */ | 256 | while(1); /* Halt */ |
315 | } | 257 | } |
316 | 258 | ||
259 | asmlinkage void __div0(void) | ||
260 | { | ||
261 | error("Attempting division by 0!"); | ||
262 | } | ||
263 | |||
317 | #ifndef STANDALONE_DEBUG | 264 | #ifndef STANDALONE_DEBUG |
318 | 265 | ||
319 | ulg | 266 | unsigned long |
320 | decompress_kernel(ulg output_start, ulg free_mem_ptr_p, ulg free_mem_ptr_end_p, | 267 | decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, |
321 | int arch_id) | 268 | unsigned long free_mem_ptr_end_p, |
269 | int arch_id) | ||
322 | { | 270 | { |
323 | output_data = (uch *)output_start; /* Points to kernel start */ | 271 | unsigned char *tmp; |
272 | |||
273 | output_data = (unsigned char *)output_start; | ||
324 | free_mem_ptr = free_mem_ptr_p; | 274 | free_mem_ptr = free_mem_ptr_p; |
325 | free_mem_end_ptr = free_mem_ptr_end_p; | 275 | free_mem_end_ptr = free_mem_ptr_end_p; |
326 | __machine_arch_type = arch_id; | 276 | __machine_arch_type = arch_id; |
327 | 277 | ||
328 | arch_decomp_setup(); | 278 | arch_decomp_setup(); |
329 | 279 | ||
330 | makecrc(); | 280 | tmp = (unsigned char *) (((unsigned long)input_data_end) - 4); |
281 | output_ptr = get_unaligned_le32(tmp); | ||
282 | |||
331 | putstr("Uncompressing Linux..."); | 283 | putstr("Uncompressing Linux..."); |
332 | gunzip(); | 284 | decompress(input_data, input_data_end - input_data, |
285 | NULL, NULL, output_data, NULL, error); | ||
333 | putstr(" done, booting the kernel.\n"); | 286 | putstr(" done, booting the kernel.\n"); |
334 | return output_ptr; | 287 | return output_ptr; |
335 | } | 288 | } |
@@ -341,11 +294,10 @@ int main() | |||
341 | { | 294 | { |
342 | output_data = output_buffer; | 295 | output_data = output_buffer; |
343 | 296 | ||
344 | makecrc(); | ||
345 | putstr("Uncompressing Linux..."); | 297 | putstr("Uncompressing Linux..."); |
346 | gunzip(); | 298 | decompress(input_data, input_data_end - input_data, |
299 | NULL, NULL, output_data, NULL, error); | ||
347 | putstr("done.\n"); | 300 | putstr("done.\n"); |
348 | return 0; | 301 | return 0; |
349 | } | 302 | } |
350 | #endif | 303 | #endif |
351 | |||
diff --git a/arch/arm/boot/compressed/piggy.gzip.S b/arch/arm/boot/compressed/piggy.gzip.S new file mode 100644 index 000000000000..a68adf91a165 --- /dev/null +++ b/arch/arm/boot/compressed/piggy.gzip.S | |||
@@ -0,0 +1,6 @@ | |||
1 | .section .piggydata,#alloc | ||
2 | .globl input_data | ||
3 | input_data: | ||
4 | .incbin "arch/arm/boot/compressed/piggy.gzip" | ||
5 | .globl input_data_end | ||
6 | input_data_end: | ||
diff --git a/arch/arm/boot/compressed/piggy.S b/arch/arm/boot/compressed/piggy.lzo.S index 54c951800ebd..a425ad95959a 100644 --- a/arch/arm/boot/compressed/piggy.S +++ b/arch/arm/boot/compressed/piggy.lzo.S | |||
@@ -1,6 +1,6 @@ | |||
1 | .section .piggydata,#alloc | 1 | .section .piggydata,#alloc |
2 | .globl input_data | 2 | .globl input_data |
3 | input_data: | 3 | input_data: |
4 | .incbin "arch/arm/boot/compressed/piggy.gz" | 4 | .incbin "arch/arm/boot/compressed/piggy.lzo" |
5 | .globl input_data_end | 5 | .globl input_data_end |
6 | input_data_end: | 6 | input_data_end: |
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index cc32c1e54a59..cc0a932bbea9 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c | |||
@@ -277,7 +277,7 @@ static inline dma_addr_t map_single(struct device *dev, void *ptr, size_t size, | |||
277 | * We don't need to sync the DMA buffer since | 277 | * We don't need to sync the DMA buffer since |
278 | * it was allocated via the coherent allocators. | 278 | * it was allocated via the coherent allocators. |
279 | */ | 279 | */ |
280 | dma_cache_maint(ptr, size, dir); | 280 | __dma_single_cpu_to_dev(ptr, size, dir); |
281 | } | 281 | } |
282 | 282 | ||
283 | return dma_addr; | 283 | return dma_addr; |
@@ -315,6 +315,8 @@ static inline void unmap_single(struct device *dev, dma_addr_t dma_addr, | |||
315 | __cpuc_flush_dcache_area(ptr, size); | 315 | __cpuc_flush_dcache_area(ptr, size); |
316 | } | 316 | } |
317 | free_safe_buffer(dev->archdata.dmabounce, buf); | 317 | free_safe_buffer(dev->archdata.dmabounce, buf); |
318 | } else { | ||
319 | __dma_single_dev_to_cpu(dma_to_virt(dev, dma_addr), size, dir); | ||
318 | } | 320 | } |
319 | } | 321 | } |
320 | 322 | ||
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index f232941de8ab..1cf999ade4bc 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c | |||
@@ -18,6 +18,7 @@ | |||
18 | * along with this program; if not, write to the Free Software | 18 | * along with this program; if not, write to the Free Software |
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | |||
21 | #include <linux/init.h> | 22 | #include <linux/init.h> |
22 | #include <linux/list.h> | 23 | #include <linux/list.h> |
23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
@@ -28,48 +29,6 @@ | |||
28 | #include <asm/mach/irq.h> | 29 | #include <asm/mach/irq.h> |
29 | #include <asm/hardware/vic.h> | 30 | #include <asm/hardware/vic.h> |
30 | 31 | ||
31 | static void vic_ack_irq(unsigned int irq) | ||
32 | { | ||
33 | void __iomem *base = get_irq_chip_data(irq); | ||
34 | irq &= 31; | ||
35 | writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); | ||
36 | /* moreover, clear the soft-triggered, in case it was the reason */ | ||
37 | writel(1 << irq, base + VIC_INT_SOFT_CLEAR); | ||
38 | } | ||
39 | |||
40 | static void vic_mask_irq(unsigned int irq) | ||
41 | { | ||
42 | void __iomem *base = get_irq_chip_data(irq); | ||
43 | irq &= 31; | ||
44 | writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); | ||
45 | } | ||
46 | |||
47 | static void vic_unmask_irq(unsigned int irq) | ||
48 | { | ||
49 | void __iomem *base = get_irq_chip_data(irq); | ||
50 | irq &= 31; | ||
51 | writel(1 << irq, base + VIC_INT_ENABLE); | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * vic_init2 - common initialisation code | ||
56 | * @base: Base of the VIC. | ||
57 | * | ||
58 | * Common initialisation code for registeration | ||
59 | * and resume. | ||
60 | */ | ||
61 | static void vic_init2(void __iomem *base) | ||
62 | { | ||
63 | int i; | ||
64 | |||
65 | for (i = 0; i < 16; i++) { | ||
66 | void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); | ||
67 | writel(VIC_VECT_CNTL_ENABLE | i, reg); | ||
68 | } | ||
69 | |||
70 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); | ||
71 | } | ||
72 | |||
73 | #if defined(CONFIG_PM) | 32 | #if defined(CONFIG_PM) |
74 | /** | 33 | /** |
75 | * struct vic_device - VIC PM device | 34 | * struct vic_device - VIC PM device |
@@ -99,13 +58,34 @@ struct vic_device { | |||
99 | /* we cannot allocate memory when VICs are initially registered */ | 58 | /* we cannot allocate memory when VICs are initially registered */ |
100 | static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; | 59 | static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; |
101 | 60 | ||
61 | static int vic_id; | ||
62 | |||
102 | static inline struct vic_device *to_vic(struct sys_device *sys) | 63 | static inline struct vic_device *to_vic(struct sys_device *sys) |
103 | { | 64 | { |
104 | return container_of(sys, struct vic_device, sysdev); | 65 | return container_of(sys, struct vic_device, sysdev); |
105 | } | 66 | } |
67 | #endif /* CONFIG_PM */ | ||
106 | 68 | ||
107 | static int vic_id; | 69 | /** |
70 | * vic_init2 - common initialisation code | ||
71 | * @base: Base of the VIC. | ||
72 | * | ||
73 | * Common initialisation code for registeration | ||
74 | * and resume. | ||
75 | */ | ||
76 | static void vic_init2(void __iomem *base) | ||
77 | { | ||
78 | int i; | ||
79 | |||
80 | for (i = 0; i < 16; i++) { | ||
81 | void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); | ||
82 | writel(VIC_VECT_CNTL_ENABLE | i, reg); | ||
83 | } | ||
84 | |||
85 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); | ||
86 | } | ||
108 | 87 | ||
88 | #if defined(CONFIG_PM) | ||
109 | static int vic_class_resume(struct sys_device *dev) | 89 | static int vic_class_resume(struct sys_device *dev) |
110 | { | 90 | { |
111 | struct vic_device *vic = to_vic(dev); | 91 | struct vic_device *vic = to_vic(dev); |
@@ -159,31 +139,6 @@ struct sysdev_class vic_class = { | |||
159 | }; | 139 | }; |
160 | 140 | ||
161 | /** | 141 | /** |
162 | * vic_pm_register - Register a VIC for later power management control | ||
163 | * @base: The base address of the VIC. | ||
164 | * @irq: The base IRQ for the VIC. | ||
165 | * @resume_sources: bitmask of interrupts allowed for resume sources. | ||
166 | * | ||
167 | * Register the VIC with the system device tree so that it can be notified | ||
168 | * of suspend and resume requests and ensure that the correct actions are | ||
169 | * taken to re-instate the settings on resume. | ||
170 | */ | ||
171 | static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources) | ||
172 | { | ||
173 | struct vic_device *v; | ||
174 | |||
175 | if (vic_id >= ARRAY_SIZE(vic_devices)) | ||
176 | printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__); | ||
177 | else { | ||
178 | v = &vic_devices[vic_id]; | ||
179 | v->base = base; | ||
180 | v->resume_sources = resume_sources; | ||
181 | v->irq = irq; | ||
182 | vic_id++; | ||
183 | } | ||
184 | } | ||
185 | |||
186 | /** | ||
187 | * vic_pm_init - initicall to register VIC pm | 142 | * vic_pm_init - initicall to register VIC pm |
188 | * | 143 | * |
189 | * This is called via late_initcall() to register | 144 | * This is called via late_initcall() to register |
@@ -219,9 +174,60 @@ static int __init vic_pm_init(void) | |||
219 | 174 | ||
220 | return 0; | 175 | return 0; |
221 | } | 176 | } |
222 | |||
223 | late_initcall(vic_pm_init); | 177 | late_initcall(vic_pm_init); |
224 | 178 | ||
179 | /** | ||
180 | * vic_pm_register - Register a VIC for later power management control | ||
181 | * @base: The base address of the VIC. | ||
182 | * @irq: The base IRQ for the VIC. | ||
183 | * @resume_sources: bitmask of interrupts allowed for resume sources. | ||
184 | * | ||
185 | * Register the VIC with the system device tree so that it can be notified | ||
186 | * of suspend and resume requests and ensure that the correct actions are | ||
187 | * taken to re-instate the settings on resume. | ||
188 | */ | ||
189 | static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources) | ||
190 | { | ||
191 | struct vic_device *v; | ||
192 | |||
193 | if (vic_id >= ARRAY_SIZE(vic_devices)) | ||
194 | printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__); | ||
195 | else { | ||
196 | v = &vic_devices[vic_id]; | ||
197 | v->base = base; | ||
198 | v->resume_sources = resume_sources; | ||
199 | v->irq = irq; | ||
200 | vic_id++; | ||
201 | } | ||
202 | } | ||
203 | #else | ||
204 | static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { } | ||
205 | #endif /* CONFIG_PM */ | ||
206 | |||
207 | static void vic_ack_irq(unsigned int irq) | ||
208 | { | ||
209 | void __iomem *base = get_irq_chip_data(irq); | ||
210 | irq &= 31; | ||
211 | writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); | ||
212 | /* moreover, clear the soft-triggered, in case it was the reason */ | ||
213 | writel(1 << irq, base + VIC_INT_SOFT_CLEAR); | ||
214 | } | ||
215 | |||
216 | static void vic_mask_irq(unsigned int irq) | ||
217 | { | ||
218 | void __iomem *base = get_irq_chip_data(irq); | ||
219 | irq &= 31; | ||
220 | writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); | ||
221 | } | ||
222 | |||
223 | static void vic_unmask_irq(unsigned int irq) | ||
224 | { | ||
225 | void __iomem *base = get_irq_chip_data(irq); | ||
226 | irq &= 31; | ||
227 | writel(1 << irq, base + VIC_INT_ENABLE); | ||
228 | } | ||
229 | |||
230 | #if defined(CONFIG_PM) | ||
225 | static struct vic_device *vic_from_irq(unsigned int irq) | 231 | static struct vic_device *vic_from_irq(unsigned int irq) |
226 | { | 232 | { |
227 | struct vic_device *v = vic_devices; | 233 | struct vic_device *v = vic_devices; |
@@ -255,10 +261,7 @@ static int vic_set_wake(unsigned int irq, unsigned int on) | |||
255 | 261 | ||
256 | return 0; | 262 | return 0; |
257 | } | 263 | } |
258 | |||
259 | #else | 264 | #else |
260 | static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { } | ||
261 | |||
262 | #define vic_set_wake NULL | 265 | #define vic_set_wake NULL |
263 | #endif /* CONFIG_PM */ | 266 | #endif /* CONFIG_PM */ |
264 | 267 | ||
@@ -270,9 +273,62 @@ static struct irq_chip vic_chip = { | |||
270 | .set_wake = vic_set_wake, | 273 | .set_wake = vic_set_wake, |
271 | }; | 274 | }; |
272 | 275 | ||
273 | /* The PL190 cell from ARM has been modified by ST, so handle both here */ | 276 | /* |
274 | static void vik_init_st(void __iomem *base, unsigned int irq_start, | 277 | * The PL190 cell from ARM has been modified by ST to handle 64 interrupts. |
275 | u32 vic_sources); | 278 | * The original cell has 32 interrupts, while the modified one has 64, |
279 | * replocating two blocks 0x00..0x1f in 0x20..0x3f. In that case | ||
280 | * the probe function is called twice, with base set to offset 000 | ||
281 | * and 020 within the page. We call this "second block". | ||
282 | */ | ||
283 | static void __init vic_init_st(void __iomem *base, unsigned int irq_start, | ||
284 | u32 vic_sources) | ||
285 | { | ||
286 | unsigned int i; | ||
287 | int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0; | ||
288 | |||
289 | /* Disable all interrupts initially. */ | ||
290 | |||
291 | writel(0, base + VIC_INT_SELECT); | ||
292 | writel(0, base + VIC_INT_ENABLE); | ||
293 | writel(~0, base + VIC_INT_ENABLE_CLEAR); | ||
294 | writel(0, base + VIC_IRQ_STATUS); | ||
295 | writel(0, base + VIC_ITCR); | ||
296 | writel(~0, base + VIC_INT_SOFT_CLEAR); | ||
297 | |||
298 | /* | ||
299 | * Make sure we clear all existing interrupts. The vector registers | ||
300 | * in this cell are after the second block of general registers, | ||
301 | * so we can address them using standard offsets, but only from | ||
302 | * the second base address, which is 0x20 in the page | ||
303 | */ | ||
304 | if (vic_2nd_block) { | ||
305 | writel(0, base + VIC_PL190_VECT_ADDR); | ||
306 | for (i = 0; i < 19; i++) { | ||
307 | unsigned int value; | ||
308 | |||
309 | value = readl(base + VIC_PL190_VECT_ADDR); | ||
310 | writel(value, base + VIC_PL190_VECT_ADDR); | ||
311 | } | ||
312 | /* ST has 16 vectors as well, but we don't enable them by now */ | ||
313 | for (i = 0; i < 16; i++) { | ||
314 | void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); | ||
315 | writel(0, reg); | ||
316 | } | ||
317 | |||
318 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); | ||
319 | } | ||
320 | |||
321 | for (i = 0; i < 32; i++) { | ||
322 | if (vic_sources & (1 << i)) { | ||
323 | unsigned int irq = irq_start + i; | ||
324 | |||
325 | set_irq_chip(irq, &vic_chip); | ||
326 | set_irq_chip_data(irq, base); | ||
327 | set_irq_handler(irq, handle_level_irq); | ||
328 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
329 | } | ||
330 | } | ||
331 | } | ||
276 | 332 | ||
277 | /** | 333 | /** |
278 | * vic_init - initialise a vectored interrupt controller | 334 | * vic_init - initialise a vectored interrupt controller |
@@ -299,7 +355,7 @@ void __init vic_init(void __iomem *base, unsigned int irq_start, | |||
299 | 355 | ||
300 | switch(vendor) { | 356 | switch(vendor) { |
301 | case AMBA_VENDOR_ST: | 357 | case AMBA_VENDOR_ST: |
302 | vik_init_st(base, irq_start, vic_sources); | 358 | vic_init_st(base, irq_start, vic_sources); |
303 | return; | 359 | return; |
304 | default: | 360 | default: |
305 | printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n"); | 361 | printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n"); |
@@ -343,60 +399,3 @@ void __init vic_init(void __iomem *base, unsigned int irq_start, | |||
343 | 399 | ||
344 | vic_pm_register(base, irq_start, resume_sources); | 400 | vic_pm_register(base, irq_start, resume_sources); |
345 | } | 401 | } |
346 | |||
347 | /* | ||
348 | * The PL190 cell from ARM has been modified by ST to handle 64 interrupts. | ||
349 | * The original cell has 32 interrupts, while the modified one has 64, | ||
350 | * replocating two blocks 0x00..0x1f in 0x20..0x3f. In that case | ||
351 | * the probe function is called twice, with base set to offset 000 | ||
352 | * and 020 within the page. We call this "second block". | ||
353 | */ | ||
354 | static void __init vik_init_st(void __iomem *base, unsigned int irq_start, | ||
355 | u32 vic_sources) | ||
356 | { | ||
357 | unsigned int i; | ||
358 | int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0; | ||
359 | |||
360 | /* Disable all interrupts initially. */ | ||
361 | |||
362 | writel(0, base + VIC_INT_SELECT); | ||
363 | writel(0, base + VIC_INT_ENABLE); | ||
364 | writel(~0, base + VIC_INT_ENABLE_CLEAR); | ||
365 | writel(0, base + VIC_IRQ_STATUS); | ||
366 | writel(0, base + VIC_ITCR); | ||
367 | writel(~0, base + VIC_INT_SOFT_CLEAR); | ||
368 | |||
369 | /* | ||
370 | * Make sure we clear all existing interrupts. The vector registers | ||
371 | * in this cell are after the second block of general registers, | ||
372 | * so we can address them using standard offsets, but only from | ||
373 | * the second base address, which is 0x20 in the page | ||
374 | */ | ||
375 | if (vic_2nd_block) { | ||
376 | writel(0, base + VIC_PL190_VECT_ADDR); | ||
377 | for (i = 0; i < 19; i++) { | ||
378 | unsigned int value; | ||
379 | |||
380 | value = readl(base + VIC_PL190_VECT_ADDR); | ||
381 | writel(value, base + VIC_PL190_VECT_ADDR); | ||
382 | } | ||
383 | /* ST has 16 vectors as well, but we don't enable them by now */ | ||
384 | for (i = 0; i < 16; i++) { | ||
385 | void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); | ||
386 | writel(0, reg); | ||
387 | } | ||
388 | |||
389 | writel(32, base + VIC_PL190_DEF_VECT_ADDR); | ||
390 | } | ||
391 | |||
392 | for (i = 0; i < 32; i++) { | ||
393 | if (vic_sources & (1 << i)) { | ||
394 | unsigned int irq = irq_start + i; | ||
395 | |||
396 | set_irq_chip(irq, &vic_chip); | ||
397 | set_irq_chip_data(irq, base); | ||
398 | set_irq_handler(irq, handle_level_irq); | ||
399 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
400 | } | ||
401 | } | ||
402 | } | ||
diff --git a/arch/arm/configs/u300_defconfig b/arch/arm/configs/u300_defconfig index 610ac3c47b0f..9155196e623b 100644 --- a/arch/arm/configs/u300_defconfig +++ b/arch/arm/configs/u300_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.32-rc5 | 3 | # Linux kernel version: 2.6.33-rc2 |
4 | # Sat Oct 17 23:32:24 2009 | 4 | # Wed Jan 6 00:01:36 2010 |
5 | # | 5 | # |
6 | CONFIG_ARM=y | 6 | CONFIG_ARM=y |
7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y | 7 | CONFIG_SYS_SUPPORTS_APM_EMULATION=y |
@@ -46,6 +46,7 @@ CONFIG_SYSVIPC_SYSCTL=y | |||
46 | # | 46 | # |
47 | CONFIG_TREE_RCU=y | 47 | CONFIG_TREE_RCU=y |
48 | # CONFIG_TREE_PREEMPT_RCU is not set | 48 | # CONFIG_TREE_PREEMPT_RCU is not set |
49 | # CONFIG_TINY_RCU is not set | ||
49 | # CONFIG_RCU_TRACE is not set | 50 | # CONFIG_RCU_TRACE is not set |
50 | CONFIG_RCU_FANOUT=32 | 51 | CONFIG_RCU_FANOUT=32 |
51 | # CONFIG_RCU_FANOUT_EXACT is not set | 52 | # CONFIG_RCU_FANOUT_EXACT is not set |
@@ -119,14 +120,41 @@ CONFIG_BLOCK=y | |||
119 | # IO Schedulers | 120 | # IO Schedulers |
120 | # | 121 | # |
121 | CONFIG_IOSCHED_NOOP=y | 122 | CONFIG_IOSCHED_NOOP=y |
122 | # CONFIG_IOSCHED_AS is not set | ||
123 | CONFIG_IOSCHED_DEADLINE=y | 123 | CONFIG_IOSCHED_DEADLINE=y |
124 | # CONFIG_IOSCHED_CFQ is not set | 124 | # CONFIG_IOSCHED_CFQ is not set |
125 | # CONFIG_DEFAULT_AS is not set | ||
126 | CONFIG_DEFAULT_DEADLINE=y | 125 | CONFIG_DEFAULT_DEADLINE=y |
127 | # CONFIG_DEFAULT_CFQ is not set | 126 | # CONFIG_DEFAULT_CFQ is not set |
128 | # CONFIG_DEFAULT_NOOP is not set | 127 | # CONFIG_DEFAULT_NOOP is not set |
129 | CONFIG_DEFAULT_IOSCHED="deadline" | 128 | CONFIG_DEFAULT_IOSCHED="deadline" |
129 | # CONFIG_INLINE_SPIN_TRYLOCK is not set | ||
130 | # CONFIG_INLINE_SPIN_TRYLOCK_BH is not set | ||
131 | # CONFIG_INLINE_SPIN_LOCK is not set | ||
132 | # CONFIG_INLINE_SPIN_LOCK_BH is not set | ||
133 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set | ||
134 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set | ||
135 | # CONFIG_INLINE_SPIN_UNLOCK is not set | ||
136 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set | ||
137 | # CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set | ||
138 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set | ||
139 | # CONFIG_INLINE_READ_TRYLOCK is not set | ||
140 | # CONFIG_INLINE_READ_LOCK is not set | ||
141 | # CONFIG_INLINE_READ_LOCK_BH is not set | ||
142 | # CONFIG_INLINE_READ_LOCK_IRQ is not set | ||
143 | # CONFIG_INLINE_READ_LOCK_IRQSAVE is not set | ||
144 | # CONFIG_INLINE_READ_UNLOCK is not set | ||
145 | # CONFIG_INLINE_READ_UNLOCK_BH is not set | ||
146 | # CONFIG_INLINE_READ_UNLOCK_IRQ is not set | ||
147 | # CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set | ||
148 | # CONFIG_INLINE_WRITE_TRYLOCK is not set | ||
149 | # CONFIG_INLINE_WRITE_LOCK is not set | ||
150 | # CONFIG_INLINE_WRITE_LOCK_BH is not set | ||
151 | # CONFIG_INLINE_WRITE_LOCK_IRQ is not set | ||
152 | # CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set | ||
153 | # CONFIG_INLINE_WRITE_UNLOCK is not set | ||
154 | # CONFIG_INLINE_WRITE_UNLOCK_BH is not set | ||
155 | # CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set | ||
156 | # CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set | ||
157 | # CONFIG_MUTEX_SPIN_ON_OWNER is not set | ||
130 | # CONFIG_FREEZER is not set | 158 | # CONFIG_FREEZER is not set |
131 | 159 | ||
132 | # | 160 | # |
@@ -155,6 +183,7 @@ CONFIG_MMU=y | |||
155 | # CONFIG_ARCH_IXP2000 is not set | 183 | # CONFIG_ARCH_IXP2000 is not set |
156 | # CONFIG_ARCH_IXP4XX is not set | 184 | # CONFIG_ARCH_IXP4XX is not set |
157 | # CONFIG_ARCH_L7200 is not set | 185 | # CONFIG_ARCH_L7200 is not set |
186 | # CONFIG_ARCH_DOVE is not set | ||
158 | # CONFIG_ARCH_KIRKWOOD is not set | 187 | # CONFIG_ARCH_KIRKWOOD is not set |
159 | # CONFIG_ARCH_LOKI is not set | 188 | # CONFIG_ARCH_LOKI is not set |
160 | # CONFIG_ARCH_MV78XX0 is not set | 189 | # CONFIG_ARCH_MV78XX0 is not set |
@@ -177,6 +206,7 @@ CONFIG_ARCH_U300=y | |||
177 | # CONFIG_ARCH_DAVINCI is not set | 206 | # CONFIG_ARCH_DAVINCI is not set |
178 | # CONFIG_ARCH_OMAP is not set | 207 | # CONFIG_ARCH_OMAP is not set |
179 | # CONFIG_ARCH_BCMRING is not set | 208 | # CONFIG_ARCH_BCMRING is not set |
209 | # CONFIG_ARCH_U8500 is not set | ||
180 | 210 | ||
181 | # | 211 | # |
182 | # ST-Ericsson AB U300/U330/U335/U365 Platform | 212 | # ST-Ericsson AB U300/U330/U335/U365 Platform |
@@ -265,12 +295,10 @@ CONFIG_FLATMEM_MANUAL=y | |||
265 | CONFIG_FLATMEM=y | 295 | CONFIG_FLATMEM=y |
266 | CONFIG_FLAT_NODE_MEM_MAP=y | 296 | CONFIG_FLAT_NODE_MEM_MAP=y |
267 | CONFIG_PAGEFLAGS_EXTENDED=y | 297 | CONFIG_PAGEFLAGS_EXTENDED=y |
268 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | 298 | CONFIG_SPLIT_PTLOCK_CPUS=999999 |
269 | # CONFIG_PHYS_ADDR_T_64BIT is not set | 299 | # CONFIG_PHYS_ADDR_T_64BIT is not set |
270 | CONFIG_ZONE_DMA_FLAG=0 | 300 | CONFIG_ZONE_DMA_FLAG=0 |
271 | CONFIG_VIRT_TO_BUS=y | 301 | CONFIG_VIRT_TO_BUS=y |
272 | CONFIG_HAVE_MLOCK=y | ||
273 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
274 | # CONFIG_KSM is not set | 302 | # CONFIG_KSM is not set |
275 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | 303 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 |
276 | CONFIG_ALIGNMENT_TRAP=y | 304 | CONFIG_ALIGNMENT_TRAP=y |
@@ -499,14 +527,21 @@ CONFIG_MTD_NAND_IDS=y | |||
499 | CONFIG_BLK_DEV=y | 527 | CONFIG_BLK_DEV=y |
500 | # CONFIG_BLK_DEV_COW_COMMON is not set | 528 | # CONFIG_BLK_DEV_COW_COMMON is not set |
501 | # CONFIG_BLK_DEV_LOOP is not set | 529 | # CONFIG_BLK_DEV_LOOP is not set |
530 | |||
531 | # | ||
532 | # DRBD disabled because PROC_FS, INET or CONNECTOR not selected | ||
533 | # | ||
502 | # CONFIG_BLK_DEV_NBD is not set | 534 | # CONFIG_BLK_DEV_NBD is not set |
503 | # CONFIG_BLK_DEV_RAM is not set | 535 | # CONFIG_BLK_DEV_RAM is not set |
504 | # CONFIG_CDROM_PKTCDVD is not set | 536 | # CONFIG_CDROM_PKTCDVD is not set |
505 | # CONFIG_ATA_OVER_ETH is not set | 537 | # CONFIG_ATA_OVER_ETH is not set |
506 | CONFIG_MISC_DEVICES=y | 538 | CONFIG_MISC_DEVICES=y |
539 | # CONFIG_AD525X_DPOT is not set | ||
507 | # CONFIG_ICS932S401 is not set | 540 | # CONFIG_ICS932S401 is not set |
508 | # CONFIG_ENCLOSURE_SERVICES is not set | 541 | # CONFIG_ENCLOSURE_SERVICES is not set |
509 | # CONFIG_ISL29003 is not set | 542 | # CONFIG_ISL29003 is not set |
543 | # CONFIG_DS1682 is not set | ||
544 | # CONFIG_TI_DAC7512 is not set | ||
510 | # CONFIG_C2PORT is not set | 545 | # CONFIG_C2PORT is not set |
511 | 546 | ||
512 | # | 547 | # |
@@ -517,6 +552,7 @@ CONFIG_MISC_DEVICES=y | |||
517 | # CONFIG_EEPROM_LEGACY is not set | 552 | # CONFIG_EEPROM_LEGACY is not set |
518 | # CONFIG_EEPROM_MAX6875 is not set | 553 | # CONFIG_EEPROM_MAX6875 is not set |
519 | # CONFIG_EEPROM_93CX6 is not set | 554 | # CONFIG_EEPROM_93CX6 is not set |
555 | # CONFIG_IWMC3200TOP is not set | ||
520 | CONFIG_HAVE_IDE=y | 556 | CONFIG_HAVE_IDE=y |
521 | # CONFIG_IDE is not set | 557 | # CONFIG_IDE is not set |
522 | 558 | ||
@@ -539,6 +575,7 @@ CONFIG_HAVE_IDE=y | |||
539 | CONFIG_INPUT=y | 575 | CONFIG_INPUT=y |
540 | # CONFIG_INPUT_FF_MEMLESS is not set | 576 | # CONFIG_INPUT_FF_MEMLESS is not set |
541 | # CONFIG_INPUT_POLLDEV is not set | 577 | # CONFIG_INPUT_POLLDEV is not set |
578 | # CONFIG_INPUT_SPARSEKMAP is not set | ||
542 | 579 | ||
543 | # | 580 | # |
544 | # Userland interfaces | 581 | # Userland interfaces |
@@ -645,7 +682,6 @@ CONFIG_I2C_STU300=y | |||
645 | # | 682 | # |
646 | # Miscellaneous I2C Chip support | 683 | # Miscellaneous I2C Chip support |
647 | # | 684 | # |
648 | # CONFIG_DS1682 is not set | ||
649 | # CONFIG_SENSORS_TSL2550 is not set | 685 | # CONFIG_SENSORS_TSL2550 is not set |
650 | # CONFIG_I2C_DEBUG_CORE is not set | 686 | # CONFIG_I2C_DEBUG_CORE is not set |
651 | # CONFIG_I2C_DEBUG_ALGO is not set | 687 | # CONFIG_I2C_DEBUG_ALGO is not set |
@@ -661,6 +697,8 @@ CONFIG_SPI_MASTER=y | |||
661 | # CONFIG_SPI_BITBANG is not set | 697 | # CONFIG_SPI_BITBANG is not set |
662 | # CONFIG_SPI_GPIO is not set | 698 | # CONFIG_SPI_GPIO is not set |
663 | CONFIG_SPI_PL022=y | 699 | CONFIG_SPI_PL022=y |
700 | # CONFIG_SPI_XILINX is not set | ||
701 | # CONFIG_SPI_DESIGNWARE is not set | ||
664 | 702 | ||
665 | # | 703 | # |
666 | # SPI Protocol Masters | 704 | # SPI Protocol Masters |
@@ -708,6 +746,7 @@ CONFIG_SSB_POSSIBLE=y | |||
708 | # CONFIG_MFD_T7L66XB is not set | 746 | # CONFIG_MFD_T7L66XB is not set |
709 | # CONFIG_MFD_TC6387XB is not set | 747 | # CONFIG_MFD_TC6387XB is not set |
710 | # CONFIG_PMIC_DA903X is not set | 748 | # CONFIG_PMIC_DA903X is not set |
749 | # CONFIG_PMIC_ADP5520 is not set | ||
711 | # CONFIG_MFD_WM8400 is not set | 750 | # CONFIG_MFD_WM8400 is not set |
712 | # CONFIG_MFD_WM831X is not set | 751 | # CONFIG_MFD_WM831X is not set |
713 | # CONFIG_MFD_WM8350_I2C is not set | 752 | # CONFIG_MFD_WM8350_I2C is not set |
@@ -716,6 +755,8 @@ CONFIG_SSB_POSSIBLE=y | |||
716 | CONFIG_AB3100_CORE=y | 755 | CONFIG_AB3100_CORE=y |
717 | CONFIG_AB3100_OTP=y | 756 | CONFIG_AB3100_OTP=y |
718 | # CONFIG_EZX_PCAP is not set | 757 | # CONFIG_EZX_PCAP is not set |
758 | # CONFIG_MFD_88PM8607 is not set | ||
759 | # CONFIG_AB4500_CORE is not set | ||
719 | CONFIG_REGULATOR=y | 760 | CONFIG_REGULATOR=y |
720 | # CONFIG_REGULATOR_DEBUG is not set | 761 | # CONFIG_REGULATOR_DEBUG is not set |
721 | # CONFIG_REGULATOR_FIXED_VOLTAGE is not set | 762 | # CONFIG_REGULATOR_FIXED_VOLTAGE is not set |
@@ -723,6 +764,7 @@ CONFIG_REGULATOR=y | |||
723 | # CONFIG_REGULATOR_USERSPACE_CONSUMER is not set | 764 | # CONFIG_REGULATOR_USERSPACE_CONSUMER is not set |
724 | # CONFIG_REGULATOR_BQ24022 is not set | 765 | # CONFIG_REGULATOR_BQ24022 is not set |
725 | # CONFIG_REGULATOR_MAX1586 is not set | 766 | # CONFIG_REGULATOR_MAX1586 is not set |
767 | # CONFIG_REGULATOR_MAX8660 is not set | ||
726 | # CONFIG_REGULATOR_LP3971 is not set | 768 | # CONFIG_REGULATOR_LP3971 is not set |
727 | CONFIG_REGULATOR_AB3100=y | 769 | CONFIG_REGULATOR_AB3100=y |
728 | # CONFIG_REGULATOR_TPS65023 is not set | 770 | # CONFIG_REGULATOR_TPS65023 is not set |
@@ -840,7 +882,9 @@ CONFIG_LEDS_CLASS=y | |||
840 | # CONFIG_LEDS_LP3944 is not set | 882 | # CONFIG_LEDS_LP3944 is not set |
841 | # CONFIG_LEDS_PCA955X is not set | 883 | # CONFIG_LEDS_PCA955X is not set |
842 | # CONFIG_LEDS_DAC124S085 is not set | 884 | # CONFIG_LEDS_DAC124S085 is not set |
885 | # CONFIG_LEDS_REGULATOR is not set | ||
843 | # CONFIG_LEDS_BD2802 is not set | 886 | # CONFIG_LEDS_BD2802 is not set |
887 | # CONFIG_LEDS_LT3593 is not set | ||
844 | 888 | ||
845 | # | 889 | # |
846 | # LED Triggers | 890 | # LED Triggers |
@@ -882,6 +926,7 @@ CONFIG_RTC_INTF_DEV=y | |||
882 | # CONFIG_RTC_DRV_PCF8563 is not set | 926 | # CONFIG_RTC_DRV_PCF8563 is not set |
883 | # CONFIG_RTC_DRV_PCF8583 is not set | 927 | # CONFIG_RTC_DRV_PCF8583 is not set |
884 | # CONFIG_RTC_DRV_M41T80 is not set | 928 | # CONFIG_RTC_DRV_M41T80 is not set |
929 | # CONFIG_RTC_DRV_BQ32K is not set | ||
885 | # CONFIG_RTC_DRV_S35390A is not set | 930 | # CONFIG_RTC_DRV_S35390A is not set |
886 | # CONFIG_RTC_DRV_FM3130 is not set | 931 | # CONFIG_RTC_DRV_FM3130 is not set |
887 | # CONFIG_RTC_DRV_RX8581 is not set | 932 | # CONFIG_RTC_DRV_RX8581 is not set |
@@ -911,7 +956,9 @@ CONFIG_RTC_INTF_DEV=y | |||
911 | # CONFIG_RTC_DRV_M48T86 is not set | 956 | # CONFIG_RTC_DRV_M48T86 is not set |
912 | # CONFIG_RTC_DRV_M48T35 is not set | 957 | # CONFIG_RTC_DRV_M48T35 is not set |
913 | # CONFIG_RTC_DRV_M48T59 is not set | 958 | # CONFIG_RTC_DRV_M48T59 is not set |
959 | # CONFIG_RTC_DRV_MSM6242 is not set | ||
914 | # CONFIG_RTC_DRV_BQ4802 is not set | 960 | # CONFIG_RTC_DRV_BQ4802 is not set |
961 | # CONFIG_RTC_DRV_RP5C01 is not set | ||
915 | # CONFIG_RTC_DRV_V3020 is not set | 962 | # CONFIG_RTC_DRV_V3020 is not set |
916 | CONFIG_RTC_DRV_AB3100=y | 963 | CONFIG_RTC_DRV_AB3100=y |
917 | 964 | ||
@@ -926,6 +973,15 @@ CONFIG_DMADEVICES=y | |||
926 | # | 973 | # |
927 | # DMA Devices | 974 | # DMA Devices |
928 | # | 975 | # |
976 | CONFIG_COH901318=y | ||
977 | CONFIG_DMA_ENGINE=y | ||
978 | |||
979 | # | ||
980 | # DMA Clients | ||
981 | # | ||
982 | # CONFIG_NET_DMA is not set | ||
983 | # CONFIG_ASYNC_TX_DMA is not set | ||
984 | # CONFIG_DMATEST is not set | ||
929 | # CONFIG_AUXDISPLAY is not set | 985 | # CONFIG_AUXDISPLAY is not set |
930 | # CONFIG_UIO is not set | 986 | # CONFIG_UIO is not set |
931 | 987 | ||
@@ -1018,7 +1074,7 @@ CONFIG_MISC_FILESYSTEMS=y | |||
1018 | CONFIG_MSDOS_PARTITION=y | 1074 | CONFIG_MSDOS_PARTITION=y |
1019 | CONFIG_NLS=y | 1075 | CONFIG_NLS=y |
1020 | CONFIG_NLS_DEFAULT="iso8859-1" | 1076 | CONFIG_NLS_DEFAULT="iso8859-1" |
1021 | # CONFIG_NLS_CODEPAGE_437 is not set | 1077 | CONFIG_NLS_CODEPAGE_437=y |
1022 | # CONFIG_NLS_CODEPAGE_737 is not set | 1078 | # CONFIG_NLS_CODEPAGE_737 is not set |
1023 | # CONFIG_NLS_CODEPAGE_775 is not set | 1079 | # CONFIG_NLS_CODEPAGE_775 is not set |
1024 | # CONFIG_NLS_CODEPAGE_850 is not set | 1080 | # CONFIG_NLS_CODEPAGE_850 is not set |
@@ -1135,6 +1191,7 @@ CONFIG_ARM_UNWIND=y | |||
1135 | # CONFIG_DEBUG_ERRORS is not set | 1191 | # CONFIG_DEBUG_ERRORS is not set |
1136 | # CONFIG_DEBUG_STACK_USAGE is not set | 1192 | # CONFIG_DEBUG_STACK_USAGE is not set |
1137 | # CONFIG_DEBUG_LL is not set | 1193 | # CONFIG_DEBUG_LL is not set |
1194 | # CONFIG_OC_ETM is not set | ||
1138 | 1195 | ||
1139 | # | 1196 | # |
1140 | # Security options | 1197 | # Security options |
@@ -1142,7 +1199,11 @@ CONFIG_ARM_UNWIND=y | |||
1142 | # CONFIG_KEYS is not set | 1199 | # CONFIG_KEYS is not set |
1143 | # CONFIG_SECURITY is not set | 1200 | # CONFIG_SECURITY is not set |
1144 | # CONFIG_SECURITYFS is not set | 1201 | # CONFIG_SECURITYFS is not set |
1145 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | 1202 | # CONFIG_DEFAULT_SECURITY_SELINUX is not set |
1203 | # CONFIG_DEFAULT_SECURITY_SMACK is not set | ||
1204 | # CONFIG_DEFAULT_SECURITY_TOMOYO is not set | ||
1205 | CONFIG_DEFAULT_SECURITY_DAC=y | ||
1206 | CONFIG_DEFAULT_SECURITY="" | ||
1146 | # CONFIG_CRYPTO is not set | 1207 | # CONFIG_CRYPTO is not set |
1147 | # CONFIG_BINARY_PRINTF is not set | 1208 | # CONFIG_BINARY_PRINTF is not set |
1148 | 1209 | ||
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index 730aefcfbee3..be8b4d79cf41 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h | |||
@@ -182,21 +182,6 @@ | |||
182 | * DMA Cache Coherency | 182 | * DMA Cache Coherency |
183 | * =================== | 183 | * =================== |
184 | * | 184 | * |
185 | * dma_inv_range(start, end) | ||
186 | * | ||
187 | * Invalidate (discard) the specified virtual address range. | ||
188 | * May not write back any entries. If 'start' or 'end' | ||
189 | * are not cache line aligned, those lines must be written | ||
190 | * back. | ||
191 | * - start - virtual start address | ||
192 | * - end - virtual end address | ||
193 | * | ||
194 | * dma_clean_range(start, end) | ||
195 | * | ||
196 | * Clean (write back) the specified virtual address range. | ||
197 | * - start - virtual start address | ||
198 | * - end - virtual end address | ||
199 | * | ||
200 | * dma_flush_range(start, end) | 185 | * dma_flush_range(start, end) |
201 | * | 186 | * |
202 | * Clean and invalidate the specified virtual address range. | 187 | * Clean and invalidate the specified virtual address range. |
@@ -213,8 +198,9 @@ struct cpu_cache_fns { | |||
213 | void (*coherent_user_range)(unsigned long, unsigned long); | 198 | void (*coherent_user_range)(unsigned long, unsigned long); |
214 | void (*flush_kern_dcache_area)(void *, size_t); | 199 | void (*flush_kern_dcache_area)(void *, size_t); |
215 | 200 | ||
216 | void (*dma_inv_range)(const void *, const void *); | 201 | void (*dma_map_area)(const void *, size_t, int); |
217 | void (*dma_clean_range)(const void *, const void *); | 202 | void (*dma_unmap_area)(const void *, size_t, int); |
203 | |||
218 | void (*dma_flush_range)(const void *, const void *); | 204 | void (*dma_flush_range)(const void *, const void *); |
219 | }; | 205 | }; |
220 | 206 | ||
@@ -244,8 +230,8 @@ extern struct cpu_cache_fns cpu_cache; | |||
244 | * is visible to DMA, or data written by DMA to system memory is | 230 | * is visible to DMA, or data written by DMA to system memory is |
245 | * visible to the CPU. | 231 | * visible to the CPU. |
246 | */ | 232 | */ |
247 | #define dmac_inv_range cpu_cache.dma_inv_range | 233 | #define dmac_map_area cpu_cache.dma_map_area |
248 | #define dmac_clean_range cpu_cache.dma_clean_range | 234 | #define dmac_unmap_area cpu_cache.dma_unmap_area |
249 | #define dmac_flush_range cpu_cache.dma_flush_range | 235 | #define dmac_flush_range cpu_cache.dma_flush_range |
250 | 236 | ||
251 | #else | 237 | #else |
@@ -270,12 +256,12 @@ extern void __cpuc_flush_dcache_area(void *, size_t); | |||
270 | * is visible to DMA, or data written by DMA to system memory is | 256 | * is visible to DMA, or data written by DMA to system memory is |
271 | * visible to the CPU. | 257 | * visible to the CPU. |
272 | */ | 258 | */ |
273 | #define dmac_inv_range __glue(_CACHE,_dma_inv_range) | 259 | #define dmac_map_area __glue(_CACHE,_dma_map_area) |
274 | #define dmac_clean_range __glue(_CACHE,_dma_clean_range) | 260 | #define dmac_unmap_area __glue(_CACHE,_dma_unmap_area) |
275 | #define dmac_flush_range __glue(_CACHE,_dma_flush_range) | 261 | #define dmac_flush_range __glue(_CACHE,_dma_flush_range) |
276 | 262 | ||
277 | extern void dmac_inv_range(const void *, const void *); | 263 | extern void dmac_map_area(const void *, size_t, int); |
278 | extern void dmac_clean_range(const void *, const void *); | 264 | extern void dmac_unmap_area(const void *, size_t, int); |
279 | extern void dmac_flush_range(const void *, const void *); | 265 | extern void dmac_flush_range(const void *, const void *); |
280 | 266 | ||
281 | #endif | 267 | #endif |
@@ -316,12 +302,8 @@ static inline void outer_flush_range(unsigned long start, unsigned long end) | |||
316 | * processes address space. Really, we want to allow our "user | 302 | * processes address space. Really, we want to allow our "user |
317 | * space" model to handle this. | 303 | * space" model to handle this. |
318 | */ | 304 | */ |
319 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 305 | extern void copy_to_user_page(struct vm_area_struct *, struct page *, |
320 | do { \ | 306 | unsigned long, void *, const void *, unsigned long); |
321 | memcpy(dst, src, len); \ | ||
322 | flush_ptrace_access(vma, page, vaddr, dst, len, 1);\ | ||
323 | } while (0) | ||
324 | |||
325 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 307 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
326 | do { \ | 308 | do { \ |
327 | memcpy(dst, src, len); \ | 309 | memcpy(dst, src, len); \ |
@@ -355,17 +337,6 @@ vivt_flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig | |||
355 | } | 337 | } |
356 | } | 338 | } |
357 | 339 | ||
358 | static inline void | ||
359 | vivt_flush_ptrace_access(struct vm_area_struct *vma, struct page *page, | ||
360 | unsigned long uaddr, void *kaddr, | ||
361 | unsigned long len, int write) | ||
362 | { | ||
363 | if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { | ||
364 | unsigned long addr = (unsigned long)kaddr; | ||
365 | __cpuc_coherent_kern_range(addr, addr + len); | ||
366 | } | ||
367 | } | ||
368 | |||
369 | #ifndef CONFIG_CPU_CACHE_VIPT | 340 | #ifndef CONFIG_CPU_CACHE_VIPT |
370 | #define flush_cache_mm(mm) \ | 341 | #define flush_cache_mm(mm) \ |
371 | vivt_flush_cache_mm(mm) | 342 | vivt_flush_cache_mm(mm) |
@@ -373,15 +344,10 @@ vivt_flush_ptrace_access(struct vm_area_struct *vma, struct page *page, | |||
373 | vivt_flush_cache_range(vma,start,end) | 344 | vivt_flush_cache_range(vma,start,end) |
374 | #define flush_cache_page(vma,addr,pfn) \ | 345 | #define flush_cache_page(vma,addr,pfn) \ |
375 | vivt_flush_cache_page(vma,addr,pfn) | 346 | vivt_flush_cache_page(vma,addr,pfn) |
376 | #define flush_ptrace_access(vma,page,ua,ka,len,write) \ | ||
377 | vivt_flush_ptrace_access(vma,page,ua,ka,len,write) | ||
378 | #else | 347 | #else |
379 | extern void flush_cache_mm(struct mm_struct *mm); | 348 | extern void flush_cache_mm(struct mm_struct *mm); |
380 | extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); | 349 | extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); |
381 | extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn); | 350 | extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn); |
382 | extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page, | ||
383 | unsigned long uaddr, void *kaddr, | ||
384 | unsigned long len, int write); | ||
385 | #endif | 351 | #endif |
386 | 352 | ||
387 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) | 353 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) |
diff --git a/arch/arm/include/asm/cpu.h b/arch/arm/include/asm/cpu.h index 634b2d7c612a..793968173bef 100644 --- a/arch/arm/include/asm/cpu.h +++ b/arch/arm/include/asm/cpu.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define __ASM_ARM_CPU_H | 11 | #define __ASM_ARM_CPU_H |
12 | 12 | ||
13 | #include <linux/percpu.h> | 13 | #include <linux/percpu.h> |
14 | #include <linux/cpu.h> | ||
14 | 15 | ||
15 | struct cpuinfo_arm { | 16 | struct cpuinfo_arm { |
16 | struct cpu cpu; | 17 | struct cpu cpu; |
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index a96300bf83fd..256ee1c9f51a 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h | |||
@@ -57,18 +57,58 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr) | |||
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * DMA-consistent mapping functions. These allocate/free a region of | 60 | * The DMA API is built upon the notion of "buffer ownership". A buffer |
61 | * uncached, unwrite-buffered mapped memory space for use with DMA | 61 | * is either exclusively owned by the CPU (and therefore may be accessed |
62 | * devices. This is the "generic" version. The PCI specific version | 62 | * by it) or exclusively owned by the DMA device. These helper functions |
63 | * is in pci.h | 63 | * represent the transitions between these two ownership states. |
64 | * | 64 | * |
65 | * Note: Drivers should NOT use this function directly, as it will break | 65 | * Note, however, that on later ARMs, this notion does not work due to |
66 | * platforms with CONFIG_DMABOUNCE. | 66 | * speculative prefetches. We model our approach on the assumption that |
67 | * Use the driver DMA support - see dma-mapping.h (dma_sync_*) | 67 | * the CPU does do speculative prefetches, which means we clean caches |
68 | * before transfers and delay cache invalidation until transfer completion. | ||
69 | * | ||
70 | * Private support functions: these are not part of the API and are | ||
71 | * liable to change. Drivers must not use these. | ||
68 | */ | 72 | */ |
69 | extern void dma_cache_maint(const void *kaddr, size_t size, int rw); | 73 | static inline void __dma_single_cpu_to_dev(const void *kaddr, size_t size, |
70 | extern void dma_cache_maint_page(struct page *page, unsigned long offset, | 74 | enum dma_data_direction dir) |
71 | size_t size, int rw); | 75 | { |
76 | extern void ___dma_single_cpu_to_dev(const void *, size_t, | ||
77 | enum dma_data_direction); | ||
78 | |||
79 | if (!arch_is_coherent()) | ||
80 | ___dma_single_cpu_to_dev(kaddr, size, dir); | ||
81 | } | ||
82 | |||
83 | static inline void __dma_single_dev_to_cpu(const void *kaddr, size_t size, | ||
84 | enum dma_data_direction dir) | ||
85 | { | ||
86 | extern void ___dma_single_dev_to_cpu(const void *, size_t, | ||
87 | enum dma_data_direction); | ||
88 | |||
89 | if (!arch_is_coherent()) | ||
90 | ___dma_single_dev_to_cpu(kaddr, size, dir); | ||
91 | } | ||
92 | |||
93 | static inline void __dma_page_cpu_to_dev(struct page *page, unsigned long off, | ||
94 | size_t size, enum dma_data_direction dir) | ||
95 | { | ||
96 | extern void ___dma_page_cpu_to_dev(struct page *, unsigned long, | ||
97 | size_t, enum dma_data_direction); | ||
98 | |||
99 | if (!arch_is_coherent()) | ||
100 | ___dma_page_cpu_to_dev(page, off, size, dir); | ||
101 | } | ||
102 | |||
103 | static inline void __dma_page_dev_to_cpu(struct page *page, unsigned long off, | ||
104 | size_t size, enum dma_data_direction dir) | ||
105 | { | ||
106 | extern void ___dma_page_dev_to_cpu(struct page *, unsigned long, | ||
107 | size_t, enum dma_data_direction); | ||
108 | |||
109 | if (!arch_is_coherent()) | ||
110 | ___dma_page_dev_to_cpu(page, off, size, dir); | ||
111 | } | ||
72 | 112 | ||
73 | /* | 113 | /* |
74 | * Return whether the given device DMA address mask can be supported | 114 | * Return whether the given device DMA address mask can be supported |
@@ -304,8 +344,7 @@ static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, | |||
304 | { | 344 | { |
305 | BUG_ON(!valid_dma_direction(dir)); | 345 | BUG_ON(!valid_dma_direction(dir)); |
306 | 346 | ||
307 | if (!arch_is_coherent()) | 347 | __dma_single_cpu_to_dev(cpu_addr, size, dir); |
308 | dma_cache_maint(cpu_addr, size, dir); | ||
309 | 348 | ||
310 | return virt_to_dma(dev, cpu_addr); | 349 | return virt_to_dma(dev, cpu_addr); |
311 | } | 350 | } |
@@ -329,8 +368,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | |||
329 | { | 368 | { |
330 | BUG_ON(!valid_dma_direction(dir)); | 369 | BUG_ON(!valid_dma_direction(dir)); |
331 | 370 | ||
332 | if (!arch_is_coherent()) | 371 | __dma_page_cpu_to_dev(page, offset, size, dir); |
333 | dma_cache_maint_page(page, offset, size, dir); | ||
334 | 372 | ||
335 | return page_to_dma(dev, page) + offset; | 373 | return page_to_dma(dev, page) + offset; |
336 | } | 374 | } |
@@ -352,7 +390,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | |||
352 | static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, | 390 | static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, |
353 | size_t size, enum dma_data_direction dir) | 391 | size_t size, enum dma_data_direction dir) |
354 | { | 392 | { |
355 | /* nothing to do */ | 393 | __dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir); |
356 | } | 394 | } |
357 | 395 | ||
358 | /** | 396 | /** |
@@ -372,7 +410,8 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle, | |||
372 | static inline void dma_unmap_page(struct device *dev, dma_addr_t handle, | 410 | static inline void dma_unmap_page(struct device *dev, dma_addr_t handle, |
373 | size_t size, enum dma_data_direction dir) | 411 | size_t size, enum dma_data_direction dir) |
374 | { | 412 | { |
375 | /* nothing to do */ | 413 | __dma_page_dev_to_cpu(dma_to_page(dev, handle), handle & ~PAGE_MASK, |
414 | size, dir); | ||
376 | } | 415 | } |
377 | #endif /* CONFIG_DMABOUNCE */ | 416 | #endif /* CONFIG_DMABOUNCE */ |
378 | 417 | ||
@@ -400,7 +439,10 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev, | |||
400 | { | 439 | { |
401 | BUG_ON(!valid_dma_direction(dir)); | 440 | BUG_ON(!valid_dma_direction(dir)); |
402 | 441 | ||
403 | dmabounce_sync_for_cpu(dev, handle, offset, size, dir); | 442 | if (!dmabounce_sync_for_cpu(dev, handle, offset, size, dir)) |
443 | return; | ||
444 | |||
445 | __dma_single_dev_to_cpu(dma_to_virt(dev, handle) + offset, size, dir); | ||
404 | } | 446 | } |
405 | 447 | ||
406 | static inline void dma_sync_single_range_for_device(struct device *dev, | 448 | static inline void dma_sync_single_range_for_device(struct device *dev, |
@@ -412,8 +454,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev, | |||
412 | if (!dmabounce_sync_for_device(dev, handle, offset, size, dir)) | 454 | if (!dmabounce_sync_for_device(dev, handle, offset, size, dir)) |
413 | return; | 455 | return; |
414 | 456 | ||
415 | if (!arch_is_coherent()) | 457 | __dma_single_cpu_to_dev(dma_to_virt(dev, handle) + offset, size, dir); |
416 | dma_cache_maint(dma_to_virt(dev, handle) + offset, size, dir); | ||
417 | } | 458 | } |
418 | 459 | ||
419 | static inline void dma_sync_single_for_cpu(struct device *dev, | 460 | static inline void dma_sync_single_for_cpu(struct device *dev, |
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h index 7edf3536df24..ca51143f97f1 100644 --- a/arch/arm/include/asm/dma.h +++ b/arch/arm/include/asm/dma.h | |||
@@ -138,12 +138,12 @@ extern int get_dma_residue(unsigned int chan); | |||
138 | #define NO_DMA 255 | 138 | #define NO_DMA 255 |
139 | #endif | 139 | #endif |
140 | 140 | ||
141 | #endif /* CONFIG_ISA_DMA_API */ | ||
142 | |||
141 | #ifdef CONFIG_PCI | 143 | #ifdef CONFIG_PCI |
142 | extern int isa_dma_bridge_buggy; | 144 | extern int isa_dma_bridge_buggy; |
143 | #else | 145 | #else |
144 | #define isa_dma_bridge_buggy (0) | 146 | #define isa_dma_bridge_buggy (0) |
145 | #endif | 147 | #endif |
146 | 148 | ||
147 | #endif /* CONFIG_ISA_DMA_API */ | ||
148 | |||
149 | #endif /* __ASM_ARM_DMA_H */ | 149 | #endif /* __ASM_ARM_DMA_H */ |
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h index 3a32af4cce30..a485ac3c8696 100644 --- a/arch/arm/include/asm/page.h +++ b/arch/arm/include/asm/page.h | |||
@@ -117,11 +117,12 @@ | |||
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | struct page; | 119 | struct page; |
120 | struct vm_area_struct; | ||
120 | 121 | ||
121 | struct cpu_user_fns { | 122 | struct cpu_user_fns { |
122 | void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr); | 123 | void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr); |
123 | void (*cpu_copy_user_highpage)(struct page *to, struct page *from, | 124 | void (*cpu_copy_user_highpage)(struct page *to, struct page *from, |
124 | unsigned long vaddr); | 125 | unsigned long vaddr, struct vm_area_struct *vma); |
125 | }; | 126 | }; |
126 | 127 | ||
127 | #ifdef MULTI_USER | 128 | #ifdef MULTI_USER |
@@ -137,7 +138,7 @@ extern struct cpu_user_fns cpu_user; | |||
137 | 138 | ||
138 | extern void __cpu_clear_user_highpage(struct page *page, unsigned long vaddr); | 139 | extern void __cpu_clear_user_highpage(struct page *page, unsigned long vaddr); |
139 | extern void __cpu_copy_user_highpage(struct page *to, struct page *from, | 140 | extern void __cpu_copy_user_highpage(struct page *to, struct page *from, |
140 | unsigned long vaddr); | 141 | unsigned long vaddr, struct vm_area_struct *vma); |
141 | #endif | 142 | #endif |
142 | 143 | ||
143 | #define clear_user_highpage(page,vaddr) \ | 144 | #define clear_user_highpage(page,vaddr) \ |
@@ -145,7 +146,7 @@ extern void __cpu_copy_user_highpage(struct page *to, struct page *from, | |||
145 | 146 | ||
146 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE | 147 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE |
147 | #define copy_user_highpage(to,from,vaddr,vma) \ | 148 | #define copy_user_highpage(to,from,vaddr,vma) \ |
148 | __cpu_copy_user_highpage(to, from, vaddr) | 149 | __cpu_copy_user_highpage(to, from, vaddr, vma) |
149 | 150 | ||
150 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) | 151 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) |
151 | extern void copy_page(void *to, const void *from); | 152 | extern void copy_page(void *to, const void *from); |
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h index bbecccda76d0..eec6e897ceb2 100644 --- a/arch/arm/include/asm/ptrace.h +++ b/arch/arm/include/asm/ptrace.h | |||
@@ -97,9 +97,15 @@ | |||
97 | * stack during a system call. Note that sizeof(struct pt_regs) | 97 | * stack during a system call. Note that sizeof(struct pt_regs) |
98 | * has to be a multiple of 8. | 98 | * has to be a multiple of 8. |
99 | */ | 99 | */ |
100 | #ifndef __KERNEL__ | ||
100 | struct pt_regs { | 101 | struct pt_regs { |
101 | long uregs[18]; | 102 | long uregs[18]; |
102 | }; | 103 | }; |
104 | #else /* __KERNEL__ */ | ||
105 | struct pt_regs { | ||
106 | unsigned long uregs[18]; | ||
107 | }; | ||
108 | #endif /* __KERNEL__ */ | ||
103 | 109 | ||
104 | #define ARM_cpsr uregs[16] | 110 | #define ARM_cpsr uregs[16] |
105 | #define ARM_pc uregs[15] | 111 | #define ARM_pc uregs[15] |
diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h index 59303e200845..e6215305544a 100644 --- a/arch/arm/include/asm/smp_plat.h +++ b/arch/arm/include/asm/smp_plat.h | |||
@@ -13,4 +13,9 @@ static inline int tlb_ops_need_broadcast(void) | |||
13 | return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2; | 13 | return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2; |
14 | } | 14 | } |
15 | 15 | ||
16 | static inline int cache_ops_need_broadcast(void) | ||
17 | { | ||
18 | return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1; | ||
19 | } | ||
20 | |||
16 | #endif | 21 | #endif |
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index c2f1605de359..e085e2c545eb 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h | |||
@@ -529,7 +529,8 @@ extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); | |||
529 | * cache entries for the kernels virtual memory range are written | 529 | * cache entries for the kernels virtual memory range are written |
530 | * back to the page. | 530 | * back to the page. |
531 | */ | 531 | */ |
532 | extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte); | 532 | extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, |
533 | pte_t *ptep); | ||
533 | 534 | ||
534 | #endif | 535 | #endif |
535 | 536 | ||
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h index 4e506d09e5f9..cf9cdaa2d4d4 100644 --- a/arch/arm/include/asm/unistd.h +++ b/arch/arm/include/asm/unistd.h | |||
@@ -391,6 +391,7 @@ | |||
391 | #define __NR_pwritev (__NR_SYSCALL_BASE+362) | 391 | #define __NR_pwritev (__NR_SYSCALL_BASE+362) |
392 | #define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363) | 392 | #define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363) |
393 | #define __NR_perf_event_open (__NR_SYSCALL_BASE+364) | 393 | #define __NR_perf_event_open (__NR_SYSCALL_BASE+364) |
394 | #define __NR_recvmmsg (__NR_SYSCALL_BASE+365) | ||
394 | 395 | ||
395 | /* | 396 | /* |
396 | * The following SWIs are ARM private. | 397 | * The following SWIs are ARM private. |
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 4a881258bb17..883511522fca 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c | |||
@@ -12,6 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
15 | #include <linux/dma-mapping.h> | ||
15 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
16 | #include <asm/thread_info.h> | 17 | #include <asm/thread_info.h> |
17 | #include <asm/memory.h> | 18 | #include <asm/memory.h> |
@@ -112,5 +113,9 @@ int main(void) | |||
112 | #ifdef MULTI_PABORT | 113 | #ifdef MULTI_PABORT |
113 | DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort)); | 114 | DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort)); |
114 | #endif | 115 | #endif |
116 | BLANK(); | ||
117 | DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL); | ||
118 | DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE); | ||
119 | DEFINE(DMA_FROM_DEVICE, DMA_FROM_DEVICE); | ||
115 | return 0; | 120 | return 0; |
116 | } | 121 | } |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index d2903e3bc861..6c5cf369183b 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -957,9 +957,7 @@ kuser_cmpxchg_fixup: | |||
957 | 957 | ||
958 | #else | 958 | #else |
959 | 959 | ||
960 | #ifdef CONFIG_SMP | 960 | smp_dmb |
961 | mcr p15, 0, r0, c7, c10, 5 @ dmb | ||
962 | #endif | ||
963 | 1: ldrex r3, [r2] | 961 | 1: ldrex r3, [r2] |
964 | subs r3, r3, r0 | 962 | subs r3, r3, r0 |
965 | strexeq r3, r1, [r2] | 963 | strexeq r3, r1, [r2] |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 67304138a2ca..ba2adefa53f7 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -212,7 +212,8 @@ void __show_regs(struct pt_regs *regs) | |||
212 | char buf[64]; | 212 | char buf[64]; |
213 | 213 | ||
214 | printk("CPU: %d %s (%s %.*s)\n", | 214 | printk("CPU: %d %s (%s %.*s)\n", |
215 | smp_processor_id(), print_tainted(), init_utsname()->release, | 215 | raw_smp_processor_id(), print_tainted(), |
216 | init_utsname()->release, | ||
216 | (int)strcspn(init_utsname()->version, " "), | 217 | (int)strcspn(init_utsname()->version, " "), |
217 | init_utsname()->version); | 218 | init_utsname()->version); |
218 | print_symbol("PC is at %s\n", instruction_pointer(regs)); | 219 | print_symbol("PC is at %s\n", instruction_pointer(regs)); |
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index a9b650dcc172..077ecf4fecda 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c | |||
@@ -236,6 +236,7 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = { | |||
236 | 236 | ||
237 | static struct vpfe_config vpfe_cfg = { | 237 | static struct vpfe_config vpfe_cfg = { |
238 | .num_subdevs = ARRAY_SIZE(vpfe_sub_devs), | 238 | .num_subdevs = ARRAY_SIZE(vpfe_sub_devs), |
239 | .i2c_adapter_id = 1, | ||
239 | .sub_devs = vpfe_sub_devs, | 240 | .sub_devs = vpfe_sub_devs, |
240 | .card_name = "DM355 EVM", | 241 | .card_name = "DM355 EVM", |
241 | .ccdc = "DM355 CCDC", | 242 | .ccdc = "DM355 CCDC", |
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 289fe1b7d25a..b476395d2cd4 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -192,7 +192,11 @@ static struct davinci_i2c_platform_data i2c_pdata = { | |||
192 | .bus_delay = 0 /* usec */, | 192 | .bus_delay = 0 /* usec */, |
193 | }; | 193 | }; |
194 | 194 | ||
195 | #ifdef CONFIG_KEYBOARD_DAVINCI | 195 | static int dm365evm_keyscan_enable(struct device *dev) |
196 | { | ||
197 | return davinci_cfg_reg(DM365_KEYSCAN); | ||
198 | } | ||
199 | |||
196 | static unsigned short dm365evm_keymap[] = { | 200 | static unsigned short dm365evm_keymap[] = { |
197 | KEY_KP2, | 201 | KEY_KP2, |
198 | KEY_LEFT, | 202 | KEY_LEFT, |
@@ -214,6 +218,7 @@ static unsigned short dm365evm_keymap[] = { | |||
214 | }; | 218 | }; |
215 | 219 | ||
216 | static struct davinci_ks_platform_data dm365evm_ks_data = { | 220 | static struct davinci_ks_platform_data dm365evm_ks_data = { |
221 | .device_enable = dm365evm_keyscan_enable, | ||
217 | .keymap = dm365evm_keymap, | 222 | .keymap = dm365evm_keymap, |
218 | .keymapsize = ARRAY_SIZE(dm365evm_keymap), | 223 | .keymapsize = ARRAY_SIZE(dm365evm_keymap), |
219 | .rep = 1, | 224 | .rep = 1, |
@@ -222,7 +227,6 @@ static struct davinci_ks_platform_data dm365evm_ks_data = { | |||
222 | .interval = 0x2, | 227 | .interval = 0x2, |
223 | .matrix_type = DAVINCI_KEYSCAN_MATRIX_4X4, | 228 | .matrix_type = DAVINCI_KEYSCAN_MATRIX_4X4, |
224 | }; | 229 | }; |
225 | #endif | ||
226 | 230 | ||
227 | static int cpld_mmc_get_cd(int module) | 231 | static int cpld_mmc_get_cd(int module) |
228 | { | 232 | { |
@@ -511,10 +515,7 @@ static __init void dm365_evm_init(void) | |||
511 | 515 | ||
512 | dm365_init_asp(&dm365_evm_snd_data); | 516 | dm365_init_asp(&dm365_evm_snd_data); |
513 | dm365_init_rtc(); | 517 | dm365_init_rtc(); |
514 | |||
515 | #ifdef CONFIG_KEYBOARD_DAVINCI | ||
516 | dm365_init_ks(&dm365evm_ks_data); | 518 | dm365_init_ks(&dm365evm_ks_data); |
517 | #endif | ||
518 | } | 519 | } |
519 | 520 | ||
520 | static __init void dm365_evm_irq_init(void) | 521 | static __init void dm365_evm_irq_init(void) |
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index fd0398bc6db3..e9612cf727b7 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
@@ -247,6 +247,7 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = { | |||
247 | 247 | ||
248 | static struct vpfe_config vpfe_cfg = { | 248 | static struct vpfe_config vpfe_cfg = { |
249 | .num_subdevs = ARRAY_SIZE(vpfe_sub_devs), | 249 | .num_subdevs = ARRAY_SIZE(vpfe_sub_devs), |
250 | .i2c_adapter_id = 1, | ||
250 | .sub_devs = vpfe_sub_devs, | 251 | .sub_devs = vpfe_sub_devs, |
251 | .card_name = "DM6446 EVM", | 252 | .card_name = "DM6446 EVM", |
252 | .ccdc = "DM6446 CCDC", | 253 | .ccdc = "DM6446 CCDC", |
diff --git a/arch/arm/mach-davinci/cp_intc.c b/arch/arm/mach-davinci/cp_intc.c index 52b287cf3a42..37311d1830eb 100644 --- a/arch/arm/mach-davinci/cp_intc.c +++ b/arch/arm/mach-davinci/cp_intc.c | |||
@@ -81,12 +81,23 @@ static int cp_intc_set_irq_type(unsigned int irq, unsigned int flow_type) | |||
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
83 | 83 | ||
84 | /* | ||
85 | * Faking this allows us to to work with suspend functions of | ||
86 | * generic drivers which call {enable|disable}_irq_wake for | ||
87 | * wake up interrupt sources (eg RTC on DA850). | ||
88 | */ | ||
89 | static int cp_intc_set_wake(unsigned int irq, unsigned int on) | ||
90 | { | ||
91 | return 0; | ||
92 | } | ||
93 | |||
84 | static struct irq_chip cp_intc_irq_chip = { | 94 | static struct irq_chip cp_intc_irq_chip = { |
85 | .name = "cp_intc", | 95 | .name = "cp_intc", |
86 | .ack = cp_intc_ack_irq, | 96 | .ack = cp_intc_ack_irq, |
87 | .mask = cp_intc_mask_irq, | 97 | .mask = cp_intc_mask_irq, |
88 | .unmask = cp_intc_unmask_irq, | 98 | .unmask = cp_intc_unmask_irq, |
89 | .set_type = cp_intc_set_irq_type, | 99 | .set_type = cp_intc_set_irq_type, |
100 | .set_wake = cp_intc_set_wake, | ||
90 | }; | 101 | }; |
91 | 102 | ||
92 | void __init cp_intc_init(void __iomem *base, unsigned short num_irq, | 103 | void __init cp_intc_init(void __iomem *base, unsigned short num_irq, |
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index dd2d32c4ce86..a5105f03fd86 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
@@ -481,11 +481,18 @@ static struct platform_device da8xx_rtc_device = { | |||
481 | 481 | ||
482 | int da8xx_register_rtc(void) | 482 | int da8xx_register_rtc(void) |
483 | { | 483 | { |
484 | int ret; | ||
485 | |||
484 | /* Unlock the rtc's registers */ | 486 | /* Unlock the rtc's registers */ |
485 | __raw_writel(0x83e70b13, IO_ADDRESS(DA8XX_RTC_BASE + 0x6c)); | 487 | __raw_writel(0x83e70b13, IO_ADDRESS(DA8XX_RTC_BASE + 0x6c)); |
486 | __raw_writel(0x95a4f1e0, IO_ADDRESS(DA8XX_RTC_BASE + 0x70)); | 488 | __raw_writel(0x95a4f1e0, IO_ADDRESS(DA8XX_RTC_BASE + 0x70)); |
487 | 489 | ||
488 | return platform_device_register(&da8xx_rtc_device); | 490 | ret = platform_device_register(&da8xx_rtc_device); |
491 | if (!ret) | ||
492 | /* Atleast on DA850, RTC is a wakeup source */ | ||
493 | device_init_wakeup(&da8xx_rtc_device.dev, true); | ||
494 | |||
495 | return ret; | ||
489 | } | 496 | } |
490 | 497 | ||
491 | static struct resource da8xx_cpuidle_resources[] = { | 498 | static struct resource da8xx_cpuidle_resources[] = { |
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 2ec619ec1657..f53735cb922e 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c | |||
@@ -993,7 +993,6 @@ void __init dm365_init_asp(struct snd_platform_data *pdata) | |||
993 | 993 | ||
994 | void __init dm365_init_ks(struct davinci_ks_platform_data *pdata) | 994 | void __init dm365_init_ks(struct davinci_ks_platform_data *pdata) |
995 | { | 995 | { |
996 | davinci_cfg_reg(DM365_KEYSCAN); | ||
997 | dm365_ks_device.dev.platform_data = pdata; | 996 | dm365_ks_device.dev.platform_data = pdata; |
998 | platform_device_register(&dm365_ks_device); | 997 | platform_device_register(&dm365_ks_device); |
999 | } | 998 | } |
diff --git a/arch/arm/mach-davinci/include/mach/keyscan.h b/arch/arm/mach-davinci/include/mach/keyscan.h index b4e21a2976d1..7a560e05bda8 100644 --- a/arch/arm/mach-davinci/include/mach/keyscan.h +++ b/arch/arm/mach-davinci/include/mach/keyscan.h | |||
@@ -29,6 +29,7 @@ enum davinci_matrix_types { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct davinci_ks_platform_data { | 31 | struct davinci_ks_platform_data { |
32 | int (*device_enable)(struct device *dev); | ||
32 | unsigned short *keymap; | 33 | unsigned short *keymap; |
33 | u32 keymapsize; | 34 | u32 keymapsize; |
34 | u8 rep:1; | 35 | u8 rep:1; |
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig index 9167c3d2a5ed..3a08b18f6433 100644 --- a/arch/arm/mach-ep93xx/Kconfig +++ b/arch/arm/mach-ep93xx/Kconfig | |||
@@ -161,6 +161,20 @@ config MACH_MICRO9S | |||
161 | Say 'Y' here if you want your kernel to support the | 161 | Say 'Y' here if you want your kernel to support the |
162 | Contec Micro9-Slim board. | 162 | Contec Micro9-Slim board. |
163 | 163 | ||
164 | config MACH_SIM_ONE | ||
165 | bool "Support Simplemachines Sim.One board" | ||
166 | depends on EP93XX_SDCE0_PHYS_OFFSET | ||
167 | help | ||
168 | Say 'Y' here if you want your kernel to support the | ||
169 | Simplemachines Sim.One board. | ||
170 | |||
171 | config MACH_SNAPPER_CL15 | ||
172 | bool "Support Bluewater Systems Snapper CL15 Module" | ||
173 | depends on EP93XX_SDCE0_PHYS_OFFSET | ||
174 | help | ||
175 | Say 'Y' here if you want your kernel to support the Bluewater | ||
176 | Systems Snapper CL15 Module. | ||
177 | |||
164 | config MACH_TS72XX | 178 | config MACH_TS72XX |
165 | bool "Support Technologic Systems TS-72xx SBC" | 179 | bool "Support Technologic Systems TS-72xx SBC" |
166 | depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET | 180 | depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET |
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile index eae6199a9891..33ee2c863d18 100644 --- a/arch/arm/mach-ep93xx/Makefile +++ b/arch/arm/mach-ep93xx/Makefile | |||
@@ -10,4 +10,6 @@ obj-$(CONFIG_MACH_ADSSPHERE) += adssphere.o | |||
10 | obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o | 10 | obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o |
11 | obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o | 11 | obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o |
12 | obj-$(CONFIG_MACH_MICRO9) += micro9.o | 12 | obj-$(CONFIG_MACH_MICRO9) += micro9.o |
13 | obj-$(CONFIG_MACH_SIM_ONE) += simone.o | ||
14 | obj-$(CONFIG_MACH_SNAPPER_CL15) += snappercl15.o | ||
13 | obj-$(CONFIG_MACH_TS72XX) += ts72xx.o | 15 | obj-$(CONFIG_MACH_TS72XX) += ts72xx.o |
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 1d0f9d8aff2e..49fa9f8fef4a 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c | |||
@@ -10,6 +10,8 @@ | |||
10 | * your option) any later version. | 10 | * your option) any later version. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt | ||
14 | |||
13 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
14 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
15 | #include <linux/err.h> | 17 | #include <linux/err.h> |
@@ -447,30 +449,34 @@ static int __init ep93xx_clock_init(void) | |||
447 | u32 value; | 449 | u32 value; |
448 | int i; | 450 | int i; |
449 | 451 | ||
450 | value = __raw_readl(EP93XX_SYSCON_CLOCK_SET1); | 452 | /* Determine the bootloader configured pll1 rate */ |
451 | if (!(value & 0x00800000)) { /* PLL1 bypassed? */ | 453 | value = __raw_readl(EP93XX_SYSCON_CLKSET1); |
454 | if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1)) | ||
452 | clk_pll1.rate = clk_xtali.rate; | 455 | clk_pll1.rate = clk_xtali.rate; |
453 | } else { | 456 | else |
454 | clk_pll1.rate = calc_pll_rate(value); | 457 | clk_pll1.rate = calc_pll_rate(value); |
455 | } | 458 | |
459 | /* Initialize the pll1 derived clocks */ | ||
456 | clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7]; | 460 | clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7]; |
457 | clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7]; | 461 | clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7]; |
458 | clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3]; | 462 | clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3]; |
459 | ep93xx_dma_clock_init(); | 463 | ep93xx_dma_clock_init(); |
460 | 464 | ||
461 | value = __raw_readl(EP93XX_SYSCON_CLOCK_SET2); | 465 | /* Determine the bootloader configured pll2 rate */ |
462 | if (!(value & 0x00080000)) { /* PLL2 bypassed? */ | 466 | value = __raw_readl(EP93XX_SYSCON_CLKSET2); |
467 | if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2)) | ||
463 | clk_pll2.rate = clk_xtali.rate; | 468 | clk_pll2.rate = clk_xtali.rate; |
464 | } else if (value & 0x00040000) { /* PLL2 enabled? */ | 469 | else if (value & EP93XX_SYSCON_CLKSET2_PLL2_EN) |
465 | clk_pll2.rate = calc_pll_rate(value); | 470 | clk_pll2.rate = calc_pll_rate(value); |
466 | } else { | 471 | else |
467 | clk_pll2.rate = 0; | 472 | clk_pll2.rate = 0; |
468 | } | 473 | |
474 | /* Initialize the pll2 derived clocks */ | ||
469 | clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); | 475 | clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); |
470 | 476 | ||
471 | printk(KERN_INFO "ep93xx: PLL1 running at %ld MHz, PLL2 at %ld MHz\n", | 477 | pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n", |
472 | clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); | 478 | clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); |
473 | printk(KERN_INFO "ep93xx: FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", | 479 | pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", |
474 | clk_f.rate / 1000000, clk_h.rate / 1000000, | 480 | clk_f.rate / 1000000, clk_h.rate / 1000000, |
475 | clk_p.rate / 1000000); | 481 | clk_p.rate / 1000000); |
476 | 482 | ||
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 1f0d66561bbe..90fb591cbffa 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -14,12 +14,15 @@ | |||
14 | * your option) any later version. | 14 | * your option) any later version. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt | ||
18 | |||
17 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 20 | #include <linux/init.h> |
19 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
20 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
21 | #include <linux/dma-mapping.h> | 23 | #include <linux/dma-mapping.h> |
22 | #include <linux/timex.h> | 24 | #include <linux/timex.h> |
25 | #include <linux/irq.h> | ||
23 | #include <linux/io.h> | 26 | #include <linux/io.h> |
24 | #include <linux/gpio.h> | 27 | #include <linux/gpio.h> |
25 | #include <linux/leds.h> | 28 | #include <linux/leds.h> |
@@ -35,7 +38,6 @@ | |||
35 | 38 | ||
36 | #include <asm/mach/map.h> | 39 | #include <asm/mach/map.h> |
37 | #include <asm/mach/time.h> | 40 | #include <asm/mach/time.h> |
38 | #include <asm/mach/irq.h> | ||
39 | 41 | ||
40 | #include <asm/hardware/vic.h> | 42 | #include <asm/hardware/vic.h> |
41 | 43 | ||
@@ -82,13 +84,40 @@ void __init ep93xx_map_io(void) | |||
82 | * to use this timer for something else. We also use timer 4 for keeping | 84 | * to use this timer for something else. We also use timer 4 for keeping |
83 | * track of lost jiffies. | 85 | * track of lost jiffies. |
84 | */ | 86 | */ |
85 | static unsigned int last_jiffy_time; | 87 | #define EP93XX_TIMER_REG(x) (EP93XX_TIMER_BASE + (x)) |
86 | 88 | #define EP93XX_TIMER1_LOAD EP93XX_TIMER_REG(0x00) | |
89 | #define EP93XX_TIMER1_VALUE EP93XX_TIMER_REG(0x04) | ||
90 | #define EP93XX_TIMER1_CONTROL EP93XX_TIMER_REG(0x08) | ||
91 | #define EP93XX_TIMER123_CONTROL_ENABLE (1 << 7) | ||
92 | #define EP93XX_TIMER123_CONTROL_MODE (1 << 6) | ||
93 | #define EP93XX_TIMER123_CONTROL_CLKSEL (1 << 3) | ||
94 | #define EP93XX_TIMER1_CLEAR EP93XX_TIMER_REG(0x0c) | ||
95 | #define EP93XX_TIMER2_LOAD EP93XX_TIMER_REG(0x20) | ||
96 | #define EP93XX_TIMER2_VALUE EP93XX_TIMER_REG(0x24) | ||
97 | #define EP93XX_TIMER2_CONTROL EP93XX_TIMER_REG(0x28) | ||
98 | #define EP93XX_TIMER2_CLEAR EP93XX_TIMER_REG(0x2c) | ||
99 | #define EP93XX_TIMER4_VALUE_LOW EP93XX_TIMER_REG(0x60) | ||
100 | #define EP93XX_TIMER4_VALUE_HIGH EP93XX_TIMER_REG(0x64) | ||
101 | #define EP93XX_TIMER4_VALUE_HIGH_ENABLE (1 << 8) | ||
102 | #define EP93XX_TIMER3_LOAD EP93XX_TIMER_REG(0x80) | ||
103 | #define EP93XX_TIMER3_VALUE EP93XX_TIMER_REG(0x84) | ||
104 | #define EP93XX_TIMER3_CONTROL EP93XX_TIMER_REG(0x88) | ||
105 | #define EP93XX_TIMER3_CLEAR EP93XX_TIMER_REG(0x8c) | ||
106 | |||
107 | #define EP93XX_TIMER123_CLOCK 508469 | ||
108 | #define EP93XX_TIMER4_CLOCK 983040 | ||
109 | |||
110 | #define TIMER1_RELOAD ((EP93XX_TIMER123_CLOCK / HZ) - 1) | ||
87 | #define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(CLOCK_TICK_RATE, HZ) | 111 | #define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(CLOCK_TICK_RATE, HZ) |
88 | 112 | ||
113 | static unsigned int last_jiffy_time; | ||
114 | |||
89 | static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id) | 115 | static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id) |
90 | { | 116 | { |
117 | /* Writing any value clears the timer interrupt */ | ||
91 | __raw_writel(1, EP93XX_TIMER1_CLEAR); | 118 | __raw_writel(1, EP93XX_TIMER1_CLEAR); |
119 | |||
120 | /* Recover lost jiffies */ | ||
92 | while ((signed long) | 121 | while ((signed long) |
93 | (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time) | 122 | (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time) |
94 | >= TIMER4_TICKS_PER_JIFFY) { | 123 | >= TIMER4_TICKS_PER_JIFFY) { |
@@ -107,13 +136,18 @@ static struct irqaction ep93xx_timer_irq = { | |||
107 | 136 | ||
108 | static void __init ep93xx_timer_init(void) | 137 | static void __init ep93xx_timer_init(void) |
109 | { | 138 | { |
139 | u32 tmode = EP93XX_TIMER123_CONTROL_MODE | | ||
140 | EP93XX_TIMER123_CONTROL_CLKSEL; | ||
141 | |||
110 | /* Enable periodic HZ timer. */ | 142 | /* Enable periodic HZ timer. */ |
111 | __raw_writel(0x48, EP93XX_TIMER1_CONTROL); | 143 | __raw_writel(tmode, EP93XX_TIMER1_CONTROL); |
112 | __raw_writel((508469 / HZ) - 1, EP93XX_TIMER1_LOAD); | 144 | __raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD); |
113 | __raw_writel(0xc8, EP93XX_TIMER1_CONTROL); | 145 | __raw_writel(tmode | EP93XX_TIMER123_CONTROL_ENABLE, |
146 | EP93XX_TIMER1_CONTROL); | ||
114 | 147 | ||
115 | /* Enable lost jiffy timer. */ | 148 | /* Enable lost jiffy timer. */ |
116 | __raw_writel(0x100, EP93XX_TIMER4_VALUE_HIGH); | 149 | __raw_writel(EP93XX_TIMER4_VALUE_HIGH_ENABLE, |
150 | EP93XX_TIMER4_VALUE_HIGH); | ||
117 | 151 | ||
118 | setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq); | 152 | setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq); |
119 | } | 153 | } |
@@ -135,237 +169,16 @@ struct sys_timer ep93xx_timer = { | |||
135 | 169 | ||
136 | 170 | ||
137 | /************************************************************************* | 171 | /************************************************************************* |
138 | * GPIO handling for EP93xx | ||
139 | *************************************************************************/ | ||
140 | static unsigned char gpio_int_unmasked[3]; | ||
141 | static unsigned char gpio_int_enabled[3]; | ||
142 | static unsigned char gpio_int_type1[3]; | ||
143 | static unsigned char gpio_int_type2[3]; | ||
144 | static unsigned char gpio_int_debounce[3]; | ||
145 | |||
146 | /* Port ordering is: A B F */ | ||
147 | static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c }; | ||
148 | static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 }; | ||
149 | static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 }; | ||
150 | static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 }; | ||
151 | static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 }; | ||
152 | |||
153 | void ep93xx_gpio_update_int_params(unsigned port) | ||
154 | { | ||
155 | BUG_ON(port > 2); | ||
156 | |||
157 | __raw_writeb(0, EP93XX_GPIO_REG(int_en_register_offset[port])); | ||
158 | |||
159 | __raw_writeb(gpio_int_type2[port], | ||
160 | EP93XX_GPIO_REG(int_type2_register_offset[port])); | ||
161 | |||
162 | __raw_writeb(gpio_int_type1[port], | ||
163 | EP93XX_GPIO_REG(int_type1_register_offset[port])); | ||
164 | |||
165 | __raw_writeb(gpio_int_unmasked[port] & gpio_int_enabled[port], | ||
166 | EP93XX_GPIO_REG(int_en_register_offset[port])); | ||
167 | } | ||
168 | |||
169 | void ep93xx_gpio_int_mask(unsigned line) | ||
170 | { | ||
171 | gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7)); | ||
172 | } | ||
173 | |||
174 | void ep93xx_gpio_int_debounce(unsigned int irq, int enable) | ||
175 | { | ||
176 | int line = irq_to_gpio(irq); | ||
177 | int port = line >> 3; | ||
178 | int port_mask = 1 << (line & 7); | ||
179 | |||
180 | if (enable) | ||
181 | gpio_int_debounce[port] |= port_mask; | ||
182 | else | ||
183 | gpio_int_debounce[port] &= ~port_mask; | ||
184 | |||
185 | __raw_writeb(gpio_int_debounce[port], | ||
186 | EP93XX_GPIO_REG(int_debounce_register_offset[port])); | ||
187 | } | ||
188 | EXPORT_SYMBOL(ep93xx_gpio_int_debounce); | ||
189 | |||
190 | /************************************************************************* | ||
191 | * EP93xx IRQ handling | 172 | * EP93xx IRQ handling |
192 | *************************************************************************/ | 173 | *************************************************************************/ |
193 | static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc) | 174 | extern void ep93xx_gpio_init_irq(void); |
194 | { | ||
195 | unsigned char status; | ||
196 | int i; | ||
197 | |||
198 | status = __raw_readb(EP93XX_GPIO_A_INT_STATUS); | ||
199 | for (i = 0; i < 8; i++) { | ||
200 | if (status & (1 << i)) { | ||
201 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_A(0)) + i; | ||
202 | generic_handle_irq(gpio_irq); | ||
203 | } | ||
204 | } | ||
205 | |||
206 | status = __raw_readb(EP93XX_GPIO_B_INT_STATUS); | ||
207 | for (i = 0; i < 8; i++) { | ||
208 | if (status & (1 << i)) { | ||
209 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i; | ||
210 | generic_handle_irq(gpio_irq); | ||
211 | } | ||
212 | } | ||
213 | } | ||
214 | |||
215 | static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc) | ||
216 | { | ||
217 | /* | ||
218 | * map discontiguous hw irq range to continous sw irq range: | ||
219 | * | ||
220 | * IRQ_EP93XX_GPIO{0..7}MUX -> gpio_to_irq(EP93XX_GPIO_LINE_F({0..7}) | ||
221 | */ | ||
222 | int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */ | ||
223 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx; | ||
224 | |||
225 | generic_handle_irq(gpio_irq); | ||
226 | } | ||
227 | |||
228 | static void ep93xx_gpio_irq_ack(unsigned int irq) | ||
229 | { | ||
230 | int line = irq_to_gpio(irq); | ||
231 | int port = line >> 3; | ||
232 | int port_mask = 1 << (line & 7); | ||
233 | |||
234 | if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { | ||
235 | gpio_int_type2[port] ^= port_mask; /* switch edge direction */ | ||
236 | ep93xx_gpio_update_int_params(port); | ||
237 | } | ||
238 | |||
239 | __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); | ||
240 | } | ||
241 | |||
242 | static void ep93xx_gpio_irq_mask_ack(unsigned int irq) | ||
243 | { | ||
244 | int line = irq_to_gpio(irq); | ||
245 | int port = line >> 3; | ||
246 | int port_mask = 1 << (line & 7); | ||
247 | |||
248 | if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) | ||
249 | gpio_int_type2[port] ^= port_mask; /* switch edge direction */ | ||
250 | |||
251 | gpio_int_unmasked[port] &= ~port_mask; | ||
252 | ep93xx_gpio_update_int_params(port); | ||
253 | |||
254 | __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); | ||
255 | } | ||
256 | |||
257 | static void ep93xx_gpio_irq_mask(unsigned int irq) | ||
258 | { | ||
259 | int line = irq_to_gpio(irq); | ||
260 | int port = line >> 3; | ||
261 | |||
262 | gpio_int_unmasked[port] &= ~(1 << (line & 7)); | ||
263 | ep93xx_gpio_update_int_params(port); | ||
264 | } | ||
265 | |||
266 | static void ep93xx_gpio_irq_unmask(unsigned int irq) | ||
267 | { | ||
268 | int line = irq_to_gpio(irq); | ||
269 | int port = line >> 3; | ||
270 | |||
271 | gpio_int_unmasked[port] |= 1 << (line & 7); | ||
272 | ep93xx_gpio_update_int_params(port); | ||
273 | } | ||
274 | |||
275 | |||
276 | /* | ||
277 | * gpio_int_type1 controls whether the interrupt is level (0) or | ||
278 | * edge (1) triggered, while gpio_int_type2 controls whether it | ||
279 | * triggers on low/falling (0) or high/rising (1). | ||
280 | */ | ||
281 | static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type) | ||
282 | { | ||
283 | struct irq_desc *desc = irq_desc + irq; | ||
284 | const int gpio = irq_to_gpio(irq); | ||
285 | const int port = gpio >> 3; | ||
286 | const int port_mask = 1 << (gpio & 7); | ||
287 | |||
288 | gpio_direction_input(gpio); | ||
289 | |||
290 | switch (type) { | ||
291 | case IRQ_TYPE_EDGE_RISING: | ||
292 | gpio_int_type1[port] |= port_mask; | ||
293 | gpio_int_type2[port] |= port_mask; | ||
294 | desc->handle_irq = handle_edge_irq; | ||
295 | break; | ||
296 | case IRQ_TYPE_EDGE_FALLING: | ||
297 | gpio_int_type1[port] |= port_mask; | ||
298 | gpio_int_type2[port] &= ~port_mask; | ||
299 | desc->handle_irq = handle_edge_irq; | ||
300 | break; | ||
301 | case IRQ_TYPE_LEVEL_HIGH: | ||
302 | gpio_int_type1[port] &= ~port_mask; | ||
303 | gpio_int_type2[port] |= port_mask; | ||
304 | desc->handle_irq = handle_level_irq; | ||
305 | break; | ||
306 | case IRQ_TYPE_LEVEL_LOW: | ||
307 | gpio_int_type1[port] &= ~port_mask; | ||
308 | gpio_int_type2[port] &= ~port_mask; | ||
309 | desc->handle_irq = handle_level_irq; | ||
310 | break; | ||
311 | case IRQ_TYPE_EDGE_BOTH: | ||
312 | gpio_int_type1[port] |= port_mask; | ||
313 | /* set initial polarity based on current input level */ | ||
314 | if (gpio_get_value(gpio)) | ||
315 | gpio_int_type2[port] &= ~port_mask; /* falling */ | ||
316 | else | ||
317 | gpio_int_type2[port] |= port_mask; /* rising */ | ||
318 | desc->handle_irq = handle_edge_irq; | ||
319 | break; | ||
320 | default: | ||
321 | pr_err("ep93xx: failed to set irq type %d for gpio %d\n", | ||
322 | type, gpio); | ||
323 | return -EINVAL; | ||
324 | } | ||
325 | |||
326 | gpio_int_enabled[port] |= port_mask; | ||
327 | |||
328 | desc->status &= ~IRQ_TYPE_SENSE_MASK; | ||
329 | desc->status |= type & IRQ_TYPE_SENSE_MASK; | ||
330 | |||
331 | ep93xx_gpio_update_int_params(port); | ||
332 | |||
333 | return 0; | ||
334 | } | ||
335 | |||
336 | static struct irq_chip ep93xx_gpio_irq_chip = { | ||
337 | .name = "GPIO", | ||
338 | .ack = ep93xx_gpio_irq_ack, | ||
339 | .mask_ack = ep93xx_gpio_irq_mask_ack, | ||
340 | .mask = ep93xx_gpio_irq_mask, | ||
341 | .unmask = ep93xx_gpio_irq_unmask, | ||
342 | .set_type = ep93xx_gpio_irq_type, | ||
343 | }; | ||
344 | |||
345 | 175 | ||
346 | void __init ep93xx_init_irq(void) | 176 | void __init ep93xx_init_irq(void) |
347 | { | 177 | { |
348 | int gpio_irq; | ||
349 | |||
350 | vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0); | 178 | vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0); |
351 | vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0); | 179 | vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0); |
352 | 180 | ||
353 | for (gpio_irq = gpio_to_irq(0); | 181 | ep93xx_gpio_init_irq(); |
354 | gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) { | ||
355 | set_irq_chip(gpio_irq, &ep93xx_gpio_irq_chip); | ||
356 | set_irq_handler(gpio_irq, handle_level_irq); | ||
357 | set_irq_flags(gpio_irq, IRQF_VALID); | ||
358 | } | ||
359 | |||
360 | set_irq_chained_handler(IRQ_EP93XX_GPIO_AB, ep93xx_gpio_ab_irq_handler); | ||
361 | set_irq_chained_handler(IRQ_EP93XX_GPIO0MUX, ep93xx_gpio_f_irq_handler); | ||
362 | set_irq_chained_handler(IRQ_EP93XX_GPIO1MUX, ep93xx_gpio_f_irq_handler); | ||
363 | set_irq_chained_handler(IRQ_EP93XX_GPIO2MUX, ep93xx_gpio_f_irq_handler); | ||
364 | set_irq_chained_handler(IRQ_EP93XX_GPIO3MUX, ep93xx_gpio_f_irq_handler); | ||
365 | set_irq_chained_handler(IRQ_EP93XX_GPIO4MUX, ep93xx_gpio_f_irq_handler); | ||
366 | set_irq_chained_handler(IRQ_EP93XX_GPIO5MUX, ep93xx_gpio_f_irq_handler); | ||
367 | set_irq_chained_handler(IRQ_EP93XX_GPIO6MUX, ep93xx_gpio_f_irq_handler); | ||
368 | set_irq_chained_handler(IRQ_EP93XX_GPIO7MUX, ep93xx_gpio_f_irq_handler); | ||
369 | } | 182 | } |
370 | 183 | ||
371 | 184 | ||
@@ -572,9 +385,9 @@ void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data, | |||
572 | * CMOS driver. | 385 | * CMOS driver. |
573 | */ | 386 | */ |
574 | if (data->sda_is_open_drain && data->sda_pin != EP93XX_GPIO_LINE_EEDAT) | 387 | if (data->sda_is_open_drain && data->sda_pin != EP93XX_GPIO_LINE_EEDAT) |
575 | pr_warning("ep93xx: sda != EEDAT, open drain has no effect\n"); | 388 | pr_warning("sda != EEDAT, open drain has no effect\n"); |
576 | if (data->scl_is_open_drain && data->scl_pin != EP93XX_GPIO_LINE_EECLK) | 389 | if (data->scl_is_open_drain && data->scl_pin != EP93XX_GPIO_LINE_EECLK) |
577 | pr_warning("ep93xx: scl != EECLK, open drain has no effect\n"); | 390 | pr_warning("scl != EECLK, open drain has no effect\n"); |
578 | 391 | ||
579 | __raw_writel((data->sda_is_open_drain << 1) | | 392 | __raw_writel((data->sda_is_open_drain << 1) | |
580 | (data->scl_is_open_drain << 0), | 393 | (data->scl_is_open_drain << 0), |
diff --git a/arch/arm/mach-ep93xx/dma-m2p.c b/arch/arm/mach-ep93xx/dma-m2p.c index dbcac9c40a28..8904ca4e2e24 100644 --- a/arch/arm/mach-ep93xx/dma-m2p.c +++ b/arch/arm/mach-ep93xx/dma-m2p.c | |||
@@ -28,6 +28,8 @@ | |||
28 | * with this implementation. | 28 | * with this implementation. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt | ||
32 | |||
31 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
32 | #include <linux/clk.h> | 34 | #include <linux/clk.h> |
33 | #include <linux/err.h> | 35 | #include <linux/err.h> |
@@ -173,7 +175,7 @@ static irqreturn_t m2p_irq(int irq, void *dev_id) | |||
173 | 175 | ||
174 | switch (m2p_channel_state(ch)) { | 176 | switch (m2p_channel_state(ch)) { |
175 | case STATE_IDLE: | 177 | case STATE_IDLE: |
176 | pr_crit("m2p_irq: dma interrupt without a dma buffer\n"); | 178 | pr_crit("dma interrupt without a dma buffer\n"); |
177 | BUG(); | 179 | BUG(); |
178 | break; | 180 | break; |
179 | 181 | ||
@@ -197,7 +199,7 @@ static irqreturn_t m2p_irq(int irq, void *dev_id) | |||
197 | break; | 199 | break; |
198 | 200 | ||
199 | case STATE_NEXT: | 201 | case STATE_NEXT: |
200 | pr_crit("m2p_irq: dma interrupt while next\n"); | 202 | pr_crit("dma interrupt while next\n"); |
201 | BUG(); | 203 | BUG(); |
202 | break; | 204 | break; |
203 | } | 205 | } |
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c index a4a7be308000..d22d67ac8b99 100644 --- a/arch/arm/mach-ep93xx/edb93xx.c +++ b/arch/arm/mach-ep93xx/edb93xx.c | |||
@@ -118,12 +118,33 @@ static void __init edb93xx_register_i2c(void) | |||
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | |||
122 | /************************************************************************* | ||
123 | * EDB93xx pwm | ||
124 | *************************************************************************/ | ||
125 | static void __init edb93xx_register_pwm(void) | ||
126 | { | ||
127 | if (machine_is_edb9301() || | ||
128 | machine_is_edb9302() || machine_is_edb9302a()) { | ||
129 | /* EP9301 and EP9302 only have pwm.1 (EGPIO14) */ | ||
130 | ep93xx_register_pwm(0, 1); | ||
131 | } else if (machine_is_edb9307() || machine_is_edb9307a()) { | ||
132 | /* EP9307 only has pwm.0 (PWMOUT) */ | ||
133 | ep93xx_register_pwm(1, 0); | ||
134 | } else { | ||
135 | /* EP9312 and EP9315 have both */ | ||
136 | ep93xx_register_pwm(1, 1); | ||
137 | } | ||
138 | } | ||
139 | |||
140 | |||
121 | static void __init edb93xx_init_machine(void) | 141 | static void __init edb93xx_init_machine(void) |
122 | { | 142 | { |
123 | ep93xx_init_devices(); | 143 | ep93xx_init_devices(); |
124 | edb93xx_register_flash(); | 144 | edb93xx_register_flash(); |
125 | ep93xx_register_eth(&edb93xx_eth_data, 1); | 145 | ep93xx_register_eth(&edb93xx_eth_data, 1); |
126 | edb93xx_register_i2c(); | 146 | edb93xx_register_i2c(); |
147 | edb93xx_register_pwm(); | ||
127 | } | 148 | } |
128 | 149 | ||
129 | 150 | ||
diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c index 1ea8871e03a9..cc377ae8c428 100644 --- a/arch/arm/mach-ep93xx/gpio.c +++ b/arch/arm/mach-ep93xx/gpio.c | |||
@@ -13,6 +13,8 @@ | |||
13 | * published by the Free Software Foundation. | 13 | * published by the Free Software Foundation. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt | ||
17 | |||
16 | #include <linux/init.h> | 18 | #include <linux/init.h> |
17 | #include <linux/module.h> | 19 | #include <linux/module.h> |
18 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
@@ -22,6 +24,235 @@ | |||
22 | 24 | ||
23 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
24 | 26 | ||
27 | /************************************************************************* | ||
28 | * GPIO handling for EP93xx | ||
29 | *************************************************************************/ | ||
30 | static unsigned char gpio_int_unmasked[3]; | ||
31 | static unsigned char gpio_int_enabled[3]; | ||
32 | static unsigned char gpio_int_type1[3]; | ||
33 | static unsigned char gpio_int_type2[3]; | ||
34 | static unsigned char gpio_int_debounce[3]; | ||
35 | |||
36 | /* Port ordering is: A B F */ | ||
37 | static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c }; | ||
38 | static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 }; | ||
39 | static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 }; | ||
40 | static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 }; | ||
41 | static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 }; | ||
42 | |||
43 | void ep93xx_gpio_update_int_params(unsigned port) | ||
44 | { | ||
45 | BUG_ON(port > 2); | ||
46 | |||
47 | __raw_writeb(0, EP93XX_GPIO_REG(int_en_register_offset[port])); | ||
48 | |||
49 | __raw_writeb(gpio_int_type2[port], | ||
50 | EP93XX_GPIO_REG(int_type2_register_offset[port])); | ||
51 | |||
52 | __raw_writeb(gpio_int_type1[port], | ||
53 | EP93XX_GPIO_REG(int_type1_register_offset[port])); | ||
54 | |||
55 | __raw_writeb(gpio_int_unmasked[port] & gpio_int_enabled[port], | ||
56 | EP93XX_GPIO_REG(int_en_register_offset[port])); | ||
57 | } | ||
58 | |||
59 | void ep93xx_gpio_int_mask(unsigned line) | ||
60 | { | ||
61 | gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7)); | ||
62 | } | ||
63 | |||
64 | void ep93xx_gpio_int_debounce(unsigned int irq, int enable) | ||
65 | { | ||
66 | int line = irq_to_gpio(irq); | ||
67 | int port = line >> 3; | ||
68 | int port_mask = 1 << (line & 7); | ||
69 | |||
70 | if (enable) | ||
71 | gpio_int_debounce[port] |= port_mask; | ||
72 | else | ||
73 | gpio_int_debounce[port] &= ~port_mask; | ||
74 | |||
75 | __raw_writeb(gpio_int_debounce[port], | ||
76 | EP93XX_GPIO_REG(int_debounce_register_offset[port])); | ||
77 | } | ||
78 | EXPORT_SYMBOL(ep93xx_gpio_int_debounce); | ||
79 | |||
80 | static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc) | ||
81 | { | ||
82 | unsigned char status; | ||
83 | int i; | ||
84 | |||
85 | status = __raw_readb(EP93XX_GPIO_A_INT_STATUS); | ||
86 | for (i = 0; i < 8; i++) { | ||
87 | if (status & (1 << i)) { | ||
88 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_A(0)) + i; | ||
89 | generic_handle_irq(gpio_irq); | ||
90 | } | ||
91 | } | ||
92 | |||
93 | status = __raw_readb(EP93XX_GPIO_B_INT_STATUS); | ||
94 | for (i = 0; i < 8; i++) { | ||
95 | if (status & (1 << i)) { | ||
96 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i; | ||
97 | generic_handle_irq(gpio_irq); | ||
98 | } | ||
99 | } | ||
100 | } | ||
101 | |||
102 | static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc) | ||
103 | { | ||
104 | /* | ||
105 | * map discontiguous hw irq range to continous sw irq range: | ||
106 | * | ||
107 | * IRQ_EP93XX_GPIO{0..7}MUX -> gpio_to_irq(EP93XX_GPIO_LINE_F({0..7}) | ||
108 | */ | ||
109 | int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */ | ||
110 | int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx; | ||
111 | |||
112 | generic_handle_irq(gpio_irq); | ||
113 | } | ||
114 | |||
115 | static void ep93xx_gpio_irq_ack(unsigned int irq) | ||
116 | { | ||
117 | int line = irq_to_gpio(irq); | ||
118 | int port = line >> 3; | ||
119 | int port_mask = 1 << (line & 7); | ||
120 | |||
121 | if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { | ||
122 | gpio_int_type2[port] ^= port_mask; /* switch edge direction */ | ||
123 | ep93xx_gpio_update_int_params(port); | ||
124 | } | ||
125 | |||
126 | __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); | ||
127 | } | ||
128 | |||
129 | static void ep93xx_gpio_irq_mask_ack(unsigned int irq) | ||
130 | { | ||
131 | int line = irq_to_gpio(irq); | ||
132 | int port = line >> 3; | ||
133 | int port_mask = 1 << (line & 7); | ||
134 | |||
135 | if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) | ||
136 | gpio_int_type2[port] ^= port_mask; /* switch edge direction */ | ||
137 | |||
138 | gpio_int_unmasked[port] &= ~port_mask; | ||
139 | ep93xx_gpio_update_int_params(port); | ||
140 | |||
141 | __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); | ||
142 | } | ||
143 | |||
144 | static void ep93xx_gpio_irq_mask(unsigned int irq) | ||
145 | { | ||
146 | int line = irq_to_gpio(irq); | ||
147 | int port = line >> 3; | ||
148 | |||
149 | gpio_int_unmasked[port] &= ~(1 << (line & 7)); | ||
150 | ep93xx_gpio_update_int_params(port); | ||
151 | } | ||
152 | |||
153 | static void ep93xx_gpio_irq_unmask(unsigned int irq) | ||
154 | { | ||
155 | int line = irq_to_gpio(irq); | ||
156 | int port = line >> 3; | ||
157 | |||
158 | gpio_int_unmasked[port] |= 1 << (line & 7); | ||
159 | ep93xx_gpio_update_int_params(port); | ||
160 | } | ||
161 | |||
162 | /* | ||
163 | * gpio_int_type1 controls whether the interrupt is level (0) or | ||
164 | * edge (1) triggered, while gpio_int_type2 controls whether it | ||
165 | * triggers on low/falling (0) or high/rising (1). | ||
166 | */ | ||
167 | static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type) | ||
168 | { | ||
169 | struct irq_desc *desc = irq_desc + irq; | ||
170 | const int gpio = irq_to_gpio(irq); | ||
171 | const int port = gpio >> 3; | ||
172 | const int port_mask = 1 << (gpio & 7); | ||
173 | |||
174 | gpio_direction_input(gpio); | ||
175 | |||
176 | switch (type) { | ||
177 | case IRQ_TYPE_EDGE_RISING: | ||
178 | gpio_int_type1[port] |= port_mask; | ||
179 | gpio_int_type2[port] |= port_mask; | ||
180 | desc->handle_irq = handle_edge_irq; | ||
181 | break; | ||
182 | case IRQ_TYPE_EDGE_FALLING: | ||
183 | gpio_int_type1[port] |= port_mask; | ||
184 | gpio_int_type2[port] &= ~port_mask; | ||
185 | desc->handle_irq = handle_edge_irq; | ||
186 | break; | ||
187 | case IRQ_TYPE_LEVEL_HIGH: | ||
188 | gpio_int_type1[port] &= ~port_mask; | ||
189 | gpio_int_type2[port] |= port_mask; | ||
190 | desc->handle_irq = handle_level_irq; | ||
191 | break; | ||
192 | case IRQ_TYPE_LEVEL_LOW: | ||
193 | gpio_int_type1[port] &= ~port_mask; | ||
194 | gpio_int_type2[port] &= ~port_mask; | ||
195 | desc->handle_irq = handle_level_irq; | ||
196 | break; | ||
197 | case IRQ_TYPE_EDGE_BOTH: | ||
198 | gpio_int_type1[port] |= port_mask; | ||
199 | /* set initial polarity based on current input level */ | ||
200 | if (gpio_get_value(gpio)) | ||
201 | gpio_int_type2[port] &= ~port_mask; /* falling */ | ||
202 | else | ||
203 | gpio_int_type2[port] |= port_mask; /* rising */ | ||
204 | desc->handle_irq = handle_edge_irq; | ||
205 | break; | ||
206 | default: | ||
207 | pr_err("failed to set irq type %d for gpio %d\n", type, gpio); | ||
208 | return -EINVAL; | ||
209 | } | ||
210 | |||
211 | gpio_int_enabled[port] |= port_mask; | ||
212 | |||
213 | desc->status &= ~IRQ_TYPE_SENSE_MASK; | ||
214 | desc->status |= type & IRQ_TYPE_SENSE_MASK; | ||
215 | |||
216 | ep93xx_gpio_update_int_params(port); | ||
217 | |||
218 | return 0; | ||
219 | } | ||
220 | |||
221 | static struct irq_chip ep93xx_gpio_irq_chip = { | ||
222 | .name = "GPIO", | ||
223 | .ack = ep93xx_gpio_irq_ack, | ||
224 | .mask_ack = ep93xx_gpio_irq_mask_ack, | ||
225 | .mask = ep93xx_gpio_irq_mask, | ||
226 | .unmask = ep93xx_gpio_irq_unmask, | ||
227 | .set_type = ep93xx_gpio_irq_type, | ||
228 | }; | ||
229 | |||
230 | void __init ep93xx_gpio_init_irq(void) | ||
231 | { | ||
232 | int gpio_irq; | ||
233 | |||
234 | for (gpio_irq = gpio_to_irq(0); | ||
235 | gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) { | ||
236 | set_irq_chip(gpio_irq, &ep93xx_gpio_irq_chip); | ||
237 | set_irq_handler(gpio_irq, handle_level_irq); | ||
238 | set_irq_flags(gpio_irq, IRQF_VALID); | ||
239 | } | ||
240 | |||
241 | set_irq_chained_handler(IRQ_EP93XX_GPIO_AB, ep93xx_gpio_ab_irq_handler); | ||
242 | set_irq_chained_handler(IRQ_EP93XX_GPIO0MUX, ep93xx_gpio_f_irq_handler); | ||
243 | set_irq_chained_handler(IRQ_EP93XX_GPIO1MUX, ep93xx_gpio_f_irq_handler); | ||
244 | set_irq_chained_handler(IRQ_EP93XX_GPIO2MUX, ep93xx_gpio_f_irq_handler); | ||
245 | set_irq_chained_handler(IRQ_EP93XX_GPIO3MUX, ep93xx_gpio_f_irq_handler); | ||
246 | set_irq_chained_handler(IRQ_EP93XX_GPIO4MUX, ep93xx_gpio_f_irq_handler); | ||
247 | set_irq_chained_handler(IRQ_EP93XX_GPIO5MUX, ep93xx_gpio_f_irq_handler); | ||
248 | set_irq_chained_handler(IRQ_EP93XX_GPIO6MUX, ep93xx_gpio_f_irq_handler); | ||
249 | set_irq_chained_handler(IRQ_EP93XX_GPIO7MUX, ep93xx_gpio_f_irq_handler); | ||
250 | } | ||
251 | |||
252 | |||
253 | /************************************************************************* | ||
254 | * gpiolib interface for EP93xx on-chip GPIOs | ||
255 | *************************************************************************/ | ||
25 | struct ep93xx_gpio_chip { | 256 | struct ep93xx_gpio_chip { |
26 | struct gpio_chip chip; | 257 | struct gpio_chip chip; |
27 | 258 | ||
@@ -31,10 +262,6 @@ struct ep93xx_gpio_chip { | |||
31 | 262 | ||
32 | #define to_ep93xx_gpio_chip(c) container_of(c, struct ep93xx_gpio_chip, chip) | 263 | #define to_ep93xx_gpio_chip(c) container_of(c, struct ep93xx_gpio_chip, chip) |
33 | 264 | ||
34 | /* From core.c */ | ||
35 | extern void ep93xx_gpio_int_mask(unsigned line); | ||
36 | extern void ep93xx_gpio_update_int_params(unsigned port); | ||
37 | |||
38 | static int ep93xx_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | 265 | static int ep93xx_gpio_direction_input(struct gpio_chip *chip, unsigned offset) |
39 | { | 266 | { |
40 | struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip); | 267 | struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip); |
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h index d55194a4c093..93e2ecc79ceb 100644 --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | |||
@@ -92,21 +92,6 @@ | |||
92 | 92 | ||
93 | /* APB peripherals */ | 93 | /* APB peripherals */ |
94 | #define EP93XX_TIMER_BASE EP93XX_APB_IOMEM(0x00010000) | 94 | #define EP93XX_TIMER_BASE EP93XX_APB_IOMEM(0x00010000) |
95 | #define EP93XX_TIMER_REG(x) (EP93XX_TIMER_BASE + (x)) | ||
96 | #define EP93XX_TIMER1_LOAD EP93XX_TIMER_REG(0x00) | ||
97 | #define EP93XX_TIMER1_VALUE EP93XX_TIMER_REG(0x04) | ||
98 | #define EP93XX_TIMER1_CONTROL EP93XX_TIMER_REG(0x08) | ||
99 | #define EP93XX_TIMER1_CLEAR EP93XX_TIMER_REG(0x0c) | ||
100 | #define EP93XX_TIMER2_LOAD EP93XX_TIMER_REG(0x20) | ||
101 | #define EP93XX_TIMER2_VALUE EP93XX_TIMER_REG(0x24) | ||
102 | #define EP93XX_TIMER2_CONTROL EP93XX_TIMER_REG(0x28) | ||
103 | #define EP93XX_TIMER2_CLEAR EP93XX_TIMER_REG(0x2c) | ||
104 | #define EP93XX_TIMER4_VALUE_LOW EP93XX_TIMER_REG(0x60) | ||
105 | #define EP93XX_TIMER4_VALUE_HIGH EP93XX_TIMER_REG(0x64) | ||
106 | #define EP93XX_TIMER3_LOAD EP93XX_TIMER_REG(0x80) | ||
107 | #define EP93XX_TIMER3_VALUE EP93XX_TIMER_REG(0x84) | ||
108 | #define EP93XX_TIMER3_CONTROL EP93XX_TIMER_REG(0x88) | ||
109 | #define EP93XX_TIMER3_CLEAR EP93XX_TIMER_REG(0x8c) | ||
110 | 95 | ||
111 | #define EP93XX_I2S_BASE EP93XX_APB_IOMEM(0x00020000) | 96 | #define EP93XX_I2S_BASE EP93XX_APB_IOMEM(0x00020000) |
112 | 97 | ||
@@ -167,8 +152,11 @@ | |||
167 | #define EP93XX_SYSCON_PWRCNT_DMA_M2P1 (1<<16) | 152 | #define EP93XX_SYSCON_PWRCNT_DMA_M2P1 (1<<16) |
168 | #define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08) | 153 | #define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08) |
169 | #define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c) | 154 | #define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c) |
170 | #define EP93XX_SYSCON_CLOCK_SET1 EP93XX_SYSCON_REG(0x20) | 155 | #define EP93XX_SYSCON_CLKSET1 EP93XX_SYSCON_REG(0x20) |
171 | #define EP93XX_SYSCON_CLOCK_SET2 EP93XX_SYSCON_REG(0x24) | 156 | #define EP93XX_SYSCON_CLKSET1_NBYP1 (1<<23) |
157 | #define EP93XX_SYSCON_CLKSET2 EP93XX_SYSCON_REG(0x24) | ||
158 | #define EP93XX_SYSCON_CLKSET2_NBYP2 (1<<19) | ||
159 | #define EP93XX_SYSCON_CLKSET2_PLL2_EN (1<<18) | ||
172 | #define EP93XX_SYSCON_DEVCFG EP93XX_SYSCON_REG(0x80) | 160 | #define EP93XX_SYSCON_DEVCFG EP93XX_SYSCON_REG(0x80) |
173 | #define EP93XX_SYSCON_DEVCFG_SWRST (1<<31) | 161 | #define EP93XX_SYSCON_DEVCFG_SWRST (1<<31) |
174 | #define EP93XX_SYSCON_DEVCFG_D1ONG (1<<30) | 162 | #define EP93XX_SYSCON_DEVCFG_D1ONG (1<<30) |
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c new file mode 100644 index 000000000000..cd93990f1b99 --- /dev/null +++ b/arch/arm/mach-ep93xx/simone.c | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ep93xx/simone.c | ||
3 | * Simplemachines Sim.One support. | ||
4 | * | ||
5 | * Copyright (C) 2010 Ryan Mallon <ryan@bluewatersys.com> | ||
6 | * | ||
7 | * Based on the 2.6.24.7 support: | ||
8 | * Copyright (C) 2009 Simplemachines | ||
9 | * MMC support by Peter Ivanov <ivanovp@gmail.com>, 2007 | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or (at | ||
14 | * your option) any later version. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/mtd/physmap.h> | ||
22 | #include <linux/gpio.h> | ||
23 | #include <linux/i2c.h> | ||
24 | #include <linux/i2c-gpio.h> | ||
25 | |||
26 | #include <mach/hardware.h> | ||
27 | #include <mach/fb.h> | ||
28 | |||
29 | #include <asm/mach-types.h> | ||
30 | #include <asm/mach/arch.h> | ||
31 | |||
32 | static struct physmap_flash_data simone_flash_data = { | ||
33 | .width = 2, | ||
34 | }; | ||
35 | |||
36 | static struct resource simone_flash_resource = { | ||
37 | .start = EP93XX_CS6_PHYS_BASE, | ||
38 | .end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1, | ||
39 | .flags = IORESOURCE_MEM, | ||
40 | }; | ||
41 | |||
42 | static struct platform_device simone_flash = { | ||
43 | .name = "physmap-flash", | ||
44 | .id = 0, | ||
45 | .num_resources = 1, | ||
46 | .resource = &simone_flash_resource, | ||
47 | .dev = { | ||
48 | .platform_data = &simone_flash_data, | ||
49 | }, | ||
50 | }; | ||
51 | |||
52 | static struct ep93xx_eth_data simone_eth_data = { | ||
53 | .phy_id = 1, | ||
54 | }; | ||
55 | |||
56 | static struct ep93xxfb_mach_info simone_fb_info = { | ||
57 | .num_modes = EP93XXFB_USE_MODEDB, | ||
58 | .bpp = 16, | ||
59 | .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING, | ||
60 | }; | ||
61 | |||
62 | static struct i2c_gpio_platform_data simone_i2c_gpio_data = { | ||
63 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | ||
64 | .sda_is_open_drain = 0, | ||
65 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | ||
66 | .scl_is_open_drain = 0, | ||
67 | .udelay = 0, | ||
68 | .timeout = 0, | ||
69 | }; | ||
70 | |||
71 | static struct i2c_board_info __initdata simone_i2c_board_info[] = { | ||
72 | { | ||
73 | I2C_BOARD_INFO("ds1337", 0x68), | ||
74 | }, | ||
75 | }; | ||
76 | |||
77 | static void __init simone_init_machine(void) | ||
78 | { | ||
79 | ep93xx_init_devices(); | ||
80 | |||
81 | platform_device_register(&simone_flash); | ||
82 | ep93xx_register_eth(&simone_eth_data, 1); | ||
83 | ep93xx_register_fb(&simone_fb_info); | ||
84 | ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info, | ||
85 | ARRAY_SIZE(simone_i2c_board_info)); | ||
86 | } | ||
87 | |||
88 | MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board") | ||
89 | /* Maintainer: Ryan Mallon <ryan@bluewatersys.com> */ | ||
90 | .phys_io = EP93XX_APB_PHYS_BASE, | ||
91 | .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, | ||
92 | .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100, | ||
93 | .map_io = ep93xx_map_io, | ||
94 | .init_irq = ep93xx_init_irq, | ||
95 | .timer = &ep93xx_timer, | ||
96 | .init_machine = simone_init_machine, | ||
97 | MACHINE_END | ||
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c new file mode 100644 index 000000000000..51134b0382ca --- /dev/null +++ b/arch/arm/mach-ep93xx/snappercl15.c | |||
@@ -0,0 +1,172 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ep93xx/snappercl15.c | ||
3 | * Bluewater Systems Snapper CL15 system module | ||
4 | * | ||
5 | * Copyright (C) 2009 Bluewater Systems Ltd | ||
6 | * Author: Ryan Mallon <ryan@bluewatersys.com> | ||
7 | * | ||
8 | * NAND code adapted from driver by: | ||
9 | * Andre Renaud <andre@bluewatersys.com> | ||
10 | * James R. McKaskill | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License as published by | ||
14 | * the Free Software Foundation; either version 2 of the License, or (at | ||
15 | * your option) any later version. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/gpio.h> | ||
24 | #include <linux/i2c.h> | ||
25 | #include <linux/i2c-gpio.h> | ||
26 | #include <linux/fb.h> | ||
27 | |||
28 | #include <linux/mtd/partitions.h> | ||
29 | #include <linux/mtd/nand.h> | ||
30 | |||
31 | #include <mach/hardware.h> | ||
32 | #include <mach/fb.h> | ||
33 | |||
34 | #include <asm/mach-types.h> | ||
35 | #include <asm/mach/arch.h> | ||
36 | |||
37 | #define SNAPPERCL15_NAND_BASE (EP93XX_CS7_PHYS_BASE + SZ_16M) | ||
38 | |||
39 | #define SNAPPERCL15_NAND_WPN (1 << 8) /* Write protect (active low) */ | ||
40 | #define SNAPPERCL15_NAND_ALE (1 << 9) /* Address latch */ | ||
41 | #define SNAPPERCL15_NAND_CLE (1 << 10) /* Command latch */ | ||
42 | #define SNAPPERCL15_NAND_CEN (1 << 11) /* Chip enable (active low) */ | ||
43 | #define SNAPPERCL15_NAND_RDY (1 << 14) /* Device ready */ | ||
44 | |||
45 | #define NAND_CTRL_ADDR(chip) (chip->IO_ADDR_W + 0x40) | ||
46 | |||
47 | static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, | ||
48 | unsigned int ctrl) | ||
49 | { | ||
50 | struct nand_chip *chip = mtd->priv; | ||
51 | static u16 nand_state = SNAPPERCL15_NAND_WPN; | ||
52 | u16 set; | ||
53 | |||
54 | if (ctrl & NAND_CTRL_CHANGE) { | ||
55 | set = SNAPPERCL15_NAND_CEN | SNAPPERCL15_NAND_WPN; | ||
56 | |||
57 | if (ctrl & NAND_NCE) | ||
58 | set &= ~SNAPPERCL15_NAND_CEN; | ||
59 | if (ctrl & NAND_CLE) | ||
60 | set |= SNAPPERCL15_NAND_CLE; | ||
61 | if (ctrl & NAND_ALE) | ||
62 | set |= SNAPPERCL15_NAND_ALE; | ||
63 | |||
64 | nand_state &= ~(SNAPPERCL15_NAND_CEN | | ||
65 | SNAPPERCL15_NAND_CLE | | ||
66 | SNAPPERCL15_NAND_ALE); | ||
67 | nand_state |= set; | ||
68 | __raw_writew(nand_state, NAND_CTRL_ADDR(chip)); | ||
69 | } | ||
70 | |||
71 | if (cmd != NAND_CMD_NONE) | ||
72 | __raw_writew((cmd & 0xff) | nand_state, chip->IO_ADDR_W); | ||
73 | } | ||
74 | |||
75 | static int snappercl15_nand_dev_ready(struct mtd_info *mtd) | ||
76 | { | ||
77 | struct nand_chip *chip = mtd->priv; | ||
78 | |||
79 | return !!(__raw_readw(NAND_CTRL_ADDR(chip)) & SNAPPERCL15_NAND_RDY); | ||
80 | } | ||
81 | |||
82 | static const char *snappercl15_nand_part_probes[] = {"cmdlinepart", NULL}; | ||
83 | |||
84 | static struct mtd_partition snappercl15_nand_parts[] = { | ||
85 | { | ||
86 | .name = "Kernel", | ||
87 | .offset = 0, | ||
88 | .size = SZ_2M, | ||
89 | }, | ||
90 | { | ||
91 | .name = "Filesystem", | ||
92 | .offset = MTDPART_OFS_APPEND, | ||
93 | .size = MTDPART_SIZ_FULL, | ||
94 | }, | ||
95 | }; | ||
96 | |||
97 | static struct platform_nand_data snappercl15_nand_data = { | ||
98 | .chip = { | ||
99 | .nr_chips = 1, | ||
100 | .part_probe_types = snappercl15_nand_part_probes, | ||
101 | .partitions = snappercl15_nand_parts, | ||
102 | .nr_partitions = ARRAY_SIZE(snappercl15_nand_parts), | ||
103 | .options = NAND_NO_AUTOINCR, | ||
104 | .chip_delay = 25, | ||
105 | }, | ||
106 | .ctrl = { | ||
107 | .dev_ready = snappercl15_nand_dev_ready, | ||
108 | .cmd_ctrl = snappercl15_nand_cmd_ctrl, | ||
109 | }, | ||
110 | }; | ||
111 | |||
112 | static struct resource snappercl15_nand_resource[] = { | ||
113 | { | ||
114 | .start = SNAPPERCL15_NAND_BASE, | ||
115 | .end = SNAPPERCL15_NAND_BASE + SZ_4K - 1, | ||
116 | .flags = IORESOURCE_MEM, | ||
117 | }, | ||
118 | }; | ||
119 | |||
120 | static struct platform_device snappercl15_nand_device = { | ||
121 | .name = "gen_nand", | ||
122 | .id = -1, | ||
123 | .dev.platform_data = &snappercl15_nand_data, | ||
124 | .resource = snappercl15_nand_resource, | ||
125 | .num_resources = ARRAY_SIZE(snappercl15_nand_resource), | ||
126 | }; | ||
127 | |||
128 | static struct ep93xx_eth_data snappercl15_eth_data = { | ||
129 | .phy_id = 1, | ||
130 | }; | ||
131 | |||
132 | static struct i2c_gpio_platform_data snappercl15_i2c_gpio_data = { | ||
133 | .sda_pin = EP93XX_GPIO_LINE_EEDAT, | ||
134 | .sda_is_open_drain = 0, | ||
135 | .scl_pin = EP93XX_GPIO_LINE_EECLK, | ||
136 | .scl_is_open_drain = 0, | ||
137 | .udelay = 0, | ||
138 | .timeout = 0, | ||
139 | }; | ||
140 | |||
141 | static struct i2c_board_info __initdata snappercl15_i2c_data[] = { | ||
142 | { | ||
143 | /* Audio codec */ | ||
144 | I2C_BOARD_INFO("tlv320aic23", 0x1a), | ||
145 | }, | ||
146 | }; | ||
147 | |||
148 | static struct ep93xxfb_mach_info snappercl15_fb_info = { | ||
149 | .num_modes = EP93XXFB_USE_MODEDB, | ||
150 | .bpp = 16, | ||
151 | }; | ||
152 | |||
153 | static void __init snappercl15_init_machine(void) | ||
154 | { | ||
155 | ep93xx_init_devices(); | ||
156 | ep93xx_register_eth(&snappercl15_eth_data, 1); | ||
157 | ep93xx_register_i2c(&snappercl15_i2c_gpio_data, snappercl15_i2c_data, | ||
158 | ARRAY_SIZE(snappercl15_i2c_data)); | ||
159 | ep93xx_register_fb(&snappercl15_fb_info); | ||
160 | platform_device_register(&snappercl15_nand_device); | ||
161 | } | ||
162 | |||
163 | MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15") | ||
164 | /* Maintainer: Ryan Mallon <ryan@bluewatersys.com> */ | ||
165 | .phys_io = EP93XX_APB_PHYS_BASE, | ||
166 | .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, | ||
167 | .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100, | ||
168 | .map_io = ep93xx_map_io, | ||
169 | .init_irq = ep93xx_init_irq, | ||
170 | .timer = &ep93xx_timer, | ||
171 | .init_machine = snappercl15_init_machine, | ||
172 | MACHINE_END | ||
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 3bbf40f6d964..71728d36d501 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -427,6 +427,17 @@ static void __init ixp4xx_clocksource_init(void) | |||
427 | } | 427 | } |
428 | 428 | ||
429 | /* | 429 | /* |
430 | * sched_clock() | ||
431 | */ | ||
432 | unsigned long long sched_clock(void) | ||
433 | { | ||
434 | cycle_t cyc = ixp4xx_get_cycles(NULL); | ||
435 | struct clocksource *cs = &clocksource_ixp4xx; | ||
436 | |||
437 | return clocksource_cyc2ns(cyc, cs->mult, cs->shift); | ||
438 | } | ||
439 | |||
440 | /* | ||
430 | * clockevents | 441 | * clockevents |
431 | */ | 442 | */ |
432 | static int ixp4xx_set_next_event(unsigned long evt, | 443 | static int ixp4xx_set_next_event(unsigned long evt, |
diff --git a/arch/arm/mach-lh7a40x/clocks.c b/arch/arm/mach-lh7a40x/clocks.c index fcaf876f19b6..0651f96653f9 100644 --- a/arch/arm/mach-lh7a40x/clocks.c +++ b/arch/arm/mach-lh7a40x/clocks.c | |||
@@ -10,6 +10,8 @@ | |||
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | #include <mach/clocks.h> | 11 | #include <mach/clocks.h> |
12 | #include <linux/err.h> | 12 | #include <linux/err.h> |
13 | #include <linux/device.h> | ||
14 | #include <linux/string.h> | ||
13 | 15 | ||
14 | struct module; | 16 | struct module; |
15 | 17 | ||
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c index 8f49b2b12608..b22dec4abf78 100644 --- a/arch/arm/mach-mmp/ttc_dkb.c +++ b/arch/arm/mach-mmp/ttc_dkb.c | |||
@@ -24,8 +24,6 @@ | |||
24 | 24 | ||
25 | #include "common.h" | 25 | #include "common.h" |
26 | 26 | ||
27 | #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) | ||
28 | |||
29 | static unsigned long ttc_dkb_pin_config[] __initdata = { | 27 | static unsigned long ttc_dkb_pin_config[] __initdata = { |
30 | /* UART2 */ | 28 | /* UART2 */ |
31 | GPIO47_UART2_RXD, | 29 | GPIO47_UART2_RXD, |
diff --git a/arch/arm/mach-mx2/mxt_td60.c b/arch/arm/mach-mx2/mxt_td60.c index 03dbbdc98955..8bcc1a5b8829 100644 --- a/arch/arm/mach-mx2/mxt_td60.c +++ b/arch/arm/mach-mx2/mxt_td60.c | |||
@@ -58,21 +58,6 @@ static unsigned int mxt_td60_pins[] __initdata = { | |||
58 | PE9_PF_UART3_RXD, | 58 | PE9_PF_UART3_RXD, |
59 | PE10_PF_UART3_CTS, | 59 | PE10_PF_UART3_CTS, |
60 | PE11_PF_UART3_RTS, | 60 | PE11_PF_UART3_RTS, |
61 | /* UART3 */ | ||
62 | PB26_AF_UART4_RTS, | ||
63 | PB28_AF_UART4_TXD, | ||
64 | PB29_AF_UART4_CTS, | ||
65 | PB31_AF_UART4_RXD, | ||
66 | /* UART4 */ | ||
67 | PB18_AF_UART5_TXD, | ||
68 | PB19_AF_UART5_RXD, | ||
69 | PB20_AF_UART5_CTS, | ||
70 | PB21_AF_UART5_RTS, | ||
71 | /* UART5 */ | ||
72 | PB10_AF_UART6_TXD, | ||
73 | PB12_AF_UART6_CTS, | ||
74 | PB11_AF_UART6_RXD, | ||
75 | PB13_AF_UART6_RTS, | ||
76 | /* FEC */ | 61 | /* FEC */ |
77 | PD0_AIN_FEC_TXD0, | 62 | PD0_AIN_FEC_TXD0, |
78 | PD1_AIN_FEC_TXD1, | 63 | PD1_AIN_FEC_TXD1, |
@@ -261,12 +246,6 @@ static struct imxuart_platform_data uart_pdata[] = { | |||
261 | .flags = IMXUART_HAVE_RTSCTS, | 246 | .flags = IMXUART_HAVE_RTSCTS, |
262 | }, { | 247 | }, { |
263 | .flags = IMXUART_HAVE_RTSCTS, | 248 | .flags = IMXUART_HAVE_RTSCTS, |
264 | }, { | ||
265 | .flags = IMXUART_HAVE_RTSCTS, | ||
266 | }, { | ||
267 | .flags = IMXUART_HAVE_RTSCTS, | ||
268 | }, { | ||
269 | .flags = IMXUART_HAVE_RTSCTS, | ||
270 | }, | 249 | }, |
271 | }; | 250 | }; |
272 | 251 | ||
@@ -278,9 +257,6 @@ static void __init mxt_td60_board_init(void) | |||
278 | mxc_register_device(&mxc_uart_device0, &uart_pdata[0]); | 257 | mxc_register_device(&mxc_uart_device0, &uart_pdata[0]); |
279 | mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); | 258 | mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); |
280 | mxc_register_device(&mxc_uart_device2, &uart_pdata[2]); | 259 | mxc_register_device(&mxc_uart_device2, &uart_pdata[2]); |
281 | mxc_register_device(&mxc_uart_device3, &uart_pdata[3]); | ||
282 | mxc_register_device(&mxc_uart_device4, &uart_pdata[4]); | ||
283 | mxc_register_device(&mxc_uart_device5, &uart_pdata[5]); | ||
284 | mxc_register_device(&mxc_nand_device, &mxt_td60_nand_board_info); | 260 | mxc_register_device(&mxc_nand_device, &mxt_td60_nand_board_info); |
285 | 261 | ||
286 | i2c_register_board_info(0, mxt_td60_i2c_devices, | 262 | i2c_register_board_info(0, mxt_td60_i2c_devices, |
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c index ef26951a5275..6e838b857712 100644 --- a/arch/arm/mach-mx25/clock.c +++ b/arch/arm/mach-mx25/clock.c | |||
@@ -173,6 +173,7 @@ DEFINE_CLOCK(pwm4_clk, 0, CCM_CGCR2, 2, get_rate_ipg, NULL); | |||
173 | DEFINE_CLOCK(kpp_clk, 0, CCM_CGCR1, 28, get_rate_ipg, NULL); | 173 | DEFINE_CLOCK(kpp_clk, 0, CCM_CGCR1, 28, get_rate_ipg, NULL); |
174 | DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL); | 174 | DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL); |
175 | DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL); | 175 | DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL); |
176 | DEFINE_CLOCK(fec_clk, 0, CCM_CGCR0, 23, get_rate_ipg, NULL); | ||
176 | 177 | ||
177 | #define _REGISTER_CLOCK(d, n, c) \ | 178 | #define _REGISTER_CLOCK(d, n, c) \ |
178 | { \ | 179 | { \ |
@@ -204,6 +205,7 @@ static struct clk_lookup lookups[] = { | |||
204 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk) | 205 | _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk) |
205 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk) | 206 | _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk) |
206 | _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk) | 207 | _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk) |
208 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | ||
207 | }; | 209 | }; |
208 | 210 | ||
209 | int __init mx25_clocks_init(unsigned long fref) | 211 | int __init mx25_clocks_init(unsigned long fref) |
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c index 63511de3a559..9fdeea1c083b 100644 --- a/arch/arm/mach-mx25/devices.c +++ b/arch/arm/mach-mx25/devices.c | |||
@@ -419,3 +419,22 @@ int __init mxc_register_gpios(void) | |||
419 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); | 419 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); |
420 | } | 420 | } |
421 | 421 | ||
422 | static struct resource mx25_fec_resources[] = { | ||
423 | { | ||
424 | .start = MX25_FEC_BASE_ADDR, | ||
425 | .end = MX25_FEC_BASE_ADDR + 0xfff, | ||
426 | .flags = IORESOURCE_MEM, | ||
427 | }, | ||
428 | { | ||
429 | .start = MX25_INT_FEC, | ||
430 | .end = MX25_INT_FEC, | ||
431 | .flags = IORESOURCE_IRQ, | ||
432 | }, | ||
433 | }; | ||
434 | |||
435 | struct platform_device mx25_fec_device = { | ||
436 | .name = "fec", | ||
437 | .id = 0, | ||
438 | .num_resources = ARRAY_SIZE(mx25_fec_resources), | ||
439 | .resource = mx25_fec_resources, | ||
440 | }; | ||
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h index fe6bf88ad1dd..fe5420fcd11f 100644 --- a/arch/arm/mach-mx25/devices.h +++ b/arch/arm/mach-mx25/devices.h | |||
@@ -17,3 +17,4 @@ extern struct platform_device mxc_keypad_device; | |||
17 | extern struct platform_device mxc_i2c_device0; | 17 | extern struct platform_device mxc_i2c_device0; |
18 | extern struct platform_device mxc_i2c_device1; | 18 | extern struct platform_device mxc_i2c_device1; |
19 | extern struct platform_device mxc_i2c_device2; | 19 | extern struct platform_device mxc_i2c_device2; |
20 | extern struct platform_device mx25_fec_device; | ||
diff --git a/arch/arm/mach-mx25/mx25pdk.c b/arch/arm/mach-mx25/mx25pdk.c index d23ae571c03f..921bc99ea231 100644 --- a/arch/arm/mach-mx25/mx25pdk.c +++ b/arch/arm/mach-mx25/mx25pdk.c | |||
@@ -18,10 +18,11 @@ | |||
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/delay.h> | ||
21 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
22 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
23 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
24 | #include <linux/smsc911x.h> | 25 | #include <linux/fec.h> |
25 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
26 | 27 | ||
27 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
@@ -35,16 +36,57 @@ | |||
35 | #include <mach/mx25.h> | 36 | #include <mach/mx25.h> |
36 | #include <mach/mxc_nand.h> | 37 | #include <mach/mxc_nand.h> |
37 | #include "devices.h" | 38 | #include "devices.h" |
38 | #include <mach/iomux-v3.h> | 39 | #include <mach/iomux.h> |
39 | 40 | ||
40 | static struct imxuart_platform_data uart_pdata = { | 41 | static struct imxuart_platform_data uart_pdata = { |
41 | .flags = IMXUART_HAVE_RTSCTS, | 42 | .flags = IMXUART_HAVE_RTSCTS, |
42 | }; | 43 | }; |
43 | 44 | ||
45 | static struct pad_desc mx25pdk_pads[] = { | ||
46 | MX25_PAD_FEC_MDC__FEC_MDC, | ||
47 | MX25_PAD_FEC_MDIO__FEC_MDIO, | ||
48 | MX25_PAD_FEC_TDATA0__FEC_TDATA0, | ||
49 | MX25_PAD_FEC_TDATA1__FEC_TDATA1, | ||
50 | MX25_PAD_FEC_TX_EN__FEC_TX_EN, | ||
51 | MX25_PAD_FEC_RDATA0__FEC_RDATA0, | ||
52 | MX25_PAD_FEC_RDATA1__FEC_RDATA1, | ||
53 | MX25_PAD_FEC_RX_DV__FEC_RX_DV, | ||
54 | MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, | ||
55 | MX25_PAD_A17__GPIO_2_3, /* FEC_EN, GPIO 35 */ | ||
56 | MX25_PAD_D12__GPIO_4_8, /* FEC_RESET_B, GPIO 104 */ | ||
57 | }; | ||
58 | |||
59 | static struct fec_platform_data mx25_fec_pdata = { | ||
60 | .phy = PHY_INTERFACE_MODE_RMII, | ||
61 | }; | ||
62 | |||
63 | #define FEC_ENABLE_GPIO 35 | ||
64 | #define FEC_RESET_B_GPIO 104 | ||
65 | |||
66 | static void __init mx25pdk_fec_reset(void) | ||
67 | { | ||
68 | gpio_request(FEC_ENABLE_GPIO, "FEC PHY enable"); | ||
69 | gpio_request(FEC_RESET_B_GPIO, "FEC PHY reset"); | ||
70 | |||
71 | gpio_direction_output(FEC_ENABLE_GPIO, 0); /* drop PHY power */ | ||
72 | gpio_direction_output(FEC_RESET_B_GPIO, 0); /* assert reset */ | ||
73 | udelay(2); | ||
74 | |||
75 | /* turn on PHY power and lift reset */ | ||
76 | gpio_set_value(FEC_ENABLE_GPIO, 1); | ||
77 | gpio_set_value(FEC_RESET_B_GPIO, 1); | ||
78 | } | ||
79 | |||
44 | static void __init mx25pdk_init(void) | 80 | static void __init mx25pdk_init(void) |
45 | { | 81 | { |
82 | mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, | ||
83 | ARRAY_SIZE(mx25pdk_pads)); | ||
84 | |||
46 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 85 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
47 | mxc_register_device(&mxc_usbh2, NULL); | 86 | mxc_register_device(&mxc_usbh2, NULL); |
87 | |||
88 | mx25pdk_fec_reset(); | ||
89 | mxc_register_device(&mx25_fec_device, &mx25_fec_pdata); | ||
48 | } | 90 | } |
49 | 91 | ||
50 | static void __init mx25pdk_timer_init(void) | 92 | static void __init mx25pdk_timer_init(void) |
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index ea8ed109a7c2..28294416b0af 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig | |||
@@ -49,6 +49,7 @@ config MACH_PCM037_EET | |||
49 | config MACH_MX31LITE | 49 | config MACH_MX31LITE |
50 | bool "Support MX31 LITEKIT (LogicPD)" | 50 | bool "Support MX31 LITEKIT (LogicPD)" |
51 | select ARCH_MX31 | 51 | select ARCH_MX31 |
52 | select MXC_ULPI if USB_ULPI | ||
52 | help | 53 | help |
53 | Include support for MX31 LITEKIT platform. This includes specific | 54 | Include support for MX31 LITEKIT platform. This includes specific |
54 | configurations for the board and its peripherals. | 55 | configurations for the board and its peripherals. |
@@ -63,7 +64,7 @@ config MACH_MX31_3DS | |||
63 | config MACH_MX31MOBOARD | 64 | config MACH_MX31MOBOARD |
64 | bool "Support mx31moboard platforms (EPFL Mobots group)" | 65 | bool "Support mx31moboard platforms (EPFL Mobots group)" |
65 | select ARCH_MX31 | 66 | select ARCH_MX31 |
66 | select MXC_ULPI | 67 | select MXC_ULPI if USB_ULPI |
67 | help | 68 | help |
68 | Include support for mx31moboard platform. This includes specific | 69 | Include support for mx31moboard platform. This includes specific |
69 | configurations for the board and its peripherals. | 70 | configurations for the board and its peripherals. |
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c index bedf5b8d976a..6858a4f9806c 100644 --- a/arch/arm/mach-mx3/mm.c +++ b/arch/arm/mach-mx3/mm.c | |||
@@ -65,6 +65,11 @@ static struct map_desc mxc_io_desc[] __initdata = { | |||
65 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | 65 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), |
66 | .length = AIPS2_SIZE, | 66 | .length = AIPS2_SIZE, |
67 | .type = MT_DEVICE_NONSHARED | 67 | .type = MT_DEVICE_NONSHARED |
68 | }, { | ||
69 | .virtual = SPBA0_BASE_ADDR_VIRT, | ||
70 | .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), | ||
71 | .length = SPBA0_SIZE, | ||
72 | .type = MT_DEVICE_NONSHARED | ||
68 | }, | 73 | }, |
69 | }; | 74 | }; |
70 | 75 | ||
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mx31ads.c index 0497c152be18..3e7bafa2ddbb 100644 --- a/arch/arm/mach-mx3/mx31ads.c +++ b/arch/arm/mach-mx3/mx31ads.c | |||
@@ -494,11 +494,6 @@ static void mxc_init_i2c(void) | |||
494 | */ | 494 | */ |
495 | static struct map_desc mx31ads_io_desc[] __initdata = { | 495 | static struct map_desc mx31ads_io_desc[] __initdata = { |
496 | { | 496 | { |
497 | .virtual = SPBA0_BASE_ADDR_VIRT, | ||
498 | .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), | ||
499 | .length = SPBA0_SIZE, | ||
500 | .type = MT_DEVICE_NONSHARED | ||
501 | }, { | ||
502 | .virtual = CS4_BASE_ADDR_VIRT, | 497 | .virtual = CS4_BASE_ADDR_VIRT, |
503 | .pfn = __phys_to_pfn(CS4_BASE_ADDR), | 498 | .pfn = __phys_to_pfn(CS4_BASE_ADDR), |
504 | .length = CS4_SIZE / 2, | 499 | .length = CS4_SIZE / 2, |
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mx31lite.c index def6b6736594..789b20d1730f 100644 --- a/arch/arm/mach-mx3/mx31lite.c +++ b/arch/arm/mach-mx3/mx31lite.c | |||
@@ -135,6 +135,7 @@ static struct spi_board_info mc13783_spi_dev __initdata = { | |||
135 | * USB | 135 | * USB |
136 | */ | 136 | */ |
137 | 137 | ||
138 | #if defined(CONFIG_USB_ULPI) | ||
138 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ | 139 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ |
139 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) | 140 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) |
140 | 141 | ||
@@ -180,6 +181,7 @@ static struct mxc_usbh_platform_data usbh2_pdata = { | |||
180 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 181 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
181 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 182 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
182 | }; | 183 | }; |
184 | #endif | ||
183 | 185 | ||
184 | /* | 186 | /* |
185 | * NOR flash | 187 | * NOR flash |
@@ -212,11 +214,6 @@ static struct platform_device physmap_flash_device = { | |||
212 | */ | 214 | */ |
213 | static struct map_desc mx31lite_io_desc[] __initdata = { | 215 | static struct map_desc mx31lite_io_desc[] __initdata = { |
214 | { | 216 | { |
215 | .virtual = SPBA0_BASE_ADDR_VIRT, | ||
216 | .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), | ||
217 | .length = SPBA0_SIZE, | ||
218 | .type = MT_DEVICE_NONSHARED | ||
219 | }, { | ||
220 | .virtual = CS4_BASE_ADDR_VIRT, | 217 | .virtual = CS4_BASE_ADDR_VIRT, |
221 | .pfn = __phys_to_pfn(CS4_BASE_ADDR), | 218 | .pfn = __phys_to_pfn(CS4_BASE_ADDR), |
222 | .length = CS4_SIZE, | 219 | .length = CS4_SIZE, |
@@ -261,11 +258,13 @@ static void __init mxc_board_init(void) | |||
261 | mxc_register_device(&mxc_spi_device1, &spi1_pdata); | 258 | mxc_register_device(&mxc_spi_device1, &spi1_pdata); |
262 | spi_register_board_info(&mc13783_spi_dev, 1); | 259 | spi_register_board_info(&mc13783_spi_dev, 1); |
263 | 260 | ||
261 | #if defined(CONFIG_USB_ULPI) | ||
264 | /* USB */ | 262 | /* USB */ |
265 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 263 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
266 | USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); | 264 | USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); |
267 | 265 | ||
268 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 266 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); |
267 | #endif | ||
269 | 268 | ||
270 | /* SMSC9117 IRQ pin */ | 269 | /* SMSC9117 IRQ pin */ |
271 | ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq"); | 270 | ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq"); |
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c index 8fc624f141cb..438428eaf769 100644 --- a/arch/arm/mach-mx3/mx31moboard-devboard.c +++ b/arch/arm/mach-mx3/mx31moboard-devboard.c | |||
@@ -179,7 +179,7 @@ static int __init devboard_usbh1_init(void) | |||
179 | 179 | ||
180 | usbh1_pdata.otg = otg; | 180 | usbh1_pdata.otg = otg; |
181 | 181 | ||
182 | return mxc_register_device(&mx31_usbh1, &usbh1_pdata); | 182 | return mxc_register_device(&mxc_usbh1, &usbh1_pdata); |
183 | } | 183 | } |
184 | 184 | ||
185 | /* | 185 | /* |
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c index 85184a35e674..1f44b9ccbb0f 100644 --- a/arch/arm/mach-mx3/mx31moboard-marxbot.c +++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c | |||
@@ -294,7 +294,7 @@ static int __init marxbot_usbh1_init(void) | |||
294 | 294 | ||
295 | usbh1_pdata.otg = otg; | 295 | usbh1_pdata.otg = otg; |
296 | 296 | ||
297 | return mxc_register_device(&mx31_usbh1, &usbh1_pdata); | 297 | return mxc_register_device(&mxc_usbh1, &usbh1_pdata); |
298 | } | 298 | } |
299 | 299 | ||
300 | /* | 300 | /* |
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c index b70529145936..cfd605d078ec 100644 --- a/arch/arm/mach-mx3/mx31moboard.c +++ b/arch/arm/mach-mx3/mx31moboard.c | |||
@@ -346,6 +346,8 @@ static struct fsl_usb2_platform_data usb_pdata = { | |||
346 | .phy_mode = FSL_USB2_PHY_ULPI, | 346 | .phy_mode = FSL_USB2_PHY_ULPI, |
347 | }; | 347 | }; |
348 | 348 | ||
349 | #if defined(CONFIG_USB_ULPI) | ||
350 | |||
349 | #define USBH2_EN_B IOMUX_TO_GPIO(MX31_PIN_SCK6) | 351 | #define USBH2_EN_B IOMUX_TO_GPIO(MX31_PIN_SCK6) |
350 | 352 | ||
351 | static int moboard_usbh2_hw_init(struct platform_device *pdev) | 353 | static int moboard_usbh2_hw_init(struct platform_device *pdev) |
@@ -392,8 +394,11 @@ static int __init moboard_usbh2_init(void) | |||
392 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 394 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
393 | USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); | 395 | USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); |
394 | 396 | ||
395 | return mxc_register_device(&mx31_usbh2, &usbh2_pdata); | 397 | return mxc_register_device(&mxc_usbh2, &usbh2_pdata); |
396 | } | 398 | } |
399 | #else | ||
400 | static inline int moboard_usbh2_init(void) { return 0; } | ||
401 | #endif | ||
397 | 402 | ||
398 | 403 | ||
399 | static struct gpio_led mx31moboard_leds[] = { | 404 | static struct gpio_led mx31moboard_leds[] = { |
diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c index 0f7a2f06bc2d..18715f1aa7eb 100644 --- a/arch/arm/mach-mx3/mx31pdk.c +++ b/arch/arm/mach-mx3/mx31pdk.c | |||
@@ -211,11 +211,6 @@ static int __init mx31pdk_init_expio(void) | |||
211 | */ | 211 | */ |
212 | static struct map_desc mx31pdk_io_desc[] __initdata = { | 212 | static struct map_desc mx31pdk_io_desc[] __initdata = { |
213 | { | 213 | { |
214 | .virtual = SPBA0_BASE_ADDR_VIRT, | ||
215 | .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), | ||
216 | .length = SPBA0_SIZE, | ||
217 | .type = MT_DEVICE_NONSHARED, | ||
218 | }, { | ||
219 | .virtual = CS5_BASE_ADDR_VIRT, | 214 | .virtual = CS5_BASE_ADDR_VIRT, |
220 | .pfn = __phys_to_pfn(CS5_BASE_ADDR), | 215 | .pfn = __phys_to_pfn(CS5_BASE_ADDR), |
221 | .length = CS5_SIZE, | 216 | .length = CS5_SIZE, |
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c index 6cbaabedf386..5be396917c99 100644 --- a/arch/arm/mach-mx3/pcm037.c +++ b/arch/arm/mach-mx3/pcm037.c | |||
@@ -322,16 +322,25 @@ static int pcm037_camera_power(struct device *dev, int on) | |||
322 | return 0; | 322 | return 0; |
323 | } | 323 | } |
324 | 324 | ||
325 | static struct i2c_board_info pcm037_i2c_2_devices[] = { | 325 | static struct i2c_board_info pcm037_i2c_camera[] = { |
326 | { | 326 | { |
327 | I2C_BOARD_INFO("mt9t031", 0x5d), | 327 | I2C_BOARD_INFO("mt9t031", 0x5d), |
328 | }, { | ||
329 | I2C_BOARD_INFO("mt9v022", 0x48), | ||
328 | }, | 330 | }, |
329 | }; | 331 | }; |
330 | 332 | ||
331 | static struct soc_camera_link iclink = { | 333 | static struct soc_camera_link iclink_mt9v022 = { |
334 | .bus_id = 0, /* Must match with the camera ID */ | ||
335 | .board_info = &pcm037_i2c_camera[1], | ||
336 | .i2c_adapter_id = 2, | ||
337 | .module_name = "mt9v022", | ||
338 | }; | ||
339 | |||
340 | static struct soc_camera_link iclink_mt9t031 = { | ||
332 | .bus_id = 0, /* Must match with the camera ID */ | 341 | .bus_id = 0, /* Must match with the camera ID */ |
333 | .power = pcm037_camera_power, | 342 | .power = pcm037_camera_power, |
334 | .board_info = &pcm037_i2c_2_devices[0], | 343 | .board_info = &pcm037_i2c_camera[0], |
335 | .i2c_adapter_id = 2, | 344 | .i2c_adapter_id = 2, |
336 | .module_name = "mt9t031", | 345 | .module_name = "mt9t031", |
337 | }; | 346 | }; |
@@ -345,11 +354,19 @@ static struct i2c_board_info pcm037_i2c_devices[] = { | |||
345 | } | 354 | } |
346 | }; | 355 | }; |
347 | 356 | ||
348 | static struct platform_device pcm037_camera = { | 357 | static struct platform_device pcm037_mt9t031 = { |
349 | .name = "soc-camera-pdrv", | 358 | .name = "soc-camera-pdrv", |
350 | .id = 0, | 359 | .id = 0, |
351 | .dev = { | 360 | .dev = { |
352 | .platform_data = &iclink, | 361 | .platform_data = &iclink_mt9t031, |
362 | }, | ||
363 | }; | ||
364 | |||
365 | static struct platform_device pcm037_mt9v022 = { | ||
366 | .name = "soc-camera-pdrv", | ||
367 | .id = 1, | ||
368 | .dev = { | ||
369 | .platform_data = &iclink_mt9v022, | ||
353 | }, | 370 | }, |
354 | }; | 371 | }; |
355 | 372 | ||
@@ -449,7 +466,8 @@ static int __init pcm037_camera_alloc_dma(const size_t buf_size) | |||
449 | static struct platform_device *devices[] __initdata = { | 466 | static struct platform_device *devices[] __initdata = { |
450 | &pcm037_flash, | 467 | &pcm037_flash, |
451 | &pcm037_sram_device, | 468 | &pcm037_sram_device, |
452 | &pcm037_camera, | 469 | &pcm037_mt9t031, |
470 | &pcm037_mt9v022, | ||
453 | }; | 471 | }; |
454 | 472 | ||
455 | static struct ipu_platform_data mx3_ipu_data = { | 473 | static struct ipu_platform_data mx3_ipu_data = { |
@@ -599,7 +617,7 @@ static void __init mxc_board_init(void) | |||
599 | if (!ret) | 617 | if (!ret) |
600 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1); | 618 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1); |
601 | else | 619 | else |
602 | iclink.power = NULL; | 620 | iclink_mt9t031.power = NULL; |
603 | 621 | ||
604 | if (!pcm037_camera_alloc_dma(4 * 1024 * 1024)) | 622 | if (!pcm037_camera_alloc_dma(4 * 1024 * 1024)) |
605 | mxc_register_device(&mx3_camera, &camera_pdata); | 623 | mxc_register_device(&mx3_camera, &camera_pdata); |
diff --git a/arch/arm/mach-nuc93x/Kconfig b/arch/arm/mach-nuc93x/Kconfig new file mode 100644 index 000000000000..2bc40a280fad --- /dev/null +++ b/arch/arm/mach-nuc93x/Kconfig | |||
@@ -0,0 +1,19 @@ | |||
1 | if ARCH_NUC93X | ||
2 | |||
3 | config CPU_NUC932 | ||
4 | bool | ||
5 | help | ||
6 | Support for NUC932 of Nuvoton NUC93X CPUs. | ||
7 | |||
8 | menu "NUC932 Machines" | ||
9 | |||
10 | config MACH_NUC932EVB | ||
11 | bool "Nuvoton NUC932 Evaluation Board" | ||
12 | default y | ||
13 | select CPU_NUC932 | ||
14 | help | ||
15 | Say Y here if you are using the Nuvoton NUC932EVB | ||
16 | |||
17 | endmenu | ||
18 | |||
19 | endif | ||
diff --git a/arch/arm/mach-nuc93x/Makefile b/arch/arm/mach-nuc93x/Makefile new file mode 100644 index 000000000000..440e2dec6c8a --- /dev/null +++ b/arch/arm/mach-nuc93x/Makefile | |||
@@ -0,0 +1,14 @@ | |||
1 | # | ||
2 | # Makefile for the linux kernel. | ||
3 | # | ||
4 | |||
5 | # Object file lists. | ||
6 | |||
7 | obj-y := irq.o time.o dev.o cpu.o clock.o | ||
8 | # NUC932 CPU support files | ||
9 | |||
10 | obj-$(CONFIG_CPU_NUC932) += nuc932.o | ||
11 | |||
12 | # machine support | ||
13 | |||
14 | obj-$(CONFIG_MACH_NUC932EVB) += mach-nuc932evb.o | ||
diff --git a/arch/arm/mach-nuc93x/Makefile.boot b/arch/arm/mach-nuc93x/Makefile.boot new file mode 100644 index 000000000000..a057b546b6e5 --- /dev/null +++ b/arch/arm/mach-nuc93x/Makefile.boot | |||
@@ -0,0 +1,3 @@ | |||
1 | zreladdr-y := 0x00008000 | ||
2 | params_phys-y := 0x00000100 | ||
3 | |||
diff --git a/arch/arm/mach-nuc93x/clock.c b/arch/arm/mach-nuc93x/clock.c new file mode 100644 index 000000000000..0521efbc48c9 --- /dev/null +++ b/arch/arm/mach-nuc93x/clock.c | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-nuc93x/clock.c | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
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 as published by | ||
10 | * the Free Software Foundation; either version 2 of the License. | ||
11 | */ | ||
12 | |||
13 | #include <linux/module.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/list.h> | ||
16 | #include <linux/errno.h> | ||
17 | #include <linux/err.h> | ||
18 | #include <linux/string.h> | ||
19 | #include <linux/clk.h> | ||
20 | #include <linux/spinlock.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/io.h> | ||
23 | |||
24 | #include <mach/hardware.h> | ||
25 | |||
26 | #include "clock.h" | ||
27 | |||
28 | static DEFINE_SPINLOCK(clocks_lock); | ||
29 | |||
30 | int clk_enable(struct clk *clk) | ||
31 | { | ||
32 | unsigned long flags; | ||
33 | |||
34 | spin_lock_irqsave(&clocks_lock, flags); | ||
35 | if (clk->enabled++ == 0) | ||
36 | (clk->enable)(clk, 1); | ||
37 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
38 | |||
39 | return 0; | ||
40 | } | ||
41 | EXPORT_SYMBOL(clk_enable); | ||
42 | |||
43 | void clk_disable(struct clk *clk) | ||
44 | { | ||
45 | unsigned long flags; | ||
46 | |||
47 | WARN_ON(clk->enabled == 0); | ||
48 | |||
49 | spin_lock_irqsave(&clocks_lock, flags); | ||
50 | if (--clk->enabled == 0) | ||
51 | (clk->enable)(clk, 0); | ||
52 | spin_unlock_irqrestore(&clocks_lock, flags); | ||
53 | } | ||
54 | EXPORT_SYMBOL(clk_disable); | ||
55 | |||
56 | unsigned long clk_get_rate(struct clk *clk) | ||
57 | { | ||
58 | return 27000000; | ||
59 | } | ||
60 | EXPORT_SYMBOL(clk_get_rate); | ||
61 | |||
62 | void nuc93x_clk_enable(struct clk *clk, int enable) | ||
63 | { | ||
64 | unsigned int clocks = clk->cken; | ||
65 | unsigned long clken; | ||
66 | |||
67 | clken = __raw_readl(NUC93X_VA_CLKPWR); | ||
68 | |||
69 | if (enable) | ||
70 | clken |= clocks; | ||
71 | else | ||
72 | clken &= ~clocks; | ||
73 | |||
74 | __raw_writel(clken, NUC93X_VA_CLKPWR); | ||
75 | } | ||
76 | |||
77 | void clks_register(struct clk_lookup *clks, size_t num) | ||
78 | { | ||
79 | int i; | ||
80 | |||
81 | for (i = 0; i < num; i++) | ||
82 | clkdev_add(&clks[i]); | ||
83 | } | ||
diff --git a/arch/arm/mach-nuc93x/clock.h b/arch/arm/mach-nuc93x/clock.h new file mode 100644 index 000000000000..18e51be4816f --- /dev/null +++ b/arch/arm/mach-nuc93x/clock.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-nuc93x/clock.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
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 as published by | ||
10 | * the Free Software Foundation; either version 2 of the License. | ||
11 | */ | ||
12 | |||
13 | #include <asm/clkdev.h> | ||
14 | |||
15 | void nuc93x_clk_enable(struct clk *clk, int enable); | ||
16 | void clks_register(struct clk_lookup *clks, size_t num); | ||
17 | |||
18 | struct clk { | ||
19 | unsigned long cken; | ||
20 | unsigned int enabled; | ||
21 | void (*enable)(struct clk *, int enable); | ||
22 | }; | ||
23 | |||
24 | #define DEFINE_CLK(_name, _ctrlbit) \ | ||
25 | struct clk clk_##_name = { \ | ||
26 | .enable = nuc93x_clk_enable, \ | ||
27 | .cken = (1 << _ctrlbit), \ | ||
28 | } | ||
29 | |||
30 | #define DEF_CLKLOOK(_clk, _devname, _conname) \ | ||
31 | { \ | ||
32 | .clk = _clk, \ | ||
33 | .dev_id = _devname, \ | ||
34 | .con_id = _conname, \ | ||
35 | } | ||
36 | |||
diff --git a/arch/arm/mach-nuc93x/cpu.c b/arch/arm/mach-nuc93x/cpu.c new file mode 100644 index 000000000000..f6ff5d87354c --- /dev/null +++ b/arch/arm/mach-nuc93x/cpu.c | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-nuc93x/cpu.c | ||
3 | * | ||
4 | * Copyright (c) 2009 Nuvoton corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
7 | * | ||
8 | * NUC93x series cpu common support | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation;version 2 of the License. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/types.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/list.h> | ||
20 | #include <linux/timer.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/io.h> | ||
24 | #include <linux/serial_8250.h> | ||
25 | #include <linux/delay.h> | ||
26 | |||
27 | #include <asm/mach/arch.h> | ||
28 | #include <asm/mach/map.h> | ||
29 | #include <asm/mach/irq.h> | ||
30 | #include <asm/irq.h> | ||
31 | |||
32 | #include <mach/hardware.h> | ||
33 | #include <mach/regs-serial.h> | ||
34 | #include <mach/regs-clock.h> | ||
35 | #include <mach/regs-ebi.h> | ||
36 | |||
37 | #include "cpu.h" | ||
38 | #include "clock.h" | ||
39 | |||
40 | /* Initial IO mappings */ | ||
41 | |||
42 | static struct map_desc nuc93x_iodesc[] __initdata = { | ||
43 | IODESC_ENT(IRQ), | ||
44 | IODESC_ENT(GCR), | ||
45 | IODESC_ENT(UART), | ||
46 | IODESC_ENT(TIMER), | ||
47 | IODESC_ENT(EBI), | ||
48 | }; | ||
49 | |||
50 | /* Initial nuc932 clock declarations. */ | ||
51 | static DEFINE_CLK(audio, 2); | ||
52 | static DEFINE_CLK(sd, 3); | ||
53 | static DEFINE_CLK(jpg, 4); | ||
54 | static DEFINE_CLK(video, 5); | ||
55 | static DEFINE_CLK(vpost, 6); | ||
56 | static DEFINE_CLK(2d, 7); | ||
57 | static DEFINE_CLK(gpu, 8); | ||
58 | static DEFINE_CLK(gdma, 9); | ||
59 | static DEFINE_CLK(adc, 10); | ||
60 | static DEFINE_CLK(uart, 11); | ||
61 | static DEFINE_CLK(spi, 12); | ||
62 | static DEFINE_CLK(pwm, 13); | ||
63 | static DEFINE_CLK(timer, 14); | ||
64 | static DEFINE_CLK(wdt, 15); | ||
65 | static DEFINE_CLK(ac97, 16); | ||
66 | static DEFINE_CLK(i2s, 16); | ||
67 | static DEFINE_CLK(usbck, 17); | ||
68 | static DEFINE_CLK(usb48, 18); | ||
69 | static DEFINE_CLK(usbh, 19); | ||
70 | static DEFINE_CLK(i2c, 20); | ||
71 | static DEFINE_CLK(ext, 0); | ||
72 | |||
73 | static struct clk_lookup nuc932_clkregs[] = { | ||
74 | DEF_CLKLOOK(&clk_audio, "nuc932-audio", NULL), | ||
75 | DEF_CLKLOOK(&clk_sd, "nuc932-sd", NULL), | ||
76 | DEF_CLKLOOK(&clk_jpg, "nuc932-jpg", "NULL"), | ||
77 | DEF_CLKLOOK(&clk_video, "nuc932-video", "NULL"), | ||
78 | DEF_CLKLOOK(&clk_vpost, "nuc932-vpost", NULL), | ||
79 | DEF_CLKLOOK(&clk_2d, "nuc932-2d", NULL), | ||
80 | DEF_CLKLOOK(&clk_gpu, "nuc932-gpu", NULL), | ||
81 | DEF_CLKLOOK(&clk_gdma, "nuc932-gdma", "NULL"), | ||
82 | DEF_CLKLOOK(&clk_adc, "nuc932-adc", NULL), | ||
83 | DEF_CLKLOOK(&clk_uart, NULL, "uart"), | ||
84 | DEF_CLKLOOK(&clk_spi, "nuc932-spi", NULL), | ||
85 | DEF_CLKLOOK(&clk_pwm, "nuc932-pwm", NULL), | ||
86 | DEF_CLKLOOK(&clk_timer, NULL, "timer"), | ||
87 | DEF_CLKLOOK(&clk_wdt, "nuc932-wdt", NULL), | ||
88 | DEF_CLKLOOK(&clk_ac97, "nuc932-ac97", NULL), | ||
89 | DEF_CLKLOOK(&clk_i2s, "nuc932-i2s", NULL), | ||
90 | DEF_CLKLOOK(&clk_usbck, "nuc932-usbck", NULL), | ||
91 | DEF_CLKLOOK(&clk_usb48, "nuc932-usb48", NULL), | ||
92 | DEF_CLKLOOK(&clk_usbh, "nuc932-usbh", NULL), | ||
93 | DEF_CLKLOOK(&clk_i2c, "nuc932-i2c", NULL), | ||
94 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), | ||
95 | }; | ||
96 | |||
97 | /* Initial serial platform data */ | ||
98 | |||
99 | struct plat_serial8250_port nuc93x_uart_data[] = { | ||
100 | NUC93X_8250PORT(UART0), | ||
101 | {}, | ||
102 | }; | ||
103 | |||
104 | struct platform_device nuc93x_serial_device = { | ||
105 | .name = "serial8250", | ||
106 | .id = PLAT8250_DEV_PLATFORM, | ||
107 | .dev = { | ||
108 | .platform_data = nuc93x_uart_data, | ||
109 | }, | ||
110 | }; | ||
111 | |||
112 | /*Init NUC93x evb io*/ | ||
113 | |||
114 | void __init nuc93x_map_io(struct map_desc *mach_desc, int mach_size) | ||
115 | { | ||
116 | unsigned long idcode = 0x0; | ||
117 | |||
118 | iotable_init(mach_desc, mach_size); | ||
119 | iotable_init(nuc93x_iodesc, ARRAY_SIZE(nuc93x_iodesc)); | ||
120 | |||
121 | idcode = __raw_readl(NUC93XPDID); | ||
122 | if (idcode == NUC932_CPUID) | ||
123 | printk(KERN_INFO "CPU type 0x%08lx is NUC910\n", idcode); | ||
124 | else | ||
125 | printk(KERN_ERR "CPU type detect error!\n"); | ||
126 | |||
127 | } | ||
128 | |||
129 | /*Init NUC93x clock*/ | ||
130 | |||
131 | void __init nuc93x_init_clocks(void) | ||
132 | { | ||
133 | clks_register(nuc932_clkregs, ARRAY_SIZE(nuc932_clkregs)); | ||
134 | } | ||
135 | |||
diff --git a/arch/arm/mach-nuc93x/cpu.h b/arch/arm/mach-nuc93x/cpu.h new file mode 100644 index 000000000000..9def28197bc9 --- /dev/null +++ b/arch/arm/mach-nuc93x/cpu.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/cpu.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Header file for NUC93X CPU support | ||
8 | * | ||
9 | * Wan ZongShun <mcuos.com@gmail.com> | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #define IODESC_ENT(y) \ | ||
18 | { \ | ||
19 | .virtual = (unsigned long)NUC93X_VA_##y, \ | ||
20 | .pfn = __phys_to_pfn(NUC93X_PA_##y), \ | ||
21 | .length = NUC93X_SZ_##y, \ | ||
22 | .type = MT_DEVICE, \ | ||
23 | } | ||
24 | |||
25 | #define NUC93X_8250PORT(name) \ | ||
26 | { \ | ||
27 | .membase = name##_BA, \ | ||
28 | .mapbase = name##_PA, \ | ||
29 | .irq = IRQ_##name, \ | ||
30 | .uartclk = 57139200, \ | ||
31 | .regshift = 2, \ | ||
32 | .iotype = UPIO_MEM, \ | ||
33 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \ | ||
34 | } | ||
35 | |||
36 | /*Cpu identifier register*/ | ||
37 | |||
38 | #define NUC93XPDID NUC93X_VA_GCR | ||
39 | #define NUC932_CPUID 0x29550091 | ||
40 | |||
41 | /* extern file from cpu.c */ | ||
42 | |||
43 | extern void nuc93x_clock_source(struct device *dev, unsigned char *src); | ||
44 | extern void nuc93x_init_clocks(void); | ||
45 | extern void nuc93x_map_io(struct map_desc *mach_desc, int mach_size); | ||
46 | extern void nuc93x_board_init(struct platform_device **device, int size); | ||
47 | extern struct platform_device nuc93x_serial_device; | ||
48 | |||
diff --git a/arch/arm/mach-nuc93x/dev.c b/arch/arm/mach-nuc93x/dev.c new file mode 100644 index 000000000000..a962ae9578d6 --- /dev/null +++ b/arch/arm/mach-nuc93x/dev.c | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-nuc93x/dev.c | ||
3 | * | ||
4 | * Copyright (C) 2009 Nuvoton corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License as | ||
10 | * published by the Free Software Foundation;version 2 of the License. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/timer.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | |||
22 | #include <asm/mach/arch.h> | ||
23 | #include <asm/mach/map.h> | ||
24 | #include <asm/mach/irq.h> | ||
25 | #include <asm/mach-types.h> | ||
26 | |||
27 | #include "cpu.h" | ||
28 | |||
29 | /*Here should be your evb resourse,such as LCD*/ | ||
30 | |||
31 | static struct platform_device *nuc93x_public_dev[] __initdata = { | ||
32 | &nuc93x_serial_device, | ||
33 | }; | ||
34 | |||
35 | /* Provide adding specific CPU platform devices API */ | ||
36 | |||
37 | void __init nuc93x_board_init(struct platform_device **device, int size) | ||
38 | { | ||
39 | platform_add_devices(device, size); | ||
40 | platform_add_devices(nuc93x_public_dev, ARRAY_SIZE(nuc93x_public_dev)); | ||
41 | } | ||
42 | |||
diff --git a/arch/arm/mach-nuc93x/include/mach/clkdev.h b/arch/arm/mach-nuc93x/include/mach/clkdev.h new file mode 100644 index 000000000000..04b37a89801c --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/clkdev.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | ||
2 | #define __ASM_MACH_CLKDEV_H | ||
3 | |||
4 | #define __clk_get(clk) ({ 1; }) | ||
5 | #define __clk_put(clk) do { } while (0) | ||
6 | |||
7 | #endif | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/entry-macro.S b/arch/arm/mach-nuc93x/include/mach/entry-macro.S new file mode 100644 index 000000000000..1352cbda3797 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/entry-macro.S | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/entry-macro.S | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #include <mach/hardware.h> | ||
11 | #include <mach/regs-irq.h> | ||
12 | |||
13 | .macro get_irqnr_preamble, base, tmp | ||
14 | .endm | ||
15 | |||
16 | .macro arch_ret_to_user, tmp1, tmp2 | ||
17 | .endm | ||
18 | |||
19 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
20 | |||
21 | mov \base, #AIC_BA | ||
22 | |||
23 | ldr \irqnr, [ \base, #AIC_IPER] | ||
24 | ldr \irqnr, [ \base, #AIC_ISNR] | ||
25 | cmp \irqnr, #0 | ||
26 | |||
27 | .endm | ||
28 | |||
29 | /* currently don't need an disable_fiq macro */ | ||
30 | |||
31 | .macro disable_fiq | ||
32 | .endm | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/hardware.h b/arch/arm/mach-nuc93x/include/mach/hardware.h new file mode 100644 index 000000000000..fb5c6fcb142e --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/hardware.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/hardware.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_HARDWARE_H | ||
17 | #define __ASM_ARCH_HARDWARE_H | ||
18 | |||
19 | #include <asm/sizes.h> | ||
20 | #include <mach/map.h> | ||
21 | |||
22 | #endif /* __ASM_ARCH_HARDWARE_H */ | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/io.h b/arch/arm/mach-nuc93x/include/mach/io.h new file mode 100644 index 000000000000..72e5051c7534 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/io.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/io.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARM_ARCH_IO_H | ||
17 | #define __ASM_ARM_ARCH_IO_H | ||
18 | |||
19 | #define IO_SPACE_LIMIT 0xffffffff | ||
20 | |||
21 | /* | ||
22 | * 1:1 mapping for ioremapped regions. | ||
23 | */ | ||
24 | |||
25 | #define __mem_pci(a) (a) | ||
26 | #define __io(a) __typesafe_io(a) | ||
27 | |||
28 | #endif | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/irqs.h b/arch/arm/mach-nuc93x/include/mach/irqs.h new file mode 100644 index 000000000000..7c4aa71edb44 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/irqs.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/irqs.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
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 as published by | ||
10 | * the Free Software Foundation;version 2 of the License. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_IRQS_H | ||
15 | #define __ASM_ARCH_IRQS_H | ||
16 | |||
17 | #define NUC93X_IRQ(x) (x) | ||
18 | |||
19 | /* Main cpu interrupts */ | ||
20 | |||
21 | #define IRQ_WDT NUC93X_IRQ(1) | ||
22 | #define IRQ_IRQ0 NUC93X_IRQ(2) | ||
23 | #define IRQ_IRQ1 NUC93X_IRQ(3) | ||
24 | #define IRQ_IRQ2 NUC93X_IRQ(4) | ||
25 | #define IRQ_IRQ3 NUC93X_IRQ(5) | ||
26 | #define IRQ_USBH NUC93X_IRQ(6) | ||
27 | #define IRQ_APU NUC93X_IRQ(7) | ||
28 | #define IRQ_VPOST NUC93X_IRQ(8) | ||
29 | #define IRQ_ADC NUC93X_IRQ(9) | ||
30 | #define IRQ_UART0 NUC93X_IRQ(10) | ||
31 | #define IRQ_TIMER0 NUC93X_IRQ(11) | ||
32 | #define IRQ_GPU0 NUC93X_IRQ(12) | ||
33 | #define IRQ_GPU1 NUC93X_IRQ(13) | ||
34 | #define IRQ_GPU2 NUC93X_IRQ(14) | ||
35 | #define IRQ_GPU3 NUC93X_IRQ(15) | ||
36 | #define IRQ_GPU4 NUC93X_IRQ(16) | ||
37 | #define IRQ_VIN NUC93X_IRQ(17) | ||
38 | #define IRQ_USBD NUC93X_IRQ(18) | ||
39 | #define IRQ_VRAMLD NUC93X_IRQ(19) | ||
40 | #define IRQ_GDMA0 NUC93X_IRQ(20) | ||
41 | #define IRQ_GDMA1 NUC93X_IRQ(21) | ||
42 | #define IRQ_SDIO NUC93X_IRQ(22) | ||
43 | #define IRQ_FMI NUC93X_IRQ(22) | ||
44 | #define IRQ_JPEG NUC93X_IRQ(23) | ||
45 | #define IRQ_SPI0 NUC93X_IRQ(24) | ||
46 | #define IRQ_SPI1 NUC93X_IRQ(25) | ||
47 | #define IRQ_RTC NUC93X_IRQ(26) | ||
48 | #define IRQ_PWM0 NUC93X_IRQ(27) | ||
49 | #define IRQ_PWM1 NUC93X_IRQ(28) | ||
50 | #define IRQ_PWM2 NUC93X_IRQ(29) | ||
51 | #define IRQ_PWM3 NUC93X_IRQ(30) | ||
52 | #define IRQ_I2SAC97 NUC93X_IRQ(31) | ||
53 | #define IRQ_CAP0 IRQ_PWM0 | ||
54 | #define IRQ_CAP1 IRQ_PWM1 | ||
55 | #define IRQ_CAP2 IRQ_PWM2 | ||
56 | #define IRQ_CAP3 IRQ_PWM3 | ||
57 | #define NR_IRQS (IRQ_I2SAC97 + 1) | ||
58 | |||
59 | #endif /* __ASM_ARCH_IRQ_H */ | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/map.h b/arch/arm/mach-nuc93x/include/mach/map.h new file mode 100644 index 000000000000..fd0b5e89f0e7 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/map.h | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/map.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
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 as published by | ||
10 | * the Free Software Foundation;version 2 of the License. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_MAP_H | ||
15 | #define __ASM_ARCH_MAP_H | ||
16 | |||
17 | #define MAP_OFFSET (0xfff00000) | ||
18 | #define CLK_OFFSET (0x10) | ||
19 | |||
20 | #ifndef __ASSEMBLY__ | ||
21 | #define NUC93X_ADDR(x) ((void __iomem *)(0xF0000000 + ((x)&(~MAP_OFFSET)))) | ||
22 | #else | ||
23 | #define NUC93X_ADDR(x) (0xF0000000 + ((x)&(~MAP_OFFSET))) | ||
24 | #endif | ||
25 | |||
26 | /* | ||
27 | * nuc932 hardware register definition | ||
28 | */ | ||
29 | |||
30 | #define NUC93X_PA_IRQ (0xFFF83000) | ||
31 | #define NUC93X_PA_GCR (0xFFF00000) | ||
32 | #define NUC93X_PA_EBI (0xFFF01000) | ||
33 | #define NUC93X_PA_UART (0xFFF80000) | ||
34 | #define NUC93X_PA_TIMER (0xFFF81000) | ||
35 | #define NUC93X_PA_GPIO (0xFFF84000) | ||
36 | #define NUC93X_PA_GDMA (0xFFF03000) | ||
37 | #define NUC93X_PA_USBHOST (0xFFF0d000) | ||
38 | #define NUC93X_PA_I2C (0xFFF89000) | ||
39 | #define NUC93X_PA_LCD (0xFFF06000) | ||
40 | #define NUC93X_PA_GE (0xFFF05000) | ||
41 | #define NUC93X_PA_ADC (0xFFF85000) | ||
42 | #define NUC93X_PA_RTC (0xFFF87000) | ||
43 | #define NUC93X_PA_PWM (0xFFF82000) | ||
44 | #define NUC93X_PA_ACTL (0xFFF0a000) | ||
45 | #define NUC93X_PA_USBDEV (0xFFF0C000) | ||
46 | #define NUC93X_PA_JEPEG (0xFFF0e000) | ||
47 | #define NUC93X_PA_CACHE_T (0xFFF60000) | ||
48 | #define NUC93X_PA_VRAM (0xFFF0b000) | ||
49 | #define NUC93X_PA_DMAC (0xFFF09000) | ||
50 | #define NUC93X_PA_I2SM (0xFFF08000) | ||
51 | #define NUC93X_PA_CACHE (0xFFF02000) | ||
52 | #define NUC93X_PA_GPU (0xFFF04000) | ||
53 | #define NUC93X_PA_VIDEOIN (0xFFF07000) | ||
54 | #define NUC93X_PA_SPI0 (0xFFF86000) | ||
55 | #define NUC93X_PA_SPI1 (0xFFF88000) | ||
56 | |||
57 | /* | ||
58 | * nuc932 virtual address mapping. | ||
59 | * interrupt controller is the first thing we put in, to make | ||
60 | * the assembly code for the irq detection easier | ||
61 | */ | ||
62 | |||
63 | #define NUC93X_VA_IRQ NUC93X_ADDR(0x00000000) | ||
64 | #define NUC93X_SZ_IRQ SZ_4K | ||
65 | |||
66 | #define NUC93X_VA_GCR NUC93X_ADDR(NUC93X_PA_IRQ) | ||
67 | #define NUC93X_VA_CLKPWR (NUC93X_VA_GCR+CLK_OFFSET) | ||
68 | #define NUC93X_SZ_GCR SZ_4K | ||
69 | |||
70 | /* EBI management */ | ||
71 | |||
72 | #define NUC93X_VA_EBI NUC93X_ADDR(NUC93X_PA_EBI) | ||
73 | #define NUC93X_SZ_EBI SZ_4K | ||
74 | |||
75 | /* UARTs */ | ||
76 | |||
77 | #define NUC93X_VA_UART NUC93X_ADDR(NUC93X_PA_UART) | ||
78 | #define NUC93X_SZ_UART SZ_4K | ||
79 | |||
80 | /* Timers */ | ||
81 | |||
82 | #define NUC93X_VA_TIMER NUC93X_ADDR(NUC93X_PA_TIMER) | ||
83 | #define NUC93X_SZ_TIMER SZ_4K | ||
84 | |||
85 | /* GPIO ports */ | ||
86 | |||
87 | #define NUC93X_VA_GPIO NUC93X_ADDR(NUC93X_PA_GPIO) | ||
88 | #define NUC93X_SZ_GPIO SZ_4K | ||
89 | |||
90 | /* GDMA control */ | ||
91 | |||
92 | #define NUC93X_VA_GDMA NUC93X_ADDR(NUC93X_PA_GDMA) | ||
93 | #define NUC93X_SZ_GDMA SZ_4K | ||
94 | |||
95 | /* I2C hardware controller */ | ||
96 | |||
97 | #define NUC93X_VA_I2C NUC93X_ADDR(NUC93X_PA_I2C) | ||
98 | #define NUC93X_SZ_I2C SZ_4K | ||
99 | |||
100 | /* LCD controller*/ | ||
101 | |||
102 | #define NUC93X_VA_LCD NUC93X_ADDR(NUC93X_PA_LCD) | ||
103 | #define NUC93X_SZ_LCD SZ_4K | ||
104 | |||
105 | /* 2D controller*/ | ||
106 | |||
107 | #define NUC93X_VA_GE NUC93X_ADDR(NUC93X_PA_GE) | ||
108 | #define NUC93X_SZ_GE SZ_4K | ||
109 | |||
110 | /* ADC */ | ||
111 | |||
112 | #define NUC93X_VA_ADC NUC93X_ADDR(NUC93X_PA_ADC) | ||
113 | #define NUC93X_SZ_ADC SZ_4K | ||
114 | |||
115 | /* RTC */ | ||
116 | |||
117 | #define NUC93X_VA_RTC NUC93X_ADDR(NUC93X_PA_RTC) | ||
118 | #define NUC93X_SZ_RTC SZ_4K | ||
119 | |||
120 | /* Pulse Width Modulation(PWM) Registers */ | ||
121 | |||
122 | #define NUC93X_VA_PWM NUC93X_ADDR(NUC93X_PA_PWM) | ||
123 | #define NUC93X_SZ_PWM SZ_4K | ||
124 | |||
125 | /* Audio Controller controller */ | ||
126 | |||
127 | #define NUC93X_VA_ACTL NUC93X_ADDR(NUC93X_PA_ACTL) | ||
128 | #define NUC93X_SZ_ACTL SZ_4K | ||
129 | |||
130 | /* USB Device port */ | ||
131 | |||
132 | #define NUC93X_VA_USBDEV NUC93X_ADDR(NUC93X_PA_USBDEV) | ||
133 | #define NUC93X_SZ_USBDEV SZ_4K | ||
134 | |||
135 | /* USB host controller*/ | ||
136 | #define NUC93X_VA_USBHOST NUC93X_ADDR(NUC93X_PA_USBHOST) | ||
137 | #define NUC93X_SZ_USBHOST SZ_4K | ||
138 | |||
139 | #endif /* __ASM_ARCH_MAP_H */ | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/memory.h b/arch/arm/mach-nuc93x/include/mach/memory.h new file mode 100644 index 000000000000..323ab0db3f7d --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/memory.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/memory.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_MEMORY_H | ||
17 | #define __ASM_ARCH_MEMORY_H | ||
18 | |||
19 | #define PHYS_OFFSET UL(0x00000000) | ||
20 | |||
21 | #endif | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-clock.h b/arch/arm/mach-nuc93x/include/mach/regs-clock.h new file mode 100644 index 000000000000..5cb2954fbec2 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/regs-clock.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/regs-clock.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
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 as published by | ||
10 | * the Free Software Foundation;version 2 of the License. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_REGS_CLOCK_H | ||
15 | #define __ASM_ARCH_REGS_CLOCK_H | ||
16 | |||
17 | /* Clock Control Registers */ | ||
18 | #define CLK_BA NUC93X_VA_CLKPWR | ||
19 | #define REG_CLKEN (CLK_BA + 0x00) | ||
20 | #define REG_CLKSEL (CLK_BA + 0x04) | ||
21 | #define REG_CLKDIV (CLK_BA + 0x08) | ||
22 | #define REG_PLLCON0 (CLK_BA + 0x0C) | ||
23 | #define REG_PLLCON1 (CLK_BA + 0x10) | ||
24 | #define REG_PMCON (CLK_BA + 0x14) | ||
25 | #define REG_IRQWAKECON (CLK_BA + 0x18) | ||
26 | #define REG_IRQWAKEFLAG (CLK_BA + 0x1C) | ||
27 | #define REG_IPSRST (CLK_BA + 0x20) | ||
28 | #define REG_CLKEN1 (CLK_BA + 0x24) | ||
29 | #define REG_CLKDIV1 (CLK_BA + 0x28) | ||
30 | |||
31 | /* Define PLL freq setting */ | ||
32 | #define PLL_DISABLE 0x12B63 | ||
33 | #define PLL_66MHZ 0x2B63 | ||
34 | #define PLL_100MHZ 0x4F64 | ||
35 | #define PLL_120MHZ 0x4F63 | ||
36 | #define PLL_166MHZ 0x4124 | ||
37 | #define PLL_200MHZ 0x4F24 | ||
38 | |||
39 | /* Define AHB:CPUFREQ ratio */ | ||
40 | #define AHB_CPUCLK_1_1 0x00 | ||
41 | #define AHB_CPUCLK_1_2 0x01 | ||
42 | #define AHB_CPUCLK_1_4 0x02 | ||
43 | #define AHB_CPUCLK_1_8 0x03 | ||
44 | |||
45 | /* Define APB:AHB ratio */ | ||
46 | #define APB_AHB_1_2 0x01 | ||
47 | #define APB_AHB_1_4 0x02 | ||
48 | #define APB_AHB_1_8 0x03 | ||
49 | |||
50 | /* Define clock skew */ | ||
51 | #define DEFAULTSKEW 0x48 | ||
52 | |||
53 | #endif /* __ASM_ARCH_REGS_CLOCK_H */ | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-ebi.h b/arch/arm/mach-nuc93x/include/mach/regs-ebi.h new file mode 100644 index 000000000000..3c72550e28e4 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/regs-ebi.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/regs-ebi.h | ||
3 | * | ||
4 | * Copyright (c) 2009 Nuvoton technology corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
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 as published by | ||
10 | * the Free Software Foundation;version 2 of the License. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_REGS_EBI_H | ||
15 | #define __ASM_ARCH_REGS_EBI_H | ||
16 | |||
17 | /* EBI Control Registers */ | ||
18 | |||
19 | #define EBI_BA NUC93X_VA_EBI | ||
20 | #define REG_EBICON (EBI_BA + 0x00) | ||
21 | #define REG_ROMCON (EBI_BA + 0x04) | ||
22 | #define REG_SDCONF0 (EBI_BA + 0x08) | ||
23 | #define REG_SDCONF1 (EBI_BA + 0x0C) | ||
24 | #define REG_SDTIME0 (EBI_BA + 0x10) | ||
25 | #define REG_SDTIME1 (EBI_BA + 0x14) | ||
26 | #define REG_EXT0CON (EBI_BA + 0x18) | ||
27 | #define REG_EXT1CON (EBI_BA + 0x1C) | ||
28 | #define REG_EXT2CON (EBI_BA + 0x20) | ||
29 | #define REG_EXT3CON (EBI_BA + 0x24) | ||
30 | #define REG_EXT4CON (EBI_BA + 0x28) | ||
31 | #define REG_CKSKEW (EBI_BA + 0x2C) | ||
32 | |||
33 | #endif /* __ASM_ARCH_REGS_EBI_H */ | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-irq.h b/arch/arm/mach-nuc93x/include/mach/regs-irq.h new file mode 100644 index 000000000000..23021592de51 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/regs-irq.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/regs-irq.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef ___ASM_ARCH_REGS_IRQ_H | ||
17 | #define ___ASM_ARCH_REGS_IRQ_H | ||
18 | |||
19 | /* Advance Interrupt Controller (AIC) Registers */ | ||
20 | |||
21 | #define AIC_BA NUC93X_VA_IRQ | ||
22 | |||
23 | #define REG_AIC_IRQSC (AIC_BA+0x80) | ||
24 | #define REG_AIC_GEN (AIC_BA+0x84) | ||
25 | #define REG_AIC_GASR (AIC_BA+0x88) | ||
26 | #define REG_AIC_GSCR (AIC_BA+0x8C) | ||
27 | #define REG_AIC_IRSR (AIC_BA+0x100) | ||
28 | #define REG_AIC_IASR (AIC_BA+0x104) | ||
29 | #define REG_AIC_ISR (AIC_BA+0x108) | ||
30 | #define REG_AIC_IPER (AIC_BA+0x10C) | ||
31 | #define REG_AIC_ISNR (AIC_BA+0x110) | ||
32 | #define REG_AIC_IMR (AIC_BA+0x114) | ||
33 | #define REG_AIC_OISR (AIC_BA+0x118) | ||
34 | #define REG_AIC_MECR (AIC_BA+0x120) | ||
35 | #define REG_AIC_MDCR (AIC_BA+0x124) | ||
36 | #define REG_AIC_SSCR (AIC_BA+0x128) | ||
37 | #define REG_AIC_SCCR (AIC_BA+0x12C) | ||
38 | #define REG_AIC_EOSCR (AIC_BA+0x130) | ||
39 | #define AIC_IPER (0x10C) | ||
40 | #define AIC_ISNR (0x110) | ||
41 | |||
42 | #endif /* ___ASM_ARCH_REGS_IRQ_H */ | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-serial.h b/arch/arm/mach-nuc93x/include/mach/regs-serial.h new file mode 100644 index 000000000000..767a047a8bc2 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/regs-serial.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/regs-serial.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARM_REGS_SERIAL_H | ||
17 | #define __ASM_ARM_REGS_SERIAL_H | ||
18 | |||
19 | #define UART0_BA NUC93X_VA_UART | ||
20 | #define UART1_BA (NUC93X_VA_UART+0x100) | ||
21 | |||
22 | #define UART0_PA NUC93X_PA_UART | ||
23 | #define UART1_PA (NUC93X_PA_UART+0x100) | ||
24 | |||
25 | |||
26 | #ifndef __ASSEMBLY__ | ||
27 | |||
28 | struct nuc93x_uart_clksrc { | ||
29 | const char *name; | ||
30 | unsigned int divisor; | ||
31 | unsigned int min_baud; | ||
32 | unsigned int max_baud; | ||
33 | }; | ||
34 | |||
35 | struct nuc93x_uartcfg { | ||
36 | unsigned char hwport; | ||
37 | unsigned char unused; | ||
38 | unsigned short flags; | ||
39 | unsigned long uart_flags; | ||
40 | |||
41 | unsigned long ucon; | ||
42 | unsigned long ulcon; | ||
43 | unsigned long ufcon; | ||
44 | |||
45 | struct nuc93x_uart_clksrc *clocks; | ||
46 | unsigned int clocks_size; | ||
47 | }; | ||
48 | |||
49 | #endif /* __ASSEMBLY__ */ | ||
50 | |||
51 | #endif /* __ASM_ARM_REGS_SERIAL_H */ | ||
52 | |||
diff --git a/arch/arm/mach-nuc93x/include/mach/regs-timer.h b/arch/arm/mach-nuc93x/include/mach/regs-timer.h new file mode 100644 index 000000000000..394be9614d36 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/regs-timer.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/regs-timer.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_REGS_TIMER_H | ||
17 | #define __ASM_ARCH_REGS_TIMER_H | ||
18 | |||
19 | /* Timer Registers */ | ||
20 | |||
21 | #define TMR_BA NUC93X_VA_TIMER | ||
22 | #define REG_TCSR0 (TMR_BA+0x00) | ||
23 | #define REG_TICR0 (TMR_BA+0x08) | ||
24 | #define REG_TDR0 (TMR_BA+0x10) | ||
25 | #define REG_TISR (TMR_BA+0x18) | ||
26 | #define REG_WTCR (TMR_BA+0x1C) | ||
27 | |||
28 | #endif /* __ASM_ARCH_REGS_TIMER_H */ | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/system.h b/arch/arm/mach-nuc93x/include/mach/system.h new file mode 100644 index 000000000000..d26bd9a52844 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/system.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * arch/arm/machnuc93x/include/mach/system.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * Based on arch/arm/mach-s3c2410/include/mach/system.h | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #include <asm/proc-fns.h> | ||
19 | |||
20 | static void arch_idle(void) | ||
21 | { | ||
22 | } | ||
23 | |||
24 | static void arch_reset(char mode, const char *cmd) | ||
25 | { | ||
26 | cpu_reset(0); | ||
27 | } | ||
28 | |||
diff --git a/arch/arm/mach-nuc93x/include/mach/timex.h b/arch/arm/mach-nuc93x/include/mach/timex.h new file mode 100644 index 000000000000..0c719cc91aa9 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/timex.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/timex.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * Based on arch/arm/mach-s3c2410/include/mach/timex.h | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_ARCH_TIMEX_H | ||
19 | #define __ASM_ARCH_TIMEX_H | ||
20 | |||
21 | /* CLOCK_TICK_RATE Now, I don't use it. */ | ||
22 | |||
23 | #define CLOCK_TICK_RATE 27000000 | ||
24 | |||
25 | #endif /* __ASM_ARCH_TIMEX_H */ | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/uncompress.h b/arch/arm/mach-nuc93x/include/mach/uncompress.h new file mode 100644 index 000000000000..73082cd61e84 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/uncompress.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/uncompress.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * Based on arch/arm/mach-s3c2410/include/mach/uncompress.h | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_ARCH_UNCOMPRESS_H | ||
19 | #define __ASM_ARCH_UNCOMPRESS_H | ||
20 | |||
21 | /* Defines for UART registers */ | ||
22 | |||
23 | #include <mach/regs-serial.h> | ||
24 | #include <mach/map.h> | ||
25 | #include <linux/serial_reg.h> | ||
26 | |||
27 | #define arch_decomp_wdog() | ||
28 | |||
29 | #define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) | ||
30 | static u32 * uart_base = (u32 *)UART0_PA; | ||
31 | |||
32 | static void putc(int ch) | ||
33 | { | ||
34 | /* Check THRE and TEMT bits before we transmit the character. | ||
35 | */ | ||
36 | while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE) | ||
37 | barrier(); | ||
38 | |||
39 | *uart_base = ch; | ||
40 | } | ||
41 | |||
42 | static inline void flush(void) | ||
43 | { | ||
44 | } | ||
45 | |||
46 | static void arch_decomp_setup(void) | ||
47 | { | ||
48 | } | ||
49 | |||
50 | #endif/* __ASM_NUC93X_UNCOMPRESS_H */ | ||
diff --git a/arch/arm/mach-nuc93x/include/mach/vmalloc.h b/arch/arm/mach-nuc93x/include/mach/vmalloc.h new file mode 100644 index 000000000000..98a21b81dec0 --- /dev/null +++ b/arch/arm/mach-nuc93x/include/mach/vmalloc.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/include/mach/vmalloc.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * Based on arch/arm/mach-s3c2410/include/mach/vmalloc.h | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_ARCH_VMALLOC_H | ||
19 | #define __ASM_ARCH_VMALLOC_H | ||
20 | |||
21 | #define VMALLOC_END (0xE0000000) | ||
22 | |||
23 | #endif /* __ASM_ARCH_VMALLOC_H */ | ||
diff --git a/arch/arm/mach-nuc93x/irq.c b/arch/arm/mach-nuc93x/irq.c new file mode 100644 index 000000000000..a7a88ea4ec31 --- /dev/null +++ b/arch/arm/mach-nuc93x/irq.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-nuc93x/irq.c | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton technology corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
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 as published by | ||
10 | * the Free Software Foundation;version 2 of the License. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/ioport.h> | ||
18 | #include <linux/ptrace.h> | ||
19 | #include <linux/sysdev.h> | ||
20 | #include <linux/io.h> | ||
21 | |||
22 | #include <asm/irq.h> | ||
23 | #include <asm/mach/irq.h> | ||
24 | |||
25 | #include <mach/hardware.h> | ||
26 | #include <mach/regs-irq.h> | ||
27 | |||
28 | static void nuc93x_irq_mask(unsigned int irq) | ||
29 | { | ||
30 | __raw_writel(1 << irq, REG_AIC_MDCR); | ||
31 | } | ||
32 | |||
33 | /* | ||
34 | * By the w90p910 spec,any irq,only write 1 | ||
35 | * to REG_AIC_EOSCR for ACK | ||
36 | */ | ||
37 | |||
38 | static void nuc93x_irq_ack(unsigned int irq) | ||
39 | { | ||
40 | __raw_writel(0x01, REG_AIC_EOSCR); | ||
41 | } | ||
42 | |||
43 | static void nuc93x_irq_unmask(unsigned int irq) | ||
44 | { | ||
45 | __raw_writel(1 << irq, REG_AIC_MECR); | ||
46 | |||
47 | } | ||
48 | |||
49 | static struct irq_chip nuc93x_irq_chip = { | ||
50 | .ack = nuc93x_irq_ack, | ||
51 | .mask = nuc93x_irq_mask, | ||
52 | .unmask = nuc93x_irq_unmask, | ||
53 | }; | ||
54 | |||
55 | void __init nuc93x_init_irq(void) | ||
56 | { | ||
57 | int irqno; | ||
58 | |||
59 | __raw_writel(0xFFFFFFFE, REG_AIC_MDCR); | ||
60 | |||
61 | for (irqno = IRQ_WDT; irqno <= NR_IRQS; irqno++) { | ||
62 | set_irq_chip(irqno, &nuc93x_irq_chip); | ||
63 | set_irq_handler(irqno, handle_level_irq); | ||
64 | set_irq_flags(irqno, IRQF_VALID); | ||
65 | } | ||
66 | } | ||
diff --git a/arch/arm/mach-nuc93x/mach-nuc932evb.c b/arch/arm/mach-nuc93x/mach-nuc932evb.c new file mode 100644 index 000000000000..9f79266f08e2 --- /dev/null +++ b/arch/arm/mach-nuc93x/mach-nuc932evb.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-w90x900/mach-nuc910evb.c | ||
3 | * | ||
4 | * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche | ||
5 | * | ||
6 | * Copyright (C) 2008 Nuvoton technology corporation. | ||
7 | * | ||
8 | * Wan ZongShun <mcuos.com@gmail.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License as | ||
12 | * published by the Free Software Foundation;version 2 of the License. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | #include <asm/mach/arch.h> | ||
18 | #include <asm/mach/map.h> | ||
19 | #include <asm/mach-types.h> | ||
20 | #include <mach/map.h> | ||
21 | |||
22 | #include "nuc932.h" | ||
23 | |||
24 | static void __init nuc932evb_map_io(void) | ||
25 | { | ||
26 | nuc932_map_io(); | ||
27 | nuc932_init_clocks(); | ||
28 | nuc932_init_uartclk(); | ||
29 | } | ||
30 | |||
31 | static void __init nuc932evb_init(void) | ||
32 | { | ||
33 | nuc932_board_init(); | ||
34 | } | ||
35 | |||
36 | MACHINE_START(NUC932EVB, "NUC932EVB") | ||
37 | /* Maintainer: Wan ZongShun */ | ||
38 | .phys_io = NUC93X_PA_UART, | ||
39 | .io_pg_offst = (((u32)NUC93X_VA_UART) >> 18) & 0xfffc, | ||
40 | .boot_params = 0, | ||
41 | .map_io = nuc932evb_map_io, | ||
42 | .init_irq = nuc93x_init_irq, | ||
43 | .init_machine = nuc932evb_init, | ||
44 | .timer = &nuc93x_timer, | ||
45 | MACHINE_END | ||
diff --git a/arch/arm/mach-nuc93x/nuc932.c b/arch/arm/mach-nuc93x/nuc932.c new file mode 100644 index 000000000000..3966ead686fc --- /dev/null +++ b/arch/arm/mach-nuc93x/nuc932.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-nuc93x/nuc932.c | ||
3 | * | ||
4 | * Copyright (c) 2009 Nuvoton corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
7 | * | ||
8 | * NUC932 cpu support | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation;version 2 of the License. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/clk.h> | ||
18 | #include <linux/err.h> | ||
19 | |||
20 | #include <asm/mach/map.h> | ||
21 | #include <mach/hardware.h> | ||
22 | |||
23 | #include "cpu.h" | ||
24 | #include "clock.h" | ||
25 | |||
26 | /* define specific CPU platform device */ | ||
27 | |||
28 | static struct platform_device *nuc932_dev[] __initdata = { | ||
29 | }; | ||
30 | |||
31 | /* define specific CPU platform io map */ | ||
32 | |||
33 | static struct map_desc nuc932evb_iodesc[] __initdata = { | ||
34 | }; | ||
35 | |||
36 | /*Init NUC932 evb io*/ | ||
37 | |||
38 | void __init nuc932_map_io(void) | ||
39 | { | ||
40 | nuc93x_map_io(nuc932evb_iodesc, ARRAY_SIZE(nuc932evb_iodesc)); | ||
41 | } | ||
42 | |||
43 | /*Init NUC932 clock*/ | ||
44 | |||
45 | void __init nuc932_init_clocks(void) | ||
46 | { | ||
47 | nuc93x_init_clocks(); | ||
48 | } | ||
49 | |||
50 | /*enable NUC932 uart clock*/ | ||
51 | |||
52 | void __init nuc932_init_uartclk(void) | ||
53 | { | ||
54 | struct clk *ck_uart = clk_get(NULL, "uart"); | ||
55 | BUG_ON(IS_ERR(ck_uart)); | ||
56 | |||
57 | clk_enable(ck_uart); | ||
58 | } | ||
59 | |||
60 | /*Init NUC932 board info*/ | ||
61 | |||
62 | void __init nuc932_board_init(void) | ||
63 | { | ||
64 | nuc93x_board_init(nuc932_dev, ARRAY_SIZE(nuc932_dev)); | ||
65 | } | ||
diff --git a/arch/arm/mach-nuc93x/nuc932.h b/arch/arm/mach-nuc93x/nuc932.h new file mode 100644 index 000000000000..9a66edd5338f --- /dev/null +++ b/arch/arm/mach-nuc93x/nuc932.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-nuc93x/nuc932.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Nuvoton corporation | ||
5 | * | ||
6 | * Header file for NUC93x CPU support | ||
7 | * | ||
8 | * Wan ZongShun <mcuos.com@gmail.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | struct map_desc; | ||
17 | struct sys_timer; | ||
18 | |||
19 | /* core initialisation functions */ | ||
20 | |||
21 | extern void nuc93x_init_irq(void); | ||
22 | extern struct sys_timer nuc93x_timer; | ||
23 | |||
24 | /* extern file from nuc932.c */ | ||
25 | |||
26 | extern void nuc932_board_init(void); | ||
27 | extern void nuc932_init_clocks(void); | ||
28 | extern void nuc932_map_io(void); | ||
29 | extern void nuc932_init_uartclk(void); | ||
diff --git a/arch/arm/mach-nuc93x/time.c b/arch/arm/mach-nuc93x/time.c new file mode 100644 index 000000000000..2f90f9dc6e30 --- /dev/null +++ b/arch/arm/mach-nuc93x/time.c | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-nuc93x/time.c | ||
3 | * | ||
4 | * Copyright (c) 2009 Nuvoton technology corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
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 as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/sched.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/err.h> | ||
20 | #include <linux/clk.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/leds.h> | ||
23 | |||
24 | #include <asm/mach-types.h> | ||
25 | #include <asm/mach/irq.h> | ||
26 | #include <asm/mach/time.h> | ||
27 | |||
28 | #include <mach/system.h> | ||
29 | #include <mach/map.h> | ||
30 | #include <mach/regs-timer.h> | ||
31 | |||
32 | #define RESETINT 0x01 | ||
33 | #define PERIOD (0x01 << 27) | ||
34 | #define ONESHOT (0x00 << 27) | ||
35 | #define COUNTEN (0x01 << 30) | ||
36 | #define INTEN (0x01 << 29) | ||
37 | |||
38 | #define TICKS_PER_SEC 100 | ||
39 | #define PRESCALE 0x63 /* Divider = prescale + 1 */ | ||
40 | |||
41 | unsigned int timer0_load; | ||
42 | |||
43 | static unsigned long nuc93x_gettimeoffset(void) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | /*IRQ handler for the timer*/ | ||
49 | |||
50 | static irqreturn_t nuc93x_timer_interrupt(int irq, void *dev_id) | ||
51 | { | ||
52 | timer_tick(); | ||
53 | __raw_writel(0x01, REG_TISR); /* clear TIF0 */ | ||
54 | return IRQ_HANDLED; | ||
55 | } | ||
56 | |||
57 | static struct irqaction nuc93x_timer_irq = { | ||
58 | .name = "nuc93x Timer Tick", | ||
59 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
60 | .handler = nuc93x_timer_interrupt, | ||
61 | }; | ||
62 | |||
63 | /*Set up timer reg.*/ | ||
64 | |||
65 | static void nuc93x_timer_setup(void) | ||
66 | { | ||
67 | struct clk *ck_ext = clk_get(NULL, "ext"); | ||
68 | struct clk *ck_timer = clk_get(NULL, "timer"); | ||
69 | unsigned int rate, val = 0; | ||
70 | |||
71 | BUG_ON(IS_ERR(ck_ext) || IS_ERR(ck_timer)); | ||
72 | |||
73 | clk_enable(ck_timer); | ||
74 | rate = clk_get_rate(ck_ext); | ||
75 | clk_put(ck_ext); | ||
76 | rate = rate / (PRESCALE + 0x01); | ||
77 | |||
78 | /* set a known state */ | ||
79 | __raw_writel(0x00, REG_TCSR0); | ||
80 | __raw_writel(RESETINT, REG_TISR); | ||
81 | |||
82 | timer0_load = (rate / TICKS_PER_SEC); | ||
83 | __raw_writel(timer0_load, REG_TICR0); | ||
84 | |||
85 | val |= (PERIOD | COUNTEN | INTEN | PRESCALE);; | ||
86 | __raw_writel(val, REG_TCSR0); | ||
87 | |||
88 | } | ||
89 | |||
90 | static void __init nuc93x_timer_init(void) | ||
91 | { | ||
92 | nuc93x_timer_setup(); | ||
93 | setup_irq(IRQ_TIMER0, &nuc93x_timer_irq); | ||
94 | } | ||
95 | |||
96 | struct sys_timer nuc93x_timer = { | ||
97 | .init = nuc93x_timer_init, | ||
98 | .offset = nuc93x_gettimeoffset, | ||
99 | .resume = nuc93x_timer_setup | ||
100 | }; | ||
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index ab995a9c606c..65e7b5b85d83 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c | |||
@@ -599,7 +599,7 @@ static struct clk i2c_ick = { | |||
599 | static struct omap_clk omap_clks[] = { | 599 | static struct omap_clk omap_clks[] = { |
600 | /* non-ULPD clocks */ | 600 | /* non-ULPD clocks */ |
601 | CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310 | CK_7XX), | 601 | CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310 | CK_7XX), |
602 | CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310), | 602 | CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310 | CK_7XX), |
603 | /* CK_GEN1 clocks */ | 603 | /* CK_GEN1 clocks */ |
604 | CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX), | 604 | CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX), |
605 | CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX), | 605 | CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX), |
@@ -627,7 +627,7 @@ static struct omap_clk omap_clks[] = { | |||
627 | CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX), | 627 | CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX), |
628 | CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310), | 628 | CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310), |
629 | CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX), | 629 | CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX), |
630 | CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310), | 630 | CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX), |
631 | CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310), | 631 | CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310), |
632 | CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX), | 632 | CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX), |
633 | CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX), | 633 | CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX), |
@@ -658,6 +658,10 @@ static struct omap_clk omap_clks[] = { | |||
658 | CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX), | 658 | CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX), |
659 | CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX), | 659 | CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX), |
660 | CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX), | 660 | CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX), |
661 | CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX), | ||
662 | CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX), | ||
663 | CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX), | ||
664 | CLK("omap1_spi100k.2", "ick", &dummy_ck, CK_7XX), | ||
661 | CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310), | 665 | CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310), |
662 | CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX), | 666 | CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX), |
663 | CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310), | 667 | CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310), |
@@ -674,7 +678,7 @@ static struct omap_clk omap_clks[] = { | |||
674 | * init | 678 | * init |
675 | */ | 679 | */ |
676 | 680 | ||
677 | static struct clk_functions omap1_clk_functions __initdata = { | 681 | static struct clk_functions omap1_clk_functions = { |
678 | .clk_enable = omap1_clk_enable, | 682 | .clk_enable = omap1_clk_enable, |
679 | .clk_disable = omap1_clk_disable, | 683 | .clk_disable = omap1_clk_disable, |
680 | .clk_round_rate = omap1_clk_round_rate, | 684 | .clk_round_rate = omap1_clk_round_rate, |
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index 23ded2d49600..a2d07aa75c9e 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/spi/spi.h> | ||
17 | 18 | ||
18 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
19 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
@@ -23,6 +24,7 @@ | |||
23 | #include <plat/mux.h> | 24 | #include <plat/mux.h> |
24 | #include <mach/gpio.h> | 25 | #include <mach/gpio.h> |
25 | #include <plat/mmc.h> | 26 | #include <plat/mmc.h> |
27 | #include <plat/omap7xx.h> | ||
26 | 28 | ||
27 | /*-------------------------------------------------------------------------*/ | 29 | /*-------------------------------------------------------------------------*/ |
28 | 30 | ||
@@ -196,6 +198,38 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, | |||
196 | 198 | ||
197 | /*-------------------------------------------------------------------------*/ | 199 | /*-------------------------------------------------------------------------*/ |
198 | 200 | ||
201 | /* OMAP7xx SPI support */ | ||
202 | #if defined(CONFIG_SPI_OMAP_100K) || defined(CONFIG_SPI_OMAP_100K_MODULE) | ||
203 | |||
204 | struct platform_device omap_spi1 = { | ||
205 | .name = "omap1_spi100k", | ||
206 | .id = 1, | ||
207 | }; | ||
208 | |||
209 | struct platform_device omap_spi2 = { | ||
210 | .name = "omap1_spi100k", | ||
211 | .id = 2, | ||
212 | }; | ||
213 | |||
214 | static void omap_init_spi100k(void) | ||
215 | { | ||
216 | omap_spi1.dev.platform_data = ioremap(OMAP7XX_SPI1_BASE, 0x7ff); | ||
217 | if (omap_spi1.dev.platform_data) | ||
218 | platform_device_register(&omap_spi1); | ||
219 | |||
220 | omap_spi2.dev.platform_data = ioremap(OMAP7XX_SPI2_BASE, 0x7ff); | ||
221 | if (omap_spi2.dev.platform_data) | ||
222 | platform_device_register(&omap_spi2); | ||
223 | } | ||
224 | |||
225 | #else | ||
226 | static inline void omap_init_spi100k(void) | ||
227 | { | ||
228 | } | ||
229 | #endif | ||
230 | |||
231 | /*-------------------------------------------------------------------------*/ | ||
232 | |||
199 | #if defined(CONFIG_OMAP_STI) | 233 | #if defined(CONFIG_OMAP_STI) |
200 | 234 | ||
201 | #define OMAP1_STI_BASE 0xfffea000 | 235 | #define OMAP1_STI_BASE 0xfffea000 |
@@ -263,6 +297,7 @@ static int __init omap1_init_devices(void) | |||
263 | 297 | ||
264 | omap_init_mbox(); | 298 | omap_init_mbox(); |
265 | omap_init_rtc(); | 299 | omap_init_rtc(); |
300 | omap_init_spi100k(); | ||
266 | omap_init_sti(); | 301 | omap_init_sti(); |
267 | 302 | ||
268 | return 0; | 303 | return 0; |
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c index 07212cc621ae..84341377232d 100644 --- a/arch/arm/mach-omap1/mux.c +++ b/arch/arm/mach-omap1/mux.c | |||
@@ -62,6 +62,14 @@ MUX_CFG_7XX("MMC_7XX_DAT0", 2, 17, 0, 16, 1, 0) | |||
62 | /* I2C interface */ | 62 | /* I2C interface */ |
63 | MUX_CFG_7XX("I2C_7XX_SCL", 5, 1, 0, 0, 1, 0) | 63 | MUX_CFG_7XX("I2C_7XX_SCL", 5, 1, 0, 0, 1, 0) |
64 | MUX_CFG_7XX("I2C_7XX_SDA", 5, 5, 0, 0, 1, 0) | 64 | MUX_CFG_7XX("I2C_7XX_SDA", 5, 5, 0, 0, 1, 0) |
65 | |||
66 | /* SPI pins */ | ||
67 | MUX_CFG_7XX("SPI_7XX_1", 6, 5, 4, 4, 1, 0) | ||
68 | MUX_CFG_7XX("SPI_7XX_2", 6, 9, 4, 8, 1, 0) | ||
69 | MUX_CFG_7XX("SPI_7XX_3", 6, 13, 4, 12, 1, 0) | ||
70 | MUX_CFG_7XX("SPI_7XX_4", 6, 17, 4, 16, 1, 0) | ||
71 | MUX_CFG_7XX("SPI_7XX_5", 8, 25, 0, 24, 0, 0) | ||
72 | MUX_CFG_7XX("SPI_7XX_6", 9, 5, 0, 4, 0, 0) | ||
65 | }; | 73 | }; |
66 | #define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins) | 74 | #define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins) |
67 | #else | 75 | #else |
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 10eafa70a909..606bf04f51b6 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -80,6 +80,7 @@ config MACH_OVERO | |||
80 | config MACH_OMAP3EVM | 80 | config MACH_OMAP3EVM |
81 | bool "OMAP 3530 EVM board" | 81 | bool "OMAP 3530 EVM board" |
82 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 82 | depends on ARCH_OMAP3 && ARCH_OMAP34XX |
83 | select OMAP_PACKAGE_CBB | ||
83 | 84 | ||
84 | config MACH_OMAP3517EVM | 85 | config MACH_OMAP3517EVM |
85 | bool "OMAP3517/ AM3517 EVM board" | 86 | bool "OMAP3517/ AM3517 EVM board" |
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 8dd277c36661..1e3dfb652acc 100755 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c | |||
@@ -63,21 +63,21 @@ static int board_keymap[] = { | |||
63 | KEY(5, 1, KEY_H), | 63 | KEY(5, 1, KEY_H), |
64 | KEY(5, 2, KEY_J), | 64 | KEY(5, 2, KEY_J), |
65 | KEY(5, 3, KEY_F3), | 65 | KEY(5, 3, KEY_F3), |
66 | KEY(5, 4, KEY_UNKNOWN), | ||
66 | KEY(5, 5, KEY_VOLUMEDOWN), | 67 | KEY(5, 5, KEY_VOLUMEDOWN), |
67 | KEY(5, 6, KEY_M), | 68 | KEY(5, 6, KEY_M), |
68 | KEY(5, 7, KEY_ENTER), | 69 | KEY(5, 7, KEY_RIGHT), |
69 | KEY(6, 0, KEY_Q), | 70 | KEY(6, 0, KEY_Q), |
70 | KEY(6, 1, KEY_A), | 71 | KEY(6, 1, KEY_A), |
71 | KEY(6, 2, KEY_N), | 72 | KEY(6, 2, KEY_N), |
72 | KEY(6, 3, KEY_BACKSPACE), | 73 | KEY(6, 3, KEY_BACKSPACE), |
73 | KEY(6, 6, KEY_P), | 74 | KEY(6, 6, KEY_P), |
74 | KEY(6, 7, KEY_SELECT), | 75 | KEY(6, 7, KEY_UP), |
75 | KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */ | 76 | KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */ |
76 | KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */ | 77 | KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */ |
77 | KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */ | 78 | KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */ |
78 | KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */ | 79 | KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */ |
79 | KEY(7, 5, KEY_RIGHT), | 80 | KEY(7, 6, KEY_SELECT), |
80 | KEY(7, 6, KEY_UP), | ||
81 | KEY(7, 7, KEY_DOWN) | 81 | KEY(7, 7, KEY_DOWN) |
82 | }; | 82 | }; |
83 | 83 | ||
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c index d0e3fb7f9298..5420356eb407 100644 --- a/arch/arm/mach-omap2/clock2xxx.c +++ b/arch/arm/mach-omap2/clock2xxx.c | |||
@@ -449,40 +449,78 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate) | |||
449 | #ifdef CONFIG_CPU_FREQ | 449 | #ifdef CONFIG_CPU_FREQ |
450 | /* | 450 | /* |
451 | * Walk PRCM rate table and fillout cpufreq freq_table | 451 | * Walk PRCM rate table and fillout cpufreq freq_table |
452 | * XXX This should be replaced by an OPP layer in the near future | ||
452 | */ | 453 | */ |
453 | static struct cpufreq_frequency_table freq_table[ARRAY_SIZE(rate_table)]; | 454 | static struct cpufreq_frequency_table *freq_table; |
454 | 455 | ||
455 | void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | 456 | void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) |
456 | { | 457 | { |
457 | struct prcm_config *prcm; | 458 | const struct prcm_config *prcm; |
459 | long sys_ck_rate; | ||
458 | int i = 0; | 460 | int i = 0; |
461 | int tbl_sz = 0; | ||
462 | |||
463 | sys_ck_rate = clk_get_rate(sclk); | ||
459 | 464 | ||
460 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | 465 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
461 | if (!(prcm->flags & cpu_mask)) | 466 | if (!(prcm->flags & cpu_mask)) |
462 | continue; | 467 | continue; |
463 | if (prcm->xtal_speed != sys_ck.rate) | 468 | if (prcm->xtal_speed != sys_ck_rate) |
464 | continue; | 469 | continue; |
465 | 470 | ||
466 | /* don't put bypass rates in table */ | 471 | /* don't put bypass rates in table */ |
467 | if (prcm->dpll_speed == prcm->xtal_speed) | 472 | if (prcm->dpll_speed == prcm->xtal_speed) |
468 | continue; | 473 | continue; |
469 | 474 | ||
470 | freq_table[i].index = i; | 475 | tbl_sz++; |
471 | freq_table[i].frequency = prcm->mpu_speed / 1000; | ||
472 | i++; | ||
473 | } | 476 | } |
474 | 477 | ||
475 | if (i == 0) { | 478 | /* |
476 | printk(KERN_WARNING "%s: failed to initialize frequency " | 479 | * XXX Ensure that we're doing what CPUFreq expects for this error |
477 | "table\n", __func__); | 480 | * case and the following one |
481 | */ | ||
482 | if (tbl_sz == 0) { | ||
483 | pr_warning("%s: no matching entries in rate_table\n", | ||
484 | __func__); | ||
485 | return; | ||
486 | } | ||
487 | |||
488 | /* Include the CPUFREQ_TABLE_END terminator entry */ | ||
489 | tbl_sz++; | ||
490 | |||
491 | freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) * tbl_sz, | ||
492 | GFP_ATOMIC); | ||
493 | if (!freq_table) { | ||
494 | pr_err("%s: could not kzalloc frequency table\n", __func__); | ||
478 | return; | 495 | return; |
479 | } | 496 | } |
480 | 497 | ||
498 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | ||
499 | if (!(prcm->flags & cpu_mask)) | ||
500 | continue; | ||
501 | if (prcm->xtal_speed != sys_ck_rate) | ||
502 | continue; | ||
503 | |||
504 | /* don't put bypass rates in table */ | ||
505 | if (prcm->dpll_speed == prcm->xtal_speed) | ||
506 | continue; | ||
507 | |||
508 | freq_table[i].index = i; | ||
509 | freq_table[i].frequency = prcm->mpu_speed / 1000; | ||
510 | i++; | ||
511 | } | ||
512 | |||
481 | freq_table[i].index = i; | 513 | freq_table[i].index = i; |
482 | freq_table[i].frequency = CPUFREQ_TABLE_END; | 514 | freq_table[i].frequency = CPUFREQ_TABLE_END; |
483 | 515 | ||
484 | *table = &freq_table[0]; | 516 | *table = &freq_table[0]; |
485 | } | 517 | } |
518 | |||
519 | void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) | ||
520 | { | ||
521 | kfree(freq_table); | ||
522 | } | ||
523 | |||
486 | #endif | 524 | #endif |
487 | 525 | ||
488 | struct clk_functions omap2_clk_functions = { | 526 | struct clk_functions omap2_clk_functions = { |
@@ -494,6 +532,7 @@ struct clk_functions omap2_clk_functions = { | |||
494 | .clk_disable_unused = omap2_clk_disable_unused, | 532 | .clk_disable_unused = omap2_clk_disable_unused, |
495 | #ifdef CONFIG_CPU_FREQ | 533 | #ifdef CONFIG_CPU_FREQ |
496 | .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table, | 534 | .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table, |
535 | .clk_exit_cpufreq_table = omap2_clk_exit_cpufreq_table, | ||
497 | #endif | 536 | #endif |
498 | }; | 537 | }; |
499 | 538 | ||
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index ded32364f32b..d4217b93e10b 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <asm/div64.h> | 34 | #include <asm/div64.h> |
35 | #include <asm/clkdev.h> | 35 | #include <asm/clkdev.h> |
36 | 36 | ||
37 | #include <plat/sdrc.h> | ||
38 | #include "clock.h" | 37 | #include "clock.h" |
39 | #include "clock34xx.h" | 38 | #include "clock34xx.h" |
40 | #include "sdrc.h" | 39 | #include "sdrc.h" |
diff --git a/arch/arm/mach-omap2/clock34xx_data.c b/arch/arm/mach-omap2/clock34xx_data.c index 8bdcc9cc7f9a..c6031d74d6f6 100644 --- a/arch/arm/mach-omap2/clock34xx_data.c +++ b/arch/arm/mach-omap2/clock34xx_data.c | |||
@@ -776,6 +776,8 @@ static struct clk dpll4_m5_ck = { | |||
776 | .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, | 776 | .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, |
777 | .clksel = div16_dpll4_clksel, | 777 | .clksel = div16_dpll4_clksel, |
778 | .clkdm_name = "dpll4_clkdm", | 778 | .clkdm_name = "dpll4_clkdm", |
779 | .set_rate = &omap2_clksel_set_rate, | ||
780 | .round_rate = &omap2_clksel_round_rate, | ||
779 | .recalc = &omap2_clksel_recalc, | 781 | .recalc = &omap2_clksel_recalc, |
780 | }; | 782 | }; |
781 | 783 | ||
@@ -1500,6 +1502,7 @@ static struct clk uart2_fck = { | |||
1500 | .parent = &core_48m_fck, | 1502 | .parent = &core_48m_fck, |
1501 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1503 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1502 | .enable_bit = OMAP3430_EN_UART2_SHIFT, | 1504 | .enable_bit = OMAP3430_EN_UART2_SHIFT, |
1505 | .clkdm_name = "core_l4_clkdm", | ||
1503 | .recalc = &followparent_recalc, | 1506 | .recalc = &followparent_recalc, |
1504 | }; | 1507 | }; |
1505 | 1508 | ||
@@ -1509,6 +1512,7 @@ static struct clk uart1_fck = { | |||
1509 | .parent = &core_48m_fck, | 1512 | .parent = &core_48m_fck, |
1510 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1513 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1511 | .enable_bit = OMAP3430_EN_UART1_SHIFT, | 1514 | .enable_bit = OMAP3430_EN_UART1_SHIFT, |
1515 | .clkdm_name = "core_l4_clkdm", | ||
1512 | .recalc = &followparent_recalc, | 1516 | .recalc = &followparent_recalc, |
1513 | }; | 1517 | }; |
1514 | 1518 | ||
@@ -2745,7 +2749,7 @@ static struct clk mcbsp4_ick = { | |||
2745 | }; | 2749 | }; |
2746 | 2750 | ||
2747 | static const struct clksel mcbsp_234_clksel[] = { | 2751 | static const struct clksel mcbsp_234_clksel[] = { |
2748 | { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates }, | 2752 | { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates }, |
2749 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, | 2753 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, |
2750 | { .parent = NULL } | 2754 | { .parent = NULL } |
2751 | }; | 2755 | }; |
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 1a45ed1e8ba1..dd285f001467 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -559,7 +559,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
559 | * downstream clocks for debugging purposes? | 559 | * downstream clocks for debugging purposes? |
560 | */ | 560 | */ |
561 | 561 | ||
562 | if (!clkdm || !clk) | 562 | if (!clkdm || !clk || !clkdm->clktrctrl_mask) |
563 | return -EINVAL; | 563 | return -EINVAL; |
564 | 564 | ||
565 | if (atomic_inc_return(&clkdm->usecount) > 1) | 565 | if (atomic_inc_return(&clkdm->usecount) > 1) |
@@ -610,7 +610,7 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | |||
610 | * downstream clocks for debugging purposes? | 610 | * downstream clocks for debugging purposes? |
611 | */ | 611 | */ |
612 | 612 | ||
613 | if (!clkdm || !clk) | 613 | if (!clkdm || !clk || !clkdm->clktrctrl_mask) |
614 | return -EINVAL; | 614 | return -EINVAL; |
615 | 615 | ||
616 | #ifdef DEBUG | 616 | #ifdef DEBUG |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index a8749e8017b9..5a7996402c53 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <plat/sdrc.h> | 33 | #include <plat/sdrc.h> |
34 | #include <plat/gpmc.h> | 34 | #include <plat/gpmc.h> |
35 | #include <plat/serial.h> | 35 | #include <plat/serial.h> |
36 | #include <plat/mux.h> | ||
37 | #include <plat/vram.h> | 36 | #include <plat/vram.h> |
38 | 37 | ||
39 | #include "clock.h" | 38 | #include "clock.h" |
@@ -73,21 +72,21 @@ static struct map_desc omap24xx_io_desc[] __initdata = { | |||
73 | #ifdef CONFIG_ARCH_OMAP2420 | 72 | #ifdef CONFIG_ARCH_OMAP2420 |
74 | static struct map_desc omap242x_io_desc[] __initdata = { | 73 | static struct map_desc omap242x_io_desc[] __initdata = { |
75 | { | 74 | { |
76 | .virtual = DSP_MEM_24XX_VIRT, | 75 | .virtual = DSP_MEM_2420_VIRT, |
77 | .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS), | 76 | .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS), |
78 | .length = DSP_MEM_24XX_SIZE, | 77 | .length = DSP_MEM_2420_SIZE, |
79 | .type = MT_DEVICE | 78 | .type = MT_DEVICE |
80 | }, | 79 | }, |
81 | { | 80 | { |
82 | .virtual = DSP_IPI_24XX_VIRT, | 81 | .virtual = DSP_IPI_2420_VIRT, |
83 | .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS), | 82 | .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS), |
84 | .length = DSP_IPI_24XX_SIZE, | 83 | .length = DSP_IPI_2420_SIZE, |
85 | .type = MT_DEVICE | 84 | .type = MT_DEVICE |
86 | }, | 85 | }, |
87 | { | 86 | { |
88 | .virtual = DSP_MMU_24XX_VIRT, | 87 | .virtual = DSP_MMU_2420_VIRT, |
89 | .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS), | 88 | .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS), |
90 | .length = DSP_MMU_24XX_SIZE, | 89 | .length = DSP_MMU_2420_SIZE, |
91 | .type = MT_DEVICE | 90 | .type = MT_DEVICE |
92 | }, | 91 | }, |
93 | }; | 92 | }; |
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index e071b3fd1878..459ef23ab8a8 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c | |||
@@ -994,8 +994,10 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size, | |||
994 | } | 994 | } |
995 | 995 | ||
996 | #ifdef CONFIG_OMAP_MUX | 996 | #ifdef CONFIG_OMAP_MUX |
997 | omap_mux_package_fixup(package_subset, superset); | 997 | if (package_subset) |
998 | omap_mux_package_init_balls(package_balls, superset); | 998 | omap_mux_package_fixup(package_subset, superset); |
999 | if (package_balls) | ||
1000 | omap_mux_package_init_balls(package_balls, superset); | ||
999 | omap_mux_set_cmdline_signals(); | 1001 | omap_mux_set_cmdline_signals(); |
1000 | omap_mux_set_board_signals(board_mux); | 1002 | omap_mux_set_board_signals(board_mux); |
1001 | #endif | 1003 | #endif |
diff --git a/arch/arm/mach-omap2/opp2420_data.c b/arch/arm/mach-omap2/opp2420_data.c index 126a9396b3a8..e6dda694fd5c 100644 --- a/arch/arm/mach-omap2/opp2420_data.c +++ b/arch/arm/mach-omap2/opp2420_data.c | |||
@@ -9,45 +9,47 @@ | |||
9 | * The OMAP2 processor can be run at several discrete 'PRCM configurations'. | 9 | * The OMAP2 processor can be run at several discrete 'PRCM configurations'. |
10 | * These configurations are characterized by voltage and speed for clocks. | 10 | * These configurations are characterized by voltage and speed for clocks. |
11 | * The device is only validated for certain combinations. One way to express | 11 | * The device is only validated for certain combinations. One way to express |
12 | * these combinations is via the 'ratio's' which the clocks operate with | 12 | * these combinations is via the 'ratios' which the clocks operate with |
13 | * respect to each other. These ratio sets are for a given voltage/DPLL | 13 | * respect to each other. These ratio sets are for a given voltage/DPLL |
14 | * setting. All configurations can be described by a DPLL setting and a ratio | 14 | * setting. All configurations can be described by a DPLL setting and a ratio. |
15 | * There are 3 ratio sets for the 2430 and X ratio sets for 2420. | ||
16 | * | ||
17 | * 2430 differs from 2420 in that there are no more phase synchronizers used. | ||
18 | * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs | ||
19 | * 2430 (iva2.1, NOdsp, mdm) | ||
20 | * | 15 | * |
21 | * XXX Missing voltage data. | 16 | * XXX Missing voltage data. |
17 | * XXX Missing 19.2MHz sys_clk rate sets (needed for N800/N810) | ||
22 | * | 18 | * |
23 | * THe format described in this file is deprecated. Once a reasonable | 19 | * THe format described in this file is deprecated. Once a reasonable |
24 | * OPP API exists, the data in this file should be converted to use it. | 20 | * OPP API exists, the data in this file should be converted to use it. |
25 | * | 21 | * |
26 | * This is technically part of the OMAP2xxx clock code. | 22 | * This is technically part of the OMAP2xxx clock code. |
23 | * | ||
24 | * Considerable work is still needed to fully support dynamic frequency | ||
25 | * changes on OMAP2xxx-series chips. Readers interested in such a | ||
26 | * project are encouraged to review the Maemo Diablo RX-34 and RX-44 | ||
27 | * kernel source at: | ||
28 | * http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/ | ||
27 | */ | 29 | */ |
28 | 30 | ||
29 | #include "opp2xxx.h" | 31 | #include "opp2xxx.h" |
30 | #include "sdrc.h" | 32 | #include "sdrc.h" |
31 | #include "clock.h" | 33 | #include "clock.h" |
32 | 34 | ||
33 | /*------------------------------------------------------------------------- | 35 | /* |
34 | * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. | 36 | * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated. |
35 | * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, | 37 | * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, |
36 | * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, | 38 | * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, |
37 | * CM_CLKSEL2_PLL, CM_CLKSEL_MDM | 39 | * CM_CLKSEL2_PLL, CM_CLKSEL_MDM |
38 | * | 40 | * |
39 | * Filling in table based on H4 boards and 2430-SDPs variants available. | 41 | * Filling in table based on H4 boards available. There are quite a |
40 | * There are quite a few more rates combinations which could be defined. | 42 | * few more rate combinations which could be defined. |
41 | * | 43 | * |
42 | * When multiple values are defined the start up will try and choose the | 44 | * When multiple values are defined the start up will try and choose |
43 | * fastest one. If a 'fast' value is defined, then automatically, the /2 | 45 | * the fastest one. If a 'fast' value is defined, then automatically, |
44 | * one should be included as it can be used. Generally having more that | 46 | * the /2 one should be included as it can be used. Generally having |
45 | * one fast set does not make sense, as static timings need to be changed | 47 | * more than one fast set does not make sense, as static timings need |
46 | * to change the set. The exception is the bypass setting which is | 48 | * to be changed to change the set. The exception is the bypass |
47 | * availble for low power bypass. | 49 | * setting which is available for low power bypass. |
48 | * | 50 | * |
49 | * Note: This table needs to be sorted, fastest to slowest. | 51 | * Note: This table needs to be sorted, fastest to slowest. |
50 | *-------------------------------------------------------------------------*/ | 52 | **/ |
51 | const struct prcm_config omap2420_rate_table[] = { | 53 | const struct prcm_config omap2420_rate_table[] = { |
52 | /* PRCM I - FAST */ | 54 | /* PRCM I - FAST */ |
53 | {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */ | 55 | {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */ |
diff --git a/arch/arm/mach-omap2/opp2430_data.c b/arch/arm/mach-omap2/opp2430_data.c index edb81672c844..1b9596ae201e 100644 --- a/arch/arm/mach-omap2/opp2430_data.c +++ b/arch/arm/mach-omap2/opp2430_data.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * opp2420_data.c - old-style "OPP" table for OMAP2420 | 2 | * opp2430_data.c - old-style "OPP" table for OMAP2430 |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
5 | * Copyright (C) 2004-2009 Nokia Corporation | 5 | * Copyright (C) 2004-2009 Nokia Corporation |
@@ -9,16 +9,16 @@ | |||
9 | * The OMAP2 processor can be run at several discrete 'PRCM configurations'. | 9 | * The OMAP2 processor can be run at several discrete 'PRCM configurations'. |
10 | * These configurations are characterized by voltage and speed for clocks. | 10 | * These configurations are characterized by voltage and speed for clocks. |
11 | * The device is only validated for certain combinations. One way to express | 11 | * The device is only validated for certain combinations. One way to express |
12 | * these combinations is via the 'ratio's' which the clocks operate with | 12 | * these combinations is via the 'ratios' which the clocks operate with |
13 | * respect to each other. These ratio sets are for a given voltage/DPLL | 13 | * respect to each other. These ratio sets are for a given voltage/DPLL |
14 | * setting. All configurations can be described by a DPLL setting and a ratio | 14 | * setting. All configurations can be described by a DPLL setting and a ratio. |
15 | * There are 3 ratio sets for the 2430 and X ratio sets for 2420. | ||
16 | * | 15 | * |
17 | * 2430 differs from 2420 in that there are no more phase synchronizers used. | 16 | * 2430 differs from 2420 in that there are no more phase synchronizers used. |
18 | * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs | 17 | * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs |
19 | * 2430 (iva2.1, NOdsp, mdm) | 18 | * 2430 (iva2.1, NOdsp, mdm) |
20 | * | 19 | * |
21 | * XXX Missing voltage data. | 20 | * XXX Missing voltage data. |
21 | * XXX Missing 19.2MHz sys_clk rate sets. | ||
22 | * | 22 | * |
23 | * THe format described in this file is deprecated. Once a reasonable | 23 | * THe format described in this file is deprecated. Once a reasonable |
24 | * OPP API exists, the data in this file should be converted to use it. | 24 | * OPP API exists, the data in this file should be converted to use it. |
@@ -30,24 +30,24 @@ | |||
30 | #include "sdrc.h" | 30 | #include "sdrc.h" |
31 | #include "clock.h" | 31 | #include "clock.h" |
32 | 32 | ||
33 | /*------------------------------------------------------------------------- | 33 | /* |
34 | * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. | 34 | * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated. |
35 | * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, | 35 | * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, |
36 | * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, | 36 | * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, |
37 | * CM_CLKSEL2_PLL, CM_CLKSEL_MDM | 37 | * CM_CLKSEL2_PLL, CM_CLKSEL_MDM |
38 | * | 38 | * |
39 | * Filling in table based on H4 boards and 2430-SDPs variants available. | 39 | * Filling in table based on 2430-SDPs variants available. There are |
40 | * There are quite a few more rates combinations which could be defined. | 40 | * quite a few more rate combinations which could be defined. |
41 | * | 41 | * |
42 | * When multiple values are defined the start up will try and choose the | 42 | * When multiple values are defined the start up will try and choose |
43 | * fastest one. If a 'fast' value is defined, then automatically, the /2 | 43 | * the fastest one. If a 'fast' value is defined, then automatically, |
44 | * one should be included as it can be used. Generally having more that | 44 | * the /2 one should be included as it can be used. Generally having |
45 | * one fast set does not make sense, as static timings need to be changed | 45 | * more than one fast set does not make sense, as static timings need |
46 | * to change the set. The exception is the bypass setting which is | 46 | * to be changed to change the set. The exception is the bypass |
47 | * availble for low power bypass. | 47 | * setting which is available for low power bypass. |
48 | * | 48 | * |
49 | * Note: This table needs to be sorted, fastest to slowest. | 49 | * Note: This table needs to be sorted, fastest to slowest. |
50 | *-------------------------------------------------------------------------*/ | 50 | */ |
51 | const struct prcm_config omap2430_rate_table[] = { | 51 | const struct prcm_config omap2430_rate_table[] = { |
52 | /* PRCM #4 - ratio2 (ES2.1) - FAST */ | 52 | /* PRCM #4 - ratio2 (ES2.1) - FAST */ |
53 | {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* 399MHz ARM */ | 53 | {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* 399MHz ARM */ |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 81ed252a0f8a..c6cc809afb79 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -124,8 +124,8 @@ static void omap3_core_save_context(void) | |||
124 | control_padconf_off |= START_PADCONF_SAVE; | 124 | control_padconf_off |= START_PADCONF_SAVE; |
125 | omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF); | 125 | omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF); |
126 | /* wait for the save to complete */ | 126 | /* wait for the save to complete */ |
127 | while (!omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) | 127 | while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) |
128 | & PADCONF_SAVE_DONE) | 128 | & PADCONF_SAVE_DONE)) |
129 | ; | 129 | ; |
130 | /* Save the Interrupt controller context */ | 130 | /* Save the Interrupt controller context */ |
131 | omap_intc_save_context(); | 131 | omap_intc_save_context(); |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 19805a7de06c..8c964bec8159 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -125,6 +125,13 @@ static struct plat_serial8250_port serial_platform_data3[] = { | |||
125 | } | 125 | } |
126 | }; | 126 | }; |
127 | #endif | 127 | #endif |
128 | static inline unsigned int __serial_read_reg(struct uart_port *up, | ||
129 | int offset) | ||
130 | { | ||
131 | offset <<= up->regshift; | ||
132 | return (unsigned int)__raw_readb(up->membase + offset); | ||
133 | } | ||
134 | |||
128 | static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, | 135 | static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, |
129 | int offset) | 136 | int offset) |
130 | { | 137 | { |
@@ -583,11 +590,12 @@ static unsigned int serial_in_override(struct uart_port *up, int offset) | |||
583 | { | 590 | { |
584 | if (UART_RX == offset) { | 591 | if (UART_RX == offset) { |
585 | unsigned int lsr; | 592 | unsigned int lsr; |
586 | lsr = serial_read_reg(omap_uart[up->line].p, UART_LSR); | 593 | lsr = __serial_read_reg(up, UART_LSR); |
587 | if (!(lsr & UART_LSR_DR)) | 594 | if (!(lsr & UART_LSR_DR)) |
588 | return -EPERM; | 595 | return -EPERM; |
589 | } | 596 | } |
590 | return serial_read_reg(omap_uart[up->line].p, offset); | 597 | |
598 | return __serial_read_reg(up, offset); | ||
591 | } | 599 | } |
592 | 600 | ||
593 | void __init omap_serial_early_init(void) | 601 | void __init omap_serial_early_init(void) |
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 8a0837ea0294..dee92182749b 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -37,6 +37,8 @@ config MACH_ZYLONITE320 | |||
37 | config MACH_LITTLETON | 37 | config MACH_LITTLETON |
38 | bool "PXA3xx Form Factor Platform (aka Littleton)" | 38 | bool "PXA3xx Form Factor Platform (aka Littleton)" |
39 | select PXA3xx | 39 | select PXA3xx |
40 | select CPU_PXA300 | ||
41 | select CPU_PXA310 | ||
40 | select PXA_SSP | 42 | select PXA_SSP |
41 | 43 | ||
42 | config MACH_TAVOREVB | 44 | config MACH_TAVOREVB |
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h index 50f1297bf5ac..e741bf1bfb2d 100644 --- a/arch/arm/mach-pxa/include/mach/hardware.h +++ b/arch/arm/mach-pxa/include/mach/hardware.h | |||
@@ -250,20 +250,17 @@ | |||
250 | 250 | ||
251 | #define cpu_is_pxa930() \ | 251 | #define cpu_is_pxa930() \ |
252 | ({ \ | 252 | ({ \ |
253 | unsigned int id = read_cpuid(CPUID_ID); \ | 253 | __cpu_is_pxa930(read_cpuid_id()); \ |
254 | __cpu_is_pxa930(id); \ | ||
255 | }) | 254 | }) |
256 | 255 | ||
257 | #define cpu_is_pxa935() \ | 256 | #define cpu_is_pxa935() \ |
258 | ({ \ | 257 | ({ \ |
259 | unsigned int id = read_cpuid(CPUID_ID); \ | 258 | __cpu_is_pxa935(read_cpuid_id()); \ |
260 | __cpu_is_pxa935(id); \ | ||
261 | }) | 259 | }) |
262 | 260 | ||
263 | #define cpu_is_pxa950() \ | 261 | #define cpu_is_pxa950() \ |
264 | ({ \ | 262 | ({ \ |
265 | unsigned int id = read_cpuid(CPUID_ID); \ | 263 | __cpu_is_pxa950(read_cpuid_id()); \ |
266 | __cpu_is_pxa950(id); \ | ||
267 | }) | 264 | }) |
268 | 265 | ||
269 | 266 | ||
diff --git a/arch/arm/mach-pxa/include/mach/zylonite.h b/arch/arm/mach-pxa/include/mach/zylonite.h index bf6785adccf4..9edf645368d6 100644 --- a/arch/arm/mach-pxa/include/mach/zylonite.h +++ b/arch/arm/mach-pxa/include/mach/zylonite.h | |||
@@ -8,13 +8,6 @@ | |||
8 | /* the following variables are processor specific and initialized | 8 | /* the following variables are processor specific and initialized |
9 | * by the corresponding zylonite_pxa3xx_init() | 9 | * by the corresponding zylonite_pxa3xx_init() |
10 | */ | 10 | */ |
11 | struct platform_mmc_slot { | ||
12 | int gpio_cd; | ||
13 | int gpio_wp; | ||
14 | }; | ||
15 | |||
16 | extern struct platform_mmc_slot zylonite_mmc_slot[]; | ||
17 | |||
18 | extern int gpio_eth_irq; | 11 | extern int gpio_eth_irq; |
19 | extern int gpio_debug_led1; | 12 | extern int gpio_debug_led1; |
20 | extern int gpio_debug_led2; | 13 | extern int gpio_debug_led2; |
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c index f28c1715b910..fa527b258d61 100644 --- a/arch/arm/mach-pxa/littleton.c +++ b/arch/arm/mach-pxa/littleton.c | |||
@@ -110,6 +110,12 @@ static mfp_cfg_t littleton_mfp_cfg[] __initdata = { | |||
110 | GPIO7_MMC1_CLK, | 110 | GPIO7_MMC1_CLK, |
111 | GPIO8_MMC1_CMD, | 111 | GPIO8_MMC1_CMD, |
112 | GPIO15_GPIO, /* card detect */ | 112 | GPIO15_GPIO, /* card detect */ |
113 | |||
114 | /* UART3 */ | ||
115 | GPIO107_UART3_CTS, | ||
116 | GPIO108_UART3_RTS, | ||
117 | GPIO109_UART3_TXD, | ||
118 | GPIO110_UART3_RXD, | ||
113 | }; | 119 | }; |
114 | 120 | ||
115 | static struct resource smc91x_resources[] = { | 121 | static struct resource smc91x_resources[] = { |
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c index 8a38d604dc77..189f330719a2 100644 --- a/arch/arm/mach-pxa/magician.c +++ b/arch/arm/mach-pxa/magician.c | |||
@@ -381,7 +381,7 @@ err: | |||
381 | return ret; | 381 | return ret; |
382 | } | 382 | } |
383 | 383 | ||
384 | static int magician_backlight_notify(int brightness) | 384 | static int magician_backlight_notify(struct device *dev, int brightness) |
385 | { | 385 | { |
386 | gpio_set_value(EGPIO_MAGICIAN_BL_POWER, brightness); | 386 | gpio_set_value(EGPIO_MAGICIAN_BL_POWER, brightness); |
387 | if (brightness >= 200) { | 387 | if (brightness >= 200) { |
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index 59140217890a..e100af78b166 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c | |||
@@ -270,7 +270,7 @@ err: | |||
270 | return ret; | 270 | return ret; |
271 | } | 271 | } |
272 | 272 | ||
273 | static int palmld_backlight_notify(int brightness) | 273 | static int palmld_backlight_notify(struct device *dev, int brightness) |
274 | { | 274 | { |
275 | gpio_set_value(GPIO_NR_PALMLD_BL_POWER, brightness); | 275 | gpio_set_value(GPIO_NR_PALMLD_BL_POWER, brightness); |
276 | gpio_set_value(GPIO_NR_PALMLD_LCD_POWER, brightness); | 276 | gpio_set_value(GPIO_NR_PALMLD_LCD_POWER, brightness); |
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c index 7f89ca20f13a..8fe3ec27568f 100644 --- a/arch/arm/mach-pxa/palmt5.c +++ b/arch/arm/mach-pxa/palmt5.c | |||
@@ -209,7 +209,7 @@ err: | |||
209 | return ret; | 209 | return ret; |
210 | } | 210 | } |
211 | 211 | ||
212 | static int palmt5_backlight_notify(int brightness) | 212 | static int palmt5_backlight_notify(struct device *dev, int brightness) |
213 | { | 213 | { |
214 | gpio_set_value(GPIO_NR_PALMT5_BL_POWER, brightness); | 214 | gpio_set_value(GPIO_NR_PALMT5_BL_POWER, brightness); |
215 | gpio_set_value(GPIO_NR_PALMT5_LCD_POWER, brightness); | 215 | gpio_set_value(GPIO_NR_PALMT5_LCD_POWER, brightness); |
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c index 308417592007..b992f07ece21 100644 --- a/arch/arm/mach-pxa/palmtc.c +++ b/arch/arm/mach-pxa/palmtc.c | |||
@@ -185,7 +185,7 @@ err: | |||
185 | return ret; | 185 | return ret; |
186 | } | 186 | } |
187 | 187 | ||
188 | static int palmtc_backlight_notify(int brightness) | 188 | static int palmtc_backlight_notify(struct device *dev, int brightness) |
189 | { | 189 | { |
190 | /* backlight is on when GPIO16 AF0 is high */ | 190 | /* backlight is on when GPIO16 AF0 is high */ |
191 | gpio_set_value(GPIO_NR_PALMTC_BL_POWER, brightness); | 191 | gpio_set_value(GPIO_NR_PALMTC_BL_POWER, brightness); |
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c index 265d62bae7de..dc728d6ab94e 100644 --- a/arch/arm/mach-pxa/palmte2.c +++ b/arch/arm/mach-pxa/palmte2.c | |||
@@ -181,7 +181,7 @@ err: | |||
181 | return ret; | 181 | return ret; |
182 | } | 182 | } |
183 | 183 | ||
184 | static int palmte2_backlight_notify(int brightness) | 184 | static int palmte2_backlight_notify(struct device *dev, int brightness) |
185 | { | 185 | { |
186 | gpio_set_value(GPIO_NR_PALMTE2_BL_POWER, brightness); | 186 | gpio_set_value(GPIO_NR_PALMTE2_BL_POWER, brightness); |
187 | gpio_set_value(GPIO_NR_PALMTE2_LCD_POWER, brightness); | 187 | gpio_set_value(GPIO_NR_PALMTE2_LCD_POWER, brightness); |
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index 606eb7e8a17e..b433bb496711 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c | |||
@@ -375,7 +375,7 @@ err: | |||
375 | return ret; | 375 | return ret; |
376 | } | 376 | } |
377 | 377 | ||
378 | static int treo_backlight_notify(int brightness) | 378 | static int treo_backlight_notify(struct device *dev, int brightness) |
379 | { | 379 | { |
380 | gpio_set_value(GPIO_NR_TREO_BL_POWER, brightness); | 380 | gpio_set_value(GPIO_NR_TREO_BL_POWER, brightness); |
381 | return TREO_MAX_INTENSITY - brightness; | 381 | return TREO_MAX_INTENSITY - brightness; |
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index 7bf18c2f002f..b37a025c0b7b 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c | |||
@@ -269,7 +269,7 @@ err: | |||
269 | return ret; | 269 | return ret; |
270 | } | 270 | } |
271 | 271 | ||
272 | static int palmtx_backlight_notify(int brightness) | 272 | static int palmtx_backlight_notify(struct device *dev, int brightness) |
273 | { | 273 | { |
274 | gpio_set_value(GPIO_NR_PALMTX_BL_POWER, brightness); | 274 | gpio_set_value(GPIO_NR_PALMTX_BL_POWER, brightness); |
275 | gpio_set_value(GPIO_NR_PALMTX_LCD_POWER, brightness); | 275 | gpio_set_value(GPIO_NR_PALMTX_LCD_POWER, brightness); |
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c index d787ac7cfdd8..1c5d68a94511 100644 --- a/arch/arm/mach-pxa/palmz72.c +++ b/arch/arm/mach-pxa/palmz72.c | |||
@@ -196,7 +196,7 @@ err: | |||
196 | return ret; | 196 | return ret; |
197 | } | 197 | } |
198 | 198 | ||
199 | static int palmz72_backlight_notify(int brightness) | 199 | static int palmz72_backlight_notify(struct device *dev, int brightness) |
200 | { | 200 | { |
201 | gpio_set_value(GPIO_NR_PALMZ72_BL_POWER, brightness); | 201 | gpio_set_value(GPIO_NR_PALMZ72_BL_POWER, brightness); |
202 | gpio_set_value(GPIO_NR_PALMZ72_LCD_POWER, brightness); | 202 | gpio_set_value(GPIO_NR_PALMZ72_LCD_POWER, brightness); |
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index e5eeb3a62d01..c2b938a4d5c9 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -293,7 +293,7 @@ static struct pxamci_platform_data poodle_mci_platform_data = { | |||
293 | .init = poodle_mci_init, | 293 | .init = poodle_mci_init, |
294 | .setpower = poodle_mci_setpower, | 294 | .setpower = poodle_mci_setpower, |
295 | .exit = poodle_mci_exit, | 295 | .exit = poodle_mci_exit, |
296 | .gpio_card_detect = POODLE_IRQ_GPIO_nSD_DETECT, | 296 | .gpio_card_detect = POODLE_GPIO_nSD_DETECT, |
297 | .gpio_card_ro = POODLE_GPIO_nSD_WP, | 297 | .gpio_card_ro = POODLE_GPIO_nSD_WP, |
298 | .gpio_power = -1, | 298 | .gpio_power = -1, |
299 | }; | 299 | }; |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 4b50f144fa48..28352c0b8c34 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -389,13 +389,13 @@ static struct gpio_keys_button spitz_gpio_keys[] = { | |||
389 | .type = EV_SW, | 389 | .type = EV_SW, |
390 | .code = 0, | 390 | .code = 0, |
391 | .gpio = SPITZ_GPIO_SWA, | 391 | .gpio = SPITZ_GPIO_SWA, |
392 | .desc = "Display Down", | 392 | .desc = "Display Down", |
393 | }, | 393 | }, |
394 | { | 394 | { |
395 | .type = EV_SW, | 395 | .type = EV_SW, |
396 | .code = 1, | 396 | .code = 1, |
397 | .gpio = SPITZ_GPIO_SWB, | 397 | .gpio = SPITZ_GPIO_SWB, |
398 | .desc = "Lid Closed", | 398 | .desc = "Lid Closed", |
399 | }, | 399 | }, |
400 | }; | 400 | }; |
401 | 401 | ||
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index 5352b4e5a7dd..89f258c9e126 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c | |||
@@ -379,7 +379,7 @@ err_request_bckl: | |||
379 | return ret; | 379 | return ret; |
380 | } | 380 | } |
381 | 381 | ||
382 | static int viper_backlight_notify(int brightness) | 382 | static int viper_backlight_notify(struct device *dev, int brightness) |
383 | { | 383 | { |
384 | gpio_set_value(VIPER_LCD_EN_GPIO, !!brightness); | 384 | gpio_set_value(VIPER_LCD_EN_GPIO, !!brightness); |
385 | gpio_set_value(VIPER_BCKLIGHT_EN_GPIO, !!brightness); | 385 | gpio_set_value(VIPER_BCKLIGHT_EN_GPIO, !!brightness); |
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index 5b986a8bd9e6..75f2a37f945d 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/mtd/physmap.h> | 25 | #include <linux/mtd/physmap.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/i2c/pca953x.h> | 27 | #include <linux/i2c/pca953x.h> |
28 | #include <linux/apm-emulation.h> | ||
28 | 29 | ||
29 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
@@ -626,8 +627,27 @@ static void zeus_power_off(void) | |||
626 | pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP); | 627 | pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP); |
627 | } | 628 | } |
628 | 629 | ||
629 | int zeus_get_pcb_info(struct i2c_client *client, unsigned gpio, | 630 | #ifdef CONFIG_APM_EMULATION |
630 | unsigned ngpio, void *context) | 631 | static void zeus_get_power_status(struct apm_power_info *info) |
632 | { | ||
633 | /* Power supply is always present */ | ||
634 | info->ac_line_status = APM_AC_ONLINE; | ||
635 | info->battery_status = APM_BATTERY_STATUS_NOT_PRESENT; | ||
636 | info->battery_flag = APM_BATTERY_FLAG_NOT_PRESENT; | ||
637 | } | ||
638 | |||
639 | static inline void zeus_setup_apm(void) | ||
640 | { | ||
641 | apm_get_power_status = zeus_get_power_status; | ||
642 | } | ||
643 | #else | ||
644 | static inline void zeus_setup_apm(void) | ||
645 | { | ||
646 | } | ||
647 | #endif | ||
648 | |||
649 | static int zeus_get_pcb_info(struct i2c_client *client, unsigned gpio, | ||
650 | unsigned ngpio, void *context) | ||
631 | { | 651 | { |
632 | int i; | 652 | int i; |
633 | u8 pcb_info = 0; | 653 | u8 pcb_info = 0; |
@@ -726,9 +746,18 @@ static mfp_cfg_t zeus_pin_config[] __initdata = { | |||
726 | GPIO99_GPIO, /* CF RDY */ | 746 | GPIO99_GPIO, /* CF RDY */ |
727 | }; | 747 | }; |
728 | 748 | ||
749 | /* | ||
750 | * DM9k MSCx settings: SRAM, 16 bits | ||
751 | * 17 cycles delay first access | ||
752 | * 5 cycles delay next access | ||
753 | * 13 cycles recovery time | ||
754 | * faster device | ||
755 | */ | ||
756 | #define DM9K_MSC_VALUE 0xe4c9 | ||
757 | |||
729 | static void __init zeus_init(void) | 758 | static void __init zeus_init(void) |
730 | { | 759 | { |
731 | u16 dm9000_msc = 0xe279; | 760 | u16 dm9000_msc = DM9K_MSC_VALUE; |
732 | 761 | ||
733 | system_rev = __raw_readw(ZEUS_CPLD_VERSION); | 762 | system_rev = __raw_readw(ZEUS_CPLD_VERSION); |
734 | pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); | 763 | pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); |
@@ -738,6 +767,7 @@ static void __init zeus_init(void) | |||
738 | MSC1 = (MSC1 & 0xffff0000) | dm9000_msc; | 767 | MSC1 = (MSC1 & 0xffff0000) | dm9000_msc; |
739 | 768 | ||
740 | pm_power_off = zeus_power_off; | 769 | pm_power_off = zeus_power_off; |
770 | zeus_setup_apm(); | ||
741 | 771 | ||
742 | pxa2xx_mfp_config(ARRAY_AND_SIZE(zeus_pin_config)); | 772 | pxa2xx_mfp_config(ARRAY_AND_SIZE(zeus_pin_config)); |
743 | 773 | ||
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index b66e9e2d06e7..2b4043c04d0c 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c | |||
@@ -36,9 +36,6 @@ | |||
36 | #include "devices.h" | 36 | #include "devices.h" |
37 | #include "generic.h" | 37 | #include "generic.h" |
38 | 38 | ||
39 | #define MAX_SLOTS 3 | ||
40 | struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS]; | ||
41 | |||
42 | int gpio_eth_irq; | 39 | int gpio_eth_irq; |
43 | int gpio_debug_led1; | 40 | int gpio_debug_led1; |
44 | int gpio_debug_led2; | 41 | int gpio_debug_led2; |
@@ -220,84 +217,28 @@ static inline void zylonite_init_lcd(void) {} | |||
220 | #endif | 217 | #endif |
221 | 218 | ||
222 | #if defined(CONFIG_MMC) | 219 | #if defined(CONFIG_MMC) |
223 | static int zylonite_mci_ro(struct device *dev) | ||
224 | { | ||
225 | struct platform_device *pdev = to_platform_device(dev); | ||
226 | |||
227 | return gpio_get_value(zylonite_mmc_slot[pdev->id].gpio_wp); | ||
228 | } | ||
229 | |||
230 | static int zylonite_mci_init(struct device *dev, | ||
231 | irq_handler_t zylonite_detect_int, | ||
232 | void *data) | ||
233 | { | ||
234 | struct platform_device *pdev = to_platform_device(dev); | ||
235 | int err, cd_irq, gpio_cd, gpio_wp; | ||
236 | |||
237 | cd_irq = gpio_to_irq(zylonite_mmc_slot[pdev->id].gpio_cd); | ||
238 | gpio_cd = zylonite_mmc_slot[pdev->id].gpio_cd; | ||
239 | gpio_wp = zylonite_mmc_slot[pdev->id].gpio_wp; | ||
240 | |||
241 | /* | ||
242 | * setup GPIO for Zylonite MMC controller | ||
243 | */ | ||
244 | err = gpio_request(gpio_cd, "mmc card detect"); | ||
245 | if (err) | ||
246 | goto err_request_cd; | ||
247 | gpio_direction_input(gpio_cd); | ||
248 | |||
249 | err = gpio_request(gpio_wp, "mmc write protect"); | ||
250 | if (err) | ||
251 | goto err_request_wp; | ||
252 | gpio_direction_input(gpio_wp); | ||
253 | |||
254 | err = request_irq(cd_irq, zylonite_detect_int, | ||
255 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | ||
256 | "MMC card detect", data); | ||
257 | if (err) { | ||
258 | printk(KERN_ERR "%s: MMC/SD/SDIO: " | ||
259 | "can't request card detect IRQ\n", __func__); | ||
260 | goto err_request_irq; | ||
261 | } | ||
262 | |||
263 | return 0; | ||
264 | |||
265 | err_request_irq: | ||
266 | gpio_free(gpio_wp); | ||
267 | err_request_wp: | ||
268 | gpio_free(gpio_cd); | ||
269 | err_request_cd: | ||
270 | return err; | ||
271 | } | ||
272 | |||
273 | static void zylonite_mci_exit(struct device *dev, void *data) | ||
274 | { | ||
275 | struct platform_device *pdev = to_platform_device(dev); | ||
276 | int cd_irq, gpio_cd, gpio_wp; | ||
277 | |||
278 | cd_irq = gpio_to_irq(zylonite_mmc_slot[pdev->id].gpio_cd); | ||
279 | gpio_cd = zylonite_mmc_slot[pdev->id].gpio_cd; | ||
280 | gpio_wp = zylonite_mmc_slot[pdev->id].gpio_wp; | ||
281 | |||
282 | free_irq(cd_irq, data); | ||
283 | gpio_free(gpio_cd); | ||
284 | gpio_free(gpio_wp); | ||
285 | } | ||
286 | |||
287 | static struct pxamci_platform_data zylonite_mci_platform_data = { | 220 | static struct pxamci_platform_data zylonite_mci_platform_data = { |
288 | .detect_delay = 20, | 221 | .detect_delay = 20, |
289 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 222 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
290 | .init = zylonite_mci_init, | 223 | .gpio_card_detect = EXT_GPIO(0), |
291 | .exit = zylonite_mci_exit, | 224 | .gpio_card_ro = EXT_GPIO(2), |
292 | .get_ro = zylonite_mci_ro, | ||
293 | .gpio_card_detect = -1, | ||
294 | .gpio_card_ro = -1, | ||
295 | .gpio_power = -1, | 225 | .gpio_power = -1, |
296 | }; | 226 | }; |
297 | 227 | ||
298 | static struct pxamci_platform_data zylonite_mci2_platform_data = { | 228 | static struct pxamci_platform_data zylonite_mci2_platform_data = { |
299 | .detect_delay = 20, | 229 | .detect_delay = 20, |
300 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 230 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
231 | .gpio_card_detect = EXT_GPIO(1), | ||
232 | .gpio_card_ro = EXT_GPIO(3), | ||
233 | .gpio_power = -1, | ||
234 | }; | ||
235 | |||
236 | static struct pxamci_platform_data zylonite_mci3_platform_data = { | ||
237 | .detect_delay = 20, | ||
238 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | ||
239 | .gpio_card_detect = EXT_GPIO(30), | ||
240 | .gpio_card_ro = EXT_GPIO(31), | ||
241 | .gpio_power = -1, | ||
301 | }; | 242 | }; |
302 | 243 | ||
303 | static void __init zylonite_init_mmc(void) | 244 | static void __init zylonite_init_mmc(void) |
@@ -305,7 +246,7 @@ static void __init zylonite_init_mmc(void) | |||
305 | pxa_set_mci_info(&zylonite_mci_platform_data); | 246 | pxa_set_mci_info(&zylonite_mci_platform_data); |
306 | pxa3xx_set_mci2_info(&zylonite_mci2_platform_data); | 247 | pxa3xx_set_mci2_info(&zylonite_mci2_platform_data); |
307 | if (cpu_is_pxa310()) | 248 | if (cpu_is_pxa310()) |
308 | pxa3xx_set_mci3_info(&zylonite_mci_platform_data); | 249 | pxa3xx_set_mci3_info(&zylonite_mci3_platform_data); |
309 | } | 250 | } |
310 | #else | 251 | #else |
311 | static inline void zylonite_init_mmc(void) {} | 252 | static inline void zylonite_init_mmc(void) {} |
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c index 84095440a878..3aa73b3e33f2 100644 --- a/arch/arm/mach-pxa/zylonite_pxa300.c +++ b/arch/arm/mach-pxa/zylonite_pxa300.c | |||
@@ -129,8 +129,8 @@ static mfp_cfg_t common_mfp_cfg[] __initdata = { | |||
129 | GPIO22_I2C_SDA, | 129 | GPIO22_I2C_SDA, |
130 | 130 | ||
131 | /* GPIO */ | 131 | /* GPIO */ |
132 | GPIO18_GPIO, /* GPIO Expander #0 INT_N */ | 132 | GPIO18_GPIO | MFP_PULL_HIGH, /* GPIO Expander #0 INT_N */ |
133 | GPIO19_GPIO, /* GPIO Expander #1 INT_N */ | 133 | GPIO19_GPIO | MFP_PULL_HIGH, /* GPIO Expander #1 INT_N */ |
134 | }; | 134 | }; |
135 | 135 | ||
136 | static mfp_cfg_t pxa300_mfp_cfg[] __initdata = { | 136 | static mfp_cfg_t pxa300_mfp_cfg[] __initdata = { |
@@ -258,10 +258,6 @@ void __init zylonite_pxa300_init(void) | |||
258 | /* detect LCD panel */ | 258 | /* detect LCD panel */ |
259 | zylonite_detect_lcd_panel(); | 259 | zylonite_detect_lcd_panel(); |
260 | 260 | ||
261 | /* MMC card detect & write protect for controller 0 */ | ||
262 | zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0); | ||
263 | zylonite_mmc_slot[0].gpio_wp = EXT_GPIO(2); | ||
264 | |||
265 | /* WM9713 IRQ */ | 261 | /* WM9713 IRQ */ |
266 | wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26); | 262 | wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26); |
267 | 263 | ||
@@ -276,10 +272,6 @@ void __init zylonite_pxa300_init(void) | |||
276 | if (cpu_is_pxa310()) { | 272 | if (cpu_is_pxa310()) { |
277 | pxa3xx_mfp_config(ARRAY_AND_SIZE(pxa310_mfp_cfg)); | 273 | pxa3xx_mfp_config(ARRAY_AND_SIZE(pxa310_mfp_cfg)); |
278 | gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO102); | 274 | gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO102); |
279 | |||
280 | /* MMC card detect & write protect for controller 2 */ | ||
281 | zylonite_mmc_slot[2].gpio_cd = EXT_GPIO(30); | ||
282 | zylonite_mmc_slot[2].gpio_wp = EXT_GPIO(31); | ||
283 | } | 275 | } |
284 | 276 | ||
285 | /* GPIOs for Debug LEDs */ | 277 | /* GPIOs for Debug LEDs */ |
diff --git a/arch/arm/mach-pxa/zylonite_pxa320.c b/arch/arm/mach-pxa/zylonite_pxa320.c index 60d08f23f5e4..9942bac4cf7d 100644 --- a/arch/arm/mach-pxa/zylonite_pxa320.c +++ b/arch/arm/mach-pxa/zylonite_pxa320.c | |||
@@ -209,10 +209,6 @@ void __init zylonite_pxa320_init(void) | |||
209 | gpio_debug_led1 = mfp_to_gpio(MFP_PIN_GPIO1_2); | 209 | gpio_debug_led1 = mfp_to_gpio(MFP_PIN_GPIO1_2); |
210 | gpio_debug_led2 = mfp_to_gpio(MFP_PIN_GPIO4_2); | 210 | gpio_debug_led2 = mfp_to_gpio(MFP_PIN_GPIO4_2); |
211 | 211 | ||
212 | /* MMC card detect & write protect for controller 0 */ | ||
213 | zylonite_mmc_slot[0].gpio_cd = mfp_to_gpio(MFP_PIN_GPIO1); | ||
214 | zylonite_mmc_slot[0].gpio_wp = mfp_to_gpio(MFP_PIN_GPIO5); | ||
215 | |||
216 | /* WM9713 IRQ */ | 212 | /* WM9713 IRQ */ |
217 | wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO15); | 213 | wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO15); |
218 | } | 214 | } |
diff --git a/arch/arm/mach-realview/include/mach/board-pb1176.h b/arch/arm/mach-realview/include/mach/board-pb1176.h index 34b80b7d40b8..2f5ccb298858 100644 --- a/arch/arm/mach-realview/include/mach/board-pb1176.h +++ b/arch/arm/mach-realview/include/mach/board-pb1176.h | |||
@@ -74,8 +74,8 @@ | |||
74 | #define REALVIEW_PB1176_L220_BASE 0x10110000 /* L220 registers */ | 74 | #define REALVIEW_PB1176_L220_BASE 0x10110000 /* L220 registers */ |
75 | 75 | ||
76 | /* | 76 | /* |
77 | * Control register SYS_RESETCTL is set to 1 to force a soft reset | 77 | * Control register SYS_RESETCTL Bit 8 is set to 1 to force a soft reset |
78 | */ | 78 | */ |
79 | #define REALVIEW_PB1176_SYS_LOCKVAL_RSTCTL 0x0100 | 79 | #define REALVIEW_PB1176_SYS_SOFT_RESET 0x0100 |
80 | 80 | ||
81 | #endif /* __ASM_ARCH_BOARD_PB1176_H */ | 81 | #endif /* __ASM_ARCH_BOARD_PB1176_H */ |
diff --git a/arch/arm/mach-realview/include/mach/platform.h b/arch/arm/mach-realview/include/mach/platform.h index 4f46bf71e752..86c0c4435a46 100644 --- a/arch/arm/mach-realview/include/mach/platform.h +++ b/arch/arm/mach-realview/include/mach/platform.h | |||
@@ -140,7 +140,7 @@ | |||
140 | * SYS_CLD, SYS_BOOTCS | 140 | * SYS_CLD, SYS_BOOTCS |
141 | */ | 141 | */ |
142 | #define REALVIEW_SYS_LOCK_LOCKED (1 << 16) | 142 | #define REALVIEW_SYS_LOCK_LOCKED (1 << 16) |
143 | #define REALVIEW_SYS_LOCKVAL_MASK 0xA05F /* Enable write access */ | 143 | #define REALVIEW_SYS_LOCK_VAL 0xA05F /* Enable write access */ |
144 | 144 | ||
145 | /* | 145 | /* |
146 | * REALVIEW_SYS_FLASH | 146 | * REALVIEW_SYS_FLASH |
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index 917f8ca3abff..7d857d300558 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -381,6 +381,20 @@ static struct sys_timer realview_eb_timer = { | |||
381 | .init = realview_eb_timer_init, | 381 | .init = realview_eb_timer_init, |
382 | }; | 382 | }; |
383 | 383 | ||
384 | static void realview_eb_reset(char mode) | ||
385 | { | ||
386 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); | ||
387 | void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); | ||
388 | |||
389 | /* | ||
390 | * To reset, we hit the on-board reset register | ||
391 | * in the system FPGA | ||
392 | */ | ||
393 | __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); | ||
394 | if (core_tile_eb11mp()) | ||
395 | __raw_writel(0x0008, reset_ctrl); | ||
396 | } | ||
397 | |||
384 | static void __init realview_eb_init(void) | 398 | static void __init realview_eb_init(void) |
385 | { | 399 | { |
386 | int i; | 400 | int i; |
@@ -408,6 +422,7 @@ static void __init realview_eb_init(void) | |||
408 | #ifdef CONFIG_LEDS | 422 | #ifdef CONFIG_LEDS |
409 | leds_event = realview_leds_event; | 423 | leds_event = realview_leds_event; |
410 | #endif | 424 | #endif |
425 | realview_reset = realview_eb_reset; | ||
411 | } | 426 | } |
412 | 427 | ||
413 | MACHINE_START(REALVIEW_EB, "ARM-RealView EB") | 428 | MACHINE_START(REALVIEW_EB, "ARM-RealView EB") |
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index 7fb726d5f8b9..44392e51dd50 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -292,12 +292,10 @@ static struct sys_timer realview_pb1176_timer = { | |||
292 | 292 | ||
293 | static void realview_pb1176_reset(char mode) | 293 | static void realview_pb1176_reset(char mode) |
294 | { | 294 | { |
295 | void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + | 295 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); |
296 | REALVIEW_SYS_RESETCTL_OFFSET; | 296 | void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); |
297 | void __iomem *rst_hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + | 297 | __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); |
298 | REALVIEW_SYS_LOCK_OFFSET; | 298 | __raw_writel(REALVIEW_PB1176_SYS_SOFT_RESET, reset_ctrl); |
299 | __raw_writel(REALVIEW_SYS_LOCKVAL_MASK, rst_hdr_ctrl); | ||
300 | __raw_writel(REALVIEW_PB1176_SYS_LOCKVAL_RSTCTL, hdr_ctrl); | ||
301 | } | 299 | } |
302 | 300 | ||
303 | static void realview_pb1176_fixup(struct machine_desc *mdesc, | 301 | static void realview_pb1176_fixup(struct machine_desc *mdesc, |
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index 9bbbfc05f225..3e02731af959 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -301,17 +301,16 @@ static struct sys_timer realview_pb11mp_timer = { | |||
301 | 301 | ||
302 | static void realview_pb11mp_reset(char mode) | 302 | static void realview_pb11mp_reset(char mode) |
303 | { | 303 | { |
304 | void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + | 304 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); |
305 | REALVIEW_SYS_RESETCTL_OFFSET; | 305 | void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); |
306 | unsigned int val; | ||
307 | 306 | ||
308 | /* | 307 | /* |
309 | * To reset, we hit the on-board reset register | 308 | * To reset, we hit the on-board reset register |
310 | * in the system FPGA | 309 | * in the system FPGA |
311 | */ | 310 | */ |
312 | val = __raw_readl(hdr_ctrl); | 311 | __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); |
313 | val |= REALVIEW_PB11MP_SYS_CTRL_RESET_CONFIGCLR; | 312 | __raw_writel(0x0000, reset_ctrl); |
314 | __raw_writel(val, hdr_ctrl); | 313 | __raw_writel(0x0004, reset_ctrl); |
315 | } | 314 | } |
316 | 315 | ||
317 | static void __init realview_pb11mp_init(void) | 316 | static void __init realview_pb11mp_init(void) |
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index fe861e96c566..fe4e25c4201a 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
@@ -272,6 +272,20 @@ static struct sys_timer realview_pba8_timer = { | |||
272 | .init = realview_pba8_timer_init, | 272 | .init = realview_pba8_timer_init, |
273 | }; | 273 | }; |
274 | 274 | ||
275 | static void realview_pba8_reset(char mode) | ||
276 | { | ||
277 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); | ||
278 | void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); | ||
279 | |||
280 | /* | ||
281 | * To reset, we hit the on-board reset register | ||
282 | * in the system FPGA | ||
283 | */ | ||
284 | __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); | ||
285 | __raw_writel(0x0000, reset_ctrl); | ||
286 | __raw_writel(0x0004, reset_ctrl); | ||
287 | } | ||
288 | |||
275 | static void __init realview_pba8_init(void) | 289 | static void __init realview_pba8_init(void) |
276 | { | 290 | { |
277 | int i; | 291 | int i; |
@@ -291,6 +305,7 @@ static void __init realview_pba8_init(void) | |||
291 | #ifdef CONFIG_LEDS | 305 | #ifdef CONFIG_LEDS |
292 | leds_event = realview_leds_event; | 306 | leds_event = realview_leds_event; |
293 | #endif | 307 | #endif |
308 | realview_reset = realview_pba8_reset; | ||
294 | } | 309 | } |
295 | 310 | ||
296 | MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8") | 311 | MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8") |
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c index ec39488e2b42..a21a4b395f73 100644 --- a/arch/arm/mach-realview/realview_pbx.c +++ b/arch/arm/mach-realview/realview_pbx.c | |||
@@ -324,6 +324,20 @@ static void realview_pbx_fixup(struct machine_desc *mdesc, struct tag *tags, | |||
324 | #endif | 324 | #endif |
325 | } | 325 | } |
326 | 326 | ||
327 | static void realview_pbx_reset(char mode) | ||
328 | { | ||
329 | void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL); | ||
330 | void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK); | ||
331 | |||
332 | /* | ||
333 | * To reset, we hit the on-board reset register | ||
334 | * in the system FPGA | ||
335 | */ | ||
336 | __raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl); | ||
337 | __raw_writel(0x0000, reset_ctrl); | ||
338 | __raw_writel(0x0004, reset_ctrl); | ||
339 | } | ||
340 | |||
327 | static void __init realview_pbx_init(void) | 341 | static void __init realview_pbx_init(void) |
328 | { | 342 | { |
329 | int i; | 343 | int i; |
@@ -358,6 +372,7 @@ static void __init realview_pbx_init(void) | |||
358 | #ifdef CONFIG_LEDS | 372 | #ifdef CONFIG_LEDS |
359 | leds_event = realview_leds_event; | 373 | leds_event = realview_leds_event; |
360 | #endif | 374 | #endif |
375 | realview_reset = realview_pbx_reset; | ||
361 | } | 376 | } |
362 | 377 | ||
363 | MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") | 378 | MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") |
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c index 547d4fc99131..2068e9096a43 100644 --- a/arch/arm/mach-s3c2440/mach-mini2440.c +++ b/arch/arm/mach-s3c2440/mach-mini2440.c | |||
@@ -288,7 +288,7 @@ static struct s3c2410_platform_nand mini2440_nand_info __initdata = { | |||
288 | 288 | ||
289 | /* DM9000AEP 10/100 ethernet controller */ | 289 | /* DM9000AEP 10/100 ethernet controller */ |
290 | 290 | ||
291 | static struct resource mini2440_dm9k_resource[] __initdata = { | 291 | static struct resource mini2440_dm9k_resource[] = { |
292 | [0] = { | 292 | [0] = { |
293 | .start = MACH_MINI2440_DM9K_BASE, | 293 | .start = MACH_MINI2440_DM9K_BASE, |
294 | .end = MACH_MINI2440_DM9K_BASE + 3, | 294 | .end = MACH_MINI2440_DM9K_BASE + 3, |
@@ -310,11 +310,11 @@ static struct resource mini2440_dm9k_resource[] __initdata = { | |||
310 | * The DM9000 has no eeprom, and it's MAC address is set by | 310 | * The DM9000 has no eeprom, and it's MAC address is set by |
311 | * the bootloader before starting the kernel. | 311 | * the bootloader before starting the kernel. |
312 | */ | 312 | */ |
313 | static struct dm9000_plat_data mini2440_dm9k_pdata __initdata = { | 313 | static struct dm9000_plat_data mini2440_dm9k_pdata = { |
314 | .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), | 314 | .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), |
315 | }; | 315 | }; |
316 | 316 | ||
317 | static struct platform_device mini2440_device_eth __initdata = { | 317 | static struct platform_device mini2440_device_eth = { |
318 | .name = "dm9000", | 318 | .name = "dm9000", |
319 | .id = -1, | 319 | .id = -1, |
320 | .num_resources = ARRAY_SIZE(mini2440_dm9k_resource), | 320 | .num_resources = ARRAY_SIZE(mini2440_dm9k_resource), |
@@ -341,7 +341,7 @@ static struct platform_device mini2440_device_eth __initdata = { | |||
341 | * | | +----+ +----+ | 341 | * | | +----+ +----+ |
342 | * ..... | 342 | * ..... |
343 | */ | 343 | */ |
344 | static struct gpio_keys_button mini2440_buttons[] __initdata = { | 344 | static struct gpio_keys_button mini2440_buttons[] = { |
345 | { | 345 | { |
346 | .gpio = S3C2410_GPG(0), /* K1 */ | 346 | .gpio = S3C2410_GPG(0), /* K1 */ |
347 | .code = KEY_F1, | 347 | .code = KEY_F1, |
@@ -384,12 +384,12 @@ static struct gpio_keys_button mini2440_buttons[] __initdata = { | |||
384 | #endif | 384 | #endif |
385 | }; | 385 | }; |
386 | 386 | ||
387 | static struct gpio_keys_platform_data mini2440_button_data __initdata = { | 387 | static struct gpio_keys_platform_data mini2440_button_data = { |
388 | .buttons = mini2440_buttons, | 388 | .buttons = mini2440_buttons, |
389 | .nbuttons = ARRAY_SIZE(mini2440_buttons), | 389 | .nbuttons = ARRAY_SIZE(mini2440_buttons), |
390 | }; | 390 | }; |
391 | 391 | ||
392 | static struct platform_device mini2440_button_device __initdata = { | 392 | static struct platform_device mini2440_button_device = { |
393 | .name = "gpio-keys", | 393 | .name = "gpio-keys", |
394 | .id = -1, | 394 | .id = -1, |
395 | .dev = { | 395 | .dev = { |
@@ -399,41 +399,41 @@ static struct platform_device mini2440_button_device __initdata = { | |||
399 | 399 | ||
400 | /* LEDS */ | 400 | /* LEDS */ |
401 | 401 | ||
402 | static struct s3c24xx_led_platdata mini2440_led1_pdata __initdata = { | 402 | static struct s3c24xx_led_platdata mini2440_led1_pdata = { |
403 | .name = "led1", | 403 | .name = "led1", |
404 | .gpio = S3C2410_GPB(5), | 404 | .gpio = S3C2410_GPB(5), |
405 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | 405 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, |
406 | .def_trigger = "heartbeat", | 406 | .def_trigger = "heartbeat", |
407 | }; | 407 | }; |
408 | 408 | ||
409 | static struct s3c24xx_led_platdata mini2440_led2_pdata __initdata = { | 409 | static struct s3c24xx_led_platdata mini2440_led2_pdata = { |
410 | .name = "led2", | 410 | .name = "led2", |
411 | .gpio = S3C2410_GPB(6), | 411 | .gpio = S3C2410_GPB(6), |
412 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | 412 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, |
413 | .def_trigger = "nand-disk", | 413 | .def_trigger = "nand-disk", |
414 | }; | 414 | }; |
415 | 415 | ||
416 | static struct s3c24xx_led_platdata mini2440_led3_pdata __initdata = { | 416 | static struct s3c24xx_led_platdata mini2440_led3_pdata = { |
417 | .name = "led3", | 417 | .name = "led3", |
418 | .gpio = S3C2410_GPB(7), | 418 | .gpio = S3C2410_GPB(7), |
419 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | 419 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, |
420 | .def_trigger = "mmc0", | 420 | .def_trigger = "mmc0", |
421 | }; | 421 | }; |
422 | 422 | ||
423 | static struct s3c24xx_led_platdata mini2440_led4_pdata __initdata = { | 423 | static struct s3c24xx_led_platdata mini2440_led4_pdata = { |
424 | .name = "led4", | 424 | .name = "led4", |
425 | .gpio = S3C2410_GPB(8), | 425 | .gpio = S3C2410_GPB(8), |
426 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | 426 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, |
427 | .def_trigger = "", | 427 | .def_trigger = "", |
428 | }; | 428 | }; |
429 | 429 | ||
430 | static struct s3c24xx_led_platdata mini2440_led_backlight_pdata __initdata = { | 430 | static struct s3c24xx_led_platdata mini2440_led_backlight_pdata = { |
431 | .name = "backlight", | 431 | .name = "backlight", |
432 | .gpio = S3C2410_GPG(4), | 432 | .gpio = S3C2410_GPG(4), |
433 | .def_trigger = "backlight", | 433 | .def_trigger = "backlight", |
434 | }; | 434 | }; |
435 | 435 | ||
436 | static struct platform_device mini2440_led1 __initdata = { | 436 | static struct platform_device mini2440_led1 = { |
437 | .name = "s3c24xx_led", | 437 | .name = "s3c24xx_led", |
438 | .id = 1, | 438 | .id = 1, |
439 | .dev = { | 439 | .dev = { |
@@ -441,7 +441,7 @@ static struct platform_device mini2440_led1 __initdata = { | |||
441 | }, | 441 | }, |
442 | }; | 442 | }; |
443 | 443 | ||
444 | static struct platform_device mini2440_led2 __initdata = { | 444 | static struct platform_device mini2440_led2 = { |
445 | .name = "s3c24xx_led", | 445 | .name = "s3c24xx_led", |
446 | .id = 2, | 446 | .id = 2, |
447 | .dev = { | 447 | .dev = { |
@@ -449,7 +449,7 @@ static struct platform_device mini2440_led2 __initdata = { | |||
449 | }, | 449 | }, |
450 | }; | 450 | }; |
451 | 451 | ||
452 | static struct platform_device mini2440_led3 __initdata = { | 452 | static struct platform_device mini2440_led3 = { |
453 | .name = "s3c24xx_led", | 453 | .name = "s3c24xx_led", |
454 | .id = 3, | 454 | .id = 3, |
455 | .dev = { | 455 | .dev = { |
@@ -457,7 +457,7 @@ static struct platform_device mini2440_led3 __initdata = { | |||
457 | }, | 457 | }, |
458 | }; | 458 | }; |
459 | 459 | ||
460 | static struct platform_device mini2440_led4 __initdata = { | 460 | static struct platform_device mini2440_led4 = { |
461 | .name = "s3c24xx_led", | 461 | .name = "s3c24xx_led", |
462 | .id = 4, | 462 | .id = 4, |
463 | .dev = { | 463 | .dev = { |
@@ -465,7 +465,7 @@ static struct platform_device mini2440_led4 __initdata = { | |||
465 | }, | 465 | }, |
466 | }; | 466 | }; |
467 | 467 | ||
468 | static struct platform_device mini2440_led_backlight __initdata = { | 468 | static struct platform_device mini2440_led_backlight = { |
469 | .name = "s3c24xx_led", | 469 | .name = "s3c24xx_led", |
470 | .id = 5, | 470 | .id = 5, |
471 | .dev = { | 471 | .dev = { |
@@ -475,14 +475,14 @@ static struct platform_device mini2440_led_backlight __initdata = { | |||
475 | 475 | ||
476 | /* AUDIO */ | 476 | /* AUDIO */ |
477 | 477 | ||
478 | static struct s3c24xx_uda134x_platform_data mini2440_audio_pins __initdata = { | 478 | static struct s3c24xx_uda134x_platform_data mini2440_audio_pins = { |
479 | .l3_clk = S3C2410_GPB(4), | 479 | .l3_clk = S3C2410_GPB(4), |
480 | .l3_mode = S3C2410_GPB(2), | 480 | .l3_mode = S3C2410_GPB(2), |
481 | .l3_data = S3C2410_GPB(3), | 481 | .l3_data = S3C2410_GPB(3), |
482 | .model = UDA134X_UDA1341 | 482 | .model = UDA134X_UDA1341 |
483 | }; | 483 | }; |
484 | 484 | ||
485 | static struct platform_device mini2440_audio __initdata = { | 485 | static struct platform_device mini2440_audio = { |
486 | .name = "s3c24xx_uda134x", | 486 | .name = "s3c24xx_uda134x", |
487 | .id = 0, | 487 | .id = 0, |
488 | .dev = { | 488 | .dev = { |
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index 480d297c1de2..8969fe73b83f 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c | |||
@@ -211,6 +211,7 @@ static struct fixed_voltage_config smdk6410_b_pwr_5v_pdata = { | |||
211 | .supply_name = "B_PWR_5V", | 211 | .supply_name = "B_PWR_5V", |
212 | .microvolts = 5000000, | 212 | .microvolts = 5000000, |
213 | .init_data = &smdk6410_b_pwr_5v_data, | 213 | .init_data = &smdk6410_b_pwr_5v_data, |
214 | .gpio = -EINVAL, | ||
214 | }; | 215 | }; |
215 | 216 | ||
216 | static struct platform_device smdk6410_b_pwr_5v = { | 217 | static struct platform_device smdk6410_b_pwr_5v = { |
diff --git a/arch/arm/mach-u300/clock.c b/arch/arm/mach-u300/clock.c index 111f7ea32b38..36ffd6a8b34c 100644 --- a/arch/arm/mach-u300/clock.c +++ b/arch/arm/mach-u300/clock.c | |||
@@ -610,34 +610,34 @@ EXPORT_SYMBOL(clk_get_rate); | |||
610 | 610 | ||
611 | static unsigned long clk_round_rate_mclk(struct clk *clk, unsigned long rate) | 611 | static unsigned long clk_round_rate_mclk(struct clk *clk, unsigned long rate) |
612 | { | 612 | { |
613 | if (rate >= 18900000) | 613 | if (rate <= 18900000) |
614 | return 18900000; | 614 | return 18900000; |
615 | if (rate >= 20800000) | 615 | if (rate <= 20800000) |
616 | return 20800000; | 616 | return 20800000; |
617 | if (rate >= 23100000) | 617 | if (rate <= 23100000) |
618 | return 23100000; | 618 | return 23100000; |
619 | if (rate >= 26000000) | 619 | if (rate <= 26000000) |
620 | return 26000000; | 620 | return 26000000; |
621 | if (rate >= 29700000) | 621 | if (rate <= 29700000) |
622 | return 29700000; | 622 | return 29700000; |
623 | if (rate >= 34700000) | 623 | if (rate <= 34700000) |
624 | return 34700000; | 624 | return 34700000; |
625 | if (rate >= 41600000) | 625 | if (rate <= 41600000) |
626 | return 41600000; | 626 | return 41600000; |
627 | if (rate >= 52000000) | 627 | if (rate <= 52000000) |
628 | return 52000000; | 628 | return 52000000; |
629 | return -EINVAL; | 629 | return -EINVAL; |
630 | } | 630 | } |
631 | 631 | ||
632 | static unsigned long clk_round_rate_cpuclk(struct clk *clk, unsigned long rate) | 632 | static unsigned long clk_round_rate_cpuclk(struct clk *clk, unsigned long rate) |
633 | { | 633 | { |
634 | if (rate >= 13000000) | 634 | if (rate <= 13000000) |
635 | return 13000000; | 635 | return 13000000; |
636 | if (rate >= 52000000) | 636 | if (rate <= 52000000) |
637 | return 52000000; | 637 | return 52000000; |
638 | if (rate >= 104000000) | 638 | if (rate <= 104000000) |
639 | return 104000000; | 639 | return 104000000; |
640 | if (rate >= 208000000) | 640 | if (rate <= 208000000) |
641 | return 208000000; | 641 | return 208000000; |
642 | return -EINVAL; | 642 | return -EINVAL; |
643 | } | 643 | } |
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c index 653e25be3dd8..01b50313914c 100644 --- a/arch/arm/mach-u300/core.c +++ b/arch/arm/mach-u300/core.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * arch/arm/mach-u300/core.c | 3 | * arch/arm/mach-u300/core.c |
4 | * | 4 | * |
5 | * | 5 | * |
6 | * Copyright (C) 2007-2009 ST-Ericsson AB | 6 | * Copyright (C) 2007-2010 ST-Ericsson AB |
7 | * License terms: GNU General Public License (GPL) version 2 | 7 | * License terms: GNU General Public License (GPL) version 2 |
8 | * Core platform support, IRQ handling and device definitions. | 8 | * Core platform support, IRQ handling and device definitions. |
9 | * Author: Linus Walleij <linus.walleij@stericsson.com> | 9 | * Author: Linus Walleij <linus.walleij@stericsson.com> |
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/amba/bus.h> | 19 | #include <linux/amba/bus.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <mach/coh901318.h> | ||
22 | 23 | ||
23 | #include <asm/types.h> | 24 | #include <asm/types.h> |
24 | #include <asm/setup.h> | 25 | #include <asm/setup.h> |
@@ -29,6 +30,7 @@ | |||
29 | 30 | ||
30 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
31 | #include <mach/syscon.h> | 32 | #include <mach/syscon.h> |
33 | #include <mach/dma_channels.h> | ||
32 | 34 | ||
33 | #include "clock.h" | 35 | #include "clock.h" |
34 | #include "mmc.h" | 36 | #include "mmc.h" |
@@ -372,8 +374,1019 @@ static struct resource ave_resources[] = { | |||
372 | }, | 374 | }, |
373 | }; | 375 | }; |
374 | 376 | ||
377 | static struct resource dma_resource[] = { | ||
378 | { | ||
379 | .start = U300_DMAC_BASE, | ||
380 | .end = U300_DMAC_BASE + PAGE_SIZE - 1, | ||
381 | .flags = IORESOURCE_MEM, | ||
382 | }, | ||
383 | { | ||
384 | .start = IRQ_U300_DMA, | ||
385 | .end = IRQ_U300_DMA, | ||
386 | .flags = IORESOURCE_IRQ, | ||
387 | } | ||
388 | }; | ||
389 | |||
390 | #ifdef CONFIG_MACH_U300_BS335 | ||
391 | /* points out all dma slave channels. | ||
392 | * Syntax is [A1, B1, A2, B2, .... ,-1,-1] | ||
393 | * Select all channels from A to B, end of list is marked with -1,-1 | ||
394 | */ | ||
395 | static int dma_slave_channels[] = { | ||
396 | U300_DMA_MSL_TX_0, U300_DMA_SPI_RX, | ||
397 | U300_DMA_UART1_TX, U300_DMA_UART1_RX, -1, -1}; | ||
398 | |||
399 | /* points out all dma memcpy channels. */ | ||
400 | static int dma_memcpy_channels[] = { | ||
401 | U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_8, -1, -1}; | ||
402 | |||
403 | #else /* CONFIG_MACH_U300_BS335 */ | ||
404 | |||
405 | static int dma_slave_channels[] = {U300_DMA_MSL_TX_0, U300_DMA_SPI_RX, -1, -1}; | ||
406 | static int dma_memcpy_channels[] = { | ||
407 | U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_10, -1, -1}; | ||
408 | |||
409 | #endif | ||
410 | |||
411 | /** register dma for memory access | ||
412 | * | ||
413 | * active 1 means dma intends to access memory | ||
414 | * 0 means dma wont access memory | ||
415 | */ | ||
416 | static void coh901318_access_memory_state(struct device *dev, bool active) | ||
417 | { | ||
418 | } | ||
419 | |||
420 | #define flags_memcpy_config (COH901318_CX_CFG_CH_DISABLE | \ | ||
421 | COH901318_CX_CFG_RM_MEMORY_TO_MEMORY | \ | ||
422 | COH901318_CX_CFG_LCR_DISABLE | \ | ||
423 | COH901318_CX_CFG_TC_IRQ_ENABLE | \ | ||
424 | COH901318_CX_CFG_BE_IRQ_ENABLE) | ||
425 | #define flags_memcpy_lli_chained (COH901318_CX_CTRL_TC_ENABLE | \ | ||
426 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \ | ||
427 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \ | ||
428 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \ | ||
429 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \ | ||
430 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \ | ||
431 | COH901318_CX_CTRL_MASTER_MODE_M1RW | \ | ||
432 | COH901318_CX_CTRL_TCP_DISABLE | \ | ||
433 | COH901318_CX_CTRL_TC_IRQ_DISABLE | \ | ||
434 | COH901318_CX_CTRL_HSP_DISABLE | \ | ||
435 | COH901318_CX_CTRL_HSS_DISABLE | \ | ||
436 | COH901318_CX_CTRL_DDMA_LEGACY | \ | ||
437 | COH901318_CX_CTRL_PRDD_SOURCE) | ||
438 | #define flags_memcpy_lli (COH901318_CX_CTRL_TC_ENABLE | \ | ||
439 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \ | ||
440 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \ | ||
441 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \ | ||
442 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \ | ||
443 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \ | ||
444 | COH901318_CX_CTRL_MASTER_MODE_M1RW | \ | ||
445 | COH901318_CX_CTRL_TCP_DISABLE | \ | ||
446 | COH901318_CX_CTRL_TC_IRQ_DISABLE | \ | ||
447 | COH901318_CX_CTRL_HSP_DISABLE | \ | ||
448 | COH901318_CX_CTRL_HSS_DISABLE | \ | ||
449 | COH901318_CX_CTRL_DDMA_LEGACY | \ | ||
450 | COH901318_CX_CTRL_PRDD_SOURCE) | ||
451 | #define flags_memcpy_lli_last (COH901318_CX_CTRL_TC_ENABLE | \ | ||
452 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \ | ||
453 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \ | ||
454 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \ | ||
455 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \ | ||
456 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \ | ||
457 | COH901318_CX_CTRL_MASTER_MODE_M1RW | \ | ||
458 | COH901318_CX_CTRL_TCP_DISABLE | \ | ||
459 | COH901318_CX_CTRL_TC_IRQ_ENABLE | \ | ||
460 | COH901318_CX_CTRL_HSP_DISABLE | \ | ||
461 | COH901318_CX_CTRL_HSS_DISABLE | \ | ||
462 | COH901318_CX_CTRL_DDMA_LEGACY | \ | ||
463 | COH901318_CX_CTRL_PRDD_SOURCE) | ||
464 | |||
465 | const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = { | ||
466 | { | ||
467 | .number = U300_DMA_MSL_TX_0, | ||
468 | .name = "MSL TX 0", | ||
469 | .priority_high = 0, | ||
470 | .dev_addr = U300_MSL_BASE + 0 * 0x40 + 0x20, | ||
471 | }, | ||
472 | { | ||
473 | .number = U300_DMA_MSL_TX_1, | ||
474 | .name = "MSL TX 1", | ||
475 | .priority_high = 0, | ||
476 | .dev_addr = U300_MSL_BASE + 1 * 0x40 + 0x20, | ||
477 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
478 | COH901318_CX_CFG_LCR_DISABLE | | ||
479 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
480 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
481 | .param.ctrl_lli_chained = 0 | | ||
482 | COH901318_CX_CTRL_TC_ENABLE | | ||
483 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
484 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
485 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
486 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
487 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
488 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
489 | COH901318_CX_CTRL_TCP_DISABLE | | ||
490 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
491 | COH901318_CX_CTRL_HSP_ENABLE | | ||
492 | COH901318_CX_CTRL_HSS_DISABLE | | ||
493 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
494 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
495 | .param.ctrl_lli = 0 | | ||
496 | COH901318_CX_CTRL_TC_ENABLE | | ||
497 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
498 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
499 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
500 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
501 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
502 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
503 | COH901318_CX_CTRL_TCP_ENABLE | | ||
504 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
505 | COH901318_CX_CTRL_HSP_ENABLE | | ||
506 | COH901318_CX_CTRL_HSS_DISABLE | | ||
507 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
508 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
509 | .param.ctrl_lli_last = 0 | | ||
510 | COH901318_CX_CTRL_TC_ENABLE | | ||
511 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
512 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
513 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
514 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
515 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
516 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
517 | COH901318_CX_CTRL_TCP_ENABLE | | ||
518 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
519 | COH901318_CX_CTRL_HSP_ENABLE | | ||
520 | COH901318_CX_CTRL_HSS_DISABLE | | ||
521 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
522 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
523 | }, | ||
524 | { | ||
525 | .number = U300_DMA_MSL_TX_2, | ||
526 | .name = "MSL TX 2", | ||
527 | .priority_high = 0, | ||
528 | .dev_addr = U300_MSL_BASE + 2 * 0x40 + 0x20, | ||
529 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
530 | COH901318_CX_CFG_LCR_DISABLE | | ||
531 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
532 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
533 | .param.ctrl_lli_chained = 0 | | ||
534 | COH901318_CX_CTRL_TC_ENABLE | | ||
535 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
536 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
537 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
538 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
539 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
540 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
541 | COH901318_CX_CTRL_TCP_DISABLE | | ||
542 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
543 | COH901318_CX_CTRL_HSP_ENABLE | | ||
544 | COH901318_CX_CTRL_HSS_DISABLE | | ||
545 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
546 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
547 | .param.ctrl_lli = 0 | | ||
548 | COH901318_CX_CTRL_TC_ENABLE | | ||
549 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
550 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
551 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
552 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
553 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
554 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
555 | COH901318_CX_CTRL_TCP_ENABLE | | ||
556 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
557 | COH901318_CX_CTRL_HSP_ENABLE | | ||
558 | COH901318_CX_CTRL_HSS_DISABLE | | ||
559 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
560 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
561 | .param.ctrl_lli_last = 0 | | ||
562 | COH901318_CX_CTRL_TC_ENABLE | | ||
563 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
564 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
565 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
566 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
567 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
568 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
569 | COH901318_CX_CTRL_TCP_ENABLE | | ||
570 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
571 | COH901318_CX_CTRL_HSP_ENABLE | | ||
572 | COH901318_CX_CTRL_HSS_DISABLE | | ||
573 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
574 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
575 | .desc_nbr_max = 10, | ||
576 | }, | ||
577 | { | ||
578 | .number = U300_DMA_MSL_TX_3, | ||
579 | .name = "MSL TX 3", | ||
580 | .priority_high = 0, | ||
581 | .dev_addr = U300_MSL_BASE + 3 * 0x40 + 0x20, | ||
582 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
583 | COH901318_CX_CFG_LCR_DISABLE | | ||
584 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
585 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
586 | .param.ctrl_lli_chained = 0 | | ||
587 | COH901318_CX_CTRL_TC_ENABLE | | ||
588 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
589 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
590 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
591 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
592 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
593 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
594 | COH901318_CX_CTRL_TCP_DISABLE | | ||
595 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
596 | COH901318_CX_CTRL_HSP_ENABLE | | ||
597 | COH901318_CX_CTRL_HSS_DISABLE | | ||
598 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
599 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
600 | .param.ctrl_lli = 0 | | ||
601 | COH901318_CX_CTRL_TC_ENABLE | | ||
602 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
603 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
604 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
605 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
606 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
607 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
608 | COH901318_CX_CTRL_TCP_ENABLE | | ||
609 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
610 | COH901318_CX_CTRL_HSP_ENABLE | | ||
611 | COH901318_CX_CTRL_HSS_DISABLE | | ||
612 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
613 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
614 | .param.ctrl_lli_last = 0 | | ||
615 | COH901318_CX_CTRL_TC_ENABLE | | ||
616 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
617 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
618 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
619 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
620 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
621 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
622 | COH901318_CX_CTRL_TCP_ENABLE | | ||
623 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
624 | COH901318_CX_CTRL_HSP_ENABLE | | ||
625 | COH901318_CX_CTRL_HSS_DISABLE | | ||
626 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
627 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
628 | }, | ||
629 | { | ||
630 | .number = U300_DMA_MSL_TX_4, | ||
631 | .name = "MSL TX 4", | ||
632 | .priority_high = 0, | ||
633 | .dev_addr = U300_MSL_BASE + 4 * 0x40 + 0x20, | ||
634 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
635 | COH901318_CX_CFG_LCR_DISABLE | | ||
636 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
637 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
638 | .param.ctrl_lli_chained = 0 | | ||
639 | COH901318_CX_CTRL_TC_ENABLE | | ||
640 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
641 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
642 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
643 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
644 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
645 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
646 | COH901318_CX_CTRL_TCP_DISABLE | | ||
647 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
648 | COH901318_CX_CTRL_HSP_ENABLE | | ||
649 | COH901318_CX_CTRL_HSS_DISABLE | | ||
650 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
651 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
652 | .param.ctrl_lli = 0 | | ||
653 | COH901318_CX_CTRL_TC_ENABLE | | ||
654 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
655 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
656 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
657 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
658 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
659 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
660 | COH901318_CX_CTRL_TCP_ENABLE | | ||
661 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
662 | COH901318_CX_CTRL_HSP_ENABLE | | ||
663 | COH901318_CX_CTRL_HSS_DISABLE | | ||
664 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
665 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
666 | .param.ctrl_lli_last = 0 | | ||
667 | COH901318_CX_CTRL_TC_ENABLE | | ||
668 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
669 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
670 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
671 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
672 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
673 | COH901318_CX_CTRL_MASTER_MODE_M1R_M2W | | ||
674 | COH901318_CX_CTRL_TCP_ENABLE | | ||
675 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
676 | COH901318_CX_CTRL_HSP_ENABLE | | ||
677 | COH901318_CX_CTRL_HSS_DISABLE | | ||
678 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
679 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
680 | }, | ||
681 | { | ||
682 | .number = U300_DMA_MSL_TX_5, | ||
683 | .name = "MSL TX 5", | ||
684 | .priority_high = 0, | ||
685 | .dev_addr = U300_MSL_BASE + 5 * 0x40 + 0x20, | ||
686 | }, | ||
687 | { | ||
688 | .number = U300_DMA_MSL_TX_6, | ||
689 | .name = "MSL TX 6", | ||
690 | .priority_high = 0, | ||
691 | .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x20, | ||
692 | }, | ||
693 | { | ||
694 | .number = U300_DMA_MSL_RX_0, | ||
695 | .name = "MSL RX 0", | ||
696 | .priority_high = 0, | ||
697 | .dev_addr = U300_MSL_BASE + 0 * 0x40 + 0x220, | ||
698 | }, | ||
699 | { | ||
700 | .number = U300_DMA_MSL_RX_1, | ||
701 | .name = "MSL RX 1", | ||
702 | .priority_high = 0, | ||
703 | .dev_addr = U300_MSL_BASE + 1 * 0x40 + 0x220, | ||
704 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
705 | COH901318_CX_CFG_LCR_DISABLE | | ||
706 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
707 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
708 | .param.ctrl_lli_chained = 0 | | ||
709 | COH901318_CX_CTRL_TC_ENABLE | | ||
710 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
711 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
712 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
713 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
714 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
715 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
716 | COH901318_CX_CTRL_TCP_DISABLE | | ||
717 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
718 | COH901318_CX_CTRL_HSP_ENABLE | | ||
719 | COH901318_CX_CTRL_HSS_DISABLE | | ||
720 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
721 | COH901318_CX_CTRL_PRDD_DEST, | ||
722 | .param.ctrl_lli = 0, | ||
723 | .param.ctrl_lli_last = 0 | | ||
724 | COH901318_CX_CTRL_TC_ENABLE | | ||
725 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
726 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
727 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
728 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
729 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
730 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
731 | COH901318_CX_CTRL_TCP_DISABLE | | ||
732 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
733 | COH901318_CX_CTRL_HSP_ENABLE | | ||
734 | COH901318_CX_CTRL_HSS_DISABLE | | ||
735 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
736 | COH901318_CX_CTRL_PRDD_DEST, | ||
737 | }, | ||
738 | { | ||
739 | .number = U300_DMA_MSL_RX_2, | ||
740 | .name = "MSL RX 2", | ||
741 | .priority_high = 0, | ||
742 | .dev_addr = U300_MSL_BASE + 2 * 0x40 + 0x220, | ||
743 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
744 | COH901318_CX_CFG_LCR_DISABLE | | ||
745 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
746 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
747 | .param.ctrl_lli_chained = 0 | | ||
748 | COH901318_CX_CTRL_TC_ENABLE | | ||
749 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
750 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
751 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
752 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
753 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
754 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
755 | COH901318_CX_CTRL_TCP_DISABLE | | ||
756 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
757 | COH901318_CX_CTRL_HSP_ENABLE | | ||
758 | COH901318_CX_CTRL_HSS_DISABLE | | ||
759 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
760 | COH901318_CX_CTRL_PRDD_DEST, | ||
761 | .param.ctrl_lli = 0 | | ||
762 | COH901318_CX_CTRL_TC_ENABLE | | ||
763 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
764 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
765 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
766 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
767 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
768 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
769 | COH901318_CX_CTRL_TCP_DISABLE | | ||
770 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
771 | COH901318_CX_CTRL_HSP_ENABLE | | ||
772 | COH901318_CX_CTRL_HSS_DISABLE | | ||
773 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
774 | COH901318_CX_CTRL_PRDD_DEST, | ||
775 | .param.ctrl_lli_last = 0 | | ||
776 | COH901318_CX_CTRL_TC_ENABLE | | ||
777 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
778 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
779 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
780 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
781 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
782 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
783 | COH901318_CX_CTRL_TCP_DISABLE | | ||
784 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
785 | COH901318_CX_CTRL_HSP_ENABLE | | ||
786 | COH901318_CX_CTRL_HSS_DISABLE | | ||
787 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
788 | COH901318_CX_CTRL_PRDD_DEST, | ||
789 | }, | ||
790 | { | ||
791 | .number = U300_DMA_MSL_RX_3, | ||
792 | .name = "MSL RX 3", | ||
793 | .priority_high = 0, | ||
794 | .dev_addr = U300_MSL_BASE + 3 * 0x40 + 0x220, | ||
795 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
796 | COH901318_CX_CFG_LCR_DISABLE | | ||
797 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
798 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
799 | .param.ctrl_lli_chained = 0 | | ||
800 | COH901318_CX_CTRL_TC_ENABLE | | ||
801 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
802 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
803 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
804 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
805 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
806 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
807 | COH901318_CX_CTRL_TCP_DISABLE | | ||
808 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
809 | COH901318_CX_CTRL_HSP_ENABLE | | ||
810 | COH901318_CX_CTRL_HSS_DISABLE | | ||
811 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
812 | COH901318_CX_CTRL_PRDD_DEST, | ||
813 | .param.ctrl_lli = 0 | | ||
814 | COH901318_CX_CTRL_TC_ENABLE | | ||
815 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
816 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
817 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
818 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
819 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
820 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
821 | COH901318_CX_CTRL_TCP_DISABLE | | ||
822 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
823 | COH901318_CX_CTRL_HSP_ENABLE | | ||
824 | COH901318_CX_CTRL_HSS_DISABLE | | ||
825 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
826 | COH901318_CX_CTRL_PRDD_DEST, | ||
827 | .param.ctrl_lli_last = 0 | | ||
828 | COH901318_CX_CTRL_TC_ENABLE | | ||
829 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
830 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
831 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
832 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
833 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
834 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
835 | COH901318_CX_CTRL_TCP_DISABLE | | ||
836 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
837 | COH901318_CX_CTRL_HSP_ENABLE | | ||
838 | COH901318_CX_CTRL_HSS_DISABLE | | ||
839 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
840 | COH901318_CX_CTRL_PRDD_DEST, | ||
841 | }, | ||
842 | { | ||
843 | .number = U300_DMA_MSL_RX_4, | ||
844 | .name = "MSL RX 4", | ||
845 | .priority_high = 0, | ||
846 | .dev_addr = U300_MSL_BASE + 4 * 0x40 + 0x220, | ||
847 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
848 | COH901318_CX_CFG_LCR_DISABLE | | ||
849 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
850 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
851 | .param.ctrl_lli_chained = 0 | | ||
852 | COH901318_CX_CTRL_TC_ENABLE | | ||
853 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
854 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
855 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
856 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
857 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
858 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
859 | COH901318_CX_CTRL_TCP_DISABLE | | ||
860 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
861 | COH901318_CX_CTRL_HSP_ENABLE | | ||
862 | COH901318_CX_CTRL_HSS_DISABLE | | ||
863 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
864 | COH901318_CX_CTRL_PRDD_DEST, | ||
865 | .param.ctrl_lli = 0 | | ||
866 | COH901318_CX_CTRL_TC_ENABLE | | ||
867 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
868 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
869 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
870 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
871 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
872 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
873 | COH901318_CX_CTRL_TCP_DISABLE | | ||
874 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
875 | COH901318_CX_CTRL_HSP_ENABLE | | ||
876 | COH901318_CX_CTRL_HSS_DISABLE | | ||
877 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
878 | COH901318_CX_CTRL_PRDD_DEST, | ||
879 | .param.ctrl_lli_last = 0 | | ||
880 | COH901318_CX_CTRL_TC_ENABLE | | ||
881 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
882 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
883 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
884 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
885 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
886 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
887 | COH901318_CX_CTRL_TCP_DISABLE | | ||
888 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
889 | COH901318_CX_CTRL_HSP_ENABLE | | ||
890 | COH901318_CX_CTRL_HSS_DISABLE | | ||
891 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
892 | COH901318_CX_CTRL_PRDD_DEST, | ||
893 | }, | ||
894 | { | ||
895 | .number = U300_DMA_MSL_RX_5, | ||
896 | .name = "MSL RX 5", | ||
897 | .priority_high = 0, | ||
898 | .dev_addr = U300_MSL_BASE + 5 * 0x40 + 0x220, | ||
899 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
900 | COH901318_CX_CFG_LCR_DISABLE | | ||
901 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
902 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
903 | .param.ctrl_lli_chained = 0 | | ||
904 | COH901318_CX_CTRL_TC_ENABLE | | ||
905 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
906 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
907 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
908 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
909 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
910 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
911 | COH901318_CX_CTRL_TCP_DISABLE | | ||
912 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
913 | COH901318_CX_CTRL_HSP_ENABLE | | ||
914 | COH901318_CX_CTRL_HSS_DISABLE | | ||
915 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
916 | COH901318_CX_CTRL_PRDD_DEST, | ||
917 | .param.ctrl_lli = 0 | | ||
918 | COH901318_CX_CTRL_TC_ENABLE | | ||
919 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
920 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
921 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
922 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
923 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
924 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
925 | COH901318_CX_CTRL_TCP_DISABLE | | ||
926 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
927 | COH901318_CX_CTRL_HSP_ENABLE | | ||
928 | COH901318_CX_CTRL_HSS_DISABLE | | ||
929 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
930 | COH901318_CX_CTRL_PRDD_DEST, | ||
931 | .param.ctrl_lli_last = 0 | | ||
932 | COH901318_CX_CTRL_TC_ENABLE | | ||
933 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
934 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
935 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
936 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
937 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
938 | COH901318_CX_CTRL_MASTER_MODE_M2R_M1W | | ||
939 | COH901318_CX_CTRL_TCP_DISABLE | | ||
940 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
941 | COH901318_CX_CTRL_HSP_ENABLE | | ||
942 | COH901318_CX_CTRL_HSS_DISABLE | | ||
943 | COH901318_CX_CTRL_DDMA_DEMAND_DMA1 | | ||
944 | COH901318_CX_CTRL_PRDD_DEST, | ||
945 | }, | ||
946 | { | ||
947 | .number = U300_DMA_MSL_RX_6, | ||
948 | .name = "MSL RX 6", | ||
949 | .priority_high = 0, | ||
950 | .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x220, | ||
951 | }, | ||
952 | { | ||
953 | .number = U300_DMA_MMCSD_RX_TX, | ||
954 | .name = "MMCSD RX TX", | ||
955 | .priority_high = 0, | ||
956 | .dev_addr = U300_MMCSD_BASE + 0x080, | ||
957 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
958 | COH901318_CX_CFG_LCR_DISABLE | | ||
959 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
960 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
961 | .param.ctrl_lli_chained = 0 | | ||
962 | COH901318_CX_CTRL_TC_ENABLE | | ||
963 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
964 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
965 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
966 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
967 | COH901318_CX_CTRL_TCP_ENABLE | | ||
968 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
969 | COH901318_CX_CTRL_HSP_ENABLE | | ||
970 | COH901318_CX_CTRL_HSS_DISABLE | | ||
971 | COH901318_CX_CTRL_DDMA_LEGACY, | ||
972 | .param.ctrl_lli = 0 | | ||
973 | COH901318_CX_CTRL_TC_ENABLE | | ||
974 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
975 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
976 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
977 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
978 | COH901318_CX_CTRL_TCP_ENABLE | | ||
979 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
980 | COH901318_CX_CTRL_HSP_ENABLE | | ||
981 | COH901318_CX_CTRL_HSS_DISABLE | | ||
982 | COH901318_CX_CTRL_DDMA_LEGACY, | ||
983 | .param.ctrl_lli_last = 0 | | ||
984 | COH901318_CX_CTRL_TC_ENABLE | | ||
985 | COH901318_CX_CTRL_BURST_COUNT_32_BYTES | | ||
986 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
987 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
988 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
989 | COH901318_CX_CTRL_TCP_DISABLE | | ||
990 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
991 | COH901318_CX_CTRL_HSP_ENABLE | | ||
992 | COH901318_CX_CTRL_HSS_DISABLE | | ||
993 | COH901318_CX_CTRL_DDMA_LEGACY, | ||
994 | |||
995 | }, | ||
996 | { | ||
997 | .number = U300_DMA_MSPRO_TX, | ||
998 | .name = "MSPRO TX", | ||
999 | .priority_high = 0, | ||
1000 | }, | ||
1001 | { | ||
1002 | .number = U300_DMA_MSPRO_RX, | ||
1003 | .name = "MSPRO RX", | ||
1004 | .priority_high = 0, | ||
1005 | }, | ||
1006 | { | ||
1007 | .number = U300_DMA_UART0_TX, | ||
1008 | .name = "UART0 TX", | ||
1009 | .priority_high = 0, | ||
1010 | }, | ||
1011 | { | ||
1012 | .number = U300_DMA_UART0_RX, | ||
1013 | .name = "UART0 RX", | ||
1014 | .priority_high = 0, | ||
1015 | }, | ||
1016 | { | ||
1017 | .number = U300_DMA_APEX_TX, | ||
1018 | .name = "APEX TX", | ||
1019 | .priority_high = 0, | ||
1020 | }, | ||
1021 | { | ||
1022 | .number = U300_DMA_APEX_RX, | ||
1023 | .name = "APEX RX", | ||
1024 | .priority_high = 0, | ||
1025 | }, | ||
1026 | { | ||
1027 | .number = U300_DMA_PCM_I2S0_TX, | ||
1028 | .name = "PCM I2S0 TX", | ||
1029 | .priority_high = 1, | ||
1030 | .dev_addr = U300_PCM_I2S0_BASE + 0x14, | ||
1031 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
1032 | COH901318_CX_CFG_LCR_DISABLE | | ||
1033 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
1034 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
1035 | .param.ctrl_lli_chained = 0 | | ||
1036 | COH901318_CX_CTRL_TC_ENABLE | | ||
1037 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1038 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1039 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
1040 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1041 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
1042 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1043 | COH901318_CX_CTRL_TCP_DISABLE | | ||
1044 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
1045 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1046 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1047 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1048 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
1049 | .param.ctrl_lli = 0 | | ||
1050 | COH901318_CX_CTRL_TC_ENABLE | | ||
1051 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1052 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1053 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
1054 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1055 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
1056 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1057 | COH901318_CX_CTRL_TCP_ENABLE | | ||
1058 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
1059 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1060 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1061 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1062 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
1063 | .param.ctrl_lli_last = 0 | | ||
1064 | COH901318_CX_CTRL_TC_ENABLE | | ||
1065 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1066 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1067 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
1068 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1069 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
1070 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1071 | COH901318_CX_CTRL_TCP_ENABLE | | ||
1072 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
1073 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1074 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1075 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1076 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
1077 | }, | ||
1078 | { | ||
1079 | .number = U300_DMA_PCM_I2S0_RX, | ||
1080 | .name = "PCM I2S0 RX", | ||
1081 | .priority_high = 1, | ||
1082 | .dev_addr = U300_PCM_I2S0_BASE + 0x10, | ||
1083 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
1084 | COH901318_CX_CFG_LCR_DISABLE | | ||
1085 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
1086 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
1087 | .param.ctrl_lli_chained = 0 | | ||
1088 | COH901318_CX_CTRL_TC_ENABLE | | ||
1089 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1090 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1091 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
1092 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1093 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
1094 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1095 | COH901318_CX_CTRL_TCP_DISABLE | | ||
1096 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
1097 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1098 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1099 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1100 | COH901318_CX_CTRL_PRDD_DEST, | ||
1101 | .param.ctrl_lli = 0 | | ||
1102 | COH901318_CX_CTRL_TC_ENABLE | | ||
1103 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1104 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1105 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
1106 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1107 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
1108 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1109 | COH901318_CX_CTRL_TCP_ENABLE | | ||
1110 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
1111 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1112 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1113 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1114 | COH901318_CX_CTRL_PRDD_DEST, | ||
1115 | .param.ctrl_lli_last = 0 | | ||
1116 | COH901318_CX_CTRL_TC_ENABLE | | ||
1117 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1118 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1119 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
1120 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1121 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
1122 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1123 | COH901318_CX_CTRL_TCP_ENABLE | | ||
1124 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
1125 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1126 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1127 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1128 | COH901318_CX_CTRL_PRDD_DEST, | ||
1129 | }, | ||
1130 | { | ||
1131 | .number = U300_DMA_PCM_I2S1_TX, | ||
1132 | .name = "PCM I2S1 TX", | ||
1133 | .priority_high = 1, | ||
1134 | .dev_addr = U300_PCM_I2S1_BASE + 0x14, | ||
1135 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
1136 | COH901318_CX_CFG_LCR_DISABLE | | ||
1137 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
1138 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
1139 | .param.ctrl_lli_chained = 0 | | ||
1140 | COH901318_CX_CTRL_TC_ENABLE | | ||
1141 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1142 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1143 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
1144 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1145 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
1146 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1147 | COH901318_CX_CTRL_TCP_DISABLE | | ||
1148 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
1149 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1150 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1151 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1152 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
1153 | .param.ctrl_lli = 0 | | ||
1154 | COH901318_CX_CTRL_TC_ENABLE | | ||
1155 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1156 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1157 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
1158 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1159 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
1160 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1161 | COH901318_CX_CTRL_TCP_ENABLE | | ||
1162 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
1163 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1164 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1165 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1166 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
1167 | .param.ctrl_lli_last = 0 | | ||
1168 | COH901318_CX_CTRL_TC_ENABLE | | ||
1169 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1170 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1171 | COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | | ||
1172 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1173 | COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | | ||
1174 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1175 | COH901318_CX_CTRL_TCP_ENABLE | | ||
1176 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
1177 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1178 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1179 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1180 | COH901318_CX_CTRL_PRDD_SOURCE, | ||
1181 | }, | ||
1182 | { | ||
1183 | .number = U300_DMA_PCM_I2S1_RX, | ||
1184 | .name = "PCM I2S1 RX", | ||
1185 | .priority_high = 1, | ||
1186 | .dev_addr = U300_PCM_I2S1_BASE + 0x10, | ||
1187 | .param.config = COH901318_CX_CFG_CH_DISABLE | | ||
1188 | COH901318_CX_CFG_LCR_DISABLE | | ||
1189 | COH901318_CX_CFG_TC_IRQ_ENABLE | | ||
1190 | COH901318_CX_CFG_BE_IRQ_ENABLE, | ||
1191 | .param.ctrl_lli_chained = 0 | | ||
1192 | COH901318_CX_CTRL_TC_ENABLE | | ||
1193 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1194 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1195 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
1196 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1197 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
1198 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1199 | COH901318_CX_CTRL_TCP_DISABLE | | ||
1200 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
1201 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1202 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1203 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1204 | COH901318_CX_CTRL_PRDD_DEST, | ||
1205 | .param.ctrl_lli = 0 | | ||
1206 | COH901318_CX_CTRL_TC_ENABLE | | ||
1207 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1208 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1209 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
1210 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1211 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
1212 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1213 | COH901318_CX_CTRL_TCP_ENABLE | | ||
1214 | COH901318_CX_CTRL_TC_IRQ_DISABLE | | ||
1215 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1216 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1217 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1218 | COH901318_CX_CTRL_PRDD_DEST, | ||
1219 | .param.ctrl_lli_last = 0 | | ||
1220 | COH901318_CX_CTRL_TC_ENABLE | | ||
1221 | COH901318_CX_CTRL_BURST_COUNT_16_BYTES | | ||
1222 | COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | | ||
1223 | COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE | | ||
1224 | COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | | ||
1225 | COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | | ||
1226 | COH901318_CX_CTRL_MASTER_MODE_M1RW | | ||
1227 | COH901318_CX_CTRL_TCP_ENABLE | | ||
1228 | COH901318_CX_CTRL_TC_IRQ_ENABLE | | ||
1229 | COH901318_CX_CTRL_HSP_ENABLE | | ||
1230 | COH901318_CX_CTRL_HSS_DISABLE | | ||
1231 | COH901318_CX_CTRL_DDMA_LEGACY | | ||
1232 | COH901318_CX_CTRL_PRDD_DEST, | ||
1233 | }, | ||
1234 | { | ||
1235 | .number = U300_DMA_XGAM_CDI, | ||
1236 | .name = "XGAM CDI", | ||
1237 | .priority_high = 0, | ||
1238 | }, | ||
1239 | { | ||
1240 | .number = U300_DMA_XGAM_PDI, | ||
1241 | .name = "XGAM PDI", | ||
1242 | .priority_high = 0, | ||
1243 | }, | ||
1244 | { | ||
1245 | .number = U300_DMA_SPI_TX, | ||
1246 | .name = "SPI TX", | ||
1247 | .priority_high = 0, | ||
1248 | }, | ||
1249 | { | ||
1250 | .number = U300_DMA_SPI_RX, | ||
1251 | .name = "SPI RX", | ||
1252 | .priority_high = 0, | ||
1253 | }, | ||
1254 | { | ||
1255 | .number = U300_DMA_GENERAL_PURPOSE_0, | ||
1256 | .name = "GENERAL 00", | ||
1257 | .priority_high = 0, | ||
1258 | |||
1259 | .param.config = flags_memcpy_config, | ||
1260 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1261 | .param.ctrl_lli = flags_memcpy_lli, | ||
1262 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1263 | }, | ||
1264 | { | ||
1265 | .number = U300_DMA_GENERAL_PURPOSE_1, | ||
1266 | .name = "GENERAL 01", | ||
1267 | .priority_high = 0, | ||
1268 | |||
1269 | .param.config = flags_memcpy_config, | ||
1270 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1271 | .param.ctrl_lli = flags_memcpy_lli, | ||
1272 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1273 | }, | ||
1274 | { | ||
1275 | .number = U300_DMA_GENERAL_PURPOSE_2, | ||
1276 | .name = "GENERAL 02", | ||
1277 | .priority_high = 0, | ||
1278 | |||
1279 | .param.config = flags_memcpy_config, | ||
1280 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1281 | .param.ctrl_lli = flags_memcpy_lli, | ||
1282 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1283 | }, | ||
1284 | { | ||
1285 | .number = U300_DMA_GENERAL_PURPOSE_3, | ||
1286 | .name = "GENERAL 03", | ||
1287 | .priority_high = 0, | ||
1288 | |||
1289 | .param.config = flags_memcpy_config, | ||
1290 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1291 | .param.ctrl_lli = flags_memcpy_lli, | ||
1292 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1293 | }, | ||
1294 | { | ||
1295 | .number = U300_DMA_GENERAL_PURPOSE_4, | ||
1296 | .name = "GENERAL 04", | ||
1297 | .priority_high = 0, | ||
1298 | |||
1299 | .param.config = flags_memcpy_config, | ||
1300 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1301 | .param.ctrl_lli = flags_memcpy_lli, | ||
1302 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1303 | }, | ||
1304 | { | ||
1305 | .number = U300_DMA_GENERAL_PURPOSE_5, | ||
1306 | .name = "GENERAL 05", | ||
1307 | .priority_high = 0, | ||
1308 | |||
1309 | .param.config = flags_memcpy_config, | ||
1310 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1311 | .param.ctrl_lli = flags_memcpy_lli, | ||
1312 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1313 | }, | ||
1314 | { | ||
1315 | .number = U300_DMA_GENERAL_PURPOSE_6, | ||
1316 | .name = "GENERAL 06", | ||
1317 | .priority_high = 0, | ||
1318 | |||
1319 | .param.config = flags_memcpy_config, | ||
1320 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1321 | .param.ctrl_lli = flags_memcpy_lli, | ||
1322 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1323 | }, | ||
1324 | { | ||
1325 | .number = U300_DMA_GENERAL_PURPOSE_7, | ||
1326 | .name = "GENERAL 07", | ||
1327 | .priority_high = 0, | ||
1328 | |||
1329 | .param.config = flags_memcpy_config, | ||
1330 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1331 | .param.ctrl_lli = flags_memcpy_lli, | ||
1332 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1333 | }, | ||
1334 | { | ||
1335 | .number = U300_DMA_GENERAL_PURPOSE_8, | ||
1336 | .name = "GENERAL 08", | ||
1337 | .priority_high = 0, | ||
1338 | |||
1339 | .param.config = flags_memcpy_config, | ||
1340 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1341 | .param.ctrl_lli = flags_memcpy_lli, | ||
1342 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1343 | }, | ||
1344 | #ifdef CONFIG_MACH_U300_BS335 | ||
1345 | { | ||
1346 | .number = U300_DMA_UART1_TX, | ||
1347 | .name = "UART1 TX", | ||
1348 | .priority_high = 0, | ||
1349 | }, | ||
1350 | { | ||
1351 | .number = U300_DMA_UART1_RX, | ||
1352 | .name = "UART1 RX", | ||
1353 | .priority_high = 0, | ||
1354 | } | ||
1355 | #else | ||
1356 | { | ||
1357 | .number = U300_DMA_GENERAL_PURPOSE_9, | ||
1358 | .name = "GENERAL 09", | ||
1359 | .priority_high = 0, | ||
1360 | |||
1361 | .param.config = flags_memcpy_config, | ||
1362 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1363 | .param.ctrl_lli = flags_memcpy_lli, | ||
1364 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1365 | }, | ||
1366 | { | ||
1367 | .number = U300_DMA_GENERAL_PURPOSE_10, | ||
1368 | .name = "GENERAL 10", | ||
1369 | .priority_high = 0, | ||
1370 | |||
1371 | .param.config = flags_memcpy_config, | ||
1372 | .param.ctrl_lli_chained = flags_memcpy_lli_chained, | ||
1373 | .param.ctrl_lli = flags_memcpy_lli, | ||
1374 | .param.ctrl_lli_last = flags_memcpy_lli_last, | ||
1375 | } | ||
1376 | #endif | ||
1377 | }; | ||
1378 | |||
1379 | |||
1380 | static struct coh901318_platform coh901318_platform = { | ||
1381 | .chans_slave = dma_slave_channels, | ||
1382 | .chans_memcpy = dma_memcpy_channels, | ||
1383 | .access_memory_state = coh901318_access_memory_state, | ||
1384 | .chan_conf = chan_config, | ||
1385 | .max_channels = U300_DMA_CHANNELS, | ||
1386 | }; | ||
1387 | |||
375 | static struct platform_device wdog_device = { | 1388 | static struct platform_device wdog_device = { |
376 | .name = "wdog", | 1389 | .name = "coh901327_wdog", |
377 | .id = -1, | 1390 | .id = -1, |
378 | .num_resources = ARRAY_SIZE(wdog_resources), | 1391 | .num_resources = ARRAY_SIZE(wdog_resources), |
379 | .resource = wdog_resources, | 1392 | .resource = wdog_resources, |
@@ -428,11 +1441,23 @@ static struct platform_device ave_device = { | |||
428 | .resource = ave_resources, | 1441 | .resource = ave_resources, |
429 | }; | 1442 | }; |
430 | 1443 | ||
1444 | static struct platform_device dma_device = { | ||
1445 | .name = "coh901318", | ||
1446 | .id = -1, | ||
1447 | .resource = dma_resource, | ||
1448 | .num_resources = ARRAY_SIZE(dma_resource), | ||
1449 | .dev = { | ||
1450 | .platform_data = &coh901318_platform, | ||
1451 | .coherent_dma_mask = ~0, | ||
1452 | }, | ||
1453 | }; | ||
1454 | |||
431 | /* | 1455 | /* |
432 | * Notice that AMBA devices are initialized before platform devices. | 1456 | * Notice that AMBA devices are initialized before platform devices. |
433 | * | 1457 | * |
434 | */ | 1458 | */ |
435 | static struct platform_device *platform_devs[] __initdata = { | 1459 | static struct platform_device *platform_devs[] __initdata = { |
1460 | &dma_device, | ||
436 | &i2c0_device, | 1461 | &i2c0_device, |
437 | &i2c1_device, | 1462 | &i2c1_device, |
438 | &keypad_device, | 1463 | &keypad_device, |
diff --git a/arch/arm/mach-u300/gpio.c b/arch/arm/mach-u300/gpio.c index 0b35826b7d1d..5f61fd45a0c8 100644 --- a/arch/arm/mach-u300/gpio.c +++ b/arch/arm/mach-u300/gpio.c | |||
@@ -546,7 +546,7 @@ static void gpio_set_initial_values(void) | |||
546 | for (i = 0; i < U300_GPIO_MAX; i++) { | 546 | for (i = 0; i < U300_GPIO_MAX; i++) { |
547 | val = 0; | 547 | val = 0; |
548 | for (j = 0; j < 8; j++) | 548 | for (j = 0; j < 8; j++) |
549 | val |= (u32)((u300_gpio_config[i][j].pull_up == DISABLE_PULL_UP)) << j; | 549 | val |= (u32)((u300_gpio_config[i][j].pull_up == DISABLE_PULL_UP) << j); |
550 | local_irq_save(flags); | 550 | local_irq_save(flags); |
551 | writel(val, virtbase + U300_GPIO_PXPER + i * U300_GPIO_PORTX_SPACING); | 551 | writel(val, virtbase + U300_GPIO_PXPER + i * U300_GPIO_PORTX_SPACING); |
552 | local_irq_restore(flags); | 552 | local_irq_restore(flags); |
diff --git a/arch/arm/mach-u300/include/mach/dma_channels.h b/arch/arm/mach-u300/include/mach/dma_channels.h new file mode 100644 index 000000000000..b239149ba0d0 --- /dev/null +++ b/arch/arm/mach-u300/include/mach/dma_channels.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * | ||
3 | * arch/arm/mach-u300/include/mach/dma_channels.h | ||
4 | * | ||
5 | * | ||
6 | * Copyright (C) 2007-2009 ST-Ericsson | ||
7 | * License terms: GNU General Public License (GPL) version 2 | ||
8 | * Map file for the U300 dma driver. | ||
9 | * Author: Per Friden <per.friden@stericsson.com> | ||
10 | */ | ||
11 | |||
12 | #ifndef DMA_CHANNELS_H | ||
13 | #define DMA_CHANNELS_H | ||
14 | |||
15 | #define U300_DMA_MSL_TX_0 0 | ||
16 | #define U300_DMA_MSL_TX_1 1 | ||
17 | #define U300_DMA_MSL_TX_2 2 | ||
18 | #define U300_DMA_MSL_TX_3 3 | ||
19 | #define U300_DMA_MSL_TX_4 4 | ||
20 | #define U300_DMA_MSL_TX_5 5 | ||
21 | #define U300_DMA_MSL_TX_6 6 | ||
22 | #define U300_DMA_MSL_RX_0 7 | ||
23 | #define U300_DMA_MSL_RX_1 8 | ||
24 | #define U300_DMA_MSL_RX_2 9 | ||
25 | #define U300_DMA_MSL_RX_3 10 | ||
26 | #define U300_DMA_MSL_RX_4 11 | ||
27 | #define U300_DMA_MSL_RX_5 12 | ||
28 | #define U300_DMA_MSL_RX_6 13 | ||
29 | #define U300_DMA_MMCSD_RX_TX 14 | ||
30 | #define U300_DMA_MSPRO_TX 15 | ||
31 | #define U300_DMA_MSPRO_RX 16 | ||
32 | #define U300_DMA_UART0_TX 17 | ||
33 | #define U300_DMA_UART0_RX 18 | ||
34 | #define U300_DMA_APEX_TX 19 | ||
35 | #define U300_DMA_APEX_RX 20 | ||
36 | #define U300_DMA_PCM_I2S0_TX 21 | ||
37 | #define U300_DMA_PCM_I2S0_RX 22 | ||
38 | #define U300_DMA_PCM_I2S1_TX 23 | ||
39 | #define U300_DMA_PCM_I2S1_RX 24 | ||
40 | #define U300_DMA_XGAM_CDI 25 | ||
41 | #define U300_DMA_XGAM_PDI 26 | ||
42 | #define U300_DMA_SPI_TX 27 | ||
43 | #define U300_DMA_SPI_RX 28 | ||
44 | #define U300_DMA_GENERAL_PURPOSE_0 29 | ||
45 | #define U300_DMA_GENERAL_PURPOSE_1 30 | ||
46 | #define U300_DMA_GENERAL_PURPOSE_2 31 | ||
47 | #define U300_DMA_GENERAL_PURPOSE_3 32 | ||
48 | #define U300_DMA_GENERAL_PURPOSE_4 33 | ||
49 | #define U300_DMA_GENERAL_PURPOSE_5 34 | ||
50 | #define U300_DMA_GENERAL_PURPOSE_6 35 | ||
51 | #define U300_DMA_GENERAL_PURPOSE_7 36 | ||
52 | #define U300_DMA_GENERAL_PURPOSE_8 37 | ||
53 | #ifdef CONFIG_MACH_U300_BS335 | ||
54 | #define U300_DMA_UART1_TX 38 | ||
55 | #define U300_DMA_UART1_RX 39 | ||
56 | #else | ||
57 | #define U300_DMA_GENERAL_PURPOSE_9 38 | ||
58 | #define U300_DMA_GENERAL_PURPOSE_10 39 | ||
59 | #endif | ||
60 | |||
61 | #ifdef CONFIG_MACH_U300_BS335 | ||
62 | #define U300_DMA_DEVICE_CHANNELS 32 | ||
63 | #else | ||
64 | #define U300_DMA_DEVICE_CHANNELS 30 | ||
65 | #endif | ||
66 | #define U300_DMA_CHANNELS 40 | ||
67 | |||
68 | |||
69 | #endif /* DMA_CHANNELS_H */ | ||
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index aa5afbcc90f9..803aec1d6728 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
23 | 23 | ||
24 | #include <plat/mtu.h> | 24 | #include <plat/mtu.h> |
25 | #include <plat/i2c.h> | ||
25 | 26 | ||
26 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
27 | #include <mach/setup.h> | 28 | #include <mach/setup.h> |
@@ -108,11 +109,96 @@ static struct amba_device pl022_device = { | |||
108 | .periphid = SSP_PER_ID, | 109 | .periphid = SSP_PER_ID, |
109 | }; | 110 | }; |
110 | 111 | ||
112 | static struct amba_device pl031_device = { | ||
113 | .dev = { | ||
114 | .init_name = "pl031", | ||
115 | }, | ||
116 | .res = { | ||
117 | .start = U8500_RTC_BASE, | ||
118 | .end = U8500_RTC_BASE + SZ_4K - 1, | ||
119 | .flags = IORESOURCE_MEM, | ||
120 | }, | ||
121 | .irq = {IRQ_RTC_RTT, NO_IRQ}, | ||
122 | }; | ||
123 | |||
124 | #define U8500_I2C_RESOURCES(id, size) \ | ||
125 | static struct resource u8500_i2c_resources_##id[] = { \ | ||
126 | [0] = { \ | ||
127 | .start = U8500_I2C##id##_BASE, \ | ||
128 | .end = U8500_I2C##id##_BASE + size - 1, \ | ||
129 | .flags = IORESOURCE_MEM, \ | ||
130 | }, \ | ||
131 | [1] = { \ | ||
132 | .start = IRQ_I2C##id, \ | ||
133 | .end = IRQ_I2C##id, \ | ||
134 | .flags = IORESOURCE_IRQ \ | ||
135 | } \ | ||
136 | } | ||
137 | |||
138 | U8500_I2C_RESOURCES(0, SZ_4K); | ||
139 | U8500_I2C_RESOURCES(1, SZ_4K); | ||
140 | U8500_I2C_RESOURCES(2, SZ_4K); | ||
141 | U8500_I2C_RESOURCES(3, SZ_4K); | ||
142 | |||
143 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ | ||
144 | static struct nmk_i2c_controller u8500_i2c_##id = { \ | ||
145 | /* \ | ||
146 | * slave data setup time, which is \ | ||
147 | * 250 ns,100ns,10ns which is 14,6,2 \ | ||
148 | * respectively for a 48 Mhz \ | ||
149 | * i2c clock \ | ||
150 | */ \ | ||
151 | .slsu = _slsu, \ | ||
152 | /* Tx FIFO threshold */ \ | ||
153 | .tft = _tft, \ | ||
154 | /* Rx FIFO threshold */ \ | ||
155 | .rft = _rft, \ | ||
156 | /* std. mode operation */ \ | ||
157 | .clk_freq = clk, \ | ||
158 | .sm = _sm, \ | ||
159 | } | ||
160 | |||
161 | /* | ||
162 | * The board uses 4 i2c controllers, initialize all of | ||
163 | * them with slave data setup time of 250 ns, | ||
164 | * Tx & Rx FIFO threshold values as 1 and standard | ||
165 | * mode of operation | ||
166 | */ | ||
167 | U8500_I2C_CONTROLLER(0, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | ||
168 | U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | ||
169 | U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | ||
170 | U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); | ||
171 | |||
172 | #define U8500_I2C_PDEVICE(cid) \ | ||
173 | static struct platform_device i2c_controller##cid = { \ | ||
174 | .name = "nmk-i2c", \ | ||
175 | .id = cid, \ | ||
176 | .num_resources = 2, \ | ||
177 | .resource = u8500_i2c_resources_##cid, \ | ||
178 | .dev = { \ | ||
179 | .platform_data = &u8500_i2c_##cid \ | ||
180 | } \ | ||
181 | } | ||
182 | |||
183 | U8500_I2C_PDEVICE(0); | ||
184 | U8500_I2C_PDEVICE(1); | ||
185 | U8500_I2C_PDEVICE(2); | ||
186 | U8500_I2C_PDEVICE(3); | ||
187 | |||
111 | static struct amba_device *amba_devs[] __initdata = { | 188 | static struct amba_device *amba_devs[] __initdata = { |
112 | &uart0_device, | 189 | &uart0_device, |
113 | &uart1_device, | 190 | &uart1_device, |
114 | &uart2_device, | 191 | &uart2_device, |
115 | &pl022_device, | 192 | &pl022_device, |
193 | &pl031_device, | ||
194 | }; | ||
195 | |||
196 | /* add any platform devices here - TODO */ | ||
197 | static struct platform_device *platform_devs[] __initdata = { | ||
198 | &i2c_controller0, | ||
199 | &i2c_controller1, | ||
200 | &i2c_controller2, | ||
201 | &i2c_controller3, | ||
116 | }; | 202 | }; |
117 | 203 | ||
118 | static void __init u8500_timer_init(void) | 204 | static void __init u8500_timer_init(void) |
@@ -139,6 +225,8 @@ static void __init u8500_init_machine(void) | |||
139 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) | 225 | for (i = 0; i < ARRAY_SIZE(amba_devs); i++) |
140 | amba_device_register(amba_devs[i], &iomem_resource); | 226 | amba_device_register(amba_devs[i], &iomem_resource); |
141 | 227 | ||
228 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | ||
229 | |||
142 | spi_register_board_info(u8500_spi_devices, | 230 | spi_register_board_info(u8500_spi_devices, |
143 | ARRAY_SIZE(u8500_spi_devices)); | 231 | ARRAY_SIZE(u8500_spi_devices)); |
144 | 232 | ||
diff --git a/arch/arm/mach-ux500/cpu-u8500.c b/arch/arm/mach-ux500/cpu-u8500.c index 5f05e5850f71..397bc1f9ed94 100644 --- a/arch/arm/mach-ux500/cpu-u8500.c +++ b/arch/arm/mach-ux500/cpu-u8500.c | |||
@@ -33,6 +33,7 @@ static struct platform_device *platform_devs[] __initdata = { | |||
33 | 33 | ||
34 | /* minimum static i/o mapping required to boot U8500 platforms */ | 34 | /* minimum static i/o mapping required to boot U8500 platforms */ |
35 | static struct map_desc u8500_io_desc[] __initdata = { | 35 | static struct map_desc u8500_io_desc[] __initdata = { |
36 | __IO_DEV_DESC(U8500_UART2_BASE, SZ_4K), | ||
36 | __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K), | 37 | __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K), |
37 | __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K), | 38 | __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K), |
38 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), | 39 | __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), |
diff --git a/arch/arm/mach-ux500/include/mach/debug-macro.S b/arch/arm/mach-ux500/include/mach/debug-macro.S index 8f21b6a95dce..8de225e02235 100644 --- a/arch/arm/mach-ux500/include/mach/debug-macro.S +++ b/arch/arm/mach-ux500/include/mach/debug-macro.S | |||
@@ -8,12 +8,13 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | #include <mach/hardware.h> | ||
12 | |||
11 | .macro addruart,rx | 13 | .macro addruart,rx |
12 | mrc p15, 0, \rx, c1, c0 | 14 | mrc p15, 0, \rx, c1, c0 |
13 | tst \rx, #1 @MMU enabled? | 15 | tst \rx, #1 @ MMU enabled? |
14 | moveq \rx, #0x80000000 @MMU off, Physical address | 16 | ldreq \rx, =U8500_UART2_BASE @ no, physical address |
15 | movne \rx, #0xF0000000 @MMU on, Virtual address | 17 | ldrne \rx, =IO_ADDRESS(U8500_UART2_BASE) @ yes, virtual address |
16 | orr \rx, \rx, #0x7000 | ||
17 | .endm | 18 | .endm |
18 | 19 | ||
19 | #include <asm/hardware/debug-pl01x.S> | 20 | #include <asm/hardware/debug-pl01x.S> |
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c index 20dc0c96214d..e44b0a0ecf4c 100644 --- a/arch/arm/mach-w90x900/cpu.c +++ b/arch/arm/mach-w90x900/cpu.c | |||
@@ -45,6 +45,7 @@ static struct map_desc nuc900_iodesc[] __initdata = { | |||
45 | IODESC_ENT(UART), | 45 | IODESC_ENT(UART), |
46 | IODESC_ENT(TIMER), | 46 | IODESC_ENT(TIMER), |
47 | IODESC_ENT(EBI), | 47 | IODESC_ENT(EBI), |
48 | IODESC_ENT(GPIO), | ||
48 | }; | 49 | }; |
49 | 50 | ||
50 | /* Initial clock declarations. */ | 51 | /* Initial clock declarations. */ |
@@ -68,6 +69,11 @@ static DEFINE_CLK(gdma, 27); | |||
68 | static DEFINE_CLK(adc, 28); | 69 | static DEFINE_CLK(adc, 28); |
69 | static DEFINE_CLK(usi, 29); | 70 | static DEFINE_CLK(usi, 29); |
70 | static DEFINE_CLK(ext, 0); | 71 | static DEFINE_CLK(ext, 0); |
72 | static DEFINE_CLK(timer0, 19); | ||
73 | static DEFINE_CLK(timer1, 20); | ||
74 | static DEFINE_CLK(timer2, 21); | ||
75 | static DEFINE_CLK(timer3, 22); | ||
76 | static DEFINE_CLK(timer4, 23); | ||
71 | 77 | ||
72 | static struct clk_lookup nuc900_clkregs[] = { | 78 | static struct clk_lookup nuc900_clkregs[] = { |
73 | DEF_CLKLOOK(&clk_lcd, "nuc900-lcd", NULL), | 79 | DEF_CLKLOOK(&clk_lcd, "nuc900-lcd", NULL), |
@@ -90,6 +96,11 @@ static struct clk_lookup nuc900_clkregs[] = { | |||
90 | DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL), | 96 | DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL), |
91 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), | 97 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), |
92 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), | 98 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), |
99 | DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), | ||
100 | DEF_CLKLOOK(&clk_timer1, NULL, "timer1"), | ||
101 | DEF_CLKLOOK(&clk_timer2, NULL, "timer2"), | ||
102 | DEF_CLKLOOK(&clk_timer3, NULL, "timer3"), | ||
103 | DEF_CLKLOOK(&clk_timer4, NULL, "timer4"), | ||
93 | }; | 104 | }; |
94 | 105 | ||
95 | /* Initial serial platform data */ | 106 | /* Initial serial platform data */ |
diff --git a/arch/arm/mach-w90x900/include/mach/system.h b/arch/arm/mach-w90x900/include/mach/system.h index 940640066857..ce228bdc66dd 100644 --- a/arch/arm/mach-w90x900/include/mach/system.h +++ b/arch/arm/mach-w90x900/include/mach/system.h | |||
@@ -15,7 +15,15 @@ | |||
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <linux/io.h> | ||
18 | #include <asm/proc-fns.h> | 19 | #include <asm/proc-fns.h> |
20 | #include <mach/map.h> | ||
21 | #include <mach/regs-timer.h> | ||
22 | |||
23 | #define WTCR (TMR_BA + 0x1C) | ||
24 | #define WTCLK (1 << 10) | ||
25 | #define WTE (1 << 7) | ||
26 | #define WTRE (1 << 1) | ||
19 | 27 | ||
20 | static void arch_idle(void) | 28 | static void arch_idle(void) |
21 | { | 29 | { |
@@ -23,6 +31,11 @@ static void arch_idle(void) | |||
23 | 31 | ||
24 | static void arch_reset(char mode, const char *cmd) | 32 | static void arch_reset(char mode, const char *cmd) |
25 | { | 33 | { |
26 | cpu_reset(0); | 34 | if (mode == 's') { |
35 | /* Jump into ROM at address 0 */ | ||
36 | cpu_reset(0); | ||
37 | } else { | ||
38 | __raw_writel(WTE | WTRE | WTCLK, WTCR); | ||
39 | } | ||
27 | } | 40 | } |
28 | 41 | ||
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c index 4128af870b41..b80f769bc135 100644 --- a/arch/arm/mach-w90x900/time.c +++ b/arch/arm/mach-w90x900/time.c | |||
@@ -42,7 +42,10 @@ | |||
42 | #define TICKS_PER_SEC 100 | 42 | #define TICKS_PER_SEC 100 |
43 | #define PRESCALE 0x63 /* Divider = prescale + 1 */ | 43 | #define PRESCALE 0x63 /* Divider = prescale + 1 */ |
44 | 44 | ||
45 | unsigned int timer0_load; | 45 | #define TDR_SHIFT 24 |
46 | #define TDR_MASK ((1 << TDR_SHIFT) - 1) | ||
47 | |||
48 | static unsigned int timer0_load; | ||
46 | 49 | ||
47 | static void nuc900_clockevent_setmode(enum clock_event_mode mode, | 50 | static void nuc900_clockevent_setmode(enum clock_event_mode mode, |
48 | struct clock_event_device *clk) | 51 | struct clock_event_device *clk) |
@@ -88,7 +91,7 @@ static int nuc900_clockevent_setnextevent(unsigned long evt, | |||
88 | static struct clock_event_device nuc900_clockevent_device = { | 91 | static struct clock_event_device nuc900_clockevent_device = { |
89 | .name = "nuc900-timer0", | 92 | .name = "nuc900-timer0", |
90 | .shift = 32, | 93 | .shift = 32, |
91 | .features = CLOCK_EVT_MODE_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 94 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
92 | .set_mode = nuc900_clockevent_setmode, | 95 | .set_mode = nuc900_clockevent_setmode, |
93 | .set_next_event = nuc900_clockevent_setnextevent, | 96 | .set_next_event = nuc900_clockevent_setnextevent, |
94 | .rating = 300, | 97 | .rating = 300, |
@@ -112,8 +115,23 @@ static struct irqaction nuc900_timer0_irq = { | |||
112 | .handler = nuc900_timer0_interrupt, | 115 | .handler = nuc900_timer0_interrupt, |
113 | }; | 116 | }; |
114 | 117 | ||
115 | static void __init nuc900_clockevents_init(unsigned int rate) | 118 | static void __init nuc900_clockevents_init(void) |
116 | { | 119 | { |
120 | unsigned int rate; | ||
121 | struct clk *clk = clk_get(NULL, "timer0"); | ||
122 | |||
123 | BUG_ON(IS_ERR(clk)); | ||
124 | |||
125 | __raw_writel(0x00, REG_TCSR0); | ||
126 | |||
127 | clk_enable(clk); | ||
128 | rate = clk_get_rate(clk) / (PRESCALE + 1); | ||
129 | |||
130 | timer0_load = (rate / TICKS_PER_SEC); | ||
131 | |||
132 | __raw_writel(RESETINT, REG_TISR); | ||
133 | setup_irq(IRQ_TIMER0, &nuc900_timer0_irq); | ||
134 | |||
117 | nuc900_clockevent_device.mult = div_sc(rate, NSEC_PER_SEC, | 135 | nuc900_clockevent_device.mult = div_sc(rate, NSEC_PER_SEC, |
118 | nuc900_clockevent_device.shift); | 136 | nuc900_clockevent_device.shift); |
119 | nuc900_clockevent_device.max_delta_ns = clockevent_delta2ns(0xffffffff, | 137 | nuc900_clockevent_device.max_delta_ns = clockevent_delta2ns(0xffffffff, |
@@ -127,26 +145,35 @@ static void __init nuc900_clockevents_init(unsigned int rate) | |||
127 | 145 | ||
128 | static cycle_t nuc900_get_cycles(struct clocksource *cs) | 146 | static cycle_t nuc900_get_cycles(struct clocksource *cs) |
129 | { | 147 | { |
130 | return ~__raw_readl(REG_TDR1); | 148 | return (~__raw_readl(REG_TDR1)) & TDR_MASK; |
131 | } | 149 | } |
132 | 150 | ||
133 | static struct clocksource clocksource_nuc900 = { | 151 | static struct clocksource clocksource_nuc900 = { |
134 | .name = "nuc900-timer1", | 152 | .name = "nuc900-timer1", |
135 | .rating = 200, | 153 | .rating = 200, |
136 | .read = nuc900_get_cycles, | 154 | .read = nuc900_get_cycles, |
137 | .mask = CLOCKSOURCE_MASK(32), | 155 | .mask = CLOCKSOURCE_MASK(TDR_SHIFT), |
138 | .shift = 20, | 156 | .shift = 10, |
139 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 157 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
140 | }; | 158 | }; |
141 | 159 | ||
142 | static void __init nuc900_clocksource_init(unsigned int rate) | 160 | static void __init nuc900_clocksource_init(void) |
143 | { | 161 | { |
144 | unsigned int val; | 162 | unsigned int val; |
163 | unsigned int rate; | ||
164 | struct clk *clk = clk_get(NULL, "timer1"); | ||
165 | |||
166 | BUG_ON(IS_ERR(clk)); | ||
167 | |||
168 | __raw_writel(0x00, REG_TCSR1); | ||
169 | |||
170 | clk_enable(clk); | ||
171 | rate = clk_get_rate(clk) / (PRESCALE + 1); | ||
145 | 172 | ||
146 | __raw_writel(0xffffffff, REG_TICR1); | 173 | __raw_writel(0xffffffff, REG_TICR1); |
147 | 174 | ||
148 | val = __raw_readl(REG_TCSR1); | 175 | val = __raw_readl(REG_TCSR1); |
149 | val |= (COUNTEN | PERIOD); | 176 | val |= (COUNTEN | PERIOD | PRESCALE); |
150 | __raw_writel(val, REG_TCSR1); | 177 | __raw_writel(val, REG_TCSR1); |
151 | 178 | ||
152 | clocksource_nuc900.mult = | 179 | clocksource_nuc900.mult = |
@@ -156,25 +183,8 @@ static void __init nuc900_clocksource_init(unsigned int rate) | |||
156 | 183 | ||
157 | static void __init nuc900_timer_init(void) | 184 | static void __init nuc900_timer_init(void) |
158 | { | 185 | { |
159 | struct clk *ck_ext = clk_get(NULL, "ext"); | 186 | nuc900_clocksource_init(); |
160 | unsigned int rate; | 187 | nuc900_clockevents_init(); |
161 | |||
162 | BUG_ON(IS_ERR(ck_ext)); | ||
163 | |||
164 | rate = clk_get_rate(ck_ext); | ||
165 | clk_put(ck_ext); | ||
166 | rate = rate / (PRESCALE + 0x01); | ||
167 | |||
168 | /* set a known state */ | ||
169 | __raw_writel(0x00, REG_TCSR0); | ||
170 | __raw_writel(0x00, REG_TCSR1); | ||
171 | __raw_writel(RESETINT, REG_TISR); | ||
172 | timer0_load = (rate / TICKS_PER_SEC); | ||
173 | |||
174 | setup_irq(IRQ_TIMER0, &nuc900_timer0_irq); | ||
175 | |||
176 | nuc900_clocksource_init(rate); | ||
177 | nuc900_clockevents_init(rate); | ||
178 | } | 188 | } |
179 | 189 | ||
180 | struct sys_timer nuc900_timer = { | 190 | struct sys_timer nuc900_timer = { |
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile index 827e238e5d4a..e8d34a80851c 100644 --- a/arch/arm/mm/Makefile +++ b/arch/arm/mm/Makefile | |||
@@ -27,6 +27,9 @@ obj-$(CONFIG_CPU_ABRT_EV5TJ) += abort-ev5tj.o | |||
27 | obj-$(CONFIG_CPU_ABRT_EV6) += abort-ev6.o | 27 | obj-$(CONFIG_CPU_ABRT_EV6) += abort-ev6.o |
28 | obj-$(CONFIG_CPU_ABRT_EV7) += abort-ev7.o | 28 | obj-$(CONFIG_CPU_ABRT_EV7) += abort-ev7.o |
29 | 29 | ||
30 | AFLAGS_abort-ev6.o :=-Wa,-march=armv6k | ||
31 | AFLAGS_abort-ev7.o :=-Wa,-march=armv7-a | ||
32 | |||
30 | obj-$(CONFIG_CPU_PABRT_LEGACY) += pabort-legacy.o | 33 | obj-$(CONFIG_CPU_PABRT_LEGACY) += pabort-legacy.o |
31 | obj-$(CONFIG_CPU_PABRT_V6) += pabort-v6.o | 34 | obj-$(CONFIG_CPU_PABRT_V6) += pabort-v6.o |
32 | obj-$(CONFIG_CPU_PABRT_V7) += pabort-v7.o | 35 | obj-$(CONFIG_CPU_PABRT_V7) += pabort-v7.o |
@@ -39,6 +42,9 @@ obj-$(CONFIG_CPU_CACHE_V6) += cache-v6.o | |||
39 | obj-$(CONFIG_CPU_CACHE_V7) += cache-v7.o | 42 | obj-$(CONFIG_CPU_CACHE_V7) += cache-v7.o |
40 | obj-$(CONFIG_CPU_CACHE_FA) += cache-fa.o | 43 | obj-$(CONFIG_CPU_CACHE_FA) += cache-fa.o |
41 | 44 | ||
45 | AFLAGS_cache-v6.o :=-Wa,-march=armv6 | ||
46 | AFLAGS_cache-v7.o :=-Wa,-march=armv7-a | ||
47 | |||
42 | obj-$(CONFIG_CPU_COPY_V3) += copypage-v3.o | 48 | obj-$(CONFIG_CPU_COPY_V3) += copypage-v3.o |
43 | obj-$(CONFIG_CPU_COPY_V4WT) += copypage-v4wt.o | 49 | obj-$(CONFIG_CPU_COPY_V4WT) += copypage-v4wt.o |
44 | obj-$(CONFIG_CPU_COPY_V4WB) += copypage-v4wb.o | 50 | obj-$(CONFIG_CPU_COPY_V4WB) += copypage-v4wb.o |
@@ -58,6 +64,9 @@ obj-$(CONFIG_CPU_TLB_V6) += tlb-v6.o | |||
58 | obj-$(CONFIG_CPU_TLB_V7) += tlb-v7.o | 64 | obj-$(CONFIG_CPU_TLB_V7) += tlb-v7.o |
59 | obj-$(CONFIG_CPU_TLB_FA) += tlb-fa.o | 65 | obj-$(CONFIG_CPU_TLB_FA) += tlb-fa.o |
60 | 66 | ||
67 | AFLAGS_tlb-v6.o :=-Wa,-march=armv6 | ||
68 | AFLAGS_tlb-v7.o :=-Wa,-march=armv7-a | ||
69 | |||
61 | obj-$(CONFIG_CPU_ARM610) += proc-arm6_7.o | 70 | obj-$(CONFIG_CPU_ARM610) += proc-arm6_7.o |
62 | obj-$(CONFIG_CPU_ARM710) += proc-arm6_7.o | 71 | obj-$(CONFIG_CPU_ARM710) += proc-arm6_7.o |
63 | obj-$(CONFIG_CPU_ARM7TDMI) += proc-arm7tdmi.o | 72 | obj-$(CONFIG_CPU_ARM7TDMI) += proc-arm7tdmi.o |
@@ -84,6 +93,9 @@ obj-$(CONFIG_CPU_FEROCEON) += proc-feroceon.o | |||
84 | obj-$(CONFIG_CPU_V6) += proc-v6.o | 93 | obj-$(CONFIG_CPU_V6) += proc-v6.o |
85 | obj-$(CONFIG_CPU_V7) += proc-v7.o | 94 | obj-$(CONFIG_CPU_V7) += proc-v7.o |
86 | 95 | ||
96 | AFLAGS_proc-v6.o :=-Wa,-march=armv6 | ||
97 | AFLAGS_proc-v7.o :=-Wa,-march=armv7-a | ||
98 | |||
87 | obj-$(CONFIG_CACHE_FEROCEON_L2) += cache-feroceon-l2.o | 99 | obj-$(CONFIG_CACHE_FEROCEON_L2) += cache-feroceon-l2.o |
88 | obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o | 100 | obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o |
89 | obj-$(CONFIG_CACHE_XSC3L2) += cache-xsc3l2.o | 101 | obj-$(CONFIG_CACHE_XSC3L2) += cache-xsc3l2.o |
diff --git a/arch/arm/mm/cache-fa.S b/arch/arm/mm/cache-fa.S index a89444a3c016..7148e53e6078 100644 --- a/arch/arm/mm/cache-fa.S +++ b/arch/arm/mm/cache-fa.S | |||
@@ -157,7 +157,7 @@ ENTRY(fa_flush_kern_dcache_area) | |||
157 | * - start - virtual start address | 157 | * - start - virtual start address |
158 | * - end - virtual end address | 158 | * - end - virtual end address |
159 | */ | 159 | */ |
160 | ENTRY(fa_dma_inv_range) | 160 | fa_dma_inv_range: |
161 | tst r0, #CACHE_DLINESIZE - 1 | 161 | tst r0, #CACHE_DLINESIZE - 1 |
162 | bic r0, r0, #CACHE_DLINESIZE - 1 | 162 | bic r0, r0, #CACHE_DLINESIZE - 1 |
163 | mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D entry | 163 | mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D entry |
@@ -180,7 +180,7 @@ ENTRY(fa_dma_inv_range) | |||
180 | * - start - virtual start address | 180 | * - start - virtual start address |
181 | * - end - virtual end address | 181 | * - end - virtual end address |
182 | */ | 182 | */ |
183 | ENTRY(fa_dma_clean_range) | 183 | fa_dma_clean_range: |
184 | bic r0, r0, #CACHE_DLINESIZE - 1 | 184 | bic r0, r0, #CACHE_DLINESIZE - 1 |
185 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 185 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
186 | add r0, r0, #CACHE_DLINESIZE | 186 | add r0, r0, #CACHE_DLINESIZE |
@@ -205,6 +205,30 @@ ENTRY(fa_dma_flush_range) | |||
205 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | 205 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer |
206 | mov pc, lr | 206 | mov pc, lr |
207 | 207 | ||
208 | /* | ||
209 | * dma_map_area(start, size, dir) | ||
210 | * - start - kernel virtual start address | ||
211 | * - size - size of region | ||
212 | * - dir - DMA direction | ||
213 | */ | ||
214 | ENTRY(fa_dma_map_area) | ||
215 | add r1, r1, r0 | ||
216 | cmp r2, #DMA_TO_DEVICE | ||
217 | beq fa_dma_clean_range | ||
218 | bcs fa_dma_inv_range | ||
219 | b fa_dma_flush_range | ||
220 | ENDPROC(fa_dma_map_area) | ||
221 | |||
222 | /* | ||
223 | * dma_unmap_area(start, size, dir) | ||
224 | * - start - kernel virtual start address | ||
225 | * - size - size of region | ||
226 | * - dir - DMA direction | ||
227 | */ | ||
228 | ENTRY(fa_dma_unmap_area) | ||
229 | mov pc, lr | ||
230 | ENDPROC(fa_dma_unmap_area) | ||
231 | |||
208 | __INITDATA | 232 | __INITDATA |
209 | 233 | ||
210 | .type fa_cache_fns, #object | 234 | .type fa_cache_fns, #object |
@@ -215,7 +239,7 @@ ENTRY(fa_cache_fns) | |||
215 | .long fa_coherent_kern_range | 239 | .long fa_coherent_kern_range |
216 | .long fa_coherent_user_range | 240 | .long fa_coherent_user_range |
217 | .long fa_flush_kern_dcache_area | 241 | .long fa_flush_kern_dcache_area |
218 | .long fa_dma_inv_range | 242 | .long fa_dma_map_area |
219 | .long fa_dma_clean_range | 243 | .long fa_dma_unmap_area |
220 | .long fa_dma_flush_range | 244 | .long fa_dma_flush_range |
221 | .size fa_cache_fns, . - fa_cache_fns | 245 | .size fa_cache_fns, . - fa_cache_fns |
diff --git a/arch/arm/mm/cache-v3.S b/arch/arm/mm/cache-v3.S index 2a482731ea36..c2ff3c599fee 100644 --- a/arch/arm/mm/cache-v3.S +++ b/arch/arm/mm/cache-v3.S | |||
@@ -84,20 +84,6 @@ ENTRY(v3_flush_kern_dcache_area) | |||
84 | /* FALLTHROUGH */ | 84 | /* FALLTHROUGH */ |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * dma_inv_range(start, end) | ||
88 | * | ||
89 | * Invalidate (discard) the specified virtual address range. | ||
90 | * May not write back any entries. If 'start' or 'end' | ||
91 | * are not cache line aligned, those lines must be written | ||
92 | * back. | ||
93 | * | ||
94 | * - start - virtual start address | ||
95 | * - end - virtual end address | ||
96 | */ | ||
97 | ENTRY(v3_dma_inv_range) | ||
98 | /* FALLTHROUGH */ | ||
99 | |||
100 | /* | ||
101 | * dma_flush_range(start, end) | 87 | * dma_flush_range(start, end) |
102 | * | 88 | * |
103 | * Clean and invalidate the specified virtual address range. | 89 | * Clean and invalidate the specified virtual address range. |
@@ -108,18 +94,29 @@ ENTRY(v3_dma_inv_range) | |||
108 | ENTRY(v3_dma_flush_range) | 94 | ENTRY(v3_dma_flush_range) |
109 | mov r0, #0 | 95 | mov r0, #0 |
110 | mcr p15, 0, r0, c7, c0, 0 @ flush ID cache | 96 | mcr p15, 0, r0, c7, c0, 0 @ flush ID cache |
97 | mov pc, lr | ||
98 | |||
99 | /* | ||
100 | * dma_unmap_area(start, size, dir) | ||
101 | * - start - kernel virtual start address | ||
102 | * - size - size of region | ||
103 | * - dir - DMA direction | ||
104 | */ | ||
105 | ENTRY(v3_dma_unmap_area) | ||
106 | teq r2, #DMA_TO_DEVICE | ||
107 | bne v3_dma_flush_range | ||
111 | /* FALLTHROUGH */ | 108 | /* FALLTHROUGH */ |
112 | 109 | ||
113 | /* | 110 | /* |
114 | * dma_clean_range(start, end) | 111 | * dma_map_area(start, size, dir) |
115 | * | 112 | * - start - kernel virtual start address |
116 | * Clean (write back) the specified virtual address range. | 113 | * - size - size of region |
117 | * | 114 | * - dir - DMA direction |
118 | * - start - virtual start address | ||
119 | * - end - virtual end address | ||
120 | */ | 115 | */ |
121 | ENTRY(v3_dma_clean_range) | 116 | ENTRY(v3_dma_map_area) |
122 | mov pc, lr | 117 | mov pc, lr |
118 | ENDPROC(v3_dma_unmap_area) | ||
119 | ENDPROC(v3_dma_map_area) | ||
123 | 120 | ||
124 | __INITDATA | 121 | __INITDATA |
125 | 122 | ||
@@ -131,7 +128,7 @@ ENTRY(v3_cache_fns) | |||
131 | .long v3_coherent_kern_range | 128 | .long v3_coherent_kern_range |
132 | .long v3_coherent_user_range | 129 | .long v3_coherent_user_range |
133 | .long v3_flush_kern_dcache_area | 130 | .long v3_flush_kern_dcache_area |
134 | .long v3_dma_inv_range | 131 | .long v3_dma_map_area |
135 | .long v3_dma_clean_range | 132 | .long v3_dma_unmap_area |
136 | .long v3_dma_flush_range | 133 | .long v3_dma_flush_range |
137 | .size v3_cache_fns, . - v3_cache_fns | 134 | .size v3_cache_fns, . - v3_cache_fns |
diff --git a/arch/arm/mm/cache-v4.S b/arch/arm/mm/cache-v4.S index 5c7da3e372e9..4810f7e3e813 100644 --- a/arch/arm/mm/cache-v4.S +++ b/arch/arm/mm/cache-v4.S | |||
@@ -94,20 +94,6 @@ ENTRY(v4_flush_kern_dcache_area) | |||
94 | /* FALLTHROUGH */ | 94 | /* FALLTHROUGH */ |
95 | 95 | ||
96 | /* | 96 | /* |
97 | * dma_inv_range(start, end) | ||
98 | * | ||
99 | * Invalidate (discard) the specified virtual address range. | ||
100 | * May not write back any entries. If 'start' or 'end' | ||
101 | * are not cache line aligned, those lines must be written | ||
102 | * back. | ||
103 | * | ||
104 | * - start - virtual start address | ||
105 | * - end - virtual end address | ||
106 | */ | ||
107 | ENTRY(v4_dma_inv_range) | ||
108 | /* FALLTHROUGH */ | ||
109 | |||
110 | /* | ||
111 | * dma_flush_range(start, end) | 97 | * dma_flush_range(start, end) |
112 | * | 98 | * |
113 | * Clean and invalidate the specified virtual address range. | 99 | * Clean and invalidate the specified virtual address range. |
@@ -120,18 +106,29 @@ ENTRY(v4_dma_flush_range) | |||
120 | mov r0, #0 | 106 | mov r0, #0 |
121 | mcr p15, 0, r0, c7, c7, 0 @ flush ID cache | 107 | mcr p15, 0, r0, c7, c7, 0 @ flush ID cache |
122 | #endif | 108 | #endif |
109 | mov pc, lr | ||
110 | |||
111 | /* | ||
112 | * dma_unmap_area(start, size, dir) | ||
113 | * - start - kernel virtual start address | ||
114 | * - size - size of region | ||
115 | * - dir - DMA direction | ||
116 | */ | ||
117 | ENTRY(v4_dma_unmap_area) | ||
118 | teq r2, #DMA_TO_DEVICE | ||
119 | bne v4_dma_flush_range | ||
123 | /* FALLTHROUGH */ | 120 | /* FALLTHROUGH */ |
124 | 121 | ||
125 | /* | 122 | /* |
126 | * dma_clean_range(start, end) | 123 | * dma_map_area(start, size, dir) |
127 | * | 124 | * - start - kernel virtual start address |
128 | * Clean (write back) the specified virtual address range. | 125 | * - size - size of region |
129 | * | 126 | * - dir - DMA direction |
130 | * - start - virtual start address | ||
131 | * - end - virtual end address | ||
132 | */ | 127 | */ |
133 | ENTRY(v4_dma_clean_range) | 128 | ENTRY(v4_dma_map_area) |
134 | mov pc, lr | 129 | mov pc, lr |
130 | ENDPROC(v4_dma_unmap_area) | ||
131 | ENDPROC(v4_dma_map_area) | ||
135 | 132 | ||
136 | __INITDATA | 133 | __INITDATA |
137 | 134 | ||
@@ -143,7 +140,7 @@ ENTRY(v4_cache_fns) | |||
143 | .long v4_coherent_kern_range | 140 | .long v4_coherent_kern_range |
144 | .long v4_coherent_user_range | 141 | .long v4_coherent_user_range |
145 | .long v4_flush_kern_dcache_area | 142 | .long v4_flush_kern_dcache_area |
146 | .long v4_dma_inv_range | 143 | .long v4_dma_map_area |
147 | .long v4_dma_clean_range | 144 | .long v4_dma_unmap_area |
148 | .long v4_dma_flush_range | 145 | .long v4_dma_flush_range |
149 | .size v4_cache_fns, . - v4_cache_fns | 146 | .size v4_cache_fns, . - v4_cache_fns |
diff --git a/arch/arm/mm/cache-v4wb.S b/arch/arm/mm/cache-v4wb.S index 3dbedf1ec0e7..df8368afa102 100644 --- a/arch/arm/mm/cache-v4wb.S +++ b/arch/arm/mm/cache-v4wb.S | |||
@@ -173,7 +173,7 @@ ENTRY(v4wb_coherent_user_range) | |||
173 | * - start - virtual start address | 173 | * - start - virtual start address |
174 | * - end - virtual end address | 174 | * - end - virtual end address |
175 | */ | 175 | */ |
176 | ENTRY(v4wb_dma_inv_range) | 176 | v4wb_dma_inv_range: |
177 | tst r0, #CACHE_DLINESIZE - 1 | 177 | tst r0, #CACHE_DLINESIZE - 1 |
178 | bic r0, r0, #CACHE_DLINESIZE - 1 | 178 | bic r0, r0, #CACHE_DLINESIZE - 1 |
179 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 179 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -194,7 +194,7 @@ ENTRY(v4wb_dma_inv_range) | |||
194 | * - start - virtual start address | 194 | * - start - virtual start address |
195 | * - end - virtual end address | 195 | * - end - virtual end address |
196 | */ | 196 | */ |
197 | ENTRY(v4wb_dma_clean_range) | 197 | v4wb_dma_clean_range: |
198 | bic r0, r0, #CACHE_DLINESIZE - 1 | 198 | bic r0, r0, #CACHE_DLINESIZE - 1 |
199 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 199 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
200 | add r0, r0, #CACHE_DLINESIZE | 200 | add r0, r0, #CACHE_DLINESIZE |
@@ -216,6 +216,30 @@ ENTRY(v4wb_dma_clean_range) | |||
216 | .globl v4wb_dma_flush_range | 216 | .globl v4wb_dma_flush_range |
217 | .set v4wb_dma_flush_range, v4wb_coherent_kern_range | 217 | .set v4wb_dma_flush_range, v4wb_coherent_kern_range |
218 | 218 | ||
219 | /* | ||
220 | * dma_map_area(start, size, dir) | ||
221 | * - start - kernel virtual start address | ||
222 | * - size - size of region | ||
223 | * - dir - DMA direction | ||
224 | */ | ||
225 | ENTRY(v4wb_dma_map_area) | ||
226 | add r1, r1, r0 | ||
227 | cmp r2, #DMA_TO_DEVICE | ||
228 | beq v4wb_dma_clean_range | ||
229 | bcs v4wb_dma_inv_range | ||
230 | b v4wb_dma_flush_range | ||
231 | ENDPROC(v4wb_dma_map_area) | ||
232 | |||
233 | /* | ||
234 | * dma_unmap_area(start, size, dir) | ||
235 | * - start - kernel virtual start address | ||
236 | * - size - size of region | ||
237 | * - dir - DMA direction | ||
238 | */ | ||
239 | ENTRY(v4wb_dma_unmap_area) | ||
240 | mov pc, lr | ||
241 | ENDPROC(v4wb_dma_unmap_area) | ||
242 | |||
219 | __INITDATA | 243 | __INITDATA |
220 | 244 | ||
221 | .type v4wb_cache_fns, #object | 245 | .type v4wb_cache_fns, #object |
@@ -226,7 +250,7 @@ ENTRY(v4wb_cache_fns) | |||
226 | .long v4wb_coherent_kern_range | 250 | .long v4wb_coherent_kern_range |
227 | .long v4wb_coherent_user_range | 251 | .long v4wb_coherent_user_range |
228 | .long v4wb_flush_kern_dcache_area | 252 | .long v4wb_flush_kern_dcache_area |
229 | .long v4wb_dma_inv_range | 253 | .long v4wb_dma_map_area |
230 | .long v4wb_dma_clean_range | 254 | .long v4wb_dma_unmap_area |
231 | .long v4wb_dma_flush_range | 255 | .long v4wb_dma_flush_range |
232 | .size v4wb_cache_fns, . - v4wb_cache_fns | 256 | .size v4wb_cache_fns, . - v4wb_cache_fns |
diff --git a/arch/arm/mm/cache-v4wt.S b/arch/arm/mm/cache-v4wt.S index b3b7410270b4..45c70312f43b 100644 --- a/arch/arm/mm/cache-v4wt.S +++ b/arch/arm/mm/cache-v4wt.S | |||
@@ -142,23 +142,12 @@ ENTRY(v4wt_flush_kern_dcache_area) | |||
142 | * - start - virtual start address | 142 | * - start - virtual start address |
143 | * - end - virtual end address | 143 | * - end - virtual end address |
144 | */ | 144 | */ |
145 | ENTRY(v4wt_dma_inv_range) | 145 | v4wt_dma_inv_range: |
146 | bic r0, r0, #CACHE_DLINESIZE - 1 | 146 | bic r0, r0, #CACHE_DLINESIZE - 1 |
147 | 1: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry | 147 | 1: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry |
148 | add r0, r0, #CACHE_DLINESIZE | 148 | add r0, r0, #CACHE_DLINESIZE |
149 | cmp r0, r1 | 149 | cmp r0, r1 |
150 | blo 1b | 150 | blo 1b |
151 | /* FALLTHROUGH */ | ||
152 | |||
153 | /* | ||
154 | * dma_clean_range(start, end) | ||
155 | * | ||
156 | * Clean the specified virtual address range. | ||
157 | * | ||
158 | * - start - virtual start address | ||
159 | * - end - virtual end address | ||
160 | */ | ||
161 | ENTRY(v4wt_dma_clean_range) | ||
162 | mov pc, lr | 151 | mov pc, lr |
163 | 152 | ||
164 | /* | 153 | /* |
@@ -172,6 +161,29 @@ ENTRY(v4wt_dma_clean_range) | |||
172 | .globl v4wt_dma_flush_range | 161 | .globl v4wt_dma_flush_range |
173 | .equ v4wt_dma_flush_range, v4wt_dma_inv_range | 162 | .equ v4wt_dma_flush_range, v4wt_dma_inv_range |
174 | 163 | ||
164 | /* | ||
165 | * dma_unmap_area(start, size, dir) | ||
166 | * - start - kernel virtual start address | ||
167 | * - size - size of region | ||
168 | * - dir - DMA direction | ||
169 | */ | ||
170 | ENTRY(v4wt_dma_unmap_area) | ||
171 | add r1, r1, r0 | ||
172 | teq r2, #DMA_TO_DEVICE | ||
173 | bne v4wt_dma_inv_range | ||
174 | /* FALLTHROUGH */ | ||
175 | |||
176 | /* | ||
177 | * dma_map_area(start, size, dir) | ||
178 | * - start - kernel virtual start address | ||
179 | * - size - size of region | ||
180 | * - dir - DMA direction | ||
181 | */ | ||
182 | ENTRY(v4wt_dma_map_area) | ||
183 | mov pc, lr | ||
184 | ENDPROC(v4wt_dma_unmap_area) | ||
185 | ENDPROC(v4wt_dma_map_area) | ||
186 | |||
175 | __INITDATA | 187 | __INITDATA |
176 | 188 | ||
177 | .type v4wt_cache_fns, #object | 189 | .type v4wt_cache_fns, #object |
@@ -182,7 +194,7 @@ ENTRY(v4wt_cache_fns) | |||
182 | .long v4wt_coherent_kern_range | 194 | .long v4wt_coherent_kern_range |
183 | .long v4wt_coherent_user_range | 195 | .long v4wt_coherent_user_range |
184 | .long v4wt_flush_kern_dcache_area | 196 | .long v4wt_flush_kern_dcache_area |
185 | .long v4wt_dma_inv_range | 197 | .long v4wt_dma_map_area |
186 | .long v4wt_dma_clean_range | 198 | .long v4wt_dma_unmap_area |
187 | .long v4wt_dma_flush_range | 199 | .long v4wt_dma_flush_range |
188 | .size v4wt_cache_fns, . - v4wt_cache_fns | 200 | .size v4wt_cache_fns, . - v4wt_cache_fns |
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S index 4ba0a24ce6f5..9d89c67a1cc3 100644 --- a/arch/arm/mm/cache-v6.S +++ b/arch/arm/mm/cache-v6.S | |||
@@ -195,7 +195,7 @@ ENTRY(v6_flush_kern_dcache_area) | |||
195 | * - start - virtual start address of region | 195 | * - start - virtual start address of region |
196 | * - end - virtual end address of region | 196 | * - end - virtual end address of region |
197 | */ | 197 | */ |
198 | ENTRY(v6_dma_inv_range) | 198 | v6_dma_inv_range: |
199 | tst r0, #D_CACHE_LINE_SIZE - 1 | 199 | tst r0, #D_CACHE_LINE_SIZE - 1 |
200 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 | 200 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 |
201 | #ifdef HARVARD_CACHE | 201 | #ifdef HARVARD_CACHE |
@@ -228,7 +228,7 @@ ENTRY(v6_dma_inv_range) | |||
228 | * - start - virtual start address of region | 228 | * - start - virtual start address of region |
229 | * - end - virtual end address of region | 229 | * - end - virtual end address of region |
230 | */ | 230 | */ |
231 | ENTRY(v6_dma_clean_range) | 231 | v6_dma_clean_range: |
232 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 | 232 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 |
233 | 1: | 233 | 1: |
234 | #ifdef HARVARD_CACHE | 234 | #ifdef HARVARD_CACHE |
@@ -263,6 +263,32 @@ ENTRY(v6_dma_flush_range) | |||
263 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | 263 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer |
264 | mov pc, lr | 264 | mov pc, lr |
265 | 265 | ||
266 | /* | ||
267 | * dma_map_area(start, size, dir) | ||
268 | * - start - kernel virtual start address | ||
269 | * - size - size of region | ||
270 | * - dir - DMA direction | ||
271 | */ | ||
272 | ENTRY(v6_dma_map_area) | ||
273 | add r1, r1, r0 | ||
274 | teq r2, #DMA_FROM_DEVICE | ||
275 | beq v6_dma_inv_range | ||
276 | b v6_dma_clean_range | ||
277 | ENDPROC(v6_dma_map_area) | ||
278 | |||
279 | /* | ||
280 | * dma_unmap_area(start, size, dir) | ||
281 | * - start - kernel virtual start address | ||
282 | * - size - size of region | ||
283 | * - dir - DMA direction | ||
284 | */ | ||
285 | ENTRY(v6_dma_unmap_area) | ||
286 | add r1, r1, r0 | ||
287 | teq r2, #DMA_TO_DEVICE | ||
288 | bne v6_dma_inv_range | ||
289 | mov pc, lr | ||
290 | ENDPROC(v6_dma_unmap_area) | ||
291 | |||
266 | __INITDATA | 292 | __INITDATA |
267 | 293 | ||
268 | .type v6_cache_fns, #object | 294 | .type v6_cache_fns, #object |
@@ -273,7 +299,7 @@ ENTRY(v6_cache_fns) | |||
273 | .long v6_coherent_kern_range | 299 | .long v6_coherent_kern_range |
274 | .long v6_coherent_user_range | 300 | .long v6_coherent_user_range |
275 | .long v6_flush_kern_dcache_area | 301 | .long v6_flush_kern_dcache_area |
276 | .long v6_dma_inv_range | 302 | .long v6_dma_map_area |
277 | .long v6_dma_clean_range | 303 | .long v6_dma_unmap_area |
278 | .long v6_dma_flush_range | 304 | .long v6_dma_flush_range |
279 | .size v6_cache_fns, . - v6_cache_fns | 305 | .size v6_cache_fns, . - v6_cache_fns |
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index 9073db849fb4..bcd64f265870 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S | |||
@@ -216,7 +216,7 @@ ENDPROC(v7_flush_kern_dcache_area) | |||
216 | * - start - virtual start address of region | 216 | * - start - virtual start address of region |
217 | * - end - virtual end address of region | 217 | * - end - virtual end address of region |
218 | */ | 218 | */ |
219 | ENTRY(v7_dma_inv_range) | 219 | v7_dma_inv_range: |
220 | dcache_line_size r2, r3 | 220 | dcache_line_size r2, r3 |
221 | sub r3, r2, #1 | 221 | sub r3, r2, #1 |
222 | tst r0, r3 | 222 | tst r0, r3 |
@@ -240,7 +240,7 @@ ENDPROC(v7_dma_inv_range) | |||
240 | * - start - virtual start address of region | 240 | * - start - virtual start address of region |
241 | * - end - virtual end address of region | 241 | * - end - virtual end address of region |
242 | */ | 242 | */ |
243 | ENTRY(v7_dma_clean_range) | 243 | v7_dma_clean_range: |
244 | dcache_line_size r2, r3 | 244 | dcache_line_size r2, r3 |
245 | sub r3, r2, #1 | 245 | sub r3, r2, #1 |
246 | bic r0, r0, r3 | 246 | bic r0, r0, r3 |
@@ -271,6 +271,32 @@ ENTRY(v7_dma_flush_range) | |||
271 | mov pc, lr | 271 | mov pc, lr |
272 | ENDPROC(v7_dma_flush_range) | 272 | ENDPROC(v7_dma_flush_range) |
273 | 273 | ||
274 | /* | ||
275 | * dma_map_area(start, size, dir) | ||
276 | * - start - kernel virtual start address | ||
277 | * - size - size of region | ||
278 | * - dir - DMA direction | ||
279 | */ | ||
280 | ENTRY(v7_dma_map_area) | ||
281 | add r1, r1, r0 | ||
282 | teq r2, #DMA_FROM_DEVICE | ||
283 | beq v7_dma_inv_range | ||
284 | b v7_dma_clean_range | ||
285 | ENDPROC(v7_dma_map_area) | ||
286 | |||
287 | /* | ||
288 | * dma_unmap_area(start, size, dir) | ||
289 | * - start - kernel virtual start address | ||
290 | * - size - size of region | ||
291 | * - dir - DMA direction | ||
292 | */ | ||
293 | ENTRY(v7_dma_unmap_area) | ||
294 | add r1, r1, r0 | ||
295 | teq r2, #DMA_TO_DEVICE | ||
296 | bne v7_dma_inv_range | ||
297 | mov pc, lr | ||
298 | ENDPROC(v7_dma_unmap_area) | ||
299 | |||
274 | __INITDATA | 300 | __INITDATA |
275 | 301 | ||
276 | .type v7_cache_fns, #object | 302 | .type v7_cache_fns, #object |
@@ -281,7 +307,7 @@ ENTRY(v7_cache_fns) | |||
281 | .long v7_coherent_kern_range | 307 | .long v7_coherent_kern_range |
282 | .long v7_coherent_user_range | 308 | .long v7_coherent_user_range |
283 | .long v7_flush_kern_dcache_area | 309 | .long v7_flush_kern_dcache_area |
284 | .long v7_dma_inv_range | 310 | .long v7_dma_map_area |
285 | .long v7_dma_clean_range | 311 | .long v7_dma_unmap_area |
286 | .long v7_dma_flush_range | 312 | .long v7_dma_flush_range |
287 | .size v7_cache_fns, . - v7_cache_fns | 313 | .size v7_cache_fns, . - v7_cache_fns |
diff --git a/arch/arm/mm/cache-xsc3l2.c b/arch/arm/mm/cache-xsc3l2.c index 5d180cb0bd94..c3154928bccd 100644 --- a/arch/arm/mm/cache-xsc3l2.c +++ b/arch/arm/mm/cache-xsc3l2.c | |||
@@ -221,15 +221,14 @@ static int __init xsc3_l2_init(void) | |||
221 | if (!cpu_is_xsc3() || !xsc3_l2_present()) | 221 | if (!cpu_is_xsc3() || !xsc3_l2_present()) |
222 | return 0; | 222 | return 0; |
223 | 223 | ||
224 | if (!(get_cr() & CR_L2)) { | 224 | if (get_cr() & CR_L2) { |
225 | pr_info("XScale3 L2 cache enabled.\n"); | 225 | pr_info("XScale3 L2 cache enabled.\n"); |
226 | adjust_cr(CR_L2, CR_L2); | ||
227 | xsc3_l2_inv_all(); | 226 | xsc3_l2_inv_all(); |
228 | } | ||
229 | 227 | ||
230 | outer_cache.inv_range = xsc3_l2_inv_range; | 228 | outer_cache.inv_range = xsc3_l2_inv_range; |
231 | outer_cache.clean_range = xsc3_l2_clean_range; | 229 | outer_cache.clean_range = xsc3_l2_clean_range; |
232 | outer_cache.flush_range = xsc3_l2_flush_range; | 230 | outer_cache.flush_range = xsc3_l2_flush_range; |
231 | } | ||
233 | 232 | ||
234 | return 0; | 233 | return 0; |
235 | } | 234 | } |
diff --git a/arch/arm/mm/copypage-feroceon.c b/arch/arm/mm/copypage-feroceon.c index 70997d5bee2d..5eb4fd93893d 100644 --- a/arch/arm/mm/copypage-feroceon.c +++ b/arch/arm/mm/copypage-feroceon.c | |||
@@ -68,12 +68,13 @@ feroceon_copy_user_page(void *kto, const void *kfrom) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | void feroceon_copy_user_highpage(struct page *to, struct page *from, | 70 | void feroceon_copy_user_highpage(struct page *to, struct page *from, |
71 | unsigned long vaddr) | 71 | unsigned long vaddr, struct vm_area_struct *vma) |
72 | { | 72 | { |
73 | void *kto, *kfrom; | 73 | void *kto, *kfrom; |
74 | 74 | ||
75 | kto = kmap_atomic(to, KM_USER0); | 75 | kto = kmap_atomic(to, KM_USER0); |
76 | kfrom = kmap_atomic(from, KM_USER1); | 76 | kfrom = kmap_atomic(from, KM_USER1); |
77 | flush_cache_page(vma, vaddr, page_to_pfn(from)); | ||
77 | feroceon_copy_user_page(kto, kfrom); | 78 | feroceon_copy_user_page(kto, kfrom); |
78 | kunmap_atomic(kfrom, KM_USER1); | 79 | kunmap_atomic(kfrom, KM_USER1); |
79 | kunmap_atomic(kto, KM_USER0); | 80 | kunmap_atomic(kto, KM_USER0); |
diff --git a/arch/arm/mm/copypage-v3.c b/arch/arm/mm/copypage-v3.c index de9c06854ad7..f72303e1d804 100644 --- a/arch/arm/mm/copypage-v3.c +++ b/arch/arm/mm/copypage-v3.c | |||
@@ -38,7 +38,7 @@ v3_copy_user_page(void *kto, const void *kfrom) | |||
38 | } | 38 | } |
39 | 39 | ||
40 | void v3_copy_user_highpage(struct page *to, struct page *from, | 40 | void v3_copy_user_highpage(struct page *to, struct page *from, |
41 | unsigned long vaddr) | 41 | unsigned long vaddr, struct vm_area_struct *vma) |
42 | { | 42 | { |
43 | void *kto, *kfrom; | 43 | void *kto, *kfrom; |
44 | 44 | ||
diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c index 7370a7142b04..598c51ad5071 100644 --- a/arch/arm/mm/copypage-v4mc.c +++ b/arch/arm/mm/copypage-v4mc.c | |||
@@ -69,7 +69,7 @@ mc_copy_user_page(void *from, void *to) | |||
69 | } | 69 | } |
70 | 70 | ||
71 | void v4_mc_copy_user_highpage(struct page *to, struct page *from, | 71 | void v4_mc_copy_user_highpage(struct page *to, struct page *from, |
72 | unsigned long vaddr) | 72 | unsigned long vaddr, struct vm_area_struct *vma) |
73 | { | 73 | { |
74 | void *kto = kmap_atomic(to, KM_USER1); | 74 | void *kto = kmap_atomic(to, KM_USER1); |
75 | 75 | ||
diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c index 9ab098414227..7c2eb55cd4a9 100644 --- a/arch/arm/mm/copypage-v4wb.c +++ b/arch/arm/mm/copypage-v4wb.c | |||
@@ -48,12 +48,13 @@ v4wb_copy_user_page(void *kto, const void *kfrom) | |||
48 | } | 48 | } |
49 | 49 | ||
50 | void v4wb_copy_user_highpage(struct page *to, struct page *from, | 50 | void v4wb_copy_user_highpage(struct page *to, struct page *from, |
51 | unsigned long vaddr) | 51 | unsigned long vaddr, struct vm_area_struct *vma) |
52 | { | 52 | { |
53 | void *kto, *kfrom; | 53 | void *kto, *kfrom; |
54 | 54 | ||
55 | kto = kmap_atomic(to, KM_USER0); | 55 | kto = kmap_atomic(to, KM_USER0); |
56 | kfrom = kmap_atomic(from, KM_USER1); | 56 | kfrom = kmap_atomic(from, KM_USER1); |
57 | flush_cache_page(vma, vaddr, page_to_pfn(from)); | ||
57 | v4wb_copy_user_page(kto, kfrom); | 58 | v4wb_copy_user_page(kto, kfrom); |
58 | kunmap_atomic(kfrom, KM_USER1); | 59 | kunmap_atomic(kfrom, KM_USER1); |
59 | kunmap_atomic(kto, KM_USER0); | 60 | kunmap_atomic(kto, KM_USER0); |
diff --git a/arch/arm/mm/copypage-v4wt.c b/arch/arm/mm/copypage-v4wt.c index 300efafd6643..172e6a55458e 100644 --- a/arch/arm/mm/copypage-v4wt.c +++ b/arch/arm/mm/copypage-v4wt.c | |||
@@ -44,7 +44,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom) | |||
44 | } | 44 | } |
45 | 45 | ||
46 | void v4wt_copy_user_highpage(struct page *to, struct page *from, | 46 | void v4wt_copy_user_highpage(struct page *to, struct page *from, |
47 | unsigned long vaddr) | 47 | unsigned long vaddr, struct vm_area_struct *vma) |
48 | { | 48 | { |
49 | void *kto, *kfrom; | 49 | void *kto, *kfrom; |
50 | 50 | ||
diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c index 0fa1319273de..8bca4dea6dfa 100644 --- a/arch/arm/mm/copypage-v6.c +++ b/arch/arm/mm/copypage-v6.c | |||
@@ -34,7 +34,7 @@ static DEFINE_SPINLOCK(v6_lock); | |||
34 | * attack the kernel's existing mapping of these pages. | 34 | * attack the kernel's existing mapping of these pages. |
35 | */ | 35 | */ |
36 | static void v6_copy_user_highpage_nonaliasing(struct page *to, | 36 | static void v6_copy_user_highpage_nonaliasing(struct page *to, |
37 | struct page *from, unsigned long vaddr) | 37 | struct page *from, unsigned long vaddr, struct vm_area_struct *vma) |
38 | { | 38 | { |
39 | void *kto, *kfrom; | 39 | void *kto, *kfrom; |
40 | 40 | ||
@@ -81,7 +81,7 @@ static void discard_old_kernel_data(void *kto) | |||
81 | * Copy the page, taking account of the cache colour. | 81 | * Copy the page, taking account of the cache colour. |
82 | */ | 82 | */ |
83 | static void v6_copy_user_highpage_aliasing(struct page *to, | 83 | static void v6_copy_user_highpage_aliasing(struct page *to, |
84 | struct page *from, unsigned long vaddr) | 84 | struct page *from, unsigned long vaddr, struct vm_area_struct *vma) |
85 | { | 85 | { |
86 | unsigned int offset = CACHE_COLOUR(vaddr); | 86 | unsigned int offset = CACHE_COLOUR(vaddr); |
87 | unsigned long kfrom, kto; | 87 | unsigned long kfrom, kto; |
diff --git a/arch/arm/mm/copypage-xsc3.c b/arch/arm/mm/copypage-xsc3.c index bc4525f5ab23..747ad4140fc7 100644 --- a/arch/arm/mm/copypage-xsc3.c +++ b/arch/arm/mm/copypage-xsc3.c | |||
@@ -71,12 +71,13 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom) | |||
71 | } | 71 | } |
72 | 72 | ||
73 | void xsc3_mc_copy_user_highpage(struct page *to, struct page *from, | 73 | void xsc3_mc_copy_user_highpage(struct page *to, struct page *from, |
74 | unsigned long vaddr) | 74 | unsigned long vaddr, struct vm_area_struct *vma) |
75 | { | 75 | { |
76 | void *kto, *kfrom; | 76 | void *kto, *kfrom; |
77 | 77 | ||
78 | kto = kmap_atomic(to, KM_USER0); | 78 | kto = kmap_atomic(to, KM_USER0); |
79 | kfrom = kmap_atomic(from, KM_USER1); | 79 | kfrom = kmap_atomic(from, KM_USER1); |
80 | flush_cache_page(vma, vaddr, page_to_pfn(from)); | ||
80 | xsc3_mc_copy_user_page(kto, kfrom); | 81 | xsc3_mc_copy_user_page(kto, kfrom); |
81 | kunmap_atomic(kfrom, KM_USER1); | 82 | kunmap_atomic(kfrom, KM_USER1); |
82 | kunmap_atomic(kto, KM_USER0); | 83 | kunmap_atomic(kto, KM_USER0); |
diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c index 76824d3e966a..9920c0ae2096 100644 --- a/arch/arm/mm/copypage-xscale.c +++ b/arch/arm/mm/copypage-xscale.c | |||
@@ -91,7 +91,7 @@ mc_copy_user_page(void *from, void *to) | |||
91 | } | 91 | } |
92 | 92 | ||
93 | void xscale_mc_copy_user_highpage(struct page *to, struct page *from, | 93 | void xscale_mc_copy_user_highpage(struct page *to, struct page *from, |
94 | unsigned long vaddr) | 94 | unsigned long vaddr, struct vm_area_struct *vma) |
95 | { | 95 | { |
96 | void *kto = kmap_atomic(to, KM_USER1); | 96 | void *kto = kmap_atomic(to, KM_USER1); |
97 | 97 | ||
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 26325cb5d368..64daef2173bd 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -404,78 +404,44 @@ EXPORT_SYMBOL(dma_free_coherent); | |||
404 | * platforms with CONFIG_DMABOUNCE. | 404 | * platforms with CONFIG_DMABOUNCE. |
405 | * Use the driver DMA support - see dma-mapping.h (dma_sync_*) | 405 | * Use the driver DMA support - see dma-mapping.h (dma_sync_*) |
406 | */ | 406 | */ |
407 | void dma_cache_maint(const void *start, size_t size, int direction) | 407 | void ___dma_single_cpu_to_dev(const void *kaddr, size_t size, |
408 | enum dma_data_direction dir) | ||
408 | { | 409 | { |
409 | void (*inner_op)(const void *, const void *); | 410 | unsigned long paddr; |
410 | void (*outer_op)(unsigned long, unsigned long); | 411 | |
411 | 412 | BUG_ON(!virt_addr_valid(kaddr) || !virt_addr_valid(kaddr + size - 1)); | |
412 | BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(start + size - 1)); | 413 | |
413 | 414 | dmac_map_area(kaddr, size, dir); | |
414 | switch (direction) { | ||
415 | case DMA_FROM_DEVICE: /* invalidate only */ | ||
416 | inner_op = dmac_inv_range; | ||
417 | outer_op = outer_inv_range; | ||
418 | break; | ||
419 | case DMA_TO_DEVICE: /* writeback only */ | ||
420 | inner_op = dmac_clean_range; | ||
421 | outer_op = outer_clean_range; | ||
422 | break; | ||
423 | case DMA_BIDIRECTIONAL: /* writeback and invalidate */ | ||
424 | inner_op = dmac_flush_range; | ||
425 | outer_op = outer_flush_range; | ||
426 | break; | ||
427 | default: | ||
428 | BUG(); | ||
429 | } | ||
430 | 415 | ||
431 | inner_op(start, start + size); | 416 | paddr = __pa(kaddr); |
432 | outer_op(__pa(start), __pa(start) + size); | 417 | if (dir == DMA_FROM_DEVICE) { |
418 | outer_inv_range(paddr, paddr + size); | ||
419 | } else { | ||
420 | outer_clean_range(paddr, paddr + size); | ||
421 | } | ||
422 | /* FIXME: non-speculating: flush on bidirectional mappings? */ | ||
433 | } | 423 | } |
434 | EXPORT_SYMBOL(dma_cache_maint); | 424 | EXPORT_SYMBOL(___dma_single_cpu_to_dev); |
435 | 425 | ||
436 | static void dma_cache_maint_contiguous(struct page *page, unsigned long offset, | 426 | void ___dma_single_dev_to_cpu(const void *kaddr, size_t size, |
437 | size_t size, int direction) | 427 | enum dma_data_direction dir) |
438 | { | 428 | { |
439 | void *vaddr; | 429 | BUG_ON(!virt_addr_valid(kaddr) || !virt_addr_valid(kaddr + size - 1)); |
440 | unsigned long paddr; | ||
441 | void (*inner_op)(const void *, const void *); | ||
442 | void (*outer_op)(unsigned long, unsigned long); | ||
443 | |||
444 | switch (direction) { | ||
445 | case DMA_FROM_DEVICE: /* invalidate only */ | ||
446 | inner_op = dmac_inv_range; | ||
447 | outer_op = outer_inv_range; | ||
448 | break; | ||
449 | case DMA_TO_DEVICE: /* writeback only */ | ||
450 | inner_op = dmac_clean_range; | ||
451 | outer_op = outer_clean_range; | ||
452 | break; | ||
453 | case DMA_BIDIRECTIONAL: /* writeback and invalidate */ | ||
454 | inner_op = dmac_flush_range; | ||
455 | outer_op = outer_flush_range; | ||
456 | break; | ||
457 | default: | ||
458 | BUG(); | ||
459 | } | ||
460 | 430 | ||
461 | if (!PageHighMem(page)) { | 431 | /* FIXME: non-speculating: not required */ |
462 | vaddr = page_address(page) + offset; | 432 | /* don't bother invalidating if DMA to device */ |
463 | inner_op(vaddr, vaddr + size); | 433 | if (dir != DMA_TO_DEVICE) { |
464 | } else { | 434 | unsigned long paddr = __pa(kaddr); |
465 | vaddr = kmap_high_get(page); | 435 | outer_inv_range(paddr, paddr + size); |
466 | if (vaddr) { | ||
467 | vaddr += offset; | ||
468 | inner_op(vaddr, vaddr + size); | ||
469 | kunmap_high(page); | ||
470 | } | ||
471 | } | 436 | } |
472 | 437 | ||
473 | paddr = page_to_phys(page) + offset; | 438 | dmac_unmap_area(kaddr, size, dir); |
474 | outer_op(paddr, paddr + size); | ||
475 | } | 439 | } |
440 | EXPORT_SYMBOL(___dma_single_dev_to_cpu); | ||
476 | 441 | ||
477 | void dma_cache_maint_page(struct page *page, unsigned long offset, | 442 | static void dma_cache_maint_page(struct page *page, unsigned long offset, |
478 | size_t size, int dir) | 443 | size_t size, enum dma_data_direction dir, |
444 | void (*op)(const void *, size_t, int)) | ||
479 | { | 445 | { |
480 | /* | 446 | /* |
481 | * A single sg entry may refer to multiple physically contiguous | 447 | * A single sg entry may refer to multiple physically contiguous |
@@ -486,20 +452,62 @@ void dma_cache_maint_page(struct page *page, unsigned long offset, | |||
486 | size_t left = size; | 452 | size_t left = size; |
487 | do { | 453 | do { |
488 | size_t len = left; | 454 | size_t len = left; |
489 | if (PageHighMem(page) && len + offset > PAGE_SIZE) { | 455 | void *vaddr; |
490 | if (offset >= PAGE_SIZE) { | 456 | |
491 | page += offset / PAGE_SIZE; | 457 | if (PageHighMem(page)) { |
492 | offset %= PAGE_SIZE; | 458 | if (len + offset > PAGE_SIZE) { |
459 | if (offset >= PAGE_SIZE) { | ||
460 | page += offset / PAGE_SIZE; | ||
461 | offset %= PAGE_SIZE; | ||
462 | } | ||
463 | len = PAGE_SIZE - offset; | ||
493 | } | 464 | } |
494 | len = PAGE_SIZE - offset; | 465 | vaddr = kmap_high_get(page); |
466 | if (vaddr) { | ||
467 | vaddr += offset; | ||
468 | op(vaddr, len, dir); | ||
469 | kunmap_high(page); | ||
470 | } | ||
471 | } else { | ||
472 | vaddr = page_address(page) + offset; | ||
473 | op(vaddr, len, dir); | ||
495 | } | 474 | } |
496 | dma_cache_maint_contiguous(page, offset, len, dir); | ||
497 | offset = 0; | 475 | offset = 0; |
498 | page++; | 476 | page++; |
499 | left -= len; | 477 | left -= len; |
500 | } while (left); | 478 | } while (left); |
501 | } | 479 | } |
502 | EXPORT_SYMBOL(dma_cache_maint_page); | 480 | |
481 | void ___dma_page_cpu_to_dev(struct page *page, unsigned long off, | ||
482 | size_t size, enum dma_data_direction dir) | ||
483 | { | ||
484 | unsigned long paddr; | ||
485 | |||
486 | dma_cache_maint_page(page, off, size, dir, dmac_map_area); | ||
487 | |||
488 | paddr = page_to_phys(page) + off; | ||
489 | if (dir == DMA_FROM_DEVICE) { | ||
490 | outer_inv_range(paddr, paddr + size); | ||
491 | } else { | ||
492 | outer_clean_range(paddr, paddr + size); | ||
493 | } | ||
494 | /* FIXME: non-speculating: flush on bidirectional mappings? */ | ||
495 | } | ||
496 | EXPORT_SYMBOL(___dma_page_cpu_to_dev); | ||
497 | |||
498 | void ___dma_page_dev_to_cpu(struct page *page, unsigned long off, | ||
499 | size_t size, enum dma_data_direction dir) | ||
500 | { | ||
501 | unsigned long paddr = page_to_phys(page) + off; | ||
502 | |||
503 | /* FIXME: non-speculating: not required */ | ||
504 | /* don't bother invalidating if DMA to device */ | ||
505 | if (dir != DMA_TO_DEVICE) | ||
506 | outer_inv_range(paddr, paddr + size); | ||
507 | |||
508 | dma_cache_maint_page(page, off, size, dir, dmac_unmap_area); | ||
509 | } | ||
510 | EXPORT_SYMBOL(___dma_page_dev_to_cpu); | ||
503 | 511 | ||
504 | /** | 512 | /** |
505 | * dma_map_sg - map a set of SG buffers for streaming mode DMA | 513 | * dma_map_sg - map a set of SG buffers for streaming mode DMA |
@@ -573,8 +581,12 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | |||
573 | int i; | 581 | int i; |
574 | 582 | ||
575 | for_each_sg(sg, s, nents, i) { | 583 | for_each_sg(sg, s, nents, i) { |
576 | dmabounce_sync_for_cpu(dev, sg_dma_address(s), 0, | 584 | if (!dmabounce_sync_for_cpu(dev, sg_dma_address(s), 0, |
577 | sg_dma_len(s), dir); | 585 | sg_dma_len(s), dir)) |
586 | continue; | ||
587 | |||
588 | __dma_page_dev_to_cpu(sg_page(s), s->offset, | ||
589 | s->length, dir); | ||
578 | } | 590 | } |
579 | } | 591 | } |
580 | EXPORT_SYMBOL(dma_sync_sg_for_cpu); | 592 | EXPORT_SYMBOL(dma_sync_sg_for_cpu); |
@@ -597,9 +609,8 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
597 | sg_dma_len(s), dir)) | 609 | sg_dma_len(s), dir)) |
598 | continue; | 610 | continue; |
599 | 611 | ||
600 | if (!arch_is_coherent()) | 612 | __dma_page_cpu_to_dev(sg_page(s), s->offset, |
601 | dma_cache_maint_page(sg_page(s), s->offset, | 613 | s->length, dir); |
602 | s->length, dir); | ||
603 | } | 614 | } |
604 | } | 615 | } |
605 | EXPORT_SYMBOL(dma_sync_sg_for_device); | 616 | EXPORT_SYMBOL(dma_sync_sg_for_device); |
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c index 56ee15321b00..c9b97e9836a2 100644 --- a/arch/arm/mm/fault-armv.c +++ b/arch/arm/mm/fault-armv.c | |||
@@ -36,28 +36,12 @@ static unsigned long shared_pte_mask = L_PTE_MT_BUFFERABLE; | |||
36 | * Therefore those configurations which might call adjust_pte (those | 36 | * Therefore those configurations which might call adjust_pte (those |
37 | * without CONFIG_CPU_CACHE_VIPT) cannot support split page_table_lock. | 37 | * without CONFIG_CPU_CACHE_VIPT) cannot support split page_table_lock. |
38 | */ | 38 | */ |
39 | static int adjust_pte(struct vm_area_struct *vma, unsigned long address) | 39 | static int do_adjust_pte(struct vm_area_struct *vma, unsigned long address, |
40 | unsigned long pfn, pte_t *ptep) | ||
40 | { | 41 | { |
41 | pgd_t *pgd; | 42 | pte_t entry = *ptep; |
42 | pmd_t *pmd; | ||
43 | pte_t *pte, entry; | ||
44 | int ret; | 43 | int ret; |
45 | 44 | ||
46 | pgd = pgd_offset(vma->vm_mm, address); | ||
47 | if (pgd_none(*pgd)) | ||
48 | goto no_pgd; | ||
49 | if (pgd_bad(*pgd)) | ||
50 | goto bad_pgd; | ||
51 | |||
52 | pmd = pmd_offset(pgd, address); | ||
53 | if (pmd_none(*pmd)) | ||
54 | goto no_pmd; | ||
55 | if (pmd_bad(*pmd)) | ||
56 | goto bad_pmd; | ||
57 | |||
58 | pte = pte_offset_map(pmd, address); | ||
59 | entry = *pte; | ||
60 | |||
61 | /* | 45 | /* |
62 | * If this page is present, it's actually being shared. | 46 | * If this page is present, it's actually being shared. |
63 | */ | 47 | */ |
@@ -68,33 +52,55 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address) | |||
68 | * fault (ie, is old), we can safely ignore any issues. | 52 | * fault (ie, is old), we can safely ignore any issues. |
69 | */ | 53 | */ |
70 | if (ret && (pte_val(entry) & L_PTE_MT_MASK) != shared_pte_mask) { | 54 | if (ret && (pte_val(entry) & L_PTE_MT_MASK) != shared_pte_mask) { |
71 | unsigned long pfn = pte_pfn(entry); | ||
72 | flush_cache_page(vma, address, pfn); | 55 | flush_cache_page(vma, address, pfn); |
73 | outer_flush_range((pfn << PAGE_SHIFT), | 56 | outer_flush_range((pfn << PAGE_SHIFT), |
74 | (pfn << PAGE_SHIFT) + PAGE_SIZE); | 57 | (pfn << PAGE_SHIFT) + PAGE_SIZE); |
75 | pte_val(entry) &= ~L_PTE_MT_MASK; | 58 | pte_val(entry) &= ~L_PTE_MT_MASK; |
76 | pte_val(entry) |= shared_pte_mask; | 59 | pte_val(entry) |= shared_pte_mask; |
77 | set_pte_at(vma->vm_mm, address, pte, entry); | 60 | set_pte_at(vma->vm_mm, address, ptep, entry); |
78 | flush_tlb_page(vma, address); | 61 | flush_tlb_page(vma, address); |
79 | } | 62 | } |
80 | pte_unmap(pte); | 63 | |
81 | return ret; | 64 | return ret; |
65 | } | ||
66 | |||
67 | static int adjust_pte(struct vm_area_struct *vma, unsigned long address, | ||
68 | unsigned long pfn) | ||
69 | { | ||
70 | spinlock_t *ptl; | ||
71 | pgd_t *pgd; | ||
72 | pmd_t *pmd; | ||
73 | pte_t *pte; | ||
74 | int ret; | ||
75 | |||
76 | pgd = pgd_offset(vma->vm_mm, address); | ||
77 | if (pgd_none_or_clear_bad(pgd)) | ||
78 | return 0; | ||
79 | |||
80 | pmd = pmd_offset(pgd, address); | ||
81 | if (pmd_none_or_clear_bad(pmd)) | ||
82 | return 0; | ||
82 | 83 | ||
83 | bad_pgd: | 84 | /* |
84 | pgd_ERROR(*pgd); | 85 | * This is called while another page table is mapped, so we |
85 | pgd_clear(pgd); | 86 | * must use the nested version. This also means we need to |
86 | no_pgd: | 87 | * open-code the spin-locking. |
87 | return 0; | 88 | */ |
88 | 89 | ptl = pte_lockptr(vma->vm_mm, pmd); | |
89 | bad_pmd: | 90 | pte = pte_offset_map_nested(pmd, address); |
90 | pmd_ERROR(*pmd); | 91 | spin_lock(ptl); |
91 | pmd_clear(pmd); | 92 | |
92 | no_pmd: | 93 | ret = do_adjust_pte(vma, address, pfn, pte); |
93 | return 0; | 94 | |
95 | spin_unlock(ptl); | ||
96 | pte_unmap_nested(pte); | ||
97 | |||
98 | return ret; | ||
94 | } | 99 | } |
95 | 100 | ||
96 | static void | 101 | static void |
97 | make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigned long addr, unsigned long pfn) | 102 | make_coherent(struct address_space *mapping, struct vm_area_struct *vma, |
103 | unsigned long addr, pte_t *ptep, unsigned long pfn) | ||
98 | { | 104 | { |
99 | struct mm_struct *mm = vma->vm_mm; | 105 | struct mm_struct *mm = vma->vm_mm; |
100 | struct vm_area_struct *mpnt; | 106 | struct vm_area_struct *mpnt; |
@@ -122,11 +128,11 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigne | |||
122 | if (!(mpnt->vm_flags & VM_MAYSHARE)) | 128 | if (!(mpnt->vm_flags & VM_MAYSHARE)) |
123 | continue; | 129 | continue; |
124 | offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT; | 130 | offset = (pgoff - mpnt->vm_pgoff) << PAGE_SHIFT; |
125 | aliases += adjust_pte(mpnt, mpnt->vm_start + offset); | 131 | aliases += adjust_pte(mpnt, mpnt->vm_start + offset, pfn); |
126 | } | 132 | } |
127 | flush_dcache_mmap_unlock(mapping); | 133 | flush_dcache_mmap_unlock(mapping); |
128 | if (aliases) | 134 | if (aliases) |
129 | adjust_pte(vma, addr); | 135 | do_adjust_pte(vma, addr, pfn, ptep); |
130 | else | 136 | else |
131 | flush_cache_page(vma, addr, pfn); | 137 | flush_cache_page(vma, addr, pfn); |
132 | } | 138 | } |
@@ -144,9 +150,10 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigne | |||
144 | * | 150 | * |
145 | * Note that the pte lock will be held. | 151 | * Note that the pte lock will be held. |
146 | */ | 152 | */ |
147 | void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte) | 153 | void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, |
154 | pte_t *ptep) | ||
148 | { | 155 | { |
149 | unsigned long pfn = pte_pfn(pte); | 156 | unsigned long pfn = pte_pfn(*ptep); |
150 | struct address_space *mapping; | 157 | struct address_space *mapping; |
151 | struct page *page; | 158 | struct page *page; |
152 | 159 | ||
@@ -168,7 +175,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte) | |||
168 | #endif | 175 | #endif |
169 | if (mapping) { | 176 | if (mapping) { |
170 | if (cache_is_vivt()) | 177 | if (cache_is_vivt()) |
171 | make_coherent(mapping, vma, addr, pfn); | 178 | make_coherent(mapping, vma, addr, ptep, pfn); |
172 | else if (vma->vm_flags & VM_EXEC) | 179 | else if (vma->vm_flags & VM_EXEC) |
173 | __flush_icache_all(); | 180 | __flush_icache_all(); |
174 | } | 181 | } |
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 6f3a4b7a3b82..e34f095e2090 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <asm/cacheflush.h> | 14 | #include <asm/cacheflush.h> |
15 | #include <asm/cachetype.h> | 15 | #include <asm/cachetype.h> |
16 | #include <asm/smp_plat.h> | ||
16 | #include <asm/system.h> | 17 | #include <asm/system.h> |
17 | #include <asm/tlbflush.h> | 18 | #include <asm/tlbflush.h> |
18 | 19 | ||
@@ -87,13 +88,26 @@ void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsig | |||
87 | if (vma->vm_flags & VM_EXEC && icache_is_vivt_asid_tagged()) | 88 | if (vma->vm_flags & VM_EXEC && icache_is_vivt_asid_tagged()) |
88 | __flush_icache_all(); | 89 | __flush_icache_all(); |
89 | } | 90 | } |
91 | #else | ||
92 | #define flush_pfn_alias(pfn,vaddr) do { } while (0) | ||
93 | #endif | ||
90 | 94 | ||
95 | #ifdef CONFIG_SMP | ||
96 | static void flush_ptrace_access_other(void *args) | ||
97 | { | ||
98 | __flush_icache_all(); | ||
99 | } | ||
100 | #endif | ||
101 | |||
102 | static | ||
91 | void flush_ptrace_access(struct vm_area_struct *vma, struct page *page, | 103 | void flush_ptrace_access(struct vm_area_struct *vma, struct page *page, |
92 | unsigned long uaddr, void *kaddr, | 104 | unsigned long uaddr, void *kaddr, unsigned long len) |
93 | unsigned long len, int write) | ||
94 | { | 105 | { |
95 | if (cache_is_vivt()) { | 106 | if (cache_is_vivt()) { |
96 | vivt_flush_ptrace_access(vma, page, uaddr, kaddr, len, write); | 107 | if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { |
108 | unsigned long addr = (unsigned long)kaddr; | ||
109 | __cpuc_coherent_kern_range(addr, addr + len); | ||
110 | } | ||
97 | return; | 111 | return; |
98 | } | 112 | } |
99 | 113 | ||
@@ -104,16 +118,37 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page, | |||
104 | } | 118 | } |
105 | 119 | ||
106 | /* VIPT non-aliasing cache */ | 120 | /* VIPT non-aliasing cache */ |
107 | if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm)) && | 121 | if (vma->vm_flags & VM_EXEC) { |
108 | vma->vm_flags & VM_EXEC) { | ||
109 | unsigned long addr = (unsigned long)kaddr; | 122 | unsigned long addr = (unsigned long)kaddr; |
110 | /* only flushing the kernel mapping on non-aliasing VIPT */ | ||
111 | __cpuc_coherent_kern_range(addr, addr + len); | 123 | __cpuc_coherent_kern_range(addr, addr + len); |
124 | #ifdef CONFIG_SMP | ||
125 | if (cache_ops_need_broadcast()) | ||
126 | smp_call_function(flush_ptrace_access_other, | ||
127 | NULL, 1); | ||
128 | #endif | ||
112 | } | 129 | } |
113 | } | 130 | } |
114 | #else | 131 | |
115 | #define flush_pfn_alias(pfn,vaddr) do { } while (0) | 132 | /* |
133 | * Copy user data from/to a page which is mapped into a different | ||
134 | * processes address space. Really, we want to allow our "user | ||
135 | * space" model to handle this. | ||
136 | * | ||
137 | * Note that this code needs to run on the current CPU. | ||
138 | */ | ||
139 | void copy_to_user_page(struct vm_area_struct *vma, struct page *page, | ||
140 | unsigned long uaddr, void *dst, const void *src, | ||
141 | unsigned long len) | ||
142 | { | ||
143 | #ifdef CONFIG_SMP | ||
144 | preempt_disable(); | ||
116 | #endif | 145 | #endif |
146 | memcpy(dst, src, len); | ||
147 | flush_ptrace_access(vma, page, uaddr, dst, len); | ||
148 | #ifdef CONFIG_SMP | ||
149 | preempt_enable(); | ||
150 | #endif | ||
151 | } | ||
117 | 152 | ||
118 | void __flush_dcache_page(struct address_space *mapping, struct page *page) | 153 | void __flush_dcache_page(struct address_space *mapping, struct page *page) |
119 | { | 154 | { |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 52c40d155672..a04ffbbbe253 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -616,7 +616,7 @@ void __init mem_init(void) | |||
616 | "%dK data, %dK init, %luK highmem)\n", | 616 | "%dK data, %dK init, %luK highmem)\n", |
617 | nr_free_pages() << (PAGE_SHIFT-10), codesize >> 10, | 617 | nr_free_pages() << (PAGE_SHIFT-10), codesize >> 10, |
618 | datasize >> 10, initsize >> 10, | 618 | datasize >> 10, initsize >> 10, |
619 | (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10))); | 619 | totalhigh_pages << (PAGE_SHIFT-10)); |
620 | 620 | ||
621 | if (PAGE_SIZE >= 16384 && num_physpages <= 128) { | 621 | if (PAGE_SIZE >= 16384 && num_physpages <= 128) { |
622 | extern int sysctl_overcommit_memory; | 622 | extern int sysctl_overcommit_memory; |
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S index 8012e24282b2..72507c630ceb 100644 --- a/arch/arm/mm/proc-arm1020.S +++ b/arch/arm/mm/proc-arm1020.S | |||
@@ -265,7 +265,7 @@ ENTRY(arm1020_flush_kern_dcache_area) | |||
265 | * | 265 | * |
266 | * (same as v4wb) | 266 | * (same as v4wb) |
267 | */ | 267 | */ |
268 | ENTRY(arm1020_dma_inv_range) | 268 | arm1020_dma_inv_range: |
269 | mov ip, #0 | 269 | mov ip, #0 |
270 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 270 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
271 | tst r0, #CACHE_DLINESIZE - 1 | 271 | tst r0, #CACHE_DLINESIZE - 1 |
@@ -295,7 +295,7 @@ ENTRY(arm1020_dma_inv_range) | |||
295 | * | 295 | * |
296 | * (same as v4wb) | 296 | * (same as v4wb) |
297 | */ | 297 | */ |
298 | ENTRY(arm1020_dma_clean_range) | 298 | arm1020_dma_clean_range: |
299 | mov ip, #0 | 299 | mov ip, #0 |
300 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 300 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
301 | bic r0, r0, #CACHE_DLINESIZE - 1 | 301 | bic r0, r0, #CACHE_DLINESIZE - 1 |
@@ -330,6 +330,30 @@ ENTRY(arm1020_dma_flush_range) | |||
330 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 330 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
331 | mov pc, lr | 331 | mov pc, lr |
332 | 332 | ||
333 | /* | ||
334 | * dma_map_area(start, size, dir) | ||
335 | * - start - kernel virtual start address | ||
336 | * - size - size of region | ||
337 | * - dir - DMA direction | ||
338 | */ | ||
339 | ENTRY(arm1020_dma_map_area) | ||
340 | add r1, r1, r0 | ||
341 | cmp r2, #DMA_TO_DEVICE | ||
342 | beq arm1020_dma_clean_range | ||
343 | bcs arm1020_dma_inv_range | ||
344 | b arm1020_dma_flush_range | ||
345 | ENDPROC(arm1020_dma_map_area) | ||
346 | |||
347 | /* | ||
348 | * dma_unmap_area(start, size, dir) | ||
349 | * - start - kernel virtual start address | ||
350 | * - size - size of region | ||
351 | * - dir - DMA direction | ||
352 | */ | ||
353 | ENTRY(arm1020_dma_unmap_area) | ||
354 | mov pc, lr | ||
355 | ENDPROC(arm1020_dma_unmap_area) | ||
356 | |||
333 | ENTRY(arm1020_cache_fns) | 357 | ENTRY(arm1020_cache_fns) |
334 | .long arm1020_flush_kern_cache_all | 358 | .long arm1020_flush_kern_cache_all |
335 | .long arm1020_flush_user_cache_all | 359 | .long arm1020_flush_user_cache_all |
@@ -337,8 +361,8 @@ ENTRY(arm1020_cache_fns) | |||
337 | .long arm1020_coherent_kern_range | 361 | .long arm1020_coherent_kern_range |
338 | .long arm1020_coherent_user_range | 362 | .long arm1020_coherent_user_range |
339 | .long arm1020_flush_kern_dcache_area | 363 | .long arm1020_flush_kern_dcache_area |
340 | .long arm1020_dma_inv_range | 364 | .long arm1020_dma_map_area |
341 | .long arm1020_dma_clean_range | 365 | .long arm1020_dma_unmap_area |
342 | .long arm1020_dma_flush_range | 366 | .long arm1020_dma_flush_range |
343 | 367 | ||
344 | .align 5 | 368 | .align 5 |
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S index 41fe25d234f5..d27829805609 100644 --- a/arch/arm/mm/proc-arm1020e.S +++ b/arch/arm/mm/proc-arm1020e.S | |||
@@ -258,7 +258,7 @@ ENTRY(arm1020e_flush_kern_dcache_area) | |||
258 | * | 258 | * |
259 | * (same as v4wb) | 259 | * (same as v4wb) |
260 | */ | 260 | */ |
261 | ENTRY(arm1020e_dma_inv_range) | 261 | arm1020e_dma_inv_range: |
262 | mov ip, #0 | 262 | mov ip, #0 |
263 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 263 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
264 | tst r0, #CACHE_DLINESIZE - 1 | 264 | tst r0, #CACHE_DLINESIZE - 1 |
@@ -284,7 +284,7 @@ ENTRY(arm1020e_dma_inv_range) | |||
284 | * | 284 | * |
285 | * (same as v4wb) | 285 | * (same as v4wb) |
286 | */ | 286 | */ |
287 | ENTRY(arm1020e_dma_clean_range) | 287 | arm1020e_dma_clean_range: |
288 | mov ip, #0 | 288 | mov ip, #0 |
289 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 289 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
290 | bic r0, r0, #CACHE_DLINESIZE - 1 | 290 | bic r0, r0, #CACHE_DLINESIZE - 1 |
@@ -316,6 +316,30 @@ ENTRY(arm1020e_dma_flush_range) | |||
316 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 316 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
317 | mov pc, lr | 317 | mov pc, lr |
318 | 318 | ||
319 | /* | ||
320 | * dma_map_area(start, size, dir) | ||
321 | * - start - kernel virtual start address | ||
322 | * - size - size of region | ||
323 | * - dir - DMA direction | ||
324 | */ | ||
325 | ENTRY(arm1020e_dma_map_area) | ||
326 | add r1, r1, r0 | ||
327 | cmp r2, #DMA_TO_DEVICE | ||
328 | beq arm1020e_dma_clean_range | ||
329 | bcs arm1020e_dma_inv_range | ||
330 | b arm1020e_dma_flush_range | ||
331 | ENDPROC(arm1020e_dma_map_area) | ||
332 | |||
333 | /* | ||
334 | * dma_unmap_area(start, size, dir) | ||
335 | * - start - kernel virtual start address | ||
336 | * - size - size of region | ||
337 | * - dir - DMA direction | ||
338 | */ | ||
339 | ENTRY(arm1020e_dma_unmap_area) | ||
340 | mov pc, lr | ||
341 | ENDPROC(arm1020e_dma_unmap_area) | ||
342 | |||
319 | ENTRY(arm1020e_cache_fns) | 343 | ENTRY(arm1020e_cache_fns) |
320 | .long arm1020e_flush_kern_cache_all | 344 | .long arm1020e_flush_kern_cache_all |
321 | .long arm1020e_flush_user_cache_all | 345 | .long arm1020e_flush_user_cache_all |
@@ -323,8 +347,8 @@ ENTRY(arm1020e_cache_fns) | |||
323 | .long arm1020e_coherent_kern_range | 347 | .long arm1020e_coherent_kern_range |
324 | .long arm1020e_coherent_user_range | 348 | .long arm1020e_coherent_user_range |
325 | .long arm1020e_flush_kern_dcache_area | 349 | .long arm1020e_flush_kern_dcache_area |
326 | .long arm1020e_dma_inv_range | 350 | .long arm1020e_dma_map_area |
327 | .long arm1020e_dma_clean_range | 351 | .long arm1020e_dma_unmap_area |
328 | .long arm1020e_dma_flush_range | 352 | .long arm1020e_dma_flush_range |
329 | 353 | ||
330 | .align 5 | 354 | .align 5 |
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S index 20a5b1b31a70..ce13e4a827de 100644 --- a/arch/arm/mm/proc-arm1022.S +++ b/arch/arm/mm/proc-arm1022.S | |||
@@ -247,7 +247,7 @@ ENTRY(arm1022_flush_kern_dcache_area) | |||
247 | * | 247 | * |
248 | * (same as v4wb) | 248 | * (same as v4wb) |
249 | */ | 249 | */ |
250 | ENTRY(arm1022_dma_inv_range) | 250 | arm1022_dma_inv_range: |
251 | mov ip, #0 | 251 | mov ip, #0 |
252 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 252 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
253 | tst r0, #CACHE_DLINESIZE - 1 | 253 | tst r0, #CACHE_DLINESIZE - 1 |
@@ -273,7 +273,7 @@ ENTRY(arm1022_dma_inv_range) | |||
273 | * | 273 | * |
274 | * (same as v4wb) | 274 | * (same as v4wb) |
275 | */ | 275 | */ |
276 | ENTRY(arm1022_dma_clean_range) | 276 | arm1022_dma_clean_range: |
277 | mov ip, #0 | 277 | mov ip, #0 |
278 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 278 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
279 | bic r0, r0, #CACHE_DLINESIZE - 1 | 279 | bic r0, r0, #CACHE_DLINESIZE - 1 |
@@ -305,6 +305,30 @@ ENTRY(arm1022_dma_flush_range) | |||
305 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 305 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
306 | mov pc, lr | 306 | mov pc, lr |
307 | 307 | ||
308 | /* | ||
309 | * dma_map_area(start, size, dir) | ||
310 | * - start - kernel virtual start address | ||
311 | * - size - size of region | ||
312 | * - dir - DMA direction | ||
313 | */ | ||
314 | ENTRY(arm1022_dma_map_area) | ||
315 | add r1, r1, r0 | ||
316 | cmp r2, #DMA_TO_DEVICE | ||
317 | beq arm1022_dma_clean_range | ||
318 | bcs arm1022_dma_inv_range | ||
319 | b arm1022_dma_flush_range | ||
320 | ENDPROC(arm1022_dma_map_area) | ||
321 | |||
322 | /* | ||
323 | * dma_unmap_area(start, size, dir) | ||
324 | * - start - kernel virtual start address | ||
325 | * - size - size of region | ||
326 | * - dir - DMA direction | ||
327 | */ | ||
328 | ENTRY(arm1022_dma_unmap_area) | ||
329 | mov pc, lr | ||
330 | ENDPROC(arm1022_dma_unmap_area) | ||
331 | |||
308 | ENTRY(arm1022_cache_fns) | 332 | ENTRY(arm1022_cache_fns) |
309 | .long arm1022_flush_kern_cache_all | 333 | .long arm1022_flush_kern_cache_all |
310 | .long arm1022_flush_user_cache_all | 334 | .long arm1022_flush_user_cache_all |
@@ -312,8 +336,8 @@ ENTRY(arm1022_cache_fns) | |||
312 | .long arm1022_coherent_kern_range | 336 | .long arm1022_coherent_kern_range |
313 | .long arm1022_coherent_user_range | 337 | .long arm1022_coherent_user_range |
314 | .long arm1022_flush_kern_dcache_area | 338 | .long arm1022_flush_kern_dcache_area |
315 | .long arm1022_dma_inv_range | 339 | .long arm1022_dma_map_area |
316 | .long arm1022_dma_clean_range | 340 | .long arm1022_dma_unmap_area |
317 | .long arm1022_dma_flush_range | 341 | .long arm1022_dma_flush_range |
318 | 342 | ||
319 | .align 5 | 343 | .align 5 |
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S index 96aedb10fcc4..636672a29c6d 100644 --- a/arch/arm/mm/proc-arm1026.S +++ b/arch/arm/mm/proc-arm1026.S | |||
@@ -241,7 +241,7 @@ ENTRY(arm1026_flush_kern_dcache_area) | |||
241 | * | 241 | * |
242 | * (same as v4wb) | 242 | * (same as v4wb) |
243 | */ | 243 | */ |
244 | ENTRY(arm1026_dma_inv_range) | 244 | arm1026_dma_inv_range: |
245 | mov ip, #0 | 245 | mov ip, #0 |
246 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 246 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
247 | tst r0, #CACHE_DLINESIZE - 1 | 247 | tst r0, #CACHE_DLINESIZE - 1 |
@@ -267,7 +267,7 @@ ENTRY(arm1026_dma_inv_range) | |||
267 | * | 267 | * |
268 | * (same as v4wb) | 268 | * (same as v4wb) |
269 | */ | 269 | */ |
270 | ENTRY(arm1026_dma_clean_range) | 270 | arm1026_dma_clean_range: |
271 | mov ip, #0 | 271 | mov ip, #0 |
272 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 272 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
273 | bic r0, r0, #CACHE_DLINESIZE - 1 | 273 | bic r0, r0, #CACHE_DLINESIZE - 1 |
@@ -299,6 +299,30 @@ ENTRY(arm1026_dma_flush_range) | |||
299 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 299 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
300 | mov pc, lr | 300 | mov pc, lr |
301 | 301 | ||
302 | /* | ||
303 | * dma_map_area(start, size, dir) | ||
304 | * - start - kernel virtual start address | ||
305 | * - size - size of region | ||
306 | * - dir - DMA direction | ||
307 | */ | ||
308 | ENTRY(arm1026_dma_map_area) | ||
309 | add r1, r1, r0 | ||
310 | cmp r2, #DMA_TO_DEVICE | ||
311 | beq arm1026_dma_clean_range | ||
312 | bcs arm1026_dma_inv_range | ||
313 | b arm1026_dma_flush_range | ||
314 | ENDPROC(arm1026_dma_map_area) | ||
315 | |||
316 | /* | ||
317 | * dma_unmap_area(start, size, dir) | ||
318 | * - start - kernel virtual start address | ||
319 | * - size - size of region | ||
320 | * - dir - DMA direction | ||
321 | */ | ||
322 | ENTRY(arm1026_dma_unmap_area) | ||
323 | mov pc, lr | ||
324 | ENDPROC(arm1026_dma_unmap_area) | ||
325 | |||
302 | ENTRY(arm1026_cache_fns) | 326 | ENTRY(arm1026_cache_fns) |
303 | .long arm1026_flush_kern_cache_all | 327 | .long arm1026_flush_kern_cache_all |
304 | .long arm1026_flush_user_cache_all | 328 | .long arm1026_flush_user_cache_all |
@@ -306,8 +330,8 @@ ENTRY(arm1026_cache_fns) | |||
306 | .long arm1026_coherent_kern_range | 330 | .long arm1026_coherent_kern_range |
307 | .long arm1026_coherent_user_range | 331 | .long arm1026_coherent_user_range |
308 | .long arm1026_flush_kern_dcache_area | 332 | .long arm1026_flush_kern_dcache_area |
309 | .long arm1026_dma_inv_range | 333 | .long arm1026_dma_map_area |
310 | .long arm1026_dma_clean_range | 334 | .long arm1026_dma_unmap_area |
311 | .long arm1026_dma_flush_range | 335 | .long arm1026_dma_flush_range |
312 | 336 | ||
313 | .align 5 | 337 | .align 5 |
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S index 471669e2d7cb..8be81992645d 100644 --- a/arch/arm/mm/proc-arm920.S +++ b/arch/arm/mm/proc-arm920.S | |||
@@ -239,7 +239,7 @@ ENTRY(arm920_flush_kern_dcache_area) | |||
239 | * | 239 | * |
240 | * (same as v4wb) | 240 | * (same as v4wb) |
241 | */ | 241 | */ |
242 | ENTRY(arm920_dma_inv_range) | 242 | arm920_dma_inv_range: |
243 | tst r0, #CACHE_DLINESIZE - 1 | 243 | tst r0, #CACHE_DLINESIZE - 1 |
244 | bic r0, r0, #CACHE_DLINESIZE - 1 | 244 | bic r0, r0, #CACHE_DLINESIZE - 1 |
245 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 245 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -262,7 +262,7 @@ ENTRY(arm920_dma_inv_range) | |||
262 | * | 262 | * |
263 | * (same as v4wb) | 263 | * (same as v4wb) |
264 | */ | 264 | */ |
265 | ENTRY(arm920_dma_clean_range) | 265 | arm920_dma_clean_range: |
266 | bic r0, r0, #CACHE_DLINESIZE - 1 | 266 | bic r0, r0, #CACHE_DLINESIZE - 1 |
267 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 267 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
268 | add r0, r0, #CACHE_DLINESIZE | 268 | add r0, r0, #CACHE_DLINESIZE |
@@ -288,6 +288,30 @@ ENTRY(arm920_dma_flush_range) | |||
288 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 288 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
289 | mov pc, lr | 289 | mov pc, lr |
290 | 290 | ||
291 | /* | ||
292 | * dma_map_area(start, size, dir) | ||
293 | * - start - kernel virtual start address | ||
294 | * - size - size of region | ||
295 | * - dir - DMA direction | ||
296 | */ | ||
297 | ENTRY(arm920_dma_map_area) | ||
298 | add r1, r1, r0 | ||
299 | cmp r2, #DMA_TO_DEVICE | ||
300 | beq arm920_dma_clean_range | ||
301 | bcs arm920_dma_inv_range | ||
302 | b arm920_dma_flush_range | ||
303 | ENDPROC(arm920_dma_map_area) | ||
304 | |||
305 | /* | ||
306 | * dma_unmap_area(start, size, dir) | ||
307 | * - start - kernel virtual start address | ||
308 | * - size - size of region | ||
309 | * - dir - DMA direction | ||
310 | */ | ||
311 | ENTRY(arm920_dma_unmap_area) | ||
312 | mov pc, lr | ||
313 | ENDPROC(arm920_dma_unmap_area) | ||
314 | |||
291 | ENTRY(arm920_cache_fns) | 315 | ENTRY(arm920_cache_fns) |
292 | .long arm920_flush_kern_cache_all | 316 | .long arm920_flush_kern_cache_all |
293 | .long arm920_flush_user_cache_all | 317 | .long arm920_flush_user_cache_all |
@@ -295,8 +319,8 @@ ENTRY(arm920_cache_fns) | |||
295 | .long arm920_coherent_kern_range | 319 | .long arm920_coherent_kern_range |
296 | .long arm920_coherent_user_range | 320 | .long arm920_coherent_user_range |
297 | .long arm920_flush_kern_dcache_area | 321 | .long arm920_flush_kern_dcache_area |
298 | .long arm920_dma_inv_range | 322 | .long arm920_dma_map_area |
299 | .long arm920_dma_clean_range | 323 | .long arm920_dma_unmap_area |
300 | .long arm920_dma_flush_range | 324 | .long arm920_dma_flush_range |
301 | 325 | ||
302 | #endif | 326 | #endif |
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S index ee111b00fa41..c0ff8e4b1074 100644 --- a/arch/arm/mm/proc-arm922.S +++ b/arch/arm/mm/proc-arm922.S | |||
@@ -241,7 +241,7 @@ ENTRY(arm922_flush_kern_dcache_area) | |||
241 | * | 241 | * |
242 | * (same as v4wb) | 242 | * (same as v4wb) |
243 | */ | 243 | */ |
244 | ENTRY(arm922_dma_inv_range) | 244 | arm922_dma_inv_range: |
245 | tst r0, #CACHE_DLINESIZE - 1 | 245 | tst r0, #CACHE_DLINESIZE - 1 |
246 | bic r0, r0, #CACHE_DLINESIZE - 1 | 246 | bic r0, r0, #CACHE_DLINESIZE - 1 |
247 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 247 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -264,7 +264,7 @@ ENTRY(arm922_dma_inv_range) | |||
264 | * | 264 | * |
265 | * (same as v4wb) | 265 | * (same as v4wb) |
266 | */ | 266 | */ |
267 | ENTRY(arm922_dma_clean_range) | 267 | arm922_dma_clean_range: |
268 | bic r0, r0, #CACHE_DLINESIZE - 1 | 268 | bic r0, r0, #CACHE_DLINESIZE - 1 |
269 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 269 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
270 | add r0, r0, #CACHE_DLINESIZE | 270 | add r0, r0, #CACHE_DLINESIZE |
@@ -290,6 +290,30 @@ ENTRY(arm922_dma_flush_range) | |||
290 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 290 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
291 | mov pc, lr | 291 | mov pc, lr |
292 | 292 | ||
293 | /* | ||
294 | * dma_map_area(start, size, dir) | ||
295 | * - start - kernel virtual start address | ||
296 | * - size - size of region | ||
297 | * - dir - DMA direction | ||
298 | */ | ||
299 | ENTRY(arm922_dma_map_area) | ||
300 | add r1, r1, r0 | ||
301 | cmp r2, #DMA_TO_DEVICE | ||
302 | beq arm922_dma_clean_range | ||
303 | bcs arm922_dma_inv_range | ||
304 | b arm922_dma_flush_range | ||
305 | ENDPROC(arm922_dma_map_area) | ||
306 | |||
307 | /* | ||
308 | * dma_unmap_area(start, size, dir) | ||
309 | * - start - kernel virtual start address | ||
310 | * - size - size of region | ||
311 | * - dir - DMA direction | ||
312 | */ | ||
313 | ENTRY(arm922_dma_unmap_area) | ||
314 | mov pc, lr | ||
315 | ENDPROC(arm922_dma_unmap_area) | ||
316 | |||
293 | ENTRY(arm922_cache_fns) | 317 | ENTRY(arm922_cache_fns) |
294 | .long arm922_flush_kern_cache_all | 318 | .long arm922_flush_kern_cache_all |
295 | .long arm922_flush_user_cache_all | 319 | .long arm922_flush_user_cache_all |
@@ -297,8 +321,8 @@ ENTRY(arm922_cache_fns) | |||
297 | .long arm922_coherent_kern_range | 321 | .long arm922_coherent_kern_range |
298 | .long arm922_coherent_user_range | 322 | .long arm922_coherent_user_range |
299 | .long arm922_flush_kern_dcache_area | 323 | .long arm922_flush_kern_dcache_area |
300 | .long arm922_dma_inv_range | 324 | .long arm922_dma_map_area |
301 | .long arm922_dma_clean_range | 325 | .long arm922_dma_unmap_area |
302 | .long arm922_dma_flush_range | 326 | .long arm922_dma_flush_range |
303 | 327 | ||
304 | #endif | 328 | #endif |
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S index 8deb5bde58e4..3c6cffe400f6 100644 --- a/arch/arm/mm/proc-arm925.S +++ b/arch/arm/mm/proc-arm925.S | |||
@@ -283,7 +283,7 @@ ENTRY(arm925_flush_kern_dcache_area) | |||
283 | * | 283 | * |
284 | * (same as v4wb) | 284 | * (same as v4wb) |
285 | */ | 285 | */ |
286 | ENTRY(arm925_dma_inv_range) | 286 | arm925_dma_inv_range: |
287 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH | 287 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH |
288 | tst r0, #CACHE_DLINESIZE - 1 | 288 | tst r0, #CACHE_DLINESIZE - 1 |
289 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 289 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -308,7 +308,7 @@ ENTRY(arm925_dma_inv_range) | |||
308 | * | 308 | * |
309 | * (same as v4wb) | 309 | * (same as v4wb) |
310 | */ | 310 | */ |
311 | ENTRY(arm925_dma_clean_range) | 311 | arm925_dma_clean_range: |
312 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH | 312 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH |
313 | bic r0, r0, #CACHE_DLINESIZE - 1 | 313 | bic r0, r0, #CACHE_DLINESIZE - 1 |
314 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 314 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -341,6 +341,30 @@ ENTRY(arm925_dma_flush_range) | |||
341 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 341 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
342 | mov pc, lr | 342 | mov pc, lr |
343 | 343 | ||
344 | /* | ||
345 | * dma_map_area(start, size, dir) | ||
346 | * - start - kernel virtual start address | ||
347 | * - size - size of region | ||
348 | * - dir - DMA direction | ||
349 | */ | ||
350 | ENTRY(arm925_dma_map_area) | ||
351 | add r1, r1, r0 | ||
352 | cmp r2, #DMA_TO_DEVICE | ||
353 | beq arm925_dma_clean_range | ||
354 | bcs arm925_dma_inv_range | ||
355 | b arm925_dma_flush_range | ||
356 | ENDPROC(arm925_dma_map_area) | ||
357 | |||
358 | /* | ||
359 | * dma_unmap_area(start, size, dir) | ||
360 | * - start - kernel virtual start address | ||
361 | * - size - size of region | ||
362 | * - dir - DMA direction | ||
363 | */ | ||
364 | ENTRY(arm925_dma_unmap_area) | ||
365 | mov pc, lr | ||
366 | ENDPROC(arm925_dma_unmap_area) | ||
367 | |||
344 | ENTRY(arm925_cache_fns) | 368 | ENTRY(arm925_cache_fns) |
345 | .long arm925_flush_kern_cache_all | 369 | .long arm925_flush_kern_cache_all |
346 | .long arm925_flush_user_cache_all | 370 | .long arm925_flush_user_cache_all |
@@ -348,8 +372,8 @@ ENTRY(arm925_cache_fns) | |||
348 | .long arm925_coherent_kern_range | 372 | .long arm925_coherent_kern_range |
349 | .long arm925_coherent_user_range | 373 | .long arm925_coherent_user_range |
350 | .long arm925_flush_kern_dcache_area | 374 | .long arm925_flush_kern_dcache_area |
351 | .long arm925_dma_inv_range | 375 | .long arm925_dma_map_area |
352 | .long arm925_dma_clean_range | 376 | .long arm925_dma_unmap_area |
353 | .long arm925_dma_flush_range | 377 | .long arm925_dma_flush_range |
354 | 378 | ||
355 | ENTRY(cpu_arm925_dcache_clean_area) | 379 | ENTRY(cpu_arm925_dcache_clean_area) |
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S index 64db6e275a44..75b707c9cce1 100644 --- a/arch/arm/mm/proc-arm926.S +++ b/arch/arm/mm/proc-arm926.S | |||
@@ -246,7 +246,7 @@ ENTRY(arm926_flush_kern_dcache_area) | |||
246 | * | 246 | * |
247 | * (same as v4wb) | 247 | * (same as v4wb) |
248 | */ | 248 | */ |
249 | ENTRY(arm926_dma_inv_range) | 249 | arm926_dma_inv_range: |
250 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH | 250 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH |
251 | tst r0, #CACHE_DLINESIZE - 1 | 251 | tst r0, #CACHE_DLINESIZE - 1 |
252 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 252 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -271,7 +271,7 @@ ENTRY(arm926_dma_inv_range) | |||
271 | * | 271 | * |
272 | * (same as v4wb) | 272 | * (same as v4wb) |
273 | */ | 273 | */ |
274 | ENTRY(arm926_dma_clean_range) | 274 | arm926_dma_clean_range: |
275 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH | 275 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH |
276 | bic r0, r0, #CACHE_DLINESIZE - 1 | 276 | bic r0, r0, #CACHE_DLINESIZE - 1 |
277 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 277 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -304,6 +304,30 @@ ENTRY(arm926_dma_flush_range) | |||
304 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 304 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
305 | mov pc, lr | 305 | mov pc, lr |
306 | 306 | ||
307 | /* | ||
308 | * dma_map_area(start, size, dir) | ||
309 | * - start - kernel virtual start address | ||
310 | * - size - size of region | ||
311 | * - dir - DMA direction | ||
312 | */ | ||
313 | ENTRY(arm926_dma_map_area) | ||
314 | add r1, r1, r0 | ||
315 | cmp r2, #DMA_TO_DEVICE | ||
316 | beq arm926_dma_clean_range | ||
317 | bcs arm926_dma_inv_range | ||
318 | b arm926_dma_flush_range | ||
319 | ENDPROC(arm926_dma_map_area) | ||
320 | |||
321 | /* | ||
322 | * dma_unmap_area(start, size, dir) | ||
323 | * - start - kernel virtual start address | ||
324 | * - size - size of region | ||
325 | * - dir - DMA direction | ||
326 | */ | ||
327 | ENTRY(arm926_dma_unmap_area) | ||
328 | mov pc, lr | ||
329 | ENDPROC(arm926_dma_unmap_area) | ||
330 | |||
307 | ENTRY(arm926_cache_fns) | 331 | ENTRY(arm926_cache_fns) |
308 | .long arm926_flush_kern_cache_all | 332 | .long arm926_flush_kern_cache_all |
309 | .long arm926_flush_user_cache_all | 333 | .long arm926_flush_user_cache_all |
@@ -311,8 +335,8 @@ ENTRY(arm926_cache_fns) | |||
311 | .long arm926_coherent_kern_range | 335 | .long arm926_coherent_kern_range |
312 | .long arm926_coherent_user_range | 336 | .long arm926_coherent_user_range |
313 | .long arm926_flush_kern_dcache_area | 337 | .long arm926_flush_kern_dcache_area |
314 | .long arm926_dma_inv_range | 338 | .long arm926_dma_map_area |
315 | .long arm926_dma_clean_range | 339 | .long arm926_dma_unmap_area |
316 | .long arm926_dma_flush_range | 340 | .long arm926_dma_flush_range |
317 | 341 | ||
318 | ENTRY(cpu_arm926_dcache_clean_area) | 342 | ENTRY(cpu_arm926_dcache_clean_area) |
diff --git a/arch/arm/mm/proc-arm940.S b/arch/arm/mm/proc-arm940.S index 8196b9f401fb..1af1657819eb 100644 --- a/arch/arm/mm/proc-arm940.S +++ b/arch/arm/mm/proc-arm940.S | |||
@@ -171,7 +171,7 @@ ENTRY(arm940_flush_kern_dcache_area) | |||
171 | * - start - virtual start address | 171 | * - start - virtual start address |
172 | * - end - virtual end address | 172 | * - end - virtual end address |
173 | */ | 173 | */ |
174 | ENTRY(arm940_dma_inv_range) | 174 | arm940_dma_inv_range: |
175 | mov ip, #0 | 175 | mov ip, #0 |
176 | mov r1, #(CACHE_DSEGMENTS - 1) << 4 @ 4 segments | 176 | mov r1, #(CACHE_DSEGMENTS - 1) << 4 @ 4 segments |
177 | 1: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries | 177 | 1: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries |
@@ -192,7 +192,7 @@ ENTRY(arm940_dma_inv_range) | |||
192 | * - start - virtual start address | 192 | * - start - virtual start address |
193 | * - end - virtual end address | 193 | * - end - virtual end address |
194 | */ | 194 | */ |
195 | ENTRY(arm940_dma_clean_range) | 195 | arm940_dma_clean_range: |
196 | ENTRY(cpu_arm940_dcache_clean_area) | 196 | ENTRY(cpu_arm940_dcache_clean_area) |
197 | mov ip, #0 | 197 | mov ip, #0 |
198 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH | 198 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH |
@@ -233,6 +233,30 @@ ENTRY(arm940_dma_flush_range) | |||
233 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 233 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
234 | mov pc, lr | 234 | mov pc, lr |
235 | 235 | ||
236 | /* | ||
237 | * dma_map_area(start, size, dir) | ||
238 | * - start - kernel virtual start address | ||
239 | * - size - size of region | ||
240 | * - dir - DMA direction | ||
241 | */ | ||
242 | ENTRY(arm940_dma_map_area) | ||
243 | add r1, r1, r0 | ||
244 | cmp r2, #DMA_TO_DEVICE | ||
245 | beq arm940_dma_clean_range | ||
246 | bcs arm940_dma_inv_range | ||
247 | b arm940_dma_flush_range | ||
248 | ENDPROC(arm940_dma_map_area) | ||
249 | |||
250 | /* | ||
251 | * dma_unmap_area(start, size, dir) | ||
252 | * - start - kernel virtual start address | ||
253 | * - size - size of region | ||
254 | * - dir - DMA direction | ||
255 | */ | ||
256 | ENTRY(arm940_dma_unmap_area) | ||
257 | mov pc, lr | ||
258 | ENDPROC(arm940_dma_unmap_area) | ||
259 | |||
236 | ENTRY(arm940_cache_fns) | 260 | ENTRY(arm940_cache_fns) |
237 | .long arm940_flush_kern_cache_all | 261 | .long arm940_flush_kern_cache_all |
238 | .long arm940_flush_user_cache_all | 262 | .long arm940_flush_user_cache_all |
@@ -240,8 +264,8 @@ ENTRY(arm940_cache_fns) | |||
240 | .long arm940_coherent_kern_range | 264 | .long arm940_coherent_kern_range |
241 | .long arm940_coherent_user_range | 265 | .long arm940_coherent_user_range |
242 | .long arm940_flush_kern_dcache_area | 266 | .long arm940_flush_kern_dcache_area |
243 | .long arm940_dma_inv_range | 267 | .long arm940_dma_map_area |
244 | .long arm940_dma_clean_range | 268 | .long arm940_dma_unmap_area |
245 | .long arm940_dma_flush_range | 269 | .long arm940_dma_flush_range |
246 | 270 | ||
247 | __INIT | 271 | __INIT |
diff --git a/arch/arm/mm/proc-arm946.S b/arch/arm/mm/proc-arm946.S index 9a951239c86c..1664b6aaff79 100644 --- a/arch/arm/mm/proc-arm946.S +++ b/arch/arm/mm/proc-arm946.S | |||
@@ -215,7 +215,7 @@ ENTRY(arm946_flush_kern_dcache_area) | |||
215 | * - end - virtual end address | 215 | * - end - virtual end address |
216 | * (same as arm926) | 216 | * (same as arm926) |
217 | */ | 217 | */ |
218 | ENTRY(arm946_dma_inv_range) | 218 | arm946_dma_inv_range: |
219 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH | 219 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH |
220 | tst r0, #CACHE_DLINESIZE - 1 | 220 | tst r0, #CACHE_DLINESIZE - 1 |
221 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 221 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -240,7 +240,7 @@ ENTRY(arm946_dma_inv_range) | |||
240 | * | 240 | * |
241 | * (same as arm926) | 241 | * (same as arm926) |
242 | */ | 242 | */ |
243 | ENTRY(arm946_dma_clean_range) | 243 | arm946_dma_clean_range: |
244 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH | 244 | #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH |
245 | bic r0, r0, #CACHE_DLINESIZE - 1 | 245 | bic r0, r0, #CACHE_DLINESIZE - 1 |
246 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 246 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -275,6 +275,30 @@ ENTRY(arm946_dma_flush_range) | |||
275 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 275 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
276 | mov pc, lr | 276 | mov pc, lr |
277 | 277 | ||
278 | /* | ||
279 | * dma_map_area(start, size, dir) | ||
280 | * - start - kernel virtual start address | ||
281 | * - size - size of region | ||
282 | * - dir - DMA direction | ||
283 | */ | ||
284 | ENTRY(arm946_dma_map_area) | ||
285 | add r1, r1, r0 | ||
286 | cmp r2, #DMA_TO_DEVICE | ||
287 | beq arm946_dma_clean_range | ||
288 | bcs arm946_dma_inv_range | ||
289 | b arm946_dma_flush_range | ||
290 | ENDPROC(arm946_dma_map_area) | ||
291 | |||
292 | /* | ||
293 | * dma_unmap_area(start, size, dir) | ||
294 | * - start - kernel virtual start address | ||
295 | * - size - size of region | ||
296 | * - dir - DMA direction | ||
297 | */ | ||
298 | ENTRY(arm946_dma_unmap_area) | ||
299 | mov pc, lr | ||
300 | ENDPROC(arm946_dma_unmap_area) | ||
301 | |||
278 | ENTRY(arm946_cache_fns) | 302 | ENTRY(arm946_cache_fns) |
279 | .long arm946_flush_kern_cache_all | 303 | .long arm946_flush_kern_cache_all |
280 | .long arm946_flush_user_cache_all | 304 | .long arm946_flush_user_cache_all |
@@ -282,8 +306,8 @@ ENTRY(arm946_cache_fns) | |||
282 | .long arm946_coherent_kern_range | 306 | .long arm946_coherent_kern_range |
283 | .long arm946_coherent_user_range | 307 | .long arm946_coherent_user_range |
284 | .long arm946_flush_kern_dcache_area | 308 | .long arm946_flush_kern_dcache_area |
285 | .long arm946_dma_inv_range | 309 | .long arm946_dma_map_area |
286 | .long arm946_dma_clean_range | 310 | .long arm946_dma_unmap_area |
287 | .long arm946_dma_flush_range | 311 | .long arm946_dma_flush_range |
288 | 312 | ||
289 | 313 | ||
diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S index dbc39383e66a..53e632343849 100644 --- a/arch/arm/mm/proc-feroceon.S +++ b/arch/arm/mm/proc-feroceon.S | |||
@@ -274,7 +274,7 @@ ENTRY(feroceon_range_flush_kern_dcache_area) | |||
274 | * (same as v4wb) | 274 | * (same as v4wb) |
275 | */ | 275 | */ |
276 | .align 5 | 276 | .align 5 |
277 | ENTRY(feroceon_dma_inv_range) | 277 | feroceon_dma_inv_range: |
278 | tst r0, #CACHE_DLINESIZE - 1 | 278 | tst r0, #CACHE_DLINESIZE - 1 |
279 | bic r0, r0, #CACHE_DLINESIZE - 1 | 279 | bic r0, r0, #CACHE_DLINESIZE - 1 |
280 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 280 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -288,7 +288,7 @@ ENTRY(feroceon_dma_inv_range) | |||
288 | mov pc, lr | 288 | mov pc, lr |
289 | 289 | ||
290 | .align 5 | 290 | .align 5 |
291 | ENTRY(feroceon_range_dma_inv_range) | 291 | feroceon_range_dma_inv_range: |
292 | mrs r2, cpsr | 292 | mrs r2, cpsr |
293 | tst r0, #CACHE_DLINESIZE - 1 | 293 | tst r0, #CACHE_DLINESIZE - 1 |
294 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 294 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -314,7 +314,7 @@ ENTRY(feroceon_range_dma_inv_range) | |||
314 | * (same as v4wb) | 314 | * (same as v4wb) |
315 | */ | 315 | */ |
316 | .align 5 | 316 | .align 5 |
317 | ENTRY(feroceon_dma_clean_range) | 317 | feroceon_dma_clean_range: |
318 | bic r0, r0, #CACHE_DLINESIZE - 1 | 318 | bic r0, r0, #CACHE_DLINESIZE - 1 |
319 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 319 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
320 | add r0, r0, #CACHE_DLINESIZE | 320 | add r0, r0, #CACHE_DLINESIZE |
@@ -324,7 +324,7 @@ ENTRY(feroceon_dma_clean_range) | |||
324 | mov pc, lr | 324 | mov pc, lr |
325 | 325 | ||
326 | .align 5 | 326 | .align 5 |
327 | ENTRY(feroceon_range_dma_clean_range) | 327 | feroceon_range_dma_clean_range: |
328 | mrs r2, cpsr | 328 | mrs r2, cpsr |
329 | cmp r1, r0 | 329 | cmp r1, r0 |
330 | subne r1, r1, #1 @ top address is inclusive | 330 | subne r1, r1, #1 @ top address is inclusive |
@@ -367,6 +367,44 @@ ENTRY(feroceon_range_dma_flush_range) | |||
367 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 367 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
368 | mov pc, lr | 368 | mov pc, lr |
369 | 369 | ||
370 | /* | ||
371 | * dma_map_area(start, size, dir) | ||
372 | * - start - kernel virtual start address | ||
373 | * - size - size of region | ||
374 | * - dir - DMA direction | ||
375 | */ | ||
376 | ENTRY(feroceon_dma_map_area) | ||
377 | add r1, r1, r0 | ||
378 | cmp r2, #DMA_TO_DEVICE | ||
379 | beq feroceon_dma_clean_range | ||
380 | bcs feroceon_dma_inv_range | ||
381 | b feroceon_dma_flush_range | ||
382 | ENDPROC(feroceon_dma_map_area) | ||
383 | |||
384 | /* | ||
385 | * dma_map_area(start, size, dir) | ||
386 | * - start - kernel virtual start address | ||
387 | * - size - size of region | ||
388 | * - dir - DMA direction | ||
389 | */ | ||
390 | ENTRY(feroceon_range_dma_map_area) | ||
391 | add r1, r1, r0 | ||
392 | cmp r2, #DMA_TO_DEVICE | ||
393 | beq feroceon_range_dma_clean_range | ||
394 | bcs feroceon_range_dma_inv_range | ||
395 | b feroceon_range_dma_flush_range | ||
396 | ENDPROC(feroceon_range_dma_map_area) | ||
397 | |||
398 | /* | ||
399 | * dma_unmap_area(start, size, dir) | ||
400 | * - start - kernel virtual start address | ||
401 | * - size - size of region | ||
402 | * - dir - DMA direction | ||
403 | */ | ||
404 | ENTRY(feroceon_dma_unmap_area) | ||
405 | mov pc, lr | ||
406 | ENDPROC(feroceon_dma_unmap_area) | ||
407 | |||
370 | ENTRY(feroceon_cache_fns) | 408 | ENTRY(feroceon_cache_fns) |
371 | .long feroceon_flush_kern_cache_all | 409 | .long feroceon_flush_kern_cache_all |
372 | .long feroceon_flush_user_cache_all | 410 | .long feroceon_flush_user_cache_all |
@@ -374,8 +412,8 @@ ENTRY(feroceon_cache_fns) | |||
374 | .long feroceon_coherent_kern_range | 412 | .long feroceon_coherent_kern_range |
375 | .long feroceon_coherent_user_range | 413 | .long feroceon_coherent_user_range |
376 | .long feroceon_flush_kern_dcache_area | 414 | .long feroceon_flush_kern_dcache_area |
377 | .long feroceon_dma_inv_range | 415 | .long feroceon_dma_map_area |
378 | .long feroceon_dma_clean_range | 416 | .long feroceon_dma_unmap_area |
379 | .long feroceon_dma_flush_range | 417 | .long feroceon_dma_flush_range |
380 | 418 | ||
381 | ENTRY(feroceon_range_cache_fns) | 419 | ENTRY(feroceon_range_cache_fns) |
@@ -385,8 +423,8 @@ ENTRY(feroceon_range_cache_fns) | |||
385 | .long feroceon_coherent_kern_range | 423 | .long feroceon_coherent_kern_range |
386 | .long feroceon_coherent_user_range | 424 | .long feroceon_coherent_user_range |
387 | .long feroceon_range_flush_kern_dcache_area | 425 | .long feroceon_range_flush_kern_dcache_area |
388 | .long feroceon_range_dma_inv_range | 426 | .long feroceon_range_dma_map_area |
389 | .long feroceon_range_dma_clean_range | 427 | .long feroceon_dma_unmap_area |
390 | .long feroceon_range_dma_flush_range | 428 | .long feroceon_range_dma_flush_range |
391 | 429 | ||
392 | .align 5 | 430 | .align 5 |
diff --git a/arch/arm/mm/proc-mohawk.S b/arch/arm/mm/proc-mohawk.S index 9674d36cc97d..caa31154e7db 100644 --- a/arch/arm/mm/proc-mohawk.S +++ b/arch/arm/mm/proc-mohawk.S | |||
@@ -218,7 +218,7 @@ ENTRY(mohawk_flush_kern_dcache_area) | |||
218 | * | 218 | * |
219 | * (same as v4wb) | 219 | * (same as v4wb) |
220 | */ | 220 | */ |
221 | ENTRY(mohawk_dma_inv_range) | 221 | mohawk_dma_inv_range: |
222 | tst r0, #CACHE_DLINESIZE - 1 | 222 | tst r0, #CACHE_DLINESIZE - 1 |
223 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 223 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
224 | tst r1, #CACHE_DLINESIZE - 1 | 224 | tst r1, #CACHE_DLINESIZE - 1 |
@@ -241,7 +241,7 @@ ENTRY(mohawk_dma_inv_range) | |||
241 | * | 241 | * |
242 | * (same as v4wb) | 242 | * (same as v4wb) |
243 | */ | 243 | */ |
244 | ENTRY(mohawk_dma_clean_range) | 244 | mohawk_dma_clean_range: |
245 | bic r0, r0, #CACHE_DLINESIZE - 1 | 245 | bic r0, r0, #CACHE_DLINESIZE - 1 |
246 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 246 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
247 | add r0, r0, #CACHE_DLINESIZE | 247 | add r0, r0, #CACHE_DLINESIZE |
@@ -268,6 +268,30 @@ ENTRY(mohawk_dma_flush_range) | |||
268 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 268 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
269 | mov pc, lr | 269 | mov pc, lr |
270 | 270 | ||
271 | /* | ||
272 | * dma_map_area(start, size, dir) | ||
273 | * - start - kernel virtual start address | ||
274 | * - size - size of region | ||
275 | * - dir - DMA direction | ||
276 | */ | ||
277 | ENTRY(mohawk_dma_map_area) | ||
278 | add r1, r1, r0 | ||
279 | cmp r2, #DMA_TO_DEVICE | ||
280 | beq mohawk_dma_clean_range | ||
281 | bcs mohawk_dma_inv_range | ||
282 | b mohawk_dma_flush_range | ||
283 | ENDPROC(mohawk_dma_map_area) | ||
284 | |||
285 | /* | ||
286 | * dma_unmap_area(start, size, dir) | ||
287 | * - start - kernel virtual start address | ||
288 | * - size - size of region | ||
289 | * - dir - DMA direction | ||
290 | */ | ||
291 | ENTRY(mohawk_dma_unmap_area) | ||
292 | mov pc, lr | ||
293 | ENDPROC(mohawk_dma_unmap_area) | ||
294 | |||
271 | ENTRY(mohawk_cache_fns) | 295 | ENTRY(mohawk_cache_fns) |
272 | .long mohawk_flush_kern_cache_all | 296 | .long mohawk_flush_kern_cache_all |
273 | .long mohawk_flush_user_cache_all | 297 | .long mohawk_flush_user_cache_all |
@@ -275,8 +299,8 @@ ENTRY(mohawk_cache_fns) | |||
275 | .long mohawk_coherent_kern_range | 299 | .long mohawk_coherent_kern_range |
276 | .long mohawk_coherent_user_range | 300 | .long mohawk_coherent_user_range |
277 | .long mohawk_flush_kern_dcache_area | 301 | .long mohawk_flush_kern_dcache_area |
278 | .long mohawk_dma_inv_range | 302 | .long mohawk_dma_map_area |
279 | .long mohawk_dma_clean_range | 303 | .long mohawk_dma_unmap_area |
280 | .long mohawk_dma_flush_range | 304 | .long mohawk_dma_flush_range |
281 | 305 | ||
282 | ENTRY(cpu_mohawk_dcache_clean_area) | 306 | ENTRY(cpu_mohawk_dcache_clean_area) |
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S index 96456f548798..e5797f1c1db7 100644 --- a/arch/arm/mm/proc-xsc3.S +++ b/arch/arm/mm/proc-xsc3.S | |||
@@ -257,7 +257,7 @@ ENTRY(xsc3_flush_kern_dcache_area) | |||
257 | * - start - virtual start address | 257 | * - start - virtual start address |
258 | * - end - virtual end address | 258 | * - end - virtual end address |
259 | */ | 259 | */ |
260 | ENTRY(xsc3_dma_inv_range) | 260 | xsc3_dma_inv_range: |
261 | tst r0, #CACHELINESIZE - 1 | 261 | tst r0, #CACHELINESIZE - 1 |
262 | bic r0, r0, #CACHELINESIZE - 1 | 262 | bic r0, r0, #CACHELINESIZE - 1 |
263 | mcrne p15, 0, r0, c7, c10, 1 @ clean L1 D line | 263 | mcrne p15, 0, r0, c7, c10, 1 @ clean L1 D line |
@@ -278,7 +278,7 @@ ENTRY(xsc3_dma_inv_range) | |||
278 | * - start - virtual start address | 278 | * - start - virtual start address |
279 | * - end - virtual end address | 279 | * - end - virtual end address |
280 | */ | 280 | */ |
281 | ENTRY(xsc3_dma_clean_range) | 281 | xsc3_dma_clean_range: |
282 | bic r0, r0, #CACHELINESIZE - 1 | 282 | bic r0, r0, #CACHELINESIZE - 1 |
283 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line | 283 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line |
284 | add r0, r0, #CACHELINESIZE | 284 | add r0, r0, #CACHELINESIZE |
@@ -304,6 +304,30 @@ ENTRY(xsc3_dma_flush_range) | |||
304 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier | 304 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier |
305 | mov pc, lr | 305 | mov pc, lr |
306 | 306 | ||
307 | /* | ||
308 | * dma_map_area(start, size, dir) | ||
309 | * - start - kernel virtual start address | ||
310 | * - size - size of region | ||
311 | * - dir - DMA direction | ||
312 | */ | ||
313 | ENTRY(xsc3_dma_map_area) | ||
314 | add r1, r1, r0 | ||
315 | cmp r2, #DMA_TO_DEVICE | ||
316 | beq xsc3_dma_clean_range | ||
317 | bcs xsc3_dma_inv_range | ||
318 | b xsc3_dma_flush_range | ||
319 | ENDPROC(xsc3_dma_map_area) | ||
320 | |||
321 | /* | ||
322 | * dma_unmap_area(start, size, dir) | ||
323 | * - start - kernel virtual start address | ||
324 | * - size - size of region | ||
325 | * - dir - DMA direction | ||
326 | */ | ||
327 | ENTRY(xsc3_dma_unmap_area) | ||
328 | mov pc, lr | ||
329 | ENDPROC(xsc3_dma_unmap_area) | ||
330 | |||
307 | ENTRY(xsc3_cache_fns) | 331 | ENTRY(xsc3_cache_fns) |
308 | .long xsc3_flush_kern_cache_all | 332 | .long xsc3_flush_kern_cache_all |
309 | .long xsc3_flush_user_cache_all | 333 | .long xsc3_flush_user_cache_all |
@@ -311,8 +335,8 @@ ENTRY(xsc3_cache_fns) | |||
311 | .long xsc3_coherent_kern_range | 335 | .long xsc3_coherent_kern_range |
312 | .long xsc3_coherent_user_range | 336 | .long xsc3_coherent_user_range |
313 | .long xsc3_flush_kern_dcache_area | 337 | .long xsc3_flush_kern_dcache_area |
314 | .long xsc3_dma_inv_range | 338 | .long xsc3_dma_map_area |
315 | .long xsc3_dma_clean_range | 339 | .long xsc3_dma_unmap_area |
316 | .long xsc3_dma_flush_range | 340 | .long xsc3_dma_flush_range |
317 | 341 | ||
318 | ENTRY(cpu_xsc3_dcache_clean_area) | 342 | ENTRY(cpu_xsc3_dcache_clean_area) |
@@ -407,6 +431,13 @@ __xsc3_setup: | |||
407 | 431 | ||
408 | adr r5, xsc3_crval | 432 | adr r5, xsc3_crval |
409 | ldmia r5, {r5, r6} | 433 | ldmia r5, {r5, r6} |
434 | |||
435 | #ifdef CONFIG_CACHE_XSC3L2 | ||
436 | mrc p15, 1, r0, c0, c0, 1 @ get L2 present information | ||
437 | ands r0, r0, #0xf8 | ||
438 | orrne r6, r6, #(1 << 26) @ enable L2 if present | ||
439 | #endif | ||
440 | |||
410 | mrc p15, 0, r0, c1, c0, 0 @ get control register | 441 | mrc p15, 0, r0, c1, c0, 0 @ get control register |
411 | bic r0, r0, r5 @ ..V. ..R. .... ..A. | 442 | bic r0, r0, r5 @ ..V. ..R. .... ..A. |
412 | orr r0, r0, r6 @ ..VI Z..S .... .C.M (mmu) | 443 | orr r0, r0, r6 @ ..VI Z..S .... .C.M (mmu) |
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S index 93df47265f2d..63037e2162f2 100644 --- a/arch/arm/mm/proc-xscale.S +++ b/arch/arm/mm/proc-xscale.S | |||
@@ -315,7 +315,7 @@ ENTRY(xscale_flush_kern_dcache_area) | |||
315 | * - start - virtual start address | 315 | * - start - virtual start address |
316 | * - end - virtual end address | 316 | * - end - virtual end address |
317 | */ | 317 | */ |
318 | ENTRY(xscale_dma_inv_range) | 318 | xscale_dma_inv_range: |
319 | tst r0, #CACHELINESIZE - 1 | 319 | tst r0, #CACHELINESIZE - 1 |
320 | bic r0, r0, #CACHELINESIZE - 1 | 320 | bic r0, r0, #CACHELINESIZE - 1 |
321 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry | 321 | mcrne p15, 0, r0, c7, c10, 1 @ clean D entry |
@@ -336,7 +336,7 @@ ENTRY(xscale_dma_inv_range) | |||
336 | * - start - virtual start address | 336 | * - start - virtual start address |
337 | * - end - virtual end address | 337 | * - end - virtual end address |
338 | */ | 338 | */ |
339 | ENTRY(xscale_dma_clean_range) | 339 | xscale_dma_clean_range: |
340 | bic r0, r0, #CACHELINESIZE - 1 | 340 | bic r0, r0, #CACHELINESIZE - 1 |
341 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 341 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
342 | add r0, r0, #CACHELINESIZE | 342 | add r0, r0, #CACHELINESIZE |
@@ -363,6 +363,43 @@ ENTRY(xscale_dma_flush_range) | |||
363 | mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer | 363 | mcr p15, 0, r0, c7, c10, 4 @ Drain Write (& Fill) Buffer |
364 | mov pc, lr | 364 | mov pc, lr |
365 | 365 | ||
366 | /* | ||
367 | * dma_map_area(start, size, dir) | ||
368 | * - start - kernel virtual start address | ||
369 | * - size - size of region | ||
370 | * - dir - DMA direction | ||
371 | */ | ||
372 | ENTRY(xscale_dma_map_area) | ||
373 | add r1, r1, r0 | ||
374 | cmp r2, #DMA_TO_DEVICE | ||
375 | beq xscale_dma_clean_range | ||
376 | bcs xscale_dma_inv_range | ||
377 | b xscale_dma_flush_range | ||
378 | ENDPROC(xscale_dma_map_area) | ||
379 | |||
380 | /* | ||
381 | * dma_map_area(start, size, dir) | ||
382 | * - start - kernel virtual start address | ||
383 | * - size - size of region | ||
384 | * - dir - DMA direction | ||
385 | */ | ||
386 | ENTRY(xscale_dma_a0_map_area) | ||
387 | add r1, r1, r0 | ||
388 | teq r2, #DMA_TO_DEVICE | ||
389 | beq xscale_dma_clean_range | ||
390 | b xscale_dma_flush_range | ||
391 | ENDPROC(xscsale_dma_a0_map_area) | ||
392 | |||
393 | /* | ||
394 | * dma_unmap_area(start, size, dir) | ||
395 | * - start - kernel virtual start address | ||
396 | * - size - size of region | ||
397 | * - dir - DMA direction | ||
398 | */ | ||
399 | ENTRY(xscale_dma_unmap_area) | ||
400 | mov pc, lr | ||
401 | ENDPROC(xscale_dma_unmap_area) | ||
402 | |||
366 | ENTRY(xscale_cache_fns) | 403 | ENTRY(xscale_cache_fns) |
367 | .long xscale_flush_kern_cache_all | 404 | .long xscale_flush_kern_cache_all |
368 | .long xscale_flush_user_cache_all | 405 | .long xscale_flush_user_cache_all |
@@ -370,8 +407,8 @@ ENTRY(xscale_cache_fns) | |||
370 | .long xscale_coherent_kern_range | 407 | .long xscale_coherent_kern_range |
371 | .long xscale_coherent_user_range | 408 | .long xscale_coherent_user_range |
372 | .long xscale_flush_kern_dcache_area | 409 | .long xscale_flush_kern_dcache_area |
373 | .long xscale_dma_inv_range | 410 | .long xscale_dma_map_area |
374 | .long xscale_dma_clean_range | 411 | .long xscale_dma_unmap_area |
375 | .long xscale_dma_flush_range | 412 | .long xscale_dma_flush_range |
376 | 413 | ||
377 | /* | 414 | /* |
@@ -394,8 +431,8 @@ ENTRY(xscale_80200_A0_A1_cache_fns) | |||
394 | .long xscale_coherent_kern_range | 431 | .long xscale_coherent_kern_range |
395 | .long xscale_coherent_user_range | 432 | .long xscale_coherent_user_range |
396 | .long xscale_flush_kern_dcache_area | 433 | .long xscale_flush_kern_dcache_area |
397 | .long xscale_dma_flush_range | 434 | .long xscale_dma_a0_map_area |
398 | .long xscale_dma_clean_range | 435 | .long xscale_dma_unmap_area |
399 | .long xscale_dma_flush_range | 436 | .long xscale_dma_flush_range |
400 | 437 | ||
401 | ENTRY(cpu_xscale_dcache_clean_area) | 438 | ENTRY(cpu_xscale_dcache_clean_area) |
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S index a26a605b73bd..0cb1848bd876 100644 --- a/arch/arm/mm/tlb-v7.S +++ b/arch/arm/mm/tlb-v7.S | |||
@@ -40,7 +40,6 @@ ENTRY(v7wbi_flush_user_tlb_range) | |||
40 | asid r3, r3 @ mask ASID | 40 | asid r3, r3 @ mask ASID |
41 | orr r0, r3, r0, lsl #PAGE_SHIFT @ Create initial MVA | 41 | orr r0, r3, r0, lsl #PAGE_SHIFT @ Create initial MVA |
42 | mov r1, r1, lsl #PAGE_SHIFT | 42 | mov r1, r1, lsl #PAGE_SHIFT |
43 | vma_vm_flags r2, r2 @ get vma->vm_flags | ||
44 | 1: | 43 | 1: |
45 | #ifdef CONFIG_SMP | 44 | #ifdef CONFIG_SMP |
46 | mcr p15, 0, r0, c8, c3, 1 @ TLB invalidate U MVA (shareable) | 45 | mcr p15, 0, r0, c8, c3, 1 @ TLB invalidate U MVA (shareable) |
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx25.h b/arch/arm/plat-mxc/include/mach/iomux-mx25.h index 810c47f56e77..9af494f0ab3d 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-mx25.h +++ b/arch/arm/plat-mxc/include/mach/iomux-mx25.h | |||
@@ -58,19 +58,19 @@ | |||
58 | 58 | ||
59 | #define MX25_PAD_A18__A18 IOMUX_PAD(0x23c, 0x020, 0x10, 0, 0, NO_PAD_CTRL) | 59 | #define MX25_PAD_A18__A18 IOMUX_PAD(0x23c, 0x020, 0x10, 0, 0, NO_PAD_CTRL) |
60 | #define MX25_PAD_A18__GPIO_2_4 IOMUX_PAD(0x23c, 0x020, 0x15, 0, 0, NO_PAD_CTRL) | 60 | #define MX25_PAD_A18__GPIO_2_4 IOMUX_PAD(0x23c, 0x020, 0x15, 0, 0, NO_PAD_CTRL) |
61 | #define MX25_PAD_A18__FEC_COL IOMUX_PAD(0x23c, 0x020, 0x17, 0x504, 0, NO_PAD_CTL) | 61 | #define MX25_PAD_A18__FEC_COL IOMUX_PAD(0x23c, 0x020, 0x17, 0x504, 0, NO_PAD_CTRL) |
62 | 62 | ||
63 | #define MX25_PAD_A19__A19 IOMUX_PAD(0x240, 0x024, 0x10, 0, 0, NO_PAD_CTRL) | 63 | #define MX25_PAD_A19__A19 IOMUX_PAD(0x240, 0x024, 0x10, 0, 0, NO_PAD_CTRL) |
64 | #define MX25_PAD_A19__FEC_RX_ER IOMUX_PAD(0x240, 0x024, 0x17, 0x518, 0, NO_PAD_CTL) | 64 | #define MX25_PAD_A19__FEC_RX_ER IOMUX_PAD(0x240, 0x024, 0x17, 0x518, 0, NO_PAD_CTRL) |
65 | #define MX25_PAD_A19__GPIO_2_5 IOMUX_PAD(0x240, 0x024, 0x15, 0, 0, NO_PAD_CTRL) | 65 | #define MX25_PAD_A19__GPIO_2_5 IOMUX_PAD(0x240, 0x024, 0x15, 0, 0, NO_PAD_CTRL) |
66 | 66 | ||
67 | #define MX25_PAD_A20__A20 IOMUX_PAD(0x244, 0x028, 0x10, 0, 0, NO_PAD_CTRL) | 67 | #define MX25_PAD_A20__A20 IOMUX_PAD(0x244, 0x028, 0x10, 0, 0, NO_PAD_CTRL) |
68 | #define MX25_PAD_A20__GPIO_2_6 IOMUX_PAD(0x244, 0x028, 0x15, 0, 0, NO_PAD_CTRL) | 68 | #define MX25_PAD_A20__GPIO_2_6 IOMUX_PAD(0x244, 0x028, 0x15, 0, 0, NO_PAD_CTRL) |
69 | #define MX25_PAD_A20__FEC_RDATA2 IOMUX_PAD(0x244, 0x028, 0x17, 0x50c, 0, NO_PAD_CTL) | 69 | #define MX25_PAD_A20__FEC_RDATA2 IOMUX_PAD(0x244, 0x028, 0x17, 0x50c, 0, NO_PAD_CTRL) |
70 | 70 | ||
71 | #define MX25_PAD_A21__A21 IOMUX_PAD(0x248, 0x02c, 0x10, 0, 0, NO_PAD_CTRL) | 71 | #define MX25_PAD_A21__A21 IOMUX_PAD(0x248, 0x02c, 0x10, 0, 0, NO_PAD_CTRL) |
72 | #define MX25_PAD_A21__GPIO_2_7 IOMUX_PAD(0x248, 0x02c, 0x15, 0, 0, NO_PAD_CTRL) | 72 | #define MX25_PAD_A21__GPIO_2_7 IOMUX_PAD(0x248, 0x02c, 0x15, 0, 0, NO_PAD_CTRL) |
73 | #define MX25_PAD_A21__FEC_RDATA3 IOMUX_PAD(0x248, 0x02c, 0x17, 0x510, 0, NO_PAD_CTL) | 73 | #define MX25_PAD_A21__FEC_RDATA3 IOMUX_PAD(0x248, 0x02c, 0x17, 0x510, 0, NO_PAD_CTRL) |
74 | 74 | ||
75 | #define MX25_PAD_A22__A22 IOMUX_PAD(0x000, 0x030, 0x10, 0, 0, NO_PAD_CTRL) | 75 | #define MX25_PAD_A22__A22 IOMUX_PAD(0x000, 0x030, 0x10, 0, 0, NO_PAD_CTRL) |
76 | #define MX25_PAD_A22__GPIO_2_8 IOMUX_PAD(0x000, 0x030, 0x15, 0, 0, NO_PAD_CTRL) | 76 | #define MX25_PAD_A22__GPIO_2_8 IOMUX_PAD(0x000, 0x030, 0x15, 0, 0, NO_PAD_CTRL) |
@@ -80,11 +80,11 @@ | |||
80 | 80 | ||
81 | #define MX25_PAD_A24__A24 IOMUX_PAD(0x250, 0x038, 0x10, 0, 0, NO_PAD_CTRL) | 81 | #define MX25_PAD_A24__A24 IOMUX_PAD(0x250, 0x038, 0x10, 0, 0, NO_PAD_CTRL) |
82 | #define MX25_PAD_A24__GPIO_2_10 IOMUX_PAD(0x250, 0x038, 0x15, 0, 0, NO_PAD_CTRL) | 82 | #define MX25_PAD_A24__GPIO_2_10 IOMUX_PAD(0x250, 0x038, 0x15, 0, 0, NO_PAD_CTRL) |
83 | #define MX25_PAD_A24__FEC_RX_CLK IOMUX_PAD(0x250, 0x038, 0x17, 0x514, 0, NO_PAD_CTL) | 83 | #define MX25_PAD_A24__FEC_RX_CLK IOMUX_PAD(0x250, 0x038, 0x17, 0x514, 0, NO_PAD_CTRL) |
84 | 84 | ||
85 | #define MX25_PAD_A25__A25 IOMUX_PAD(0x254, 0x03c, 0x10, 0, 0, NO_PAD_CTRL) | 85 | #define MX25_PAD_A25__A25 IOMUX_PAD(0x254, 0x03c, 0x10, 0, 0, NO_PAD_CTRL) |
86 | #define MX25_PAD_A25__GPIO_2_11 IOMUX_PAD(0x254, 0x03c, 0x15, 0, 0, NO_PAD_CTRL) | 86 | #define MX25_PAD_A25__GPIO_2_11 IOMUX_PAD(0x254, 0x03c, 0x15, 0, 0, NO_PAD_CTRL) |
87 | #define MX25_PAD_A25__FEC_CRS IOMUX_PAD(0x254, 0x03c, 0x17, 0x508, 0, NO_PAD_CTL) | 87 | #define MX25_PAD_A25__FEC_CRS IOMUX_PAD(0x254, 0x03c, 0x17, 0x508, 0, NO_PAD_CTRL) |
88 | 88 | ||
89 | #define MX25_PAD_EB0__EB0 IOMUX_PAD(0x258, 0x040, 0x10, 0, 0, NO_PAD_CTRL) | 89 | #define MX25_PAD_EB0__EB0 IOMUX_PAD(0x258, 0x040, 0x10, 0, 0, NO_PAD_CTRL) |
90 | #define MX25_PAD_EB0__AUD4_TXD IOMUX_PAD(0x258, 0x040, 0x14, 0x464, 0, NO_PAD_CTRL) | 90 | #define MX25_PAD_EB0__AUD4_TXD IOMUX_PAD(0x258, 0x040, 0x14, 0x464, 0, NO_PAD_CTRL) |
@@ -112,7 +112,7 @@ | |||
112 | #define MX25_PAD_CS5__UART5_RTS IOMUX_PAD(0x268, 0x058, 0x13, 0x574, 0, NO_PAD_CTRL) | 112 | #define MX25_PAD_CS5__UART5_RTS IOMUX_PAD(0x268, 0x058, 0x13, 0x574, 0, NO_PAD_CTRL) |
113 | #define MX25_PAD_CS5__GPIO_3_21 IOMUX_PAD(0x268, 0x058, 0x15, 0, 0, NO_PAD_CTRL) | 113 | #define MX25_PAD_CS5__GPIO_3_21 IOMUX_PAD(0x268, 0x058, 0x15, 0, 0, NO_PAD_CTRL) |
114 | 114 | ||
115 | #define MX25_PAD_NF_CE0__NF_CE0 IOMUX_PAD(0x26c, 0x05c, 0x10, 0, 0, NO_PAD_CTL) | 115 | #define MX25_PAD_NF_CE0__NF_CE0 IOMUX_PAD(0x26c, 0x05c, 0x10, 0, 0, NO_PAD_CTRL) |
116 | #define MX25_PAD_NF_CE0__GPIO_3_22 IOMUX_PAD(0x26c, 0x05c, 0x15, 0, 0, NO_PAD_CTRL) | 116 | #define MX25_PAD_NF_CE0__GPIO_3_22 IOMUX_PAD(0x26c, 0x05c, 0x15, 0, 0, NO_PAD_CTRL) |
117 | 117 | ||
118 | #define MX25_PAD_ECB__ECB IOMUX_PAD(0x270, 0x060, 0x10, 0, 0, NO_PAD_CTRL) | 118 | #define MX25_PAD_ECB__ECB IOMUX_PAD(0x270, 0x060, 0x10, 0, 0, NO_PAD_CTRL) |
@@ -229,28 +229,28 @@ | |||
229 | #define MX25_PAD_LD7__GPIO_1_21 IOMUX_PAD(0x2dc, 0x0e4, 0x15, 0, 0, NO_PAD_CTRL) | 229 | #define MX25_PAD_LD7__GPIO_1_21 IOMUX_PAD(0x2dc, 0x0e4, 0x15, 0, 0, NO_PAD_CTRL) |
230 | 230 | ||
231 | #define MX25_PAD_LD8__LD8 IOMUX_PAD(0x2e0, 0x0e8, 0x10, 0, 0, NO_PAD_CTRL) | 231 | #define MX25_PAD_LD8__LD8 IOMUX_PAD(0x2e0, 0x0e8, 0x10, 0, 0, NO_PAD_CTRL) |
232 | #define MX25_PAD_LD8__FEC_TX_ERR IOMUX_PAD(0x2e0, 0x0e8, 0x15, 0, 0, NO_PAD_CTL) | 232 | #define MX25_PAD_LD8__FEC_TX_ERR IOMUX_PAD(0x2e0, 0x0e8, 0x15, 0, 0, NO_PAD_CTRL) |
233 | 233 | ||
234 | #define MX25_PAD_LD9__LD9 IOMUX_PAD(0x2e4, 0x0ec, 0x10, 0, 0, NO_PAD_CTRL) | 234 | #define MX25_PAD_LD9__LD9 IOMUX_PAD(0x2e4, 0x0ec, 0x10, 0, 0, NO_PAD_CTRL) |
235 | #define MX25_PAD_LD9__FEC_COL IOMUX_PAD(0x2e4, 0x0ec, 0x15, 0x504, 1, NO_PAD_CTL) | 235 | #define MX25_PAD_LD9__FEC_COL IOMUX_PAD(0x2e4, 0x0ec, 0x15, 0x504, 1, NO_PAD_CTRL) |
236 | 236 | ||
237 | #define MX25_PAD_LD10__LD10 IOMUX_PAD(0x2e8, 0x0f0, 0x10, 0, 0, NO_PAD_CTRL) | 237 | #define MX25_PAD_LD10__LD10 IOMUX_PAD(0x2e8, 0x0f0, 0x10, 0, 0, NO_PAD_CTRL) |
238 | #define MX25_PAD_LD10__FEC_RX_ER IOMUX_PAD(0x2e8, 0x0f0, 0x15, 0x518, 1, NO_PAD_CTL) | 238 | #define MX25_PAD_LD10__FEC_RX_ER IOMUX_PAD(0x2e8, 0x0f0, 0x15, 0x518, 1, NO_PAD_CTRL) |
239 | 239 | ||
240 | #define MX25_PAD_LD11__LD11 IOMUX_PAD(0x2ec, 0x0f4, 0x10, 0, 0, NO_PAD_CTRL) | 240 | #define MX25_PAD_LD11__LD11 IOMUX_PAD(0x2ec, 0x0f4, 0x10, 0, 0, NO_PAD_CTRL) |
241 | #define MX25_PAD_LD11__FEC_RDATA2 IOMUX_PAD(0x2ec, 0x0f4, 0x15, 0x50c, 1, NO_PAD_CTL) | 241 | #define MX25_PAD_LD11__FEC_RDATA2 IOMUX_PAD(0x2ec, 0x0f4, 0x15, 0x50c, 1, NO_PAD_CTRL) |
242 | 242 | ||
243 | #define MX25_PAD_LD12__LD12 IOMUX_PAD(0x2f0, 0x0f8, 0x10, 0, 0, NO_PAD_CTRL) | 243 | #define MX25_PAD_LD12__LD12 IOMUX_PAD(0x2f0, 0x0f8, 0x10, 0, 0, NO_PAD_CTRL) |
244 | #define MX25_PAD_LD12__FEC_RDATA3 IOMUX_PAD(0x2f0, 0x0f8, 0x15, 0x510, 1, NO_PAD_CTL) | 244 | #define MX25_PAD_LD12__FEC_RDATA3 IOMUX_PAD(0x2f0, 0x0f8, 0x15, 0x510, 1, NO_PAD_CTRL) |
245 | 245 | ||
246 | #define MX25_PAD_LD13__LD13 IOMUX_PAD(0x2f4, 0x0fc, 0x10, 0, 0, NO_PAD_CTRL) | 246 | #define MX25_PAD_LD13__LD13 IOMUX_PAD(0x2f4, 0x0fc, 0x10, 0, 0, NO_PAD_CTRL) |
247 | #define MX25_PAD_LD13__FEC_TDATA2 IOMUX_PAD(0x2f4, 0x0fc, 0x15, 0, 0, NO_PAD_CTL) | 247 | #define MX25_PAD_LD13__FEC_TDATA2 IOMUX_PAD(0x2f4, 0x0fc, 0x15, 0, 0, NO_PAD_CTRL) |
248 | 248 | ||
249 | #define MX25_PAD_LD14__LD14 IOMUX_PAD(0x2f8, 0x100, 0x10, 0, 0, NO_PAD_CTRL) | 249 | #define MX25_PAD_LD14__LD14 IOMUX_PAD(0x2f8, 0x100, 0x10, 0, 0, NO_PAD_CTRL) |
250 | #define MX25_PAD_LD14__FEC_TDATA3 IOMUX_PAD(0x2f8, 0x100, 0x15, 0, 0, NO_PAD_CTL) | 250 | #define MX25_PAD_LD14__FEC_TDATA3 IOMUX_PAD(0x2f8, 0x100, 0x15, 0, 0, NO_PAD_CTRL) |
251 | 251 | ||
252 | #define MX25_PAD_LD15__LD15 IOMUX_PAD(0x2fc, 0x104, 0x10, 0, 0, NO_PAD_CTRL) | 252 | #define MX25_PAD_LD15__LD15 IOMUX_PAD(0x2fc, 0x104, 0x10, 0, 0, NO_PAD_CTRL) |
253 | #define MX25_PAD_LD15__FEC_RX_CLK IOMUX_PAD(0x2fc, 0x104, 0x15, 0x514, 1, NO_PAD_CTL) | 253 | #define MX25_PAD_LD15__FEC_RX_CLK IOMUX_PAD(0x2fc, 0x104, 0x15, 0x514, 1, NO_PAD_CTRL) |
254 | 254 | ||
255 | #define MX25_PAD_HSYNC__HSYNC IOMUX_PAD(0x300, 0x108, 0x10, 0, 0, NO_PAD_CTRL) | 255 | #define MX25_PAD_HSYNC__HSYNC IOMUX_PAD(0x300, 0x108, 0x10, 0, 0, NO_PAD_CTRL) |
256 | #define MX25_PAD_HSYNC__GPIO_1_22 IOMUX_PAD(0x300, 0x108, 0x15, 0, 0, NO_PAD_CTRL) | 256 | #define MX25_PAD_HSYNC__GPIO_1_22 IOMUX_PAD(0x300, 0x108, 0x15, 0, 0, NO_PAD_CTRL) |
@@ -265,7 +265,7 @@ | |||
265 | #define MX25_PAD_OE_ACD__GPIO_1_25 IOMUX_PAD(0x30c, 0x114, 0x15, 0, 0, NO_PAD_CTRL) | 265 | #define MX25_PAD_OE_ACD__GPIO_1_25 IOMUX_PAD(0x30c, 0x114, 0x15, 0, 0, NO_PAD_CTRL) |
266 | 266 | ||
267 | #define MX25_PAD_CONTRAST__CONTRAST IOMUX_PAD(0x310, 0x118, 0x10, 0, 0, NO_PAD_CTRL) | 267 | #define MX25_PAD_CONTRAST__CONTRAST IOMUX_PAD(0x310, 0x118, 0x10, 0, 0, NO_PAD_CTRL) |
268 | #define MX25_PAD_CONTRAST__FEC_CRS IOMUX_PAD(0x310, 0x118, 0x15, 0x508, 1, NO_PAD_CTL) | 268 | #define MX25_PAD_CONTRAST__FEC_CRS IOMUX_PAD(0x310, 0x118, 0x15, 0x508, 1, NO_PAD_CTRL) |
269 | 269 | ||
270 | #define MX25_PAD_PWM__PWM IOMUX_PAD(0x314, 0x11c, 0x10, 0, 0, NO_PAD_CTRL) | 270 | #define MX25_PAD_PWM__PWM IOMUX_PAD(0x314, 0x11c, 0x10, 0, 0, NO_PAD_CTRL) |
271 | #define MX25_PAD_PWM__GPIO_1_26 IOMUX_PAD(0x314, 0x11c, 0x15, 0, 0, NO_PAD_CTRL) | 271 | #define MX25_PAD_PWM__GPIO_1_26 IOMUX_PAD(0x314, 0x11c, 0x15, 0, 0, NO_PAD_CTRL) |
@@ -354,19 +354,19 @@ | |||
354 | #define MX25_PAD_UART2_TXD__GPIO_4_27 IOMUX_PAD(0x37c, 0x184, 0x15, 0, 0, NO_PAD_CTRL) | 354 | #define MX25_PAD_UART2_TXD__GPIO_4_27 IOMUX_PAD(0x37c, 0x184, 0x15, 0, 0, NO_PAD_CTRL) |
355 | 355 | ||
356 | #define MX25_PAD_UART2_RTS__UART2_RTS IOMUX_PAD(0x380, 0x188, 0x10, 0, 0, NO_PAD_CTRL) | 356 | #define MX25_PAD_UART2_RTS__UART2_RTS IOMUX_PAD(0x380, 0x188, 0x10, 0, 0, NO_PAD_CTRL) |
357 | #define MX25_PAD_UART2_RTS__FEC_COL IOMUX_PAD(0x380, 0x188, 0x12, 0x504, 2, NO_PAD_CTL) | 357 | #define MX25_PAD_UART2_RTS__FEC_COL IOMUX_PAD(0x380, 0x188, 0x12, 0x504, 2, NO_PAD_CTRL) |
358 | #define MX25_PAD_UART2_RTS__GPIO_4_28 IOMUX_PAD(0x380, 0x188, 0x15, 0, 0, NO_PAD_CTRL) | 358 | #define MX25_PAD_UART2_RTS__GPIO_4_28 IOMUX_PAD(0x380, 0x188, 0x15, 0, 0, NO_PAD_CTRL) |
359 | 359 | ||
360 | #define MX25_PAD_UART2_CTS__FEC_RX_ER IOMUX_PAD(0x384, 0x18c, 0x12, 0x518, 2, NO_PAD_CTL) | 360 | #define MX25_PAD_UART2_CTS__FEC_RX_ER IOMUX_PAD(0x384, 0x18c, 0x12, 0x518, 2, NO_PAD_CTRL) |
361 | #define MX25_PAD_UART2_CTS__UART2_CTS IOMUX_PAD(0x384, 0x18c, 0x10, 0, 0, NO_PAD_CTRL) | 361 | #define MX25_PAD_UART2_CTS__UART2_CTS IOMUX_PAD(0x384, 0x18c, 0x10, 0, 0, NO_PAD_CTRL) |
362 | #define MX25_PAD_UART2_CTS__GPIO_4_29 IOMUX_PAD(0x384, 0x18c, 0x15, 0, 0, NO_PAD_CTRL) | 362 | #define MX25_PAD_UART2_CTS__GPIO_4_29 IOMUX_PAD(0x384, 0x18c, 0x15, 0, 0, NO_PAD_CTRL) |
363 | 363 | ||
364 | #define MX25_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x388, 0x190, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) | 364 | #define MX25_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x388, 0x190, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) |
365 | #define MX25_PAD_SD1_CMD__FEC_RDATA2 IOMUX_PAD(0x388, 0x190, 0x12, 0x50c, 2, NO_PAD_CTL) | 365 | #define MX25_PAD_SD1_CMD__FEC_RDATA2 IOMUX_PAD(0x388, 0x190, 0x12, 0x50c, 2, NO_PAD_CTRL) |
366 | #define MX25_PAD_SD1_CMD__GPIO_2_23 IOMUX_PAD(0x388, 0x190, 0x15, 0, 0, NO_PAD_CTRL) | 366 | #define MX25_PAD_SD1_CMD__GPIO_2_23 IOMUX_PAD(0x388, 0x190, 0x15, 0, 0, NO_PAD_CTRL) |
367 | 367 | ||
368 | #define MX25_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x38c, 0x194, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) | 368 | #define MX25_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x38c, 0x194, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) |
369 | #define MX25_PAD_SD1_CLK__FEC_RDATA3 IOMUX_PAD(0x38c, 0x194, 0x12, 0x510, 2, NO_PAD_CTL) | 369 | #define MX25_PAD_SD1_CLK__FEC_RDATA3 IOMUX_PAD(0x38c, 0x194, 0x12, 0x510, 2, NO_PAD_CTRL) |
370 | #define MX25_PAD_SD1_CLK__GPIO_2_24 IOMUX_PAD(0x38c, 0x194, 0x15, 0, 0, NO_PAD_CTRL) | 370 | #define MX25_PAD_SD1_CLK__GPIO_2_24 IOMUX_PAD(0x38c, 0x194, 0x15, 0, 0, NO_PAD_CTRL) |
371 | 371 | ||
372 | #define MX25_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(0x390, 0x198, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) | 372 | #define MX25_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(0x390, 0x198, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) |
@@ -377,11 +377,11 @@ | |||
377 | #define MX25_PAD_SD1_DATA1__GPIO_2_26 IOMUX_PAD(0x394, 0x19c, 0x15, 0, 0, NO_PAD_CTRL) | 377 | #define MX25_PAD_SD1_DATA1__GPIO_2_26 IOMUX_PAD(0x394, 0x19c, 0x15, 0, 0, NO_PAD_CTRL) |
378 | 378 | ||
379 | #define MX25_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(0x398, 0x1a0, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) | 379 | #define MX25_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(0x398, 0x1a0, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) |
380 | #define MX25_PAD_SD1_DATA2__FEC_RX_CLK IOMUX_PAD(0x398, 0x1a0, 0x15, 0x514, 2, NO_PAD_CTL) | 380 | #define MX25_PAD_SD1_DATA2__FEC_RX_CLK IOMUX_PAD(0x398, 0x1a0, 0x15, 0x514, 2, NO_PAD_CTRL) |
381 | #define MX25_PAD_SD1_DATA2__GPIO_2_27 IOMUX_PAD(0x398, 0x1a0, 0x15, 0, 0, NO_PAD_CTRL) | 381 | #define MX25_PAD_SD1_DATA2__GPIO_2_27 IOMUX_PAD(0x398, 0x1a0, 0x15, 0, 0, NO_PAD_CTRL) |
382 | 382 | ||
383 | #define MX25_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(0x39c, 0x1a4, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) | 383 | #define MX25_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(0x39c, 0x1a4, 0x10, 0, 0, PAD_CTL_PUS_47K_UP) |
384 | #define MX25_PAD_SD1_DATA3__FEC_CRS IOMUX_PAD(0x39c, 0x1a4, 0x10, 0x508, 2, NO_PAD_CTL) | 384 | #define MX25_PAD_SD1_DATA3__FEC_CRS IOMUX_PAD(0x39c, 0x1a4, 0x10, 0x508, 2, NO_PAD_CTRL) |
385 | #define MX25_PAD_SD1_DATA3__GPIO_2_28 IOMUX_PAD(0x39c, 0x1a4, 0x15, 0, 0, NO_PAD_CTRL) | 385 | #define MX25_PAD_SD1_DATA3__GPIO_2_28 IOMUX_PAD(0x39c, 0x1a4, 0x15, 0, 0, NO_PAD_CTRL) |
386 | 386 | ||
387 | #define MX25_PAD_KPP_ROW0__KPP_ROW0 IOMUX_PAD(0x3a0, 0x1a8, 0x10, 0, 0, PAD_CTL_PKE) | 387 | #define MX25_PAD_KPP_ROW0__KPP_ROW0 IOMUX_PAD(0x3a0, 0x1a8, 0x10, 0, 0, PAD_CTL_PKE) |
@@ -410,7 +410,7 @@ | |||
410 | #define MX25_PAD_KPP_COL3__KPP_COL3 IOMUX_PAD(0x3bc, 0x1c4, 0x10, 0, 0, PAD_CTL_PKE | PAD_CTL_ODE) | 410 | #define MX25_PAD_KPP_COL3__KPP_COL3 IOMUX_PAD(0x3bc, 0x1c4, 0x10, 0, 0, PAD_CTL_PKE | PAD_CTL_ODE) |
411 | #define MX25_PAD_KPP_COL3__GPIO_3_4 IOMUX_PAD(0x3bc, 0x1c4, 0x15, 0, 0, NO_PAD_CTRL) | 411 | #define MX25_PAD_KPP_COL3__GPIO_3_4 IOMUX_PAD(0x3bc, 0x1c4, 0x15, 0, 0, NO_PAD_CTRL) |
412 | 412 | ||
413 | #define MX25_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(0x3c0, 0x1c8, 0x10, 0, 0, NO_PAD_CTL) | 413 | #define MX25_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(0x3c0, 0x1c8, 0x10, 0, 0, NO_PAD_CTRL) |
414 | #define MX25_PAD_FEC_MDC__AUD4_TXD IOMUX_PAD(0x3c0, 0x1c8, 0x12, 0x464, 1, NO_PAD_CTRL) | 414 | #define MX25_PAD_FEC_MDC__AUD4_TXD IOMUX_PAD(0x3c0, 0x1c8, 0x12, 0x464, 1, NO_PAD_CTRL) |
415 | #define MX25_PAD_FEC_MDC__GPIO_3_5 IOMUX_PAD(0x3c0, 0x1c8, 0x15, 0, 0, NO_PAD_CTRL) | 415 | #define MX25_PAD_FEC_MDC__GPIO_3_5 IOMUX_PAD(0x3c0, 0x1c8, 0x15, 0, 0, NO_PAD_CTRL) |
416 | 416 | ||
@@ -418,23 +418,23 @@ | |||
418 | #define MX25_PAD_FEC_MDIO__AUD4_RXD IOMUX_PAD(0x3c4, 0x1cc, 0x12, 0x460, 1, NO_PAD_CTRL) | 418 | #define MX25_PAD_FEC_MDIO__AUD4_RXD IOMUX_PAD(0x3c4, 0x1cc, 0x12, 0x460, 1, NO_PAD_CTRL) |
419 | #define MX25_PAD_FEC_MDIO__GPIO_3_6 IOMUX_PAD(0x3c4, 0x1cc, 0x15, 0, 0, NO_PAD_CTRL) | 419 | #define MX25_PAD_FEC_MDIO__GPIO_3_6 IOMUX_PAD(0x3c4, 0x1cc, 0x15, 0, 0, NO_PAD_CTRL) |
420 | 420 | ||
421 | #define MX25_PAD_FEC_TDATA0__FEC_TDATA0 IOMUX_PAD(0x3c8, 0x1d0, 0x10, 0, 0, NO_PAD_CTL) | 421 | #define MX25_PAD_FEC_TDATA0__FEC_TDATA0 IOMUX_PAD(0x3c8, 0x1d0, 0x10, 0, 0, NO_PAD_CTRL) |
422 | #define MX25_PAD_FEC_TDATA0__GPIO_3_7 IOMUX_PAD(0x3c8, 0x1d0, 0x15, 0, 0, NO_PAD_CTRL) | 422 | #define MX25_PAD_FEC_TDATA0__GPIO_3_7 IOMUX_PAD(0x3c8, 0x1d0, 0x15, 0, 0, NO_PAD_CTRL) |
423 | 423 | ||
424 | #define MX25_PAD_FEC_TDATA1__FEC_TDATA1 IOMUX_PAD(0x3cc, 0x1d4, 0x10, 0, 0, NO_PAD_CTL) | 424 | #define MX25_PAD_FEC_TDATA1__FEC_TDATA1 IOMUX_PAD(0x3cc, 0x1d4, 0x10, 0, 0, NO_PAD_CTRL) |
425 | #define MX25_PAD_FEC_TDATA1__AUD4_TXFS IOMUX_PAD(0x3cc, 0x1d4, 0x12, 0x474, 1, NO_PAD_CTRL) | 425 | #define MX25_PAD_FEC_TDATA1__AUD4_TXFS IOMUX_PAD(0x3cc, 0x1d4, 0x12, 0x474, 1, NO_PAD_CTRL) |
426 | #define MX25_PAD_FEC_TDATA1__GPIO_3_8 IOMUX_PAD(0x3cc, 0x1d4, 0x15, 0, 0, NO_PAD_CTRL) | 426 | #define MX25_PAD_FEC_TDATA1__GPIO_3_8 IOMUX_PAD(0x3cc, 0x1d4, 0x15, 0, 0, NO_PAD_CTRL) |
427 | 427 | ||
428 | #define MX25_PAD_FEC_TX_EN__FEC_TX_EN IOMUX_PAD(0x3d0, 0x1d8, 0x10, 0, 0, NO_PAD_CTL) | 428 | #define MX25_PAD_FEC_TX_EN__FEC_TX_EN IOMUX_PAD(0x3d0, 0x1d8, 0x10, 0, 0, NO_PAD_CTRL) |
429 | #define MX25_PAD_FEC_TX_EN__GPIO_3_9 IOMUX_PAD(0x3d0, 0x1d8, 0x15, 0, 0, NO_PAD_CTRL) | 429 | #define MX25_PAD_FEC_TX_EN__GPIO_3_9 IOMUX_PAD(0x3d0, 0x1d8, 0x15, 0, 0, NO_PAD_CTRL) |
430 | 430 | ||
431 | #define MX25_PAD_FEC_RDATA0__FEC_RDATA0 IOMUX_PAD(0x3d4, 0x1dc, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN | NO_PAD_CTL) | 431 | #define MX25_PAD_FEC_RDATA0__FEC_RDATA0 IOMUX_PAD(0x3d4, 0x1dc, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN | NO_PAD_CTRL) |
432 | #define MX25_PAD_FEC_RDATA0__GPIO_3_10 IOMUX_PAD(0x3d4, 0x1dc, 0x15, 0, 0, NO_PAD_CTRL) | 432 | #define MX25_PAD_FEC_RDATA0__GPIO_3_10 IOMUX_PAD(0x3d4, 0x1dc, 0x15, 0, 0, NO_PAD_CTRL) |
433 | 433 | ||
434 | #define MX25_PAD_FEC_RDATA1__FEC_RDATA1 IOMUX_PAD(0x3d8, 0x1e0, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN | NO_PAD_CTL) | 434 | #define MX25_PAD_FEC_RDATA1__FEC_RDATA1 IOMUX_PAD(0x3d8, 0x1e0, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN | NO_PAD_CTRL) |
435 | #define MX25_PAD_FEC_RDATA1__GPIO_3_11 IOMUX_PAD(0x3d8, 0x1e0, 0x15, 0, 0, NO_PAD_CTRL) | 435 | #define MX25_PAD_FEC_RDATA1__GPIO_3_11 IOMUX_PAD(0x3d8, 0x1e0, 0x15, 0, 0, NO_PAD_CTRL) |
436 | 436 | ||
437 | #define MX25_PAD_FEC_RX_DV__FEC_RX_DV IOMUX_PAD(0x3dc, 0x1e4, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN | NO_PAD_CTL) | 437 | #define MX25_PAD_FEC_RX_DV__FEC_RX_DV IOMUX_PAD(0x3dc, 0x1e4, 0x10, 0, 0, PAD_CTL_PUS_100K_DOWN | NO_PAD_CTRL) |
438 | #define MX25_PAD_FEC_RX_DV__CAN2_RX IOMUX_PAD(0x3dc, 0x1e4, 0x14, 0x484, 0, PAD_CTL_PUS_22K_UP) | 438 | #define MX25_PAD_FEC_RX_DV__CAN2_RX IOMUX_PAD(0x3dc, 0x1e4, 0x14, 0x484, 0, PAD_CTL_PUS_22K_UP) |
439 | #define MX25_PAD_FEC_RX_DV__GPIO_3_12 IOMUX_PAD(0x3dc, 0x1e4, 0x15, 0, 0, NO_PAD_CTRL) | 439 | #define MX25_PAD_FEC_RX_DV__GPIO_3_12 IOMUX_PAD(0x3dc, 0x1e4, 0x15, 0, 0, NO_PAD_CTRL) |
440 | 440 | ||
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h index 91e738144804..854e2dc58481 100644 --- a/arch/arm/plat-mxc/include/mach/mx25.h +++ b/arch/arm/plat-mxc/include/mach/mx25.h | |||
@@ -41,4 +41,8 @@ | |||
41 | #define UART1_BASE_ADDR 0x43f90000 | 41 | #define UART1_BASE_ADDR 0x43f90000 |
42 | #define UART2_BASE_ADDR 0x43f94000 | 42 | #define UART2_BASE_ADDR 0x43f94000 |
43 | 43 | ||
44 | #define MX25_FEC_BASE_ADDR 0x50038000 | ||
45 | |||
46 | #define MX25_INT_FEC 57 | ||
47 | |||
44 | #endif /* __MACH_MX25_H__ */ | 48 | #endif /* __MACH_MX25_H__ */ |
diff --git a/arch/arm/plat-nomadik/include/plat/i2c.h b/arch/arm/plat-nomadik/include/plat/i2c.h new file mode 100644 index 000000000000..1621db67a53d --- /dev/null +++ b/arch/arm/plat-nomadik/include/plat/i2c.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 ST-Ericsson | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2, as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __PLAT_I2C_H | ||
9 | #define __PLAT_I2C_H | ||
10 | |||
11 | enum i2c_freq_mode { | ||
12 | I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */ | ||
13 | I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */ | ||
14 | I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */ | ||
15 | I2C_FREQ_MODE_HIGH_SPEED /* up to 3.4 Mb/s */ | ||
16 | }; | ||
17 | |||
18 | /** | ||
19 | * struct nmk_i2c_controller - client specific controller configuration | ||
20 | * @clk_freq: clock frequency for the operation mode | ||
21 | * @slsu: Slave data setup time in ns. | ||
22 | * The needed setup time for three modes of operation | ||
23 | * are 250ns, 100ns and 10ns respectively thus leading | ||
24 | * to the values of 14, 6, 2 for a 48 MHz i2c clk | ||
25 | * @tft: Tx FIFO Threshold in bytes | ||
26 | * @rft: Rx FIFO Threshold in bytes | ||
27 | * @sm: speed mode | ||
28 | */ | ||
29 | struct nmk_i2c_controller { | ||
30 | unsigned long clk_freq; | ||
31 | unsigned short slsu; | ||
32 | unsigned char tft; | ||
33 | unsigned char rft; | ||
34 | enum i2c_freq_mode sm; | ||
35 | }; | ||
36 | |||
37 | #endif /* __PLAT_I2C_H */ | ||
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 89cafc937249..d9f8c844c385 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -36,10 +36,6 @@ static struct clk_functions *arch_clock; | |||
36 | * Standard clock functions defined in include/linux/clk.h | 36 | * Standard clock functions defined in include/linux/clk.h |
37 | *-------------------------------------------------------------------------*/ | 37 | *-------------------------------------------------------------------------*/ |
38 | 38 | ||
39 | /* This functions is moved to arch/arm/common/clkdev.c. For OMAP4 since | ||
40 | * clock framework is not up , it is defined here to avoid rework in | ||
41 | * every driver. Also dummy prcm reset function is added */ | ||
42 | |||
43 | int clk_enable(struct clk *clk) | 39 | int clk_enable(struct clk *clk) |
44 | { | 40 | { |
45 | unsigned long flags; | 41 | unsigned long flags; |
@@ -305,7 +301,6 @@ void clk_enable_init_clocks(void) | |||
305 | clk_enable(clkp); | 301 | clk_enable(clkp); |
306 | } | 302 | } |
307 | } | 303 | } |
308 | EXPORT_SYMBOL(clk_enable_init_clocks); | ||
309 | 304 | ||
310 | /* | 305 | /* |
311 | * Low level helpers | 306 | * Low level helpers |
@@ -334,7 +329,16 @@ void clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | |||
334 | arch_clock->clk_init_cpufreq_table(table); | 329 | arch_clock->clk_init_cpufreq_table(table); |
335 | spin_unlock_irqrestore(&clockfw_lock, flags); | 330 | spin_unlock_irqrestore(&clockfw_lock, flags); |
336 | } | 331 | } |
337 | EXPORT_SYMBOL(clk_init_cpufreq_table); | 332 | |
333 | void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) | ||
334 | { | ||
335 | unsigned long flags; | ||
336 | |||
337 | spin_lock_irqsave(&clockfw_lock, flags); | ||
338 | if (arch_clock->clk_exit_cpufreq_table) | ||
339 | arch_clock->clk_exit_cpufreq_table(table); | ||
340 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
341 | } | ||
338 | #endif | 342 | #endif |
339 | 343 | ||
340 | /*-------------------------------------------------------------------------*/ | 344 | /*-------------------------------------------------------------------------*/ |
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c index f8ddbdd8b076..6d3d33360056 100644 --- a/arch/arm/plat-omap/cpu-omap.c +++ b/arch/arm/plat-omap/cpu-omap.c | |||
@@ -134,6 +134,7 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy) | |||
134 | 134 | ||
135 | static int omap_cpu_exit(struct cpufreq_policy *policy) | 135 | static int omap_cpu_exit(struct cpufreq_policy *policy) |
136 | { | 136 | { |
137 | clk_exit_cpufreq_table(&freq_table); | ||
137 | clk_put(mpu_clk); | 138 | clk_put(mpu_clk); |
138 | return 0; | 139 | return 0; |
139 | } | 140 | } |
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 04846811d0aa..d17620c50c28 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -192,6 +192,7 @@ struct gpio_bank { | |||
192 | u32 saved_risingdetect; | 192 | u32 saved_risingdetect; |
193 | #endif | 193 | #endif |
194 | u32 level_mask; | 194 | u32 level_mask; |
195 | u32 toggle_mask; | ||
195 | spinlock_t lock; | 196 | spinlock_t lock; |
196 | struct gpio_chip chip; | 197 | struct gpio_chip chip; |
197 | struct clk *dbck; | 198 | struct clk *dbck; |
@@ -749,6 +750,44 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, | |||
749 | } | 750 | } |
750 | #endif | 751 | #endif |
751 | 752 | ||
753 | /* | ||
754 | * This only applies to chips that can't do both rising and falling edge | ||
755 | * detection at once. For all other chips, this function is a noop. | ||
756 | */ | ||
757 | static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio) | ||
758 | { | ||
759 | void __iomem *reg = bank->base; | ||
760 | u32 l = 0; | ||
761 | |||
762 | switch (bank->method) { | ||
763 | #ifdef CONFIG_ARCH_OMAP1 | ||
764 | case METHOD_MPUIO: | ||
765 | reg += OMAP_MPUIO_GPIO_INT_EDGE; | ||
766 | break; | ||
767 | #endif | ||
768 | #ifdef CONFIG_ARCH_OMAP15XX | ||
769 | case METHOD_GPIO_1510: | ||
770 | reg += OMAP1510_GPIO_INT_CONTROL; | ||
771 | break; | ||
772 | #endif | ||
773 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) | ||
774 | case METHOD_GPIO_7XX: | ||
775 | reg += OMAP7XX_GPIO_INT_CONTROL; | ||
776 | break; | ||
777 | #endif | ||
778 | default: | ||
779 | return; | ||
780 | } | ||
781 | |||
782 | l = __raw_readl(reg); | ||
783 | if ((l >> gpio) & 1) | ||
784 | l &= ~(1 << gpio); | ||
785 | else | ||
786 | l |= 1 << gpio; | ||
787 | |||
788 | __raw_writel(l, reg); | ||
789 | } | ||
790 | |||
752 | static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) | 791 | static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) |
753 | { | 792 | { |
754 | void __iomem *reg = bank->base; | 793 | void __iomem *reg = bank->base; |
@@ -759,6 +798,8 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) | |||
759 | case METHOD_MPUIO: | 798 | case METHOD_MPUIO: |
760 | reg += OMAP_MPUIO_GPIO_INT_EDGE; | 799 | reg += OMAP_MPUIO_GPIO_INT_EDGE; |
761 | l = __raw_readl(reg); | 800 | l = __raw_readl(reg); |
801 | if (trigger & IRQ_TYPE_EDGE_BOTH) | ||
802 | bank->toggle_mask |= 1 << gpio; | ||
762 | if (trigger & IRQ_TYPE_EDGE_RISING) | 803 | if (trigger & IRQ_TYPE_EDGE_RISING) |
763 | l |= 1 << gpio; | 804 | l |= 1 << gpio; |
764 | else if (trigger & IRQ_TYPE_EDGE_FALLING) | 805 | else if (trigger & IRQ_TYPE_EDGE_FALLING) |
@@ -771,6 +812,8 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) | |||
771 | case METHOD_GPIO_1510: | 812 | case METHOD_GPIO_1510: |
772 | reg += OMAP1510_GPIO_INT_CONTROL; | 813 | reg += OMAP1510_GPIO_INT_CONTROL; |
773 | l = __raw_readl(reg); | 814 | l = __raw_readl(reg); |
815 | if (trigger & IRQ_TYPE_EDGE_BOTH) | ||
816 | bank->toggle_mask |= 1 << gpio; | ||
774 | if (trigger & IRQ_TYPE_EDGE_RISING) | 817 | if (trigger & IRQ_TYPE_EDGE_RISING) |
775 | l |= 1 << gpio; | 818 | l |= 1 << gpio; |
776 | else if (trigger & IRQ_TYPE_EDGE_FALLING) | 819 | else if (trigger & IRQ_TYPE_EDGE_FALLING) |
@@ -803,6 +846,8 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) | |||
803 | case METHOD_GPIO_7XX: | 846 | case METHOD_GPIO_7XX: |
804 | reg += OMAP7XX_GPIO_INT_CONTROL; | 847 | reg += OMAP7XX_GPIO_INT_CONTROL; |
805 | l = __raw_readl(reg); | 848 | l = __raw_readl(reg); |
849 | if (trigger & IRQ_TYPE_EDGE_BOTH) | ||
850 | bank->toggle_mask |= 1 << gpio; | ||
806 | if (trigger & IRQ_TYPE_EDGE_RISING) | 851 | if (trigger & IRQ_TYPE_EDGE_RISING) |
807 | l |= 1 << gpio; | 852 | l |= 1 << gpio; |
808 | else if (trigger & IRQ_TYPE_EDGE_FALLING) | 853 | else if (trigger & IRQ_TYPE_EDGE_FALLING) |
@@ -1072,7 +1117,7 @@ static inline void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int ena | |||
1072 | */ | 1117 | */ |
1073 | static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) | 1118 | static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) |
1074 | { | 1119 | { |
1075 | unsigned long flags; | 1120 | unsigned long uninitialized_var(flags); |
1076 | 1121 | ||
1077 | switch (bank->method) { | 1122 | switch (bank->method) { |
1078 | #ifdef CONFIG_ARCH_OMAP16XX | 1123 | #ifdef CONFIG_ARCH_OMAP16XX |
@@ -1217,7 +1262,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
1217 | { | 1262 | { |
1218 | void __iomem *isr_reg = NULL; | 1263 | void __iomem *isr_reg = NULL; |
1219 | u32 isr; | 1264 | u32 isr; |
1220 | unsigned int gpio_irq; | 1265 | unsigned int gpio_irq, gpio_index; |
1221 | struct gpio_bank *bank; | 1266 | struct gpio_bank *bank; |
1222 | u32 retrigger = 0; | 1267 | u32 retrigger = 0; |
1223 | int unmasked = 0; | 1268 | int unmasked = 0; |
@@ -1284,9 +1329,23 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
1284 | 1329 | ||
1285 | gpio_irq = bank->virtual_irq_start; | 1330 | gpio_irq = bank->virtual_irq_start; |
1286 | for (; isr != 0; isr >>= 1, gpio_irq++) { | 1331 | for (; isr != 0; isr >>= 1, gpio_irq++) { |
1332 | gpio_index = get_gpio_index(irq_to_gpio(gpio_irq)); | ||
1333 | |||
1287 | if (!(isr & 1)) | 1334 | if (!(isr & 1)) |
1288 | continue; | 1335 | continue; |
1289 | 1336 | ||
1337 | #ifdef CONFIG_ARCH_OMAP1 | ||
1338 | /* | ||
1339 | * Some chips can't respond to both rising and falling | ||
1340 | * at the same time. If this irq was requested with | ||
1341 | * both flags, we need to flip the ICR data for the IRQ | ||
1342 | * to respond to the IRQ for the opposite direction. | ||
1343 | * This will be indicated in the bank toggle_mask. | ||
1344 | */ | ||
1345 | if (bank->toggle_mask & (1 << gpio_index)) | ||
1346 | _toggle_gpio_edge_triggering(bank, gpio_index); | ||
1347 | #endif | ||
1348 | |||
1290 | generic_handle_irq(gpio_irq); | 1349 | generic_handle_irq(gpio_irq); |
1291 | } | 1350 | } |
1292 | } | 1351 | } |
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h index 376ce18216ff..5cd622039da0 100644 --- a/arch/arm/plat-omap/include/plat/board.h +++ b/arch/arm/plat-omap/include/plat/board.h | |||
@@ -99,7 +99,6 @@ struct fb_info; | |||
99 | struct omap_backlight_config { | 99 | struct omap_backlight_config { |
100 | int default_intensity; | 100 | int default_intensity; |
101 | int (*set_power)(struct device *dev, int state); | 101 | int (*set_power)(struct device *dev, int state); |
102 | int (*check_fb)(struct fb_info *fb); | ||
103 | }; | 102 | }; |
104 | 103 | ||
105 | struct omap_fbmem_config { | 104 | struct omap_fbmem_config { |
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h index 309b6d1dccdb..94fe2a0ce40a 100644 --- a/arch/arm/plat-omap/include/plat/clock.h +++ b/arch/arm/plat-omap/include/plat/clock.h | |||
@@ -119,6 +119,7 @@ struct clk_functions { | |||
119 | void (*clk_disable_unused)(struct clk *clk); | 119 | void (*clk_disable_unused)(struct clk *clk); |
120 | #ifdef CONFIG_CPU_FREQ | 120 | #ifdef CONFIG_CPU_FREQ |
121 | void (*clk_init_cpufreq_table)(struct cpufreq_frequency_table **); | 121 | void (*clk_init_cpufreq_table)(struct cpufreq_frequency_table **); |
122 | void (*clk_exit_cpufreq_table)(struct cpufreq_frequency_table **); | ||
122 | #endif | 123 | #endif |
123 | }; | 124 | }; |
124 | 125 | ||
@@ -135,6 +136,7 @@ extern unsigned long followparent_recalc(struct clk *clk); | |||
135 | extern void clk_enable_init_clocks(void); | 136 | extern void clk_enable_init_clocks(void); |
136 | #ifdef CONFIG_CPU_FREQ | 137 | #ifdef CONFIG_CPU_FREQ |
137 | extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | 138 | extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); |
139 | extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); | ||
138 | #endif | 140 | #endif |
139 | 141 | ||
140 | extern const struct clkops clkops_null; | 142 | extern const struct clkops clkops_null; |
diff --git a/arch/arm/plat-omap/include/plat/control.h b/arch/arm/plat-omap/include/plat/control.h index 2ae884378638..a745d62fad0d 100644 --- a/arch/arm/plat-omap/include/plat/control.h +++ b/arch/arm/plat-omap/include/plat/control.h | |||
@@ -147,7 +147,7 @@ | |||
147 | #define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) | 147 | #define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) |
148 | #define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) | 148 | #define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) |
149 | #define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \ | 149 | #define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \ |
150 | + ((i) >> 1) * 4 + (!(i) & 1) * 2) | 150 | + ((i) >> 1) * 4 + (!((i) & 1)) * 2) |
151 | #define OMAP343X_CONTROL_PROG_IO0 (OMAP2_CONTROL_GENERAL + 0x01D4) | 151 | #define OMAP343X_CONTROL_PROG_IO0 (OMAP2_CONTROL_GENERAL + 0x01D4) |
152 | #define OMAP343X_CONTROL_PROG_IO1 (OMAP2_CONTROL_GENERAL + 0x01D8) | 152 | #define OMAP343X_CONTROL_PROG_IO1 (OMAP2_CONTROL_GENERAL + 0x01D8) |
153 | #define OMAP343X_CONTROL_DSS_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E0) | 153 | #define OMAP343X_CONTROL_DSS_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E0) |
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h index 7e5319f907d1..a3e7b471bcba 100644 --- a/arch/arm/plat-omap/include/plat/io.h +++ b/arch/arm/plat-omap/include/plat/io.h | |||
@@ -122,16 +122,21 @@ | |||
122 | #define OMAP243X_SMS_VIRT (OMAP243X_SMS_PHYS + OMAP2_L3_IO_OFFSET) | 122 | #define OMAP243X_SMS_VIRT (OMAP243X_SMS_PHYS + OMAP2_L3_IO_OFFSET) |
123 | #define OMAP243X_SMS_SIZE SZ_1M | 123 | #define OMAP243X_SMS_SIZE SZ_1M |
124 | 124 | ||
125 | /* DSP */ | 125 | /* 2420 IVA */ |
126 | #define DSP_MEM_24XX_PHYS OMAP2420_DSP_MEM_BASE /* 0x58000000 */ | 126 | #define DSP_MEM_2420_PHYS OMAP2420_DSP_MEM_BASE |
127 | #define DSP_MEM_24XX_VIRT 0xe0000000 | 127 | /* 0x58000000 --> 0xfc100000 */ |
128 | #define DSP_MEM_24XX_SIZE 0x28000 | 128 | #define DSP_MEM_2420_VIRT 0xfc100000 |
129 | #define DSP_IPI_24XX_PHYS OMAP2420_DSP_IPI_BASE /* 0x59000000 */ | 129 | #define DSP_MEM_2420_SIZE 0x28000 |
130 | #define DSP_IPI_24XX_VIRT 0xe1000000 | 130 | #define DSP_IPI_2420_PHYS OMAP2420_DSP_IPI_BASE |
131 | #define DSP_IPI_24XX_SIZE SZ_4K | 131 | /* 0x59000000 --> 0xfc128000 */ |
132 | #define DSP_MMU_24XX_PHYS OMAP2420_DSP_MMU_BASE /* 0x5a000000 */ | 132 | #define DSP_IPI_2420_VIRT 0xfc128000 |
133 | #define DSP_MMU_24XX_VIRT 0xe2000000 | 133 | #define DSP_IPI_2420_SIZE SZ_4K |
134 | #define DSP_MMU_24XX_SIZE SZ_4K | 134 | #define DSP_MMU_2420_PHYS OMAP2420_DSP_MMU_BASE |
135 | /* 0x5a000000 --> 0xfc129000 */ | ||
136 | #define DSP_MMU_2420_VIRT 0xfc129000 | ||
137 | #define DSP_MMU_2420_SIZE SZ_4K | ||
138 | |||
139 | /* 2430 IVA2.1 - currently unmapped */ | ||
135 | 140 | ||
136 | /* | 141 | /* |
137 | * ---------------------------------------------------------------------------- | 142 | * ---------------------------------------------------------------------------- |
@@ -182,16 +187,7 @@ | |||
182 | #define OMAP343X_SDRC_VIRT (OMAP343X_SDRC_PHYS + OMAP2_L3_IO_OFFSET) | 187 | #define OMAP343X_SDRC_VIRT (OMAP343X_SDRC_PHYS + OMAP2_L3_IO_OFFSET) |
183 | #define OMAP343X_SDRC_SIZE SZ_1M | 188 | #define OMAP343X_SDRC_SIZE SZ_1M |
184 | 189 | ||
185 | /* DSP */ | 190 | /* 3430 IVA - currently unmapped */ |
186 | #define DSP_MEM_34XX_PHYS OMAP34XX_DSP_MEM_BASE /* 0x58000000 */ | ||
187 | #define DSP_MEM_34XX_VIRT 0xe0000000 | ||
188 | #define DSP_MEM_34XX_SIZE 0x28000 | ||
189 | #define DSP_IPI_34XX_PHYS OMAP34XX_DSP_IPI_BASE /* 0x59000000 */ | ||
190 | #define DSP_IPI_34XX_VIRT 0xe1000000 | ||
191 | #define DSP_IPI_34XX_SIZE SZ_4K | ||
192 | #define DSP_MMU_34XX_PHYS OMAP34XX_DSP_MMU_BASE /* 0x5a000000 */ | ||
193 | #define DSP_MMU_34XX_VIRT 0xe2000000 | ||
194 | #define DSP_MMU_34XX_SIZE SZ_4K | ||
195 | 191 | ||
196 | /* | 192 | /* |
197 | * ---------------------------------------------------------------------------- | 193 | * ---------------------------------------------------------------------------- |
diff --git a/arch/arm/plat-omap/include/plat/mux.h b/arch/arm/plat-omap/include/plat/mux.h index 8f069cc80350..692c90e89ac3 100644 --- a/arch/arm/plat-omap/include/plat/mux.h +++ b/arch/arm/plat-omap/include/plat/mux.h | |||
@@ -183,6 +183,14 @@ enum omap7xx_index { | |||
183 | /* I2C */ | 183 | /* I2C */ |
184 | I2C_7XX_SCL, | 184 | I2C_7XX_SCL, |
185 | I2C_7XX_SDA, | 185 | I2C_7XX_SDA, |
186 | |||
187 | /* SPI */ | ||
188 | SPI_7XX_1, | ||
189 | SPI_7XX_2, | ||
190 | SPI_7XX_3, | ||
191 | SPI_7XX_4, | ||
192 | SPI_7XX_5, | ||
193 | SPI_7XX_6, | ||
186 | }; | 194 | }; |
187 | 195 | ||
188 | enum omap1xxx_index { | 196 | enum omap1xxx_index { |
diff --git a/arch/arm/plat-omap/include/plat/omap7xx.h b/arch/arm/plat-omap/include/plat/omap7xx.h index 53f52414b0e9..48e4757e1e30 100644 --- a/arch/arm/plat-omap/include/plat/omap7xx.h +++ b/arch/arm/plat-omap/include/plat/omap7xx.h | |||
@@ -46,6 +46,9 @@ | |||
46 | #define OMAP7XX_DSPREG_SIZE SZ_128K | 46 | #define OMAP7XX_DSPREG_SIZE SZ_128K |
47 | #define OMAP7XX_DSPREG_START 0xE1000000 | 47 | #define OMAP7XX_DSPREG_START 0xE1000000 |
48 | 48 | ||
49 | #define OMAP7XX_SPI1_BASE 0xfffc0800 | ||
50 | #define OMAP7XX_SPI2_BASE 0xfffc1000 | ||
51 | |||
49 | /* | 52 | /* |
50 | * ---------------------------------------------------------------------------- | 53 | * ---------------------------------------------------------------------------- |
51 | * OMAP7XX specific configuration registers | 54 | * OMAP7XX specific configuration registers |
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c index 11f5d7961c73..0cfd54f519c4 100644 --- a/arch/arm/plat-omap/io.c +++ b/arch/arm/plat-omap/io.c | |||
@@ -66,12 +66,12 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type) | |||
66 | return XLATE(p, L4_24XX_PHYS, L4_24XX_VIRT); | 66 | return XLATE(p, L4_24XX_PHYS, L4_24XX_VIRT); |
67 | } | 67 | } |
68 | if (cpu_is_omap2420()) { | 68 | if (cpu_is_omap2420()) { |
69 | if (BETWEEN(p, DSP_MEM_24XX_PHYS, DSP_MEM_24XX_SIZE)) | 69 | if (BETWEEN(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_SIZE)) |
70 | return XLATE(p, DSP_MEM_24XX_PHYS, DSP_MEM_24XX_VIRT); | 70 | return XLATE(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_VIRT); |
71 | if (BETWEEN(p, DSP_IPI_24XX_PHYS, DSP_IPI_24XX_SIZE)) | 71 | if (BETWEEN(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE)) |
72 | return XLATE(p, DSP_IPI_24XX_PHYS, DSP_IPI_24XX_SIZE); | 72 | return XLATE(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE); |
73 | if (BETWEEN(p, DSP_MMU_24XX_PHYS, DSP_MMU_24XX_SIZE)) | 73 | if (BETWEEN(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_SIZE)) |
74 | return XLATE(p, DSP_MMU_24XX_PHYS, DSP_MMU_24XX_VIRT); | 74 | return XLATE(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_VIRT); |
75 | } | 75 | } |
76 | if (cpu_is_omap2430()) { | 76 | if (cpu_is_omap2430()) { |
77 | if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE)) | 77 | if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE)) |
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index c0ff1e39d893..463d6386aff2 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c | |||
@@ -827,7 +827,7 @@ EXPORT_SYMBOL_GPL(iommu_get); | |||
827 | **/ | 827 | **/ |
828 | void iommu_put(struct iommu *obj) | 828 | void iommu_put(struct iommu *obj) |
829 | { | 829 | { |
830 | if (!obj && IS_ERR(obj)) | 830 | if (!obj || IS_ERR(obj)) |
831 | return; | 831 | return; |
832 | 832 | ||
833 | mutex_lock(&obj->iommu_lock); | 833 | mutex_lock(&obj->iommu_lock); |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index 2cc1cc328bac..f75767278fc3 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -436,7 +436,7 @@ int omap_mcbsp_request(unsigned int id) | |||
436 | dev_err(mcbsp->dev, "Unable to request TX IRQ %d " | 436 | dev_err(mcbsp->dev, "Unable to request TX IRQ %d " |
437 | "for McBSP%d\n", mcbsp->tx_irq, | 437 | "for McBSP%d\n", mcbsp->tx_irq, |
438 | mcbsp->id); | 438 | mcbsp->id); |
439 | return err; | 439 | goto error; |
440 | } | 440 | } |
441 | 441 | ||
442 | init_completion(&mcbsp->rx_irq_completion); | 442 | init_completion(&mcbsp->rx_irq_completion); |
@@ -446,12 +446,26 @@ int omap_mcbsp_request(unsigned int id) | |||
446 | dev_err(mcbsp->dev, "Unable to request RX IRQ %d " | 446 | dev_err(mcbsp->dev, "Unable to request RX IRQ %d " |
447 | "for McBSP%d\n", mcbsp->rx_irq, | 447 | "for McBSP%d\n", mcbsp->rx_irq, |
448 | mcbsp->id); | 448 | mcbsp->id); |
449 | free_irq(mcbsp->tx_irq, (void *)mcbsp); | 449 | goto tx_irq; |
450 | return err; | ||
451 | } | 450 | } |
452 | } | 451 | } |
453 | 452 | ||
454 | return 0; | 453 | return 0; |
454 | tx_irq: | ||
455 | free_irq(mcbsp->tx_irq, (void *)mcbsp); | ||
456 | error: | ||
457 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) | ||
458 | mcbsp->pdata->ops->free(id); | ||
459 | |||
460 | /* Do procedure specific to omap34xx arch, if applicable */ | ||
461 | omap34xx_mcbsp_free(mcbsp); | ||
462 | |||
463 | clk_disable(mcbsp->fclk); | ||
464 | clk_disable(mcbsp->iclk); | ||
465 | |||
466 | mcbsp->free = 1; | ||
467 | |||
468 | return err; | ||
455 | } | 469 | } |
456 | EXPORT_SYMBOL(omap_mcbsp_request); | 470 | EXPORT_SYMBOL(omap_mcbsp_request); |
457 | 471 | ||
diff --git a/arch/arm/plat-pxa/pwm.c b/arch/arm/plat-pxa/pwm.c index a9eabdcfa163..51dc5c8106c0 100644 --- a/arch/arm/plat-pxa/pwm.c +++ b/arch/arm/plat-pxa/pwm.c | |||
@@ -204,14 +204,14 @@ static int __devinit pwm_probe(struct platform_device *pdev) | |||
204 | goto err_free_clk; | 204 | goto err_free_clk; |
205 | } | 205 | } |
206 | 206 | ||
207 | r = request_mem_region(r->start, r->end - r->start + 1, pdev->name); | 207 | r = request_mem_region(r->start, resource_size(r), pdev->name); |
208 | if (r == NULL) { | 208 | if (r == NULL) { |
209 | dev_err(&pdev->dev, "failed to request memory resource\n"); | 209 | dev_err(&pdev->dev, "failed to request memory resource\n"); |
210 | ret = -EBUSY; | 210 | ret = -EBUSY; |
211 | goto err_free_clk; | 211 | goto err_free_clk; |
212 | } | 212 | } |
213 | 213 | ||
214 | pwm->mmio_base = ioremap(r->start, r->end - r->start + 1); | 214 | pwm->mmio_base = ioremap(r->start, resource_size(r)); |
215 | if (pwm->mmio_base == NULL) { | 215 | if (pwm->mmio_base == NULL) { |
216 | dev_err(&pdev->dev, "failed to ioremap() registers\n"); | 216 | dev_err(&pdev->dev, "failed to ioremap() registers\n"); |
217 | ret = -ENODEV; | 217 | ret = -ENODEV; |
@@ -241,7 +241,7 @@ static int __devinit pwm_probe(struct platform_device *pdev) | |||
241 | return 0; | 241 | return 0; |
242 | 242 | ||
243 | err_free_mem: | 243 | err_free_mem: |
244 | release_mem_region(r->start, r->end - r->start + 1); | 244 | release_mem_region(r->start, resource_size(r)); |
245 | err_free_clk: | 245 | err_free_clk: |
246 | clk_put(pwm->clk); | 246 | clk_put(pwm->clk); |
247 | err_free: | 247 | err_free: |
@@ -271,7 +271,7 @@ static int __devexit pwm_remove(struct platform_device *pdev) | |||
271 | iounmap(pwm->mmio_base); | 271 | iounmap(pwm->mmio_base); |
272 | 272 | ||
273 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 273 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
274 | release_mem_region(r->start, r->end - r->start + 1); | 274 | release_mem_region(r->start, resource_size(r)); |
275 | 275 | ||
276 | clk_put(pwm->clk); | 276 | clk_put(pwm->clk); |
277 | kfree(pwm); | 277 | kfree(pwm); |
diff --git a/arch/arm/plat-s3c/dev-nand.c b/arch/arm/plat-s3c/dev-nand.c index 84808ccda70e..a52fb6cf618f 100644 --- a/arch/arm/plat-s3c/dev-nand.c +++ b/arch/arm/plat-s3c/dev-nand.c | |||
@@ -58,8 +58,8 @@ static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set) | |||
58 | return -ENOMEM; | 58 | return -ENOMEM; |
59 | } | 59 | } |
60 | 60 | ||
61 | size = sizeof(int) * set->nr_chips; | 61 | if (set->nr_map && set->nr_chips) { |
62 | if (size) { | 62 | size = sizeof(int) * set->nr_chips; |
63 | ptr = kmemdup(set->nr_map, size, GFP_KERNEL); | 63 | ptr = kmemdup(set->nr_map, size, GFP_KERNEL); |
64 | set->nr_map = ptr; | 64 | set->nr_map = ptr; |
65 | 65 | ||
diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c index 6ffa21eb1b91..ffd56deb9e81 100644 --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c | |||
@@ -46,6 +46,7 @@ static struct clk clk_ext_xtal_mux = { | |||
46 | #define clk_fin_epll clk_ext_xtal_mux | 46 | #define clk_fin_epll clk_ext_xtal_mux |
47 | 47 | ||
48 | #define clk_fout_mpll clk_mpll | 48 | #define clk_fout_mpll clk_mpll |
49 | #define clk_fout_epll clk_epll | ||
49 | 50 | ||
50 | struct clk_sources { | 51 | struct clk_sources { |
51 | unsigned int nr_sources; | 52 | unsigned int nr_sources; |
@@ -88,11 +89,6 @@ static struct clksrc_clk clk_mout_apll = { | |||
88 | .sources = &clk_src_apll, | 89 | .sources = &clk_src_apll, |
89 | }; | 90 | }; |
90 | 91 | ||
91 | static struct clk clk_fout_epll = { | ||
92 | .name = "fout_epll", | ||
93 | .id = -1, | ||
94 | }; | ||
95 | |||
96 | static struct clk *clk_src_epll_list[] = { | 92 | static struct clk *clk_src_epll_list[] = { |
97 | [0] = &clk_fin_epll, | 93 | [0] = &clk_fin_epll, |
98 | [1] = &clk_fout_epll, | 94 | [1] = &clk_fout_epll, |
@@ -715,7 +711,6 @@ static struct clk *clks[] __initdata = { | |||
715 | &clk_iis_cd1, | 711 | &clk_iis_cd1, |
716 | &clk_pcm_cd, | 712 | &clk_pcm_cd, |
717 | &clk_mout_epll.clk, | 713 | &clk_mout_epll.clk, |
718 | &clk_fout_epll, | ||
719 | &clk_mout_mpll.clk, | 714 | &clk_mout_mpll.clk, |
720 | &clk_dout_mpll, | 715 | &clk_dout_mpll, |
721 | &clk_mmc0.clk, | 716 | &clk_mmc0.clk, |
@@ -760,7 +755,4 @@ void __init s3c6400_register_clocks(unsigned armclk_divlimit) | |||
760 | clkp->name, ret); | 755 | clkp->name, ret); |
761 | } | 756 | } |
762 | } | 757 | } |
763 | |||
764 | clk_mpll.parent = &clk_mout_mpll.clk; | ||
765 | clk_epll.parent = &clk_mout_epll.clk; | ||
766 | } | 758 | } |