2 +++ b/arch/m68k/coldfire/cache.c
5 + * linux/arch/m68k/coldfire/cache.c
7 + * Matt Waddel Matt.Waddel@freescale.com
8 + * Kurt Mahan kmahan@freescale.com
9 + * Copyright Freescale Semiconductor, Inc. 2007
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.
17 +#include <linux/interrupt.h>
18 +#include <asm/cfcache.h>
19 +#include <asm/coldfire.h>
20 +#include <asm/system.h>
22 +/* Cache Control Reg shadow reg */
23 +unsigned long shadow_cacr;
26 + * cacr_set - Set the Cache Control Register
29 +void cacr_set(unsigned long x)
33 + __asm__ __volatile__ ("movec %0, %%cacr"
35 + : "r" (shadow_cacr));
39 + * cacr_get - Get the current value of the Cache Control Register
41 + * @return CACR value
43 +unsigned long cacr_get(void)
48 +++ b/arch/m68k/coldfire/config.c
51 + * linux/arch/m68k/coldfire/config.c
53 + * Kurt Mahan kmahan@freescale.com
54 + * Matt Waddel Matt.Waddel@freescale.com
55 + * Copyright Freescale Semiconductor, Inc. 2007, 2008
57 + * This program is free software; you can redistribute it and/or modify
58 + * it under the terms of the GNU General Public License as published by
59 + * the Free Software Foundation; either version 2 of the License, or
60 + * (at your option) any later version.
63 +#include <linux/module.h>
64 +#include <linux/init.h>
65 +#include <linux/string.h>
66 +#include <linux/kernel.h>
67 +#include <linux/console.h>
68 +#include <linux/bootmem.h>
69 +#include <linux/mm.h>
70 +#include <asm/bootinfo.h>
71 +#include <asm/machdep.h>
72 +#include <asm/coldfire.h>
73 +#include <asm/cfcache.h>
74 +#include <asm/cacheflush.h>
76 +#include <asm/cfmmu.h>
77 +#include <asm/setup.h>
79 +#include <asm/traps.h>
80 +#include <asm/movs.h>
81 +#include <asm/movs.h>
82 +#include <asm/page.h>
83 +#include <asm/pgalloc.h>
85 +#include <asm/mcfsim.h>
87 +#if defined(CONFIG_M5445X)
88 +#define UBOOT_EXTRA_CLOCKS
89 +#elif defined(CONFIG_M547X_8X)
92 +#include <asm/bootinfo.h>
95 +#include <asm/mcf5445x_intc.h>
96 +#include <asm/mcf5445x_sdramc.h>
97 +#include <asm/mcf5445x_fbcs.h>
98 +#include <asm/mcf5445x_dtim.h>
99 +#include <asm/mcf5445x_xbs.h>
102 +#ifdef CONFIG_M547X_8X
103 +#include <asm/m5485gpt.h>
106 +extern int get_irq_list(struct seq_file *p, void *v);
107 +extern char _text, _end;
108 +extern char _etext, _edata, __init_begin, __init_end;
109 +extern struct console mcfrs_console;
110 +extern char m68k_command_line[CL_SIZE];
111 +extern unsigned long availmem;
113 +static int irq_enable[NR_IRQS];
114 +unsigned long num_pages;
116 +/* ethernet mac addresses from uboot */
117 +unsigned char uboot_enet0[6];
118 +unsigned char uboot_enet1[6];
120 +void coldfire_sort_memrec(void)
124 + /* Sort the m68k_memory records by address */
125 + for (i = 0; i < m68k_num_memory; ++i) {
126 + for (j = i + 1; j < m68k_num_memory; ++j) {
127 + if (m68k_memory[i].addr > m68k_memory[j].addr) {
128 + struct mem_info tmp;
129 + tmp = m68k_memory[i];
130 + m68k_memory[i] = m68k_memory[j];
131 + m68k_memory[j] = tmp;
135 + /* Trim off discontiguous bits */
136 + for (i = 1; i < m68k_num_memory; ++i) {
137 + if ((m68k_memory[i-1].addr + m68k_memory[i-1].size) !=
138 + m68k_memory[i].addr) {
139 + printk(KERN_DEBUG "m68k_parse_bootinfo: addr gap between \
141 + m68k_memory[i-1].addr+m68k_memory[i-1].size,
142 + m68k_memory[i].addr);
143 + m68k_num_memory = i;
152 +int __init uboot_commandline(char *bootargs)
154 + int len = 0, cmd_line_len;
155 + static struct uboot_record uboot_info;
156 + u32 offset = PAGE_OFFSET_RAW - PHYS_OFFSET;
158 + extern unsigned long uboot_info_stk;
160 + /* validate address */
161 + if ((uboot_info_stk < PAGE_OFFSET_RAW) ||
162 + (uboot_info_stk >= (PAGE_OFFSET_RAW + CONFIG_SDRAM_SIZE)))
165 + /* Add offset to get post-remapped kernel memory location */
166 + uboot_info.bdi = (struct bd_info *)((*(u32 *)(uboot_info_stk)) + offset);
167 + uboot_info.initrd_start = (*(u32 *)(uboot_info_stk+4)) + offset;
168 + uboot_info.initrd_end = (*(u32 *)(uboot_info_stk+8)) + offset;
169 + uboot_info.cmd_line_start = (*(u32 *)(uboot_info_stk+12)) + offset;
170 + uboot_info.cmd_line_stop = (*(u32 *)(uboot_info_stk+16)) + offset;
172 + /* copy over mac addresses */
173 + memcpy(uboot_enet0, uboot_info.bdi->bi_enet0addr, 6);
174 + memcpy(uboot_enet1, uboot_info.bdi->bi_enet1addr, 6);
176 + /* copy command line */
177 + cmd_line_len = uboot_info.cmd_line_stop - uboot_info.cmd_line_start;
178 + if ((cmd_line_len > 0) && (cmd_line_len < CL_SIZE-1))
179 + len = (int)strncpy(bootargs, (char *)uboot_info.cmd_line_start,\
186 + * This routine does things not done in the bootloader.
188 +#if defined(CONFIG_M54451)
189 +#define DEFAULT_COMMAND_LINE "debug root=/dev/nfs rw nfsroot=172.27.155.1:/tftpboot/redstripe/rootfs/ ip=172.27.155.51:172.27.155.1"
190 +#elif defined(CONFIG_M54455)
191 +#define MTD_DEFAULT_COMMAND_LINE "root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:5M(kernel)ro,-(jffs2)"
192 +#define DEFAULT_COMMAND_LINE "debug root=/dev/nfs rw nfsroot=172.27.155.1:/tftpboot/redstripe/rootfs/ ip=172.27.155.55:172.27.155.1"
193 +#elif defined(CONFIG_M547X_8X)
194 +#define DEFAULT_COMMAND_LINE "debug root=/dev/nfs rw nfsroot=172.27.155.1:/tftpboot/rigo/rootfs/ ip=172.27.155.75:172.27.155.1"
196 +asmlinkage void __init cf_early_init(void)
198 + struct bi_record *record = (struct bi_record *) &_end;
202 +#if defined(CONFIG_M5445X)
203 + SET_VBR((void *)MCF_RAMBAR1);
204 +#elif defined(CONFIG_M547X_8X)
205 + SET_VBR((void *)MCF_RAMBAR0);
208 + /* Mask all interrupts */
209 +#if defined(CONFIG_M5445X)
210 + MCF_INTC0_IMRL = 0xFFFFFFFF;
211 + MCF_INTC0_IMRH = 0xFFFFFFFF;
212 + MCF_INTC1_IMRL = 0xFFFFFFFF;
213 + MCF_INTC1_IMRH = 0xFFFFFFFF;
214 +#elif defined(CONFIG_M547X_8X)
215 + MCF_IMRL = 0xFFFFFFFF;
216 + MCF_IMRH = 0xFFFFFFFF;
219 +#if defined(CONFIG_M5445X)
220 +#if defined(CONFIG_NOR_FLASH_BASE)
221 + MCF_FBCS_CSAR(1) = CONFIG_NOR_FLASH_BASE;
223 + MCF_FBCS_CSAR(1) = 0x00000000;
226 +#if CONFIG_SDRAM_SIZE > (256*1024*1024)
227 + /* Init optional SDRAM chip select */
228 + MCF_SDRAMC_SDCS(1) = (256*1024*1024) | 0x1B;
230 +#endif /* CONFIG_M5445X */
232 +#if defined(CONFIG_M5445X)
233 + /* Setup SDRAM crossbar(XBS) priorities */
234 + MCF_XBS_PRS2 = (MCF_XBS_PRS_M0(MCF_XBS_PRI_2) |
235 + MCF_XBS_PRS_M1(MCF_XBS_PRI_3) |
236 + MCF_XBS_PRS_M2(MCF_XBS_PRI_4) |
237 + MCF_XBS_PRS_M3(MCF_XBS_PRI_5) |
238 + MCF_XBS_PRS_M5(MCF_XBS_PRI_6) |
239 + MCF_XBS_PRS_M6(MCF_XBS_PRI_1) |
240 + MCF_XBS_PRS_M7(MCF_XBS_PRI_7));
243 + m68k_machtype = MACH_CFMMU;
244 + m68k_fputype = FPU_CFV4E;
245 + m68k_mmutype = MMU_CFV4E;
246 + m68k_cputype = CPU_CFV4E;
248 + m68k_num_memory = 0;
249 + m68k_memory[m68k_num_memory].addr = CONFIG_SDRAM_BASE;
250 + m68k_memory[m68k_num_memory++].size = CONFIG_SDRAM_SIZE;
252 + if (!uboot_commandline(m68k_command_line)) {
253 +#if defined(CONFIG_BOOTPARAM)
254 + strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE-1);
256 + strcpy(m68k_command_line, DEFAULT_COMMAND_LINE);
260 +#if defined(CONFIG_BLK_DEV_INITRD)
261 + /* add initrd image */
262 + record = (struct bi_record *) ((void *)record + record->size);
263 + record->tag = BI_RAMDISK;
264 + record->size = sizeof(record->tag) + sizeof(record->size)
265 + + sizeof(record->data[0]) + sizeof(record->data[1]);
268 + /* Mark end of tags. */
269 + record = (struct bi_record *) ((void *) record + record->size);
271 + record->data[0] = 0;
272 + record->data[1] = 0;
273 + record->size = sizeof(record->tag) + sizeof(record->size)
274 + + sizeof(record->data[0]) + sizeof(record->data[1]);
276 + /* Invalidate caches via CACR */
278 + cacr_set(CACHE_DISABLE_MODE);
280 + /* Turn on caches via CACR, enable EUSP */
281 + cacr_set(CACHE_INITIAL_MODE);
285 +#if defined(CONFIG_M5445X)
286 +void settimericr(unsigned int timer, unsigned int level)
288 + volatile unsigned char *icrp;
294 + case 2: irq = 33; icr = MCFSIM_ICR_TIMER2; break;
295 + default: irq = 32; icr = MCFSIM_ICR_TIMER1; break;
298 + icrp = (volatile unsigned char *) (icr);
300 + coldfire_enable_irq0(irq);
305 +/* Assembler routines */
306 +asmlinkage void buserr(void);
307 +asmlinkage void trap(void);
308 +asmlinkage void system_call(void);
309 +asmlinkage void inthandler(void);
311 +void __init coldfire_trap_init(void)
316 +#if defined(CONFIG_M5445X)
317 + vectors = (e_vector *)MCF_RAMBAR1;
318 +#elif defined(CONFIG_M547X_8X)
319 + vectors = (e_vector *)MCF_RAMBAR0;
322 + * There is a common trap handler and common interrupt
323 + * handler that handle almost every vector. We treat
324 + * the system call and bus error special, they get their
325 + * own first level handlers.
327 + for (i = 3; (i <= 23); i++)
329 + for (i = 33; (i <= 63); i++)
331 + for (i = 24; (i <= 31); i++)
332 + vectors[i] = inthandler;
333 + for (i = 64; (i < 255); i++)
334 + vectors[i] = inthandler;
337 + vectors[2] = buserr;
338 + vectors[32] = system_call;
341 +#if defined(CONFIG_M5445X)
343 +void coldfire_tick(void)
345 + /* Reset the ColdFire timer */
346 + __raw_writeb(MCF_DTIM_DTER_CAP | MCF_DTIM_DTER_REF, MCF_DTIM0_DTER);
349 +void __init coldfire_sched_init(irq_handler_t handler)
351 + unsigned int mcf_timerlevel = 5;
352 + unsigned int mcf_timervector = 64+32;
354 + __raw_writew(MCF_DTIM_DTMR_RST_RST, MCF_DTIM0_DTMR);
355 + __raw_writel(((MCF_BUSCLK / 16) / HZ), MCF_DTIM0_DTRR);
356 + __raw_writew(MCF_DTIM_DTMR_ORRI | MCF_DTIM_DTMR_CLK_DIV16 |
357 + MCF_DTIM_DTMR_FRR | MCF_DTIM_DTMR_RST_EN, \
360 + request_irq(mcf_timervector, handler, IRQF_DISABLED, \
361 + "timer", (void *)MCF_DTIM0_DTMR);
363 + settimericr(1, mcf_timerlevel);
366 +int timerirqpending(int timer)
368 + unsigned int imr = 0;
371 + case 1: imr = 0x1; break;
372 + case 2: imr = 0x2; break;
376 + return (getiprh() & imr);
379 +unsigned long coldfire_gettimeoffset(void)
381 + volatile unsigned long trr, tcn, offset;
383 + tcn = __raw_readw(MCF_DTIM0_DTCN);
384 + trr = __raw_readl(MCF_DTIM0_DTRR);
385 + offset = (tcn * (1000000 / HZ)) / trr;
387 + /* Check if we just wrapped the counters and maybe missed a tick */
388 + if ((offset < (1000000 / HZ / 2)) && timerirqpending(1))
389 + offset += 1000000 / HZ;
393 +#elif defined(CONFIG_M547X_8X)
395 +void coldfire_tick(void)
397 + /* Reset the ColdFire timer */
398 + MCF_SSR(0) = MCF_SSR_ST;
401 +void __init coldfire_sched_init(irq_handler_t handler)
403 + int irq = ISC_SLTn(0);
406 + MCF_ICR(irq) = ILP_SLT0;
407 + request_irq(64 + irq, handler, IRQF_DISABLED, "ColdFire Timer 0", NULL);
408 + MCF_SLTCNT(0) = MCF_BUSCLK / HZ;
409 + MCF_SCR(0) |= MCF_SCR_TEN | MCF_SCR_IEN | MCF_SCR_RUN;
412 +unsigned long coldfire_gettimeoffset(void)
414 + volatile unsigned long trr, tcn, offset;
415 + trr = MCF_SLTCNT(0);
418 + offset = (trr - tcn) * ((1000000 >> 3) / HZ) / (trr >> 3);
419 + if (MCF_SSR(0) & MCF_SSR_ST)
420 + offset += 1000000 / HZ;
427 +void coldfire_reboot(void)
429 +#if defined(CONFIG_M5445X)
430 + /* disable interrupts and do a software reset */
431 + asm("movew #0x2700, %%sr\n\t"
432 + "moveb #0x80, %%d0\n\t"
433 + "moveb %%d0, 0xfc0a0000\n\t"
435 +#elif defined(CONFIG_M547X_8X)
436 + /* disable interrupts and enable the watchdog */
437 + printk(KERN_INFO "Rebooting\n");
438 + asm("movew #0x2700, %sr\n");
439 + MCF_GPT_GMS0 = MCF_GPT_GMS_WDEN | MCF_GPT_GMS_CE | MCF_GPT_GMS_TMS(4);
443 +static void coldfire_get_model(char *model)
445 + sprintf(model, "Version 4 ColdFire");
449 +coldfire_bootmem_alloc(unsigned long memory_start, unsigned long memory_end)
451 + unsigned long base_pfn;
453 + /* compute total pages in system */
454 + num_pages = PAGE_ALIGN(memory_end - PAGE_OFFSET) >> PAGE_SHIFT;
456 + /* align start/end to page boundries */
457 + memory_start = PAGE_ALIGN(memory_start);
458 + memory_end = memory_end & PAGE_MASK;
461 + base_pfn = __pa(PAGE_OFFSET) >> PAGE_SHIFT;
462 + min_low_pfn = __pa(memory_start) >> PAGE_SHIFT;
463 + max_low_pfn = __pa(memory_end) >> PAGE_SHIFT;
465 + high_memory = (void *)memory_end;
466 + availmem = memory_start;
468 + /* setup bootmem data */
469 + m68k_setup_node(0);
470 + availmem += init_bootmem_node(NODE_DATA(0), min_low_pfn,
471 + base_pfn, max_low_pfn);
472 + availmem = PAGE_ALIGN(availmem);
473 + free_bootmem(__pa(availmem), memory_end - (availmem));
476 +void __init config_coldfire(void)
478 + unsigned long endmem, startmem;
482 + * Calculate endmem from m68k_memory, assume all are contiguous
484 + startmem = ((((int) &_end) + (PAGE_SIZE - 1)) & PAGE_MASK);
485 + endmem = PAGE_OFFSET;
486 + for (i = 0; i < m68k_num_memory; ++i)
487 + endmem += m68k_memory[i].size;
489 + printk(KERN_INFO "starting up linux startmem 0x%lx, endmem 0x%lx, \
490 + size %luMB\n", startmem, endmem, (endmem - startmem) >> 20);
492 + memset(irq_enable, 0, sizeof(irq_enable));
495 + * Setup coldfire mach-specific handlers
497 + mach_max_dma_address = 0xffffffff;
498 + mach_sched_init = coldfire_sched_init;
499 + mach_tick = coldfire_tick;
500 + mach_gettimeoffset = coldfire_gettimeoffset;
501 + mach_reset = coldfire_reboot;
502 +/* mach_hwclk = coldfire_hwclk; to be done */
503 + mach_get_model = coldfire_get_model;
505 + coldfire_bootmem_alloc(startmem, endmem-1);
510 +/* #ifdef CONFIG_BLK_DEV_INITRD
511 + if (m68k_ramdisk.size) {
512 + reserve_bootmem (__pa(m68k_ramdisk.addr), m68k_ramdisk.size);
513 + initrd_start = (unsigned long) m68k_ramdisk.addr;
514 + initrd_end = initrd_start + m68k_ramdisk.size;
515 + printk (KERN_DEBUG "initrd: %08lx - %08lx\n", initrd_start,
520 +#if defined(CONFIG_DUMMY_CONSOLE) || defined(CONFIG_FRAMEBUFFER_CONSOLE)
521 + conswitchp = &dummy_con;
524 +#if defined(CONFIG_SERIAL_COLDFIRE)
526 + * This causes trouble when it is re-registered later.
527 + * Currently this is fixed by conditionally commenting
528 + * out the register_console in mcf_serial.c
530 + register_console(&mcfrs_console);
534 +++ b/arch/m68k/coldfire/entry.S
537 + * arch/m68k/coldfire/entry.S
539 + * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
540 + * Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>,
541 + * Kenneth Albanowski <kjahds@kjahds.com>,
542 + * Copyright (C) 2000 Lineo Inc. (www.lineo.com)
543 + * Copyright (C) 2004-2006 Macq Electronique SA. (www.macqel.com)
544 + * Matt Waddel Matt.Waddel@freescale.com
545 + * Kurt Mahan kmahan@freescale.com
546 + * Copyright Freescale Semiconductor, Inc. 2007
548 + * Modify irq status in buserr -- (c) Copyright 2008, SYSTEM electronic Gmbh
552 + * arch/m68knommu/platform/5307/entry.S &
553 + * arch/m68k/kernel/entry.S
555 + * Copyright (C) 1991, 1992 Linus Torvalds
557 + * This file is subject to the terms and conditions of the GNU General Public
558 + * License. See the file README.legal in the main directory of this archive
559 + * for more details.
561 + * Linux/m68k support by Hamish Macdonald
563 + * ColdFire support by Greg Ungerer (gerg@snapgear.com)
564 + * 5307 fixes by David W. Miller
565 + * linux 2.4 support David McCullough <davidm@snapgear.com>
566 + * Bug, speed and maintainability fixes by Philippe De Muyter <phdm@macqel.be>
567 + * Ported to mmu Coldfire by Matt Waddel
570 +#include <linux/sys.h>
571 +#include <linux/linkage.h>
572 +#include <asm/cf_entry.h>
573 +#include <asm/errno.h>
574 +#include <asm/setup.h>
575 +#include <asm/segment.h>
576 +#include <asm/traps.h>
577 +#include <asm/unistd.h>
582 + * - TINFO_PREEMPT (struct thread_info / preempt_count)
583 + * Used to keep track of preemptability
584 + * - TINFO_FLAGS (struct thread_info / flags - include/asm-m68k/thread_info.h)
585 + * Various bit flags that are checked for scheduling/tracing
586 + * Bits 0-7 are checked every exception exit
587 + * 8-15 are checked every syscall exit
590 + * TIF_NEED_RESCHED 7
591 + * TIF_DELAYED_TRACE 14
592 + * TIF_SYSCALL_TRACE 15
593 + * TIF_MEMDIE 16 (never checked here)
610 +.globl ret_from_exception
611 +.globl ret_from_signal
612 +.globl sys_call_table
613 +.globl ret_from_interrupt
617 +#ifdef CONFIG_COLDFIRE_FOO
618 + movew #0x2700,%sr /* lock interrupts */
621 +#ifdef CONFIG_COLDFIRE_FOO
622 + movew PT_SR(%sp),%d3 /* get original %sr */
623 + oril #0x2000,%d3 /* set supervisor mode in it */
624 + movew %d3,%sr /* recover irq state */
627 + movel %sp,%sp@- /* stack frame pointer argument */
630 + jra .Lret_from_exception
635 + movel %sp,%sp@- /* stack frame pointer argument */
638 + jra .Lret_from_exception
640 + /* After a fork we jump here directly from resume,
641 + %d1 contains the previous task schedule_tail */
642 +ENTRY(ret_from_fork)
646 + jra .Lret_from_exception
649 + movel #-ENOSYS,%d1 /* needed for strace */
650 + movel %d1,%sp@(PT_D0)
654 + RESTORE_SWITCH_STACK
656 + movel %sp@(PT_ORIG_D0),%d0
657 + cmpl #NR_syscalls,%d0
661 + movel %d1,%sp@(PT_D0)
662 + jra ret_from_exception
668 + RESTORE_SWITCH_STACK
670 + jra .Lret_from_exception
672 +ENTRY(ret_from_signal)
673 + RESTORE_SWITCH_STACK
675 + jra .Lret_from_exception
681 + /* save top of frame */
682 + movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0)
684 + /* syscall trace */
685 + tstb %curptr@(TASK_INFO+TINFO_FLAGS+2)
686 + jmi do_trace_entry /* SYSCALL_TRACE is set */
687 + cmpl #NR_syscalls,%d0
690 + movel #sys_call_table,%a0
695 + movel %d0,%sp@(PT_D0) /* save the return value */
697 + movew %curptr@(TASK_INFO+TINFO_FLAGS+2),%d0
698 + jne syscall_exit_work /* flags set so process */
702 + btst #5,%sp@(PT_SR) /* check if returning to kernel */
703 + bnes 1b /* if so, skip resched, signals */
705 + btstl #15,%d0 /* check if SYSCALL_TRACE */
707 + btstl #14,%d0 /* check if DELAYED_TRACE */
708 + jne do_delayed_trace
709 + btstl #6,%d0 /* check if SIGPENDING */
710 + jne do_signal_return
711 + pea resume_userspace
714 +ENTRY(ret_from_exception)
715 +.Lret_from_exception:
716 + btst #5,%sp@(PT_SR) /* check if returning to kernel */
717 + bnes 1f /* if so, skip resched, signals */
718 + movel %d0,%sp@- /* Only allow interrupts when we are */
719 + move %sr,%d0 /* last one on the kernel stack, */
720 + andl #ALLOWINT,%d0 /* otherwise stack overflow can occur */
721 + move %d0,%sr /* during heavy interrupt load. */
725 + moveb %curptr@(TASK_INFO+TINFO_FLAGS+3),%d0
726 + jne exit_work /* SIGPENDING and/or NEED_RESCHED set */
730 + /* save top of frame */
731 + movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0)
732 + btstl #6,%d0 /* check for SIGPENDING in flags */
733 + jne do_signal_return
734 + pea resume_userspace
738 + subql #4,%sp /* dummy return address */
740 + pea %sp@(SWITCH_STACK_SIZE)
744 + RESTORE_SWITCH_STACK
746 + jbra resume_userspace
749 + bclr #7,%sp@(PT_SR) /* clear trace bit in SR */
750 + pea 1 /* send SIGTRAP */
751 + movel %curptr,%sp@-
756 + jbra resume_userspace
759 + * This is the interrupt handler (for all hardware interrupt
760 + * sources). It figures out the vector number and calls the appropriate
761 + * interrupt service routine directly.
766 + addql #1,%curptr@(TASK_INFO+TINFO_PREEMPT)
767 + /* put exception # in d0 */
768 + movel %sp@(PT_VECTOR),%d0
769 + swap %d0 /* extract bits 25:18 */
774 + movel %d0,%sp@- /* put vector # on stack */
775 +auto_irqhandler_fixup = . + 2
776 + jbsr process_int /* process the IRQ */
777 + addql #8,%sp /* pop parameters off stack */
779 +ENTRY(ret_from_interrupt)
782 + subql #1,%curptr@(TASK_INFO+TINFO_PREEMPT)
783 + jeq ret_from_last_interrupt
787 +ret_from_last_interrupt:
788 + moveb %sp@(PT_SR),%d0
789 + andl #(~ALLOWINT>>8)&0xff,%d0
792 + /* check if we need to do software interrupts */
793 + tstl irq_stat+CPUSTAT_SOFTIRQ_PENDING
794 + jeq .Lret_from_exception
795 + pea ret_from_exception
798 +ENTRY(user_inthandler)
801 + addql #1,%curptr@(TASK_INFO+TINFO_PREEMPT)
802 + /* put exception # in d0 */
803 + movel %sp@(PT_VECTOR),%d0
804 +user_irqvec_fixup = . + 2
805 + swap %d0 /* extract bits 25:18 */
810 + movel %d0,%sp@- /* put vector # on stack */
811 +user_irqhandler_fixup = . + 2
812 + jbsr process_int /* process the IRQ */
813 + addql #8,%sp /* pop parameters off stack */
815 + subql #1,%curptr@(TASK_INFO+TINFO_PREEMPT)
816 + jeq ret_from_last_interrupt
819 +/* Handler for uninitialized and spurious interrupts */
821 +ENTRY(bad_inthandler)
824 + addql #1,%curptr@(TASK_INFO+TINFO_PREEMPT)
830 + subql #1,%curptr@(TASK_INFO+TINFO_PREEMPT)
831 + jeq ret_from_last_interrupt
836 + pea %sp@(SWITCH_STACK_SIZE)
839 + RESTORE_SWITCH_STACK
844 + pea %sp@(SWITCH_STACK_SIZE)
847 + RESTORE_SWITCH_STACK
852 + pea %sp@(SWITCH_STACK_SIZE)
855 + RESTORE_SWITCH_STACK
858 +ENTRY(sys_sigsuspend)
860 + pea %sp@(SWITCH_STACK_SIZE)
863 + RESTORE_SWITCH_STACK
866 +ENTRY(sys_rt_sigsuspend)
868 + pea %sp@(SWITCH_STACK_SIZE)
869 + jbsr do_rt_sigsuspend
871 + RESTORE_SWITCH_STACK
874 +ENTRY(sys_sigreturn)
877 + RESTORE_SWITCH_STACK
880 +ENTRY(sys_rt_sigreturn)
882 + jbsr do_rt_sigreturn
883 + RESTORE_SWITCH_STACK
888 + * Beware - when entering resume, prev (the current task) is
889 + * in a0, next (the new task) is in a1,so don't change these
890 + * registers until their contents are no longer needed.
895 + movew %d0,%a0@(TASK_THREAD+THREAD_SR)
898 + /* Save USP via %a1 (which is saved/restored from %d0) */
901 + movel %a1,%a0@(TASK_THREAD+THREAD_USP)
904 + /* save non-scratch registers on stack */
907 + /* save current kernel stack pointer */
908 + movel %sp,%a0@(TASK_THREAD+THREAD_KSP)
910 + /* Return previous task in %d1 */
913 + /* switch to new task (a1 contains new task) */
916 + /* restore the kernel stack pointer */
917 + movel %a1@(TASK_THREAD+THREAD_KSP),%sp
919 + /* restore non-scratch registers */
920 + RESTORE_SWITCH_STACK
922 + /* restore user stack pointer */
923 + movel %a1@(TASK_THREAD+THREAD_USP),%a0
926 + /* restore status register */
927 + movew %a1@(TASK_THREAD+THREAD_SR),%d0
935 + .long sys_ni_syscall /* 0 - old "setup()" system call*/
940 + .long sys_open /* 5 */
945 + .long sys_unlink /* 10 */
950 + .long sys_chmod /* 15 */
952 + .long sys_ni_syscall /* old break syscall holder */
955 + .long sys_getpid /* 20 */
957 + .long sys_oldumount
960 + .long sys_stime /* 25 */
965 + .long sys_utime /* 30 */
966 + .long sys_ni_syscall /* old stty syscall holder */
967 + .long sys_ni_syscall /* old gtty syscall holder */
970 + .long sys_ni_syscall /* 35 */ /* old ftime syscall holder */
975 + .long sys_rmdir /* 40 */
979 + .long sys_ni_syscall /* old prof syscall holder */
980 + .long sys_brk /* 45 */
984 + .long sys_geteuid16
985 + .long sys_getegid16 /* 50 */
987 + .long sys_umount /* recycled never used phys() */
988 + .long sys_ni_syscall /* old lock syscall holder */
990 + .long sys_fcntl /* 55 */
991 + .long sys_ni_syscall /* old mpx syscall holder */
993 + .long sys_ni_syscall /* old ulimit syscall holder */
994 + .long sys_ni_syscall
995 + .long sys_umask /* 60 */
1000 + .long sys_getpgrp /* 65 */
1002 + .long sys_sigaction
1003 + .long sys_sgetmask
1004 + .long sys_ssetmask
1005 + .long sys_setreuid16 /* 70 */
1006 + .long sys_setregid16
1007 + .long sys_sigsuspend
1008 + .long sys_sigpending
1009 + .long sys_sethostname
1010 + .long sys_setrlimit /* 75 */
1011 + .long sys_old_getrlimit
1012 + .long sys_getrusage
1013 + .long sys_gettimeofday
1014 + .long sys_settimeofday
1015 + .long sys_getgroups16 /* 80 */
1016 + .long sys_setgroups16
1020 + .long sys_readlink /* 85 */
1025 + .long old_mmap /* 90 */
1027 + .long sys_truncate
1028 + .long sys_ftruncate
1030 + .long sys_fchown16 /* 95 */
1031 + .long sys_getpriority
1032 + .long sys_setpriority
1033 + .long sys_ni_syscall /* old profil syscall holder */
1035 + .long sys_fstatfs /* 100 */
1036 + .long sys_ni_syscall /* ioperm for i386 */
1037 + .long sys_socketcall
1039 + .long sys_setitimer
1040 + .long sys_getitimer /* 105 */
1042 + .long sys_newlstat
1043 + .long sys_newfstat
1044 + .long sys_ni_syscall
1045 + .long sys_ni_syscall /* 110 */ /* iopl for i386 */
1047 + .long sys_ni_syscall /* obsolete idle() syscall */
1048 + .long sys_ni_syscall /* vm86old for i386 */
1050 + .long sys_swapoff /* 115 */
1054 + .long sys_sigreturn
1055 + .long sys_clone /* 120 */
1056 + .long sys_setdomainname
1057 + .long sys_newuname
1058 + .long sys_cacheflush /* modify_ldt for i386 */
1059 + .long sys_adjtimex
1060 + .long sys_mprotect /* 125 */
1061 + .long sys_sigprocmask
1062 + .long sys_ni_syscall /* old "create_module" */
1063 + .long sys_init_module
1064 + .long sys_delete_module
1065 + .long sys_ni_syscall /* 130 - old "get_kernel_syms" */
1066 + .long sys_quotactl
1070 + .long sys_sysfs /* 135 */
1071 + .long sys_personality
1072 + .long sys_ni_syscall /* for afs_syscall */
1073 + .long sys_setfsuid16
1074 + .long sys_setfsgid16
1075 + .long sys_llseek /* 140 */
1076 + .long sys_getdents
1080 + .long sys_readv /* 145 */
1083 + .long sys_fdatasync
1085 + .long sys_mlock /* 150 */
1087 + .long sys_mlockall
1088 + .long sys_munlockall
1089 + .long sys_sched_setparam
1090 + .long sys_sched_getparam /* 155 */
1091 + .long sys_sched_setscheduler
1092 + .long sys_sched_getscheduler
1093 + .long sys_sched_yield
1094 + .long sys_sched_get_priority_max
1095 + .long sys_sched_get_priority_min /* 160 */
1096 + .long sys_sched_rr_get_interval
1097 + .long sys_nanosleep
1099 + .long sys_setresuid16
1100 + .long sys_getresuid16 /* 165 */
1101 + .long sys_getpagesize
1102 + .long sys_ni_syscall /* old sys_query_module */
1104 + .long sys_nfsservctl
1105 + .long sys_setresgid16 /* 170 */
1106 + .long sys_getresgid16
1108 + .long sys_rt_sigreturn
1109 + .long sys_rt_sigaction
1110 + .long sys_rt_sigprocmask /* 175 */
1111 + .long sys_rt_sigpending
1112 + .long sys_rt_sigtimedwait
1113 + .long sys_rt_sigqueueinfo
1114 + .long sys_rt_sigsuspend
1115 + .long sys_pread64 /* 180 */
1116 + .long sys_pwrite64
1117 + .long sys_lchown16;
1120 + .long sys_capset /* 185 */
1121 + .long sys_sigaltstack
1122 + .long sys_sendfile
1123 + .long sys_ni_syscall /* streams1 */
1124 + .long sys_ni_syscall /* streams2 */
1125 + .long sys_vfork /* 190 */
1126 + .long sys_getrlimit
1128 + .long sys_truncate64
1129 + .long sys_ftruncate64
1130 + .long sys_stat64 /* 195 */
1135 + .long sys_getgid /* 200 */
1138 + .long sys_setreuid
1139 + .long sys_setregid
1140 + .long sys_getgroups /* 205 */
1141 + .long sys_setgroups
1143 + .long sys_setresuid
1144 + .long sys_getresuid
1145 + .long sys_setresgid /* 210 */
1146 + .long sys_getresgid
1150 + .long sys_setfsuid /* 215 */
1151 + .long sys_setfsgid
1152 + .long sys_pivot_root
1153 + .long sys_ni_syscall
1154 + .long sys_ni_syscall
1155 + .long sys_getdents64 /* 220 */
1158 + .long sys_setxattr
1159 + .long sys_lsetxattr
1160 + .long sys_fsetxattr /* 225 */
1161 + .long sys_getxattr
1162 + .long sys_lgetxattr
1163 + .long sys_fgetxattr
1164 + .long sys_listxattr
1165 + .long sys_llistxattr /* 230 */
1166 + .long sys_flistxattr
1167 + .long sys_removexattr
1168 + .long sys_lremovexattr
1169 + .long sys_fremovexattr
1170 + .long sys_futex /* 235 */
1171 + .long sys_sendfile64
1175 + .long sys_readahead /* 240 */
1176 + .long sys_io_setup
1177 + .long sys_io_destroy
1178 + .long sys_io_getevents
1179 + .long sys_io_submit
1180 + .long sys_io_cancel /* 245 */
1181 + .long sys_fadvise64
1182 + .long sys_exit_group
1183 + .long sys_lookup_dcookie
1184 + .long sys_epoll_create
1185 + .long sys_epoll_ctl /* 250 */
1186 + .long sys_epoll_wait
1187 + .long sys_remap_file_pages
1188 + .long sys_set_tid_address
1189 + .long sys_timer_create
1190 + .long sys_timer_settime /* 255 */
1191 + .long sys_timer_gettime
1192 + .long sys_timer_getoverrun
1193 + .long sys_timer_delete
1194 + .long sys_clock_settime
1195 + .long sys_clock_gettime /* 260 */
1196 + .long sys_clock_getres
1197 + .long sys_clock_nanosleep
1198 + .long sys_statfs64
1199 + .long sys_fstatfs64
1200 + .long sys_tgkill /* 265 */
1202 + .long sys_fadvise64_64
1204 + .long sys_get_mempolicy
1205 + .long sys_set_mempolicy /* 270 */
1207 + .long sys_mq_unlink
1208 + .long sys_mq_timedsend
1209 + .long sys_mq_timedreceive
1210 + .long sys_mq_notify /* 275 */
1211 + .long sys_mq_getsetattr
1213 + .long sys_ni_syscall /* for sys_vserver */
1215 + .long sys_request_key /* 280 */
1217 + .long sys_ioprio_set
1218 + .long sys_ioprio_get
1219 + .long sys_inotify_init
1220 + .long sys_inotify_add_watch /* 285 */
1221 + .long sys_inotify_rm_watch
1222 + .long sys_migrate_pages
1225 + .long sys_mknodat /* 290 */
1226 + .long sys_fchownat
1227 + .long sys_futimesat
1228 + .long sys_fstatat64
1229 + .long sys_unlinkat
1230 + .long sys_renameat /* 295 */
1232 + .long sys_symlinkat
1233 + .long sys_readlinkat
1234 + .long sys_fchmodat
1235 + .long sys_faccessat /* 300 */
1236 + .long sys_ni_syscall /* Reserved for pselect6 */
1237 + .long sys_ni_syscall /* Reserved for ppoll */
1239 + .long sys_set_robust_list
1240 + .long sys_get_robust_list /* 305 */
1242 + .long sys_sync_file_range
1244 + .long sys_vmsplice
1245 + .long sys_move_pages /* 310 */
1248 +++ b/arch/m68k/coldfire/head.S
1251 + * head.S is the MMU enabled ColdFire specific initial boot code
1253 + * Ported to ColdFire by
1254 + * Matt Waddel Matt.Waddel@freescale.com
1255 + * Kurt Mahan kmahan@freescale.com
1256 + * Copyright Freescale Semiconductor, Inc. 2007, 2008
1257 + * Phys kernel mapping Copyright Daniel Krueger, SYSTEC electornic GmbH 2008
1259 + * This program is free software; you can redistribute it and/or modify
1260 + * it under the terms of the GNU General Public License as published by
1261 + * the Free Software Foundation; either version 2 of the License, or
1262 + * (at your option) any later version.
1264 + * Parts of this code came from arch/m68k/kernel/head.S
1266 +#include <linux/linkage.h>
1267 +#include <linux/init.h>
1268 +#include <asm/bootinfo.h>
1269 +#include <asm/setup.h>
1270 +#include <asm/entry.h>
1271 +#include <asm/pgtable.h>
1272 +#include <asm/page.h>
1273 +#include <asm/coldfire.h>
1274 +#include <asm/mcfuart.h>
1275 +#include <asm/cfcache.h>
1279 +.globl kernel_pg_dir
1285 +/* When debugging use readable names for labels */
1287 +#define L(name) .head.S.##name
1289 +#define L(name) .head.S./**/name
1293 +#define L(name) .L##name
1295 +#define L(name) .L/**/name
1299 +/* The __INITDATA stuff is a no-op when ftrace or kgdb are turned on */
1301 +#define __INITDATA .data
1302 +#define __FINIT .previous
1305 +#if CONFIG_SDRAM_BASE != PAGE_OFFSET
1307 + * Kernel mapped to virtual ram address.
1310 + * Data[0]: 0xF0000000 -> 0xFFFFFFFF System regs
1311 + * Data[1]: 0xA0000000 -> 0xAFFFFFFF PCI
1312 + * Code[0]: Not Mapped
1313 + * Code[1]: Not Mapped
1316 + * Data[0]: 0xF0000000 -> 0xFFFFFFFF System regs
1317 + * Data[1]: Not Mapped
1318 + * Code[0]: Not Mapped
1319 + * Code[1]: Not Mapped
1321 +#if defined(CONFIG_M5445X)
1322 +#define ACR0_DEFAULT #0xF00FA048 /* System regs */
1323 +#define ACR1_DEFAULT #0xA00FA048 /* PCI */
1324 +#define ACR2_DEFAULT #0x00000000 /* Not Mapped */
1325 +#define ACR3_DEFAULT #0x00000000 /* Not Mapped */
1326 +#elif defined(CONFIG_M547X_8X)
1327 +#define ACR0_DEFAULT #0xF00FA048 /* System Regs */
1328 +#define ACR1_DEFAULT #0x00000000 /* Not Mapped */
1329 +#define ACR2_DEFAULT #0x00000000 /* Not Mapped */
1330 +#define ACR3_DEFAULT #0x00000000 /* Not Mapped */
1333 +#else /* CONFIG_SDRAM_BASE = PAGE_OFFSET */
1335 + * Kernel mapped to physical ram address.
1338 + * Data[0]: 0xF0000000 -> 0xFFFFFFFF System regs
1339 + * Data[1]: 0x40000000 -> 0x4FFFFFFF SDRAM - uncached
1340 + * Code[0]: Not Mapped
1341 + * Code[1]: 0x40000000 -> 0x4FFFFFFF SDRAM - cached
1344 + * Data[0]: 0xF0000000 -> 0xFFFFFFFF System regs
1345 + * Data[1]: 0x00000000 -> 0x0FFFFFFF SDRAM - uncached
1346 + * Code[0]: Not Mapped
1347 + * Code[1]: 0x00000000 -> 0x0FFFFFFF SDRAM - cached
1349 +#if defined(CONFIG_M5445X)
1350 +#define ACR0_DEFAULT #0xF00FA048 /* System Regs */
1351 +#define ACR1_DEFAULT #0x400FA048 /* SDRAM uncached */
1352 +#define ACR2_DEFAULT #0x00000000 /* Not mapped */
1353 +#define ACR3_DEFAULT #0x400FA008 /* SDRAM cached */
1354 +#elif defined(CONFIG_M547X_8X)
1355 +#define ACR0_DEFAULT #0xF00FA048 /* System Regs */
1356 +#define ACR1_DEFAULT #0x000FA048 /* SDRAM uncached */
1357 +#define ACR2_DEFAULT #0x00000000 /* Not mapped */
1358 +#define ACR3_DEFAULT #0x000FA008 /* SDRAM cached */
1362 +/* Several macros to make the writing of subroutines easier:
1363 + * - func_start marks the beginning of the routine which setups the frame
1364 + * register and saves the registers, it also defines another macro
1365 + * to automatically restore the registers again.
1366 + * - func_return marks the end of the routine and simply calls the prepared
1367 + * macro to restore registers and jump back to the caller.
1368 + * - func_define generates another macro to automatically put arguments
1369 + * onto the stack call the subroutine and cleanup the stack again.
1372 +.macro load_symbol_address symbol,register
1373 + movel #\symbol,\register
1376 +.macro func_start name,saveregs,savesize,stack=0
1378 + linkw %a6,#-\stack
1379 + subal #(\savesize),%sp
1380 + moveml \saveregs,%sp@
1381 +.set stackstart,-\stack
1383 +.macro func_return_\name
1384 + moveml %sp@,\saveregs
1385 + addal #(\savesize),%sp
1391 +.macro func_return name
1395 +.macro func_call name
1399 +.macro move_stack nr,arg1,arg2,arg3,arg4
1401 + move_stack "(\nr-1)",\arg2,\arg3,\arg4
1406 +.macro func_define name,nr=0
1407 +.macro \name arg1,arg2,arg3,arg4
1408 + move_stack \nr,\arg1,\arg2,\arg3,\arg4
1411 + lea %sp@(\nr*4),%sp
1416 +func_define serial_putc,1
1420 + func_call serial_putc
1438 +#if CONFIG_SDRAM_BASE != PAGE_OFFSET
1440 + mmu_map - creates a new TLB entry
1442 + virt_addr Must be on proper boundary
1443 + phys_addr Must be on proper boundary
1444 + itlb MMUOR_ITLB if instruction TLB or 0
1445 + asid address space ID
1446 + shared_global MMUTR_SG if shared between different ASIDs or 0
1447 + size_code MMUDR_SZ1M 1 MB
1451 + cache_mode MMUDR_INC instruction non-cacheable
1452 + MMUDR_IC instruction cacheable
1453 + MMUDR_DWT data writethrough
1454 + MMUDR_DCB data copyback
1455 + MMUDR_DNCP data non-cacheable, precise
1456 + MMUDR_DNCIP data non-cacheable, imprecise
1457 + super_prot MMUDR_SP if user mode generates exception or 0
1458 + readable MMUDR_R if permits read access (data TLB) or 0
1459 + writable MMUDR_W if permits write access (data TLB) or 0
1460 + executable MMUDR_X if permits execute access (instruction TLB) or 0
1461 + locked MMUDR_LK prevents TLB entry from being replaced or 0
1462 + temp_data_reg a data register to use for temporary values
1464 +.macro mmu_map virt_addr,phys_addr,itlb,asid,shared_global,size_code,cache_mode,super_prot,readable,writable,executable,locked,temp_data_reg
1465 + /* Set up search of TLB. */
1466 + movel #(\virt_addr+1), \temp_data_reg
1467 + movel \temp_data_reg, MMUAR
1469 + movel #(MMUOR_STLB + MMUOR_ADR +\itlb), \temp_data_reg
1470 + movew \temp_data_reg, (MMUOR)
1471 + /* Set up tag value. */
1472 + movel #(\virt_addr + \asid + \shared_global + MMUTR_V), \temp_data_reg
1473 + movel \temp_data_reg, MMUTR
1474 + /* Set up data value. */
1475 + movel #(\phys_addr + \size_code + \cache_mode + \super_prot + \readable + \writable + \executable + \locked), \temp_data_reg
1476 + movel \temp_data_reg, MMUDR
1478 + movel #(MMUOR_ACC + MMUOR_UAA + \itlb), \temp_data_reg
1479 + movew \temp_data_reg, (MMUOR)
1480 +.endm /* mmu_map */
1482 +.macro mmu_unmap virt_addr,itlb,temp_data_reg
1483 + /* Set up search of TLB. */
1484 + movel #(\virt_addr+1), \temp_data_reg
1485 + movel \temp_data_reg, MMUAR
1487 + movel #(MMUOR_STLB + MMUOR_ADR +\itlb), \temp_data_reg
1488 + movew \temp_data_reg, (MMUOR)
1489 + /* Test for hit. */
1490 + movel MMUSR,\temp_data_reg
1491 + btst #MMUSR_HITN,\temp_data_reg
1493 + /* Read the TLB. */
1494 + movel #(MMUOR_RW + MMUOR_ACC +\itlb), \temp_data_reg
1495 + movew \temp_data_reg, (MMUOR)
1496 + movel MMUSR,\temp_data_reg
1497 + /* Set up tag value. */
1498 + movel #0, \temp_data_reg
1499 + movel \temp_data_reg, MMUTR
1500 + /* Set up data value. */
1501 + movel #0, \temp_data_reg
1502 + movel \temp_data_reg, MMUDR
1504 + movel #(MMUOR_ACC + MMUOR_UAA + \itlb), \temp_data_reg
1505 + movew \temp_data_reg, (MMUOR)
1507 +.endm /* mmu_unmap */
1508 +#endif /* CONFIG_SDRAM_BASE != PAGE_OFFSET */
1511 +.section ".text.head","ax"
1513 +/* Version numbers of the bootinfo interface -- if we later pass info
1514 + * from boot ROM we might want to put something real here.
1516 + * The area from _stext to _start will later be used as kernel pointer table
1518 + bras 1f /* Jump over bootinfo version numbers */
1520 + .long BOOTINFOV_MAGIC
1522 +#if CONFIG_SDRAM_BASE != PAGE_OFFSET
1523 +1: jmp __start-(0xc0000000-CONFIG_SDRAM_BASE)
1528 +.equ kernel_pg_dir,_stext
1529 +.equ .,_stext+0x1000
1535 +/* Save the location of u-boot info - cmd line, bd_info, etc. */
1536 + movel %a7,%a4 /* Don't use %a4 before cf_early_init */
1537 + addl #0x00000004,%a4 /* offset past top */
1538 + addl #(PAGE_OFFSET-CONFIG_SDRAM_BASE),%a4 /* high mem offset */
1540 +/* Setup initial stack pointer */
1541 + movel #CONFIG_SDRAM_BASE+0x1000,%sp
1547 +#if defined(CONFIG_M5445X)
1548 + movel #0x80000000, %d0
1549 + movec %d0, %rambar1
1550 +#elif defined(CONFIG_M547X_8X)
1551 + movel #MCF_MBAR, %d0
1553 + move.l #(MCF_RAMBAR0 + 0x21), %d0
1554 + movec %d0, %rambar0
1555 + move.l #(MCF_RAMBAR1 + 0x21), %d0
1556 + movec %d0, %rambar1
1562 + movel #(CF_CACR_ICINVA + CF_CACR_DCINVA),%d0
1565 + movel #(MMU_BASE+1),%d0
1566 + movecl %d0,%mmubar
1567 + movel #MMUOR_CA,%a0 /* Clear tlb entries */
1569 + movel #(MMUOR_CA + MMUOR_ITLB),%a0 /* Use ITLB for searches */
1571 + movel #0,%a0 /* Clear Addr Space User ID */
1575 + movel ACR0_DEFAULT, %d0 /* ACR0 (DATA) setup */
1578 + movel ACR1_DEFAULT, %d0 /* ACR1 (DATA) setup */
1581 + movel ACR2_DEFAULT, %d0 /* ACR2 (CODE) setup */
1584 + movel ACR3_DEFAULT, %d0 /* ACR3 (CODE) setup */
1588 + /* If you change the memory size to another value make a matching
1589 + change in paging_init(cf-mmu.c) to zones_size[]. */
1591 +#if CONFIG_SDRAM_BASE != PAGE_OFFSET
1592 +#if defined(CONFIG_M5445X)
1593 + /* Map 256MB as code */
1594 + mmu_map (PAGE_OFFSET+0*0x1000000), (PHYS_OFFSET+0*0x1000000), \
1595 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1596 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1597 + mmu_map (PAGE_OFFSET+1*0x1000000), (PHYS_OFFSET+1*0x1000000), \
1598 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1599 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1600 + mmu_map (PAGE_OFFSET+2*0x1000000), (PHYS_OFFSET+2*0x1000000), \
1601 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1602 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1603 + mmu_map (PAGE_OFFSET+3*0x1000000), (PHYS_OFFSET+3*0x1000000), \
1604 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1605 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1606 + mmu_map (PAGE_OFFSET+4*0x1000000), (PHYS_OFFSET+4*0x1000000), \
1607 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1608 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1609 + mmu_map (PAGE_OFFSET+5*0x1000000), (PHYS_OFFSET+5*0x1000000), \
1610 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1611 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1612 + mmu_map (PAGE_OFFSET+6*0x1000000), (PHYS_OFFSET+6*0x1000000), \
1613 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1614 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1615 + mmu_map (PAGE_OFFSET+7*0x1000000), (PHYS_OFFSET+7*0x1000000), \
1616 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1617 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1618 + mmu_map (PAGE_OFFSET+8*0x1000000), (PHYS_OFFSET+8*0x1000000), \
1619 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1620 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1621 + mmu_map (PAGE_OFFSET+9*0x1000000), (PHYS_OFFSET+9*0x1000000), \
1622 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1623 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1624 + mmu_map (PAGE_OFFSET+10*0x1000000), (PHYS_OFFSET+10*0x1000000), \
1625 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1626 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1627 + mmu_map (PAGE_OFFSET+11*0x1000000), (PHYS_OFFSET+11*0x1000000), \
1628 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1629 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1630 + mmu_map (PAGE_OFFSET+12*0x1000000), (PHYS_OFFSET+12*0x1000000), \
1631 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1632 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1633 + mmu_map (PAGE_OFFSET+13*0x1000000), (PHYS_OFFSET+13*0x1000000), \
1634 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1635 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1636 + mmu_map (PAGE_OFFSET+14*0x1000000), (PHYS_OFFSET+14*0x1000000), \
1637 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1638 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1639 + mmu_map (PAGE_OFFSET+15*0x1000000), (PHYS_OFFSET+15*0x1000000), \
1640 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_IC, MMUDR_SP, \
1641 + 0, 0, MMUDR_X, MMUDR_LK, %d0
1643 + /* Map 256MB as data also */
1644 + mmu_map (PAGE_OFFSET+0*0x1000000), (PHYS_OFFSET+0*0x1000000), 0, 0, \
1645 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1647 + mmu_map (PAGE_OFFSET+1*0x1000000), (PHYS_OFFSET+1*0x1000000), 0, 0, \
1648 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1650 + mmu_map (PAGE_OFFSET+2*0x1000000), (PHYS_OFFSET+2*0x1000000), 0, 0, \
1651 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1653 + mmu_map (PAGE_OFFSET+3*0x1000000), (PHYS_OFFSET+3*0x1000000), 0, 0, \
1654 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1656 + mmu_map (PAGE_OFFSET+4*0x1000000), (PHYS_OFFSET+4*0x1000000), 0, 0, \
1657 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1659 + mmu_map (PAGE_OFFSET+5*0x1000000), (PHYS_OFFSET+5*0x1000000), 0, 0, \
1660 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1662 + mmu_map (PAGE_OFFSET+6*0x1000000), (PHYS_OFFSET+6*0x1000000), 0, 0, \
1663 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1665 + mmu_map (PAGE_OFFSET+7*0x1000000), (PHYS_OFFSET+7*0x1000000), 0, 0, \
1666 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1668 + mmu_map (PAGE_OFFSET+8*0x1000000), (PHYS_OFFSET+8*0x1000000), 0, 0, \
1669 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1671 + mmu_map (PAGE_OFFSET+9*0x1000000), (PHYS_OFFSET+9*0x1000000), 0, 0, \
1672 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1674 + mmu_map (PAGE_OFFSET+10*0x1000000), (PHYS_OFFSET+10*0x1000000), 0, 0, \
1675 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1677 + mmu_map (PAGE_OFFSET+11*0x1000000), (PHYS_OFFSET+11*0x1000000), 0, 0, \
1678 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1680 + mmu_map (PAGE_OFFSET+12*0x1000000), (PHYS_OFFSET+12*0x1000000), 0, 0, \
1681 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1683 + mmu_map (PAGE_OFFSET+13*0x1000000), (PHYS_OFFSET+13*0x1000000), 0, 0, \
1684 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1686 + mmu_map (PAGE_OFFSET+14*0x1000000), (PHYS_OFFSET+14*0x1000000), 0, 0, \
1687 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1689 + mmu_map (PAGE_OFFSET+15*0x1000000), (PHYS_OFFSET+15*0x1000000), 0, 0, \
1690 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1693 + /* Map ATA registers -- sacrifice a data TLB due to the hw design */
1694 + mmu_map (0x90000000), (0x90000000), 0, 0, \
1695 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1698 +#elif defined(CONFIG_M547X_8X)
1700 + /* Map first 8 MB as code */
1701 + mmu_map (PAGE_OFFSET+0*1024*1024), (0*1024*1024), MMUOR_ITLB, 0, \
1702 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, MMUDR_X, \
1704 + mmu_map (PAGE_OFFSET+1*1024*1024), (1*1024*1024), MMUOR_ITLB, 0, \
1705 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, MMUDR_X, \
1707 + mmu_map (PAGE_OFFSET+2*1024*1024), (2*1024*1024), MMUOR_ITLB, 0, \
1708 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, MMUDR_X, \
1710 + mmu_map (PAGE_OFFSET+3*1024*1024), (3*1024*1024), MMUOR_ITLB, 0, \
1711 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, MMUDR_X, \
1713 + mmu_map (PAGE_OFFSET+4*1024*1024), (4*1024*1024), MMUOR_ITLB, 0, \
1714 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, MMUDR_X, \
1716 + mmu_map (PAGE_OFFSET+5*1024*1024), (5*1024*1024), MMUOR_ITLB, 0, \
1717 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, MMUDR_X, \
1719 + mmu_map (PAGE_OFFSET+6*1024*1024), (6*1024*1024), MMUOR_ITLB, 0, \
1720 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, MMUDR_X, \
1722 + mmu_map (PAGE_OFFSET+7*1024*1024), (7*1024*1024), MMUOR_ITLB, 0, \
1723 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, MMUDR_X, \
1726 + /* Map first 8 MB as data */
1727 + mmu_map (PAGE_OFFSET+0*1024*1024), (0*1024*1024), 0, 0, \
1728 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, \
1729 + MMUDR_W, 0, MMUDR_LK, %d0
1730 + mmu_map (PAGE_OFFSET+1*1024*1024), (1*1024*1024), 0, 0, \
1731 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, \
1732 + MMUDR_W, 0, MMUDR_LK, %d0
1733 + mmu_map (PAGE_OFFSET+2*1024*1024), (2*1024*1024), 0, 0, \
1734 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, \
1735 + MMUDR_W, 0, MMUDR_LK, %d0
1736 + mmu_map (PAGE_OFFSET+3*1024*1024), (3*1024*1024), 0, 0, \
1737 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, \
1738 + MMUDR_W, 0, MMUDR_LK, %d0
1739 + mmu_map (PAGE_OFFSET+4*1024*1024), (4*1024*1024), 0, 0, \
1740 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, \
1741 + MMUDR_W, 0, MMUDR_LK, %d0
1742 + mmu_map (PAGE_OFFSET+5*1024*1024), (5*1024*1024), 0, 0, \
1743 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, \
1744 + MMUDR_W, 0, MMUDR_LK, %d0
1745 + mmu_map (PAGE_OFFSET+6*1024*1024), (6*1024*1024), 0, 0, \
1746 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, \
1747 + MMUDR_W, 0, MMUDR_LK, %d0
1748 + mmu_map (PAGE_OFFSET+7*1024*1024), (7*1024*1024), 0, 0, \
1749 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, \
1750 + MMUDR_W, 0, MMUDR_LK, %d0
1753 + * Do unity mapping to enable the MMU. Map first chunk of memory
1754 + * in place as code/data. The TLBs will be deleted after the MMU is
1755 + * enabled and we are executing in high memory.
1758 +#if defined(CONFIG_M5445X)
1759 + /* Map first 16 MB as code */
1760 + mmu_map (PHYS_OFFSET+0*0x1000000), (PHYS_OFFSET+0*0x1000000), \
1761 + MMUOR_ITLB, 0, MMUTR_SG, MMUDR_SZ16M, MMUDR_INC, MMUDR_SP, 0, \
1762 + 0, MMUDR_X, 0, %d0
1763 + /* Map first 16 MB as data too */
1764 + mmu_map (PHYS_OFFSET+0*0x1000000), (PHYS_OFFSET+0*0x1000000), 0, 0, \
1765 + MMUTR_SG, MMUDR_SZ16M, MMUDR_DNCP, MMUDR_SP, MMUDR_R, MMUDR_W, \
1767 +#elif defined(CONFIG_M547X_8X)
1768 + /* Map first 4 MB as code */
1769 + mmu_map (0*1024*1024), (0*1024*1024), MMUOR_ITLB, 0, \
1770 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, \
1772 + mmu_map (1*1024*1024), (1*1024*1024), MMUOR_ITLB, 0, \
1773 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, \
1775 + mmu_map (2*1024*1024), (2*1024*1024), MMUOR_ITLB, 0, \
1776 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, \
1778 + mmu_map (3*1024*1024), (3*1024*1024), MMUOR_ITLB, 0, \
1779 + MMUTR_SG, MMUDR_SZ1M, MMUDR_IC, MMUDR_SP, 0, 0, \
1782 + /* Map first 4 MB as data too */
1783 + mmu_map (0*1024*1024), (0*1024*1024), 0, 0, \
1784 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DCB, MMUDR_SP, MMUDR_R, \
1785 + MMUDR_W, 0, 0, %d0
1786 + mmu_map (1*1024*1024), (1*1024*1024), 0, 0, \
1787 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DCB, MMUDR_SP, MMUDR_R, \
1788 + MMUDR_W, 0, 0, %d0
1789 + mmu_map (2*1024*1024), (2*1024*1024), 0, 0, \
1790 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DCB, MMUDR_SP, MMUDR_R, \
1791 + MMUDR_W, 0, 0, %d0
1792 + mmu_map (3*1024*1024), (3*1024*1024), 0, 0, \
1793 + MMUTR_SG, MMUDR_SZ1M, MMUDR_DCB, MMUDR_SP, MMUDR_R, \
1794 + MMUDR_W, 0, 0, %d0
1796 +#endif /* CONFIG_SDRAM_BASE != PAGE_OFFSET */
1799 + movel #(MMUCR_EN),%a0
1801 + nop /* This synchs the pipeline after a write to MMUCR */
1803 + movel #__running_high,%a0 /* Get around PC-relative addressing. */
1806 +ENTRY(__running_high)
1807 + load_symbol_address _stext,%sp
1808 + movel L(memory_start),%a0
1809 + movel %a0,availmem
1810 + load_symbol_address L(phys_kernel_start),%a0
1811 + load_symbol_address _stext,%a1
1813 + addl #PAGE_OFFSET,%a1
1825 + /* Unmap unity mappings */
1826 +#if CONFIG_SDRAM_BASE != PAGE_OFFSET
1827 +#if defined(CONFIG_M5445X)
1828 + mmu_unmap (PHYS_OFFSET+0*0x1000000), MMUOR_ITLB, %d0
1829 + mmu_unmap (PHYS_OFFSET+0*0x1000000), 0, %d0
1830 +#elif defined(CONFIG_M547X_8X)
1831 + mmu_unmap (PHYS_OFFSET+0*0x1000000), MMUOR_ITLB, %d0
1832 + mmu_unmap (PHYS_OFFSET+1*0x1000000), MMUOR_ITLB, %d0
1833 + mmu_unmap (PHYS_OFFSET+2*0x1000000), MMUOR_ITLB, %d0
1834 + mmu_unmap (PHYS_OFFSET+3*0x1000000), MMUOR_ITLB, %d0
1835 + mmu_unmap (PHYS_OFFSET+0*0x1000000), 0, %d0
1836 + mmu_unmap (PHYS_OFFSET+1*0x1000000), 0, %d0
1837 + mmu_unmap (PHYS_OFFSET+2*0x1000000), 0, %d0
1838 + mmu_unmap (PHYS_OFFSET+3*0x1000000), 0, %d0
1840 +#endif /* CONFIG_SDRAM_BASE != PAGE_OFFSET */
1842 +/* Setup initial stack pointer */
1844 + lea init_thread_union+THREAD_SIZE,%sp
1845 + subl %a6,%a6 /* clear a6 for gdb */
1847 +#ifdef CONFIG_MCF_USER_HALT
1848 +/* Setup debug control reg to allow halts from user space */
1853 + movel %a4,uboot_info_stk /* save uboot info to variable */
1857 +.section ".text.head","ax"
1859 +func_start set_context,%d0,(1*4)
1862 +func_return set_context
1864 +#ifdef CONFIG_M5445X
1866 + * set_fpga(addr,val) on the M5445X
1868 + * Map in 0x00000000 -> 0x0fffffff and then do the write.
1874 + movel ACR0_FPGA, %d0
1879 + movel ACR0_DEFAULT, %d0
1892 +L(phys_kernel_start):
1897 + .long PAGE_OFFSET_RAW
1899 +#ifdef CONFIG_MCF_USER_HALT
1901 + * Enable User Halt Enable in the debug control register.
1904 + .word 0x2c80 /* DR0 */
1905 + .word 0x00b0 /* 31:16 */
1906 + .word 0x0400 /* 15:0 -- enable UHE */
1907 + .word 0x0000 /* unused */
1912 +++ b/arch/m68k/coldfire/ints.c
1915 + * linux/arch/m68k/coldfire/ints.c -- General interrupt handling code
1917 + * Copyright (C) 1999-2002 Greg Ungerer (gerg@snapgear.com)
1918 + * Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>,
1919 + * Kenneth Albanowski <kjahds@kjahds.com>,
1920 + * Copyright (C) 2000 Lineo Inc. (www.lineo.com)
1922 + * Copyright Freescale Semiconductor, Inc. 2007, 2008
1923 + * Kurt Mahan kmahan@freescale.com
1924 + * Matt Waddel Matt.Waddel@freescale.com
1927 + * linux/arch/m68k/kernel/ints.c &
1928 + * linux/arch/m68knommu/5307/ints.c
1930 + * This file is subject to the terms and conditions of the GNU General Public
1931 + * License. See the file COPYING in the main directory of this archive
1932 + * for more details.
1935 +#include <linux/module.h>
1936 +#include <linux/types.h>
1937 +#include <linux/init.h>
1938 +#include <linux/sched.h>
1939 +#include <linux/kernel_stat.h>
1940 +#include <linux/errno.h>
1941 +#include <linux/seq_file.h>
1942 +#include <linux/interrupt.h>
1944 +#include <asm/system.h>
1945 +#include <asm/irq.h>
1946 +#include <asm/traps.h>
1947 +#include <asm/page.h>
1948 +#include <asm/machdep.h>
1949 +#include <asm/irq_regs.h>
1951 +#include <asm/mcfsim.h>
1954 + * IRQ Handler lists.
1956 +static struct irq_node *irq_list[SYS_IRQS];
1957 +static struct irq_controller *irq_controller[SYS_IRQS];
1958 +static int irq_depth[SYS_IRQS];
1963 +#if defined(CONFIG_M5445X)
1964 +void m5445x_irq_enable(unsigned int irq);
1965 +void m5445x_irq_disable(unsigned int irq);
1966 +static struct irq_controller m5445x_irq_controller = {
1968 + .lock = SPIN_LOCK_UNLOCKED,
1969 + .enable = m5445x_irq_enable,
1970 + .disable = m5445x_irq_disable,
1972 +#elif defined(CONFIG_M547X_8X)
1973 +void m547x_8x_irq_enable(unsigned int irq);
1974 +void m547x_8x_irq_disable(unsigned int irq);
1975 +static struct irq_controller m547x_8x_irq_controller = {
1976 + .name = "M547X_8X",
1977 + .lock = SPIN_LOCK_UNLOCKED,
1978 + .enable = m547x_8x_irq_enable,
1979 + .disable = m547x_8x_irq_disable,
1982 +# error No IRQ controller defined
1985 +#define POOL_SIZE SYS_IRQS
1986 +static struct irq_node pool[POOL_SIZE];
1987 +static struct irq_node *get_irq_node(void);
1989 +/* The number of spurious interrupts */
1990 +unsigned int num_spurious;
1991 +asmlinkage void handle_badint(struct pt_regs *regs);
1994 + * void init_IRQ(void)
1996 + * This function should be called during kernel startup to initialize
1997 + * the IRQ handling routines.
1999 +void __init init_IRQ(void)
2003 +#if defined(CONFIG_M5445X)
2004 + for (i = 0; i < SYS_IRQS; i++)
2005 + irq_controller[i] = &m5445x_irq_controller;
2006 +#elif defined(CONFIG_M547X_8X)
2007 + for (i = 0; i < SYS_IRQS; i++)
2008 + irq_controller[i] = &m547x_8x_irq_controller;
2013 + * process_int(unsigned long vec, struct pt_regs *fp)
2015 + * Process an interrupt. Called from entry.S.
2017 +asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
2019 + struct pt_regs *old_regs;
2020 + struct irq_node *node;
2021 + old_regs = set_irq_regs(fp);
2022 + kstat_cpu(0).irqs[vec]++;
2024 + node = irq_list[vec];
2026 + handle_badint(fp);
2029 + node->handler(vec, node->dev_id);
2030 + node = node->next;
2034 + set_irq_regs(old_regs);
2038 + * show_interrupts( struct seq_file *p, void *v)
2040 + * Called to show all the current interrupt information.
2042 +int show_interrupts(struct seq_file *p, void *v)
2044 + struct irq_controller *contr;
2045 + struct irq_node *node;
2046 + int i = *(loff_t *) v;
2048 + if ((i < NR_IRQS) && (irq_list[i])) {
2049 + contr = irq_controller[i];
2050 + node = irq_list[i];
2051 + seq_printf(p, "%-8s %3u: %10u %s", contr->name, i,
2052 + kstat_cpu(0).irqs[i], node->devname);
2053 + while ((node = node->next))
2054 + seq_printf(p, ", %s", node->devname);
2056 + seq_printf(p, "\n");
2063 + * get_irq_node(void)
2065 + * Get an irq node from the pool.
2067 +struct irq_node *get_irq_node(void)
2069 + struct irq_node *p = pool;
2072 + for (i = 0; i < POOL_SIZE; i++, p++) {
2073 + if (!p->handler) {
2074 + memset(p, 0, sizeof(struct irq_node));
2078 + printk(KERN_INFO "%s(%s:%d): No more irq nodes, I suggest you \
2079 + increase POOL_SIZE", __FUNCTION__, __FILE__, __LINE__);
2083 +void init_irq_proc(void)
2085 + /* Insert /proc/irq driver here */
2088 +int setup_irq(unsigned int irq, struct irq_node *node)
2090 + struct irq_controller *contr;
2091 + struct irq_node **prev;
2092 + unsigned long flags;
2094 + if (irq >= NR_IRQS || !irq_controller[irq]) {
2095 + printk("%s: Incorrect IRQ %d from %s\n",
2096 + __FUNCTION__, irq, node->devname);
2100 + contr = irq_controller[irq];
2101 + spin_lock_irqsave(&contr->lock, flags);
2103 + prev = irq_list + irq;
2105 + /* Can't share interrupts unless both agree to */
2106 + if (!((*prev)->flags & node->flags & IRQF_SHARED)) {
2107 + spin_unlock_irqrestore(&contr->lock, flags);
2108 + printk(KERN_INFO "%s: -BUSY-Incorrect IRQ %d \n",
2109 + __FUNCTION__, irq);
2113 + prev = &(*prev)->next;
2116 + if (!irq_list[irq]) {
2117 + if (contr->startup)
2118 + contr->startup(irq);
2120 + contr->enable(irq);
2122 + node->next = NULL;
2125 + spin_unlock_irqrestore(&contr->lock, flags);
2130 +int request_irq(unsigned int irq,
2131 + irq_handler_t handler,
2132 + unsigned long flags, const char *devname, void *dev_id)
2134 + struct irq_node *node = get_irq_node();
2138 + printk(KERN_INFO "%s:get_irq_node error %x\n",
2139 + __FUNCTION__,(unsigned int) node);
2142 + node->handler = handler;
2143 + node->flags = flags;
2144 + node->dev_id = dev_id;
2145 + node->devname = devname;
2147 + res = setup_irq(irq, node);
2149 + node->handler = NULL;
2153 +EXPORT_SYMBOL(request_irq);
2155 +void free_irq(unsigned int irq, void *dev_id)
2157 + struct irq_controller *contr;
2158 + struct irq_node **p, *node;
2159 + unsigned long flags;
2161 + if (irq >= NR_IRQS || !irq_controller[irq]) {
2162 + printk(KERN_DEBUG "%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
2166 + contr = irq_controller[irq];
2167 + spin_lock_irqsave(&contr->lock, flags);
2169 + p = irq_list + irq;
2170 + while ((node = *p)) {
2171 + if (node->dev_id == dev_id)
2178 + node->handler = NULL;
2180 + printk(KERN_DEBUG "%s: Removing probably wrong IRQ %d\n",
2181 + __FUNCTION__, irq);
2183 + if (!irq_list[irq]) {
2184 + if (contr->shutdown)
2185 + contr->shutdown(irq);
2187 + contr->disable(irq);
2190 + spin_unlock_irqrestore(&contr->lock, flags);
2192 +EXPORT_SYMBOL(free_irq);
2194 +void enable_irq(unsigned int irq)
2196 + struct irq_controller *contr;
2197 + unsigned long flags;
2199 + if (irq >= NR_IRQS || !irq_controller[irq]) {
2200 + printk(KERN_DEBUG "%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
2204 + contr = irq_controller[irq];
2205 + spin_lock_irqsave(&contr->lock, flags);
2206 + if (irq_depth[irq]) {
2207 + if (!--irq_depth[irq]) {
2208 + if (contr->enable)
2209 + contr->enable(irq);
2213 + spin_unlock_irqrestore(&contr->lock, flags);
2215 +EXPORT_SYMBOL(enable_irq);
2217 +void disable_irq(unsigned int irq)
2219 + struct irq_controller *contr;
2220 + unsigned long flags;
2222 + if (irq >= NR_IRQS || !irq_controller[irq]) {
2223 + printk(KERN_DEBUG "%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
2227 + contr = irq_controller[irq];
2228 + spin_lock_irqsave(&contr->lock, flags);
2229 + if (!irq_depth[irq]++) {
2230 + if (contr->disable)
2231 + contr->disable(irq);
2233 + spin_unlock_irqrestore(&contr->lock, flags);
2235 +EXPORT_SYMBOL(disable_irq);
2237 +void disable_irq_nosync(unsigned int irq) __attribute__((alias("disable_irq")));
2238 +EXPORT_SYMBOL(disable_irq_nosync);
2241 +unsigned long probe_irq_on(void)
2245 +EXPORT_SYMBOL(probe_irq_on);
2247 +int probe_irq_off(unsigned long irqs)
2251 +EXPORT_SYMBOL(probe_irq_off);
2253 +asmlinkage void handle_badint(struct pt_regs *regs)
2255 + kstat_cpu(0).irqs[0]++;
2257 + printk(KERN_DEBUG "unexpected interrupt from %u\n", regs->vector);
2259 +EXPORT_SYMBOL(handle_badint);
2261 +#ifdef CONFIG_M5445X
2263 + * M5445X Implementation
2265 +void m5445x_irq_enable(unsigned int irq)
2267 + /* enable the interrupt hardware */
2271 + /* adjust past non-hardware ints */
2274 + /* check for eport */
2275 + if ((irq > 0) && (irq < 8)) {
2276 + /* enable eport */
2277 + MCF_EPORT_EPPAR &= ~(3 << (irq*2)); /* level */
2278 + MCF_EPORT_EPDDR &= ~(1 << irq); /* input */
2279 + MCF_EPORT_EPIER |= 1 << irq; /* irq enabled */
2283 + /* controller 0 */
2284 + MCF_INTC0_ICR(irq) = 0x02;
2285 + MCF_INTC0_CIMR = irq;
2287 + /* controller 1 */
2289 + MCF_INTC1_ICR(irq) = 0x02;
2290 + MCF_INTC1_CIMR = irq;
2294 +void m5445x_irq_disable(unsigned int irq)
2296 + /* disable the interrupt hardware */
2300 + /* adjust past non-hardware ints */
2303 + /* check for eport */
2304 + if ((irq > 0) && (irq < 8)) {
2305 + /* disable eport */
2306 + MCF_EPORT_EPIER &= ~(1 << irq);
2310 + /* controller 0 */
2311 + MCF_INTC0_ICR(irq) = 0x00;
2312 + MCF_INTC0_SIMR = irq;
2314 + /* controller 1 */
2316 + MCF_INTC1_ICR(irq) = 0x00;
2317 + MCF_INTC1_SIMR = irq;
2320 +#elif defined(CONFIG_M547X_8X)
2322 + * M547X_8X Implementation
2324 +void m547x_8x_irq_enable(unsigned int irq)
2326 + /* enable the interrupt hardware */
2330 + /* adjust past non-hardware ints */
2333 +/* JKM -- re-add EPORT later */
2335 + /* check for eport */
2336 + if ((irq > 0) && (irq < 8)) {
2337 + /* enable eport */
2338 + MCF_EPORT_EPPAR &= ~(3 << (irq*2)); /* level */
2339 + MCF_EPORT_EPDDR &= ~(1 << irq); /* input */
2340 + MCF_EPORT_EPIER |= 1 << irq; /* irq enabled */
2345 + /* *grumble* don't set low bit of IMRL */
2346 + MCF_IMRL &= (~(1 << irq) & 0xfffffffe);
2349 + MCF_IMRH &= ~(1 << (irq - 32));
2353 +void m547x_8x_irq_disable(unsigned int irq)
2355 + /* disable the interrupt hardware */
2359 + /* adjust past non-hardware ints */
2362 +/* JKM -- re-add EPORT later */
2364 + /* check for eport */
2365 + if ((irq > 0) && (irq < 8)) {
2366 + /* disable eport */
2367 + MCF_EPORT_EPIER &= ~(1 << irq);
2372 + MCF_IMRL |= (1 << irq);
2374 + MCF_IMRH |= (1 << (irq - 32));
2378 +++ b/arch/m68k/coldfire/iomap.c
2381 + * arch/m68k/coldfire/iomap.c
2383 + * Generic coldfire iomap interface
2385 + * Based on the sh64 iomap.c by Paul Mundt.
2387 + * This file is subject to the terms and conditions of the GNU General Public
2388 + * License. See the file "COPYING" in the main directory of this archive
2389 + * for more details.
2391 +#include <linux/pci.h>
2392 +#include <asm/io.h>
2395 +void __iomem *__attribute__ ((weak))
2396 +ioport_map(unsigned long port, unsigned int len)
2398 + return (void __iomem *)port;
2400 +EXPORT_SYMBOL(pci_iomap);
2402 +void ioport_unmap(void __iomem *addr)
2406 +EXPORT_SYMBOL(pci_iounmap);
2408 +void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
2410 + unsigned long start = pci_resource_start(dev, bar);
2411 + unsigned long len = pci_resource_len(dev, bar);
2412 + unsigned long flags = pci_resource_flags(dev, bar);
2413 +printk(KERN_INFO "PCI_IOMAP: BAR=%d START=0x%lx LEN=0x%lx FLAGS=0x%lx\n",
2414 + bar, start, len, flags);
2418 + if (max && len > max)
2420 + if (flags & IORESOURCE_IO)
2421 + return ioport_map(start, len);
2422 + if (flags & IORESOURCE_MEM)
2423 + return (void __iomem *)start;
2428 +EXPORT_SYMBOL(ioport_map);
2430 +void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
2434 +EXPORT_SYMBOL(ioport_unmap);
2437 +++ b/arch/m68k/coldfire/m547x_8x-devices.c
2440 + * arch/m68k/coldfire/m547x_8x-devices.c
2442 + * Coldfire M547x/M548x Platform Device Configuration
2444 + * Copyright (c) 2008 Freescale Semiconductor, Inc.
2445 + * Kurt Mahan <kmahan@freescale.com>
2447 +#include <linux/module.h>
2448 +#include <linux/kernel.h>
2449 +#include <linux/init.h>
2450 +#include <linux/platform_device.h>
2451 +#include <linux/fsl_devices.h>
2452 +#include <linux/spi/spi.h>
2454 +#include <asm/coldfire.h>
2455 +#include <asm/mcfsim.h>
2456 +#include <asm/mcfqspi.h>
2466 +/* number of supported SPI selects */
2467 +#define SPI_NUM_CHIPSELECTS 8
2469 +void coldfire_spi_cs_control(u8 cs, u8 command)
2471 + /* nothing special required */
2474 +#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
2475 +static struct coldfire_spi_chip spidev_chip_info = {
2476 + .bits_per_word = 8,
2480 +static struct spi_board_info spi_board_info[] = {
2481 +#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
2483 + .modalias = "spidev",
2484 + .max_speed_hz = 16000000, /* max clk (SCK) speed in HZ */
2486 + .chip_select = 0, /* CS0 */
2487 + .controller_data = &spidev_chip_info,
2492 +static int spi_irq_list[] = {
2493 + /* IRQ, ICR Offset, ICR Val,Mask */
2494 + 64 + ISC_DSPI_OVRFW, ISC_DSPI_OVRFW, 0x18, 0,
2495 + 64 + ISC_DSPI_RFOF, ISC_DSPI_RFOF, 0x18, 0,
2496 + 64 + ISC_DSPI_RFDF, ISC_DSPI_RFDF, 0x18, 0,
2497 + 64 + ISC_DSPI_TFUF, ISC_DSPI_TFUF, 0x18, 0,
2498 + 64 + ISC_DSPI_TCF, ISC_DSPI_TCF, 0x18, 0,
2499 + 64 + ISC_DSPI_TFFF, ISC_DSPI_TFFF, 0x18, 0,
2500 + 64 + ISC_DSPI_EOQF, ISC_DSPI_EOQF, 0x18, 0,
2504 +static struct coldfire_spi_master coldfire_master_info = {
2506 + .num_chipselect = SPI_NUM_CHIPSELECTS,
2507 + .irq_list = spi_irq_list,
2508 + .irq_source = 0, /* not used */
2509 + .irq_vector = 0, /* not used */
2510 + .irq_mask = 0, /* not used */
2511 + .irq_lp = 0, /* not used */
2512 + .par_val = 0, /* not used */
2513 + .cs_control = coldfire_spi_cs_control,
2516 +static struct resource coldfire_spi_resources[] = {
2518 + .name = "spi-par",
2519 + .start = MCF_MBAR + 0x00000a50, /* PAR_DSPI */
2520 + .end = MCF_MBAR + 0x00000a50, /* PAR_DSPI */
2521 + .flags = IORESOURCE_MEM
2525 + .name = "spi-module",
2526 + .start = MCF_MBAR + 0x00008a00, /* DSPI MCR Base */
2527 + .end = MCF_MBAR + 0x00008ab8, /* DSPI mem map end */
2528 + .flags = IORESOURCE_MEM
2532 + .name = "spi-int-level",
2533 + .start = MCF_MBAR + 0x740, /* ICR start */
2534 + .end = MCF_MBAR + 0x740 + ISC_DSPI_EOQF, /* ICR end */
2535 + .flags = IORESOURCE_MEM
2539 + .name = "spi-int-mask",
2540 + .start = MCF_MBAR + 0x70c, /* IMRL */
2541 + .end = MCF_MBAR + 0x70c, /* IMRL */
2542 + .flags = IORESOURCE_MEM
2546 +static struct platform_device coldfire_spi = {
2547 + .name = "spi_coldfire",
2549 + .resource = coldfire_spi_resources,
2550 + .num_resources = ARRAY_SIZE(coldfire_spi_resources),
2552 + .platform_data = &coldfire_master_info,
2557 + * m547x_8x_spi_init - Initialize SPI
2559 +static int __init m547x_8x_spi_init(void)
2563 + /* initialize the DSPI PAR */
2564 + MCF_GPIO_PAR_DSPI = (MCF_GPIO_PAR_DSPI_PAR_CS5 |
2565 + MCF_GPIO_PAR_DSPI_PAR_CS3_DSPICS |
2566 + MCF_GPIO_PAR_DSPI_PAR_CS2_DSPICS |
2567 + MCF_GPIO_PAR_DSPI_PAR_CS0_DSPICS |
2568 + MCF_GPIO_PAR_DSPI_PAR_SCK_SCK |
2569 + MCF_GPIO_PAR_DSPI_PAR_SIN_SIN |
2570 + MCF_GPIO_PAR_DSPI_PAR_SOUT_SOUT);
2572 + /* register device */
2573 + retval = platform_device_register(&coldfire_spi);
2578 + /* register board info */
2579 + if (ARRAY_SIZE(spi_board_info))
2580 + retval = spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
2589 + * m547x_8x_init_devices - Initialize M547X_8X devices
2591 + * Returns 0 on success.
2593 +static int __init m547x_8x_init_devices(void)
2596 + m547x_8x_spi_init();
2601 +arch_initcall(m547x_8x_init_devices);
2603 +++ b/arch/m68k/coldfire/m547x_8x-dma.c
2606 + * arch/m68k/coldfire/m547x_8x-dma.c
2608 + * Coldfire M547x/M548x DMA
2610 + * Copyright (c) 2008 Freescale Semiconductor, Inc.
2611 + * Kurt Mahan <kmahan@freescale.com>
2613 + * This code is based on patches from the Freescale M547x_8x BSP
2614 + * release mcf547x_8x-20070107-ltib.iso
2616 + * This program is free software; you can redistribute it and/or modify
2617 + * it under the terms of the GNU General Public License as published by
2618 + * the Free Software Foundation; either version 2 of the License, or
2619 + * (at your option) any later version.
2621 + * This program is distributed in the hope that it will be useful,
2622 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2623 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2624 + * GNU General Public License for more details.
2626 + * You should have received a copy of the GNU General Public License
2627 + * along with this program; if not, write to the Free Software
2628 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2630 +#include <linux/kernel.h>
2631 +#include <linux/sched.h>
2632 +#include <linux/mm.h>
2633 +#include <linux/init.h>
2634 +#include <linux/interrupt.h>
2635 +#include <asm/io.h>
2636 +#include <asm/irq.h>
2637 +#include <asm/dma.h>
2638 +#include <asm/coldfire.h>
2639 +#include <asm/m5485sram.h>
2640 +#include <asm/mcfsim.h>
2643 + * This global keeps track of which initiators have been
2644 + * used of the available assignments. Initiators 0-15 are
2645 + * hardwired. Initiators 16-31 are multiplexed and controlled
2646 + * via the Initiatior Mux Control Registe (IMCR). The
2647 + * assigned requestor is stored with the associated initiator
2650 +static int used_reqs[32] = {
2651 + DMA_ALWAYS, DMA_DSPI_RX, DMA_DSPI_TX, DMA_DREQ0,
2652 + DMA_PSC0_RX, DMA_PSC0_TX, DMA_USBEP0, DMA_USBEP1,
2653 + DMA_USBEP2, DMA_USBEP3, DMA_PCI_TX, DMA_PCI_RX,
2654 + DMA_PSC1_RX, DMA_PSC1_TX, DMA_I2C_RX, DMA_I2C_TX,
2662 + * This global keeps track of which channels have been assigned
2663 + * to tasks. This methology assumes that no single initiator
2664 + * will be tied to more than one task/channel
2666 +static char used_channel[16] = {
2667 + -1, -1, -1, -1, -1, -1, -1, -1,
2668 + -1, -1, -1, -1, -1, -1, -1, -1
2671 +unsigned int connected_channel[16] = {
2672 + 0, 0, 0, 0, 0, 0, 0, 0,
2673 + 0, 0, 0, 0, 0, 0, 0, 0
2677 + * dma_set_initiator - enable initiator
2678 + * @initiator: initiator identifier
2680 + * Returns 0 of successful, non-zero otherwise
2682 + * Attempt to enable the provided Initiator in the Initiator
2683 + * Mux Control Register.
2685 +int dma_set_initiator(int initiator)
2687 + switch (initiator) {
2705 + * These initiators are always active
2710 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC16(3))
2711 + | MCF_DMA_IMCR_SRC16_FEC0RX;
2712 + used_reqs[16] = DMA_FEC0_RX;
2716 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC17(3))
2717 + | MCF_DMA_IMCR_SRC17_FEC0TX;
2718 + used_reqs[17] = DMA_FEC0_TX;
2722 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC20(3))
2723 + | MCF_DMA_IMCR_SRC20_FEC1RX;
2724 + used_reqs[20] = DMA_FEC1_RX;
2728 + if (used_reqs[21] == 0) {
2729 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC21(3))
2730 + | MCF_DMA_IMCR_SRC21_FEC1TX;
2731 + used_reqs[21] = DMA_FEC1_TX;
2732 + } else if (used_reqs[25] == 0) {
2733 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC25(3))
2734 + | MCF_DMA_IMCR_SRC25_FEC1TX;
2735 + used_reqs[25] = DMA_FEC1_TX;
2736 + } else if (used_reqs[31] == 0) {
2737 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC31(3))
2738 + | MCF_DMA_IMCR_SRC31_FEC1TX;
2739 + used_reqs[31] = DMA_FEC1_TX;
2740 + } else /* No empty slots */
2745 + if (used_reqs[29] == 0) {
2746 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC29(3))
2747 + | MCF_DMA_IMCR_SRC29_DREQ1;
2748 + used_reqs[29] = DMA_DREQ1;
2749 + } else if (used_reqs[21] == 0) {
2750 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC21(3))
2751 + | MCF_DMA_IMCR_SRC21_DREQ1;
2752 + used_reqs[21] = DMA_DREQ1;
2753 + } else /* No empty slots */
2758 + if (used_reqs[24] == 0) {
2759 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC24(3))
2760 + | MCF_DMA_IMCR_SRC24_CTM0;
2761 + used_reqs[24] = DMA_CTM0;
2762 + } else /* No empty slots */
2767 + if (used_reqs[25] == 0) {
2768 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC25(3))
2769 + | MCF_DMA_IMCR_SRC25_CTM1;
2770 + used_reqs[25] = DMA_CTM1;
2771 + } else /* No empty slots */
2776 + if (used_reqs[26] == 0) {
2777 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC26(3))
2778 + | MCF_DMA_IMCR_SRC26_CTM2;
2779 + used_reqs[26] = DMA_CTM2;
2780 + } else /* No empty slots */
2785 + if (used_reqs[27] == 0) {
2786 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC27(3))
2787 + | MCF_DMA_IMCR_SRC27_CTM3;
2788 + used_reqs[27] = DMA_CTM3;
2789 + } else /* No empty slots */
2794 + if (used_reqs[28] == 0) {
2795 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC28(3))
2796 + | MCF_DMA_IMCR_SRC28_CTM4;
2797 + used_reqs[28] = DMA_CTM4;
2798 + } else /* No empty slots */
2803 + if (used_reqs[29] == 0) {
2804 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC29(3))
2805 + | MCF_DMA_IMCR_SRC29_CTM5;
2806 + used_reqs[29] = DMA_CTM5;
2807 + } else /* No empty slots */
2812 + if (used_reqs[30] == 0) {
2813 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC30(3))
2814 + | MCF_DMA_IMCR_SRC30_CTM6;
2815 + used_reqs[30] = DMA_CTM6;
2816 + } else /* No empty slots */
2821 + if (used_reqs[31] == 0) {
2822 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC31(3))
2823 + | MCF_DMA_IMCR_SRC31_CTM7;
2824 + used_reqs[31] = DMA_CTM7;
2825 + } else /* No empty slots */
2830 + if (used_reqs[26] == 0) {
2831 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC26(3))
2832 + | MCF_DMA_IMCR_SRC26_USBEP4;
2833 + used_reqs[26] = DMA_USBEP4;
2834 + } else /* No empty slots */
2839 + if (used_reqs[27] == 0) {
2840 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC27(3))
2841 + | MCF_DMA_IMCR_SRC27_USBEP5;
2842 + used_reqs[27] = DMA_USBEP5;
2843 + } else /* No empty slots */
2848 + if (used_reqs[28] == 0) {
2849 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC28(3))
2850 + | MCF_DMA_IMCR_SRC28_USBEP6;
2851 + used_reqs[28] = DMA_USBEP6;
2852 + } else /* No empty slots */
2857 + if (used_reqs[28] == 0) {
2858 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC28(3))
2859 + | MCF_DMA_IMCR_SRC28_PSC2RX;
2860 + used_reqs[28] = DMA_PSC2_RX;
2861 + } else /* No empty slots */
2866 + if (used_reqs[29] == 0) {
2867 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC29(3))
2868 + | MCF_DMA_IMCR_SRC29_PSC2TX;
2869 + used_reqs[29] = DMA_PSC2_TX;
2870 + } else /* No empty slots */
2875 + if (used_reqs[30] == 0) {
2876 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC30(3))
2877 + | MCF_DMA_IMCR_SRC30_PSC3RX;
2878 + used_reqs[30] = DMA_PSC3_RX;
2879 + } else /* No empty slots */
2884 + if (used_reqs[31] == 0) {
2885 + MCF_DMA_IMCR = (MCF_DMA_IMCR & ~MCF_DMA_IMCR_SRC31(3))
2886 + | MCF_DMA_IMCR_SRC31_PSC3TX;
2887 + used_reqs[31] = DMA_PSC3_TX;
2888 + } else /* No empty slots */
2899 + * dma_get_initiator - get the initiator for the given requestor
2900 + * @requestor: initiator identifier
2902 + * Returns initiator number (0-31) if assigned or just 0
2904 +unsigned int dma_get_initiator(int requestor)
2908 + for (i = 0; i < sizeof(used_reqs); ++i) {
2909 + if (used_reqs[i] == requestor)
2916 + * dma_remove_initiator - remove the given initiator from active list
2917 + * @requestor: requestor to remove
2919 +void dma_remove_initiator(int requestor)
2923 + for (i = 0; i < sizeof(used_reqs); ++i) {
2924 + if (used_reqs[i] == requestor) {
2925 + used_reqs[i] = -1;
2932 + * dma_set_channel_fec: find available channel for fec and mark
2933 + * @requestor: initiator/requestor identifier
2935 + * Returns first avaialble channel (0-5) or -1 if all occupied
2937 +int dma_set_channel_fec(int requestor)
2941 +#ifdef CONFIG_FEC_548x_ENABLE_FEC2
2947 + for (i = 0; i < t ; ++i) {
2948 + if (used_channel[i] == -1) {
2949 + used_channel[i] = requestor;
2953 + /* All channels taken */
2958 + * dma_set_channel - find an available channel and mark as used
2959 + * @requestor: initiator/requestor identifier
2961 + * Returns first available channel (6-15) or -1 if all occupied
2963 +int dma_set_channel(int requestor)
2966 +#ifdef CONFIG_NET_FEC2
2972 + for (; i < 16; ++i)
2973 + if (used_channel[i] == -1) {
2974 + used_channel[i] = requestor;
2978 + /* All channels taken */
2983 + * dma_get_channel - get the channel being initiated by the requestor
2984 + * @requestor: initiator/requestor identifier
2986 + * Returns Initiator for requestor or -1 if not found
2988 +int dma_get_channel(int requestor)
2992 + for (i = 0; i < sizeof(used_channel); ++i) {
2993 + if (used_channel[i] == requestor)
3000 + * dma_connect - connect a channel with reference on data
3001 + * @channel: channel number
3002 + * @address: reference address of data
3004 + * Returns 0 if success or -1 if invalid channel
3006 +int dma_connect(int channel, int address)
3008 + if ((channel < 16) && (channel >= 0)) {
3009 + connected_channel[channel] = address;
3016 + * dma_disconnect - disconnect a channel
3017 + * @channel: channel number
3019 + * Returns 0 if success or -1 if invalid channel
3021 +int dma_disconnect(int channel)
3023 + if ((channel < 16) && (channel >= 0)) {
3024 + connected_channel[channel] = 0;
3031 + * dma_remove_channel - remove channel from the active list
3032 + * @requestor: initiator/requestor identifier
3034 +void dma_remove_channel(int requestor)
3038 + for (i = 0; i < sizeof(used_channel); ++i) {
3039 + if (used_channel[i] == requestor) {
3040 + used_channel[i] = -1;
3047 + * dma_interrupt_handler - dma interrupt handler
3048 + * @irq: interrupt number
3051 + * Returns IRQ_HANDLED
3053 +irqreturn_t dma_interrupt_handler(int irq, void *dev_id)
3055 + u32 i, interrupts;
3058 + * Determine which interrupt(s) triggered by AND'ing the
3059 + * pending interrupts with those that aren't masked.
3061 + interrupts = MCF_DMA_DIPR;
3062 + MCF_DMA_DIPR = interrupts;
3064 + for (i = 0; i < 16; ++i, interrupts >>= 1) {
3065 + if (interrupts & 0x1)
3066 + if (connected_channel[i] != 0)
3067 + ((void (*)(void)) (connected_channel[i])) ();
3070 + return IRQ_HANDLED;
3074 + * dma_remove_channel_by_number - clear dma channel
3075 + * @channel: channel number to clear
3077 +void dma_remove_channel_by_number(int channel)
3079 + if ((channel < sizeof(used_channel)) && (channel >= 0))
3080 + used_channel[channel] = -1;
3084 + * dma_init - initialize the dma subsystem
3086 + * Returns 0 if success non-zero if failure
3088 + * Handles the DMA initialization during device setup.
3090 +int __devinit dma_init()
3093 + char *dma_version_str;
3095 + MCD_getVersion(&dma_version_str);
3096 + printk(KERN_INFO "m547x_8x DMA: Initialize %s\n", dma_version_str);
3098 + /* attempt to setup dma interrupt handler */
3099 + if (request_irq(64 + ISC_DMA, dma_interrupt_handler, IRQF_DISABLED,
3100 + "MCD-DMA", NULL)) {
3101 + printk(KERN_ERR "MCD-DMA: Cannot allocate the DMA IRQ(48)\n");
3106 + MCF_DMA_DIPR = 0xFFFFFFFF;
3108 + MCF_ICR(ISC_DMA) = ILP_DMA;
3110 + result = MCD_initDma((dmaRegs *) (MCF_MBAR + 0x8000),
3111 + (void *) SYS_SRAM_DMA_START, MCD_RELOC_TASKS);
3112 + if (result != MCD_OK) {
3113 + printk(KERN_ERR "MCD-DMA: Cannot perform DMA initialization\n");
3114 + free_irq(64 + ISC_DMA, NULL);
3120 +device_initcall(dma_init);
3122 +++ b/arch/m68k/coldfire/Makefile
3125 +# Makefile for Linux arch/m68k/coldfire source directory
3128 +obj-y:= entry.o config.o cache.o signal.o muldi3.o traps.o ints.o
3129 +ifdef CONFIG_M5445X
3130 +ifneq ($(strip $(CONFIG_USB) $(CONFIG_USB_GADGET_MCF5445X)),)
3131 + obj-y += usb.o usb/
3135 +ifdef CONFIG_M547X_8X
3136 +obj-$(CONFIG_PCI) += mcf548x-pci.o
3138 +obj-$(CONFIG_PCI) += pci.o mcf5445x-pci.o iomap.o
3140 +obj-$(CONFIG_M5445X) += mcf5445x-devices.o
3141 +obj-$(CONFIG_M547X_8X) += m547x_8x-devices.o
3142 +obj-$(CONFIG_M547X_8X) += mcf548x-devices.o
3143 +obj-$(CONFIG_MCD_DMA) += m547x_8x-dma.o
3145 +++ b/arch/m68k/coldfire/mcf5445x-devices.c
3148 + * arch/m68k/coldfire/mcf5445x-devices.c
3150 + * Coldfire M5445x Platform Device Configuration
3152 + * Based on the Freescale MXC devices.c
3154 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
3155 + * Kurt Mahan <kmahan@freescale.com>
3157 +#include <linux/module.h>
3158 +#include <linux/kernel.h>
3159 +#include <linux/init.h>
3160 +#include <linux/platform_device.h>
3161 +#include <linux/fsl_devices.h>
3163 +#include <asm/coldfire.h>
3164 +#include <asm/mcfsim.h>
3166 +/* ATA Interrupt */
3167 +#define IRQ_ATA (64 + 64 + 54)
3170 +#define BASE_IO_ATA 0x90000000
3172 +#define ATA_IER MCF_REG08(BASE_IO_ATA+0x2c) /* int enable reg */
3173 +#define ATA_ICR MCF_REG08(BASE_IO_ATA+0x30) /* int clear reg */
3178 +#if defined(CONFIG_PATA_FSL) || defined(CONFIG_PATA_FSL_MODULE)
3179 +static int ata_init(struct platform_device *pdev)
3185 + /* setup shared pins */
3186 + MCF_GPIO_PAR_FEC = (MCF_GPIO_PAR_FEC & MCF_GPIO_PAR_FEC_FEC1_MASK) |
3187 + MCF_GPIO_PAR_FEC_FEC1_ATA;
3189 + MCF_GPIO_PAR_FECI2C = (MCF_GPIO_PAR_FECI2C &
3190 + (MCF_GPIO_PAR_FECI2C_MDC1_MASK &
3191 + MCF_GPIO_PAR_FECI2C_MDIO1_MASK)) |
3192 + MCF_GPIO_PAR_FECI2C_MDC1_ATA_DIOR |
3193 + MCF_GPIO_PAR_FECI2C_MDIO1_ATA_DIOW;
3195 + MCF_GPIO_PAR_ATA = MCF_GPIO_PAR_ATA_BUFEN |
3196 + MCF_GPIO_PAR_ATA_CS1 |
3197 + MCF_GPIO_PAR_ATA_CS0 |
3198 + MCF_GPIO_PAR_ATA_DA2 |
3199 + MCF_GPIO_PAR_ATA_DA1 |
3200 + MCF_GPIO_PAR_ATA_DA0 |
3201 + MCF_GPIO_PAR_ATA_RESET_RESET |
3202 + MCF_GPIO_PAR_ATA_DMARQ_DMARQ |
3203 + MCF_GPIO_PAR_ATA_IORDY_IORDY;
3205 + MCF_GPIO_PAR_PCI = (MCF_GPIO_PAR_PCI &
3206 + (MCF_GPIO_PAR_PCI_GNT3_MASK &
3207 + MCF_GPIO_PAR_PCI_REQ3_MASK)) |
3208 + MCF_GPIO_PAR_PCI_GNT3_ATA_DMACK |
3209 + MCF_GPIO_PAR_PCI_REQ3_ATA_INTRQ;
3214 +static void ata_exit(void)
3216 + printk(KERN_INFO "** ata_exit\n");
3219 +static int ata_get_clk_rate(void)
3221 + return MCF_BUSCLK;
3224 +/* JKM -- move these to a header file */
3225 +#define MCF_IDE_DMA_WATERMARK 32 /* DMA watermark level in bytes */
3226 +#define MCF_IDE_DMA_BD_NR (512/3/4) /* number of BDs per channel */
3228 +static struct fsl_ata_platform_data ata_data = {
3231 + .get_clk_rate = ata_get_clk_rate,
3232 +#ifdef CONFIG_PATA_FSL_USE_DMA
3233 + .udma_mask = 0x0F, /* the board handles up to UDMA3 */
3234 + .fifo_alarm = MCF_IDE_DMA_WATERMARK / 2,
3235 + .max_sg = MCF_IDE_DMA_BD_NR,
3239 +static struct resource pata_fsl_resources[] = {
3241 + .start = BASE_IO_ATA,
3242 + .end = BASE_IO_ATA + 0x000000d8,
3243 + .flags = IORESOURCE_MEM,
3248 + .flags = IORESOURCE_IRQ,
3252 +static struct platform_device pata_fsl_device = {
3253 + .name = "pata_fsl",
3255 + .num_resources = ARRAY_SIZE(pata_fsl_resources),
3256 + .resource = pata_fsl_resources,
3258 + .platform_data = &ata_data,
3259 + .coherent_dma_mask = ~0, /* $$$ REVISIT */
3263 +static inline void mcf5445x_init_pata(void)
3265 + (void)platform_device_register(&pata_fsl_device);
3268 +static inline void mcf5445x_init_pata(void)
3273 +static int __init mcf5445x_init_devices(void)
3275 + printk(KERN_INFO "MCF5445x INIT_DEVICES\n");
3277 + mcf5445x_init_pata();
3282 +arch_initcall(mcf5445x_init_devices);
3284 +++ b/arch/m68k/coldfire/mcf5445x-pci.c
3287 + * arch/m68k/coldfire/mcf5445x-pci.c
3289 + * Coldfire M5445x specific PCI implementation.
3291 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
3292 + * Kurt Mahan <kmahan@freescale.com>
3295 +#include <linux/delay.h>
3296 +#include <linux/interrupt.h>
3297 +#include <linux/pci.h>
3299 +#include <asm/mcfsim.h>
3300 +#include <asm/pci.h>
3301 +#include <asm/irq.h>
3304 + * Layout MCF5445x to PCI memory mappings:
3306 + * WIN MCF5445x PCI TYPE
3307 + * --- -------- --- ----
3308 + * [0] 0xA0000000 -> 0xA7FFFFFF 0xA0000000 -> 0xA7FFFFFF MEM
3309 + * [1] 0xA8000000 -> 0xABFFFFFF 0xA8000000 -> 0xABFFFFFF MEM
3310 + * [2] 0xAC000000 -> 0xAFFFFFFF 0xAC000000 -> 0xAFFFFFFF IO
3313 +#define MCF5445X_PCI_MEM_BASE 0xA0000000
3314 +#define MCF5445X_PCI_MEM_SIZE 0x0C000000
3316 +#define MCF5445X_PCI_CONFIG_BASE 0xAC000000
3317 +#define MCF5445X_PCI_CONFIG_SIZE 0x04000000
3319 +#define MCF5445X_PCI_IO_BASE 0xAC000000
3320 +#define MCF5445X_PCI_IO_SIZE 0x04000000
3322 +/* PCI Bus memory resource block */
3323 +struct resource pci_iomem_resource = {
3324 + .name = "PCI memory space",
3325 + .start = MCF5445X_PCI_MEM_BASE,
3326 + .flags = IORESOURCE_MEM,
3327 + .end = MCF5445X_PCI_MEM_BASE + MCF5445X_PCI_MEM_SIZE - 1
3330 +/* PCI Bus ioport resource block */
3331 +struct resource pci_ioport_resource = {
3332 + .name = "PCI I/O space",
3333 + .start = MCF5445X_PCI_IO_BASE,
3334 + .flags = IORESOURCE_IO,
3335 + .end = MCF5445X_PCI_IO_BASE + MCF5445X_PCI_IO_SIZE - 1
3339 + * The M54455EVB multiplexes all the PCI interrupts via
3340 + * the FPGA and routes them to a single interrupt. The
3341 + * PCI spec requires all PCI interrupt routines be smart
3342 + * enough to sort out their own interrupts.
3343 + * The interrupt source from the FPGA is configured
3346 +#define MCF5445X_PCI_IRQ 0x43
3348 +#define PCI_SLOTS 4
3353 +#define FPGA_PCI_IRQ_ENABLE (u32 *)0x09000000
3354 +#define FPGA_PCI_IRQ_STATUS (u32 *)0x09000004
3355 +#define FPGA_PCI_IRQ_ROUTE (u32 *)0x0900000c
3356 +#define FPGA_SEVEN_LED (u32 *)0x09000014
3358 +extern void set_fpga(u32 *addr, u32 val);
3361 +void mcf5445x_pci_dumpregs(void);
3365 + * mcf5445x_conf_device(struct pci_dev *dev)
3367 + * Machine dependent Configure the given device.
3371 + * dev - the pci device.
3374 +mcf5445x_conf_device(struct pci_dev *dev)
3376 + set_fpga(FPGA_PCI_IRQ_ENABLE, 0x0f);
3380 + * int mcf5445x_pci_config_read(unsigned int seg, unsigned int bus,
3381 + * unsigned int devfn, int reg,
3384 + * Read from PCI configuration space.
3387 +int mcf5445x_pci_config_read(unsigned int seg, unsigned int bus,
3388 + unsigned int devfn, int reg, int len, u32 *value)
3390 + u32 addr = MCF_PCI_PCICAR_BUSNUM(bus) |
3391 + MCF_PCI_PCICAR_DEVNUM(PCI_SLOT(devfn)) |
3392 + MCF_PCI_PCICAR_FUNCNUM(PCI_FUNC(devfn)) |
3393 + MCF_PCI_PCICAR_DWORD(reg) |
3396 + if ((bus > 255) || (devfn > 255) || (reg > 255)) {
3401 + /* setup for config mode */
3402 + MCF_PCI_PCICAR = addr;
3403 + __asm__ __volatile__("nop");
3407 + *value = *(volatile u8 *)(MCF5445X_PCI_CONFIG_BASE+(reg&3));
3410 + *value = le16_to_cpu(*(volatile u16 *)
3411 + (MCF5445X_PCI_CONFIG_BASE + (reg&2)));
3414 + *value = le32_to_cpu(*(volatile u32 *)
3415 + (MCF5445X_PCI_CONFIG_BASE));
3419 + /* clear config mode */
3420 + MCF_PCI_PCICAR = ~MCF_PCI_PCICAR_E;
3421 + __asm__ __volatile__("nop");
3427 + * int mcf5445x_pci_config_write(unsigned int seg, unsigned int bus,
3428 + * unsigned int devfn, int reg,
3431 + * Write to PCI configuration space
3433 +int mcf5445x_pci_config_write(unsigned int seg, unsigned int bus,
3434 + unsigned int devfn, int reg, int len, u32 value)
3436 + u32 addr = MCF_PCI_PCICAR_BUSNUM(bus) |
3437 + MCF_PCI_PCICAR_DEVNUM(PCI_SLOT(devfn)) |
3438 + MCF_PCI_PCICAR_FUNCNUM(PCI_FUNC(devfn)) |
3439 + MCF_PCI_PCICAR_DWORD(reg) |
3442 + if ((bus > 255) || (devfn > 255) || (reg > 255))
3445 + /* setup for config mode */
3446 + MCF_PCI_PCICAR = addr;
3447 + __asm__ __volatile__("nop");
3451 + *(volatile u8 *)(MCF5445X_PCI_CONFIG_BASE+(reg&3)) = (u8)value;
3454 + *(volatile u16 *)(MCF5445X_PCI_CONFIG_BASE+(reg&2)) =
3455 + cpu_to_le16((u16)value);
3458 + *(volatile u32 *)(MCF5445X_PCI_CONFIG_BASE) =
3459 + cpu_to_le32(value);
3463 + /* clear config mode */
3464 + MCF_PCI_PCICAR = ~MCF_PCI_PCICAR_E;
3465 + __asm__ __volatile__("nop");
3470 +/* hardware operations */
3471 +static struct pci_raw_ops mcf5445x_pci_ops = {
3472 + .read = mcf5445x_pci_config_read,
3473 + .write = mcf5445x_pci_config_write,
3477 + * irqreturn_t mcf5445x_pci_interrupt( int irq, void *dev)
3479 + * PCI controller interrupt handler.
3482 +mcf5445x_pci_interrupt(int irq, void *dev)
3484 + u32 status = MCF_PCI_PCIGSCR;
3486 + printk(KERN_INFO "PCI: Controller irq status=0x%08x\n", status);
3489 + MCF_PCI_PCIGSCR = status;
3491 + return IRQ_HANDLED;
3495 + * irqreturn_t mcf5445x_pci_arb_interrupt( int irq, void *dev)
3497 + * PCI Arbiter interrupt handler.
3500 +mcf5445x_pci_arb_interrupt(int irq, void *dev)
3502 + u32 status = MCF_PCIARB_PASR;
3504 + printk(KERN_INFO "PCI: Arbiter irq status=0x%08x\n", status);
3507 + MCF_PCIARB_PASR = status;
3508 + return IRQ_HANDLED;
3512 + * struct pci_bus_info *init_mcf5445x_pci(void)
3514 + * Machine specific initialisation:
3516 + * - Allocate and initialise a 'pci_bus_info' structure
3517 + * - Initialize hardware
3519 + * Result: pointer to 'pci_bus_info' structure.
3522 +init_mcf5445x_pci(void)
3527 + * Initialize the PCI core
3530 + /* arbitration controller */
3531 + MCF_PCIARB_PACR = MCF_PCIARB_PACR_INTMPRI |
3532 + MCF_PCIARB_PACR_EXTMPRI(0x0f) |
3533 + MCF_PCIARB_PACR_INTMINTEN |
3534 + MCF_PCIARB_PACR_EXTMINTEN(0x0f);
3536 + /* pci pin assignment regs */
3537 + MCF_GPIO_PAR_PCI = MCF_GPIO_PAR_PCI_GNT0 |
3538 + MCF_GPIO_PAR_PCI_GNT1 |
3539 + MCF_GPIO_PAR_PCI_GNT2 |
3540 + MCF_GPIO_PAR_PCI_GNT3_GNT3 |
3541 + MCF_GPIO_PAR_PCI_REQ0 |
3542 + MCF_GPIO_PAR_PCI_REQ1 |
3543 + MCF_GPIO_PAR_PCI_REQ2 |
3544 + MCF_GPIO_PAR_PCI_REQ3_REQ3;
3546 + /* target control reg */
3547 + MCF_PCI_PCITCR = MCF_PCI_PCITCR_P |
3548 + MCF_PCI_PCITCR_WCT(8);
3550 + /* PCI MEM address */
3551 + MCF_PCI_PCIIW0BTAR = 0xA007A000;
3553 + /* PCI MEM address */
3554 + MCF_PCI_PCIIW1BTAR = 0xA803A800;
3556 + /* PCI IO address */
3557 + MCF_PCI_PCIIW2BTAR = 0xAC03AC00;
3559 + /* window control */
3560 + MCF_PCI_PCIIWCR = MCF_PCI_PCIIWCR_WINCTRL0_ENABLE |
3561 + MCF_PCI_PCIIWCR_WINCTRL0_MEMREAD |
3562 + MCF_PCI_PCIIWCR_WINCTRL1_ENABLE |
3563 + MCF_PCI_PCIIWCR_WINCTRL1_MEMREAD |
3564 + MCF_PCI_PCIIWCR_WINCTRL2_ENABLE |
3565 + MCF_PCI_PCIIWCR_WINCTRL2_IO;
3567 + /* initiator control reg */
3568 + MCF_PCI_PCIICR = 0x00ff;
3570 + /* type 0 - command */
3571 + MCF_PCI_PCISCR = MCF_PCI_PCISCR_MW | /* mem write/inval */
3572 + MCF_PCI_PCISCR_B | /* bus master enable */
3573 + MCF_PCI_PCISCR_M; /* mem access enable */
3575 + /* type 0 - config reg */
3576 + MCF_PCI_PCICR1 = MCF_PCI_PCICR1_CACHELINESIZE(8) |
3577 + MCF_PCI_PCICR1_LATTIMER(0xff);
3579 + /* type 0 - config 2 reg */
3580 + MCF_PCI_PCICR2 = 0;
3582 + /* target control reg */
3583 + MCF_PCI_PCITCR2 = MCF_PCI_PCITCR2_B0E |
3584 + MCF_PCI_PCITCR2_B4E;
3586 + /* translate addresses from PCI[0] to CF[SDRAM] */
3587 + MCF_PCI_PCITBATR0 = MCF_RAMBAR1 | MCF_PCI_PCITBATR0_EN;
3588 + MCF_PCI_PCITBATR4 = MCF_RAMBAR1 | MCF_PCI_PCITBATR4_EN;
3590 + /* setup controller interrupt handlers */
3591 + if (request_irq(55+128, mcf5445x_pci_interrupt, IRQF_SHARED,
3592 + "PCI Controller", NULL))
3593 + printk(KERN_ERR "PCI: Unable to register controller irq\n");
3595 + if (request_irq (56+128, mcf5445x_pci_arb_interrupt, IRQF_SHARED, "PCI Arbiter", NULL))
3596 + printk(KERN_ERR "PCI: Unable to register arbiter irq\n");
3598 + /* global control - clear reset bit */
3599 + MCF_PCI_PCIGSCR = MCF_PCI_PCIGSCR_SEE |
3600 + MCF_PCI_PCIGSCR_PEE;
3602 + /* let everything settle */
3605 + /* allocate bus ioport resource */
3606 + if (request_resource(&ioport_resource, &pci_ioport_resource) < 0)
3607 + printk(KERN_ERR "PCI: Unable to alloc ioport resource\n");
3609 + /* allocate bus iomem resource */
3610 + if (request_resource(&iomem_resource, &pci_iomem_resource) < 0)
3611 + printk(KERN_ERR "PCI: Unable to alloc iomem resource\n");
3613 + /* setup FPGA to route PCI to IRQ3(67), SW7 to IRQ7, SW6 to IRQ4 */
3614 + set_fpga(FPGA_PCI_IRQ_ENABLE, 0x00000000);
3615 + set_fpga(FPGA_PCI_IRQ_ROUTE, 0x00000039);
3616 + set_fpga(FPGA_SEVEN_LED, 0x000000FF);
3618 + raw_pci_ops = &mcf5445x_pci_ops;
3634 +struct regdump type0regs[] = {
3635 + { 0xfc0a8000, "PCIIDR" },
3636 + { 0xfc0a8004, "PCISCR" },
3637 + { 0xfc0a8008, "PCICCRIR" },
3638 + { 0xfc0a800c, "PCICR1" },
3639 + { 0xfc0a8010, "PCIBAR0" },
3640 + { 0xfc0a8014, "PCIBAR1" },
3641 + { 0xfc0a8018, "PCIBAR2" },
3642 + { 0xfc0a801c, "PCIBAR3" },
3643 + { 0xfc0a8020, "PCIBAR4" },
3644 + { 0xfc0a8024, "PCIBAR5" },
3645 + { 0xfc0a8028, "PCICCPR" },
3646 + { 0xfc0a802c, "PCISID" },
3647 + { 0xfc0a8030, "PCIERBAR" },
3648 + { 0xfc0a8034, "PCICPR" },
3649 + { 0xfc0a803c, "PCICR2" },
3653 +struct regdump genregs[] = {
3654 + { 0xfc0a8060, "PCIGSCR" },
3655 + { 0xfc0a8064, "PCITBATR0" },
3656 + { 0xfc0a8068, "PCITBATR1" },
3657 + { 0xfc0a806c, "PCITCR1" },
3658 + { 0xfc0a8070, "PCIIW0BTAR" },
3659 + { 0xfc0a8074, "PCIIW1BTAR" },
3660 + { 0xfc0a8078, "PCIIW2BTAR" },
3661 + { 0xfc0a8080, "PCIIWCR" },
3662 + { 0xfc0a8084, "PCIICR" },
3663 + { 0xfc0a8088, "PCIISR" },
3664 + { 0xfc0a808c, "PCITCR2" },
3665 + { 0xfc0a8090, "PCITBATR0" },
3666 + { 0xfc0a8094, "PCITBATR1" },
3667 + { 0xfc0a8098, "PCITBATR2" },
3668 + { 0xfc0a809c, "PCITBATR3" },
3669 + { 0xfc0a80a0, "PCITBATR4" },
3670 + { 0xfc0a80a4, "PCITBATR5" },
3671 + { 0xfc0a80a8, "PCIINTR" },
3672 + { 0xfc0a80f8, "PCICAR" },
3676 +struct regdump arbregs[] = {
3677 + { 0xfc0ac000, "PACR" },
3678 + { 0xfc0ac004, "PASR" }, /* documentation error */
3683 + * void mcf5445x_pci_dumpregs()
3685 + * Dump out all the PCI registers
3688 +mcf5445x_pci_dumpregs(void)
3690 + struct regdump *reg;
3692 + printk(KERN_INFO "*** MCF5445x PCI TARGET 0 REGISTERS ***\n");
3695 + while (reg->addr) {
3696 + printk(KERN_INFO "0x%08x 0x%08x %s\n", reg->addr,
3697 + *((u32 *)reg->addr), reg->regname);
3701 + printk(KERN_INFO "\n*** MCF5445x PCI GENERAL REGISTERS ***\n");
3703 + while (reg->addr) {
3704 + printk(KERN_INFO "0x%08x 0x%08x %s\n", reg->addr,
3705 + *((u32 *)reg->addr), reg->regname);
3708 + printk(KERN_INFO "\n*** MCF5445x PCI ARBITER REGISTERS ***\n");
3710 + while (reg->addr) {
3711 + printk(KERN_INFO "0x%08x 0x%08x %s\n", reg->addr,
3712 + *((u32 *)reg->addr), reg->regname);
3718 +++ b/arch/m68k/coldfire/mcf548x-devices.c
3721 + * arch/m68k/coldfire/mcf5445x-devices.c
3723 + * Coldfire M5445x Platform Device Configuration
3725 + * Based on the Freescale MXC devices.c
3727 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
3728 + * Kurt Mahan <kmahan@freescale.com>
3730 +#include <linux/module.h>
3731 +#include <linux/kernel.h>
3732 +#include <linux/init.h>
3733 +#include <linux/mtd/physmap.h>
3734 +#include <linux/platform_device.h>
3735 +#include <linux/fsl_devices.h>
3737 +#include <asm/coldfire.h>
3738 +#include <asm/mcfsim.h>
3740 +static struct resource coldfire_i2c_resources[] = {
3742 + .start = MCF_MBAR + 0x008F00,
3743 + .end = MCF_MBAR + 0x008F20,
3744 + .flags = IORESOURCE_MEM,
3749 + .flags = IORESOURCE_IRQ,
3753 +static struct platform_device coldfire_i2c_device = {
3754 + .name = "MCF548X-i2c",
3756 + .num_resources = ARRAY_SIZE(coldfire_i2c_resources),
3757 + .resource = coldfire_i2c_resources,
3760 +static struct resource coldfire_sec_resources[] = {
3762 + .start = MCF_MBAR + 0x00020000,
3763 + .end = MCF_MBAR + 0x00033000,
3764 + .flags = IORESOURCE_MEM,
3769 + .flags = IORESOURCE_IRQ,
3773 +static struct platform_device coldfire_sec_device = {
3774 + .name = "fsl-sec1",
3776 + .num_resources = ARRAY_SIZE(coldfire_sec_resources),
3777 + .resource = coldfire_sec_resources,
3780 +#if defined(CONFIG_MTD_PHYSMAP)
3781 +static struct physmap_flash_data mcf5485_flash_data = {
3785 +static struct resource mcf5485_flash_resource = {
3786 + .start = 0xf8000000,
3787 + .end = 0xf80fffff,
3788 + .flags = IORESOURCE_MEM,
3791 +static struct platform_device mcf5485_flash_device = {
3792 + .name = "physmap-flash",
3795 + .platform_data = &mcf5485_flash_data,
3797 + .num_resources = 1,
3798 + .resource = &mcf5485_flash_resource,
3802 +static int __init mcf5485_init_devices(void)
3804 + printk(KERN_INFO "MCF5485x INIT_DEVICES\n");
3806 + platform_device_register(&coldfire_i2c_device);
3807 + platform_device_register(&coldfire_sec_device);
3808 +/*#if defined(CONFIG_MTD_PHYSMAP)
3809 + platform_device_register(&mcf5485_flash_device);
3813 +arch_initcall(mcf5485_init_devices);
3815 +++ b/arch/m68k/coldfire/mcf548x-pci.c
3818 + * ColdFire 547x/548x PCI Host Controller functions
3820 + * Copyright (c) 2005-2008 Freescale Semiconductor, Inc.
3822 + * This code is based on the 2.6.10 version of pci.c
3824 + * This program is free software; you can redistribute it and/or modify
3825 + * it under the terms of the GNU General Public License as published by
3826 + * the Free Software Foundation; either version 2 of the License, or
3827 + * (at your option) any later version.
3829 + * This program is distributed in the hope that it will be useful,
3830 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3831 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3832 + * GNU General Public License for more details.
3834 + * You should have received a copy of the GNU General Public License
3835 + * along with this program; if not, write to the Free Software
3836 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3838 +#include <linux/kernel.h>
3839 +#include <linux/types.h>
3840 +#include <linux/init.h>
3841 +#include <linux/mm.h>
3842 +#include <linux/string.h>
3843 +#include <linux/pci.h>
3844 +#include <linux/ioport.h>
3845 +#include <linux/slab.h>
3846 +#include <linux/version.h>
3847 +#include <linux/interrupt.h>
3849 +#include <linux/dma-mapping.h>
3850 +#include <asm/coldfire.h>
3851 +#include <asm/io.h>
3852 +#include <asm/m5485sim.h>
3853 +#include <asm/m5485pci.h>
3854 +#include <asm/irq.h>
3855 +#include <asm/pci.h>
3856 +#include <asm/virtconvert.h>
3863 +//#define DBG(x...) printk(KERN_DEBUG x)
3864 +#define DBG(x...) printk(x)
3869 +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,75))
3870 +# define irqreturn_t void
3871 +# define IRQ_HANDLED
3876 + * Bridge configration dafaults
3878 +#define PCI_RETRIES 0
3879 +#define PCI_CACHE_LINE 8
3880 +#define PCI_MINGNT 1
3881 +#define PCI_MAXLAT 42
3885 + * Initiator windows setting
3887 +#define HOST_MEM_BASE 0xD0000000 /* ColdFire Memory window base */
3888 +#define PCI_MEM_BASE 0xD0000000 /* PCI Memory window base */
3889 +#define PCI_MEM_SIZE 0x08000000 /* Memory window size (128M) */
3890 +#define HOST_IO_BASE 0xD8000000 /* ColdFire I/O window base */
3891 +#define PCI_IO_BASE_ADDR 0x00000000 /* PCI I/O window base */
3892 +#define PCI_IO_SIZE 0x00010000 /* I/O window size (64K) */
3893 +#define HOST_CFG_BASE 0xD8000000 /* ColdFire config window base */
3894 +#define HOST_DMA_BASE CONFIG_SDRAM_BASE /* ColdFire PCI-DMA window base */
3895 +#define PCI_HDR_BASE (MCF_MBAR+0xB00)/* ColdFire config registers */
3897 +#define PCI_MEM_MASK (PCI_MEM_SIZE-1)
3898 +#define PCI_IO_MASK (PCI_IO_SIZE-1)
3900 +/* Macro to set initiator window */
3901 +#define WxBAR(host_address, pci_address, size) \
3902 + (((host_address) & 0xff000000) | \
3903 + ((((size)-1) & 0xff000000) >> 8) | \
3904 + ((pci_address) & 0xff000000) >> 16)
3907 + * BIOS internal data
3909 +static u8 revision; /* controller revision */
3912 + * Board specific setting
3914 +const unsigned int irq_lines[] = { 5, 7 };
3916 +#define N_SLOTS (sizeof(board_info) / sizeof(board_info[0]))
3917 +#define N_IRQS (sizeof(irq_lines) / sizeof(irq_lines[0]))
3918 +#define BRIDGE_SLOT 0
3920 +const struct slotinfo {
3921 + unsigned char idsel; /* device number */
3922 + unsigned char irq; /* external IRQ */
3923 + unsigned char req; /* REQ line number */
3924 + unsigned char gnt; /* GNT line number */
3926 + {0, 0, 0, 0}, /* Bridge */
3927 + {17, 5, 1, 1}, /* Slot #1 */
3928 + {18, 5, 2, 2}, /* Slot #2 */
3929 + {20, 7, 3, 3}, /* Slot #3 */
3930 + {21, 7, 4, 4}, /* Slot #4 */
3933 +/************************************************************************/
3936 + * static int mk_conf_addr()
3938 + * Return type0 or type1 configuration address
3939 + * by the means of device address and PCI dword location
3940 + * 0 - for not existing slots
3942 +static int mk_conf_addr(/*struct pci_dev *dev*/struct pci_bus *bus, unsigned int devfn, int where)
3944 + int slot, func, address, idsel, dev_fn;
3946 + if (bus->number) {
3947 + address = MCF_PCICAR_E | (bus->number << 16) |
3948 + (devfn << 8) | (where & 0xfc);
3950 + slot = PCI_SLOT(devfn);
3951 + if (slot > N_SLOTS || slot == BRIDGE_SLOT)
3954 + func = PCI_FUNC(devfn);
3955 + idsel = board_info[slot].idsel;
3957 + dev_fn = PCI_DEVFN(idsel, func);
3958 + address = MCF_PCICAR_E | (bus->number << 16) |
3959 + (dev_fn << 8) | (where & 0xfc);
3967 + * static int read_config_byte()
3969 + * Read a byte from configuration space of specified device
3971 +static int read_config_byte(/*struct pci_dev *dev*/struct pci_bus *bus, unsigned int devfn, int where, u8 *value)
3978 + result = PCIBIOS_SUCCESSFUL;
3980 + slot = PCI_SLOT(devfn);
3981 + if (slot == BRIDGE_SLOT) {
3982 + if (where <= 0x40)
3983 + *value = *(volatile u8 *) (PCI_HDR_BASE + (where ^ 3));
3987 + address = mk_conf_addr(bus, devfn, where);
3989 + result = PCIBIOS_DEVICE_NOT_FOUND;
3991 + MCF_PCICAR = address;
3992 + *value = *(volatile u8 *) (HOST_CFG_BASE + (where & 3));
3995 + __asm__ __volatile__("nop");
3996 + __asm__ __volatile__("nop");
3997 + MCF_PCICAR &= ~MCF_PCICAR_E;
3999 + DBG("PCI: read_config_byte bus=%d, devfn=%d, addr=0x%02X, val=0x%02X, ret=%02X\n",
4000 + bus->number, devfn, where, *value, result);
4006 + * static int read_config_word()
4008 + * Read a word from configuration space of specified device
4010 +static int read_config_word(/*struct pci_dev *dev*/struct pci_bus *bus, unsigned int devfn, int where, u16 *value)
4017 + result = PCIBIOS_SUCCESSFUL;
4020 + result = PCIBIOS_BAD_REGISTER_NUMBER;
4022 + slot = PCI_SLOT(devfn);
4023 + if (slot == BRIDGE_SLOT) {
4024 + if (where <= 0x3f)
4026 + *(volatile u16 *) (PCI_HDR_BASE +
4031 + address = mk_conf_addr(bus, devfn, where);
4033 + result = PCIBIOS_DEVICE_NOT_FOUND;
4035 + MCF_PCICAR = address;
4036 + *value = le16_to_cpu(*(volatile u16 *)
4042 + __asm__ __volatile__("nop");
4043 + __asm__ __volatile__("nop");
4044 + MCF_PCICAR &= ~MCF_PCICAR_E;
4046 + DBG("PCI: read_config_word bus=%d, devfn=%d, addr=0x%02X, val=0x%04X ret=%02X\n",
4047 + bus->number, devfn, where, *value, result);
4053 + * static int read_config_dword()
4055 + * Read a long word from configuration space of specified device
4057 +static int read_config_dword(/*struct pci_dev *dev*/struct pci_bus *bus, unsigned int devfn, int where, u32 *value)
4063 + *value = 0xffffffff;
4064 + result = PCIBIOS_SUCCESSFUL;
4067 + result = PCIBIOS_BAD_REGISTER_NUMBER;
4069 + slot = PCI_SLOT(devfn);
4070 + if (slot == BRIDGE_SLOT) {
4071 + if (where <= 0x3d)
4073 + *(volatile u32 *) (PCI_HDR_BASE + where);
4076 + __asm__ __volatile__("nop");
4077 + __asm__ __volatile__("nop");
4079 + address = mk_conf_addr(bus, devfn, where);
4081 + result = PCIBIOS_DEVICE_NOT_FOUND;
4083 + MCF_PCICAR = address;
4084 + *value = le32_to_cpu(*(volatile u32 *)
4086 + __asm__ __volatile__("nop");
4087 + __asm__ __volatile__("nop");
4088 + if (bus->number != 0 && revision < 1) {
4089 + volatile u32 temp;
4091 + MCF_PCICAR |= 0xff0000;
4092 + temp = *(volatile u32 *) (HOST_CFG_BASE);
4098 + MCF_PCICAR &= ~MCF_PCICAR_E;
4100 + DBG("PCI: read_config_dword bus=%d, devfn=%d, addr=0x%02X, value=0x%08X ret=%02X\n",
4101 + bus->number, devfn, where, *value, result);
4107 + * static int write_config_byte()
4109 + * Write a byte to configuration space of specified device
4111 +static int write_config_byte(/*struct pci_dev *dev*/struct pci_bus *bus, unsigned int devfn, int where, u8 value)
4117 + result = PCIBIOS_SUCCESSFUL;
4119 + slot = PCI_SLOT(devfn);
4120 + if (slot == BRIDGE_SLOT) {
4121 + if (where <= 0x40)
4122 + *(volatile u8 *) (PCI_HDR_BASE + (where ^ 3)) = value;
4124 + address = mk_conf_addr(bus, devfn, where);
4126 + result = PCIBIOS_DEVICE_NOT_FOUND;
4128 + MCF_PCICAR = address;
4129 + *(volatile u8 *) (HOST_CFG_BASE + (where & 3)) = value;
4132 + __asm__ __volatile__("nop");
4133 + __asm__ __volatile__("nop");
4134 + MCF_PCICAR &= ~MCF_PCICAR_E;
4136 + DBG("PCI: write_config_byte bus=%d, devfn=%d, addr=0x%02X, value=0x%02X ret=%02X\n",
4137 + bus->number, devfn, where, value, result);
4143 + * static int write_config_word()
4145 + * Write a word to configuration space of specified device
4147 +static int write_config_word(/*struct pci_dev *dev*/struct pci_bus *bus, unsigned int devfn, int where, u16 value)
4153 + result = PCIBIOS_SUCCESSFUL;
4156 + result = PCIBIOS_BAD_REGISTER_NUMBER;
4158 + slot = PCI_SLOT(devfn);
4159 + if (slot == BRIDGE_SLOT) {
4160 + if (where <= 0x3f)
4161 + *(volatile u16 *) (PCI_HDR_BASE + (where ^ 2)) =
4164 + address = mk_conf_addr(bus, devfn, where);
4166 + result = PCIBIOS_DEVICE_NOT_FOUND;
4168 + MCF_PCICAR = address;
4169 + *(volatile u16 *) (HOST_CFG_BASE + (where & 2)) =
4170 + cpu_to_le16(value);
4174 + __asm__ __volatile__("nop");
4175 + __asm__ __volatile__("nop");
4176 + MCF_PCICAR &= ~MCF_PCICAR_E;
4178 + DBG("PCI: write_config_word bus=%d, devfn=%d, addr=0x%02X, value=0x%04X ret=%02X\n",
4179 + bus->number, devfn, where, value, result);
4185 + * static int write_config_dword()
4187 + * Write a long word to configuration space of specified device
4189 +static int write_config_dword(/*struct pci_dev *dev*/struct pci_bus *bus, unsigned int devfn, int where, u32 value)
4195 + result = PCIBIOS_SUCCESSFUL;
4198 + result = PCIBIOS_BAD_REGISTER_NUMBER;
4200 + slot = PCI_SLOT(devfn);
4201 + if (slot == BRIDGE_SLOT) {
4202 + if (where <= 0x3d)
4203 + *(volatile u32 *) (PCI_HDR_BASE + where) =
4206 + address = mk_conf_addr(bus, devfn, where);
4208 + result = PCIBIOS_DEVICE_NOT_FOUND;
4210 + MCF_PCICAR = address;
4211 + *(volatile u32 *) (HOST_CFG_BASE) =
4212 + cpu_to_le32(value);
4216 + __asm__ __volatile__("nop");
4217 + __asm__ __volatile__("nop");
4218 + MCF_PCICAR &= ~MCF_PCICAR_E;
4220 + DBG("PCI: write_config_dword dev=%d, fn=%d, addr=0x%02X, value=0x%08X ret=%02X\n",
4221 + PCI_SLOT(devfn), PCI_FUNC(devfn), where, value, result);
4226 +static int config_read(struct pci_bus *bus, unsigned int devfn,
4227 + int where, int size, u32 * val)
4231 + return read_config_byte(bus, devfn, where, (u8 *) val);
4233 + return read_config_word(bus, devfn, where, (u16 *) val);
4235 + return read_config_dword(bus, devfn, where, val);
4239 +static int config_write(struct pci_bus *bus, unsigned int devfn,
4240 + int where, int size, u32 val)
4244 + return write_config_byte(bus, devfn, where, (u8) val);
4246 + return write_config_word(bus, devfn, where, (u16) val);
4248 + return write_config_dword(bus, devfn, where, val);
4253 + * configuration routines entry points
4255 +static struct pci_ops bus_ops = {
4256 + read: config_read,
4257 + write: config_write
4260 +/************************************************************************/
4265 + * Read a byte at specified address from I/O space
4267 +unsigned char pci_inb(long addr)
4271 + value = *(volatile unsigned char *) (HOST_IO_BASE | (addr & PCI_IO_MASK));
4272 + DBG("PCI: inb addr=0x%08X, value=0x%02X\n", addr, value);
4274 + return (unsigned char) value;
4281 + * Read a word at specified address from I/O space
4283 +unsigned short pci_inw(long addr)
4286 + volatile unsigned short *ptr;
4288 + ptr = (volatile unsigned short *) (HOST_IO_BASE | (addr & PCI_IO_MASK));
4289 + value = le16_to_cpu(*ptr);
4291 + DBG("PCI: inw addr=0x%08X, value=0x%04X\n", addr, value);
4292 + return (unsigned short) value;
4296 + * u16 pci_raw_inw()
4298 + * Read a raw word at specified address from I/O space
4300 +unsigned short pci_raw_inw(long addr)
4303 + volatile unsigned short *ptr;
4305 + ptr = (volatile unsigned short *) (HOST_IO_BASE | (addr & PCI_IO_MASK));
4308 + DBG("PCI: raw_inw addr=0x%08X, value=0x%04X\n", addr, value);
4309 + return (unsigned short) value;
4315 + * Read a dword at specified address from I/O space
4317 +unsigned long pci_inl(long addr)
4320 + volatile unsigned long *ptr;
4322 + ptr = (volatile unsigned long *) (HOST_IO_BASE | (addr & PCI_IO_MASK));
4323 + value = le32_to_cpu(*ptr);
4325 + DBG("PCI: inl addr=0x%08X, value=0x%08X\n", addr, value);
4326 + return (unsigned long) value;
4330 + * u32 pci_raw_inl()
4332 + * Read a raw dword at specified address from I/O space
4334 +unsigned long pci_raw_inl(long addr)
4337 + volatile unsigned long *ptr;
4339 + ptr = (volatile unsigned long *) (HOST_IO_BASE | (addr & PCI_IO_MASK));
4342 + DBG("PCI: raw_inl addr=0x%08X, value=0x%08X\n", addr, value);
4343 + return (unsigned long) value;
4349 + * Write a byte value at specified address to I/O space
4351 +void pci_outb( unsigned char value, long addr)
4354 + *(volatile unsigned char *) (HOST_IO_BASE | (addr & PCI_IO_MASK)) = value;
4355 + DBG("PCI: outb addr=0x%08X, value=0x%02X\n", addr, value);
4362 + * Write a word value at specified address to I/O space
4364 +void pci_outw(volatile unsigned short value, volatile long addr)
4366 + volatile unsigned short *ptr;
4368 + ptr = (volatile unsigned short *) (HOST_IO_BASE | (addr & PCI_IO_MASK));
4369 + *ptr = cpu_to_le16(value);
4370 + DBG("PCI: outw addr=0x%08X, value=0x%04X\n", addr, value);
4374 + * void pci_raw_outw()
4376 + * Write a raw word value at specified address to I/O space
4378 +void pci_raw_outw(volatile unsigned short value, volatile long addr)
4380 + volatile unsigned short *ptr;
4382 + ptr = (volatile unsigned short *) (HOST_IO_BASE | (addr & PCI_IO_MASK));
4384 + DBG("PCI: raw_outw addr=0x%08X, value=0x%04X\n", addr, value);
4390 + * Write a long word value at specified address to I/O space
4392 +void pci_outl(volatile unsigned long value, volatile long addr)
4394 + volatile unsigned long *ptr;
4396 + ptr = (volatile unsigned long *)(HOST_IO_BASE | (addr & PCI_IO_MASK));
4397 + *ptr = cpu_to_le32(value);
4398 + DBG("PCI: outl addr=0x%08X, value=0x%08X\n", addr, value);
4402 + * void pci_raw_outl()
4404 + * Write a raw long word value at specified address to I/O space
4406 +void pci_raw_outl(volatile unsigned long value, volatile long addr)
4408 + volatile unsigned long *ptr;
4410 + ptr = (volatile unsigned long *)(HOST_IO_BASE | (addr & PCI_IO_MASK));
4412 + DBG("PCI: raw_outl addr=0x%08X, value=0x%08X\n", addr, value);
4418 + * Read several byte values from specified I/O port
4420 +void pci_insb(volatile unsigned char *addr, unsigned char *buf, int len)
4422 + for (; len--; buf++)
4423 + *buf = pci_inb((unsigned long)addr);
4424 + DBG("PCI: pci_insb addr=0x%08X, buf=%p, len=%d\n", addr, buf, len);
4431 + * Read several word values from specified I/O port
4433 +void pci_insw(volatile unsigned short *addr, unsigned short *buf, int len)
4435 + for (; len--; buf++)
4436 + *buf = pci_inw((unsigned long)addr);
4437 + DBG("PCI: pci_insw addr=0x%08X, buf=%p, len=%d\n", addr, buf, len);
4443 + * Read several dword values from specified I/O port
4445 +void pci_insl(volatile unsigned long *addr, unsigned long *buf, int len)
4447 + for (; len--; buf++)
4448 + *buf = pci_inl((unsigned long)addr);
4449 + DBG("PCI: pci_insl addr=0x%08X, buf=%p, len=%d\n", addr, buf, len);
4453 + * void pci_outsb()
4455 + * Write several byte values to specified I/O port
4457 +void pci_outsb(volatile unsigned char *addr, const unsigned char *buf, int len)
4459 + for (; len--; buf++)
4460 + pci_outb((unsigned long)addr, *buf);
4461 + DBG("PCI: pci_outsb addr=0x%08X, buf=%p, len=%d\n", addr, buf, len);
4465 + * void pci_outsw()
4467 + * Write several word values to specified I/O port
4469 +void pci_outsw(volatile unsigned short *addr, const unsigned short *buf, int len)
4471 + for (; len--; buf++)
4472 + pci_outw((unsigned long)addr, *buf);
4473 + DBG("PCI: pci_outsw addr=0x%08X, buf=%p, len=%d\n", addr, buf, len);
4477 + * void pci_outsl()
4479 + * Write several dword values to specified I/O port
4481 +void pci_outsl(volatile unsigned long *addr, const unsigned long *buf, int len)
4483 + for (; len--; buf++)
4484 + pci_outl((unsigned long)addr, *buf);
4485 + DBG("PCI: pci_outsl addr=0x%08X, buf=%p, len=%d\n", addr, buf, len);
4489 + * void pci_xlb_handler()
4491 + * PCI XLB interrupt handler
4493 +irqreturn_t xlb_interrupt(int irq, void *dev)
4495 + volatile int xlb_error = MCF_PCIISR;
4497 + /* Acknowlege interrupt */
4498 + MCF_PCIISR = xlb_error;
4500 + /* Dump interrupt reason */
4501 + if (xlb_error & MCF_PCIISR_RE)
4502 + DBG("PCI: Retry Error Received\n");
4504 + if (xlb_error & MCF_PCIISR_IA)
4505 + DBG("PCI: Initiator Abort Received\n");
4507 + if (xlb_error & MCF_PCIISR_TA)
4508 + DBG("PCI: Target Abort Received\n");
4510 + return IRQ_HANDLED;
4515 + * void pci_arbiter_handler()
4517 + * PCI arbiter interrupt handler
4519 +irqreturn_t arb_interrupt(int irq, void *dev)
4521 + volatile unsigned long arb_error = MCF_PCIARB_PASR;
4523 + /* Acknowlege interrupt */
4524 + printk("%s\n",__FUNCTION__);
4525 + MCF_PCIARB_PASR = arb_error;
4527 + if (arb_error & MCF_PCIARB_PASR_ITLMBK) {
4528 + DBG("PCI: coldfire master time-out\n");
4530 + /* Set infinite number of retries */
4531 + MCF_PCIICR &= ~0xFF;
4534 + if (arb_error & MCF_PCIARB_PASR_EXTMBK(0x1F)) {
4536 + DBG("PCI: external master time-out (mask = 0x%X)\n", arb_error);
4538 + /* raise arbitration priority level */
4539 + MCF_PCIARB_PACR = MCF_PCIARB_PACR_EXTMPRI(arb_error);
4542 + return IRQ_HANDLED;
4547 + * void pci_eint_handler()
4549 + * Eport interrupt handler
4551 +irqreturn_t eint_handler(int irq, void *dev)
4553 + /* Just acknowlege interrupt and exit */
4554 + MCF_EPFR = 0x1 << (irq - 64);
4555 + return IRQ_HANDLED;
4560 + * void __init coldfire_fixup(int pci_modify)
4562 + * Assign IRQ numbers as used by Linux to the interrupt pins
4563 + * of the PCI cards.
4565 +static void __init coldfire_fixup(int pci_modify)
4567 + struct pci_dev *dev;
4568 + unsigned char slot, pin;
4570 + DBG("%s\n",__FUNCTION__);
4572 + pci_for_each_dev(dev) {
4575 + while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
4577 + if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) {
4578 + slot = PCI_SLOT(dev->devfn);
4579 + dev->irq = 64 + board_info[slot].irq;
4581 + /* Check if device needs interrupt */
4583 + pcibios_read_config_byte(
4584 + dev->bus->number, dev->devfn,
4585 + PCI_INTERRUPT_PIN, &pin);
4588 + pcibios_write_config_byte(
4589 + dev->bus->number, dev->devfn,
4590 + PCI_INTERRUPT_LINE, dev->irq);
4593 + pci_read_config_byte(dev,
4594 + PCI_INTERRUPT_PIN, &pin);
4597 + pci_write_config_byte(dev,
4598 + PCI_INTERRUPT_LINE, dev->irq);
4605 +static void __init configure_device(struct pci_dev *dev)
4607 + /* TODO: This should depend from disable_pci_burst setting */
4608 + DBG("%s\n",__FUNCTION__);
4610 + pcibios_write_config_byte(bus, devfn, PCI_CACHE_LINE_SIZE, PCI_CACHE_LINE);
4612 + pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, PCI_CACHE_LINE);
4616 +struct pci_bus_info *__init init_coldfire_pci(void)
4618 + static struct pci_bus_info bus;
4621 + static char irq_name[N_IRQS][15];
4623 + /* Get controller revision */
4624 + revision = MCF_PCICCRIR;
4625 + printk("ColdFire PCI Host Bridge (Rev. %d) detected:"
4626 + "MEMBase %x,MEMLen %x,IOBase %x,IOLen %x\n",
4627 + revision, HOST_MEM_BASE, PCI_MEM_SIZE - 1, 0, PCI_IO_SIZE - 1);
4629 + /* Setup bus info structure. */
4630 + memset(&bus, 0, sizeof (struct pci_bus_info));
4632 + /* Request intiator memory resource */
4633 + bus.mem_space.start = PCI_MEM_BASE;//HOST_MEM_BASE;
4634 + bus.mem_space.end = bus.mem_space.start + PCI_MEM_SIZE - 1;
4635 + bus.mem_space.name = "PCI Bus #0";
4636 + if (request_resource(&iomem_resource, &bus.mem_space) != 0)
4638 + printk("Failed to request bridge iomem resource\n");
4642 + /* Request intiator memory resource */
4643 + bus.io_space.start = 0;
4644 + bus.io_space.end = bus.io_space.start + PCI_IO_SIZE - 1;
4645 + bus.io_space.name = "PCI Bus #0";
4646 + if (request_resource(&ioport_resource, &bus.io_space) != 0)
4648 + printk("Failed to request bridge ioport resource\n");
4652 + /* Must Reset!!! If bootloader has PCI enabled, it will cause
4653 + * problem in linux when it tries to configure/find resources
4654 + * for the pci devices. Both registers need to be reset.
4656 + MCF_PCIGSCR = 0x1;
4657 + MCF_PCITCR = 0x00000000;
4659 + /* Set up the arbiter */
4660 + MCF_PCIARB_PACR = 0 /*MCF_PCIARB_PACR_PKMD*/
4661 + | MCF_PCIARB_PACR_INTMPRI
4662 + | MCF_PCIARB_PACR_INTMINTEN
4663 + | MCF_PCIARB_PACR_EXTMPRI(0x1F)
4664 + | MCF_PCIARB_PACR_EXTMINTEN(0x1F);
4667 + MCF_PAR_PCIBG = 0x3FF;
4668 + MCF_PAR_PCIBR = 0x3FF;
4670 + /* Enable bus mastering, memory access and MWI */
4671 + MCF_PCISCR = MCF_PCISCR_B | MCF_PCISCR_M | MCF_PCISCR_MW;
4673 + /* Setup burst parameters */
4674 + MCF_PCICR1 = MCF_PCICR1_LATTIMER(32) |
4675 + MCF_PCICR1_CACHELINESIZE(PCI_CACHE_LINE);
4678 + /*MCF_PCICR2_MINGNT(PCI_MINGNT) |
4679 + MCF_PCICR2_MAXLAT(PCI_MAXLAT);
4681 + /* Turn on error signaling */
4682 + MCF_PCIICR = MCF_PCIICR_TAE | MCF_PCIICR_IAE | PCI_RETRIES;
4683 + MCF_PCIGSCR |= MCF_PCIGSCR_SEE;
4685 + * Configure Initiator Windows
4686 + * Window 0: 128M PCI Memory @ HOST_MEM_BASE, 1:1 mapping
4687 + * Window 1: 64K I/O Memory @ HOST_IO_BASE, 1:0 mapping
4689 + MCF_PCIIW0BTAR = WxBAR(HOST_MEM_BASE, PCI_MEM_BASE, PCI_MEM_SIZE);
4690 + MCF_PCIIW1BTAR = WxBAR(HOST_IO_BASE, PCI_IO_BASE_ADDR, PCI_IO_SIZE);
4692 + MCF_PCIIWCR = MCF_PCIIWCR_WINCTRL1_IO |
4693 + MCF_PCIIWCR_WINCTRL0_MEMRDLINE;
4695 + /* Target PCI DMA Windows */
4696 + MCF_PCIBAR1 = PCI_DMA_BASE;
4697 + MCF_PCITBATR1 = HOST_DMA_BASE | MCF_PCITBATR1_EN;
4698 + MCF_PCIBAR0 = MCF_RAMBAR0;;
4699 + MCF_PCITBATR0 = MCF_RAMBAR0 | MCF_PCITBATR0_EN;
4700 + DBG("PCI TCR %x,MCF_PCIBAR1 %x,MCF_PCITBATR1 %x."
4701 + "MCF_PCIBAR0 %x,MCF_PCITBATR9 %x\n", MCF_PCITCR, MCF_PCIBAR1,
4702 + MCF_PCITBATR1, MCF_PCIBAR0, MCF_PCITBATR0);
4703 + /* Enable internal PCI controller interrupts */
4704 + MCF_ICR(ISC_PCI_XLB) = ILP_PCI_XLB;
4705 + /*request_irq(64+ISC_PCI_XLB, xlb_interrupt,
4706 + SA_INTERRUPT, "PCI XL Bus", (void*)-1);
4707 + enable_irq (64+ISC_PCI_XLB);
4709 + if(request_irq(64+ISC_PCI_XLB, xlb_interrupt,
4710 + IRQF_DISABLED, "PCI XL Bus", (void*)-1)){
4711 + printk("Cannot allocate ISC_PCI_XLB IRQ\n");
4712 + return (struct pci_bus_info *)-EBUSY;
4715 + MCF_ICR(ISC_PCI_ARB) = ILP_PCI_ARB;
4716 + /*request_irq(64+ISC_PCI_ARB, arb_interrupt,
4717 + SA_INTERRUPT, "PCI Arbiter", (void*)-1);
4718 + enable_irq (64+ISC_PCI_ARB);
4720 + if(request_irq(64+ISC_PCI_ARB, arb_interrupt,
4721 + IRQF_DISABLED, "PCI Arbiter", (void*)-1)){
4722 + printk("Cannot allocate ISC_PCI_ARB IRQ\n");
4723 + return (struct pci_bus_info *)-EBUSY;
4726 + /* Set slots interrupt setting */
4727 + for (i = 0; i < N_IRQS; i++)
4729 + /* Set trailing edge for PCI interrupts */
4730 + MCF_EPPAR &= ~MCF_EPPAR_EPPA(irq_lines[i], 0x3);
4731 + if (irq_lines[i] == 5)
4732 + MCF_EPPAR |= MCF_EPPAR_EPPA(irq_lines[i], MCF_EPPAR_EPPAx_FALLING);
4734 + MCF_EPPAR |= MCF_EPPAR_EPPA(irq_lines[i], 0/*MCF_EPPAR_EPPAx_FALLING*/);
4735 + /* Turn on irq line in eport */
4736 + MCF_EPIER |= MCF_EPIER_EPIE(irq_lines[i]);
4738 + /* Enable irq in gpio */
4739 + if (irq_lines[i] == 5)
4740 + MCF_PAR_FECI2CIRQ |= 1;
4742 + if (irq_lines[i] == 6)
4743 + MCF_PAR_FECI2CIRQ |= 2;
4745 + /* Register external interrupt handlers */
4746 + sprintf(irq_name[i], "PCI IRQ%d", irq_lines[i]);
4747 + /*request_irq(64 + irq_lines[i], eint_handler,
4748 + SA_SHIRQ, irq_name[i], (void*)-1);
4749 + enable_irq(64 + irq_lines[i]);*/
4750 + if(request_irq(64 + irq_lines[i], eint_handler,
4751 + IRQF_SHARED, irq_name[i], (void*)-1)){
4752 + printk("Cannot allocate irq_lines[%d] IRQ\n", irq_lines[i]);
4753 + return (struct pci_bus_info *)-EBUSY;
4757 + /* Clear PCI Reset and wait for devices to reset */
4758 + MCF_PCIGSCR &= ~MCF_PCIGSCR_PR;
4759 + schedule_timeout((5 * HZ) / 10);
4760 + /* Remap initiator windows (should be 1:1 to the physical memory) */
4761 + pci_mem_va = (int) ioremap_nocache(HOST_MEM_BASE, PCI_MEM_SIZE + PCI_IO_SIZE);
4763 + printk("%s: MEMBase_phy %x, Virt %x, len %x\n",__FUNCTION__,
4764 + HOST_MEM_BASE,pci_mem_va,PCI_MEM_SIZE + PCI_IO_SIZE);
4766 + BUG_ON(pci_mem_va != HOST_MEM_BASE);
4768 + /* Setup bios32 and pci bus driver callbacks */
4769 + bus.m68k_pci_ops = &bus_ops;
4770 + bus.fixup = coldfire_fixup;
4771 + bus.conf_device = configure_device;
4777 +++ b/arch/m68k/coldfire/muldi3.S
4780 + * Coldfire muldi3 assembly verion
4783 +#include <linux/linkage.h>
4789 + moveml %d2-%d7/%a2-%a3,%sp@
4790 + moveal %fp@(8), %a2
4791 + moveal %fp@(12), %a3
4792 + moveal %fp@(16), %a0
4793 + moveal %fp@(20),%a1
4839 + moveml %sp@, %d2-%d7/%a2-%a3
4844 +++ b/arch/m68k/coldfire/pci.c
4847 + * linux/arch/m68k/coldfire/pci.c
4849 + * PCI initialization for Coldfire architectures.
4851 + * Currently Supported:
4854 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
4855 + * Kurt Mahan <kmahan@freescale.com>
4858 +#include <linux/kernel.h>
4859 +#include <linux/init.h>
4860 +#include <linux/pci.h>
4862 +#include <asm/mcfsim.h>
4863 +#include <asm/pci.h>
4865 +/* pci ops for reading/writing config */
4866 +struct pci_raw_ops *raw_pci_ops;
4868 +/* pci debug flag */
4869 +static int debug_pci;
4871 +#ifdef CONFIG_M54455
4872 +extern int init_mcf5445x_pci(void);
4873 +extern void mcf5445x_conf_device(struct pci_dev *dev);
4874 +extern void mcf5445x_pci_dumpregs(void);
4876 +extern struct resource pci_ioport_resource;
4877 +extern struct resource pci_iomem_resource;
4881 +pci_read(struct pci_bus *bus, unsigned int devfn, int where,
4882 + int size, u32 *value)
4884 + return raw_pci_ops->read(0, bus->number, devfn, where, size, value);
4888 +pci_write(struct pci_bus *bus, unsigned int devfn, int where,
4889 + int size, u32 value)
4891 + return raw_pci_ops->write(0, bus->number, devfn, where, size, value);
4894 +struct pci_ops pci_root_ops = {
4896 + .write = pci_write,
4900 + * pcibios_setup(char *)
4902 + * Initialize the pcibios based on cmd line params.
4905 +pcibios_setup(char *str)
4907 + if (!strcmp(str, "debug")) {
4915 + * We need to avoid collisions with `mirrored' VGA ports
4916 + * and other strange ISA hardware, so we always want the
4917 + * addresses to be allocated in the 0x000-0x0ff region
4920 + * Why? Because some silly external IO cards only decode
4921 + * the low 10 bits of the IO address. The 0x00-0xff region
4922 + * is reserved for motherboard devices that decode all 16
4923 + * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
4924 + * but we want to try to avoid allocating at 0x2900-0x2bff
4925 + * which might have be mirrored at 0x0100-0x03ff..
4928 +pcibios_align_resource(void *data, struct resource *res, resource_size_t size,
4929 + resource_size_t align)
4931 + struct pci_dev *dev = data;
4933 + if (res->flags & IORESOURCE_IO) {
4934 + resource_size_t start = res->start;
4937 + printk(KERN_ERR "PCI: I/O Region %s/%d too large"
4938 + " (%ld bytes)\n", pci_name(dev),
4939 + dev->resource - res, (long int)size);
4941 + if (start & 0x300) {
4942 + start = (start + 0x3ff) & ~0x3ff;
4943 + res->start = start;
4949 + * Swizzle the device pin each time we cross a bridge
4950 + * and return the slot number.
4952 +static u8 __devinit
4953 +pcibios_swizzle(struct pci_dev *dev, u8 *pin)
4959 + * Map a slot/pin to an IRQ.
4962 +pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
4968 + * pcibios_update_irq(struct pci_dev *dev, int irq)
4970 + * Update a PCI interrupt.
4973 +pcibios_update_irq(struct pci_dev *dev, int irq)
4975 + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
4979 + * pcibios_enable_device(struct pci_dev *dev, int mask)
4981 + * Enable a device on the PCI bus.
4984 +pcibios_enable_device(struct pci_dev *dev, int mask)
4988 + struct resource *r;
4990 + pci_read_config_word(dev, PCI_COMMAND, &cmd);
4992 + for (idx = 0; idx < 6; idx++) {
4993 + r = &dev->resource[idx];
4994 + if (!r->start && r->end) {
4995 + printk(KERN_ERR "PCI: Device %s not available because "
4996 + "of resource collisions\n", pci_name(dev));
4999 + if (r->flags & IORESOURCE_IO)
5000 + cmd |= PCI_COMMAND_IO;
5001 + if (r->flags & IORESOURCE_MEM)
5002 + cmd |= PCI_COMMAND_MEMORY;
5004 + if (cmd != old_cmd) {
5005 + printk("PCI: Enabling device %s (%04x -> %04x)\n",
5006 + pci_name(dev), old_cmd, cmd);
5007 + pci_write_config_word(dev, PCI_COMMAND, cmd);
5008 +#ifdef CONFIG_M54455
5009 + mcf5445x_conf_device(dev);
5017 + * pcibios_fixup_bus(struct pci_bus *bus)
5020 +pcibios_fixup_bus(struct pci_bus *bus)
5022 + struct pci_dev *dev = bus->self;
5026 +#ifdef CONFIG_M54455
5027 + bus->resource[0] = &pci_ioport_resource;
5028 + bus->resource[1] = &pci_iomem_resource;
5034 + * pcibios_init(void)
5036 + * Allocate/initialize low level pci bus/devices.
5041 + struct pci_bus *bus;
5043 + if (!raw_pci_ops) {
5044 + printk(KERN_WARNING "PCIBIOS: FATAL: NO PCI Hardware found\n");
5048 + /* allocate and scan the (only) bus */
5049 + bus = pci_scan_bus_parented(NULL, 0, &pci_root_ops, NULL);
5051 + /* setup everything */
5053 + /* compute the bridge window sizes */
5054 + pci_bus_size_bridges(bus);
5056 + /* (re)assign device resources */
5057 + pci_bus_assign_resources(bus);
5059 + /* add the bus to the system */
5060 + pci_bus_add_devices(bus);
5063 + pci_fixup_irqs(pcibios_swizzle, pcibios_map_irq);
5072 + * Initialize the PCI Hardware.
5077 +#if defined(CONFIG_M54455)
5078 + init_mcf5445x_pci();
5081 + printk(KERN_ERR "PCI: FATAL: NO PCI Detected\n");
5086 +/* low level hardware (first) */
5087 +arch_initcall(pci_init);
5089 +/* basic bios init (second) */
5090 +subsys_initcall(pcibios_init);
5092 +++ b/arch/m68k/coldfire/signal.c
5095 + * linux/arch/m68k/kernel/signal.c
5097 + * Copyright (C) 1991, 1992 Linus Torvalds
5099 + * This file is subject to the terms and conditions of the GNU General Public
5100 + * License. See the file COPYING in the main directory of this archive
5101 + * for more details.
5105 + * Derived from m68k/kernel/signal.c and the original authors are credited
5108 + * Coldfire support by:
5109 + * Matt Waddel Matt.Waddel@freescale.com
5110 + * Copyright Freescale Semiconductor, Inc 2007
5113 +#include <linux/sched.h>
5114 +#include <linux/mm.h>
5115 +#include <linux/kernel.h>
5116 +#include <linux/signal.h>
5117 +#include <linux/syscalls.h>
5118 +#include <linux/errno.h>
5119 +#include <linux/wait.h>
5120 +#include <linux/ptrace.h>
5121 +#include <linux/unistd.h>
5122 +#include <linux/stddef.h>
5123 +#include <linux/highuid.h>
5124 +#include <linux/personality.h>
5125 +#include <linux/tty.h>
5126 +#include <linux/binfmts.h>
5128 +#include <asm/setup.h>
5129 +#include <asm/cf_uaccess.h>
5130 +#include <asm/cf_pgtable.h>
5131 +#include <asm/traps.h>
5132 +#include <asm/ucontext.h>
5133 +#include <asm/cacheflush.h>
5135 +#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
5137 +asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs);
5139 +const int frame_extra_sizes[16] = {
5141 + [2] = sizeof(((struct frame *)0)->un.fmt2),
5142 + [3] = sizeof(((struct frame *)0)->un.fmt3),
5146 + [7] = sizeof(((struct frame *)0)->un.fmt7),
5148 + [9] = sizeof(((struct frame *)0)->un.fmt9),
5149 + [10] = sizeof(((struct frame *)0)->un.fmta),
5150 + [11] = sizeof(((struct frame *)0)->un.fmtb),
5158 + * Atomically swap in the new signal mask, and wait for a signal.
5160 +asmlinkage int do_sigsuspend(struct pt_regs *regs)
5162 + old_sigset_t mask = regs->d3;
5165 + mask &= _BLOCKABLE;
5166 + spin_lock_irq(¤t->sighand->siglock);
5167 + saveset = current->blocked;
5168 + siginitset(¤t->blocked, mask);
5169 + recalc_sigpending();
5170 + spin_unlock_irq(¤t->sighand->siglock);
5172 + regs->d0 = -EINTR;
5174 + current->state = TASK_INTERRUPTIBLE;
5176 + if (do_signal(&saveset, regs))
5182 +do_rt_sigsuspend(struct pt_regs *regs)
5184 + sigset_t __user *unewset = (sigset_t __user *)regs->d1;
5185 + size_t sigsetsize = (size_t)regs->d2;
5186 + sigset_t saveset, newset;
5188 + /* XXX: Don't preclude handling different sized sigset_t's. */
5189 + if (sigsetsize != sizeof(sigset_t))
5192 + if (copy_from_user(&newset, unewset, sizeof(newset)))
5194 + sigdelsetmask(&newset, ~_BLOCKABLE);
5196 + spin_lock_irq(¤t->sighand->siglock);
5197 + saveset = current->blocked;
5198 + current->blocked = newset;
5199 + recalc_sigpending();
5200 + spin_unlock_irq(¤t->sighand->siglock);
5202 + regs->d0 = -EINTR;
5204 + current->state = TASK_INTERRUPTIBLE;
5206 + if (do_signal(&saveset, regs))
5212 +sys_sigaction(int sig, const struct old_sigaction __user *act,
5213 + struct old_sigaction __user *oact)
5215 + struct k_sigaction new_ka, old_ka;
5219 + old_sigset_t mask;
5220 + if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
5221 + __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
5222 + __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
5224 + __get_user(new_ka.sa.sa_flags, &act->sa_flags);
5225 + __get_user(mask, &act->sa_mask);
5226 + siginitset(&new_ka.sa.sa_mask, mask);
5229 + ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
5231 + if (!ret && oact) {
5232 + if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
5233 + __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
5234 + __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
5236 + __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
5237 + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
5244 +sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
5246 + return do_sigaltstack(uss, uoss, rdusp());
5251 + * Do a signal return; undo the signal stack.
5253 + * Keep the return code on the stack quadword aligned!
5254 + * That makes the cache flush below easier.
5259 + char __user *pretcode;
5262 + struct sigcontext __user *psc;
5264 + unsigned long extramask[_NSIG_WORDS-1];
5265 + struct sigcontext sc;
5270 + char __user *pretcode;
5272 + struct siginfo __user *pinfo;
5275 + struct siginfo info;
5276 + struct ucontext uc;
5279 +#define FPCONTEXT_SIZE 216
5280 +#define uc_fpstate uc_filler[0]
5281 +#define uc_formatvec uc_filler[FPCONTEXT_SIZE/4]
5282 +#define uc_extra uc_filler[FPCONTEXT_SIZE/4+1]
5285 +static unsigned char fpu_version; /* version num of fpu, set by setup_frame */
5287 +static inline int restore_fpu_state(struct sigcontext *sc)
5292 + /* restore registers */
5293 + memcpy(current->thread.fpcntl, sc->sc_fpcntl, 12);
5294 + memcpy(current->thread.fp, sc->sc_fpregs, 24);
5298 + if (CPU_IS_060 ? sc->sc_fpstate[2] : sc->sc_fpstate[0]) {
5299 + /* Verify the frame format. */
5300 + if (!CPU_IS_060 && (sc->sc_fpstate[0] != fpu_version))
5302 + if (CPU_IS_020_OR_030) {
5303 + if (m68k_fputype & FPU_68881 &&
5304 + !(sc->sc_fpstate[1] == 0x18 || sc->sc_fpstate[1] == 0xb4))
5306 + if (m68k_fputype & FPU_68882 &&
5307 + !(sc->sc_fpstate[1] == 0x38 || sc->sc_fpstate[1] == 0xd4))
5309 + } else if (CPU_IS_040) {
5310 + if (!(sc->sc_fpstate[1] == 0x00 ||
5311 + sc->sc_fpstate[1] == 0x28 ||
5312 + sc->sc_fpstate[1] == 0x60))
5314 + } else if (CPU_IS_060) {
5315 + if (!(sc->sc_fpstate[3] == 0x00 ||
5316 + sc->sc_fpstate[3] == 0x60 ||
5317 + sc->sc_fpstate[3] == 0xe0))
5329 +static inline int rt_restore_fpu_state(struct ucontext __user *uc)
5331 + unsigned char fpstate[FPCONTEXT_SIZE];
5332 + int context_size = CPU_IS_060 ? 8 : 0;
5333 + fpregset_t fpregs;
5337 + /* restore fpu control register */
5338 + if (__copy_from_user(current->thread.fpcntl,
5339 + uc->uc_mcontext.fpregs.f_fpcntl, 12))
5341 + /* restore all other fpu register */
5342 + if (__copy_from_user(current->thread.fp,
5343 + uc->uc_mcontext.fpregs.f_fpregs, 96))
5348 + if (__get_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate))
5350 + if (CPU_IS_060 ? fpstate[2] : fpstate[0]) {
5352 + context_size = fpstate[1];
5353 + /* Verify the frame format. */
5354 + if (!CPU_IS_060 && (fpstate[0] != fpu_version))
5356 + if (CPU_IS_020_OR_030) {
5357 + if (m68k_fputype & FPU_68881 &&
5358 + !(context_size == 0x18 || context_size == 0xb4))
5360 + if (m68k_fputype & FPU_68882 &&
5361 + !(context_size == 0x38 || context_size == 0xd4))
5363 + } else if (CPU_IS_040) {
5364 + if (!(context_size == 0x00 ||
5365 + context_size == 0x28 ||
5366 + context_size == 0x60))
5368 + } else if (CPU_IS_060) {
5369 + if (!(fpstate[3] == 0x00 ||
5370 + fpstate[3] == 0x60 ||
5371 + fpstate[3] == 0xe0))
5375 + if (__copy_from_user(&fpregs, &uc->uc_mcontext.fpregs,
5379 + if (context_size &&
5380 + __copy_from_user(fpstate + 4, (long __user *)&uc->uc_fpstate + 1,
5391 +restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *usc,
5392 + void __user *fp, int *pd0)
5394 + int fsize, formatvec;
5395 + struct sigcontext context;
5398 + /* get previous context */
5399 + if (copy_from_user(&context, usc, sizeof(context)))
5402 + /* restore passed registers */
5403 + regs->d1 = context.sc_d1;
5404 + regs->a0 = context.sc_a0;
5405 + regs->a1 = context.sc_a1;
5406 + regs->sr = (regs->sr & 0xff00) | (context.sc_sr & 0xff);
5407 + regs->pc = context.sc_pc;
5408 + regs->orig_d0 = -1; /* disable syscall checks */
5409 + wrusp(context.sc_usp);
5410 + formatvec = context.sc_formatvec;
5411 + regs->format = formatvec >> 12;
5412 + regs->vector = formatvec & 0xfff;
5415 + err = restore_fpu_state(&context);
5418 + fsize = frame_extra_sizes[regs->format];
5421 + * user process trying to return with weird frame format
5424 + printk(KERN_DEBUG "user process returning with weird \
5430 + /* OK. Make room on the supervisor stack for the extra junk,
5435 + struct switch_stack *sw = (struct switch_stack *)regs - 1;
5436 + regs->d0 = context.sc_d0;
5437 +#define frame_offset (sizeof(struct pt_regs)+sizeof(struct switch_stack))
5438 + __asm__ __volatile__
5439 + (" movel %0,%/sp\n\t"
5440 + " bra ret_from_signal\n"
5442 + ".section __ex_table,\"a\"\n"
5446 + : /* no outputs, it doesn't ever return */
5447 + : "a" (sw), "d" (fsize), "d" (frame_offset/4-1),
5448 + "n" (frame_offset), "a" (fp)
5450 +#undef frame_offset
5452 + * If we ever get here an exception occurred while
5453 + * building the above stack-frame.
5458 + *pd0 = context.sc_d0;
5466 +rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw,
5467 + struct ucontext __user *uc, int *pd0)
5470 + greg_t __user *gregs = uc->uc_mcontext.gregs;
5471 + unsigned long usp;
5474 + err = __get_user(temp, &uc->uc_mcontext.version);
5475 + if (temp != MCONTEXT_VERSION)
5477 + /* restore passed registers */
5478 + err |= __get_user(regs->d0, &gregs[0]);
5479 + err |= __get_user(regs->d1, &gregs[1]);
5480 + err |= __get_user(regs->d2, &gregs[2]);
5481 + err |= __get_user(regs->d3, &gregs[3]);
5482 + err |= __get_user(regs->d4, &gregs[4]);
5483 + err |= __get_user(regs->d5, &gregs[5]);
5484 + err |= __get_user(sw->d6, &gregs[6]);
5485 + err |= __get_user(sw->d7, &gregs[7]);
5486 + err |= __get_user(regs->a0, &gregs[8]);
5487 + err |= __get_user(regs->a1, &gregs[9]);
5488 + err |= __get_user(regs->a2, &gregs[10]);
5489 + err |= __get_user(sw->a3, &gregs[11]);
5490 + err |= __get_user(sw->a4, &gregs[12]);
5491 + err |= __get_user(sw->a5, &gregs[13]);
5492 + err |= __get_user(sw->a6, &gregs[14]);
5493 + err |= __get_user(usp, &gregs[15]);
5495 + err |= __get_user(regs->pc, &gregs[16]);
5496 + err |= __get_user(temp, &gregs[17]);
5497 + regs->sr = (regs->sr & 0xff00) | (temp & 0xff);
5498 + regs->orig_d0 = -1; /* disable syscall checks */
5499 + err |= __get_user(temp, &uc->uc_formatvec);
5500 + regs->format = temp >> 12;
5501 + regs->vector = temp & 0xfff;
5504 + err |= rt_restore_fpu_state(uc);
5507 + if (do_sigaltstack(&uc->uc_stack, NULL, usp) == -EFAULT)
5510 + fsize = frame_extra_sizes[regs->format];
5513 + * user process trying to return with weird frame format
5516 + printk(KERN_DEBUG "user process returning with weird \
5522 + /* OK. Make room on the supervisor stack for the extra junk,
5527 +#define frame_offset (sizeof(struct pt_regs)+sizeof(struct switch_stack))
5528 + __asm__ __volatile__
5529 + (" movel %0,%/sp\n\t"
5530 + " bra ret_from_signal\n"
5532 + ".section __ex_table,\"a\"\n"
5536 + : /* no outputs, it doesn't ever return */
5537 + : "a" (sw), "d" (fsize), "d" (frame_offset/4-1),
5538 + "n" (frame_offset), "a" (&uc->uc_extra)
5540 +#undef frame_offset
5542 + * If we ever get here an exception occurred while
5543 + * building the above stack-frame.
5555 +asmlinkage int do_sigreturn(unsigned long __unused)
5557 + struct switch_stack *sw = (struct switch_stack *) &__unused;
5558 + struct pt_regs *regs = (struct pt_regs *) (sw + 1);
5559 + unsigned long usp = rdusp();
5560 + struct sigframe __user *frame = (struct sigframe __user *)(usp - 4);
5564 + if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
5566 + if (__get_user(set.sig[0], &frame->sc.sc_mask) ||
5567 + (_NSIG_WORDS > 1 &&
5568 + __copy_from_user(&set.sig[1], &frame->extramask,
5569 + sizeof(frame->extramask))))
5572 + sigdelsetmask(&set, ~_BLOCKABLE);
5573 + spin_lock_irq(¤t->sighand->siglock);
5574 + current->blocked = set;
5575 + recalc_sigpending();
5576 + spin_unlock_irq(¤t->sighand->siglock);
5578 + if (restore_sigcontext(regs, &frame->sc, frame + 1, &d0))
5583 + force_sig(SIGSEGV, current);
5587 +asmlinkage int do_rt_sigreturn(unsigned long __unused)
5589 + struct switch_stack *sw = (struct switch_stack *) &__unused;
5590 + struct pt_regs *regs = (struct pt_regs *) (sw + 1);
5591 + unsigned long usp = rdusp();
5592 + struct rt_sigframe __user *frame =
5593 + (struct rt_sigframe __user *)(usp - 4);
5597 + if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
5599 + if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
5602 + sigdelsetmask(&set, ~_BLOCKABLE);
5603 + spin_lock_irq(¤t->sighand->siglock);
5604 + current->blocked = set;
5605 + recalc_sigpending();
5606 + spin_unlock_irq(¤t->sighand->siglock);
5608 + if (rt_restore_ucontext(regs, sw, &frame->uc, &d0))
5613 + force_sig(SIGSEGV, current);
5619 + * Set up a signal frame.
5622 +static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs)
5625 + /* save registers */
5626 + memcpy(sc->sc_fpcntl, current->thread.fpcntl, 12);
5627 + memcpy(sc->sc_fpregs, current->thread.fp, 24);
5632 +static inline int rt_save_fpu_state(struct ucontext __user *uc,
5633 + struct pt_regs *regs)
5638 + /* save fpu control register */
5639 + err |= copy_to_user(uc->uc_mcontext.fpregs.f_fpcntl,
5640 + current->thread.fpcntl, 12);
5641 + /* save all other fpu register */
5642 + err |= copy_to_user(uc->uc_mcontext.fpregs.f_fpregs,
5643 + current->thread.fp, 96);
5651 +static void setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
5652 + unsigned long mask)
5654 + sc->sc_mask = mask;
5655 + sc->sc_usp = rdusp();
5656 + sc->sc_d0 = regs->d0;
5657 + sc->sc_d1 = regs->d1;
5658 + sc->sc_a0 = regs->a0;
5659 + sc->sc_a1 = regs->a1;
5660 + sc->sc_sr = regs->sr;
5661 + sc->sc_pc = regs->pc;
5662 + sc->sc_formatvec = regs->format << 12 | regs->vector;
5664 + save_fpu_state(sc, regs);
5668 +static inline int rt_setup_ucontext(struct ucontext __user *uc,
5669 + struct pt_regs *regs)
5671 + struct switch_stack *sw = (struct switch_stack *)regs - 1;
5672 + greg_t __user *gregs = uc->uc_mcontext.gregs;
5675 + err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version);
5676 + err |= __put_user(regs->d0, &gregs[0]);
5677 + err |= __put_user(regs->d1, &gregs[1]);
5678 + err |= __put_user(regs->d2, &gregs[2]);
5679 + err |= __put_user(regs->d3, &gregs[3]);
5680 + err |= __put_user(regs->d4, &gregs[4]);
5681 + err |= __put_user(regs->d5, &gregs[5]);
5682 + err |= __put_user(sw->d6, &gregs[6]);
5683 + err |= __put_user(sw->d7, &gregs[7]);
5684 + err |= __put_user(regs->a0, &gregs[8]);
5685 + err |= __put_user(regs->a1, &gregs[9]);
5686 + err |= __put_user(regs->a2, &gregs[10]);
5687 + err |= __put_user(sw->a3, &gregs[11]);
5688 + err |= __put_user(sw->a4, &gregs[12]);
5689 + err |= __put_user(sw->a5, &gregs[13]);
5690 + err |= __put_user(sw->a6, &gregs[14]);
5691 + err |= __put_user(rdusp(), &gregs[15]);
5692 + err |= __put_user(regs->pc, &gregs[16]);
5693 + err |= __put_user(regs->sr, &gregs[17]);
5694 + err |= __put_user((regs->format << 12) | regs->vector,
5695 + &uc->uc_formatvec);
5697 + err |= rt_save_fpu_state(uc, regs);
5702 +static inline void push_cache(unsigned long vaddr)
5705 +// JKM -- need to add into the old cpushl cache stuff
5706 + cf_cache_push(__pa(vaddr), 8);
5710 +static inline void __user *
5711 +get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
5713 + unsigned long usp;
5715 + /* Default to using normal stack. */
5718 + /* This is the X/Open sanctioned signal stack switching. */
5719 + if (ka->sa.sa_flags & SA_ONSTACK) {
5720 + if (!sas_ss_flags(usp))
5721 + usp = current->sas_ss_sp + current->sas_ss_size;
5723 + return (void __user *)((usp - frame_size) & -8UL);
5726 +static void setup_frame(int sig, struct k_sigaction *ka,
5727 + sigset_t *set, struct pt_regs *regs)
5729 + struct sigframe __user *frame;
5730 + int fsize = frame_extra_sizes[regs->format];
5731 + struct sigcontext context;
5736 + printk(KERN_DEBUG "setup_frame: Unknown frame format %#x\n",
5739 + goto give_sigsegv;
5742 + frame = get_sigframe(ka, regs, sizeof(*frame));
5744 + err |= __put_user((current_thread_info()->exec_domain
5745 + && current_thread_info()->exec_domain->signal_invmap
5747 + ? current_thread_info()->exec_domain->signal_invmap[sig]
5751 + err |= __put_user(regs->vector, &frame->code);
5752 + err |= __put_user(&frame->sc, &frame->psc);
5754 + if (_NSIG_WORDS > 1)
5755 + err |= copy_to_user(frame->extramask, &set->sig[1],
5756 + sizeof(frame->extramask));
5758 + setup_sigcontext(&context, regs, set->sig[0]);
5759 + err |= copy_to_user(&frame->sc, &context, sizeof(context));
5761 + /* Set up to return from userspace. */
5762 + err |= __put_user(frame->retcode, &frame->pretcode);
5763 + /* moveq #,d0; trap #0 */
5764 + err |= __put_user(0x70004e40 + (__NR_sigreturn << 16),
5765 + (long __user *)(frame->retcode));
5768 + goto give_sigsegv;
5770 + push_cache((unsigned long) &frame->retcode);
5772 + /* Set up registers for signal handler */
5773 + wrusp((unsigned long) frame);
5774 + regs->pc = (unsigned long) ka->sa.sa_handler;
5777 + /* Prepare to skip over the extra stuff in the exception frame. */
5778 + if (regs->stkadj) {
5779 + struct pt_regs *tregs =
5780 + (struct pt_regs *)((ulong)regs + regs->stkadj);
5782 + printk(KERN_DEBUG "Performing stackadjust=%04x\n",
5785 + /* This must be copied with decreasing addresses to
5786 + handle overlaps. */
5787 + tregs->vector = 0;
5788 + tregs->format = 0;
5789 + tregs->pc = regs->pc;
5790 + tregs->sr = regs->sr;
5795 + force_sigsegv(sig, current);
5796 + goto adjust_stack;
5799 +static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
5800 + sigset_t *set, struct pt_regs *regs)
5802 + struct rt_sigframe __user *frame;
5803 + int fsize = frame_extra_sizes[regs->format];
5808 + printk(KERN_DEBUG "setup_frame: Unknown frame format %#x\n",
5811 + goto give_sigsegv;
5814 + frame = get_sigframe(ka, regs, sizeof(*frame));
5817 + err |= copy_to_user(&frame->uc.uc_extra, regs + 1, fsize);
5818 + regs->stkadj = fsize;
5821 + err |= __put_user((current_thread_info()->exec_domain
5822 + && current_thread_info()->exec_domain->signal_invmap
5824 + ? current_thread_info()->exec_domain->signal_invmap[sig]
5827 + err |= __put_user(&frame->info, &frame->pinfo);
5828 + err |= __put_user(&frame->uc, &frame->puc);
5829 + err |= copy_siginfo_to_user(&frame->info, info);
5831 + /* Create the ucontext. */
5832 + err |= __put_user(0, &frame->uc.uc_flags);
5833 + err |= __put_user(NULL, &frame->uc.uc_link);
5834 + err |= __put_user((void __user *)current->sas_ss_sp,
5835 + &frame->uc.uc_stack.ss_sp);
5836 + err |= __put_user(sas_ss_flags(rdusp()),
5837 + &frame->uc.uc_stack.ss_flags);
5838 + err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
5839 + err |= rt_setup_ucontext(&frame->uc, regs);
5840 + err |= copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
5842 + /* Set up to return from userspace. */
5843 + err |= __put_user(frame->retcode, &frame->pretcode);
5845 + /* moveq #,d0; andi.l #,D0; trap #0 */
5846 + err |= __put_user(0x70AD0280, (long *)(frame->retcode + 0));
5847 + err |= __put_user(0x000000ff, (long *)(frame->retcode + 4));
5848 + err |= __put_user(0x4e400000, (long *)(frame->retcode + 8));
5851 + goto give_sigsegv;
5853 + push_cache((unsigned long) &frame->retcode);
5855 + /* Set up registers for signal handler */
5856 + wrusp((unsigned long) frame);
5857 + regs->pc = (unsigned long) ka->sa.sa_handler;
5860 + /* Prepare to skip over the extra stuff in the exception frame. */
5861 + if (regs->stkadj) {
5862 + struct pt_regs *tregs =
5863 + (struct pt_regs *)((ulong)regs + regs->stkadj);
5865 + printk(KERN_DEBUG "Performing stackadjust=%04x\n",
5868 + /* This must be copied with decreasing addresses to
5869 + handle overlaps. */
5870 + tregs->vector = 0;
5871 + tregs->format = 0;
5872 + tregs->pc = regs->pc;
5873 + tregs->sr = regs->sr;
5878 + force_sigsegv(sig, current);
5879 + goto adjust_stack;
5883 +handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
5885 + switch (regs->d0) {
5886 + case -ERESTARTNOHAND:
5889 + regs->d0 = -EINTR;
5892 + case -ERESTARTSYS:
5893 + if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) {
5894 + regs->d0 = -EINTR;
5898 + case -ERESTARTNOINTR:
5900 + regs->d0 = regs->orig_d0;
5907 + * OK, we're invoking a handler
5910 +handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
5911 + sigset_t *oldset, struct pt_regs *regs)
5913 + /* are we from a system call? */
5914 + if (regs->orig_d0 >= 0)
5915 + /* If so, check system call restarting.. */
5916 + handle_restart(regs, ka, 1);
5918 + /* set up the stack frame */
5919 + if (ka->sa.sa_flags & SA_SIGINFO)
5920 + setup_rt_frame(sig, ka, info, oldset, regs);
5922 + setup_frame(sig, ka, oldset, regs);
5924 + if (ka->sa.sa_flags & SA_ONESHOT)
5925 + ka->sa.sa_handler = SIG_DFL;
5927 + spin_lock_irq(¤t->sighand->siglock);
5928 + sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask);
5929 + if (!(ka->sa.sa_flags & SA_NODEFER))
5930 + sigaddset(¤t->blocked, sig);
5931 + recalc_sigpending();
5932 + spin_unlock_irq(¤t->sighand->siglock);
5936 + * Note that 'init' is a special process: it doesn't get signals it doesn't
5937 + * want to handle. Thus you cannot kill init even with a SIGKILL even by
5940 +asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
5943 + struct k_sigaction ka;
5946 + current->thread.esp0 = (unsigned long) regs;
5949 + oldset = ¤t->blocked;
5951 + signr = get_signal_to_deliver(&info, &ka, regs, NULL);
5953 + /* Whee! Actually deliver the signal. */
5954 + handle_signal(signr, &ka, &info, oldset, regs);
5958 + /* Did we come from a system call? */
5959 + if (regs->orig_d0 >= 0)
5960 + /* Restart the system call - no handlers present */
5961 + handle_restart(regs, NULL, 0);
5966 +++ b/arch/m68k/coldfire/traps.c
5969 + * linux/arch/m68knommu/kernel/traps.c
5971 + * Copyright (C) 1993, 1994 by Hamish Macdonald
5973 + * 68040 fixes by Michael Rausch
5974 + * 68040 fixes by Martin Apel
5975 + * 68060 fixes by Roman Hodek
5976 + * 68060 fixes by Jesper Skov
5977 + * Coldfire fixes by Kurt Mahan
5979 + * This file is subject to the terms and conditions of the GNU General Public
5980 + * License. See the file COPYING in the main directory of this archive
5981 + * for more details.
5985 + * Sets up all exception vectors
5987 +#include <linux/sched.h>
5988 +#include <linux/signal.h>
5989 +#include <linux/kernel.h>
5990 +#include <linux/mm.h>
5991 +#include <linux/module.h>
5992 +#include <linux/types.h>
5993 +#include <linux/a.out.h>
5994 +#include <linux/user.h>
5995 +#include <linux/string.h>
5996 +#include <linux/linkage.h>
5997 +#include <linux/init.h>
5998 +#include <linux/ptrace.h>
5999 +#include <linux/kallsyms.h>
6001 +#include <asm/setup.h>
6002 +#include <asm/fpu.h>
6003 +#include <asm/system.h>
6004 +#include <asm/uaccess.h>
6005 +#include <asm/traps.h>
6006 +#include <asm/pgtable.h>
6007 +#include <asm/machdep.h>
6008 +#include <asm/siginfo.h>
6010 +static char const * const vec_names[] = {
6011 + "RESET SP", "RESET PC", "BUS ERROR", "ADDRESS ERROR",
6012 + "ILLEGAL INSTRUCTION", "ZERO DIVIDE", "CHK", "TRAPcc",
6013 + "PRIVILEGE VIOLATION", "TRACE", "LINE 1010", "LINE 1111",
6014 + "UNASSIGNED RESERVED 12", "COPROCESSOR PROTOCOL VIOLATION",
6015 + "FORMAT ERROR", "UNINITIALIZED INTERRUPT",
6016 + "UNASSIGNED RESERVED 16", "UNASSIGNED RESERVED 17",
6017 + "UNASSIGNED RESERVED 18", "UNASSIGNED RESERVED 19",
6018 + "UNASSIGNED RESERVED 20", "UNASSIGNED RESERVED 21",
6019 + "UNASSIGNED RESERVED 22", "UNASSIGNED RESERVED 23",
6020 + "SPURIOUS INTERRUPT", "LEVEL 1 INT", "LEVEL 2 INT", "LEVEL 3 INT",
6021 + "LEVEL 4 INT", "LEVEL 5 INT", "LEVEL 6 INT", "LEVEL 7 INT",
6022 + "SYSCALL", "TRAP #1", "TRAP #2", "TRAP #3",
6023 + "TRAP #4", "TRAP #5", "TRAP #6", "TRAP #7",
6024 + "TRAP #8", "TRAP #9", "TRAP #10", "TRAP #11",
6025 + "TRAP #12", "TRAP #13", "TRAP #14", "TRAP #15",
6026 + "FPCP BSUN", "FPCP INEXACT", "FPCP DIV BY 0", "FPCP UNDERFLOW",
6027 + "FPCP OPERAND ERROR", "FPCP OVERFLOW", "FPCP SNAN",
6028 + "FPCP UNSUPPORTED OPERATION",
6029 + "MMU CONFIGURATION ERROR"
6032 +asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
6033 + unsigned long error_code);
6034 +asmlinkage void trap_c(struct frame *fp);
6035 +extern void __init coldfire_trap_init(void);
6037 +void __init trap_init(void)
6039 + coldfire_trap_init();
6042 +/* The following table converts the FS encoding of a ColdFire
6043 + exception stack frame into the error_code value needed by
6046 +static const unsigned char fs_err_code[] = {
6066 +static const char *fs_err_msg[16] = {
6069 + "Interrupt during debug service routine",
6072 + "TLB X miss (opword)",
6073 + "TLB X miss (ext. word)",
6074 + "IFP in emulator mode",
6080 + "R/RMW Protection",
6082 + "OEP in emulator mode",
6086 +static inline void access_errorCF(struct frame *fp)
6088 + unsigned long int mmusr, complainingAddress;
6089 + unsigned int err_code, fs;
6090 + int need_page_fault;
6092 + mmusr = fp->ptregs.mmusr;
6093 + complainingAddress = fp->ptregs.mmuar;
6095 + printk(KERN_DEBUG "pc %#lx, mmusr %#lx, complainingAddress %#lx\n", \
6096 + fp->ptregs.pc, mmusr, complainingAddress);
6101 + * bit 0 == 0 means no page found, 1 means protection fault
6102 + * bit 1 == 0 means read, 1 means write
6105 + fs = (fp->ptregs.fs2 << 2) | fp->ptregs.fs1;
6107 + case 5: /* 0101 TLB opword X miss */
6108 + need_page_fault = cf_tlb_miss(&fp->ptregs, 0, 0, 0);
6109 + complainingAddress = fp->ptregs.pc;
6111 + case 6: /* 0110 TLB extension word X miss */
6112 + need_page_fault = cf_tlb_miss(&fp->ptregs, 0, 0, 1);
6113 + complainingAddress = fp->ptregs.pc + sizeof(long);
6115 + case 10: /* 1010 TLB W miss */
6116 + need_page_fault = cf_tlb_miss(&fp->ptregs, 1, 1, 0);
6118 + case 14: /* 1110 TLB R miss */
6119 + need_page_fault = cf_tlb_miss(&fp->ptregs, 0, 1, 0);
6123 + /* 0001 Reserved */
6124 + /* 0010 Interrupt during debug service routine */
6125 + /* 0011 Reserved */
6126 + /* 0100 X Protection */
6127 + /* 0111 IFP in emulator mode */
6128 + /* 1000 W Protection*/
6129 + /* 1001 Write error*/
6130 + /* 1011 Reserved*/
6131 + /* 1100 R Protection*/
6132 + /* 1101 R Protection*/
6133 + /* 1111 OEP in emulator mode*/
6134 + need_page_fault = 1;
6138 + if (need_page_fault) {
6139 + err_code = fs_err_code[fs];
6140 + if ((fs == 13) && (mmusr & MMUSR_WF)) /* rd-mod-wr access */
6141 + err_code |= 2; /* bit1 - write, bit0 - protection */
6142 + do_page_fault(&fp->ptregs, complainingAddress, err_code);
6146 +void die_if_kernel(char *str, struct pt_regs *fp, int nr)
6148 + if (!(fp->sr & PS_S))
6151 + console_verbose();
6152 + printk(KERN_EMERG "%s: %08x\n", str, nr);
6153 + printk(KERN_EMERG "PC: [<%08lx>]", fp->pc);
6154 + print_symbol(" %s", fp->pc);
6155 + printk(KERN_EMERG "\nSR: %04x SP: %p a2: %08lx\n",
6156 + fp->sr, fp, fp->a2);
6157 + printk(KERN_EMERG "d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
6158 + fp->d0, fp->d1, fp->d2, fp->d3);
6159 + printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
6160 + fp->d4, fp->d5, fp->a0, fp->a1);
6162 + printk(KERN_EMERG "Process %s (pid: %d, stackpage=%08lx)\n",
6163 + current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
6164 + show_stack(NULL, (unsigned long *)fp);
6168 +asmlinkage void buserr_c(struct frame *fp)
6172 + /* Only set esp0 if coming from user mode */
6173 + if (user_mode(&fp->ptregs))
6174 + current->thread.esp0 = (unsigned long) fp;
6176 + fs = (fp->ptregs.fs2 << 2) | fp->ptregs.fs1;
6178 + printk(KERN_DEBUG "*** Bus Error *** (%x)%s\n", fs,
6179 + fs_err_msg[fs & 0xf]);
6190 + access_errorCF(fp);
6193 + die_if_kernel("bad frame format", &fp->ptregs, 0);
6195 + printk(KERN_DEBUG "Unknown SIGSEGV - 4\n");
6197 + force_sig(SIGSEGV, current);
6202 +int kstack_depth_to_print = 48;
6204 +void show_stack(struct task_struct *task, unsigned long *stack)
6206 + unsigned long *endstack, addr, symaddr;
6207 + extern char _start, _etext;
6212 + stack = (unsigned long *)task->thread.ksp;
6214 + stack = (unsigned long *)&stack;
6217 + addr = (unsigned long) stack;
6218 + endstack = (unsigned long *) PAGE_ALIGN(addr);
6220 + printk(KERN_EMERG "Stack from %08lx:", (unsigned long)stack);
6221 + for (i = 0; i < kstack_depth_to_print; i++) {
6222 + if (stack + 1 > endstack)
6225 + printk("\n" KERN_EMERG " ");
6227 + printk(KERN_EMERG " %08lx", *stack++);
6228 + if ((symaddr >= 0xc0000000) && (symaddr < 0xc1000000))
6229 + print_symbol("(%s)", symaddr);
6233 + printk(KERN_EMERG "Call Trace:");
6235 + while (stack + 1 <= endstack) {
6238 + * If the address is either in the text segment of the
6239 + * kernel, or in the region which contains vmalloc'ed
6240 + * memory, it *may* be the address of a calling
6241 + * routine; if so, print it so that someone tracing
6242 + * down the cause of the crash will be able to figure
6243 + * out the call path that was taken.
6245 + if (((addr >= (unsigned long) &_start) &&
6246 + (addr <= (unsigned long) &_etext))) {
6248 + printk("\n" KERN_EMERG " ");
6249 + printk(KERN_EMERG " [<%08lx>]", addr);
6256 +void bad_super_trap(struct frame *fp)
6258 + console_verbose();
6259 + if (fp->ptregs.vector < sizeof(vec_names)/sizeof(vec_names[0]))
6260 + printk(KERN_WARNING "*** %s *** FORMAT=%X\n",
6261 + vec_names[fp->ptregs.vector],
6262 + fp->ptregs.format);
6264 + printk(KERN_WARNING "*** Exception %d *** FORMAT=%X\n",
6265 + fp->ptregs.vector,
6266 + fp->ptregs.format);
6267 + printk(KERN_WARNING "Current process id is %d\n", current->pid);
6268 + die_if_kernel("BAD KERNEL TRAP", &fp->ptregs, 0);
6271 +asmlinkage void trap_c(struct frame *fp)
6276 + if (fp->ptregs.sr & PS_S) {
6277 + if (fp->ptregs.vector == VEC_TRACE) {
6278 + /* traced a trapping instruction */
6279 + current->ptrace |= PT_DTRACE;
6281 + bad_super_trap(fp);
6285 + /* send the appropriate signal to the user program */
6286 + switch (fp->ptregs.vector) {
6288 + info.si_code = BUS_ADRALN;
6294 + info.si_code = ILL_ILLOPC;
6298 + info.si_code = ILL_PRVOPC;
6302 + info.si_code = ILL_COPROC;
6305 + case VEC_TRAP1: /* gdbserver breakpoint */
6306 + fp->ptregs.pc -= 2;
6307 + info.si_code = TRAP_TRACE;
6323 + info.si_code = ILL_ILLTRP;
6329 + info.si_code = FPE_FLTINV;
6333 + info.si_code = FPE_FLTRES;
6337 + info.si_code = FPE_FLTDIV;
6341 + info.si_code = FPE_FLTUND;
6345 + info.si_code = FPE_FLTOVF;
6349 + info.si_code = FPE_INTDIV;
6354 + info.si_code = FPE_INTOVF;
6357 + case VEC_TRACE: /* ptrace single step */
6358 + info.si_code = TRAP_TRACE;
6361 + case VEC_TRAP15: /* breakpoint */
6362 + info.si_code = TRAP_BRKPT;
6366 + info.si_code = ILL_ILLOPC;
6370 + info.si_signo = sig;
6371 + info.si_errno = 0;
6372 + switch (fp->ptregs.format) {
6374 + info.si_addr = (void *) fp->ptregs.pc;
6377 + info.si_addr = (void *) fp->un.fmt2.iaddr;
6380 + info.si_addr = (void *) fp->un.fmt7.effaddr;
6383 + info.si_addr = (void *) fp->un.fmt9.iaddr;
6386 + info.si_addr = (void *) fp->un.fmta.daddr;
6389 + info.si_addr = (void *) fp->un.fmtb.daddr;
6392 + force_sig_info(sig, &info, current);
6395 +asmlinkage void set_esp0(unsigned long ssp)
6397 + current->thread.esp0 = ssp;
6401 + * The architecture-independent backtrace generator
6403 +void dump_stack(void)
6405 + unsigned long stack;
6407 + show_stack(current, &stack);
6409 +EXPORT_SYMBOL(dump_stack);
6411 +#ifdef CONFIG_M68KFPU_EMU
6412 +asmlinkage void fpemu_signal(int signal, int code, void *addr)
6416 + info.si_signo = signal;
6417 + info.si_errno = 0;
6418 + info.si_code = code;
6419 + info.si_addr = addr;
6420 + force_sig_info(signal, &info, current);
6424 +++ b/arch/m68k/coldfire/usb/Makefile
6427 +# Makefile for the linux kernel.
6430 +# Object file lists.
6432 +ifneq ($(CONFIG_USB_EHCI_HCD),)
6433 + obj-y += otg_host.o
6436 +ifneq ($(CONFIG_USB_GADGET_MCF5445X),)
6437 + obj-y += otg_device.o
6440 +ifneq ($(strip $(CONFIG_USB_GADGET_MCF5445X) $(CONFIG_USB_EHCI_HCD)),)
6441 + obj-y += otg_cmn.o
6444 +ifneq ($(CONFIG_USB_OTG),)
6445 + obj-y += otg_otg.o
6449 +# USB Transceiver driver:
6450 +ifneq ($(strip $(CONFIG_USB) $(CONFIG_USB_GADGET_MCF5445X)),)
6455 +++ b/arch/m68k/coldfire/usb/otg_cmn.c
6458 + * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6462 + * The code contained herein is licensed under the GNU General Public
6463 + * License. You may obtain a copy of the GNU General Public License
6464 + * Version 2 or later at the following locations:
6466 + * http://www.opensource.org/licenses/gpl-license.html
6467 + * http://www.gnu.org/copyleft/gpl.html
6470 +#include <linux/module.h>
6471 +#include <linux/kernel.h>
6472 +#include <linux/types.h>
6473 +#include <linux/err.h>
6474 +#include <linux/errno.h>
6475 +#include <linux/init.h>
6476 +#include <linux/io.h>
6477 +#include <linux/irq.h>
6478 +#include <linux/platform_device.h>
6479 +#include <linux/delay.h>
6480 +#include <linux/fsl_devices.h>
6481 +#include <linux/usb/fsl_xcvr.h>
6483 +#include <asm/system.h>
6484 +#include <asm/coldfire.h>
6486 +extern void fsl_usb_enable_clk(void);
6487 +extern void fsl_usb_disable_clk(void);
6488 +extern int fsl_usb_mem_init(struct platform_device *pdev);
6490 +extern struct fsl_xcvr_ops *xc_ops[];
6492 +static int otg_used;
6494 +int usbotg_init(struct platform_device *pdev)
6496 + struct fsl_usb2_platform_data *pdata;
6497 + struct fsl_xcvr_ops *xops = xc_ops[USB_CTRLR_OTG];
6500 + pdata = (struct fsl_usb2_platform_data *)pdev->dev.platform_data;
6502 + pr_debug("%s: pdev=0x%p pdata=0x%p\n", __FUNCTION__, pdev, pdata);
6505 + printk(KERN_ERR "OTG transceiver ops missing\n");
6508 + pdata->xcvr_ops = xops;
6509 + pdata->xcvr_type = xops->xcvr_type;
6512 + /* request_mem_region and ioremap registers */
6513 + rc = fsl_usb_mem_init(pdev);
6517 + fsl_usb_enable_clk();
6524 + pr_debug("%s: success\n", __FUNCTION__);
6528 +void usbotg_uninit(struct platform_device *pdev)
6530 + struct fsl_usb2_platform_data *pdata;
6531 + pdata = (struct fsl_usb2_platform_data *)pdev->dev.platform_data;
6533 + pr_debug("%s\n", __FUNCTION__);
6537 + if (pdata->xcvr_ops && pdata->xcvr_ops->uninit)
6538 + pdata->xcvr_ops->uninit(pdev);
6540 + iounmap(pdata->regs);
6541 + release_mem_region(pdata->r_start, pdata->r_len);
6543 + pdata->regs = NULL;
6544 + pdata->r_start = pdata->r_len = 0;
6546 + fsl_usb_disable_clk();
6550 +struct fsl_usb2_platform_data mxc_otg_config = {
6552 + .platform_init = usbotg_init,
6553 + .platform_uninit = usbotg_uninit,
6555 + .big_endian_mmio = 1,
6556 + .big_endian_desc = 1,
6557 + .le_setup_buf = 1,
6559 + .power_budget = 500, /* 500 mA max power */
6560 + .max_ep_nr = 4, /* DDD read from a register ? */
6561 + .phy_mode = FSL_USB2_PHY_ULPI, /* DDD redundant with xcvr_type */
6564 +++ b/arch/m68k/coldfire/usb/otg_device.c
6567 + * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6571 + * The code contained herein is licensed under the GNU General Public
6572 + * License. You may obtain a copy of the GNU General Public License
6573 + * Version 2 or later at the following locations:
6575 + * http://www.opensource.org/licenses/gpl-license.html
6576 + * http://www.gnu.org/copyleft/gpl.html
6579 +#include <linux/module.h>
6580 +#include <linux/kernel.h>
6581 +#include <linux/types.h>
6582 +#include <linux/errno.h>
6583 +#include <linux/init.h>
6584 +#include <linux/io.h>
6585 +#include <linux/irq.h>
6586 +#include <linux/err.h>
6587 +#include <linux/platform_device.h>
6588 +#include <linux/usb/otg.h>
6589 +#include <linux/delay.h>
6590 +#include <linux/fsl_devices.h>
6591 +#include <linux/usb/fsl_xcvr.h>
6593 +#include <asm/system.h>
6594 +#include <asm/coldfire.h>
6596 +#define USB_OTGREGS_BASE MCF_REG32(0xFC0B0000)
6597 +#define INT_USB (64 + 64 + 47) /* INTC1:47 16.2.9.1 */
6598 +#define INT_UOCSR (64 + 64 + 53) /* INTC1:53 16.2.9.1 */
6600 +extern int usbotg_init(struct platform_device *pdev);
6601 +extern void usbotg_uninit(struct fsl_usb2_platform_data *pdata);
6602 +extern struct fsl_usb2_platform_data mxc_otg_config;
6604 +struct platform_device otg_udc_device;
6607 + * OTG Gadget device
6610 +static void usb_release(struct device *dev)
6612 + /* normally not freed */
6615 +static u64 udc_dmamask = ~(u32) 0;
6616 +static struct resource otg_udc_resources[] = {
6618 + .start = (u32) (&USB_OTGREGS_BASE),
6619 + .end = (u32) (&USB_OTGREGS_BASE + 0x1ff),
6620 + .flags = IORESOURCE_MEM,
6624 + .flags = IORESOURCE_IRQ,
6629 +struct platform_device otg_udc_device = {
6630 + .name = "fsl-usb2-udc",
6633 + .release = usb_release,
6634 + .dma_mask = &udc_dmamask,
6635 + .coherent_dma_mask = 0xffffffff,
6636 + .platform_data = &mxc_otg_config,
6638 + .resource = otg_udc_resources,
6639 + .num_resources = ARRAY_SIZE(otg_udc_resources),
6642 +static int __init udc_init(void)
6644 + int rc __attribute((unused));
6646 + rc = platform_device_register(&otg_udc_device);
6648 + printk(KERN_ERR "usb: can't register OTG Gadget, rc=%d\n", rc);
6650 + printk(KERN_INFO "usb: OTG Gadget registered\n");
6654 +subsys_initcall(udc_init);
6656 +++ b/arch/m68k/coldfire/usb/otg_host.c
6659 + * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6663 + * The code contained herein is licensed under the GNU General Public
6664 + * License. You may obtain a copy of the GNU General Public License
6665 + * Version 2 or later at the following locations:
6667 + * http://www.opensource.org/licenses/gpl-license.html
6668 + * http://www.gnu.org/copyleft/gpl.html
6671 +#include <linux/module.h>
6672 +#include <linux/kernel.h>
6673 +#include <linux/types.h>
6674 +#include <linux/errno.h>
6675 +#include <linux/init.h>
6676 +#include <linux/io.h>
6677 +#include <linux/irq.h>
6678 +#include <linux/err.h>
6679 +#include <linux/platform_device.h>
6680 +#include <linux/delay.h>
6681 +#include <linux/fsl_devices.h>
6682 +#include <linux/usb/fsl_xcvr.h>
6684 +#include <asm/system.h>
6685 +#include <asm/mcfsim.h>
6687 +#define USB_OTGREGS_BASE MCF_REG32(0xFC0B0000)
6688 +#define INT_USB (64 + 64 + 47) /* INTC1:47 16.2.9.1 */
6689 +#define INT_UOCSR (64 + 64 + 53) /* INTC1:53 16.2.9.1 */
6691 +struct platform_device *otg_host_device;
6693 +extern struct platform_device *host_pdev_register(struct resource *res,
6695 + struct fsl_usb2_platform_data
6698 +extern int usbotg_init(struct platform_device *pdev);
6699 +extern void usbotg_uninit(struct fsl_usb2_platform_data *pdata);
6700 +extern struct fsl_usb2_platform_data mxc_otg_config;
6705 +static struct resource otg_host_resources[] = {
6707 + .start = (u32) (&USB_OTGREGS_BASE),
6708 + .end = (u32) (&USB_OTGREGS_BASE + 0x1ff),
6709 + .flags = IORESOURCE_MEM,
6713 + .flags = IORESOURCE_IRQ,
6717 +static int __init otg_host_init(void)
6719 + otg_host_device = host_pdev_register(otg_host_resources,
6720 + ARRAY_SIZE(otg_host_resources),
6725 +subsys_initcall(otg_host_init);
6727 +++ b/arch/m68k/coldfire/usb/otg_otg.c
6730 + * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6734 + * The code contained herein is licensed under the GNU General Public
6735 + * License. You may obtain a copy of the GNU General Public License
6736 + * Version 2 or later at the following locations:
6738 + * http://www.opensource.org/licenses/gpl-license.html
6739 + * http://www.gnu.org/copyleft/gpl.html
6743 + * platform_device registration for ULPI OTG device
6746 +#include <linux/module.h>
6747 +#include <linux/kernel.h>
6748 +#include <linux/types.h>
6749 +#include <linux/errno.h>
6750 +#include <linux/init.h>
6751 +#include <linux/err.h>
6752 +#include <linux/platform_device.h>
6753 +#include <linux/fsl_devices.h>
6755 +#include <asm/mcfsim.h>
6757 +#define USB_OTGREGS_BASE MCF_REG32(0xFC0B0000)
6758 +#define INT_USB (64 + 64 + 47) /* INTC1:47 16.2.9.1 */
6759 +#define INT_UOCSR (64 + 64 + 53) /* INTC1:53 16.2.9.1 */
6761 +extern int usbotg_init(struct platform_device *pdev);
6762 +extern void usbotg_uninit(struct fsl_usb2_platform_data *pdata);
6763 +extern struct fsl_usb2_platform_data mxc_otg_config;
6765 +static void otg_otg_release(struct device *dev)
6767 + /* normally not freed */
6771 +static struct resource otg_otg_resources[] = {
6773 + .start = (u32) (&USB_OTGREGS_BASE),
6774 + .end = (u32) (&USB_OTGREGS_BASE + 0x1ff),
6775 + .flags = IORESOURCE_MEM,
6779 + .flags = IORESOURCE_IRQ,
6786 +static u64 otg_otg_dmamask = ~(u32) 0;
6787 +static struct platform_device otg_otg_device = {
6788 + .name = "fsl-usb2-otg",
6791 + .release = otg_otg_release,
6792 + .dma_mask = &otg_otg_dmamask,
6793 + .coherent_dma_mask = 0xffffffff,
6794 + .platform_data = &mxc_otg_config,
6796 + .resource = otg_otg_resources,
6797 + .num_resources = ARRAY_SIZE(otg_otg_resources),
6801 +static int __init mx31_otg_otg_init(void)
6805 + pr_debug("register OTG otg res=0x%p, size=%d\n",
6806 + otg_otg_device.resource, otg_otg_device.num_resources);
6808 + rc = platform_device_register(&otg_otg_device);
6810 + pr_debug("can't register ULPI OTG dvc, %d\n", rc);
6812 + printk(KERN_INFO "usb: OTG ULPI transceiver registered\n");
6813 + pr_debug("otg_otg_device=0x%p resources=0x%p.\n",
6814 + &otg_otg_device, otg_otg_device.resource);
6820 +subsys_initcall(mx31_otg_otg_init);
6822 +MODULE_AUTHOR("Freescale Semiconductor, Inc.");
6823 +MODULE_DESCRIPTION("ULPI OTG device registration");
6824 +MODULE_LICENSE("GPL");
6826 +++ b/arch/m68k/coldfire/usb/xcvr.c
6829 + * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6833 + * The code contained herein is licensed under the GNU General Public
6834 + * License. You may obtain a copy of the GNU General Public License
6835 + * Version 2 or later at the following locations:
6837 + * http://www.opensource.org/licenses/gpl-license.html
6838 + * http://www.gnu.org/copyleft/gpl.html
6841 +#include <linux/module.h>
6842 +#include <linux/kernel.h>
6843 +#include <linux/types.h>
6844 +#include <linux/errno.h>
6845 +#include <linux/init.h>
6846 +#include <linux/err.h>
6847 +#include <linux/platform_device.h>
6848 +#include <linux/delay.h>
6849 +#include <linux/fsl_devices.h>
6850 +#include <linux/usb/fsl_xcvr.h>
6851 +#include <linux/usb/fsl_usb2.h>
6853 +#include <asm/mcfsim.h>
6855 +extern void fsl_usb_xcvr_register(struct fsl_xcvr_ops *xcvr_ops);
6856 +extern void fsl_usb_xcvr_unregister(enum fsl_usb_ctrlr ctrlr);
6858 +#define MCF_SCM_BCR MCF_REG32(0xFC040024)
6859 +#define MCF_SCM_BCR_GBR (1 << 9) /* global bursts for read */
6860 +#define MCF_SCM_BCR_GBW (1 << 8) /* global bursts for write */
6861 +#define MCF_SCM_BCR_SBE_ALL (0xff << 0) /* slave burst enable */
6865 +void print_ulpi_regs(void)
6867 + pr_debug("MCF_SCM_BCR=0x%08lx MCF_CCM_MISCCR=0x%08x "
6868 + "MCF_GPIO_PAR_DMA=0x%08x MCF_GPIO_PAR_USB=08%08x "
6869 + "MCF_GPIO_PAR_FEC=08%08x\n",
6870 + MCF_SCM_BCR, MCF_CCM_MISCCR, MCF_GPIO_PAR_DMA,
6871 + MCF_GPIO_PAR_USB, MCF_GPIO_PAR_FEC);
6873 +EXPORT_SYMBOL(print_ulpi_regs);
6877 +static void xcvr_init(struct platform_device *pdev)
6879 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
6880 + struct fsl_xcvr_ops *this = pdata->xcvr_ops;
6881 + struct fsl_usb_host_regs *regs = pdata->regs;
6883 + pr_debug("%s: ctrlr=%d pdata=0x%p regs=0x%p\n", __FUNCTION__,
6884 + this->ctrlr, pdata, pdata->regs);
6886 + /* enable USB read, write and slave bursts */
6887 + MCF_SCM_BCR = MCF_SCM_BCR_GBR | MCF_SCM_BCR_GBW | MCF_SCM_BCR_SBE_ALL;
6889 + /* Use external clock source if PLL isn't a multiple of 60MHz */
6890 + MCF_CCM_MISCCR &= ~MCF_CCM_MISCCR_USBSRC;
6892 + /* Initialize the USB Clock: use USB input clock */
6893 + MCF_GPIO_PAR_DMA = (MCF_GPIO_PAR_DMA & MCF_GPIO_PAR_DMA_DREQ1_MASK) |
6894 + MCF_GPIO_PAR_DMA_DREQ1_USB_CLKIN;
6896 + switch (this->xcvr_type) {
6897 + case PORTSCX_PTS_ULPI:
6898 + /* Enable the required ULPI signals */
6899 + MCF_GPIO_PAR_DMA = (MCF_GPIO_PAR_DMA &
6900 + MCF_GPIO_PAR_DMA_DACK1_MASK) |
6901 + MCF_GPIO_PAR_DMA_DACK1_ULPI_DIR;
6903 + MCF_GPIO_PAR_USB = MCF_GPIO_PAR_USB_VBUSEN_ULPI_NXT |
6904 + MCF_GPIO_PAR_USB_VBUSOC_ULPI_STP;
6906 + MCF_GPIO_PAR_FEC = (MCF_GPIO_PAR_FEC &
6907 + MCF_GPIO_PAR_FEC_FEC0_MASK) |
6908 + MCF_GPIO_PAR_FEC_FEC0_RMII_ULPI;
6910 + case PORTSCX_PTS_ONCHIP:
6911 + /* Enable VBUS_EN and VBUS_OC signals */
6912 + MCF_GPIO_PAR_USB = MCF_GPIO_PAR_USB_VBUSEN_VBUSEN |
6913 + MCF_GPIO_PAR_USB_VBUSOC_VBUSOC;
6915 + /* Setup USB_VBUS_OC signal to be active-low */
6916 + MCF_CCM_MISCCR |= MCF_CCM_MISCCR_USBOC;
6921 + pr_debug("®s->portsc1=0x%p old portsc1=0x%x \n", ®s->portsc1,
6924 + regs->portsc1 &= ~PORTSCX_PTS_MASK;
6925 + regs->portsc1 |= this->xcvr_type;
6928 + * need to reset the controller here so that the ID pin
6929 + * is correctly detected.
6931 + regs->usbcmd |= USB_CMD_CTRL_RESET;
6934 + * allow controller to reset, and leave time for
6935 + * the ULPI transceiver to reset too.
6939 + pr_debug("DDD %s: done. portsc1=0x%x\n", __FUNCTION__, regs->portsc1);
6942 +static void xcvr_uninit(struct platform_device *pdev)
6944 + pr_debug("%s: pdev=0x%p\n", __FUNCTION__, pdev);
6948 +struct fsl_xcvr_ops xcvr_ops_otg = {
6949 + .ctrlr = USB_CTRLR_OTG,
6950 + .init = xcvr_init,
6951 + .uninit = xcvr_uninit,
6953 +#ifdef CONFIG_USB_M5445X_ULPI
6954 + .xcvr_type = PORTSCX_PTS_ULPI,
6955 +#elif defined CONFIG_USB_M5445X_FSLS
6956 + .xcvr_type = PORTSCX_PTS_ONCHIP,
6958 +#error "Invalid USB transceiver selection."
6962 +static int __init usb_xcvr_init(void)
6964 + pr_debug("%s\n", __FUNCTION__);
6966 + fsl_usb_xcvr_register(&xcvr_ops_otg);
6968 + pr_debug("%s done\n", __FUNCTION__);
6972 +static void __exit usb_xcvr_exit(void)
6974 + fsl_usb_xcvr_unregister(USB_CTRLR_OTG);
6977 +module_init(usb_xcvr_init);
6978 +module_exit(usb_xcvr_exit);
6980 +MODULE_AUTHOR("Freescale Semiconductor, Inc.");
6981 +MODULE_DESCRIPTION("External ULPI xcvr driver");
6982 +MODULE_LICENSE("GPL");
6985 +++ b/arch/m68k/coldfire/usb.c
6989 + * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6991 + * otg_{get,set}_transceiver() are from arm/plat-omap/usb.c.
6992 + * which is Copyright (C) 2004 Texas Instruments, Inc.
6996 + * The code contained herein is licensed under the GNU General Public
6997 + * License. You may obtain a copy of the GNU General Public License
6998 + * Version 2 or later at the following locations:
7000 + * http://www.opensource.org/licenses/gpl-license.html
7001 + * http://www.gnu.org/copyleft/gpl.html
7004 +#include <linux/module.h>
7005 +#include <linux/kernel.h>
7006 +#include <linux/types.h>
7007 +#include <linux/errno.h>
7008 +#include <linux/init.h>
7009 +#include <linux/io.h>
7010 +#include <linux/err.h>
7011 +#include <linux/platform_device.h>
7012 +#include <linux/usb/otg.h>
7013 +#include <linux/delay.h>
7014 +#include <linux/fsl_devices.h>
7015 +#include <linux/usb/fsl_xcvr.h>
7018 +/* The dmamask must be set for EHCI to work */
7019 +static u64 ehci_dmamask = ~(u32) 0;
7021 +struct fsl_xcvr_ops *xc_ops[3] = { NULL };
7023 +void fsl_usb_enable_clk(void)
7026 +EXPORT_SYMBOL(fsl_usb_enable_clk);
7028 +void fsl_usb_disable_clk(void)
7031 +EXPORT_SYMBOL(fsl_usb_disable_clk);
7033 +void fsl_usb_xcvr_register(struct fsl_xcvr_ops *xcvr_ops)
7035 + pr_debug("%s ctrlr=%d\n", __FUNCTION__, xcvr_ops->ctrlr);
7036 + xc_ops[xcvr_ops->ctrlr] = xcvr_ops;
7039 +EXPORT_SYMBOL(fsl_usb_xcvr_register);
7041 +void fsl_usb_xcvr_unregister(enum fsl_usb_ctrlr ctrlr)
7043 + pr_debug("%s ctrlr=%d\n", __FUNCTION__, ctrlr);
7044 + xc_ops[ctrlr] = NULL;
7046 +EXPORT_SYMBOL(fsl_usb_xcvr_unregister);
7049 + * Register an instance of a USB host platform device.
7051 + * @param res: resource pointer
7052 + * @param n_res: number of resources
7053 + * @param config: config pointer
7055 + * @return newly-registered platform_device
7057 + * DDD fix this comment:
7058 + * The USB controller supports 3 host interfaces, and the
7059 + * kernel can be configured to support some number of them.
7060 + * Each supported host interface is registered as an instance
7061 + * of the "fsl-ehci" device. Call this function multiple times
7062 + * to register each host interface.
7064 +static int instance_id;
7065 +struct platform_device *host_pdev_register(struct resource *res, int n_res,
7066 + struct fsl_usb2_platform_data *config)
7068 + struct platform_device *pdev;
7070 + pr_debug("register host res=0x%p, size=%d\n", res, n_res);
7072 + pdev = platform_device_register_simple("fsl-ehci",
7073 + instance_id, res, n_res);
7074 + if (IS_ERR(pdev)) {
7075 + printk(KERN_ERR "usb: can't register %s Host, %ld\n",
7076 + config->name, PTR_ERR(pdev));
7080 + pdev->dev.coherent_dma_mask = 0xffffffff;
7081 + pdev->dev.dma_mask = &ehci_dmamask;
7084 + * platform_device_add_data() makes a copy of
7085 + * the platform_data passed in. That makes it
7086 + * impossible to share the same config struct for
7087 + * all OTG devices (host,gadget,otg). So, just
7088 + * set the platform_data pointer ourselves.
7090 + pdev->dev.platform_data = config;
7092 + printk(KERN_INFO "usb: %s Host registered\n", config->name);
7093 + pr_debug("pdev=0x%p dev=0x%p resources=0x%p pdata=0x%p\n",
7094 + pdev, &pdev->dev, pdev->resource, pdev->dev.platform_data);
7102 +int fsl_usb_mem_init(struct platform_device *pdev)
7104 + struct resource *res;
7105 + struct fsl_usb2_platform_data *pdata;
7107 + pdata = (struct fsl_usb2_platform_data *)pdev->dev.platform_data;
7109 + pr_debug("%s: pdev=0x%p pdata=0x%p\n", __FUNCTION__, pdev, pdata);
7111 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
7113 + dev_err(&pdev->dev, "no MEM resource.\n");
7117 + pdata->r_start = res->start;
7118 + pdata->r_len = res->end - res->start + 1;
7119 + pr_debug("%s: MEM resource start=0x%x len=0x%x\n", pdata->name,
7120 + res->start, pdata->r_len);
7122 + if (!request_mem_region(pdata->r_start, pdata->r_len, "OTG")) {
7123 + dev_err(&pdev->dev, "request_mem_region failed\n");
7126 + pdata->regs = ioremap(pdata->r_start, pdata->r_len);
7127 + pr_debug("ioremapped to 0x%p\n", pdata->regs);
7129 + if (pdata->regs == NULL) {
7130 + dev_err(&pdev->dev, "ioremap failed\n");
7131 + release_mem_region(pdata->r_start, pdata->r_len);
7135 + pr_debug("%s: success\n", __FUNCTION__);
7140 +#if defined(CONFIG_USB_OTG)
7141 +static struct otg_transceiver *xceiv;
7144 + * otg_get_transceiver - find the (single) OTG transceiver driver
7146 + * Returns the transceiver driver, after getting a refcount to it; or
7147 + * null if there is no such transceiver. The caller is responsible for
7148 + * releasing that count.
7150 +struct otg_transceiver *otg_get_transceiver(void)
7152 + pr_debug("%s xceiv=0x%p\n", __FUNCTION__, xceiv);
7154 + get_device(xceiv->dev);
7157 +EXPORT_SYMBOL(otg_get_transceiver);
7159 +int otg_set_transceiver(struct otg_transceiver *x)
7161 + pr_debug("%s xceiv=0x%p x=0x%p\n", __FUNCTION__, xceiv, x);
7167 +EXPORT_SYMBOL(otg_set_transceiver);
7170 +++ b/arch/m68k/coldfire/vmlinux-cf.lds
7172 +/* ld script to make m68k Coldfire Linux kernel
7174 + * Derived from arch/m68k/kernel/vmlinux-std.lds
7176 + * Updated 11/26/2007 for new CodeSourcery toolset
7177 + * by Kurt Mahan <kmahan@freescale.com>
7180 +#define LOAD_OFFSET 0x00000000
7182 +#include <asm-generic/vmlinux.lds.h>
7183 +#include <asm/page_offset.h>
7185 +#define START_OFFSET 0x00020000
7186 +#define IMAGE_START PAGE_OFFSET_RAW + START_OFFSET
7188 +OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
7191 +jiffies = jiffies_64 + 4;
7196 + .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
7197 + _text = .; /* Text and read-only data */
7201 + .text : AT(ADDR(.text) - LOAD_OFFSET) {
7208 + _etext = .; /* End of text section */
7211 + __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
7212 + __start___ex_table = .;
7214 + __stop___ex_table = .;
7220 + .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
7227 + .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET ) {
7228 + *(.data.cacheline_aligned)
7231 + _edata = .; /* End of data section */
7233 + NOTES /* support ld --build-id */
7235 + . = ALIGN(8192); /* Initrd */
7236 + .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
7243 + .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
7248 + .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
7249 + __setup_start = .;
7254 + .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
7255 + __initcall_start = .;
7257 + __initcall_end = .;
7260 + .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
7261 + __con_initcall_start = .;
7262 + *(.con_initcall.init)
7263 + __con_initcall_end = .;
7268 +#ifdef CONFIG_BLK_DEV_INITRD
7270 + .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
7271 + __initramfs_start = .;
7273 + __initramfs_end = .;
7280 + .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
7281 + *(.data.init_task) /* The initial task and kernel stack */
7285 + .bss : AT(ADDR(.bss) - LOAD_OFFSET) { /* BSS */
7292 + /* Sections to be discarded */
7299 + /* Stabs debugging sections. */
7303 +++ b/arch/m68k/configs/55_defconfig
7306 +# Automatically generated make config: don't edit
7307 +# Linux kernel version: 2.6.25
7308 +# Thu Jun 26 16:17:41 2008
7312 +# CONFIG_GENERIC_TIME is not set
7313 +# CONFIG_GENERIC_CLOCKEVENTS is not set
7314 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
7315 +# CONFIG_ARCH_HAS_ILOG2_U32 is not set
7316 +# CONFIG_ARCH_HAS_ILOG2_U64 is not set
7317 +CONFIG_GENERIC_HWEIGHT=y
7318 +CONFIG_GENERIC_CALIBRATE_DELAY=y
7319 +CONFIG_TIME_LOW_RES=y
7320 +CONFIG_GENERIC_IOMAP=y
7321 +# CONFIG_NO_IOPORT is not set
7322 +# CONFIG_NO_DMA is not set
7323 +CONFIG_ARCH_SUPPORTS_AOUT=y
7325 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
7330 +CONFIG_EXPERIMENTAL=y
7331 +CONFIG_BROKEN_ON_SMP=y
7332 +CONFIG_INIT_ENV_ARG_LIMIT=32
7333 +CONFIG_LOCALVERSION=""
7334 +CONFIG_LOCALVERSION_AUTO=y
7337 +CONFIG_SYSVIPC_SYSCTL=y
7338 +# CONFIG_POSIX_MQUEUE is not set
7339 +# CONFIG_BSD_PROCESS_ACCT is not set
7340 +# CONFIG_TASKSTATS is not set
7341 +# CONFIG_AUDIT is not set
7343 +CONFIG_IKCONFIG_PROC=y
7344 +CONFIG_LOG_BUF_SHIFT=17
7345 +# CONFIG_CGROUPS is not set
7346 +CONFIG_GROUP_SCHED=y
7347 +CONFIG_FAIR_GROUP_SCHED=y
7348 +# CONFIG_RT_GROUP_SCHED is not set
7349 +CONFIG_USER_SCHED=y
7350 +# CONFIG_CGROUP_SCHED is not set
7351 +CONFIG_SYSFS_DEPRECATED=y
7352 +CONFIG_SYSFS_DEPRECATED_V2=y
7353 +# CONFIG_RELAY is not set
7354 +CONFIG_NAMESPACES=y
7355 +# CONFIG_UTS_NS is not set
7356 +# CONFIG_IPC_NS is not set
7357 +# CONFIG_USER_NS is not set
7358 +# CONFIG_PID_NS is not set
7359 +# CONFIG_BLK_DEV_INITRD is not set
7360 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
7362 +# CONFIG_EMBEDDED is not set
7364 +CONFIG_SYSCTL_SYSCALL=y
7366 +# CONFIG_KALLSYMS_ALL is not set
7367 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
7372 +CONFIG_COMPAT_BRK=y
7375 +CONFIG_ANON_INODES=y
7381 +CONFIG_VM_EVENT_COUNTERS=y
7383 +# CONFIG_SLUB is not set
7384 +# CONFIG_SLOB is not set
7385 +# CONFIG_PROFILING is not set
7386 +# CONFIG_MARKERS is not set
7387 +# CONFIG_HAVE_OPROFILE is not set
7388 +# CONFIG_HAVE_KPROBES is not set
7389 +# CONFIG_HAVE_KRETPROBES is not set
7390 +CONFIG_PROC_PAGE_MONITOR=y
7392 +CONFIG_RT_MUTEXES=y
7393 +# CONFIG_TINY_SHMEM is not set
7394 +CONFIG_BASE_SMALL=0
7396 +CONFIG_MODULE_UNLOAD=y
7397 +CONFIG_MODULE_FORCE_UNLOAD=y
7398 +# CONFIG_MODVERSIONS is not set
7399 +# CONFIG_MODULE_SRCVERSION_ALL is not set
7400 +# CONFIG_KMOD is not set
7403 +# CONFIG_BLK_DEV_IO_TRACE is not set
7404 +# CONFIG_LSF is not set
7405 +# CONFIG_BLK_DEV_BSG is not set
7410 +CONFIG_IOSCHED_NOOP=y
7411 +CONFIG_IOSCHED_AS=y
7412 +CONFIG_IOSCHED_DEADLINE=y
7413 +CONFIG_IOSCHED_CFQ=y
7414 +# CONFIG_DEFAULT_AS is not set
7415 +# CONFIG_DEFAULT_DEADLINE is not set
7416 +CONFIG_DEFAULT_CFQ=y
7417 +# CONFIG_DEFAULT_NOOP is not set
7418 +CONFIG_DEFAULT_IOSCHED="cfq"
7419 +CONFIG_CLASSIC_RCU=y
7422 +# Platform dependent setup
7424 +# CONFIG_SUN3 is not set
7427 +# CONFIG_AMIGA is not set
7428 +# CONFIG_ATARI is not set
7429 +# CONFIG_PCI is not set
7430 +# CONFIG_MAC is not set
7431 +# CONFIG_APOLLO is not set
7432 +# CONFIG_VME is not set
7433 +# CONFIG_HP300 is not set
7434 +# CONFIG_SUN3X is not set
7435 +# CONFIG_Q40 is not set
7440 +# CONFIG_M68020 is not set
7441 +# CONFIG_M68030 is not set
7442 +# CONFIG_M68040 is not set
7443 +# CONFIG_M68060 is not set
7445 +# CONFIG_M54451 is not set
7447 +# CONFIG_M54451EVB is not set
7449 +# CONFIG_M547X_8X is not set
7450 +CONFIG_MCFCLK=266666666
7451 +# CONFIG_MCF_USER_HALT is not set
7453 +CONFIG_SDRAM_BASE=0x40000000
7454 +CONFIG_SDRAM_SIZE=0x10000000
7455 +CONFIG_NOR_FLASH_BASE=0x00000000
7456 +# CONFIG_M68KFPU_EMU is not set
7458 +# CONFIG_RMW_INSNS is not set
7459 +CONFIG_SINGLE_MEMORY_CHUNK=y
7460 +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
7461 +CONFIG_SELECT_MEMORY_MODEL=y
7462 +CONFIG_FLATMEM_MANUAL=y
7463 +# CONFIG_DISCONTIGMEM_MANUAL is not set
7464 +# CONFIG_SPARSEMEM_MANUAL is not set
7466 +CONFIG_FLAT_NODE_MEM_MAP=y
7467 +CONFIG_NEED_MULTIPLE_NODES=y
7468 +# CONFIG_SPARSEMEM_STATIC is not set
7469 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
7470 +CONFIG_SPLIT_PTLOCK_CPUS=4
7471 +# CONFIG_RESOURCES_64BIT is not set
7472 +CONFIG_ZONE_DMA_FLAG=1
7474 +CONFIG_VIRT_TO_BUS=y
7479 +CONFIG_BINFMT_ELF=y
7480 +# CONFIG_BINFMT_AOUT is not set
7481 +# CONFIG_BINFMT_MISC is not set
7482 +CONFIG_PROC_HARDWARE=y
7484 +# CONFIG_ARCH_SUPPORTS_MSI is not set
7487 +# Power management options
7489 +# CONFIG_PM is not set
7497 +# Networking options
7500 +# CONFIG_PACKET_MMAP is not set
7503 +# CONFIG_XFRM_USER is not set
7504 +# CONFIG_XFRM_SUB_POLICY is not set
7505 +# CONFIG_XFRM_MIGRATE is not set
7506 +# CONFIG_XFRM_STATISTICS is not set
7508 +# CONFIG_NET_KEY_MIGRATE is not set
7510 +# CONFIG_IP_MULTICAST is not set
7511 +CONFIG_IP_ADVANCED_ROUTER=y
7512 +CONFIG_ASK_IP_FIB_HASH=y
7513 +# CONFIG_IP_FIB_TRIE is not set
7514 +CONFIG_IP_FIB_HASH=y
7515 +# CONFIG_IP_MULTIPLE_TABLES is not set
7516 +# CONFIG_IP_ROUTE_MULTIPATH is not set
7517 +# CONFIG_IP_ROUTE_VERBOSE is not set
7519 +# CONFIG_IP_PNP_DHCP is not set
7520 +# CONFIG_IP_PNP_BOOTP is not set
7521 +# CONFIG_IP_PNP_RARP is not set
7522 +# CONFIG_NET_IPIP is not set
7523 +# CONFIG_NET_IPGRE is not set
7524 +# CONFIG_ARPD is not set
7525 +# CONFIG_SYN_COOKIES is not set
7528 +# CONFIG_INET_IPCOMP is not set
7529 +# CONFIG_INET_XFRM_TUNNEL is not set
7530 +# CONFIG_INET_TUNNEL is not set
7531 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
7532 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
7533 +# CONFIG_INET_XFRM_MODE_BEET is not set
7534 +# CONFIG_INET_LRO is not set
7536 +CONFIG_INET_TCP_DIAG=y
7537 +# CONFIG_TCP_CONG_ADVANCED is not set
7538 +CONFIG_TCP_CONG_CUBIC=y
7539 +CONFIG_DEFAULT_TCP_CONG="cubic"
7540 +# CONFIG_TCP_MD5SIG is not set
7541 +# CONFIG_IPV6 is not set
7542 +# CONFIG_INET6_XFRM_TUNNEL is not set
7543 +# CONFIG_INET6_TUNNEL is not set
7544 +# CONFIG_NETWORK_SECMARK is not set
7545 +# CONFIG_NETFILTER is not set
7546 +# CONFIG_IP_DCCP is not set
7547 +# CONFIG_IP_SCTP is not set
7548 +# CONFIG_TIPC is not set
7549 +# CONFIG_ATM is not set
7550 +# CONFIG_BRIDGE is not set
7551 +# CONFIG_VLAN_8021Q is not set
7552 +# CONFIG_DECNET is not set
7553 +# CONFIG_LLC2 is not set
7554 +# CONFIG_IPX is not set
7555 +# CONFIG_ATALK is not set
7556 +# CONFIG_X25 is not set
7557 +# CONFIG_LAPB is not set
7558 +# CONFIG_ECONET is not set
7559 +# CONFIG_WAN_ROUTER is not set
7560 +# CONFIG_NET_SCHED is not set
7565 +# CONFIG_NET_PKTGEN is not set
7566 +# CONFIG_HAMRADIO is not set
7567 +# CONFIG_CAN is not set
7568 +# CONFIG_IRDA is not set
7569 +# CONFIG_BT is not set
7570 +# CONFIG_AF_RXRPC is not set
7575 +# CONFIG_CFG80211 is not set
7576 +# CONFIG_WIRELESS_EXT is not set
7577 +# CONFIG_MAC80211 is not set
7578 +# CONFIG_IEEE80211 is not set
7579 +# CONFIG_RFKILL is not set
7580 +# CONFIG_NET_9P is not set
7587 +# Generic Driver Options
7589 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
7590 +# CONFIG_STANDALONE is not set
7591 +CONFIG_PREVENT_FIRMWARE_BUILD=y
7593 +# CONFIG_DEBUG_DRIVER is not set
7594 +# CONFIG_DEBUG_DEVRES is not set
7595 +# CONFIG_SYS_HYPERVISOR is not set
7596 +# CONFIG_CONNECTOR is not set
7597 +# CONFIG_MTD is not set
7598 +# CONFIG_PARPORT is not set
7600 +# CONFIG_BLK_DEV_COW_COMMON is not set
7601 +CONFIG_BLK_DEV_LOOP=y
7602 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
7603 +# CONFIG_BLK_DEV_NBD is not set
7604 +CONFIG_BLK_DEV_RAM=y
7605 +CONFIG_BLK_DEV_RAM_COUNT=16
7606 +CONFIG_BLK_DEV_RAM_SIZE=64000
7607 +# CONFIG_BLK_DEV_XIP is not set
7608 +# CONFIG_CDROM_PKTCDVD is not set
7609 +# CONFIG_ATA_OVER_ETH is not set
7610 +CONFIG_MISC_DEVICES=y
7611 +# CONFIG_COLDFIRE_SEC is not set
7612 +# CONFIG_EEPROM_93CX6 is not set
7613 +# CONFIG_ENCLOSURE_SERVICES is not set
7615 +# CONFIG_IDE is not set
7618 +# SCSI device support
7620 +# CONFIG_RAID_ATTRS is not set
7623 +# CONFIG_SCSI_TGT is not set
7624 +# CONFIG_SCSI_NETLINK is not set
7625 +CONFIG_SCSI_PROC_FS=y
7628 +# SCSI support type (disk, tape, CD-ROM)
7630 +CONFIG_BLK_DEV_SD=y
7631 +# CONFIG_CHR_DEV_ST is not set
7632 +# CONFIG_CHR_DEV_OSST is not set
7633 +# CONFIG_BLK_DEV_SR is not set
7634 +# CONFIG_CHR_DEV_SG is not set
7635 +# CONFIG_CHR_DEV_SCH is not set
7638 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
7640 +CONFIG_SCSI_MULTI_LUN=y
7641 +# CONFIG_SCSI_CONSTANTS is not set
7642 +# CONFIG_SCSI_LOGGING is not set
7643 +# CONFIG_SCSI_SCAN_ASYNC is not set
7644 +CONFIG_SCSI_WAIT_SCAN=m
7649 +# CONFIG_SCSI_SPI_ATTRS is not set
7650 +# CONFIG_SCSI_FC_ATTRS is not set
7651 +# CONFIG_SCSI_ISCSI_ATTRS is not set
7652 +# CONFIG_SCSI_SAS_LIBSAS is not set
7653 +# CONFIG_SCSI_SRP_ATTRS is not set
7654 +CONFIG_SCSI_LOWLEVEL=y
7655 +# CONFIG_ISCSI_TCP is not set
7656 +# CONFIG_SCSI_DEBUG is not set
7657 +# CONFIG_ATA is not set
7658 +# CONFIG_MD is not set
7659 +CONFIG_NETDEVICES=y
7660 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
7661 +# CONFIG_DUMMY is not set
7662 +# CONFIG_BONDING is not set
7663 +# CONFIG_MACVLAN is not set
7664 +# CONFIG_EQUALIZER is not set
7665 +# CONFIG_TUN is not set
7666 +# CONFIG_VETH is not set
7667 +# CONFIG_PHYLIB is not set
7668 +CONFIG_NET_ETHERNET=y
7670 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
7671 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
7672 +# CONFIG_IBM_NEW_EMAC_TAH is not set
7673 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
7674 +# CONFIG_B44 is not set
7676 +# CONFIG_FEC2 is not set
7677 +# CONFIG_NETDEV_1000 is not set
7678 +# CONFIG_NETDEV_10000 is not set
7683 +# CONFIG_WLAN_PRE80211 is not set
7684 +# CONFIG_WLAN_80211 is not set
7685 +# CONFIG_WAN is not set
7686 +# CONFIG_PPP is not set
7687 +# CONFIG_SLIP is not set
7688 +# CONFIG_NETCONSOLE is not set
7689 +# CONFIG_NETPOLL is not set
7690 +# CONFIG_NET_POLL_CONTROLLER is not set
7691 +# CONFIG_ISDN is not set
7692 +# CONFIG_PHONE is not set
7695 +# Input device support
7698 +# CONFIG_INPUT_FF_MEMLESS is not set
7699 +# CONFIG_INPUT_POLLDEV is not set
7702 +# Userland interfaces
7704 +CONFIG_INPUT_MOUSEDEV=y
7705 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
7706 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
7707 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
7708 +# CONFIG_INPUT_JOYDEV is not set
7709 +CONFIG_INPUT_EVDEV=y
7710 +# CONFIG_INPUT_EVBUG is not set
7713 +# Input Device Drivers
7715 +CONFIG_INPUT_KEYBOARD=y
7716 +# CONFIG_KEYBOARD_ATKBD is not set
7717 +# CONFIG_KEYBOARD_SUNKBD is not set
7718 +# CONFIG_KEYBOARD_LKKBD is not set
7719 +# CONFIG_KEYBOARD_XTKBD is not set
7720 +# CONFIG_KEYBOARD_NEWTON is not set
7721 +# CONFIG_KEYBOARD_STOWAWAY is not set
7722 +# CONFIG_INPUT_MOUSE is not set
7723 +# CONFIG_INPUT_JOYSTICK is not set
7724 +# CONFIG_INPUT_TABLET is not set
7725 +# CONFIG_INPUT_TOUCHSCREEN is not set
7726 +# CONFIG_INPUT_MISC is not set
7729 +# Hardware I/O ports
7732 +CONFIG_SERIO_SERPORT=y
7733 +# CONFIG_SERIO_RAW is not set
7734 +# CONFIG_GAMEPORT is not set
7737 +# Character devices
7740 +CONFIG_VT_CONSOLE=y
7741 +CONFIG_HW_CONSOLE=y
7742 +# CONFIG_VT_HW_CONSOLE_BINDING is not set
7743 +# CONFIG_SERIAL_NONSTANDARD is not set
7748 +# CONFIG_SERIAL_8250 is not set
7751 +# Non-8250 serial port support
7753 +CONFIG_SERIAL_COLDFIRE=y
7754 +# CONFIG_SERIAL_MCF is not set
7755 +CONFIG_UNIX98_PTYS=y
7756 +# CONFIG_LEGACY_PTYS is not set
7757 +# CONFIG_IPMI_HANDLER is not set
7758 +# CONFIG_HW_RANDOM is not set
7759 +# CONFIG_GEN_RTC is not set
7760 +# CONFIG_R3964 is not set
7761 +# CONFIG_RAW_DRIVER is not set
7762 +# CONFIG_TCG_TPM is not set
7764 +CONFIG_I2C_BOARDINFO=y
7765 +CONFIG_I2C_CHARDEV=y
7770 +# CONFIG_I2C_ALGOBIT is not set
7771 +# CONFIG_I2C_ALGOPCF is not set
7772 +# CONFIG_I2C_ALGOPCA is not set
7775 +# I2C Hardware Bus support
7777 +# CONFIG_I2C_MCF548x is not set
7779 +# CONFIG_I2C_OCORES is not set
7780 +# CONFIG_I2C_PARPORT_LIGHT is not set
7781 +# CONFIG_I2C_SIMTEC is not set
7782 +# CONFIG_I2C_TAOS_EVM is not set
7783 +# CONFIG_I2C_STUB is not set
7786 +# Miscellaneous I2C Chip support
7788 +# CONFIG_DS1682 is not set
7789 +# CONFIG_SENSORS_EEPROM is not set
7790 +# CONFIG_SENSORS_PCF8574 is not set
7791 +# CONFIG_PCF8575 is not set
7792 +# CONFIG_SENSORS_PCF8591 is not set
7793 +# CONFIG_TPS65010 is not set
7794 +# CONFIG_SENSORS_MAX6875 is not set
7795 +# CONFIG_SENSORS_TSL2550 is not set
7796 +# CONFIG_I2C_DEBUG_CORE is not set
7797 +# CONFIG_I2C_DEBUG_ALGO is not set
7798 +# CONFIG_I2C_DEBUG_BUS is not set
7799 +# CONFIG_I2C_DEBUG_CHIP is not set
7804 +# CONFIG_SPI is not set
7805 +# CONFIG_COLDFIRE_EDMA is not set
7806 +# CONFIG_SPI_MASTER is not set
7807 +# CONFIG_W1 is not set
7808 +# CONFIG_POWER_SUPPLY is not set
7809 +# CONFIG_HWMON is not set
7810 +# CONFIG_THERMAL is not set
7811 +# CONFIG_WATCHDOG is not set
7814 +# Sonics Silicon Backplane
7816 +CONFIG_SSB_POSSIBLE=y
7817 +# CONFIG_SSB is not set
7820 +# Multifunction device drivers
7822 +# CONFIG_MFD_SM501 is not set
7825 +# Multimedia devices
7827 +# CONFIG_VIDEO_DEV is not set
7828 +# CONFIG_DVB_CORE is not set
7834 +# CONFIG_VGASTATE is not set
7835 +CONFIG_VIDEO_OUTPUT_CONTROL=m
7836 +# CONFIG_FB is not set
7837 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
7840 +# Display device support
7842 +# CONFIG_DISPLAY_SUPPORT is not set
7845 +# Console display driver support
7847 +CONFIG_DUMMY_CONSOLE=y
7852 +# CONFIG_SOUND is not set
7853 +# CONFIG_HID_SUPPORT is not set
7854 +# CONFIG_USB_SUPPORT is not set
7855 +# CONFIG_MMC is not set
7856 +# CONFIG_MEMSTICK is not set
7857 +# CONFIG_NEW_LEDS is not set
7858 +# CONFIG_RTC_CLASS is not set
7863 +# CONFIG_UIO is not set
7866 +# Character devices
7868 +# CONFIG_SERIAL_CONSOLE is not set
7874 +# CONFIG_EXT2_FS_XATTR is not set
7875 +# CONFIG_EXT2_FS_XIP is not set
7877 +CONFIG_EXT3_FS_XATTR=y
7878 +# CONFIG_EXT3_FS_POSIX_ACL is not set
7879 +# CONFIG_EXT3_FS_SECURITY is not set
7880 +# CONFIG_EXT4DEV_FS is not set
7882 +CONFIG_FS_MBCACHE=y
7883 +# CONFIG_REISERFS_FS is not set
7884 +# CONFIG_JFS_FS is not set
7885 +# CONFIG_FS_POSIX_ACL is not set
7886 +# CONFIG_XFS_FS is not set
7887 +# CONFIG_GFS2_FS is not set
7888 +# CONFIG_OCFS2_FS is not set
7890 +# CONFIG_INOTIFY is not set
7891 +# CONFIG_QUOTA is not set
7892 +# CONFIG_AUTOFS_FS is not set
7893 +# CONFIG_AUTOFS4_FS is not set
7894 +# CONFIG_FUSE_FS is not set
7897 +# CD-ROM/DVD Filesystems
7899 +# CONFIG_ISO9660_FS is not set
7900 +# CONFIG_UDF_FS is not set
7903 +# DOS/FAT/NT Filesystems
7908 +CONFIG_FAT_DEFAULT_CODEPAGE=437
7909 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
7911 +# CONFIG_NTFS_DEBUG is not set
7915 +# Pseudo filesystems
7918 +# CONFIG_PROC_KCORE is not set
7919 +CONFIG_PROC_SYSCTL=y
7922 +# CONFIG_TMPFS_POSIX_ACL is not set
7923 +# CONFIG_HUGETLB_PAGE is not set
7924 +# CONFIG_CONFIGFS_FS is not set
7927 +# Miscellaneous filesystems
7929 +# CONFIG_ADFS_FS is not set
7930 +# CONFIG_AFFS_FS is not set
7931 +# CONFIG_HFS_FS is not set
7932 +# CONFIG_HFSPLUS_FS is not set
7933 +# CONFIG_BEFS_FS is not set
7934 +# CONFIG_BFS_FS is not set
7935 +# CONFIG_EFS_FS is not set
7936 +# CONFIG_CRAMFS is not set
7937 +# CONFIG_VXFS_FS is not set
7939 +# CONFIG_HPFS_FS is not set
7940 +# CONFIG_QNX4FS_FS is not set
7941 +# CONFIG_ROMFS_FS is not set
7942 +# CONFIG_SYSV_FS is not set
7943 +# CONFIG_UFS_FS is not set
7944 +CONFIG_NETWORK_FILESYSTEMS=y
7946 +# CONFIG_NFS_V3 is not set
7947 +# CONFIG_NFS_V4 is not set
7948 +# CONFIG_NFS_DIRECTIO is not set
7949 +# CONFIG_NFSD is not set
7952 +CONFIG_NFS_COMMON=y
7954 +# CONFIG_SUNRPC_BIND34 is not set
7955 +# CONFIG_RPCSEC_GSS_KRB5 is not set
7956 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
7957 +# CONFIG_SMB_FS is not set
7958 +# CONFIG_CIFS is not set
7959 +# CONFIG_NCP_FS is not set
7960 +# CONFIG_CODA_FS is not set
7961 +# CONFIG_AFS_FS is not set
7966 +CONFIG_PARTITION_ADVANCED=y
7967 +# CONFIG_ACORN_PARTITION is not set
7968 +# CONFIG_OSF_PARTITION is not set
7969 +# CONFIG_AMIGA_PARTITION is not set
7970 +# CONFIG_ATARI_PARTITION is not set
7971 +# CONFIG_MAC_PARTITION is not set
7972 +CONFIG_MSDOS_PARTITION=y
7973 +# CONFIG_BSD_DISKLABEL is not set
7974 +# CONFIG_MINIX_SUBPARTITION is not set
7975 +# CONFIG_SOLARIS_X86_PARTITION is not set
7976 +# CONFIG_UNIXWARE_DISKLABEL is not set
7977 +# CONFIG_LDM_PARTITION is not set
7978 +# CONFIG_SGI_PARTITION is not set
7979 +# CONFIG_ULTRIX_PARTITION is not set
7980 +# CONFIG_SUN_PARTITION is not set
7981 +# CONFIG_KARMA_PARTITION is not set
7982 +# CONFIG_EFI_PARTITION is not set
7983 +# CONFIG_SYSV68_PARTITION is not set
7985 +CONFIG_NLS_DEFAULT="iso8859-1"
7986 +CONFIG_NLS_CODEPAGE_437=y
7987 +# CONFIG_NLS_CODEPAGE_737 is not set
7988 +# CONFIG_NLS_CODEPAGE_775 is not set
7989 +# CONFIG_NLS_CODEPAGE_850 is not set
7990 +# CONFIG_NLS_CODEPAGE_852 is not set
7991 +# CONFIG_NLS_CODEPAGE_855 is not set
7992 +# CONFIG_NLS_CODEPAGE_857 is not set
7993 +# CONFIG_NLS_CODEPAGE_860 is not set
7994 +# CONFIG_NLS_CODEPAGE_861 is not set
7995 +# CONFIG_NLS_CODEPAGE_862 is not set
7996 +# CONFIG_NLS_CODEPAGE_863 is not set
7997 +# CONFIG_NLS_CODEPAGE_864 is not set
7998 +# CONFIG_NLS_CODEPAGE_865 is not set
7999 +# CONFIG_NLS_CODEPAGE_866 is not set
8000 +# CONFIG_NLS_CODEPAGE_869 is not set
8001 +# CONFIG_NLS_CODEPAGE_936 is not set
8002 +# CONFIG_NLS_CODEPAGE_950 is not set
8003 +# CONFIG_NLS_CODEPAGE_932 is not set
8004 +# CONFIG_NLS_CODEPAGE_949 is not set
8005 +# CONFIG_NLS_CODEPAGE_874 is not set
8006 +# CONFIG_NLS_ISO8859_8 is not set
8007 +# CONFIG_NLS_CODEPAGE_1250 is not set
8008 +# CONFIG_NLS_CODEPAGE_1251 is not set
8009 +# CONFIG_NLS_ASCII is not set
8010 +CONFIG_NLS_ISO8859_1=y
8011 +# CONFIG_NLS_ISO8859_2 is not set
8012 +# CONFIG_NLS_ISO8859_3 is not set
8013 +# CONFIG_NLS_ISO8859_4 is not set
8014 +# CONFIG_NLS_ISO8859_5 is not set
8015 +# CONFIG_NLS_ISO8859_6 is not set
8016 +# CONFIG_NLS_ISO8859_7 is not set
8017 +# CONFIG_NLS_ISO8859_9 is not set
8018 +# CONFIG_NLS_ISO8859_13 is not set
8019 +# CONFIG_NLS_ISO8859_14 is not set
8020 +# CONFIG_NLS_ISO8859_15 is not set
8021 +# CONFIG_NLS_KOI8_R is not set
8022 +# CONFIG_NLS_KOI8_U is not set
8024 +# CONFIG_DLM is not set
8029 +# CONFIG_PRINTK_TIME is not set
8030 +CONFIG_ENABLE_WARN_DEPRECATED=y
8031 +# CONFIG_ENABLE_MUST_CHECK is not set
8032 +# CONFIG_MAGIC_SYSRQ is not set
8033 +# CONFIG_UNUSED_SYMBOLS is not set
8034 +# CONFIG_DEBUG_FS is not set
8035 +# CONFIG_HEADERS_CHECK is not set
8036 +CONFIG_DEBUG_KERNEL=y
8037 +CONFIG_DETECT_SOFTLOCKUP=y
8038 +CONFIG_SCHED_DEBUG=y
8039 +# CONFIG_SCHEDSTATS is not set
8040 +# CONFIG_TIMER_STATS is not set
8041 +CONFIG_DEBUG_SLAB=y
8042 +# CONFIG_DEBUG_SLAB_LEAK is not set
8043 +# CONFIG_DEBUG_RT_MUTEXES is not set
8044 +# CONFIG_RT_MUTEX_TESTER is not set
8045 +# CONFIG_DEBUG_SPINLOCK is not set
8046 +# CONFIG_DEBUG_MUTEXES is not set
8047 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
8048 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
8049 +# CONFIG_DEBUG_KOBJECT is not set
8050 +CONFIG_DEBUG_BUGVERBOSE=y
8051 +CONFIG_DEBUG_INFO=y
8052 +# CONFIG_DEBUG_VM is not set
8053 +# CONFIG_DEBUG_LIST is not set
8054 +# CONFIG_DEBUG_SG is not set
8055 +# CONFIG_FRAME_POINTER is not set
8056 +# CONFIG_BOOT_PRINTK_DELAY is not set
8057 +# CONFIG_RCU_TORTURE_TEST is not set
8058 +# CONFIG_BACKTRACE_SELF_TEST is not set
8059 +# CONFIG_FAULT_INJECTION is not set
8060 +# CONFIG_SAMPLES is not set
8062 +CONFIG_BOOTPARAM_STRING="root=/dev/nfs rw nfsroot=172.27.155.1:/tftpboot/redstripe ip=172.27.155.55:172.27.155.1:172.27.255.254:255.255.0.0::eth0:off mtdparts=phys_mapped_flash:16m(User)"
8067 +# CONFIG_KEYS is not set
8068 +# CONFIG_SECURITY is not set
8069 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
8071 +CONFIG_CRYPTO_ALGAPI=y
8072 +CONFIG_CRYPTO_AEAD=y
8073 +CONFIG_CRYPTO_BLKCIPHER=y
8074 +# CONFIG_CRYPTO_SEQIV is not set
8075 +CONFIG_CRYPTO_HASH=y
8076 +CONFIG_CRYPTO_MANAGER=y
8077 +CONFIG_CRYPTO_HMAC=y
8078 +# CONFIG_CRYPTO_XCBC is not set
8079 +# CONFIG_CRYPTO_NULL is not set
8080 +# CONFIG_CRYPTO_MD4 is not set
8081 +CONFIG_CRYPTO_MD5=y
8082 +CONFIG_CRYPTO_SHA1=y
8083 +# CONFIG_CRYPTO_SHA256 is not set
8084 +# CONFIG_CRYPTO_SHA512 is not set
8085 +# CONFIG_CRYPTO_WP512 is not set
8086 +# CONFIG_CRYPTO_TGR192 is not set
8087 +# CONFIG_CRYPTO_GF128MUL is not set
8088 +CONFIG_CRYPTO_ECB=y
8089 +CONFIG_CRYPTO_CBC=y
8090 +CONFIG_CRYPTO_PCBC=m
8091 +# CONFIG_CRYPTO_LRW is not set
8092 +# CONFIG_CRYPTO_XTS is not set
8093 +# CONFIG_CRYPTO_CTR is not set
8094 +# CONFIG_CRYPTO_GCM is not set
8095 +# CONFIG_CRYPTO_CCM is not set
8096 +# CONFIG_CRYPTO_CRYPTD is not set
8097 +CONFIG_CRYPTO_DES=y
8098 +# CONFIG_CRYPTO_FCRYPT is not set
8099 +# CONFIG_CRYPTO_BLOWFISH is not set
8100 +# CONFIG_CRYPTO_TWOFISH is not set
8101 +# CONFIG_CRYPTO_SERPENT is not set
8102 +# CONFIG_CRYPTO_AES is not set
8103 +# CONFIG_CRYPTO_CAST5 is not set
8104 +# CONFIG_CRYPTO_CAST6 is not set
8105 +# CONFIG_CRYPTO_TEA is not set
8106 +# CONFIG_CRYPTO_ARC4 is not set
8107 +# CONFIG_CRYPTO_KHAZAD is not set
8108 +# CONFIG_CRYPTO_ANUBIS is not set
8109 +# CONFIG_CRYPTO_SEED is not set
8110 +# CONFIG_CRYPTO_SALSA20 is not set
8111 +# CONFIG_CRYPTO_DEFLATE is not set
8112 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
8113 +# CONFIG_CRYPTO_CRC32C is not set
8114 +# CONFIG_CRYPTO_CAMELLIA is not set
8115 +CONFIG_CRYPTO_TEST=m
8116 +CONFIG_CRYPTO_AUTHENC=y
8117 +# CONFIG_CRYPTO_LZO is not set
8119 +# CONFIG_CRYPTO_DEV_MCFCAU is not set
8124 +CONFIG_BITREVERSE=y
8127 +# CONFIG_CRC_ITU_T is not set
8129 +# CONFIG_CRC7 is not set
8133 +CONFIG_HAS_IOPORT=y
8136 +++ b/arch/m68k/configs/m54455evb_defconfig
8139 +# Automatically generated make config: don't edit
8140 +# Linux kernel version: 2.6.23
8141 +# Thu Dec 6 12:14:18 2007
8145 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
8146 +# CONFIG_ARCH_HAS_ILOG2_U32 is not set
8147 +# CONFIG_ARCH_HAS_ILOG2_U64 is not set
8148 +CONFIG_GENERIC_HWEIGHT=y
8149 +CONFIG_GENERIC_CALIBRATE_DELAY=y
8150 +CONFIG_TIME_LOW_RES=y
8151 +CONFIG_GENERIC_IOMAP=y
8153 +# CONFIG_NO_DMA is not set
8154 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
8159 +CONFIG_EXPERIMENTAL=y
8160 +CONFIG_BROKEN_ON_SMP=y
8161 +CONFIG_INIT_ENV_ARG_LIMIT=32
8162 +CONFIG_LOCALVERSION=""
8163 +CONFIG_LOCALVERSION_AUTO=y
8166 +CONFIG_SYSVIPC_SYSCTL=y
8167 +# CONFIG_POSIX_MQUEUE is not set
8168 +# CONFIG_BSD_PROCESS_ACCT is not set
8169 +# CONFIG_TASKSTATS is not set
8170 +# CONFIG_USER_NS is not set
8171 +# CONFIG_AUDIT is not set
8173 +CONFIG_IKCONFIG_PROC=y
8174 +CONFIG_LOG_BUF_SHIFT=17
8175 +CONFIG_SYSFS_DEPRECATED=y
8176 +# CONFIG_RELAY is not set
8177 +# CONFIG_BLK_DEV_INITRD is not set
8178 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
8180 +# CONFIG_EMBEDDED is not set
8182 +CONFIG_SYSCTL_SYSCALL=y
8184 +# CONFIG_KALLSYMS_ALL is not set
8185 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
8192 +CONFIG_ANON_INODES=y
8197 +CONFIG_VM_EVENT_COUNTERS=y
8199 +# CONFIG_SLUB is not set
8200 +# CONFIG_SLOB is not set
8201 +CONFIG_RT_MUTEXES=y
8202 +# CONFIG_TINY_SHMEM is not set
8203 +CONFIG_BASE_SMALL=0
8205 +CONFIG_MODULE_UNLOAD=y
8206 +CONFIG_MODULE_FORCE_UNLOAD=y
8207 +# CONFIG_MODVERSIONS is not set
8208 +# CONFIG_MODULE_SRCVERSION_ALL is not set
8209 +# CONFIG_KMOD is not set
8212 +# CONFIG_BLK_DEV_IO_TRACE is not set
8213 +# CONFIG_LSF is not set
8214 +# CONFIG_BLK_DEV_BSG is not set
8219 +CONFIG_IOSCHED_NOOP=y
8220 +CONFIG_IOSCHED_AS=y
8221 +CONFIG_IOSCHED_DEADLINE=y
8222 +CONFIG_IOSCHED_CFQ=y
8223 +# CONFIG_DEFAULT_AS is not set
8224 +# CONFIG_DEFAULT_DEADLINE is not set
8225 +CONFIG_DEFAULT_CFQ=y
8226 +# CONFIG_DEFAULT_NOOP is not set
8227 +CONFIG_DEFAULT_IOSCHED="cfq"
8230 +# Platform dependent setup
8232 +# CONFIG_SUN3 is not set
8235 +# CONFIG_AMIGA is not set
8236 +# CONFIG_ATARI is not set
8237 +# CONFIG_MAC is not set
8238 +# CONFIG_APOLLO is not set
8239 +# CONFIG_VME is not set
8240 +# CONFIG_HP300 is not set
8241 +# CONFIG_SUN3X is not set
8242 +# CONFIG_Q40 is not set
8247 +# CONFIG_M68020 is not set
8248 +# CONFIG_M68030 is not set
8249 +# CONFIG_M68040 is not set
8250 +# CONFIG_M68060 is not set
8252 +CONFIG_MCFCLK=266666666
8253 +# CONFIG_MCF_USER_HALT is not set
8255 +CONFIG_SDRAM_BASE=0x40000000
8256 +CONFIG_SDRAM_SIZE=0x0FFFFFFF
8257 +CONFIG_NOR_FLASH_BASE=0x00000000
8258 +# CONFIG_M68KFPU_EMU is not set
8260 +# CONFIG_RMW_INSNS is not set
8261 +CONFIG_SINGLE_MEMORY_CHUNK=y
8262 +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
8263 +CONFIG_SELECT_MEMORY_MODEL=y
8264 +CONFIG_FLATMEM_MANUAL=y
8265 +# CONFIG_DISCONTIGMEM_MANUAL is not set
8266 +# CONFIG_SPARSEMEM_MANUAL is not set
8268 +CONFIG_FLAT_NODE_MEM_MAP=y
8269 +CONFIG_NEED_MULTIPLE_NODES=y
8270 +# CONFIG_SPARSEMEM_STATIC is not set
8271 +CONFIG_SPLIT_PTLOCK_CPUS=4
8272 +# CONFIG_RESOURCES_64BIT is not set
8273 +CONFIG_ZONE_DMA_FLAG=1
8275 +CONFIG_VIRT_TO_BUS=y
8280 +CONFIG_BINFMT_ELF=y
8281 +# CONFIG_BINFMT_AOUT is not set
8282 +# CONFIG_BINFMT_MISC is not set
8283 +CONFIG_PROC_HARDWARE=y
8285 +# CONFIG_ARCH_SUPPORTS_MSI is not set
8288 +# Power management options
8290 +# CONFIG_PM is not set
8298 +# Networking options
8301 +# CONFIG_PACKET_MMAP is not set
8304 +# CONFIG_XFRM_USER is not set
8305 +# CONFIG_XFRM_SUB_POLICY is not set
8306 +# CONFIG_XFRM_MIGRATE is not set
8308 +# CONFIG_NET_KEY_MIGRATE is not set
8310 +# CONFIG_IP_MULTICAST is not set
8311 +CONFIG_IP_ADVANCED_ROUTER=y
8312 +CONFIG_ASK_IP_FIB_HASH=y
8313 +# CONFIG_IP_FIB_TRIE is not set
8314 +CONFIG_IP_FIB_HASH=y
8315 +# CONFIG_IP_MULTIPLE_TABLES is not set
8316 +# CONFIG_IP_ROUTE_MULTIPATH is not set
8317 +# CONFIG_IP_ROUTE_VERBOSE is not set
8319 +# CONFIG_IP_PNP_DHCP is not set
8320 +# CONFIG_IP_PNP_BOOTP is not set
8321 +# CONFIG_IP_PNP_RARP is not set
8322 +# CONFIG_NET_IPIP is not set
8323 +# CONFIG_NET_IPGRE is not set
8324 +# CONFIG_ARPD is not set
8325 +# CONFIG_SYN_COOKIES is not set
8328 +# CONFIG_INET_IPCOMP is not set
8329 +# CONFIG_INET_XFRM_TUNNEL is not set
8330 +# CONFIG_INET_TUNNEL is not set
8331 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
8332 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
8333 +# CONFIG_INET_XFRM_MODE_BEET is not set
8335 +CONFIG_INET_TCP_DIAG=y
8336 +# CONFIG_TCP_CONG_ADVANCED is not set
8337 +CONFIG_TCP_CONG_CUBIC=y
8338 +CONFIG_DEFAULT_TCP_CONG="cubic"
8339 +# CONFIG_TCP_MD5SIG is not set
8340 +# CONFIG_IPV6 is not set
8341 +# CONFIG_INET6_XFRM_TUNNEL is not set
8342 +# CONFIG_INET6_TUNNEL is not set
8343 +# CONFIG_NETWORK_SECMARK is not set
8344 +# CONFIG_NETFILTER is not set
8345 +# CONFIG_IP_DCCP is not set
8346 +# CONFIG_IP_SCTP is not set
8347 +# CONFIG_TIPC is not set
8348 +# CONFIG_ATM is not set
8349 +# CONFIG_BRIDGE is not set
8350 +# CONFIG_VLAN_8021Q is not set
8351 +# CONFIG_DECNET is not set
8352 +# CONFIG_LLC2 is not set
8353 +# CONFIG_IPX is not set
8354 +# CONFIG_ATALK is not set
8355 +# CONFIG_X25 is not set
8356 +# CONFIG_LAPB is not set
8357 +# CONFIG_ECONET is not set
8358 +# CONFIG_WAN_ROUTER is not set
8361 +# QoS and/or fair queueing
8363 +# CONFIG_NET_SCHED is not set
8368 +# CONFIG_NET_PKTGEN is not set
8369 +# CONFIG_HAMRADIO is not set
8370 +# CONFIG_IRDA is not set
8371 +# CONFIG_BT is not set
8372 +# CONFIG_AF_RXRPC is not set
8377 +# CONFIG_CFG80211 is not set
8378 +# CONFIG_WIRELESS_EXT is not set
8379 +# CONFIG_MAC80211 is not set
8380 +# CONFIG_IEEE80211 is not set
8381 +# CONFIG_RFKILL is not set
8382 +# CONFIG_NET_9P is not set
8389 +# Generic Driver Options
8391 +# CONFIG_STANDALONE is not set
8392 +CONFIG_PREVENT_FIRMWARE_BUILD=y
8394 +# CONFIG_DEBUG_DRIVER is not set
8395 +# CONFIG_DEBUG_DEVRES is not set
8396 +# CONFIG_SYS_HYPERVISOR is not set
8397 +# CONFIG_CONNECTOR is not set
8400 +CONFIG_MTD_DEBUG_VERBOSE=0
8401 +CONFIG_MTD_CONCAT=y
8402 +CONFIG_MTD_PARTITIONS=y
8403 +# CONFIG_MTD_REDBOOT_PARTS is not set
8404 +CONFIG_MTD_CMDLINE_PARTS=y
8407 +# User Modules And Translation Layers
8410 +CONFIG_MTD_BLKDEVS=y
8412 +# CONFIG_FTL is not set
8413 +# CONFIG_NFTL is not set
8414 +# CONFIG_INFTL is not set
8415 +# CONFIG_RFD_FTL is not set
8416 +# CONFIG_SSFDC is not set
8419 +# RAM/ROM/Flash chip drivers
8422 +# CONFIG_MTD_JEDECPROBE is not set
8423 +CONFIG_MTD_GEN_PROBE=y
8424 +CONFIG_MTD_CFI_ADV_OPTIONS=y
8425 +CONFIG_MTD_CFI_NOSWAP=y
8426 +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
8427 +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
8428 +CONFIG_MTD_CFI_GEOMETRY=y
8429 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
8430 +# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
8431 +# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
8432 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
8433 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
8434 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
8435 +CONFIG_MTD_CFI_I1=y
8436 +# CONFIG_MTD_CFI_I2 is not set
8437 +# CONFIG_MTD_CFI_I4 is not set
8438 +# CONFIG_MTD_CFI_I8 is not set
8439 +# CONFIG_MTD_OTP is not set
8440 +CONFIG_MTD_CFI_INTELEXT=y
8441 +# CONFIG_MTD_CFI_AMDSTD is not set
8442 +# CONFIG_MTD_CFI_STAA is not set
8443 +CONFIG_MTD_CFI_UTIL=y
8444 +# CONFIG_MTD_RAM is not set
8445 +# CONFIG_MTD_ROM is not set
8446 +# CONFIG_MTD_ABSENT is not set
8449 +# Mapping drivers for chip access
8451 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
8452 +CONFIG_MTD_PHYSMAP=y
8453 +CONFIG_MTD_PHYSMAP_START=0x00000000
8454 +CONFIG_MTD_PHYSMAP_LEN=0x1000000
8455 +CONFIG_MTD_PHYSMAP_BANKWIDTH=1
8456 +# CONFIG_MTD_PLATRAM is not set
8459 +# Self-contained MTD device drivers
8461 +# CONFIG_MTD_DATAFLASH is not set
8462 +# CONFIG_MTD_M25P80 is not set
8463 +# CONFIG_MTD_SLRAM is not set
8464 +# CONFIG_MTD_PHRAM is not set
8465 +# CONFIG_MTD_MTDRAM is not set
8466 +# CONFIG_MTD_BLOCK2MTD is not set
8469 +# Disk-On-Chip Device Drivers
8471 +# CONFIG_MTD_DOC2000 is not set
8472 +# CONFIG_MTD_DOC2001 is not set
8473 +# CONFIG_MTD_DOC2001PLUS is not set
8474 +# CONFIG_MTD_NAND is not set
8475 +# CONFIG_MTD_ONENAND is not set
8478 +# UBI - Unsorted block images
8480 +# CONFIG_MTD_UBI is not set
8481 +# CONFIG_PARPORT is not set
8483 +# CONFIG_BLK_DEV_COW_COMMON is not set
8484 +CONFIG_BLK_DEV_LOOP=y
8485 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
8486 +# CONFIG_BLK_DEV_NBD is not set
8487 +# CONFIG_BLK_DEV_UB is not set
8488 +CONFIG_BLK_DEV_RAM=y
8489 +CONFIG_BLK_DEV_RAM_COUNT=16
8490 +CONFIG_BLK_DEV_RAM_SIZE=64000
8491 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
8492 +# CONFIG_CDROM_PKTCDVD is not set
8493 +# CONFIG_ATA_OVER_ETH is not set
8494 +CONFIG_MISC_DEVICES=y
8495 +# CONFIG_EEPROM_93CX6 is not set
8496 +# CONFIG_IDE is not set
8499 +# SCSI device support
8501 +# CONFIG_RAID_ATTRS is not set
8504 +# CONFIG_SCSI_TGT is not set
8505 +# CONFIG_SCSI_NETLINK is not set
8506 +CONFIG_SCSI_PROC_FS=y
8509 +# SCSI support type (disk, tape, CD-ROM)
8511 +CONFIG_BLK_DEV_SD=y
8512 +# CONFIG_CHR_DEV_ST is not set
8513 +# CONFIG_CHR_DEV_OSST is not set
8514 +# CONFIG_BLK_DEV_SR is not set
8515 +# CONFIG_CHR_DEV_SG is not set
8516 +# CONFIG_CHR_DEV_SCH is not set
8519 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
8521 +CONFIG_SCSI_MULTI_LUN=y
8522 +# CONFIG_SCSI_CONSTANTS is not set
8523 +# CONFIG_SCSI_LOGGING is not set
8524 +# CONFIG_SCSI_SCAN_ASYNC is not set
8525 +CONFIG_SCSI_WAIT_SCAN=m
8530 +# CONFIG_SCSI_SPI_ATTRS is not set
8531 +# CONFIG_SCSI_FC_ATTRS is not set
8532 +# CONFIG_SCSI_ISCSI_ATTRS is not set
8533 +# CONFIG_SCSI_SAS_LIBSAS is not set
8534 +CONFIG_SCSI_LOWLEVEL=y
8535 +# CONFIG_ISCSI_TCP is not set
8536 +# CONFIG_SCSI_DEBUG is not set
8538 +# CONFIG_ATA_NONSTANDARD is not set
8540 +# CONFIG_MD is not set
8541 +CONFIG_NETDEVICES=y
8542 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
8543 +# CONFIG_DUMMY is not set
8544 +# CONFIG_BONDING is not set
8545 +# CONFIG_MACVLAN is not set
8546 +# CONFIG_EQUALIZER is not set
8547 +# CONFIG_TUN is not set
8548 +# CONFIG_PHYLIB is not set
8549 +CONFIG_NET_ETHERNET=y
8552 +# CONFIG_FEC2 is not set
8553 +CONFIG_NETDEV_1000=y
8554 +CONFIG_NETDEV_10000=y
8559 +# CONFIG_WLAN_PRE80211 is not set
8560 +# CONFIG_WLAN_80211 is not set
8563 +# USB Network Adapters
8565 +# CONFIG_USB_CATC is not set
8566 +# CONFIG_USB_KAWETH is not set
8567 +CONFIG_USB_PEGASUS=m
8568 +CONFIG_USB_RTL8150=m
8569 +CONFIG_USB_USBNET_MII=m
8570 +CONFIG_USB_USBNET=m
8571 +CONFIG_USB_NET_AX8817X=m
8572 +CONFIG_USB_NET_CDCETHER=m
8573 +# CONFIG_USB_NET_DM9601 is not set
8574 +# CONFIG_USB_NET_GL620A is not set
8575 +# CONFIG_USB_NET_NET1080 is not set
8576 +# CONFIG_USB_NET_PLUSB is not set
8577 +# CONFIG_USB_NET_MCS7830 is not set
8578 +# CONFIG_USB_NET_RNDIS_HOST is not set
8579 +# CONFIG_USB_NET_CDC_SUBSET is not set
8580 +# CONFIG_USB_NET_ZAURUS is not set
8581 +# CONFIG_WAN is not set
8582 +# CONFIG_PPP is not set
8583 +# CONFIG_SLIP is not set
8584 +# CONFIG_SHAPER is not set
8585 +# CONFIG_NETCONSOLE is not set
8586 +# CONFIG_NETPOLL is not set
8587 +# CONFIG_NET_POLL_CONTROLLER is not set
8588 +# CONFIG_ISDN is not set
8589 +# CONFIG_PHONE is not set
8592 +# Input device support
8595 +# CONFIG_INPUT_FF_MEMLESS is not set
8596 +# CONFIG_INPUT_POLLDEV is not set
8599 +# Userland interfaces
8601 +CONFIG_INPUT_MOUSEDEV=y
8602 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
8603 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
8604 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
8605 +# CONFIG_INPUT_JOYDEV is not set
8606 +# CONFIG_INPUT_TSDEV is not set
8607 +CONFIG_INPUT_EVDEV=y
8608 +# CONFIG_INPUT_EVBUG is not set
8611 +# Input Device Drivers
8613 +CONFIG_INPUT_KEYBOARD=y
8614 +# CONFIG_KEYBOARD_ATKBD is not set
8615 +# CONFIG_KEYBOARD_SUNKBD is not set
8616 +# CONFIG_KEYBOARD_LKKBD is not set
8617 +# CONFIG_KEYBOARD_XTKBD is not set
8618 +# CONFIG_KEYBOARD_NEWTON is not set
8619 +# CONFIG_KEYBOARD_STOWAWAY is not set
8620 +# CONFIG_INPUT_MOUSE is not set
8621 +# CONFIG_INPUT_JOYSTICK is not set
8622 +# CONFIG_INPUT_TABLET is not set
8623 +# CONFIG_INPUT_TOUCHSCREEN is not set
8624 +# CONFIG_INPUT_MISC is not set
8627 +# Hardware I/O ports
8630 +CONFIG_SERIO_SERPORT=y
8631 +# CONFIG_SERIO_RAW is not set
8632 +# CONFIG_GAMEPORT is not set
8635 +# Character devices
8638 +CONFIG_VT_CONSOLE=y
8639 +CONFIG_HW_CONSOLE=y
8640 +# CONFIG_VT_HW_CONSOLE_BINDING is not set
8641 +# CONFIG_SERIAL_NONSTANDARD is not set
8646 +# CONFIG_SERIAL_8250 is not set
8649 +# Non-8250 serial port support
8651 +CONFIG_SERIAL_COLDFIRE=y
8652 +CONFIG_UNIX98_PTYS=y
8653 +# CONFIG_LEGACY_PTYS is not set
8654 +# CONFIG_IPMI_HANDLER is not set
8655 +# CONFIG_WATCHDOG is not set
8656 +# CONFIG_HW_RANDOM is not set
8657 +# CONFIG_GEN_RTC is not set
8658 +# CONFIG_R3964 is not set
8659 +# CONFIG_RAW_DRIVER is not set
8660 +# CONFIG_TCG_TPM is not set
8661 +# CONFIG_I2C is not set
8667 +# CONFIG_SPI_DEBUG is not set
8668 +CONFIG_COLDFIRE_EDMA=y
8669 +CONFIG_SPI_MASTER=y
8672 +# SPI Master Controller Drivers
8674 +# CONFIG_SPI_BITBANG is not set
8675 +CONFIG_SPI_COLDFIRE=y
8676 +CONFIG_SPI_COLDFIRE_DSPI_EDMA=y
8679 +# SPI Protocol Masters
8681 +# CONFIG_SPI_AT25 is not set
8682 +# CONFIG_SPI_SPIDEV is not set
8683 +# CONFIG_SPI_TLE62X0 is not set
8684 +CONFIG_SPI_COLDFIRE_SSI_AUDIO=y
8685 +# CONFIG_SSIAUDIO_USE_EDMA is not set
8686 +# CONFIG_W1 is not set
8687 +# CONFIG_POWER_SUPPLY is not set
8688 +# CONFIG_HWMON is not set
8691 +# Multifunction device drivers
8693 +# CONFIG_MFD_SM501 is not set
8696 +# Multimedia devices
8698 +# CONFIG_VIDEO_DEV is not set
8699 +# CONFIG_DVB_CORE is not set
8701 +# CONFIG_USB_DABUSB is not set
8706 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
8709 +# Display device support
8711 +# CONFIG_DISPLAY_SUPPORT is not set
8712 +# CONFIG_VGASTATE is not set
8713 +CONFIG_VIDEO_OUTPUT_CONTROL=m
8714 +# CONFIG_FB is not set
8717 +# Console display driver support
8719 +CONFIG_DUMMY_CONSOLE=y
8724 +# CONFIG_SOUND is not set
8725 +CONFIG_HID_SUPPORT=y
8730 +# USB Input Devices
8733 +# CONFIG_USB_HIDINPUT_POWERBOOK is not set
8734 +# CONFIG_HID_FF is not set
8735 +# CONFIG_USB_HIDDEV is not set
8736 +CONFIG_USB_SUPPORT=y
8737 +CONFIG_USB_ARCH_HAS_HCD=y
8738 +# CONFIG_USB_ARCH_HAS_OHCI is not set
8739 +CONFIG_USB_ARCH_HAS_EHCI=y
8741 +# CONFIG_USB_DEBUG is not set
8744 +# Miscellaneous USB options
8746 +CONFIG_USB_DEVICEFS=y
8747 +# CONFIG_USB_DEVICE_CLASS is not set
8748 +# CONFIG_USB_DYNAMIC_MINORS is not set
8749 +# CONFIG_USB_OTG is not set
8752 +# USB Host Controller Drivers
8754 +CONFIG_USB_EHCI_HCD=m
8755 +CONFIG_USB_EHCI_SPLIT_ISO=y
8756 +CONFIG_USB_EHCI_ROOT_HUB_TT=y
8757 +# CONFIG_USB_EHCI_TT_NEWSCHED is not set
8758 +CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
8759 +CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y
8760 +# CONFIG_USB_ISP116X_HCD is not set
8761 +# CONFIG_USB_SL811_HCD is not set
8762 +# CONFIG_USB_R8A66597_HCD is not set
8763 +CONFIG_USB_M5445X_ULPI=y
8764 +# CONFIG_USB_M5445X_FSLS is not set
8767 +# USB Device Class drivers
8769 +# CONFIG_USB_ACM is not set
8770 +# CONFIG_USB_PRINTER is not set
8773 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
8777 +# may also be needed; see USB_STORAGE Help for more information
8779 +CONFIG_USB_STORAGE=y
8780 +# CONFIG_USB_STORAGE_DEBUG is not set
8781 +# CONFIG_USB_STORAGE_DATAFAB is not set
8782 +# CONFIG_USB_STORAGE_FREECOM is not set
8783 +# CONFIG_USB_STORAGE_DPCM is not set
8784 +# CONFIG_USB_STORAGE_USBAT is not set
8785 +# CONFIG_USB_STORAGE_SDDR09 is not set
8786 +# CONFIG_USB_STORAGE_SDDR55 is not set
8787 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
8788 +# CONFIG_USB_STORAGE_ALAUDA is not set
8789 +# CONFIG_USB_STORAGE_ONETOUCH is not set
8790 +# CONFIG_USB_STORAGE_KARMA is not set
8791 +# CONFIG_USB_LIBUSUAL is not set
8794 +# USB Imaging devices
8796 +# CONFIG_USB_MDC800 is not set
8797 +# CONFIG_USB_MICROTEK is not set
8798 +# CONFIG_USB_MON is not set
8805 +# USB Serial Converter support
8807 +# CONFIG_USB_SERIAL is not set
8810 +# USB Miscellaneous drivers
8812 +# CONFIG_USB_EMI62 is not set
8813 +# CONFIG_USB_EMI26 is not set
8814 +# CONFIG_USB_ADUTUX is not set
8815 +# CONFIG_USB_AUERSWALD is not set
8816 +# CONFIG_USB_RIO500 is not set
8817 +# CONFIG_USB_LEGOTOWER is not set
8818 +# CONFIG_USB_LCD is not set
8819 +# CONFIG_USB_BERRY_CHARGE is not set
8820 +# CONFIG_USB_LED is not set
8821 +# CONFIG_USB_CYPRESS_CY7C63 is not set
8822 +# CONFIG_USB_CYTHERM is not set
8823 +# CONFIG_USB_PHIDGET is not set
8824 +# CONFIG_USB_IDMOUSE is not set
8825 +# CONFIG_USB_FTDI_ELAN is not set
8826 +# CONFIG_USB_APPLEDISPLAY is not set
8827 +# CONFIG_USB_SISUSBVGA is not set
8828 +# CONFIG_USB_LD is not set
8829 +# CONFIG_USB_TRANCEVIBRATOR is not set
8830 +# CONFIG_USB_IOWARRIOR is not set
8831 +# CONFIG_USB_TEST is not set
8834 +# USB DSL modem support
8838 +# USB Gadget Support
8840 +CONFIG_USB_GADGET=m
8841 +# CONFIG_USB_GADGET_DEBUG is not set
8842 +# CONFIG_USB_GADGET_DEBUG_FILES is not set
8843 +CONFIG_USB_GADGET_SELECTED=y
8844 +# CONFIG_USB_GADGET_AMD5536UDC is not set
8845 +# CONFIG_USB_GADGET_FSL_USB2 is not set
8846 +# CONFIG_USB_GADGET_NET2280 is not set
8847 +# CONFIG_USB_GADGET_PXA2XX is not set
8848 +# CONFIG_USB_GADGET_M66592 is not set
8849 +CONFIG_USB_GADGET_MCF5445X=y
8850 +CONFIG_USB_MCF5445X=m
8851 +# CONFIG_USB_GADGET_GOKU is not set
8852 +# CONFIG_USB_GADGET_LH7A40X is not set
8853 +# CONFIG_USB_GADGET_OMAP is not set
8854 +# CONFIG_USB_GADGET_S3C2410 is not set
8855 +# CONFIG_USB_GADGET_AT91 is not set
8856 +# CONFIG_USB_GADGET_DUMMY_HCD is not set
8857 +CONFIG_USB_GADGET_DUALSPEED=y
8858 +# CONFIG_USB_ZERO is not set
8860 +CONFIG_USB_ETH_RNDIS=y
8861 +CONFIG_USB_GADGETFS=m
8862 +CONFIG_USB_FILE_STORAGE=m
8863 +# CONFIG_USB_FILE_STORAGE_TEST is not set
8864 +# CONFIG_USB_G_SERIAL is not set
8865 +# CONFIG_USB_MIDI_GADGET is not set
8866 +# CONFIG_MMC is not set
8867 +# CONFIG_NEW_LEDS is not set
8868 +# CONFIG_RTC_CLASS is not set
8871 +# DMA Engine support
8873 +# CONFIG_DMA_ENGINE is not set
8886 +# CONFIG_UIO is not set
8889 +# Character devices
8891 +# CONFIG_SERIAL_CONSOLE is not set
8897 +# CONFIG_EXT2_FS_XATTR is not set
8898 +# CONFIG_EXT2_FS_XIP is not set
8900 +CONFIG_EXT3_FS_XATTR=y
8901 +# CONFIG_EXT3_FS_POSIX_ACL is not set
8902 +# CONFIG_EXT3_FS_SECURITY is not set
8903 +# CONFIG_EXT4DEV_FS is not set
8905 +# CONFIG_JBD_DEBUG is not set
8906 +CONFIG_FS_MBCACHE=y
8907 +# CONFIG_REISERFS_FS is not set
8908 +# CONFIG_JFS_FS is not set
8909 +# CONFIG_FS_POSIX_ACL is not set
8910 +# CONFIG_XFS_FS is not set
8911 +# CONFIG_GFS2_FS is not set
8912 +# CONFIG_OCFS2_FS is not set
8914 +# CONFIG_ROMFS_FS is not set
8915 +# CONFIG_INOTIFY is not set
8916 +# CONFIG_QUOTA is not set
8918 +# CONFIG_AUTOFS_FS is not set
8919 +# CONFIG_AUTOFS4_FS is not set
8920 +# CONFIG_FUSE_FS is not set
8923 +# CD-ROM/DVD Filesystems
8925 +# CONFIG_ISO9660_FS is not set
8926 +# CONFIG_UDF_FS is not set
8929 +# DOS/FAT/NT Filesystems
8934 +CONFIG_FAT_DEFAULT_CODEPAGE=437
8935 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
8937 +# CONFIG_NTFS_DEBUG is not set
8941 +# Pseudo filesystems
8944 +# CONFIG_PROC_KCORE is not set
8945 +CONFIG_PROC_SYSCTL=y
8948 +# CONFIG_TMPFS_POSIX_ACL is not set
8949 +# CONFIG_HUGETLB_PAGE is not set
8951 +# CONFIG_CONFIGFS_FS is not set
8954 +# Miscellaneous filesystems
8956 +# CONFIG_ADFS_FS is not set
8957 +# CONFIG_AFFS_FS is not set
8958 +# CONFIG_HFS_FS is not set
8959 +# CONFIG_HFSPLUS_FS is not set
8960 +# CONFIG_BEFS_FS is not set
8961 +# CONFIG_BFS_FS is not set
8962 +# CONFIG_EFS_FS is not set
8964 +CONFIG_JFFS2_FS_DEBUG=0
8965 +CONFIG_JFFS2_FS_WRITEBUFFER=y
8966 +# CONFIG_JFFS2_SUMMARY is not set
8967 +# CONFIG_JFFS2_FS_XATTR is not set
8968 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
8969 +CONFIG_JFFS2_ZLIB=y
8970 +CONFIG_JFFS2_RTIME=y
8971 +# CONFIG_JFFS2_RUBIN is not set
8972 +# CONFIG_CRAMFS is not set
8973 +# CONFIG_VXFS_FS is not set
8974 +# CONFIG_HPFS_FS is not set
8975 +# CONFIG_QNX4FS_FS is not set
8976 +# CONFIG_SYSV_FS is not set
8977 +# CONFIG_UFS_FS is not set
8980 +# Network File Systems
8983 +# CONFIG_NFS_V3 is not set
8984 +# CONFIG_NFS_V4 is not set
8985 +# CONFIG_NFS_DIRECTIO is not set
8986 +# CONFIG_NFSD is not set
8989 +CONFIG_NFS_COMMON=y
8991 +# CONFIG_SUNRPC_BIND34 is not set
8992 +# CONFIG_RPCSEC_GSS_KRB5 is not set
8993 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
8994 +# CONFIG_SMB_FS is not set
8995 +# CONFIG_CIFS is not set
8996 +# CONFIG_NCP_FS is not set
8997 +# CONFIG_CODA_FS is not set
8998 +# CONFIG_AFS_FS is not set
9003 +CONFIG_PARTITION_ADVANCED=y
9004 +# CONFIG_ACORN_PARTITION is not set
9005 +# CONFIG_OSF_PARTITION is not set
9006 +# CONFIG_AMIGA_PARTITION is not set
9007 +# CONFIG_ATARI_PARTITION is not set
9008 +# CONFIG_MAC_PARTITION is not set
9009 +CONFIG_MSDOS_PARTITION=y
9010 +# CONFIG_BSD_DISKLABEL is not set
9011 +# CONFIG_MINIX_SUBPARTITION is not set
9012 +# CONFIG_SOLARIS_X86_PARTITION is not set
9013 +# CONFIG_UNIXWARE_DISKLABEL is not set
9014 +# CONFIG_LDM_PARTITION is not set
9015 +# CONFIG_SGI_PARTITION is not set
9016 +# CONFIG_ULTRIX_PARTITION is not set
9017 +# CONFIG_SUN_PARTITION is not set
9018 +# CONFIG_KARMA_PARTITION is not set
9019 +# CONFIG_EFI_PARTITION is not set
9020 +# CONFIG_SYSV68_PARTITION is not set
9023 +# Native Language Support
9026 +CONFIG_NLS_DEFAULT="iso8859-1"
9027 +CONFIG_NLS_CODEPAGE_437=y
9028 +# CONFIG_NLS_CODEPAGE_737 is not set
9029 +# CONFIG_NLS_CODEPAGE_775 is not set
9030 +# CONFIG_NLS_CODEPAGE_850 is not set
9031 +# CONFIG_NLS_CODEPAGE_852 is not set
9032 +# CONFIG_NLS_CODEPAGE_855 is not set
9033 +# CONFIG_NLS_CODEPAGE_857 is not set
9034 +# CONFIG_NLS_CODEPAGE_860 is not set
9035 +# CONFIG_NLS_CODEPAGE_861 is not set
9036 +# CONFIG_NLS_CODEPAGE_862 is not set
9037 +# CONFIG_NLS_CODEPAGE_863 is not set
9038 +# CONFIG_NLS_CODEPAGE_864 is not set
9039 +# CONFIG_NLS_CODEPAGE_865 is not set
9040 +# CONFIG_NLS_CODEPAGE_866 is not set
9041 +# CONFIG_NLS_CODEPAGE_869 is not set
9042 +# CONFIG_NLS_CODEPAGE_936 is not set
9043 +# CONFIG_NLS_CODEPAGE_950 is not set
9044 +# CONFIG_NLS_CODEPAGE_932 is not set
9045 +# CONFIG_NLS_CODEPAGE_949 is not set
9046 +# CONFIG_NLS_CODEPAGE_874 is not set
9047 +# CONFIG_NLS_ISO8859_8 is not set
9048 +# CONFIG_NLS_CODEPAGE_1250 is not set
9049 +# CONFIG_NLS_CODEPAGE_1251 is not set
9050 +# CONFIG_NLS_ASCII is not set
9051 +CONFIG_NLS_ISO8859_1=y
9052 +# CONFIG_NLS_ISO8859_2 is not set
9053 +# CONFIG_NLS_ISO8859_3 is not set
9054 +# CONFIG_NLS_ISO8859_4 is not set
9055 +# CONFIG_NLS_ISO8859_5 is not set
9056 +# CONFIG_NLS_ISO8859_6 is not set
9057 +# CONFIG_NLS_ISO8859_7 is not set
9058 +# CONFIG_NLS_ISO8859_9 is not set
9059 +# CONFIG_NLS_ISO8859_13 is not set
9060 +# CONFIG_NLS_ISO8859_14 is not set
9061 +# CONFIG_NLS_ISO8859_15 is not set
9062 +# CONFIG_NLS_KOI8_R is not set
9063 +# CONFIG_NLS_KOI8_U is not set
9067 +# Distributed Lock Manager
9069 +# CONFIG_DLM is not set
9074 +# CONFIG_PRINTK_TIME is not set
9075 +# CONFIG_ENABLE_MUST_CHECK is not set
9076 +# CONFIG_MAGIC_SYSRQ is not set
9077 +# CONFIG_UNUSED_SYMBOLS is not set
9078 +# CONFIG_DEBUG_FS is not set
9079 +# CONFIG_HEADERS_CHECK is not set
9080 +CONFIG_DEBUG_KERNEL=y
9081 +CONFIG_DETECT_SOFTLOCKUP=y
9082 +CONFIG_SCHED_DEBUG=y
9083 +# CONFIG_SCHEDSTATS is not set
9084 +# CONFIG_TIMER_STATS is not set
9085 +CONFIG_DEBUG_SLAB=y
9086 +# CONFIG_DEBUG_SLAB_LEAK is not set
9087 +# CONFIG_DEBUG_RT_MUTEXES is not set
9088 +# CONFIG_RT_MUTEX_TESTER is not set
9089 +# CONFIG_DEBUG_SPINLOCK is not set
9090 +# CONFIG_DEBUG_MUTEXES is not set
9091 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
9092 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
9093 +# CONFIG_DEBUG_KOBJECT is not set
9094 +CONFIG_DEBUG_BUGVERBOSE=y
9095 +CONFIG_DEBUG_INFO=y
9096 +# CONFIG_DEBUG_VM is not set
9097 +# CONFIG_DEBUG_LIST is not set
9098 +# CONFIG_FRAME_POINTER is not set
9099 +CONFIG_FORCED_INLINING=y
9100 +# CONFIG_RCU_TORTURE_TEST is not set
9101 +# CONFIG_FAULT_INJECTION is not set
9103 +CONFIG_BOOTPARAM_STRING="root=/dev/nfs rw nfsroot=172.27.155.1:/tftpboot/redstripe ip=172.27.155.55:172.27.155.1:172.27.255.254:255.255.0.0::eth0:off mtdparts=phys_mapped_flash:16m(User)"
9108 +# CONFIG_CODETEST is not set
9113 +# CONFIG_KEYS is not set
9114 +# CONFIG_SECURITY is not set
9116 +CONFIG_CRYPTO_ALGAPI=y
9117 +CONFIG_CRYPTO_BLKCIPHER=y
9118 +CONFIG_CRYPTO_HASH=y
9119 +CONFIG_CRYPTO_MANAGER=y
9120 +CONFIG_CRYPTO_HMAC=y
9121 +# CONFIG_CRYPTO_XCBC is not set
9122 +# CONFIG_CRYPTO_NULL is not set
9123 +# CONFIG_CRYPTO_MD4 is not set
9124 +CONFIG_CRYPTO_MD5=y
9125 +CONFIG_CRYPTO_SHA1=y
9126 +# CONFIG_CRYPTO_SHA256 is not set
9127 +# CONFIG_CRYPTO_SHA512 is not set
9128 +# CONFIG_CRYPTO_WP512 is not set
9129 +# CONFIG_CRYPTO_TGR192 is not set
9130 +# CONFIG_CRYPTO_GF128MUL is not set
9131 +CONFIG_CRYPTO_ECB=y
9132 +CONFIG_CRYPTO_CBC=y
9133 +CONFIG_CRYPTO_PCBC=m
9134 +# CONFIG_CRYPTO_LRW is not set
9135 +# CONFIG_CRYPTO_CRYPTD is not set
9136 +CONFIG_CRYPTO_DES=y
9137 +# CONFIG_CRYPTO_FCRYPT is not set
9138 +# CONFIG_CRYPTO_BLOWFISH is not set
9139 +# CONFIG_CRYPTO_TWOFISH is not set
9140 +# CONFIG_CRYPTO_SERPENT is not set
9141 +# CONFIG_CRYPTO_AES is not set
9142 +# CONFIG_CRYPTO_CAST5 is not set
9143 +# CONFIG_CRYPTO_CAST6 is not set
9144 +# CONFIG_CRYPTO_TEA is not set
9145 +# CONFIG_CRYPTO_ARC4 is not set
9146 +# CONFIG_CRYPTO_KHAZAD is not set
9147 +# CONFIG_CRYPTO_ANUBIS is not set
9148 +# CONFIG_CRYPTO_DEFLATE is not set
9149 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
9150 +# CONFIG_CRYPTO_CRC32C is not set
9151 +# CONFIG_CRYPTO_CAMELLIA is not set
9152 +CONFIG_CRYPTO_TEST=m
9154 +CONFIG_CRYPTO_DEV_MCFCAU=y
9155 +CONFIG_CRYPTO_DEV_MCFCAU_DES=y
9156 +CONFIG_CRYPTO_DEV_MCFCAU_AES=y
9157 +CONFIG_CRYPTO_DEV_MCFCAU_MD5=y
9158 +CONFIG_CRYPTO_DEV_MCFCAU_SHA1=y
9163 +CONFIG_BITREVERSE=y
9166 +# CONFIG_CRC_ITU_T is not set
9168 +# CONFIG_CRC7 is not set
9170 +CONFIG_ZLIB_INFLATE=y
9171 +CONFIG_ZLIB_DEFLATE=y
9176 +++ b/arch/m68k/configs/m5475evb_defconfig
9179 +# Automatically generated make config: don't edit
9180 +# Linux kernel version: 2.6.25
9181 +# Wed Jul 9 16:09:19 2008
9185 +# CONFIG_GENERIC_TIME is not set
9186 +# CONFIG_GENERIC_CLOCKEVENTS is not set
9187 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
9188 +# CONFIG_ARCH_HAS_ILOG2_U32 is not set
9189 +# CONFIG_ARCH_HAS_ILOG2_U64 is not set
9190 +CONFIG_GENERIC_HWEIGHT=y
9191 +CONFIG_GENERIC_CALIBRATE_DELAY=y
9192 +CONFIG_TIME_LOW_RES=y
9193 +CONFIG_GENERIC_IOMAP=y
9194 +# CONFIG_NO_IOPORT is not set
9195 +# CONFIG_NO_DMA is not set
9196 +CONFIG_ARCH_SUPPORTS_AOUT=y
9198 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
9203 +CONFIG_EXPERIMENTAL=y
9204 +CONFIG_BROKEN_ON_SMP=y
9205 +CONFIG_INIT_ENV_ARG_LIMIT=32
9206 +CONFIG_LOCALVERSION=""
9207 +CONFIG_LOCALVERSION_AUTO=y
9210 +CONFIG_SYSVIPC_SYSCTL=y
9211 +# CONFIG_POSIX_MQUEUE is not set
9212 +# CONFIG_BSD_PROCESS_ACCT is not set
9213 +# CONFIG_TASKSTATS is not set
9214 +# CONFIG_AUDIT is not set
9216 +CONFIG_IKCONFIG_PROC=y
9217 +CONFIG_LOG_BUF_SHIFT=17
9218 +# CONFIG_CGROUPS is not set
9219 +CONFIG_GROUP_SCHED=y
9220 +CONFIG_FAIR_GROUP_SCHED=y
9221 +# CONFIG_RT_GROUP_SCHED is not set
9222 +CONFIG_USER_SCHED=y
9223 +# CONFIG_CGROUP_SCHED is not set
9224 +CONFIG_SYSFS_DEPRECATED=y
9225 +CONFIG_SYSFS_DEPRECATED_V2=y
9226 +# CONFIG_RELAY is not set
9227 +CONFIG_NAMESPACES=y
9228 +# CONFIG_UTS_NS is not set
9229 +# CONFIG_IPC_NS is not set
9230 +# CONFIG_USER_NS is not set
9231 +# CONFIG_PID_NS is not set
9232 +# CONFIG_BLK_DEV_INITRD is not set
9233 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
9235 +# CONFIG_EMBEDDED is not set
9237 +CONFIG_SYSCTL_SYSCALL=y
9239 +# CONFIG_KALLSYMS_ALL is not set
9240 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
9245 +CONFIG_COMPAT_BRK=y
9248 +CONFIG_ANON_INODES=y
9254 +CONFIG_VM_EVENT_COUNTERS=y
9256 +# CONFIG_SLUB is not set
9257 +# CONFIG_SLOB is not set
9258 +# CONFIG_PROFILING is not set
9259 +# CONFIG_MARKERS is not set
9260 +# CONFIG_HAVE_OPROFILE is not set
9261 +# CONFIG_HAVE_KPROBES is not set
9262 +# CONFIG_HAVE_KRETPROBES is not set
9263 +CONFIG_PROC_PAGE_MONITOR=y
9265 +CONFIG_RT_MUTEXES=y
9266 +# CONFIG_TINY_SHMEM is not set
9267 +CONFIG_BASE_SMALL=0
9269 +CONFIG_MODULE_UNLOAD=y
9270 +CONFIG_MODULE_FORCE_UNLOAD=y
9271 +# CONFIG_MODVERSIONS is not set
9272 +# CONFIG_MODULE_SRCVERSION_ALL is not set
9273 +# CONFIG_KMOD is not set
9276 +# CONFIG_BLK_DEV_IO_TRACE is not set
9277 +# CONFIG_LSF is not set
9278 +# CONFIG_BLK_DEV_BSG is not set
9283 +CONFIG_IOSCHED_NOOP=y
9284 +CONFIG_IOSCHED_AS=y
9285 +CONFIG_IOSCHED_DEADLINE=y
9286 +CONFIG_IOSCHED_CFQ=y
9287 +# CONFIG_DEFAULT_AS is not set
9288 +# CONFIG_DEFAULT_DEADLINE is not set
9289 +CONFIG_DEFAULT_CFQ=y
9290 +# CONFIG_DEFAULT_NOOP is not set
9291 +CONFIG_DEFAULT_IOSCHED="cfq"
9292 +CONFIG_CLASSIC_RCU=y
9295 +# Platform dependent setup
9297 +# CONFIG_SUN3 is not set
9301 +# CONFIG_AMIGA is not set
9302 +# CONFIG_ATARI is not set
9304 +# CONFIG_MAC is not set
9305 +# CONFIG_APOLLO is not set
9306 +# CONFIG_VME is not set
9307 +# CONFIG_HP300 is not set
9308 +# CONFIG_SUN3X is not set
9309 +# CONFIG_Q40 is not set
9314 +# CONFIG_M68020 is not set
9315 +# CONFIG_M68030 is not set
9316 +# CONFIG_M68040 is not set
9317 +# CONFIG_M68060 is not set
9318 +# CONFIG_M5445X is not set
9321 +# CONFIG_M548X is not set
9322 +# CONFIG_M5475AFE is not set
9323 +# CONFIG_M5475BFE is not set
9325 +# CONFIG_M5475DFE is not set
9326 +# CONFIG_M5475EFE is not set
9327 +# CONFIG_M5475FFE is not set
9328 +# CONFIG_M5485AFE is not set
9329 +# CONFIG_M5485BFE is not set
9330 +# CONFIG_M5485CFE is not set
9331 +# CONFIG_M5485DFE is not set
9332 +# CONFIG_M5485EFE is not set
9333 +# CONFIG_M5485FFE is not set
9334 +CONFIG_MCFCLK=266000000
9335 +# CONFIG_MCF_USER_HALT is not set
9337 +CONFIG_SDRAM_BASE=0x00000000
9338 +CONFIG_SDRAM_SIZE=0x04000000
9339 +CONFIG_NOR_FLASH_BASE=0xE0000000
9340 +# CONFIG_M68KFPU_EMU is not set
9342 +# CONFIG_RMW_INSNS is not set
9343 +CONFIG_SINGLE_MEMORY_CHUNK=y
9344 +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
9345 +CONFIG_SELECT_MEMORY_MODEL=y
9346 +CONFIG_FLATMEM_MANUAL=y
9347 +# CONFIG_DISCONTIGMEM_MANUAL is not set
9348 +# CONFIG_SPARSEMEM_MANUAL is not set
9350 +CONFIG_FLAT_NODE_MEM_MAP=y
9351 +CONFIG_NEED_MULTIPLE_NODES=y
9352 +# CONFIG_SPARSEMEM_STATIC is not set
9353 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
9354 +CONFIG_SPLIT_PTLOCK_CPUS=4
9355 +# CONFIG_RESOURCES_64BIT is not set
9356 +CONFIG_ZONE_DMA_FLAG=1
9358 +CONFIG_VIRT_TO_BUS=y
9363 +CONFIG_BINFMT_ELF=y
9364 +# CONFIG_BINFMT_AOUT is not set
9365 +# CONFIG_BINFMT_MISC is not set
9366 +CONFIG_PROC_HARDWARE=y
9368 +# CONFIG_ARCH_SUPPORTS_MSI is not set
9369 +CONFIG_PCI_LEGACY=y
9370 +# CONFIG_PCI_DEBUG is not set
9373 +# Power management options
9375 +# CONFIG_PM is not set
9383 +# Networking options
9386 +# CONFIG_PACKET_MMAP is not set
9389 +# CONFIG_XFRM_USER is not set
9390 +# CONFIG_XFRM_SUB_POLICY is not set
9391 +# CONFIG_XFRM_MIGRATE is not set
9392 +# CONFIG_XFRM_STATISTICS is not set
9394 +# CONFIG_NET_KEY_MIGRATE is not set
9396 +# CONFIG_IP_MULTICAST is not set
9397 +CONFIG_IP_ADVANCED_ROUTER=y
9398 +CONFIG_ASK_IP_FIB_HASH=y
9399 +# CONFIG_IP_FIB_TRIE is not set
9400 +CONFIG_IP_FIB_HASH=y
9401 +# CONFIG_IP_MULTIPLE_TABLES is not set
9402 +# CONFIG_IP_ROUTE_MULTIPATH is not set
9403 +# CONFIG_IP_ROUTE_VERBOSE is not set
9405 +# CONFIG_IP_PNP_DHCP is not set
9406 +# CONFIG_IP_PNP_BOOTP is not set
9407 +# CONFIG_IP_PNP_RARP is not set
9408 +# CONFIG_NET_IPIP is not set
9409 +# CONFIG_NET_IPGRE is not set
9410 +# CONFIG_ARPD is not set
9411 +# CONFIG_SYN_COOKIES is not set
9414 +# CONFIG_INET_IPCOMP is not set
9415 +# CONFIG_INET_XFRM_TUNNEL is not set
9416 +# CONFIG_INET_TUNNEL is not set
9417 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
9418 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
9419 +# CONFIG_INET_XFRM_MODE_BEET is not set
9420 +# CONFIG_INET_LRO is not set
9422 +CONFIG_INET_TCP_DIAG=y
9423 +# CONFIG_TCP_CONG_ADVANCED is not set
9424 +CONFIG_TCP_CONG_CUBIC=y
9425 +CONFIG_DEFAULT_TCP_CONG="cubic"
9426 +# CONFIG_TCP_MD5SIG is not set
9427 +# CONFIG_IPV6 is not set
9428 +# CONFIG_INET6_XFRM_TUNNEL is not set
9429 +# CONFIG_INET6_TUNNEL is not set
9430 +# CONFIG_NETWORK_SECMARK is not set
9431 +# CONFIG_NETFILTER is not set
9432 +# CONFIG_IP_DCCP is not set
9433 +# CONFIG_IP_SCTP is not set
9434 +# CONFIG_TIPC is not set
9435 +# CONFIG_ATM is not set
9436 +# CONFIG_BRIDGE is not set
9437 +# CONFIG_VLAN_8021Q is not set
9438 +# CONFIG_DECNET is not set
9439 +# CONFIG_LLC2 is not set
9440 +# CONFIG_IPX is not set
9441 +# CONFIG_ATALK is not set
9442 +# CONFIG_X25 is not set
9443 +# CONFIG_LAPB is not set
9444 +# CONFIG_ECONET is not set
9445 +# CONFIG_WAN_ROUTER is not set
9446 +# CONFIG_NET_SCHED is not set
9451 +# CONFIG_NET_PKTGEN is not set
9452 +# CONFIG_HAMRADIO is not set
9455 +# CONFIG_CAN_BCM is not set
9458 +# CAN Device Drivers
9460 +# CONFIG_CAN_VCAN is not set
9461 +CONFIG_CAN_FLEXCAN=y
9462 +CONFIG_CAN_MCF547X_8X=y
9463 +# CONFIG_CAN_DEBUG_DEVICES is not set
9464 +# CONFIG_IRDA is not set
9465 +# CONFIG_BT is not set
9466 +# CONFIG_AF_RXRPC is not set
9471 +# CONFIG_CFG80211 is not set
9472 +# CONFIG_WIRELESS_EXT is not set
9473 +# CONFIG_MAC80211 is not set
9474 +# CONFIG_IEEE80211 is not set
9475 +# CONFIG_RFKILL is not set
9476 +# CONFIG_NET_9P is not set
9483 +# Generic Driver Options
9485 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
9486 +# CONFIG_STANDALONE is not set
9487 +CONFIG_PREVENT_FIRMWARE_BUILD=y
9489 +# CONFIG_DEBUG_DRIVER is not set
9490 +# CONFIG_DEBUG_DEVRES is not set
9491 +# CONFIG_SYS_HYPERVISOR is not set
9492 +# CONFIG_CONNECTOR is not set
9494 +# CONFIG_MTD_DEBUG is not set
9495 +# CONFIG_MTD_CONCAT is not set
9496 +CONFIG_MTD_PARTITIONS=y
9497 +# CONFIG_MTD_REDBOOT_PARTS is not set
9498 +CONFIG_MTD_CMDLINE_PARTS=y
9501 +# User Modules And Translation Layers
9503 +# CONFIG_MTD_CHAR is not set
9504 +CONFIG_MTD_BLKDEVS=y
9506 +# CONFIG_FTL is not set
9507 +# CONFIG_NFTL is not set
9508 +# CONFIG_INFTL is not set
9509 +# CONFIG_RFD_FTL is not set
9510 +# CONFIG_SSFDC is not set
9511 +# CONFIG_MTD_OOPS is not set
9514 +# RAM/ROM/Flash chip drivers
9516 +# CONFIG_MTD_CFI is not set
9517 +# CONFIG_MTD_JEDECPROBE is not set
9518 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
9519 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
9520 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
9521 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
9522 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
9523 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
9524 +CONFIG_MTD_CFI_I1=y
9525 +CONFIG_MTD_CFI_I2=y
9526 +# CONFIG_MTD_CFI_I4 is not set
9527 +# CONFIG_MTD_CFI_I8 is not set
9530 +# CONFIG_MTD_ABSENT is not set
9533 +# Mapping drivers for chip access
9535 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
9536 +# CONFIG_MTD_PHYSMAP is not set
9537 +# CONFIG_MTD_INTEL_VR_NOR is not set
9538 +# CONFIG_MTD_PLATRAM is not set
9541 +# Self-contained MTD device drivers
9543 +# CONFIG_MTD_PMC551 is not set
9544 +# CONFIG_MTD_DATAFLASH is not set
9545 +# CONFIG_MTD_M25P80 is not set
9546 +# CONFIG_MTD_SLRAM is not set
9547 +# CONFIG_MTD_PHRAM is not set
9548 +# CONFIG_MTD_MTDRAM is not set
9549 +# CONFIG_MTD_BLOCK2MTD is not set
9552 +# Disk-On-Chip Device Drivers
9554 +# CONFIG_MTD_DOC2000 is not set
9555 +# CONFIG_MTD_DOC2001 is not set
9556 +# CONFIG_MTD_DOC2001PLUS is not set
9557 +# CONFIG_MTD_NAND is not set
9558 +# CONFIG_MTD_ONENAND is not set
9561 +# UBI - Unsorted block images
9563 +# CONFIG_MTD_UBI is not set
9564 +# CONFIG_PARPORT is not set
9566 +# CONFIG_BLK_CPQ_DA is not set
9567 +# CONFIG_BLK_CPQ_CISS_DA is not set
9568 +# CONFIG_BLK_DEV_DAC960 is not set
9569 +# CONFIG_BLK_DEV_UMEM is not set
9570 +# CONFIG_BLK_DEV_COW_COMMON is not set
9571 +CONFIG_BLK_DEV_LOOP=y
9572 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
9573 +# CONFIG_BLK_DEV_NBD is not set
9574 +# CONFIG_BLK_DEV_SX8 is not set
9575 +CONFIG_BLK_DEV_RAM=y
9576 +CONFIG_BLK_DEV_RAM_COUNT=16
9577 +CONFIG_BLK_DEV_RAM_SIZE=64000
9578 +# CONFIG_BLK_DEV_XIP is not set
9579 +# CONFIG_CDROM_PKTCDVD is not set
9580 +# CONFIG_ATA_OVER_ETH is not set
9581 +CONFIG_MISC_DEVICES=y
9582 +CONFIG_COLDFIRE_SEC=y
9583 +CONFIG_SEC_DEVICE=y
9584 +# CONFIG_PHANTOM is not set
9585 +# CONFIG_EEPROM_93CX6 is not set
9586 +# CONFIG_SGI_IOC4 is not set
9587 +# CONFIG_TIFM_CORE is not set
9588 +# CONFIG_ENCLOSURE_SERVICES is not set
9590 +# CONFIG_IDE is not set
9593 +# SCSI device support
9595 +# CONFIG_RAID_ATTRS is not set
9598 +# CONFIG_SCSI_TGT is not set
9599 +# CONFIG_SCSI_NETLINK is not set
9600 +CONFIG_SCSI_PROC_FS=y
9603 +# SCSI support type (disk, tape, CD-ROM)
9605 +CONFIG_BLK_DEV_SD=y
9606 +# CONFIG_CHR_DEV_ST is not set
9607 +# CONFIG_CHR_DEV_OSST is not set
9608 +# CONFIG_BLK_DEV_SR is not set
9609 +# CONFIG_CHR_DEV_SG is not set
9610 +# CONFIG_CHR_DEV_SCH is not set
9613 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
9615 +CONFIG_SCSI_MULTI_LUN=y
9616 +# CONFIG_SCSI_CONSTANTS is not set
9617 +# CONFIG_SCSI_LOGGING is not set
9618 +# CONFIG_SCSI_SCAN_ASYNC is not set
9619 +CONFIG_SCSI_WAIT_SCAN=m
9624 +# CONFIG_SCSI_SPI_ATTRS is not set
9625 +# CONFIG_SCSI_FC_ATTRS is not set
9626 +# CONFIG_SCSI_ISCSI_ATTRS is not set
9627 +# CONFIG_SCSI_SAS_LIBSAS is not set
9628 +# CONFIG_SCSI_SRP_ATTRS is not set
9629 +# CONFIG_SCSI_LOWLEVEL is not set
9630 +# CONFIG_ATA is not set
9631 +# CONFIG_MD is not set
9632 +# CONFIG_FUSION is not set
9635 +# IEEE 1394 (FireWire) support
9637 +# CONFIG_FIREWIRE is not set
9638 +# CONFIG_IEEE1394 is not set
9639 +# CONFIG_I2O is not set
9640 +CONFIG_NETDEVICES=y
9641 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
9642 +# CONFIG_DUMMY is not set
9643 +# CONFIG_BONDING is not set
9644 +# CONFIG_MACVLAN is not set
9645 +# CONFIG_EQUALIZER is not set
9646 +# CONFIG_TUN is not set
9647 +# CONFIG_VETH is not set
9648 +# CONFIG_ARCNET is not set
9649 +# CONFIG_PHYLIB is not set
9650 +CONFIG_NET_ETHERNET=y
9653 +CONFIG_FEC_548x_AUTO_NEGOTIATION=y
9654 +# CONFIG_FEC_548x_ENABLE_FEC2 is not set
9655 +# CONFIG_HAPPYMEAL is not set
9656 +# CONFIG_SUNGEM is not set
9657 +# CONFIG_CASSINI is not set
9658 +# CONFIG_NET_VENDOR_3COM is not set
9659 +# CONFIG_ENC28J60 is not set
9660 +# CONFIG_NET_TULIP is not set
9661 +# CONFIG_HP100 is not set
9662 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
9663 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
9664 +# CONFIG_IBM_NEW_EMAC_TAH is not set
9665 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
9666 +# CONFIG_NET_PCI is not set
9667 +# CONFIG_B44 is not set
9668 +# CONFIG_NETDEV_1000 is not set
9669 +# CONFIG_NETDEV_10000 is not set
9670 +# CONFIG_TR is not set
9675 +# CONFIG_WLAN_PRE80211 is not set
9676 +# CONFIG_WLAN_80211 is not set
9677 +# CONFIG_WAN is not set
9678 +# CONFIG_FDDI is not set
9679 +# CONFIG_HIPPI is not set
9680 +# CONFIG_PPP is not set
9681 +# CONFIG_SLIP is not set
9682 +# CONFIG_NET_FC is not set
9683 +# CONFIG_NETCONSOLE is not set
9684 +# CONFIG_NETPOLL is not set
9685 +# CONFIG_NET_POLL_CONTROLLER is not set
9686 +# CONFIG_ISDN is not set
9687 +# CONFIG_PHONE is not set
9690 +# Input device support
9693 +# CONFIG_INPUT_FF_MEMLESS is not set
9694 +# CONFIG_INPUT_POLLDEV is not set
9697 +# Userland interfaces
9699 +CONFIG_INPUT_MOUSEDEV=y
9700 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
9701 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
9702 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
9703 +# CONFIG_INPUT_JOYDEV is not set
9704 +CONFIG_INPUT_EVDEV=y
9705 +# CONFIG_INPUT_EVBUG is not set
9708 +# Input Device Drivers
9710 +CONFIG_INPUT_KEYBOARD=y
9711 +# CONFIG_KEYBOARD_ATKBD is not set
9712 +# CONFIG_KEYBOARD_SUNKBD is not set
9713 +# CONFIG_KEYBOARD_LKKBD is not set
9714 +# CONFIG_KEYBOARD_XTKBD is not set
9715 +# CONFIG_KEYBOARD_NEWTON is not set
9716 +# CONFIG_KEYBOARD_STOWAWAY is not set
9717 +# CONFIG_INPUT_MOUSE is not set
9718 +# CONFIG_INPUT_JOYSTICK is not set
9719 +# CONFIG_INPUT_TABLET is not set
9720 +# CONFIG_INPUT_TOUCHSCREEN is not set
9721 +# CONFIG_INPUT_MISC is not set
9724 +# Hardware I/O ports
9727 +CONFIG_SERIO_SERPORT=y
9728 +# CONFIG_SERIO_PCIPS2 is not set
9729 +# CONFIG_SERIO_RAW is not set
9730 +# CONFIG_GAMEPORT is not set
9733 +# Character devices
9736 +CONFIG_VT_CONSOLE=y
9737 +CONFIG_HW_CONSOLE=y
9738 +# CONFIG_VT_HW_CONSOLE_BINDING is not set
9739 +# CONFIG_SERIAL_NONSTANDARD is not set
9740 +# CONFIG_NOZOMI is not set
9745 +# CONFIG_SERIAL_8250 is not set
9748 +# Non-8250 serial port support
9750 +CONFIG_SERIAL_COLDFIRE=y
9751 +CONFIG_SERIAL_COLDFIRE_IRDA=y
9752 +# CONFIG_SERIAL_MCF is not set
9753 +# CONFIG_SERIAL_JSM is not set
9754 +CONFIG_UNIX98_PTYS=y
9755 +# CONFIG_LEGACY_PTYS is not set
9756 +# CONFIG_IPMI_HANDLER is not set
9757 +# CONFIG_HW_RANDOM is not set
9758 +# CONFIG_GEN_RTC is not set
9759 +# CONFIG_R3964 is not set
9760 +# CONFIG_APPLICOM is not set
9761 +# CONFIG_RAW_DRIVER is not set
9762 +# CONFIG_TCG_TPM is not set
9763 +# CONFIG_I2C is not set
9770 +# CONFIG_COLDFIRE_EDMA is not set
9771 +CONFIG_SPI_MASTER=y
9774 +# SPI Master Controller Drivers
9776 +# CONFIG_SPI_BITBANG is not set
9777 +CONFIG_SPI_COLDFIRE=y
9780 +# SPI Protocol Masters
9782 +# CONFIG_SPI_AT25 is not set
9783 +# CONFIG_SPI_SPIDEV is not set
9784 +# CONFIG_SPI_TLE62X0 is not set
9785 +# CONFIG_SPI_COLDFIRE_SSI_AUDIO is not set
9786 +# CONFIG_W1 is not set
9787 +# CONFIG_POWER_SUPPLY is not set
9788 +# CONFIG_HWMON is not set
9789 +# CONFIG_THERMAL is not set
9791 +# CONFIG_WATCHDOG_NOWAYOUT is not set
9794 +# Watchdog Device Drivers
9796 +# CONFIG_SOFT_WATCHDOG is not set
9797 +CONFIG_COLDFIRE_WATCHDOG=m
9800 +# PCI-based Watchdog Cards
9802 +# CONFIG_PCIPCWATCHDOG is not set
9803 +# CONFIG_WDTPCI is not set
9806 +# Sonics Silicon Backplane
9808 +CONFIG_SSB_POSSIBLE=y
9809 +# CONFIG_SSB is not set
9812 +# Multifunction device drivers
9814 +# CONFIG_MFD_SM501 is not set
9817 +# Multimedia devices
9819 +# CONFIG_VIDEO_DEV is not set
9820 +# CONFIG_DVB_CORE is not set
9826 +# CONFIG_DRM is not set
9827 +# CONFIG_VGASTATE is not set
9828 +CONFIG_VIDEO_OUTPUT_CONTROL=m
9829 +# CONFIG_FB is not set
9830 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
9833 +# Display device support
9835 +# CONFIG_DISPLAY_SUPPORT is not set
9838 +# Console display driver support
9840 +CONFIG_DUMMY_CONSOLE=y
9845 +# CONFIG_SOUND is not set
9846 +CONFIG_HID_SUPPORT=y
9849 +# CONFIG_HIDRAW is not set
9850 +# CONFIG_USB_SUPPORT is not set
9851 +# CONFIG_MMC is not set
9852 +# CONFIG_MEMSTICK is not set
9853 +# CONFIG_NEW_LEDS is not set
9854 +# CONFIG_INFINIBAND is not set
9855 +# CONFIG_RTC_CLASS is not set
9860 +# CONFIG_UIO is not set
9863 +# Character devices
9865 +# CONFIG_SERIAL_CONSOLE is not set
9871 +# CONFIG_EXT2_FS_XATTR is not set
9872 +# CONFIG_EXT2_FS_XIP is not set
9874 +CONFIG_EXT3_FS_XATTR=y
9875 +# CONFIG_EXT3_FS_POSIX_ACL is not set
9876 +# CONFIG_EXT3_FS_SECURITY is not set
9877 +# CONFIG_EXT4DEV_FS is not set
9879 +CONFIG_FS_MBCACHE=y
9880 +# CONFIG_REISERFS_FS is not set
9881 +# CONFIG_JFS_FS is not set
9882 +# CONFIG_FS_POSIX_ACL is not set
9883 +# CONFIG_XFS_FS is not set
9884 +# CONFIG_GFS2_FS is not set
9885 +# CONFIG_OCFS2_FS is not set
9887 +# CONFIG_INOTIFY is not set
9888 +# CONFIG_QUOTA is not set
9889 +# CONFIG_AUTOFS_FS is not set
9890 +# CONFIG_AUTOFS4_FS is not set
9891 +# CONFIG_FUSE_FS is not set
9894 +# CD-ROM/DVD Filesystems
9896 +# CONFIG_ISO9660_FS is not set
9897 +# CONFIG_UDF_FS is not set
9900 +# DOS/FAT/NT Filesystems
9905 +CONFIG_FAT_DEFAULT_CODEPAGE=437
9906 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
9908 +# CONFIG_NTFS_DEBUG is not set
9912 +# Pseudo filesystems
9915 +# CONFIG_PROC_KCORE is not set
9916 +CONFIG_PROC_SYSCTL=y
9919 +# CONFIG_TMPFS_POSIX_ACL is not set
9920 +# CONFIG_HUGETLB_PAGE is not set
9921 +# CONFIG_CONFIGFS_FS is not set
9924 +# Miscellaneous filesystems
9926 +# CONFIG_ADFS_FS is not set
9927 +# CONFIG_AFFS_FS is not set
9928 +# CONFIG_HFS_FS is not set
9929 +# CONFIG_HFSPLUS_FS is not set
9930 +# CONFIG_BEFS_FS is not set
9931 +# CONFIG_BFS_FS is not set
9932 +# CONFIG_EFS_FS is not set
9933 +# CONFIG_JFFS2_FS is not set
9934 +# CONFIG_CRAMFS is not set
9935 +# CONFIG_VXFS_FS is not set
9937 +# CONFIG_HPFS_FS is not set
9938 +# CONFIG_QNX4FS_FS is not set
9940 +# CONFIG_SYSV_FS is not set
9941 +# CONFIG_UFS_FS is not set
9942 +CONFIG_NETWORK_FILESYSTEMS=y
9944 +# CONFIG_NFS_V3 is not set
9945 +# CONFIG_NFS_V4 is not set
9946 +# CONFIG_NFS_DIRECTIO is not set
9947 +# CONFIG_NFSD is not set
9950 +CONFIG_NFS_COMMON=y
9952 +# CONFIG_SUNRPC_BIND34 is not set
9953 +# CONFIG_RPCSEC_GSS_KRB5 is not set
9954 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
9955 +# CONFIG_SMB_FS is not set
9956 +# CONFIG_CIFS is not set
9957 +# CONFIG_NCP_FS is not set
9958 +# CONFIG_CODA_FS is not set
9959 +# CONFIG_AFS_FS is not set
9964 +CONFIG_PARTITION_ADVANCED=y
9965 +# CONFIG_ACORN_PARTITION is not set
9966 +# CONFIG_OSF_PARTITION is not set
9967 +# CONFIG_AMIGA_PARTITION is not set
9968 +# CONFIG_ATARI_PARTITION is not set
9969 +# CONFIG_MAC_PARTITION is not set
9970 +CONFIG_MSDOS_PARTITION=y
9971 +# CONFIG_BSD_DISKLABEL is not set
9972 +# CONFIG_MINIX_SUBPARTITION is not set
9973 +# CONFIG_SOLARIS_X86_PARTITION is not set
9974 +# CONFIG_UNIXWARE_DISKLABEL is not set
9975 +# CONFIG_LDM_PARTITION is not set
9976 +# CONFIG_SGI_PARTITION is not set
9977 +# CONFIG_ULTRIX_PARTITION is not set
9978 +# CONFIG_SUN_PARTITION is not set
9979 +# CONFIG_KARMA_PARTITION is not set
9980 +# CONFIG_EFI_PARTITION is not set
9981 +# CONFIG_SYSV68_PARTITION is not set
9983 +CONFIG_NLS_DEFAULT="iso8859-1"
9984 +CONFIG_NLS_CODEPAGE_437=y
9985 +# CONFIG_NLS_CODEPAGE_737 is not set
9986 +# CONFIG_NLS_CODEPAGE_775 is not set
9987 +# CONFIG_NLS_CODEPAGE_850 is not set
9988 +# CONFIG_NLS_CODEPAGE_852 is not set
9989 +# CONFIG_NLS_CODEPAGE_855 is not set
9990 +# CONFIG_NLS_CODEPAGE_857 is not set
9991 +# CONFIG_NLS_CODEPAGE_860 is not set
9992 +# CONFIG_NLS_CODEPAGE_861 is not set
9993 +# CONFIG_NLS_CODEPAGE_862 is not set
9994 +# CONFIG_NLS_CODEPAGE_863 is not set
9995 +# CONFIG_NLS_CODEPAGE_864 is not set
9996 +# CONFIG_NLS_CODEPAGE_865 is not set
9997 +# CONFIG_NLS_CODEPAGE_866 is not set
9998 +# CONFIG_NLS_CODEPAGE_869 is not set
9999 +# CONFIG_NLS_CODEPAGE_936 is not set
10000 +# CONFIG_NLS_CODEPAGE_950 is not set
10001 +# CONFIG_NLS_CODEPAGE_932 is not set
10002 +# CONFIG_NLS_CODEPAGE_949 is not set
10003 +# CONFIG_NLS_CODEPAGE_874 is not set
10004 +# CONFIG_NLS_ISO8859_8 is not set
10005 +# CONFIG_NLS_CODEPAGE_1250 is not set
10006 +# CONFIG_NLS_CODEPAGE_1251 is not set
10007 +# CONFIG_NLS_ASCII is not set
10008 +CONFIG_NLS_ISO8859_1=y
10009 +# CONFIG_NLS_ISO8859_2 is not set
10010 +# CONFIG_NLS_ISO8859_3 is not set
10011 +# CONFIG_NLS_ISO8859_4 is not set
10012 +# CONFIG_NLS_ISO8859_5 is not set
10013 +# CONFIG_NLS_ISO8859_6 is not set
10014 +# CONFIG_NLS_ISO8859_7 is not set
10015 +# CONFIG_NLS_ISO8859_9 is not set
10016 +# CONFIG_NLS_ISO8859_13 is not set
10017 +# CONFIG_NLS_ISO8859_14 is not set
10018 +# CONFIG_NLS_ISO8859_15 is not set
10019 +# CONFIG_NLS_KOI8_R is not set
10020 +# CONFIG_NLS_KOI8_U is not set
10022 +# CONFIG_DLM is not set
10027 +# CONFIG_PRINTK_TIME is not set
10028 +CONFIG_ENABLE_WARN_DEPRECATED=y
10029 +# CONFIG_ENABLE_MUST_CHECK is not set
10030 +# CONFIG_MAGIC_SYSRQ is not set
10031 +# CONFIG_UNUSED_SYMBOLS is not set
10032 +# CONFIG_DEBUG_FS is not set
10033 +# CONFIG_HEADERS_CHECK is not set
10034 +CONFIG_DEBUG_KERNEL=y
10035 +CONFIG_DETECT_SOFTLOCKUP=y
10036 +CONFIG_SCHED_DEBUG=y
10037 +# CONFIG_SCHEDSTATS is not set
10038 +# CONFIG_TIMER_STATS is not set
10039 +CONFIG_DEBUG_SLAB=y
10040 +# CONFIG_DEBUG_SLAB_LEAK is not set
10041 +# CONFIG_DEBUG_RT_MUTEXES is not set
10042 +# CONFIG_RT_MUTEX_TESTER is not set
10043 +# CONFIG_DEBUG_SPINLOCK is not set
10044 +# CONFIG_DEBUG_MUTEXES is not set
10045 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
10046 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
10047 +# CONFIG_DEBUG_KOBJECT is not set
10048 +CONFIG_DEBUG_BUGVERBOSE=y
10049 +CONFIG_DEBUG_INFO=y
10050 +# CONFIG_DEBUG_VM is not set
10051 +# CONFIG_DEBUG_LIST is not set
10052 +# CONFIG_DEBUG_SG is not set
10053 +# CONFIG_FRAME_POINTER is not set
10054 +# CONFIG_BOOT_PRINTK_DELAY is not set
10055 +# CONFIG_RCU_TORTURE_TEST is not set
10056 +# CONFIG_BACKTRACE_SELF_TEST is not set
10057 +# CONFIG_FAULT_INJECTION is not set
10058 +# CONFIG_SAMPLES is not set
10059 +CONFIG_BOOTPARAM=y
10060 +CONFIG_BOOTPARAM_STRING="root=/dev/nfs rw nfsroot=172.27.163.2:/tftpboot/ltib ip=172.27.163.3:172.27.163.2:172.27.255.254:255.255.0.0::eth0:off mtdparts=phys_mapped_flash:16m(User)"
10063 +# Security options
10065 +# CONFIG_KEYS is not set
10066 +# CONFIG_SECURITY is not set
10067 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
10069 +CONFIG_CRYPTO_ALGAPI=y
10070 +CONFIG_CRYPTO_AEAD=y
10071 +CONFIG_CRYPTO_BLKCIPHER=y
10072 +# CONFIG_CRYPTO_SEQIV is not set
10073 +CONFIG_CRYPTO_HASH=y
10074 +CONFIG_CRYPTO_MANAGER=y
10075 +CONFIG_CRYPTO_HMAC=y
10076 +# CONFIG_CRYPTO_XCBC is not set
10077 +# CONFIG_CRYPTO_NULL is not set
10078 +# CONFIG_CRYPTO_MD4 is not set
10079 +CONFIG_CRYPTO_MD5=y
10080 +CONFIG_CRYPTO_SHA1=y
10081 +# CONFIG_CRYPTO_SHA256 is not set
10082 +# CONFIG_CRYPTO_SHA512 is not set
10083 +# CONFIG_CRYPTO_WP512 is not set
10084 +# CONFIG_CRYPTO_TGR192 is not set
10085 +# CONFIG_CRYPTO_GF128MUL is not set
10086 +# CONFIG_CRYPTO_ECB is not set
10087 +CONFIG_CRYPTO_CBC=y
10088 +# CONFIG_CRYPTO_PCBC is not set
10089 +# CONFIG_CRYPTO_LRW is not set
10090 +# CONFIG_CRYPTO_XTS is not set
10091 +# CONFIG_CRYPTO_CTR is not set
10092 +# CONFIG_CRYPTO_GCM is not set
10093 +# CONFIG_CRYPTO_CCM is not set
10094 +# CONFIG_CRYPTO_CRYPTD is not set
10095 +CONFIG_CRYPTO_DES=y
10096 +# CONFIG_CRYPTO_FCRYPT is not set
10097 +# CONFIG_CRYPTO_BLOWFISH is not set
10098 +# CONFIG_CRYPTO_TWOFISH is not set
10099 +# CONFIG_CRYPTO_SERPENT is not set
10100 +# CONFIG_CRYPTO_AES is not set
10101 +# CONFIG_CRYPTO_CAST5 is not set
10102 +# CONFIG_CRYPTO_CAST6 is not set
10103 +# CONFIG_CRYPTO_TEA is not set
10104 +# CONFIG_CRYPTO_ARC4 is not set
10105 +# CONFIG_CRYPTO_KHAZAD is not set
10106 +# CONFIG_CRYPTO_ANUBIS is not set
10107 +# CONFIG_CRYPTO_SEED is not set
10108 +# CONFIG_CRYPTO_SALSA20 is not set
10109 +# CONFIG_CRYPTO_DEFLATE is not set
10110 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
10111 +# CONFIG_CRYPTO_CRC32C is not set
10112 +# CONFIG_CRYPTO_CAMELLIA is not set
10113 +CONFIG_CRYPTO_TEST=m
10114 +CONFIG_CRYPTO_AUTHENC=y
10115 +# CONFIG_CRYPTO_LZO is not set
10116 +# CONFIG_CRYPTO_HW is not set
10119 +# Library routines
10121 +CONFIG_BITREVERSE=y
10122 +CONFIG_CRC_CCITT=y
10124 +# CONFIG_CRC_ITU_T is not set
10126 +# CONFIG_CRC7 is not set
10127 +CONFIG_LIBCRC32C=y
10129 +CONFIG_HAS_IOMEM=y
10130 +CONFIG_HAS_IOPORT=y
10133 +++ b/arch/m68k/configs/m5485evb_defconfig
10136 +# Automatically generated make config: don't edit
10137 +# Linux kernel version: 2.6.25
10138 +# Thu Jul 10 16:12:53 2008
10142 +# CONFIG_GENERIC_TIME is not set
10143 +# CONFIG_GENERIC_CLOCKEVENTS is not set
10144 +CONFIG_RWSEM_GENERIC_SPINLOCK=y
10145 +# CONFIG_ARCH_HAS_ILOG2_U32 is not set
10146 +# CONFIG_ARCH_HAS_ILOG2_U64 is not set
10147 +CONFIG_GENERIC_HWEIGHT=y
10148 +CONFIG_GENERIC_CALIBRATE_DELAY=y
10149 +CONFIG_TIME_LOW_RES=y
10150 +CONFIG_GENERIC_IOMAP=y
10151 +# CONFIG_NO_IOPORT is not set
10152 +# CONFIG_NO_DMA is not set
10153 +CONFIG_ARCH_SUPPORTS_AOUT=y
10155 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
10160 +CONFIG_EXPERIMENTAL=y
10161 +CONFIG_BROKEN_ON_SMP=y
10162 +CONFIG_INIT_ENV_ARG_LIMIT=32
10163 +CONFIG_LOCALVERSION=""
10164 +CONFIG_LOCALVERSION_AUTO=y
10167 +CONFIG_SYSVIPC_SYSCTL=y
10168 +# CONFIG_POSIX_MQUEUE is not set
10169 +# CONFIG_BSD_PROCESS_ACCT is not set
10170 +# CONFIG_TASKSTATS is not set
10171 +# CONFIG_AUDIT is not set
10173 +CONFIG_IKCONFIG_PROC=y
10174 +CONFIG_LOG_BUF_SHIFT=17
10175 +# CONFIG_CGROUPS is not set
10176 +CONFIG_GROUP_SCHED=y
10177 +CONFIG_FAIR_GROUP_SCHED=y
10178 +# CONFIG_RT_GROUP_SCHED is not set
10179 +CONFIG_USER_SCHED=y
10180 +# CONFIG_CGROUP_SCHED is not set
10181 +CONFIG_SYSFS_DEPRECATED=y
10182 +CONFIG_SYSFS_DEPRECATED_V2=y
10183 +# CONFIG_RELAY is not set
10184 +CONFIG_NAMESPACES=y
10185 +# CONFIG_UTS_NS is not set
10186 +# CONFIG_IPC_NS is not set
10187 +# CONFIG_USER_NS is not set
10188 +# CONFIG_PID_NS is not set
10189 +# CONFIG_BLK_DEV_INITRD is not set
10190 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
10192 +# CONFIG_EMBEDDED is not set
10194 +CONFIG_SYSCTL_SYSCALL=y
10196 +# CONFIG_KALLSYMS_ALL is not set
10197 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
10202 +CONFIG_COMPAT_BRK=y
10203 +CONFIG_BASE_FULL=y
10205 +CONFIG_ANON_INODES=y
10211 +CONFIG_VM_EVENT_COUNTERS=y
10213 +# CONFIG_SLUB is not set
10214 +# CONFIG_SLOB is not set
10215 +# CONFIG_PROFILING is not set
10216 +# CONFIG_MARKERS is not set
10217 +# CONFIG_HAVE_OPROFILE is not set
10218 +# CONFIG_HAVE_KPROBES is not set
10219 +# CONFIG_HAVE_KRETPROBES is not set
10220 +CONFIG_PROC_PAGE_MONITOR=y
10222 +CONFIG_RT_MUTEXES=y
10223 +# CONFIG_TINY_SHMEM is not set
10224 +CONFIG_BASE_SMALL=0
10226 +CONFIG_MODULE_UNLOAD=y
10227 +CONFIG_MODULE_FORCE_UNLOAD=y
10228 +# CONFIG_MODVERSIONS is not set
10229 +# CONFIG_MODULE_SRCVERSION_ALL is not set
10230 +# CONFIG_KMOD is not set
10233 +# CONFIG_BLK_DEV_IO_TRACE is not set
10234 +# CONFIG_LSF is not set
10235 +# CONFIG_BLK_DEV_BSG is not set
10240 +CONFIG_IOSCHED_NOOP=y
10241 +CONFIG_IOSCHED_AS=y
10242 +CONFIG_IOSCHED_DEADLINE=y
10243 +CONFIG_IOSCHED_CFQ=y
10244 +# CONFIG_DEFAULT_AS is not set
10245 +# CONFIG_DEFAULT_DEADLINE is not set
10246 +CONFIG_DEFAULT_CFQ=y
10247 +# CONFIG_DEFAULT_NOOP is not set
10248 +CONFIG_DEFAULT_IOSCHED="cfq"
10249 +CONFIG_CLASSIC_RCU=y
10252 +# Platform dependent setup
10254 +# CONFIG_SUN3 is not set
10258 +# CONFIG_AMIGA is not set
10259 +# CONFIG_ATARI is not set
10260 +# CONFIG_MAC is not set
10261 +# CONFIG_APOLLO is not set
10262 +# CONFIG_VME is not set
10263 +# CONFIG_HP300 is not set
10264 +# CONFIG_SUN3X is not set
10265 +# CONFIG_Q40 is not set
10270 +# CONFIG_M68020 is not set
10271 +# CONFIG_M68030 is not set
10272 +# CONFIG_M68040 is not set
10273 +# CONFIG_M68060 is not set
10274 +# CONFIG_M5445X is not set
10276 +# CONFIG_M547X is not set
10278 +# CONFIG_M5475AFE is not set
10279 +# CONFIG_M5475BFE is not set
10280 +# CONFIG_M5475CFE is not set
10281 +# CONFIG_M5475DFE is not set
10282 +# CONFIG_M5475EFE is not set
10283 +# CONFIG_M5475FFE is not set
10284 +# CONFIG_M5485AFE is not set
10285 +# CONFIG_M5485BFE is not set
10287 +# CONFIG_M5485DFE is not set
10288 +# CONFIG_M5485EFE is not set
10289 +# CONFIG_M5485FFE is not set
10290 +CONFIG_MCFCLK=200000000
10291 +# CONFIG_MCF_USER_HALT is not set
10292 +CONFIG_MMU_CFV4E=y
10293 +CONFIG_SDRAM_BASE=0x00000000
10294 +CONFIG_SDRAM_SIZE=0x04000000
10295 +CONFIG_NOR_FLASH_BASE=0xE0000000
10296 +# CONFIG_M68KFPU_EMU is not set
10298 +# CONFIG_RMW_INSNS is not set
10299 +CONFIG_SINGLE_MEMORY_CHUNK=y
10300 +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
10301 +CONFIG_SELECT_MEMORY_MODEL=y
10302 +CONFIG_FLATMEM_MANUAL=y
10303 +# CONFIG_DISCONTIGMEM_MANUAL is not set
10304 +# CONFIG_SPARSEMEM_MANUAL is not set
10306 +CONFIG_FLAT_NODE_MEM_MAP=y
10307 +CONFIG_NEED_MULTIPLE_NODES=y
10308 +# CONFIG_SPARSEMEM_STATIC is not set
10309 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
10310 +CONFIG_SPLIT_PTLOCK_CPUS=4
10311 +# CONFIG_RESOURCES_64BIT is not set
10312 +CONFIG_ZONE_DMA_FLAG=1
10314 +CONFIG_VIRT_TO_BUS=y
10319 +CONFIG_BINFMT_ELF=y
10320 +# CONFIG_BINFMT_AOUT is not set
10321 +# CONFIG_BINFMT_MISC is not set
10322 +CONFIG_PROC_HARDWARE=y
10324 +# CONFIG_ARCH_SUPPORTS_MSI is not set
10327 +# Power management options
10329 +# CONFIG_PM is not set
10337 +# Networking options
10340 +# CONFIG_PACKET_MMAP is not set
10343 +# CONFIG_XFRM_USER is not set
10344 +# CONFIG_XFRM_SUB_POLICY is not set
10345 +# CONFIG_XFRM_MIGRATE is not set
10346 +# CONFIG_XFRM_STATISTICS is not set
10348 +# CONFIG_NET_KEY_MIGRATE is not set
10350 +# CONFIG_IP_MULTICAST is not set
10351 +CONFIG_IP_ADVANCED_ROUTER=y
10352 +CONFIG_ASK_IP_FIB_HASH=y
10353 +# CONFIG_IP_FIB_TRIE is not set
10354 +CONFIG_IP_FIB_HASH=y
10355 +# CONFIG_IP_MULTIPLE_TABLES is not set
10356 +# CONFIG_IP_ROUTE_MULTIPATH is not set
10357 +# CONFIG_IP_ROUTE_VERBOSE is not set
10359 +# CONFIG_IP_PNP_DHCP is not set
10360 +# CONFIG_IP_PNP_BOOTP is not set
10361 +# CONFIG_IP_PNP_RARP is not set
10362 +# CONFIG_NET_IPIP is not set
10363 +# CONFIG_NET_IPGRE is not set
10364 +# CONFIG_ARPD is not set
10365 +# CONFIG_SYN_COOKIES is not set
10368 +# CONFIG_INET_IPCOMP is not set
10369 +# CONFIG_INET_XFRM_TUNNEL is not set
10370 +# CONFIG_INET_TUNNEL is not set
10371 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
10372 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
10373 +# CONFIG_INET_XFRM_MODE_BEET is not set
10374 +# CONFIG_INET_LRO is not set
10375 +CONFIG_INET_DIAG=y
10376 +CONFIG_INET_TCP_DIAG=y
10377 +# CONFIG_TCP_CONG_ADVANCED is not set
10378 +CONFIG_TCP_CONG_CUBIC=y
10379 +CONFIG_DEFAULT_TCP_CONG="cubic"
10380 +# CONFIG_TCP_MD5SIG is not set
10381 +# CONFIG_IPV6 is not set
10382 +# CONFIG_INET6_XFRM_TUNNEL is not set
10383 +# CONFIG_INET6_TUNNEL is not set
10384 +# CONFIG_NETWORK_SECMARK is not set
10385 +# CONFIG_NETFILTER is not set
10386 +# CONFIG_IP_DCCP is not set
10387 +# CONFIG_IP_SCTP is not set
10388 +# CONFIG_TIPC is not set
10389 +# CONFIG_ATM is not set
10390 +# CONFIG_BRIDGE is not set
10391 +# CONFIG_VLAN_8021Q is not set
10392 +# CONFIG_DECNET is not set
10393 +# CONFIG_LLC2 is not set
10394 +# CONFIG_IPX is not set
10395 +# CONFIG_ATALK is not set
10396 +# CONFIG_X25 is not set
10397 +# CONFIG_LAPB is not set
10398 +# CONFIG_ECONET is not set
10399 +# CONFIG_WAN_ROUTER is not set
10400 +# CONFIG_NET_SCHED is not set
10405 +# CONFIG_NET_PKTGEN is not set
10406 +# CONFIG_HAMRADIO is not set
10407 +# CONFIG_CAN is not set
10408 +# CONFIG_IRDA is not set
10409 +# CONFIG_BT is not set
10410 +# CONFIG_AF_RXRPC is not set
10415 +# CONFIG_CFG80211 is not set
10416 +# CONFIG_WIRELESS_EXT is not set
10417 +# CONFIG_MAC80211 is not set
10418 +# CONFIG_IEEE80211 is not set
10419 +# CONFIG_RFKILL is not set
10420 +# CONFIG_NET_9P is not set
10427 +# Generic Driver Options
10429 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
10430 +# CONFIG_STANDALONE is not set
10431 +CONFIG_PREVENT_FIRMWARE_BUILD=y
10432 +CONFIG_FW_LOADER=y
10433 +# CONFIG_DEBUG_DRIVER is not set
10434 +# CONFIG_DEBUG_DEVRES is not set
10435 +# CONFIG_SYS_HYPERVISOR is not set
10436 +# CONFIG_CONNECTOR is not set
10437 +# CONFIG_MTD is not set
10438 +# CONFIG_PARPORT is not set
10440 +# CONFIG_BLK_DEV_COW_COMMON is not set
10441 +CONFIG_BLK_DEV_LOOP=y
10442 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
10443 +# CONFIG_BLK_DEV_NBD is not set
10444 +CONFIG_BLK_DEV_RAM=y
10445 +CONFIG_BLK_DEV_RAM_COUNT=16
10446 +CONFIG_BLK_DEV_RAM_SIZE=64000
10447 +# CONFIG_BLK_DEV_XIP is not set
10448 +# CONFIG_CDROM_PKTCDVD is not set
10449 +# CONFIG_ATA_OVER_ETH is not set
10450 +CONFIG_MISC_DEVICES=y
10451 +CONFIG_COLDFIRE_SEC=y
10452 +CONFIG_SEC_DEVICE=y
10453 +# CONFIG_EEPROM_93CX6 is not set
10454 +# CONFIG_ENCLOSURE_SERVICES is not set
10456 +# CONFIG_IDE is not set
10459 +# SCSI device support
10461 +# CONFIG_RAID_ATTRS is not set
10464 +# CONFIG_SCSI_TGT is not set
10465 +# CONFIG_SCSI_NETLINK is not set
10466 +CONFIG_SCSI_PROC_FS=y
10469 +# SCSI support type (disk, tape, CD-ROM)
10471 +CONFIG_BLK_DEV_SD=y
10472 +# CONFIG_CHR_DEV_ST is not set
10473 +# CONFIG_CHR_DEV_OSST is not set
10474 +# CONFIG_BLK_DEV_SR is not set
10475 +# CONFIG_CHR_DEV_SG is not set
10476 +# CONFIG_CHR_DEV_SCH is not set
10479 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
10481 +CONFIG_SCSI_MULTI_LUN=y
10482 +# CONFIG_SCSI_CONSTANTS is not set
10483 +# CONFIG_SCSI_LOGGING is not set
10484 +# CONFIG_SCSI_SCAN_ASYNC is not set
10485 +CONFIG_SCSI_WAIT_SCAN=m
10490 +# CONFIG_SCSI_SPI_ATTRS is not set
10491 +# CONFIG_SCSI_FC_ATTRS is not set
10492 +# CONFIG_SCSI_ISCSI_ATTRS is not set
10493 +# CONFIG_SCSI_SAS_LIBSAS is not set
10494 +# CONFIG_SCSI_SRP_ATTRS is not set
10495 +# CONFIG_SCSI_LOWLEVEL is not set
10496 +# CONFIG_ATA is not set
10497 +# CONFIG_MD is not set
10498 +CONFIG_NETDEVICES=y
10499 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
10500 +# CONFIG_DUMMY is not set
10501 +# CONFIG_BONDING is not set
10502 +# CONFIG_MACVLAN is not set
10503 +# CONFIG_EQUALIZER is not set
10504 +# CONFIG_TUN is not set
10505 +# CONFIG_VETH is not set
10506 +# CONFIG_PHYLIB is not set
10507 +CONFIG_NET_ETHERNET=y
10510 +CONFIG_FEC_548x_AUTO_NEGOTIATION=y
10511 +# CONFIG_FEC_548x_ENABLE_FEC2 is not set
10512 +# CONFIG_ENC28J60 is not set
10513 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
10514 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
10515 +# CONFIG_IBM_NEW_EMAC_TAH is not set
10516 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
10517 +# CONFIG_B44 is not set
10518 +# CONFIG_NETDEV_1000 is not set
10519 +# CONFIG_NETDEV_10000 is not set
10524 +# CONFIG_WLAN_PRE80211 is not set
10525 +# CONFIG_WLAN_80211 is not set
10526 +# CONFIG_WAN is not set
10527 +# CONFIG_PPP is not set
10528 +# CONFIG_SLIP is not set
10529 +# CONFIG_NETCONSOLE is not set
10530 +# CONFIG_NETPOLL is not set
10531 +# CONFIG_NET_POLL_CONTROLLER is not set
10532 +# CONFIG_ISDN is not set
10533 +# CONFIG_PHONE is not set
10536 +# Input device support
10539 +# CONFIG_INPUT_FF_MEMLESS is not set
10540 +# CONFIG_INPUT_POLLDEV is not set
10543 +# Userland interfaces
10545 +CONFIG_INPUT_MOUSEDEV=y
10546 +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
10547 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
10548 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
10549 +# CONFIG_INPUT_JOYDEV is not set
10550 +CONFIG_INPUT_EVDEV=y
10551 +# CONFIG_INPUT_EVBUG is not set
10554 +# Input Device Drivers
10556 +CONFIG_INPUT_KEYBOARD=y
10557 +# CONFIG_KEYBOARD_ATKBD is not set
10558 +# CONFIG_KEYBOARD_SUNKBD is not set
10559 +# CONFIG_KEYBOARD_LKKBD is not set
10560 +# CONFIG_KEYBOARD_XTKBD is not set
10561 +# CONFIG_KEYBOARD_NEWTON is not set
10562 +# CONFIG_KEYBOARD_STOWAWAY is not set
10563 +# CONFIG_INPUT_MOUSE is not set
10564 +# CONFIG_INPUT_JOYSTICK is not set
10565 +# CONFIG_INPUT_TABLET is not set
10566 +# CONFIG_INPUT_TOUCHSCREEN is not set
10567 +# CONFIG_INPUT_MISC is not set
10570 +# Hardware I/O ports
10573 +CONFIG_SERIO_SERPORT=y
10574 +# CONFIG_SERIO_RAW is not set
10575 +# CONFIG_GAMEPORT is not set
10578 +# Character devices
10581 +CONFIG_VT_CONSOLE=y
10582 +CONFIG_HW_CONSOLE=y
10583 +# CONFIG_VT_HW_CONSOLE_BINDING is not set
10584 +# CONFIG_SERIAL_NONSTANDARD is not set
10589 +# CONFIG_SERIAL_8250 is not set
10592 +# Non-8250 serial port support
10594 +CONFIG_SERIAL_COLDFIRE=y
10595 +# CONFIG_SERIAL_COLDFIRE_IRDA is not set
10596 +# CONFIG_SERIAL_MCF is not set
10597 +CONFIG_UNIX98_PTYS=y
10598 +# CONFIG_LEGACY_PTYS is not set
10599 +# CONFIG_IPMI_HANDLER is not set
10600 +# CONFIG_HW_RANDOM is not set
10601 +# CONFIG_GEN_RTC is not set
10602 +# CONFIG_R3964 is not set
10603 +# CONFIG_RAW_DRIVER is not set
10604 +# CONFIG_TCG_TPM is not set
10606 +CONFIG_I2C_BOARDINFO=y
10607 +# CONFIG_I2C_CHARDEV is not set
10612 +# CONFIG_I2C_ALGOBIT is not set
10613 +# CONFIG_I2C_ALGOPCF is not set
10614 +# CONFIG_I2C_ALGOPCA is not set
10617 +# I2C Hardware Bus support
10619 +CONFIG_I2C_MCF548x=y
10620 +# CONFIG_I2C_MCF is not set
10621 +# CONFIG_I2C_OCORES is not set
10622 +# CONFIG_I2C_PARPORT_LIGHT is not set
10623 +# CONFIG_I2C_SIMTEC is not set
10624 +# CONFIG_I2C_TAOS_EVM is not set
10625 +# CONFIG_I2C_STUB is not set
10628 +# Miscellaneous I2C Chip support
10630 +# CONFIG_DS1682 is not set
10631 +# CONFIG_SENSORS_EEPROM is not set
10632 +# CONFIG_SENSORS_PCF8574 is not set
10633 +# CONFIG_PCF8575 is not set
10634 +# CONFIG_SENSORS_PCF8591 is not set
10635 +# CONFIG_TPS65010 is not set
10636 +# CONFIG_SENSORS_MAX6875 is not set
10637 +# CONFIG_SENSORS_TSL2550 is not set
10638 +# CONFIG_I2C_DEBUG_CORE is not set
10639 +# CONFIG_I2C_DEBUG_ALGO is not set
10640 +# CONFIG_I2C_DEBUG_BUS is not set
10641 +# CONFIG_I2C_DEBUG_CHIP is not set
10647 +CONFIG_SPI_DEBUG=y
10648 +# CONFIG_COLDFIRE_EDMA is not set
10649 +CONFIG_SPI_MASTER=y
10652 +# SPI Master Controller Drivers
10654 +# CONFIG_SPI_BITBANG is not set
10655 +CONFIG_SPI_COLDFIRE=y
10658 +# SPI Protocol Masters
10660 +# CONFIG_SPI_AT25 is not set
10661 +# CONFIG_SPI_SPIDEV is not set
10662 +# CONFIG_SPI_TLE62X0 is not set
10663 +# CONFIG_SPI_COLDFIRE_SSI_AUDIO is not set
10664 +# CONFIG_W1 is not set
10665 +# CONFIG_POWER_SUPPLY is not set
10666 +# CONFIG_HWMON is not set
10667 +# CONFIG_THERMAL is not set
10668 +# CONFIG_WATCHDOG is not set
10671 +# Sonics Silicon Backplane
10673 +CONFIG_SSB_POSSIBLE=y
10674 +# CONFIG_SSB is not set
10677 +# Multifunction device drivers
10679 +# CONFIG_MFD_SM501 is not set
10682 +# Multimedia devices
10684 +# CONFIG_VIDEO_DEV is not set
10685 +# CONFIG_DVB_CORE is not set
10689 +# Graphics support
10691 +# CONFIG_VGASTATE is not set
10692 +CONFIG_VIDEO_OUTPUT_CONTROL=m
10693 +# CONFIG_FB is not set
10694 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
10697 +# Display device support
10699 +# CONFIG_DISPLAY_SUPPORT is not set
10702 +# Console display driver support
10704 +CONFIG_DUMMY_CONSOLE=y
10709 +# CONFIG_SOUND is not set
10710 +CONFIG_HID_SUPPORT=y
10712 +CONFIG_HID_DEBUG=y
10713 +# CONFIG_HIDRAW is not set
10714 +# CONFIG_USB_SUPPORT is not set
10715 +# CONFIG_MMC is not set
10716 +# CONFIG_MEMSTICK is not set
10717 +# CONFIG_NEW_LEDS is not set
10718 +# CONFIG_RTC_CLASS is not set
10723 +# CONFIG_UIO is not set
10726 +# Character devices
10728 +# CONFIG_SERIAL_CONSOLE is not set
10734 +# CONFIG_EXT2_FS_XATTR is not set
10735 +# CONFIG_EXT2_FS_XIP is not set
10737 +CONFIG_EXT3_FS_XATTR=y
10738 +# CONFIG_EXT3_FS_POSIX_ACL is not set
10739 +# CONFIG_EXT3_FS_SECURITY is not set
10740 +# CONFIG_EXT4DEV_FS is not set
10742 +CONFIG_FS_MBCACHE=y
10743 +# CONFIG_REISERFS_FS is not set
10744 +# CONFIG_JFS_FS is not set
10745 +# CONFIG_FS_POSIX_ACL is not set
10746 +# CONFIG_XFS_FS is not set
10747 +# CONFIG_GFS2_FS is not set
10748 +# CONFIG_OCFS2_FS is not set
10750 +# CONFIG_INOTIFY is not set
10751 +# CONFIG_QUOTA is not set
10752 +# CONFIG_AUTOFS_FS is not set
10753 +# CONFIG_AUTOFS4_FS is not set
10754 +# CONFIG_FUSE_FS is not set
10757 +# CD-ROM/DVD Filesystems
10759 +# CONFIG_ISO9660_FS is not set
10760 +# CONFIG_UDF_FS is not set
10763 +# DOS/FAT/NT Filesystems
10768 +CONFIG_FAT_DEFAULT_CODEPAGE=437
10769 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
10771 +# CONFIG_NTFS_DEBUG is not set
10775 +# Pseudo filesystems
10778 +# CONFIG_PROC_KCORE is not set
10779 +CONFIG_PROC_SYSCTL=y
10782 +# CONFIG_TMPFS_POSIX_ACL is not set
10783 +# CONFIG_HUGETLB_PAGE is not set
10784 +# CONFIG_CONFIGFS_FS is not set
10787 +# Miscellaneous filesystems
10789 +# CONFIG_ADFS_FS is not set
10790 +# CONFIG_AFFS_FS is not set
10791 +# CONFIG_HFS_FS is not set
10792 +# CONFIG_HFSPLUS_FS is not set
10793 +# CONFIG_BEFS_FS is not set
10794 +# CONFIG_BFS_FS is not set
10795 +# CONFIG_EFS_FS is not set
10796 +# CONFIG_CRAMFS is not set
10797 +# CONFIG_VXFS_FS is not set
10799 +# CONFIG_HPFS_FS is not set
10800 +# CONFIG_QNX4FS_FS is not set
10802 +# CONFIG_SYSV_FS is not set
10803 +# CONFIG_UFS_FS is not set
10804 +CONFIG_NETWORK_FILESYSTEMS=y
10806 +# CONFIG_NFS_V3 is not set
10807 +# CONFIG_NFS_V4 is not set
10808 +# CONFIG_NFS_DIRECTIO is not set
10809 +# CONFIG_NFSD is not set
10812 +CONFIG_NFS_COMMON=y
10814 +# CONFIG_SUNRPC_BIND34 is not set
10815 +# CONFIG_RPCSEC_GSS_KRB5 is not set
10816 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
10817 +# CONFIG_SMB_FS is not set
10818 +# CONFIG_CIFS is not set
10819 +# CONFIG_NCP_FS is not set
10820 +# CONFIG_CODA_FS is not set
10821 +# CONFIG_AFS_FS is not set
10826 +CONFIG_PARTITION_ADVANCED=y
10827 +# CONFIG_ACORN_PARTITION is not set
10828 +# CONFIG_OSF_PARTITION is not set
10829 +# CONFIG_AMIGA_PARTITION is not set
10830 +# CONFIG_ATARI_PARTITION is not set
10831 +# CONFIG_MAC_PARTITION is not set
10832 +CONFIG_MSDOS_PARTITION=y
10833 +# CONFIG_BSD_DISKLABEL is not set
10834 +# CONFIG_MINIX_SUBPARTITION is not set
10835 +# CONFIG_SOLARIS_X86_PARTITION is not set
10836 +# CONFIG_UNIXWARE_DISKLABEL is not set
10837 +# CONFIG_LDM_PARTITION is not set
10838 +# CONFIG_SGI_PARTITION is not set
10839 +# CONFIG_ULTRIX_PARTITION is not set
10840 +# CONFIG_SUN_PARTITION is not set
10841 +# CONFIG_KARMA_PARTITION is not set
10842 +# CONFIG_EFI_PARTITION is not set
10843 +# CONFIG_SYSV68_PARTITION is not set
10845 +CONFIG_NLS_DEFAULT="iso8859-1"
10846 +CONFIG_NLS_CODEPAGE_437=y
10847 +# CONFIG_NLS_CODEPAGE_737 is not set
10848 +# CONFIG_NLS_CODEPAGE_775 is not set
10849 +# CONFIG_NLS_CODEPAGE_850 is not set
10850 +# CONFIG_NLS_CODEPAGE_852 is not set
10851 +# CONFIG_NLS_CODEPAGE_855 is not set
10852 +# CONFIG_NLS_CODEPAGE_857 is not set
10853 +# CONFIG_NLS_CODEPAGE_860 is not set
10854 +# CONFIG_NLS_CODEPAGE_861 is not set
10855 +# CONFIG_NLS_CODEPAGE_862 is not set
10856 +# CONFIG_NLS_CODEPAGE_863 is not set
10857 +# CONFIG_NLS_CODEPAGE_864 is not set
10858 +# CONFIG_NLS_CODEPAGE_865 is not set
10859 +# CONFIG_NLS_CODEPAGE_866 is not set
10860 +# CONFIG_NLS_CODEPAGE_869 is not set
10861 +# CONFIG_NLS_CODEPAGE_936 is not set
10862 +# CONFIG_NLS_CODEPAGE_950 is not set
10863 +# CONFIG_NLS_CODEPAGE_932 is not set
10864 +# CONFIG_NLS_CODEPAGE_949 is not set
10865 +# CONFIG_NLS_CODEPAGE_874 is not set
10866 +# CONFIG_NLS_ISO8859_8 is not set
10867 +# CONFIG_NLS_CODEPAGE_1250 is not set
10868 +# CONFIG_NLS_CODEPAGE_1251 is not set
10869 +# CONFIG_NLS_ASCII is not set
10870 +CONFIG_NLS_ISO8859_1=y
10871 +# CONFIG_NLS_ISO8859_2 is not set
10872 +# CONFIG_NLS_ISO8859_3 is not set
10873 +# CONFIG_NLS_ISO8859_4 is not set
10874 +# CONFIG_NLS_ISO8859_5 is not set
10875 +# CONFIG_NLS_ISO8859_6 is not set
10876 +# CONFIG_NLS_ISO8859_7 is not set
10877 +# CONFIG_NLS_ISO8859_9 is not set
10878 +# CONFIG_NLS_ISO8859_13 is not set
10879 +# CONFIG_NLS_ISO8859_14 is not set
10880 +# CONFIG_NLS_ISO8859_15 is not set
10881 +# CONFIG_NLS_KOI8_R is not set
10882 +# CONFIG_NLS_KOI8_U is not set
10884 +# CONFIG_DLM is not set
10889 +# CONFIG_PRINTK_TIME is not set
10890 +CONFIG_ENABLE_WARN_DEPRECATED=y
10891 +# CONFIG_ENABLE_MUST_CHECK is not set
10892 +# CONFIG_MAGIC_SYSRQ is not set
10893 +# CONFIG_UNUSED_SYMBOLS is not set
10894 +# CONFIG_DEBUG_FS is not set
10895 +# CONFIG_HEADERS_CHECK is not set
10896 +CONFIG_DEBUG_KERNEL=y
10897 +CONFIG_DETECT_SOFTLOCKUP=y
10898 +CONFIG_SCHED_DEBUG=y
10899 +# CONFIG_SCHEDSTATS is not set
10900 +# CONFIG_TIMER_STATS is not set
10901 +CONFIG_DEBUG_SLAB=y
10902 +# CONFIG_DEBUG_SLAB_LEAK is not set
10903 +# CONFIG_DEBUG_RT_MUTEXES is not set
10904 +# CONFIG_RT_MUTEX_TESTER is not set
10905 +# CONFIG_DEBUG_SPINLOCK is not set
10906 +# CONFIG_DEBUG_MUTEXES is not set
10907 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
10908 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
10909 +# CONFIG_DEBUG_KOBJECT is not set
10910 +CONFIG_DEBUG_BUGVERBOSE=y
10911 +CONFIG_DEBUG_INFO=y
10912 +# CONFIG_DEBUG_VM is not set
10913 +# CONFIG_DEBUG_LIST is not set
10914 +# CONFIG_DEBUG_SG is not set
10915 +# CONFIG_FRAME_POINTER is not set
10916 +# CONFIG_BOOT_PRINTK_DELAY is not set
10917 +# CONFIG_RCU_TORTURE_TEST is not set
10918 +# CONFIG_BACKTRACE_SELF_TEST is not set
10919 +# CONFIG_FAULT_INJECTION is not set
10920 +# CONFIG_SAMPLES is not set
10921 +CONFIG_BOOTPARAM=y
10922 +CONFIG_BOOTPARAM_STRING="root=/dev/nfs rw nfsroot=172.27.163.2:/tftpboot/ltib ip=172.27.163.3:172.27.163.2:172.27.255.254:255.255.0.0::eth0:off mtdparts=phys_mapped_flash:16m(User)"
10925 +# Security options
10927 +# CONFIG_KEYS is not set
10928 +# CONFIG_SECURITY is not set
10929 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
10931 +CONFIG_CRYPTO_ALGAPI=y
10932 +CONFIG_CRYPTO_AEAD=y
10933 +CONFIG_CRYPTO_BLKCIPHER=y
10934 +# CONFIG_CRYPTO_SEQIV is not set
10935 +CONFIG_CRYPTO_HASH=y
10936 +CONFIG_CRYPTO_MANAGER=y
10937 +CONFIG_CRYPTO_HMAC=y
10938 +# CONFIG_CRYPTO_XCBC is not set
10939 +# CONFIG_CRYPTO_NULL is not set
10940 +# CONFIG_CRYPTO_MD4 is not set
10941 +CONFIG_CRYPTO_MD5=y
10942 +CONFIG_CRYPTO_SHA1=y
10943 +# CONFIG_CRYPTO_SHA256 is not set
10944 +# CONFIG_CRYPTO_SHA512 is not set
10945 +# CONFIG_CRYPTO_WP512 is not set
10946 +# CONFIG_CRYPTO_TGR192 is not set
10947 +# CONFIG_CRYPTO_GF128MUL is not set
10948 +# CONFIG_CRYPTO_ECB is not set
10949 +CONFIG_CRYPTO_CBC=y
10950 +# CONFIG_CRYPTO_PCBC is not set
10951 +# CONFIG_CRYPTO_LRW is not set
10952 +# CONFIG_CRYPTO_XTS is not set
10953 +# CONFIG_CRYPTO_CTR is not set
10954 +# CONFIG_CRYPTO_GCM is not set
10955 +# CONFIG_CRYPTO_CCM is not set
10956 +# CONFIG_CRYPTO_CRYPTD is not set
10957 +CONFIG_CRYPTO_DES=y
10958 +# CONFIG_CRYPTO_FCRYPT is not set
10959 +# CONFIG_CRYPTO_BLOWFISH is not set
10960 +# CONFIG_CRYPTO_TWOFISH is not set
10961 +# CONFIG_CRYPTO_SERPENT is not set
10962 +# CONFIG_CRYPTO_AES is not set
10963 +# CONFIG_CRYPTO_CAST5 is not set
10964 +# CONFIG_CRYPTO_CAST6 is not set
10965 +# CONFIG_CRYPTO_TEA is not set
10966 +# CONFIG_CRYPTO_ARC4 is not set
10967 +# CONFIG_CRYPTO_KHAZAD is not set
10968 +# CONFIG_CRYPTO_ANUBIS is not set
10969 +# CONFIG_CRYPTO_SEED is not set
10970 +# CONFIG_CRYPTO_SALSA20 is not set
10971 +# CONFIG_CRYPTO_DEFLATE is not set
10972 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
10973 +# CONFIG_CRYPTO_CRC32C is not set
10974 +# CONFIG_CRYPTO_CAMELLIA is not set
10975 +CONFIG_CRYPTO_TEST=m
10976 +CONFIG_CRYPTO_AUTHENC=y
10977 +# CONFIG_CRYPTO_LZO is not set
10978 +# CONFIG_CRYPTO_HW is not set
10981 +# Library routines
10983 +CONFIG_BITREVERSE=y
10984 +CONFIG_CRC_CCITT=y
10986 +# CONFIG_CRC_ITU_T is not set
10988 +# CONFIG_CRC7 is not set
10989 +CONFIG_LIBCRC32C=y
10991 +CONFIG_HAS_IOMEM=y
10992 +CONFIG_HAS_IOPORT=y
10994 --- a/arch/m68k/Kconfig
10995 +++ b/arch/m68k/Kconfig
10996 @@ -11,6 +11,14 @@ config MMU
11000 +config GENERIC_TIME
11004 +config GENERIC_CLOCKEVENTS
11008 config RWSEM_GENERIC_SPINLOCK
11011 @@ -48,7 +56,7 @@ config ARCH_MAY_HAVE_PC_FDC
11016 + def_bool !(M5445X || M547X_8X)
11020 @@ -119,6 +127,29 @@ config SUN3
11022 If you don't want to compile a kernel exclusively for a Sun 3, say N.
11025 + bool "ColdFire V4e support"
11029 + Say Y if you want to build a kernel to run on one of the ColdFire
11034 + depends on COLDFIRE
11035 + select MMU_CFV4E if MMU
11039 + bool "ColdFire MCD DMA support"
11040 + depends on M547X_8X
11043 + This enables support for the ColdFire 547x/548x family
11044 + multichannel DMA support. Many drivers need it.
11045 + If you want it, say Y
11048 bool "Amiga support"
11049 depends on !MMU_SUN3
11050 @@ -144,9 +175,9 @@ config HADES
11051 to use this kernel on a Hades, say Y here; otherwise say N.
11057 + bool "PCI bus support"
11058 + depends on HADES || M54455 || M547X_8X
11061 Find out whether you have a PCI motherboard. PCI is the name of a
11062 bus system, i.e. the way the CPU talks to the other stuff inside
11063 @@ -294,14 +325,142 @@ config M68060
11064 If you anticipate running this kernel on a computer with a MC68060
11065 processor, say Y. Otherwise, say N.
11068 + bool "MCF5445x support"
11069 + depends on COLDFIRE
11071 + This option will add support for the MCF5445 processor with mmu.
11075 + depends on M5445X
11080 + depends on M5445X
11085 + depends on M5445X
11086 + default M54451EVB
11097 + bool "MCF547x/MCF548x support"
11098 + depends on COLDFIRE
11100 + This option will add support for the MCF547x/MCF548x processor with mmu.
11104 + depends on M547X_8X
11109 + depends on M547X_8X
11114 + depends on M547X_8X
11117 + bool "MCF5475AFE"
11120 + bool "MCF5475BFE"
11123 + bool "MCF5475CFE"
11126 + bool "MCF5475DFE"
11129 + bool "MCF5475EFE"
11132 + bool "MCF5475FFE"
11136 + bool "MCF5485AFE"
11139 + bool "MCF5485BFE"
11142 + bool "MCF5485CFE"
11145 + bool "MCF5485DFE"
11148 + bool "MCF5485EFE"
11151 + bool "MCF5485FFE"
11158 + default 266666666 if M54455EVB
11159 + default 240000000 if M54451EVB
11160 + default 266000000 if M547X
11161 + default 200000000 if M548X
11163 + Coldfire System clock.
11165 +config MCF_USER_HALT
11166 + bool "Coldfire User Halt Enable"
11167 + depends on M5445X || M547X_8X
11170 + Enables the HALT instruction in User Mode.
11172 config MMU_MOTOROLA
11174 - depends on MMU && !MMU_SUN3
11175 + depends on MMU && !MMU_SUN3 && !COLDFIRE
11186 + depends on COLDFIRE
11187 + default 0x40000000 if M5445X
11188 + default 0x00000000 if M547X_8X
11192 + depends on COLDFIRE
11193 + default 0x08000000 if M54451EVB
11194 + default 0x10000000 if M54455EVB
11195 + default 0x04000000 if M547X_8X
11197 +config NOR_FLASH_BASE
11198 + hex "NOR Flash Base Address"
11199 + depends on COLDFIRE
11200 + default 0x00000000 if M54451EVB
11201 + default 0x00000000 if M54455EVB
11202 + default 0xE0000000 if M547X_8X
11205 bool "Math emulation support (EXPERIMENTAL)"
11206 depends on EXPERIMENTAL
11207 @@ -468,6 +627,14 @@ config ZONE_DMA
11208 source "drivers/pci/Kconfig"
11210 source "drivers/zorro/Kconfig"
11213 +menu "Power management options"
11216 + bool "Power Management support"
11218 + Support processor power management modes
11222 @@ -647,7 +814,7 @@ config DN_SERIAL
11224 config SERIAL_CONSOLE
11225 bool "Support for serial port console"
11226 - depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_SCC=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
11227 + depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO || COLDFIRE) && (ATARI_MFPSER=y || ATARI_SCC=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL || SERIAL_COLDFIRE)
11229 If you say Y here, it will be possible to use a serial port as the
11230 system console (the system console is the device which receives all
11231 --- a/arch/m68k/Kconfig.debug
11232 +++ b/arch/m68k/Kconfig.debug
11233 @@ -2,4 +2,13 @@ menu "Kernel hacking"
11235 source "lib/Kconfig.debug"
11238 + bool 'Compiled-in Kernel Boot Parameter'
11239 + depends on COLDFIRE
11241 +config BOOTPARAM_STRING
11242 + string 'Kernel Boot Parameter'
11243 + default 'console=ttyS0,115200'
11244 + depends on BOOTPARAM
11247 --- a/arch/m68k/kernel/asm-offsets.c
11248 +++ b/arch/m68k/kernel/asm-offsets.c
11249 @@ -58,8 +58,15 @@ int main(void)
11250 DEFINE(PT_A2, offsetof(struct pt_regs, a2));
11251 DEFINE(PT_PC, offsetof(struct pt_regs, pc));
11252 DEFINE(PT_SR, offsetof(struct pt_regs, sr));
11253 +#ifdef CONFIG_COLDFIRE
11254 + /* Need to get the context out of struct mm for ASID setting */
11255 + DEFINE(MM_CONTEXT, offsetof(struct mm_struct, context));
11256 + /* Coldfire exception frame has vector *before* pc */
11257 + DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) - 4);
11259 /* bitfields are a bit difficult */
11260 DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) + 4);
11263 /* offsets into the irq_handler struct */
11264 DEFINE(IRQ_HANDLER, offsetof(struct irq_node, handler));
11266 +++ b/arch/m68k/kernel/bios32_mcf548x.c
11269 + * bios32.c - PCI BIOS functions for m68k systems.
11271 + * Written by Wout Klaren.
11273 + * Based on the DEC Alpha bios32.c by Dave Rusling and David Mosberger.
11275 +#include <linux/init.h>
11276 +#include <linux/kernel.h>
11279 +# define DBG_DEVS(args) printk args
11281 +# define DBG_DEVS(args)
11287 + * PCI support for Linux/m68k. Currently only the Hades is supported.
11289 + * The support for PCI bridges in the DEC Alpha version has
11290 + * been removed in this version.
11293 +#include <linux/pci.h>
11294 +#include <linux/slab.h>
11295 +#include <linux/mm.h>
11297 +#include <asm/io.h>
11298 +#include <asm/pci.h>
11299 +#include <asm/uaccess.h>
11302 +#define MB (1024*KB)
11303 +#define GB (1024*MB)
11305 +#define MAJOR_REV 0
11306 +#define MINOR_REV 5
11309 + * Align VAL to ALIGN, which must be a power of two.
11312 +#define MAX(val1, val2) (((val1) > (val2)) ? val1 : val2)
11315 + * Offsets relative to the I/O and memory base addresses from where resources
11319 +#ifdef CONFIG_COLDFIRE
11320 +#define IO_ALLOC_OFFSET 0x00000100
11321 +#define MEM_ALLOC_OFFSET 0x00000000
11322 +#else /* CONFIG_COLDFIRE */
11323 +#define IO_ALLOC_OFFSET 0x00004000
11324 +#define MEM_ALLOC_OFFSET 0x04000000
11325 +#endif /* CONFIG_COLDFIRE */
11328 + * Declarations of hardware specific initialisation functions.
11331 +extern struct pci_bus_info *init_hades_pci(void);
11334 + * Bus info structure of the PCI bus. A pointer to this structure is
11335 + * put in the sysdata member of the pci_bus structure.
11338 +static struct pci_bus_info *bus_info;
11340 +static int pci_modify = 1; /* If set, layout the PCI bus ourself. */
11341 +static int skip_vga; /* If set do not modify base addresses
11343 +static int disable_pci_burst; /* If set do not allow PCI bursts. */
11345 +static unsigned int io_base;
11346 +static unsigned int mem_base;
11349 + * static void disable_dev(struct pci_dev *dev)
11351 + * Disable PCI device DEV so that it does not respond to I/O or memory
11356 + * dev - device to disable.
11359 +static void __init disable_dev(struct pci_dev *dev)
11361 + unsigned short cmd;
11363 + if (((dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA) ||
11364 + (dev->class >> 8 == PCI_CLASS_DISPLAY_VGA) ||
11365 + (dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)) && skip_vga)
11368 + pci_read_config_word(dev, PCI_COMMAND, &cmd);
11370 + cmd &= (~PCI_COMMAND_IO & ~PCI_COMMAND_MEMORY & ~PCI_COMMAND_MASTER);
11371 + pci_write_config_word(dev, PCI_COMMAND, cmd);
11374 +/* Stolen from pcibios_enable_resources/i386 */
11375 +int pcibios_enable_device(struct pci_dev *dev, int mask)
11377 + u16 cmd, old_cmd;
11379 + struct resource *r;
11381 + pci_read_config_word(dev, PCI_COMMAND, &cmd);
11383 + for(idx=0; idx<6; idx++) {
11384 + /* Only set up the requested stuff */
11385 + if (!(mask & (1<<idx)))
11388 + r = &dev->resource[idx];
11389 + if (!r->start && r->end) {
11390 + printk("PCI: Device %s not available because"
11391 + " of resource collisions\n", dev->dev.bus_id);
11394 + if (r->flags & IORESOURCE_IO)
11395 + cmd |= PCI_COMMAND_IO;
11396 + if (r->flags & IORESOURCE_MEM)
11397 + cmd |= PCI_COMMAND_MEMORY;
11399 + if (dev->resource[PCI_ROM_RESOURCE].start)
11400 + cmd |= PCI_COMMAND_MEMORY;
11401 + if (cmd != old_cmd) {
11402 + printk("PCI: Enabling device %s (%04x -> %04x)\n", dev->dev.bus_id, old_cmd, cmd);
11403 + pci_write_config_word(dev, PCI_COMMAND, cmd);
11409 + * static void layout_dev(struct pci_dev *dev)
11411 + * Layout memory and I/O for a device.
11415 + * device - device to layout memory and I/O for.
11418 +static void __init layout_dev(struct pci_dev *dev)
11420 + unsigned short cmd;
11421 + unsigned int base, mask, size, reg;
11422 + unsigned int alignto;
11426 + * Skip video cards if requested.
11428 + if (((dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA) ||
11429 + (dev->class >> 8 == PCI_CLASS_DISPLAY_VGA) ||
11430 + (dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)) && skip_vga){
11431 + printk("%s: VGA\n",__FUNCTION__);
11434 + pci_read_config_word(dev, PCI_COMMAND, &cmd);
11436 + for (reg = PCI_BASE_ADDRESS_0, i = 0; reg <= PCI_BASE_ADDRESS_5; reg += 4, i++)
11439 + * Figure out how much space and of what type this
11443 + pci_write_config_dword(dev, reg, 0xffffffff);
11444 + pci_read_config_dword(dev, reg, &base);
11447 + /* this base-address register is unused */
11448 + dev->resource[i].start = 0;
11449 + dev->resource[i].end = 0;
11450 + dev->resource[i].flags = 0;
11455 + * We've read the base address register back after
11456 + * writing all ones and so now we must decode it.
11459 + if (base & PCI_BASE_ADDRESS_SPACE_IO)
11462 + * I/O space base address register.
11465 + cmd |= PCI_COMMAND_IO;
11467 + base &= PCI_BASE_ADDRESS_IO_MASK;
11468 + mask = (~base << 1) | 0x1;
11469 + size = (mask & base) & 0xffffffff;
11472 + * Align to multiple of size of minimum base.
11475 +#ifdef CONFIG_COLDFIRE
11476 + alignto = MAX(PAGE_SIZE, size) ;
11477 +#else /* CONFIG_COLDFIRE */
11478 + alignto = MAX(0x040, size) ;
11479 +#endif /* CONFIG_COLDFIRE */
11480 + base = ALIGN(io_base, alignto);
11481 + io_base = base + size;
11482 + pci_write_config_dword(dev, reg, base | PCI_BASE_ADDRESS_SPACE_IO);
11484 + dev->resource[i].start = base;
11485 + dev->resource[i].end = dev->resource[i].start + size - 1;
11486 + dev->resource[i].flags = IORESOURCE_IO | PCI_BASE_ADDRESS_SPACE_IO;
11488 + DBG_DEVS(("layout_dev: IO address: %x\n", base));
11492 + unsigned int type;
11495 + * Memory space base address register.
11498 + cmd |= PCI_COMMAND_MEMORY;
11499 + type = base & PCI_BASE_ADDRESS_MEM_TYPE_MASK;
11500 + base &= PCI_BASE_ADDRESS_MEM_MASK;
11501 + mask = (~base << 1) | 0x1;
11502 + size = (mask & base) & 0xffffffff;
11505 + case PCI_BASE_ADDRESS_MEM_TYPE_32:
11506 + case PCI_BASE_ADDRESS_MEM_TYPE_64:
11509 + case PCI_BASE_ADDRESS_MEM_TYPE_1M:
11510 + printk("bios32 WARNING: slot %d, function %d "
11511 + "requests memory below 1MB---don't "
11512 + "know how to do that.\n",
11513 + PCI_SLOT(dev->devfn),
11514 + PCI_FUNC(dev->devfn));
11517 + DBG_DEVS(("%s MEM: base %x,type %x,mask %x,size %x\n",
11518 + __FUNCTION__, base, type, mask, size));
11520 + * Align to multiple of size of minimum base.
11523 + alignto = max_t(unsigned int, 0x1000, size);
11524 + base = ALIGN(mem_base, alignto);
11525 + mem_base = base + size;
11526 + pci_write_config_dword(dev, reg, base);
11528 + dev->resource[i].start = base;
11529 + dev->resource[i].end = dev->resource[i].start + size - 1;
11530 + dev->resource[i].flags = IORESOURCE_MEM;
11531 + DBG_DEVS(("%s MEM :base %x,size %x\n",
11532 + __FUNCTION__, base, size));
11533 + if (type == PCI_BASE_ADDRESS_MEM_TYPE_64)
11536 + * 64-bit address, set the highest 32 bits
11541 + pci_write_config_dword(dev, reg, 0);
11544 + dev->resource[i].start = 0;
11545 + dev->resource[i].end = 0;
11546 + dev->resource[i].flags = 0;
11547 + printk("%s:type == 64\n",__FUNCTION__);
11556 + if (dev->class >> 8 == PCI_CLASS_NOT_DEFINED ||
11557 + dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA ||
11558 + dev->class >> 8 == PCI_CLASS_DISPLAY_VGA ||
11559 + dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)
11562 + * All of these (may) have I/O scattered all around
11563 + * and may not use i/o-base address registers at all.
11564 + * So we just have to always enable I/O to these
11567 + cmd |= PCI_COMMAND_IO;
11570 + pci_write_config_word(dev, PCI_COMMAND, cmd | PCI_COMMAND_MASTER);
11572 + pci_write_config_byte(dev, PCI_LATENCY_TIMER, (disable_pci_burst) ? 0 : 32);
11574 + if (bus_info != NULL)
11575 + bus_info->conf_device(dev); /* Machine dependent configuration. */
11577 + printk(KERN_INFO "layout_dev: bus %d slot 0x%x VID 0x%x DID 0x%x class 0x%x\n",
11578 + dev->bus->number, PCI_SLOT(dev->devfn),
11579 + dev->vendor, dev->device, dev->class);
11583 + * static void layout_bus(struct pci_bus *bus)
11585 + * Layout memory and I/O for all devices on the given bus.
11592 +static void __init layout_bus(struct pci_bus *bus)
11594 + unsigned int bio, bmem;
11595 + struct pci_dev *dev;
11597 + DBG_DEVS(("layout_bus: starting bus %d\n", bus->number));
11599 + if (list_empty(&bus->devices) && list_empty(&bus->children))
11603 + * Align the current bases on appropriate boundaries (4K for
11604 + * IO and 1MB for memory).
11607 + bio = io_base = ALIGN(io_base, 4*KB);
11608 + bmem = mem_base = ALIGN(mem_base, 1*MB);
11611 + * PCI devices might have been setup by a PCI BIOS emulation
11612 + * running under TOS. In these cases there is a
11613 + * window during which two devices may have an overlapping
11614 + * address range. To avoid this causing trouble, we first
11615 + * turn off the I/O and memory address decoders for all PCI
11616 + * devices. They'll be re-enabled only once all address
11617 + * decoders are programmed consistently.
11620 + DBG_DEVS(("layout_bus: disable_dev for bus %d\n", bus->number));
11622 +#ifdef NL_ORIGINAL
11623 + for (dev = bus->devices; dev; dev = dev->sibling)
11626 + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
11629 + if ((dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) ||
11630 + (dev->class >> 8 == PCI_CLASS_BRIDGE_PCMCIA))
11631 + disable_dev(dev);
11635 + * Allocate space to each device:
11638 + DBG_DEVS(("layout_bus: starting bus %d devices\n", bus->number));
11640 +#ifdef NL_ORIGINAL
11641 + for (dev = bus->devices; dev; dev = dev->sibling)
11644 + while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
11647 + if ((dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) ||
11648 + (dev->class >> 8 == PCI_CLASS_BRIDGE_PCMCIA))
11652 + DBG_DEVS(("layout_bus: bus %d finished\n", bus->number));
11656 + * static void pcibios_fixup(void)
11658 + * Layout memory and I/O of all devices on the PCI bus if 'pci_modify' is
11659 + * true. This might be necessary because not every m68k machine with a PCI
11660 + * bus has a PCI BIOS. This function should be called right after
11661 + * pci_scan_bus() in pcibios_init().
11664 +static void __init pcibios_fixup(void)
11666 + DBG_DEVS(("%s\n", __FUNCTION__));
11670 + * Set base addresses for allocation of I/O and memory space.
11673 + io_base = bus_info->io_space.start + IO_ALLOC_OFFSET;
11674 + mem_base = bus_info->mem_space.start + MEM_ALLOC_OFFSET;
11677 + * Scan the tree, allocating PCI memory and I/O space.
11680 +#ifdef NL_ORIGINAL
11681 + layout_bus(pci_bus_b(pci_root.next));
11683 + layout_bus(pci_bus_b(pci_root_buses.next));
11688 + * Fix interrupt assignments, etc.
11691 + bus_info->fixup(pci_modify);
11695 + * static void pcibios_claim_resources(struct pci_bus *bus)
11697 + * Claim all resources that are assigned to devices on the given bus.
11704 +static void __init pcibios_claim_resources(struct pci_bus *bus)
11706 + struct pci_dev *dev;
11708 + DBG_DEVS(("%s\n", __FUNCTION__));
11709 +#ifdef NL_ORIGINAL
11712 + while ((bus = pci_find_next_bus(bus)) != NULL)
11716 +#ifdef NL_ORIGINAL
11717 + for (dev = bus->devices; (dev != NULL); dev = dev->sibling)
11720 + while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
11723 + for (i = 0; i < PCI_NUM_RESOURCES; i++)
11725 + struct resource *r = &dev->resource[i];
11726 + struct resource *pr;
11727 + struct pci_bus_info *bus_info =
11728 + (struct pci_bus_info *) dev->sysdata;
11730 + if ((r->start == 0) || (r->parent != NULL))
11733 +#ifdef CONFIG_COLDFIRE
11734 + if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE)
11736 +#endif /* CONFIG_COLDFIRE */
11738 + if (r->flags & IORESOURCE_IO)
11739 + pr = &bus_info->io_space;
11741 + pr = &bus_info->mem_space;
11743 + if (r->flags & IORESOURCE_IO)
11744 + pr = &ioport_resource;
11746 + pr = &iomem_resource;
11748 + if (request_resource(pr, r) < 0)
11750 +#ifdef NL_ORIGINAL
11751 + DBG_DEVS(("PCI: Address space collision on "
11752 + "region %d of device %s\n", i, dev->name));
11754 + printk("PCI: Address space collision on region %d of device %s\n", i, dev->dev.bus_id);
11760 +#ifdef NL_ORIGINAL
11761 + if (bus->children)
11762 + pcibios_claim_resources(bus->children);
11764 + if (!list_empty(&bus->children))
11765 + pcibios_claim_resources(pci_bus_b(bus->children.next));
11768 +#ifdef NL_ORIGINAL
11775 + * int pcibios_assign_resource(struct pci_dev *dev, int i)
11777 + * Assign a new address to a PCI resource.
11784 + * Result: 0 if successful.
11787 +int __init pcibios_assign_resource(struct pci_dev *dev, int i)
11789 + struct resource *r = &dev->resource[i];
11790 + struct resource *pr = pci_find_parent_resource(dev, r);
11791 + unsigned long size = r->end + 1;
11792 + DBG_DEVS(("%s:IO_ALLOC_OFFSET %x\n", __FUNCTION__, IO_ALLOC_OFFSET));
11796 + if (r->flags & IORESOURCE_IO)
11798 + DBG_DEVS(("%s:IORESOURCE_IO:start %x, size %lx\n",
11799 + __FUNCTION__, bus_info->io_space.start, size));
11800 + if (size > 0x100)
11803 +#ifdef NL_ORIGINAL
11804 + if (allocate_resource(pr, r, size, bus_info->io_space.start +
11805 + IO_ALLOC_OFFSET, bus_info->io_space.end, 1024))
11807 + if (allocate_resource(pr, r, size, bus_info->io_space.start +
11808 + IO_ALLOC_OFFSET, bus_info->io_space.end, 1024, NULL, NULL))
11814 + DBG_DEVS(("%s:IORESOURCE_MEM:start %x, size %lx\n",
11815 + __FUNCTION__, bus_info->mem_space.start, size));
11816 +#ifdef NL_ORIGINAL
11817 + if (allocate_resource(pr, r, size, bus_info->mem_space.start +
11818 + MEM_ALLOC_OFFSET, bus_info->mem_space.end, size))
11820 + if (allocate_resource(pr, r, size, bus_info->io_space.start +
11821 + IO_ALLOC_OFFSET, bus_info->io_space.end, 1024, NULL, NULL))
11827 + pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + 4 * i, r->start);
11832 +void pcibios_fixup_bus(struct pci_bus *bus)
11834 + struct pci_dev *dev;
11837 + sysdata = (bus->parent) ? bus->parent->sysdata : bus->sysdata;
11839 +#ifdef NL_ORIGINAL
11840 + for (dev = bus->devices; (dev != NULL); dev = dev->sibling)
11843 + while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
11845 + dev->sysdata = sysdata;
11848 +int __init pcibios_init(void)
11850 + printk("Linux/m68k PCI BIOS32 revision %x.%02x\n", MAJOR_REV, MINOR_REV);
11853 +#ifdef CONFIG_COLDFIRE
11854 + bus_info = init_coldfire_pci();
11855 +#endif /* CONFIG_COLDFIRE */
11856 +#ifdef CONFIG_HADES
11857 + if (MACH_IS_HADES)
11858 + bus_info = init_hades_pci();
11860 + if (bus_info != NULL)
11862 + printk("PCI: Probing PCI hardware\n");
11863 + pci_scan_bus(0, bus_info->m68k_pci_ops, bus_info);
11865 +#ifdef NL_ORIGINAL
11866 + pcibios_claim_resources(pci_root);
11868 + pcibios_claim_resources(pci_bus_b(pci_root_buses.next));
11872 + printk("PCI: No PCI bus detected\n");
11876 +subsys_initcall(pcibios_init);
11878 +char * pcibios_setup(char *str)
11880 + if (!strcmp(str, "nomodify"))
11885 + else if (!strcmp(str, "skipvga"))
11890 + else if (!strcmp(str, "noburst"))
11892 + disable_pci_burst = 1;
11898 +#endif /* CONFIG_PCI */
11899 --- a/arch/m68k/kernel/dma.c
11900 +++ b/arch/m68k/kernel/dma.c
11901 @@ -11,12 +11,24 @@
11902 #include <linux/kernel.h>
11903 #include <linux/scatterlist.h>
11904 #include <linux/vmalloc.h>
11906 +#include <linux/pci.h>
11907 #include <asm/pgalloc.h>
11909 void *dma_alloc_coherent(struct device *dev, size_t size,
11910 dma_addr_t *handle, gfp_t flag)
11912 +#if defined(CONFIG_M547X_8X) | defined(CONFIG_M54455)
11914 + * On the M5445x platform the memory allocated with GFP_DMA
11915 + * is guaranteed to be DMA'able.
11919 + size = PAGE_ALIGN(size);
11920 + addr = kmalloc(size, GFP_DMA);
11921 + *handle = virt_to_phys(addr);
11924 struct page *page, **map;
11927 @@ -55,6 +67,7 @@ void *dma_alloc_coherent(struct device *
11933 EXPORT_SYMBOL(dma_alloc_coherent);
11935 @@ -62,7 +75,11 @@ void dma_free_coherent(struct device *de
11936 void *addr, dma_addr_t handle)
11938 pr_debug("dma_free_coherent: %p, %x\n", addr, handle);
11939 +#if defined(CONFIG_M547X_8X) | defined(CONFIG_M54455)
11945 EXPORT_SYMBOL(dma_free_coherent);
11947 --- a/arch/m68k/kernel/Makefile
11948 +++ b/arch/m68k/kernel/Makefile
11950 # Makefile for the linux kernel.
11953 -ifndef CONFIG_SUN3
11954 - extra-y := head.o
11956 + extra-y := sun3-head.o vmlinux.lds
11957 + obj-y := entry.o signal.o ints.o
11959 - extra-y := sun3-head.o
11960 +ifndef CONFIG_COLDFIRE
11961 + extra-y := head.o vmlinux.lds
11962 + obj-y := entry.o signal.o traps.o ints.o
11963 + obj-$(CONFIG_PCI) += bios32.o
11964 +else # CONFIG_COLDFIRE
11965 + extra-y := ../coldfire/head.o vmlinux.lds
11966 +ifdef CONFIG_M547X_8X
11967 + obj-$(CONFIG_PCI) += bios32_mcf548x.o
11971 -extra-y += vmlinux.lds
11973 -obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o module.o \
11974 +obj-y += process.o ptrace.o module.o \
11975 sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o devres.o
11977 devres-y = ../../../kernel/irq/devres.o
11979 -obj-$(CONFIG_PCI) += bios32.o
11980 obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo
11982 EXTRA_AFLAGS := -traditional
11983 --- a/arch/m68k/kernel/process.c
11984 +++ b/arch/m68k/kernel/process.c
11985 @@ -191,6 +191,7 @@ EXPORT_SYMBOL(kernel_thread);
11987 void flush_thread(void)
11989 +#if !defined(CONFIG_COLDFIRE)
11990 unsigned long zero = 0;
11992 current->thread.fs = __USER_DS;
11993 @@ -198,6 +199,14 @@ void flush_thread(void)
11994 asm volatile (".chip 68k/68881\n\t"
11996 ".chip 68k" : : "a" (&zero));
11999 + current->thread.fs = USER_DS;
12000 +#if defined(CONFIG_FPU)
12002 + asm volatile ("frestore %0@\n\t" : : "a" (&zero));
12008 @@ -261,6 +270,7 @@ int copy_thread(int nr, unsigned long cl
12009 * Must save the current SFC/DFC value, NOT the value when
12010 * the parent was last descheduled - RGH 10-08-96
12012 +#if !defined(CONFIG_COLDFIRE)
12013 p->thread.fs = get_fs().seg;
12016 @@ -272,9 +282,34 @@ int copy_thread(int nr, unsigned long cl
12017 "fmoveml %/fpiar/%/fpcr/%/fpsr,%1"
12018 : : "m" (p->thread.fp[0]), "m" (p->thread.fpcntl[0])
12021 + p->thread.fs = get_fs();
12023 +#if defined(CONFIG_FPU)
12024 + if (!FPU_IS_EMU) {
12025 + /* Copy the current fpu state */
12026 + asm volatile ("fsave %0" : : "m" (p->thread.fpstate[0])
12029 + if (p->thread.fpstate[0]) {
12030 + asm volatile ("fmovemd %/fp0-%/fp7,%0"
12031 + : : "m" (p->thread.fp[0])
12033 + asm volatile ("fmovel %/fpiar,%0"
12034 + : : "m" (p->thread.fpcntl[0])
12036 + asm volatile ("fmovel %/fpcr,%0"
12037 + : : "m" (p->thread.fpcntl[1])
12039 + asm volatile ("fmovel %/fpsr,%0"
12040 + : : "m" (p->thread.fpcntl[2])
12043 /* Restore the state in case the fpu was busy */
12044 asm volatile ("frestore %0" : : "m" (p->thread.fpstate[0]));
12051 @@ -283,7 +318,9 @@ int copy_thread(int nr, unsigned long cl
12053 int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu)
12055 +#if !defined(CONFIG_COLDFIRE) || defined(CONFIG_FPU)
12056 char fpustate[216];
12061 @@ -300,6 +337,7 @@ int dump_fpu (struct pt_regs *regs, stru
12064 /* First dump the fpu context to avoid protocol violation. */
12065 +#if !defined(CONFIG_COLDFIRE)
12066 asm volatile ("fsave %0" :: "m" (fpustate[0]) : "memory");
12067 if (!CPU_IS_060 ? !fpustate[0] : !fpustate[2])
12069 @@ -310,6 +348,25 @@ int dump_fpu (struct pt_regs *regs, stru
12070 asm volatile ("fmovemx %/fp0-%/fp7,%0"
12071 :: "m" (fpu->fpregs[0])
12073 +#elif defined(CONFIG_FPU)
12074 + asm volatile ("fsave %0" :: "m" (fpustate[0]) : "memory");
12075 + if (!CPU_IS_060 ? !fpustate[0] : !fpustate[2])
12078 + asm volatile ("fmovel %/fpiar,%0"
12079 + : : "m" (fpu->fpcntl[0])
12081 + asm volatile ("fmovel %/fpcr,%0"
12082 + : : "m" (fpu->fpcntl[1])
12084 + asm volatile ("fmovel %/fpsr,%0"
12085 + : : "m" (fpu->fpcntl[2])
12087 + asm volatile ("fmovemd %/fp0-%/fp7,%0"
12088 + : : "m" (fpu->fpregs[0])
12094 EXPORT_SYMBOL(dump_fpu);
12095 --- a/arch/m68k/kernel/setup.c
12096 +++ b/arch/m68k/kernel/setup.c
12097 @@ -67,13 +67,22 @@ EXPORT_SYMBOL(m68k_memory);
12099 struct mem_info m68k_ramdisk;
12101 +#if !defined(CONFIG_COLDFIRE)
12102 static char m68k_command_line[CL_SIZE];
12104 +char m68k_command_line[CL_SIZE];
12105 +unsigned long uboot_info_stk;
12106 +EXPORT_SYMBOL(uboot_info_stk);
12109 void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL;
12110 /* machine dependent irq functions */
12111 void (*mach_init_IRQ) (void) __initdata = NULL;
12112 void (*mach_get_model) (char *model);
12113 int (*mach_get_hardware_list) (char *buffer);
12114 +#ifdef CONFIG_COLDFIRE
12115 +void (*mach_tick)(void);
12117 /* machine dependent timer functions */
12118 unsigned long (*mach_gettimeoffset) (void);
12119 int (*mach_hwclk) (int, struct rtc_time*);
12120 @@ -128,13 +137,17 @@ extern void config_hp300(void);
12121 extern void config_q40(void);
12122 extern void config_sun3x(void);
12124 +#ifdef CONFIG_COLDFIRE
12125 +void coldfire_sort_memrec(void);
12128 #define MASK_256K 0xfffc0000
12130 extern void paging_init(void);
12132 static void __init m68k_parse_bootinfo(const struct bi_record *record)
12134 - while (record->tag != BI_LAST) {
12135 + while ((record->tag != BI_LAST) && !(CONFIG_COLDFIRE)) {
12137 const unsigned long *data = record->data;
12139 @@ -192,7 +205,11 @@ static void __init m68k_parse_bootinfo(c
12143 - m68k_realnum_memory = m68k_num_memory;
12144 +#ifdef CONFIG_COLDFIRE
12145 + coldfire_sort_memrec();
12148 + m68k_realnum_memory = m68k_num_memory;
12149 #ifdef CONFIG_SINGLE_MEMORY_CHUNK
12150 if (m68k_num_memory > 1) {
12151 printk("Ignoring last %i chunks of physical memory\n",
12152 @@ -205,7 +222,9 @@ static void __init m68k_parse_bootinfo(c
12153 void __init setup_arch(char **cmdline_p)
12155 extern int _etext, _edata, _end;
12156 +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
12160 /* The bootinfo is located right after the kernel bss */
12161 m68k_parse_bootinfo((const struct bi_record *)&_end);
12162 @@ -220,9 +239,10 @@ void __init setup_arch(char **cmdline_p)
12163 * We should really do our own FPU check at startup.
12164 * [what do we do with buggy 68LC040s? if we have problems
12165 * with them, we should add a test to check_bugs() below] */
12166 -#ifndef CONFIG_M68KFPU_EMU_ONLY
12167 +#if !defined(CONFIG_M68KFPU_EMU_ONLY) && defined(CONFIG_FPU)
12168 /* clear the fpu if we have one */
12169 - if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060)) {
12170 + if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060|
12172 volatile int zero = 0;
12173 asm volatile ("frestore %0" : : "m" (zero));
12175 @@ -310,13 +330,18 @@ void __init setup_arch(char **cmdline_p)
12179 +#ifdef CONFIG_COLDFIRE
12181 + config_coldfire();
12185 panic("No configuration setup");
12190 -#ifndef CONFIG_SUN3
12191 +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
12192 for (i = 1; i < m68k_num_memory; i++)
12193 free_bootmem_node(NODE_DATA(i), m68k_memory[i].addr,
12194 m68k_memory[i].size);
12195 @@ -343,6 +368,10 @@ void __init setup_arch(char **cmdline_p)
12197 #endif /* !CONFIG_SUN3 */
12199 +#ifdef CONFIG_COLDFIRE
12200 + mmu_context_init();
12203 /* set ISA defs early as possible */
12204 #if defined(CONFIG_ISA) && defined(MULTI_ISA)
12205 #if defined(CONFIG_Q40)
12206 @@ -373,6 +402,7 @@ static int show_cpuinfo(struct seq_file
12207 #define LOOP_CYCLES_68030 (8)
12208 #define LOOP_CYCLES_68040 (3)
12209 #define LOOP_CYCLES_68060 (1)
12210 +#define LOOP_CYCLES_COLDFIRE (2)
12214 @@ -386,6 +416,9 @@ static int show_cpuinfo(struct seq_file
12215 } else if (CPU_IS_060) {
12217 clockfactor = LOOP_CYCLES_68060;
12218 + } else if (CPU_IS_CFV4E) {
12219 + cpu = "ColdFire V4e";
12220 + clockfactor = LOOP_CYCLES_COLDFIRE;
12224 @@ -404,6 +437,8 @@ static int show_cpuinfo(struct seq_file
12226 else if (m68k_fputype & FPU_SUNFPA)
12228 + else if (m68k_fputype & FPU_CFV4E)
12229 + fpu = "ColdFire V4e";
12233 @@ -420,6 +455,8 @@ static int show_cpuinfo(struct seq_file
12235 else if (m68k_mmutype & MMU_APOLLO)
12237 + else if (m68k_mmutype & MMU_CFV4E)
12238 + mmu = "ColdFire";
12242 @@ -482,7 +519,7 @@ int get_hardware_list(char *buffer)
12244 void check_bugs(void)
12246 -#ifndef CONFIG_M68KFPU_EMU
12247 +#if !defined(CONFIG_M68KFPU_EMU) && !defined(CONFIG_M5445X)
12248 if (m68k_fputype == 0) {
12249 printk(KERN_EMERG "*** YOU DO NOT HAVE A FLOATING POINT UNIT, "
12250 "WHICH IS REQUIRED BY LINUX/M68K ***\n");
12251 --- a/arch/m68k/kernel/sys_m68k.c
12252 +++ b/arch/m68k/kernel/sys_m68k.c
12254 #include <asm/traps.h>
12255 #include <asm/page.h>
12256 #include <asm/unistd.h>
12257 +#ifdef CONFIG_COLDFIRE
12258 +#include <asm/cacheflush.h>
12262 * sys_pipe() is the normal C calling standard for creating
12263 @@ -257,6 +260,7 @@ asmlinkage int sys_ipc (uint call, int f
12267 +#ifndef CONFIG_COLDFIRE
12268 /* Convert virtual (user) address VADDR to physical address PADDR */
12269 #define virt_to_phys_040(vaddr) \
12271 @@ -580,6 +584,7 @@ cache_flush_060 (unsigned long addr, int
12275 +#endif /* CONFIG_COLDFIRE */
12277 /* sys_cacheflush -- flush (part of) the processor cache. */
12279 @@ -612,6 +617,7 @@ sys_cacheflush (unsigned long addr, int
12283 +#ifndef CONFIG_COLDFIRE
12284 if (CPU_IS_020_OR_030) {
12285 if (scope == FLUSH_SCOPE_LINE && len < 256) {
12286 unsigned long cacr;
12287 @@ -656,6 +662,16 @@ sys_cacheflush (unsigned long addr, int
12288 ret = cache_flush_060 (addr, scope, cache, len);
12291 +#else /* CONFIG_COLDFIRE */
12292 + if ((cache & FLUSH_CACHE_INSN) && (cache & FLUSH_CACHE_DATA))
12294 + else if (cache & FLUSH_CACHE_INSN)
12300 +#endif /* CONFIG_COLDFIRE */
12304 --- a/arch/m68k/kernel/time.c
12305 +++ b/arch/m68k/kernel/time.c
12306 @@ -40,6 +40,11 @@ static inline int set_rtc_mmss(unsigned
12308 static irqreturn_t timer_interrupt(int irq, void *dummy)
12310 +#ifdef CONFIG_COLDFIRE
12311 + /* kick hardware timer if necessary */
12317 update_process_times(user_mode(get_irq_regs()));
12318 --- a/arch/m68k/kernel/vmlinux.lds.S
12319 +++ b/arch/m68k/kernel/vmlinux.lds.S
12323 - text PT_LOAD FILEHDR PHDRS FLAGS (7);
12324 + headers PT_PHDR PHDRS ;
12325 + text PT_LOAD FILEHDR PHDRS FLAGS (5);
12326 data PT_LOAD FLAGS (7);
12329 #include "vmlinux-sun3.lds"
12330 +#elif CONFIG_COLDFIRE
12331 +#include "../coldfire/vmlinux-cf.lds"
12333 #include "vmlinux-std.lds"
12335 --- a/arch/m68k/lib/checksum.c
12336 +++ b/arch/m68k/lib/checksum.c
12337 @@ -39,8 +39,131 @@
12338 * computes a partial checksum, e.g. for TCP/UDP fragments
12341 +#ifdef CONFIG_COLDFIRE
12343 +static inline unsigned short from32to16(unsigned long x)
12345 + /* add up 16-bit and 16-bit for 16+c bit */
12346 + x = (x & 0xffff) + (x >> 16);
12347 + /* add up carry.. */
12348 + x = (x & 0xffff) + (x >> 16);
12352 +static unsigned long do_csum(const unsigned char *buff, int len)
12355 + unsigned long result = 0;
12359 + odd = 1 & (unsigned long) buff;
12365 + count = len >> 1; /* nr of 16-bit words.. */
12367 + if (2 & (unsigned long) buff) {
12368 + result += *(unsigned short *) buff;
12373 + count >>= 1; /* nr of 32-bit words.. */
12375 + unsigned long carry = 0;
12377 + unsigned long w = *(unsigned long *) buff;
12382 + carry = (w > result);
12385 + result = (result & 0xffff) + (result >> 16);
12388 + result += *(unsigned short *) buff;
12393 + result += (*buff << 8);
12394 + result = from32to16(result);
12396 + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
12402 + * This is a version of ip_compute_csum() optimized for IP headers,
12403 + * which always checksum on 4 octet boundaries.
12405 +__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
12407 + return ~do_csum(iph, ihl*4);
12409 +EXPORT_SYMBOL(ip_fast_csum);
12412 + * computes the checksum of a memory block at buff, length len,
12413 + * and adds in "sum" (32-bit)
12415 + * returns a 32-bit number suitable for feeding into itself
12416 + * or csum_tcpudp_magic
12418 + * this function must be called with even lengths, except
12419 + * for the last fragment, which may be odd
12421 + * it's best to have buff aligned on a 32-bit boundary
12423 __wsum csum_partial(const void *buff, int len, __wsum sum)
12425 + unsigned int result = do_csum(buff, len);
12427 + /* add in old sum, and carry.. */
12429 + if (sum > result)
12433 +EXPORT_SYMBOL(csum_partial);
12436 + * copy from fs while checksumming, otherwise like csum_partial
12440 +csum_partial_copy_from_user(const void __user *src, void *dst, int len,
12441 + __wsum sum, int *csum_err)
12443 + if (csum_err) *csum_err = 0;
12444 + memcpy(dst, src, len);
12445 + return csum_partial(dst, len, sum);
12447 +EXPORT_SYMBOL(csum_partial_copy_from_user);
12450 + * copy from ds while checksumming, otherwise like csum_partial
12454 +csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
12456 + memcpy(dst, src, len);
12457 + return csum_partial(dst, len, sum);
12459 +EXPORT_SYMBOL(csum_partial_copy_nocheck);
12461 +#else /* !CONFIG_COLDFIRE */
12464 +csum_partial(const unsigned char *buff, int len, unsigned int sum)
12466 unsigned long tmp1, tmp2;
12468 * Experiments with ethernet and slip connections show that buff
12469 @@ -423,3 +546,4 @@ csum_partial_copy_nocheck(const void *sr
12472 EXPORT_SYMBOL(csum_partial_copy_nocheck);
12473 +#endif /* CONFIG_COLDFIRE */
12474 --- a/arch/m68k/lib/muldi3.c
12475 +++ b/arch/m68k/lib/muldi3.c
12476 @@ -21,12 +21,22 @@ Boston, MA 02111-1307, USA. */
12478 #define BITS_PER_UNIT 8
12480 +#ifdef CONFIG_COLDFIRE
12481 +#define umul_ppmm(w1, w0, u, v) \
12483 + unsigned long long x; \
12484 + x = (unsigned long long)u * v; \
12485 + w0 = (unsigned long)(x & 0x00000000ffffffff); \
12486 + w1 = (unsigned long)(x & 0xffffffff00000000) >> 32; \
12488 +#else /* CONFIG_COLDFIRE */
12489 #define umul_ppmm(w1, w0, u, v) \
12490 __asm__ ("mulu%.l %3,%1:%0" \
12491 : "=d" ((USItype)(w0)), \
12492 "=d" ((USItype)(w1)) \
12493 : "%0" ((USItype)(u)), \
12494 "dmi" ((USItype)(v)))
12495 +#endif /* CONFIG_COLDFIRE */
12497 #define __umulsidi3(u, v) \
12499 --- a/arch/m68k/lib/semaphore.S
12500 +++ b/arch/m68k/lib/semaphore.S
12501 @@ -16,11 +16,24 @@
12502 * there is contention on the semaphore.
12504 ENTRY(__down_failed)
12505 +#ifndef CONFIG_COLDFIRE
12506 moveml %a0/%d0/%d1,-(%sp)
12515 +#ifndef CONFIG_COLDFIRE
12516 moveml (%sp)+,%a0/%d0/%d1
12525 ENTRY(__down_failed_interruptible)
12526 @@ -44,10 +57,22 @@ ENTRY(__down_failed_trylock)
12530 +#ifndef CONFIG_COLDFIRE
12531 moveml %a0/%d0/%d1,-(%sp)
12540 +#ifndef CONFIG_COLDFIRE
12541 moveml (%sp)+,%a0/%d0/%d1
12549 --- a/arch/m68k/lib/string.c
12550 +++ b/arch/m68k/lib/string.c
12551 @@ -15,6 +15,7 @@ char *strcpy(char *dest, const char *src
12553 EXPORT_SYMBOL(strcpy);
12555 +#ifndef CONFIG_COLDFIRE
12556 void *memset(void *s, int c, size_t count)
12559 @@ -143,6 +144,69 @@ void *memcpy(void *to, const void *from,
12561 EXPORT_SYMBOL(memcpy);
12563 +#else /* CONFIG_COLDFIRE */
12565 +void *memset(void *s, int c, size_t count)
12568 + void *originalTo;
12570 + for (x = 0; x < count; x++)
12571 + *(unsigned char *)s++ = (unsigned char)c;
12573 + return originalTo;
12575 +EXPORT_SYMBOL(memset);
12577 +void *memcpy(void *to, const void *from, size_t n)
12584 + if ((long) to & 1) {
12586 + const char *cfrom = from;
12587 + *cto++ = *cfrom++;
12592 + if (n > 2 && (long) to & 2) {
12594 + const short *sfrom = from;
12595 + *sto++ = *sfrom++;
12603 + const long *lfrom = from;
12604 + for (; temp; temp--)
12605 + *lto++ = *lfrom++;
12611 + const short *sfrom = from;
12612 + *sto++ = *sfrom++;
12618 + const char *cfrom = from;
12623 +EXPORT_SYMBOL(memcpy);
12624 +#endif /* CONFIG_COLDFIRE */
12626 void *memmove(void *dest, const void *src, size_t n)
12628 void *xdest = dest;
12629 --- a/arch/m68k/lib/uaccess.c
12630 +++ b/arch/m68k/lib/uaccess.c
12634 #include <linux/module.h>
12635 +#ifndef CONFIG_COLDFIRE
12636 #include <asm/uaccess.h>
12638 unsigned long __generic_copy_from_user(void *to, const void __user *from,
12639 @@ -220,3 +221,244 @@ unsigned long __clear_user(void __user *
12642 EXPORT_SYMBOL(__clear_user);
12644 +#else /* CONFIG_COLDFIRE */
12646 +#include <asm/cf_uaccess.h>
12648 +unsigned long __generic_copy_from_user(void *to, const void *from,
12651 + unsigned long tmp;
12652 + __asm__ __volatile__
12655 + "1: movel (%1)+,%3\n"
12656 + " movel %3,(%0)+\n"
12659 + "2: movel %4,%2\n"
12662 + "3: movew (%1)+,%3\n"
12663 + " movew %3,(%0)+\n"
12664 + "4: bclr #0,%2\n"
12666 + "5: moveb (%1)+,%3\n"
12667 + " moveb %3,(%0)+\n"
12669 + ".section .fixup,\"ax\"\n"
12671 + "7: movel %2,%%d0\n"
12672 + "71:clrl (%0)+\n"
12673 + " subql #1,%%d0\n"
12682 + "8: addql #2,%2\n"
12683 + "81:clrw (%0)+\n"
12687 + "9: addql #1,%2\n"
12688 + "91:clrb (%0)+\n"
12691 + ".section __ex_table,\"a\"\n"
12697 + : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp)
12698 + : "d"(n & 3), "0"(to), "1"(from), "2"(n/4)
12699 + : "d0", "memory");
12702 +EXPORT_SYMBOL(__generic_copy_from_user);
12705 +unsigned long __generic_copy_to_user(void *to, const void *from,
12708 + unsigned long tmp;
12709 + __asm__ __volatile__
12712 + "1: movel (%1)+,%3\n"
12713 + "22:movel %3,(%0)+\n"
12714 + "2: subql #1,%2\n"
12716 + "3: movel %4,%2\n"
12719 + " movew (%1)+,%3\n"
12720 + "24:movew %3,(%0)+\n"
12721 + "4: bclr #0,%2\n"
12723 + " moveb (%1)+,%3\n"
12724 + "25:moveb %3,(%0)+\n"
12726 + ".section .fixup,\"ax\"\n"
12728 + "60:addql #1,%2\n"
12729 + "6: lsll #2,%2\n"
12732 + "7: addql #2,%2\n"
12734 + "8: addql #1,%2\n"
12737 + ".section __ex_table,\"a\"\n"
12739 + " .long 1b,60b\n"
12740 + " .long 22b,6b\n"
12742 + " .long 24b,7b\n"
12743 + " .long 3b,60b\n"
12745 + " .long 25b,8b\n"
12748 + : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp)
12749 + : "r"(n & 3), "0"(to), "1"(from), "2"(n / 4)
12753 +EXPORT_SYMBOL(__generic_copy_to_user);
12756 + * Copy a null terminated string from userspace.
12759 +long strncpy_from_user(char *dst, const char *src, long count)
12761 + long res = -EFAULT;
12762 + if (!(access_ok(VERIFY_READ, src, 1))) /* --tym-- */
12764 + if (count == 0) return count;
12765 + __asm__ __volatile__
12766 + ("1: moveb (%2)+,%%d0\n"
12767 + "12:moveb %%d0,(%1)+\n"
12771 + "2: subl %3,%0\n"
12773 + ".section .fixup,\"ax\"\n"
12775 + "4: movel %4,%0\n"
12778 + ".section __ex_table,\"a\"\n"
12781 + " .long 12b,4b\n"
12783 + : "=d"(res), "=a"(dst), "=a"(src), "=d"(count)
12784 + : "i"(-EFAULT), "0"(count), "1"(dst), "2"(src), "3"(count)
12785 + : "d0", "memory");
12788 +EXPORT_SYMBOL(strncpy_from_user);
12791 + * Return the size of a string (including the ending 0)
12793 + * Return 0 on exception, a value greater than N if too long
12795 +long strnlen_user(const char *src, long n)
12797 + long res = -EFAULT;
12798 + if (!(access_ok(VERIFY_READ, src, 1))) /* --tym-- */
12801 + res = -(long)src;
12802 + __asm__ __volatile__
12806 + "2: moveb (%1)+,%%d0\n"
12817 + ".section .fixup,\"ax\"\n"
12819 + "6: moveq %3,%0\n"
12822 + ".section __ex_table,\"a\"\n"
12825 + " .long 22b,6b\n"
12827 + : "=d"(res), "=a"(src), "=d"(n)
12828 + : "i"(0), "0"(res), "1"(src), "2"(n)
12832 +EXPORT_SYMBOL(strnlen_user);
12839 +unsigned long __clear_user(void *to, unsigned long n)
12841 + __asm__ __volatile__
12844 + "1: movel %3,(%0)+\n"
12845 + "2: subql #1,%1\n"
12847 + "3: movel %2,%1\n"
12850 + "24:movew %3,(%0)+\n"
12851 + "4: bclr #0,%1\n"
12853 + "25:moveb %3,(%0)+\n"
12855 + ".section .fixup,\"ax\"\n"
12857 + "61:addql #1,%1\n"
12858 + "6: lsll #2,%1\n"
12861 + "7: addql #2,%1\n"
12863 + "8: addql #1,%1\n"
12866 + ".section __ex_table,\"a\"\n"
12868 + " .long 1b,61b\n"
12870 + " .long 3b,61b\n"
12871 + " .long 24b,7b\n"
12873 + " .long 25b,8b\n"
12876 + : "=a"(to), "=d"(n)
12877 + : "r"(n & 3), "d"(0), "0"(to), "1"(n/4));
12880 +EXPORT_SYMBOL(__clear_user);
12882 +#endif /* CONFIG_COLDFIRE */
12884 --- a/arch/m68k/Makefile
12885 +++ b/arch/m68k/Makefile
12887 KBUILD_DEFCONFIG := amiga_defconfig
12889 # override top level makefile
12890 +ifndef CONFIG_COLDFIRE
12893 LDFLAGS := -m m68kelf
12894 LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
12895 ifneq ($(SUBARCH),$(ARCH))
12896 @@ -30,12 +32,18 @@ ifdef CONFIG_SUN3
12897 LDFLAGS_vmlinux = -N
12900 +ifdef CONFIG_COLDFIRE
12901 +# OBJCOPYFLAGS := -R .note -R .note.gnu.build-id -R .comment -S
12902 +# LDFLAGS_vmlinux = --verbose
12905 CHECKFLAGS += -D__mc68000__
12907 # without -fno-strength-reduce the 53c7xx.c driver fails ;-(
12908 KBUILD_CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
12910 # enable processor switch if compiled only for a single cpu
12911 +ifndef CONFIG_COLDFIRE
12912 ifndef CONFIG_M68020
12913 ifndef CONFIG_M68030
12915 @@ -49,6 +57,16 @@ endif
12921 +ifdef CONFIG_M5445X
12922 +KBUILD_CFLAGS += -march=isac -mcpu=54455 -msoft-float -g
12923 +KBUILD_AFLAGS += -march=isac -mcpu=54455 -msoft-float
12925 +ifdef CONFIG_M547X_8X
12926 +KBUILD_CFLAGS += -mcfv4e -g
12927 +KBUILD_AFLAGS += -mcfv4e
12931 # If configured for kgdb support, include debugging infos and keep the
12932 @@ -57,8 +75,12 @@ KBUILD_CFLAGS := $(subst -fomit-frame-po
12936 +ifndef CONFIG_COLDFIRE
12937 head-y := arch/m68k/kernel/head.o
12939 +head-y := arch/m68k/coldfire/head.o
12942 head-y := arch/m68k/kernel/sun3-head.o
12945 @@ -79,6 +101,7 @@ core-$(CONFIG_SUN3) += arch/m68k/sun3/
12946 core-$(CONFIG_M68040) += arch/m68k/fpsp040/
12947 core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
12948 core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
12949 +core-$(CONFIG_COLDFIRE) += arch/m68k/coldfire/
12953 --- a/arch/m68k/mm/cache.c
12954 +++ b/arch/m68k/mm/cache.c
12956 #include <asm/pgalloc.h>
12957 #include <asm/traps.h>
12959 +#ifdef CONFIG_COLDFIRE
12960 +#include <asm/cfcache.h>
12961 +#endif /* CONFIG_COLDFIRE */
12963 +#ifndef CONFIG_COLDFIRE
12964 static unsigned long virt_to_phys_slow(unsigned long vaddr)
12967 @@ -69,11 +73,18 @@ static unsigned long virt_to_phys_slow(u
12971 +#endif /* CONFIG_COLDFIRE */
12974 /* Push n pages at kernel virtual address and clear the icache */
12975 /* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
12976 void flush_icache_range(unsigned long address, unsigned long endaddr)
12978 +#ifdef CONFIG_COLDFIRE
12979 +// JKM -- hack until new cpushl stuff is in
12980 +// cf_icache_flush_range(address, endaddr);
12982 +#else /* !CONFIG_COLDFIRE */
12984 if (CPU_IS_040_OR_060) {
12985 address &= PAGE_MASK;
12986 @@ -94,9 +105,11 @@ void flush_icache_range(unsigned long ad
12990 +#endif /* CONFIG_COLDFIRE */
12992 EXPORT_SYMBOL(flush_icache_range);
12994 +#ifndef CONFIG_COLDFIRE
12995 void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
12996 unsigned long addr, int len)
12998 @@ -115,4 +128,5 @@ void flush_icache_user_range(struct vm_a
13002 +#endif /* CONFIG_COLDFIRE */
13005 +++ b/arch/m68k/mm/cf-mmu.c
13008 + * linux/arch/m68k/mm/cf-mmu.c
13010 + * Based upon linux/arch/m68k/mm/sun3mmu.c
13011 + * Based upon linux/arch/ppc/mm/mmu_context.c
13013 + * Implementations of mm routines specific to the Coldfire MMU.
13015 + * Copyright (c) 2008 Freescale Semiconductor, Inc.
13018 +#include <linux/signal.h>
13019 +#include <linux/sched.h>
13020 +#include <linux/mm.h>
13021 +#include <linux/swap.h>
13022 +#include <linux/kernel.h>
13023 +#include <linux/string.h>
13024 +#include <linux/types.h>
13025 +#include <linux/init.h>
13026 +#ifdef CONFIG_BLK_DEV_RAM
13027 +#include <linux/blkdev.h>
13029 +#include <linux/bootmem.h>
13031 +#include <asm/setup.h>
13032 +#include <asm/uaccess.h>
13033 +#include <asm/page.h>
13034 +#include <asm/pgtable.h>
13035 +#include <asm/system.h>
13036 +#include <asm/machdep.h>
13037 +#include <asm/io.h>
13038 +#include <asm/mmu_context.h>
13039 +#include <asm/cf_pgalloc.h>
13041 +#include <asm/coldfire.h>
13042 +#include <asm/tlbflush.h>
13044 +#define KMAPAREA(x) ((x >= VMALLOC_START) && ( x < KMAP_END))
13048 +mm_context_t next_mmu_context;
13049 +unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1];
13051 +atomic_t nr_free_contexts;
13052 +struct mm_struct *context_mm[LAST_CONTEXT+1];
13053 +void steal_context(void);
13056 +const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n";
13058 +extern unsigned long empty_bad_page_table;
13059 +extern unsigned long empty_bad_page;
13060 +extern unsigned long num_pages;
13062 +extern char __init_begin, __init_end;
13064 +void free_initmem(void)
13067 + unsigned long addr;
13068 + unsigned long start = (unsigned long)&__init_begin;
13069 + unsigned long end = (unsigned long)&__init_end;
13071 + printk(KERN_INFO "free_initmem: __init_begin = 0x%lx __init_end = 0x%lx\n", start, end);
13073 + addr = (unsigned long)&__init_begin;
13074 + for (; addr < (unsigned long)&__init_end; addr += PAGE_SIZE) {
13075 + /* not currently used */
13076 + virt_to_page(addr)->flags &= ~(1 << PG_reserved);
13077 + init_page_count(virt_to_page(addr));
13079 + totalram_pages++;
13084 +/* Coldfire paging_init derived from sun3 */
13085 +void __init paging_init(void)
13088 + pte_t * pg_table;
13090 + unsigned long address;
13091 + unsigned long next_pgtable;
13092 + unsigned long bootmem_end;
13093 + unsigned long zones_size[MAX_NR_ZONES];
13094 + unsigned long size;
13095 + enum zone_type zone;
13097 + empty_zero_page = (void *)alloc_bootmem_pages(PAGE_SIZE);
13098 + memset((void *)empty_zero_page, 0, PAGE_SIZE);
13100 + pg_dir = swapper_pg_dir;
13101 + memset(swapper_pg_dir, 0, sizeof (swapper_pg_dir));
13103 + size = num_pages * sizeof(pte_t);
13104 + size = (size + PAGE_SIZE) & ~(PAGE_SIZE-1);
13105 + next_pgtable = (unsigned long)alloc_bootmem_pages(size);
13107 + bootmem_end = (next_pgtable + size + PAGE_SIZE) & PAGE_MASK;
13108 + pg_dir += PAGE_OFFSET >> PGDIR_SHIFT;
13110 + address = PAGE_OFFSET;
13111 + while (address < (unsigned long)high_memory)
13113 + pg_table = (pte_t *)next_pgtable;
13114 + next_pgtable += PTRS_PER_PTE * sizeof (pte_t);
13115 + pgd_val(*pg_dir) = (unsigned long) pg_table;
13118 + /* now change pg_table to kernel virtual addresses */
13119 + for (i=0; i<PTRS_PER_PTE; ++i, ++pg_table)
13121 + pte_t pte = pfn_pte(virt_to_pfn(address), PAGE_INIT);
13122 + if (address >= (unsigned long)high_memory)
13123 + pte_val (pte) = 0;
13125 + set_pte (pg_table, pte);
13126 + address += PAGE_SIZE;
13130 + current->mm = NULL;
13132 + /* clear zones */
13133 + for (zone = 0; zone < MAX_NR_ZONES; zone++)
13134 + zones_size[zone] = 0x0;
13136 + /* allocate the bottom 32M (0x40x 0x41x) to DMA - head.S marks them NO CACHE */
13137 + /* JKM - this should be changed to allocate from the TOP (0x4f,0x4e) but the
13138 + * allocator is being a bit challenging */
13139 + zones_size[ZONE_DMA] = (32*1024*1024) >> PAGE_SHIFT;
13141 + /* allocate the rest to NORMAL - head.S marks them CACHE */
13142 + zones_size[ZONE_NORMAL] = (((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT) - zones_size[0];
13144 + free_area_init(zones_size);
13148 +int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
13150 + struct mm_struct *mm;
13154 + unsigned long mmuar;
13158 + local_save_flags(flags);
13159 + local_irq_disable();
13161 + mmuar = ( dtlb ) ? regs->mmuar
13162 + : regs->pc + (extension_word * sizeof(long));
13164 + mm = (!user_mode(regs) && KMAPAREA(mmuar)) ? &init_mm : current->mm;
13167 + local_irq_restore(flags);
13171 + pgd = pgd_offset(mm, mmuar);
13172 + if (pgd_none(*pgd)) {
13173 + local_irq_restore(flags);
13177 + pmd = pmd_offset(pgd, mmuar);
13178 + if (pmd_none(*pmd)) {
13179 + local_irq_restore(flags);
13183 + pte = (KMAPAREA(mmuar)) ? pte_offset_kernel(pmd, mmuar)
13184 + : pte_offset_map(pmd, mmuar);
13185 + if (pte_none(*pte) || !pte_present(*pte)) {
13186 + local_irq_restore(flags);
13191 + if (!pte_write(*pte)) {
13192 + local_irq_restore(flags);
13195 + set_pte(pte, pte_mkdirty(*pte));
13198 + set_pte(pte, pte_mkyoung(*pte));
13199 + asid = mm->context & 0xff;
13200 + if (!pte_dirty(*pte) && !KMAPAREA(mmuar))
13201 + set_pte(pte, pte_wrprotect(*pte));
13203 + *MMUTR = (mmuar & PAGE_MASK) | (asid << CF_ASID_MMU_SHIFT)
13204 + | (((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK ) >> CF_PAGE_MMUTR_SHIFT)
13207 + *MMUDR = (pte_val(*pte) & PAGE_MASK)
13208 + | ((pte->pte) & CF_PAGE_MMUDR_MASK)
13209 + | MMUDR_SZ8K | MMUDR_X;
13212 + *MMUOR = MMUOR_ACC | MMUOR_UAA;
13214 + *MMUOR = MMUOR_ITLB | MMUOR_ACC | MMUOR_UAA;
13219 + printk("cf_tlb_miss: va=%lx, pa=%lx\n", (mmuar & PAGE_MASK),
13220 + (pte_val(*pte) & PAGE_MASK));
13222 + local_irq_restore(flags);
13227 +/* The following was taken from arch/ppc/mmu_context.c
13229 + * Initialize the context management stuff.
13231 +void __init mmu_context_init(void)
13234 + * Some processors have too few contexts to reserve one for
13235 + * init_mm, and require using context 0 for a normal task.
13236 + * Other processors reserve the use of context zero for the kernel.
13237 + * This code assumes FIRST_CONTEXT < 32.
13239 + context_map[0] = (1 << FIRST_CONTEXT) - 1;
13240 + next_mmu_context = FIRST_CONTEXT;
13241 + atomic_set(&nr_free_contexts, LAST_CONTEXT - FIRST_CONTEXT + 1);
13245 + * Steal a context from a task that has one at the moment.
13246 + * This is only used on 8xx and 4xx and we presently assume that
13247 + * they don't do SMP. If they do then thicfpgalloc.hs will have to check
13248 + * whether the MM we steal is in use.
13249 + * We also assume that this is only used on systems that don't
13250 + * use an MMU hash table - this is true for 8xx and 4xx.
13251 + * This isn't an LRU system, it just frees up each context in
13252 + * turn (sort-of pseudo-random replacement :). This would be the
13253 + * place to implement an LRU scheme if anyone was motivated to do it.
13256 +void steal_context(void)
13258 + struct mm_struct *mm;
13259 + /* free up context `next_mmu_context' */
13260 + /* if we shouldn't free context 0, don't... */
13261 + if (next_mmu_context < FIRST_CONTEXT)
13262 + next_mmu_context = FIRST_CONTEXT;
13263 + mm = context_mm[next_mmu_context];
13264 + flush_tlb_mm(mm);
13265 + destroy_context(mm);
13268 +++ b/arch/m68k/mm/cf-mmu.c.orig
13271 + * linux/arch/m68k/mm/cf-mmu.c
13273 + * Based upon linux/arch/m68k/mm/sun3mmu.c
13274 + * Based upon linux/arch/ppc/mm/mmu_context.c
13276 + * Implementations of mm routines specific to the Coldfire MMU.
13278 + * Copyright (c) 2008 Freescale Semiconductor, Inc.
13281 +#include <linux/signal.h>
13282 +#include <linux/sched.h>
13283 +#include <linux/mm.h>
13284 +#include <linux/swap.h>
13285 +#include <linux/kernel.h>
13286 +#include <linux/string.h>
13287 +#include <linux/types.h>
13288 +#include <linux/init.h>
13289 +#ifdef CONFIG_BLK_DEV_RAM
13290 +#include <linux/blkdev.h>
13292 +#include <linux/bootmem.h>
13294 +#include <asm/setup.h>
13295 +#include <asm/uaccess.h>
13296 +#include <asm/page.h>
13297 +#include <asm/pgtable.h>
13298 +#include <asm/system.h>
13299 +#include <asm/machdep.h>
13300 +#include <asm/io.h>
13301 +#include <asm/mmu_context.h>
13302 +#include <asm/cf_pgalloc.h>
13304 +#include <asm/coldfire.h>
13305 +#include <asm/tlbflush.h>
13307 +#if PAGE_OFFSET == CONFIG_SDRAM_BASE
13308 +#define KERNRAM(x) ((x >= PAGE_OFFSET) && (x < (PAGE_OFFSET + CONFIG_SDRAM_SIZE)))
13310 +#define KERNRAM(x) (x >= PAGE_OFFSET)
13313 +mm_context_t next_mmu_context;
13314 +unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1];
13316 +atomic_t nr_free_contexts;
13317 +struct mm_struct *context_mm[LAST_CONTEXT+1];
13318 +void steal_context(void);
13321 +const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n";
13323 +extern unsigned long empty_bad_page_table;
13324 +extern unsigned long empty_bad_page;
13325 +extern unsigned long num_pages;
13327 +extern char __init_begin, __init_end;
13329 +void free_initmem(void)
13332 + unsigned long addr;
13333 + unsigned long start = (unsigned long)&__init_begin;
13334 + unsigned long end = (unsigned long)&__init_end;
13337 + * JKM -- revisit -- the latest round of vmlinux.lds changes has caused
13338 + * a little grief with how init areas are handled. With the new toolchain
13339 + * release I'll fix this.
13341 + printk(KERN_INFO "free_initmem: __init_begin = 0x%lx __init_end = 0x%lx\n", start, end);
13343 + addr = (unsigned long)&__init_begin;
13344 + for (; addr < (unsigned long)&__init_end; addr += PAGE_SIZE) {
13345 + /* not currently used */
13346 + virt_to_page(addr)->flags &= ~(1 << PG_reserved);
13347 + init_page_count(virt_to_page(addr));
13349 + totalram_pages++;
13354 +/* Coldfire paging_init derived from sun3 */
13355 +void __init paging_init(void)
13358 + pte_t * pg_table;
13360 + unsigned long address;
13361 + unsigned long next_pgtable;
13362 + unsigned long bootmem_end;
13363 + unsigned long zones_size[MAX_NR_ZONES];
13364 + unsigned long size;
13365 + enum zone_type zone;
13367 + empty_zero_page = (void *)alloc_bootmem_pages(PAGE_SIZE);
13368 + memset((void *)empty_zero_page, 0, PAGE_SIZE);
13370 + pg_dir = swapper_pg_dir;
13371 + memset(swapper_pg_dir, 0, sizeof (swapper_pg_dir));
13373 + size = num_pages * sizeof(pte_t);
13374 + size = (size + PAGE_SIZE) & ~(PAGE_SIZE-1);
13375 + next_pgtable = (unsigned long)alloc_bootmem_pages(size);
13377 + bootmem_end = (next_pgtable + size + PAGE_SIZE) & PAGE_MASK;
13378 + pg_dir += PAGE_OFFSET >> PGDIR_SHIFT;
13380 + address = PAGE_OFFSET;
13381 + while (address < (unsigned long)high_memory)
13383 + pg_table = (pte_t *)next_pgtable;
13384 + next_pgtable += PTRS_PER_PTE * sizeof (pte_t);
13385 + pgd_val(*pg_dir) = (unsigned long) pg_table;
13388 + /* now change pg_table to kernel virtual addresses */
13389 + for (i=0; i<PTRS_PER_PTE; ++i, ++pg_table)
13391 + pte_t pte = pfn_pte(virt_to_pfn(address), PAGE_INIT);
13392 + if (address >= (unsigned long)high_memory)
13393 + pte_val (pte) = 0;
13395 + set_pte (pg_table, pte);
13396 + address += PAGE_SIZE;
13400 + current->mm = NULL;
13402 + /* clear zones */
13403 + for (zone = 0; zone < MAX_NR_ZONES; zone++)
13404 + zones_size[zone] = 0x0;
13406 + /* allocate the bottom 32M (0x40x 0x41x) to DMA - head.S marks them NO CACHE */
13407 + /* JKM - this should be changed to allocate from the TOP (0x4f,0x4e) but the
13408 + * allocator is being a bit challenging */
13409 + zones_size[ZONE_DMA] = (32*1024*1024) >> PAGE_SHIFT;
13411 + /* allocate the rest to NORMAL - head.S marks them CACHE */
13412 + zones_size[ZONE_NORMAL] = (((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT) - zones_size[0];
13414 + free_area_init(zones_size);
13418 +int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
13420 + struct mm_struct *mm;
13424 + unsigned long mmuar;
13428 + local_save_flags(flags);
13429 + local_irq_disable();
13431 + mmuar = ( dtlb ) ? regs->mmuar
13432 + : regs->pc + (extension_word * sizeof(long));
13434 + mm = (!user_mode(regs) && KERNRAM(mmuar)) ? &init_mm : current->mm;
13437 + local_irq_restore(flags);
13441 + pgd = pgd_offset(mm, mmuar);
13442 + if (pgd_none(*pgd)) {
13443 + local_irq_restore(flags);
13447 + pmd = pmd_offset(pgd, mmuar);
13448 + if (pmd_none(*pmd)) {
13449 + local_irq_restore(flags);
13453 + pte = (KERNRAM(mmuar)) ? pte_offset_kernel(pmd, mmuar)
13454 + : pte_offset_map(pmd, mmuar);
13455 + if (pte_none(*pte) || !pte_present(*pte)) {
13456 + local_irq_restore(flags);
13461 + if (!pte_write(*pte)) {
13462 + local_irq_restore(flags);
13465 + set_pte(pte, pte_mkdirty(*pte));
13468 + set_pte(pte, pte_mkyoung(*pte));
13469 + asid = mm->context & 0xff;
13470 + if (!pte_dirty(*pte) && !KERNRAM(mmuar))
13471 + set_pte(pte, pte_wrprotect(*pte));
13473 + *MMUTR = (mmuar & PAGE_MASK) | (asid << CF_ASID_MMU_SHIFT)
13474 + | (((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK ) >> CF_PAGE_MMUTR_SHIFT)
13477 + *MMUDR = (pte_val(*pte) & PAGE_MASK)
13478 + | ((pte->pte) & CF_PAGE_MMUDR_MASK)
13479 + | MMUDR_SZ8K | MMUDR_X;
13482 + *MMUOR = MMUOR_ACC | MMUOR_UAA;
13484 + *MMUOR = MMUOR_ITLB | MMUOR_ACC | MMUOR_UAA;
13488 + /*printk("cf_tlb_miss: va=%lx, pa=%lx\n", (mmuar & PAGE_MASK),
13489 + (pte_val(*pte) & PAGE_MASK));*/
13490 + local_irq_restore(flags);
13495 +/* The following was taken from arch/ppc/mmu_context.c
13497 + * Initialize the context management stuff.
13499 +void __init mmu_context_init(void)
13502 + * Some processors have too few contexts to reserve one for
13503 + * init_mm, and require using context 0 for a normal task.
13504 + * Other processors reserve the use of context zero for the kernel.
13505 + * This code assumes FIRST_CONTEXT < 32.
13507 + context_map[0] = (1 << FIRST_CONTEXT) - 1;
13508 + next_mmu_context = FIRST_CONTEXT;
13509 + atomic_set(&nr_free_contexts, LAST_CONTEXT - FIRST_CONTEXT + 1);
13513 + * Steal a context from a task that has one at the moment.
13514 + * This is only used on 8xx and 4xx and we presently assume that
13515 + * they don't do SMP. If they do then thicfpgalloc.hs will have to check
13516 + * whether the MM we steal is in use.
13517 + * We also assume that this is only used on systems that don't
13518 + * use an MMU hash table - this is true for 8xx and 4xx.
13519 + * This isn't an LRU system, it just frees up each context in
13520 + * turn (sort-of pseudo-random replacement :). This would be the
13521 + * place to implement an LRU scheme if anyone was motivated to do it.
13524 +void steal_context(void)
13526 + struct mm_struct *mm;
13527 + /* free up context `next_mmu_context' */
13528 + /* if we shouldn't free context 0, don't... */
13529 + if (next_mmu_context < FIRST_CONTEXT)
13530 + next_mmu_context = FIRST_CONTEXT;
13531 + mm = context_mm[next_mmu_context];
13532 + flush_tlb_mm(mm);
13533 + destroy_context(mm);
13535 --- a/arch/m68k/mm/hwtest.c
13536 +++ b/arch/m68k/mm/hwtest.c
13539 #include <linux/module.h>
13541 +#ifndef CONFIG_COLDFIRE
13542 int hwreg_present( volatile void *regp )
13545 @@ -82,4 +83,5 @@ int hwreg_write( volatile void *regp, un
13548 EXPORT_SYMBOL(hwreg_write);
13551 --- a/arch/m68k/mm/init.c
13552 +++ b/arch/m68k/mm/init.c
13553 @@ -122,7 +122,6 @@ void __init mem_init(void)
13555 atari_stram_mem_init_hook();
13558 /* this will put all memory onto the freelists */
13559 totalram_pages = num_physpages = 0;
13560 for_each_online_pgdat(pgdat) {
13561 @@ -146,7 +145,7 @@ void __init mem_init(void)
13565 -#ifndef CONFIG_SUN3
13566 +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
13567 /* insert pointer tables allocated so far into the tablelist */
13568 init_pointer_table((unsigned long)kernel_pg_dir);
13569 for (i = 0; i < PTRS_PER_PGD; i++) {
13570 --- a/arch/m68k/mm/kmap.c
13571 +++ b/arch/m68k/mm/kmap.c
13576 +#ifndef CONFIG_COLDFIRE
13577 #define PTRTREESIZE (256*1024)
13579 +#define PTRTREESIZE PAGE_SIZE
13583 * For 040/060 we can use the virtual memory area like other architectures,
13584 @@ -50,7 +54,11 @@ static inline void free_io_area(void *ad
13588 +#ifdef CONFIG_COLDFIRE
13589 +#define IO_SIZE PAGE_SIZE
13591 #define IO_SIZE (256*1024)
13594 static struct vm_struct *iolist;
13596 @@ -125,8 +133,34 @@ void __iomem *__ioremap(unsigned long ph
13600 +#ifdef CONFIG_M5445X
13601 + if (physaddr >= 0xf0000000) {
13603 + * On the M5445x processors an ACR is setup to map
13604 + * the 0xF0000000 range into kernel memory as
13607 + return (void __iomem *)physaddr;
13611 +#ifdef CONFIG_M547X_8X
13612 + if (physaddr >= 0xf0000000) {
13614 + * On the M547x/M548x processors an ACR is setup to map
13615 + * the 0xF0000000 range into kernel memory as
13618 + return (void __iomem *)physaddr;
13620 + if ((physaddr >= 0xd0000000) && (physaddr + size < 0xd800ffff)) {
13621 + printk("ioremap:PCI 0x%lx,0x%lx(%d) - PCI area hit\n", physaddr, size, cacheflag);
13622 + return (void *)physaddr;
13627 - printk("ioremap: 0x%lx,0x%lx(%d) - ", physaddr, size, cacheflag);
13628 + printk("ioremap: paddr=0x%lx,size=0x%lx(%d) - ", physaddr, size, cacheflag);
13631 * Mappings have to be aligned
13632 @@ -145,7 +179,7 @@ void __iomem *__ioremap(unsigned long ph
13633 virtaddr = (unsigned long)area->addr;
13634 retaddr = virtaddr + offset;
13636 - printk("0x%lx,0x%lx,0x%lx", physaddr, virtaddr, retaddr);
13637 + printk(" paddr=0x%lx,vaddr=0x%lx,retaddr=0x%lx", physaddr, virtaddr, retaddr);
13641 @@ -170,7 +204,12 @@ void __iomem *__ioremap(unsigned long ph
13645 +#ifndef CONFIG_COLDFIRE
13646 physaddr |= (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY);
13648 + physaddr |= (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY | \
13649 + _PAGE_READWRITE);
13651 switch (cacheflag) {
13652 case IOMAP_NOCACHE_SER:
13653 case IOMAP_NOCACHE_NONSER:
13654 @@ -249,7 +288,12 @@ void __iounmap(void *addr, unsigned long
13659 +#ifdef CONFIG_M547X_8X
13660 + if ((addr >= (void*)0xd0000000) && (addr + size < (void*)0xd800ffff)) {
13661 + printk("%s: PCI address\n",__FUNCTION__);
13665 while ((long)size > 0) {
13666 pgd_dir = pgd_offset_k(virtaddr);
13667 if (pgd_bad(*pgd_dir)) {
13668 --- a/arch/m68k/mm/Makefile
13669 +++ b/arch/m68k/mm/Makefile
13670 @@ -6,3 +6,4 @@ obj-y := cache.o init.o fault.o hwtest.
13672 obj-$(CONFIG_MMU_MOTOROLA) += kmap.o memory.o motorola.o
13673 obj-$(CONFIG_MMU_SUN3) += sun3kmap.o sun3mmu.o
13674 +obj-$(CONFIG_MMU_CFV4E) += cf-mmu.o kmap.o memory.o
13675 --- a/arch/m68k/mm/memory.c
13676 +++ b/arch/m68k/mm/memory.c
13677 @@ -127,6 +127,7 @@ int free_pointer_table (pmd_t *ptable)
13681 +#ifndef CONFIG_COLDFIRE
13682 /* invalidate page in both caches */
13683 static inline void clear040(unsigned long paddr)
13685 @@ -173,6 +174,7 @@ static inline void pushcl040(unsigned lo
13687 local_irq_restore(flags);
13689 +#endif /* CONFIG_COLDFIRE */
13692 * 040: Hit every page containing an address in the range paddr..paddr+len-1.
13693 @@ -203,6 +205,11 @@ static inline void pushcl040(unsigned lo
13695 void cache_clear (unsigned long paddr, int len)
13697 +#ifdef CONFIG_COLDFIRE
13698 +// JKM -- revise to use proper caching
13699 +// cf_cache_clear(paddr, len);
13702 if (CPU_IS_040_OR_060) {
13705 @@ -237,6 +244,7 @@ void cache_clear (unsigned long paddr, i
13709 +#endif /* CONFIG_COLDFIRE */
13711 EXPORT_SYMBOL(cache_clear);
13713 @@ -250,6 +258,11 @@ EXPORT_SYMBOL(cache_clear);
13715 void cache_push (unsigned long paddr, int len)
13717 +#ifdef CONFIG_COLDFIRE
13718 +// JKM -- revise to use proper caching
13719 +// cf_cache_push(paddr, len);
13722 if (CPU_IS_040_OR_060) {
13723 int tmp = PAGE_SIZE;
13725 @@ -290,6 +303,7 @@ void cache_push (unsigned long paddr, in
13729 +#endif /* CONFIG_COLDFIRE */
13731 EXPORT_SYMBOL(cache_push);
13733 --- a/drivers/ata/Kconfig
13734 +++ b/drivers/ata/Kconfig
13735 @@ -6,7 +6,7 @@ menuconfig ATA
13736 tristate "Serial ATA (prod) and Parallel ATA (experimental) drivers"
13737 depends on HAS_IOMEM
13739 - depends on !(M32R || M68K) || BROKEN
13740 + depends on !M32R || BROKEN
13741 depends on !SUN4 || BROKEN
13744 @@ -679,4 +679,13 @@ config PATA_BF54X
13749 + tristate "Freescale on-chip PATA support"
13750 + depends on (ARCH_MX3 || ARCH_MX27 || PPC_512x || M54455)
13752 + On Freescale processors, say Y here if you wish to use the on-chip
13755 + If you are unsure, say N to this.
13758 --- a/drivers/ata/Makefile
13759 +++ b/drivers/ata/Makefile
13762 obj-$(CONFIG_ATA) += libata.o
13764 obj-$(CONFIG_SATA_AHCI) += ahci.o
13765 @@ -71,6 +70,7 @@ obj-$(CONFIG_PATA_BF54X) += pata_bf54x.o
13766 obj-$(CONFIG_PATA_PLATFORM) += pata_platform.o
13767 obj-$(CONFIG_PATA_OF_PLATFORM) += pata_of_platform.o
13768 obj-$(CONFIG_PATA_ICSIDE) += pata_icside.o
13769 +obj-$(CONFIG_PATA_FSL) += pata_fsl.o
13770 # Should be last but two libata driver
13771 obj-$(CONFIG_PATA_ACPI) += pata_acpi.o
13772 # Should be last but one libata driver
13774 +++ b/drivers/ata/pata_fsl.c
13777 + * Freescale integrated PATA driver
13781 + * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
13785 + * The code contained herein is licensed under the GNU General Public
13786 + * License. You may obtain a copy of the GNU General Public License
13787 + * Version 2 or later at the following locations:
13789 + * http://www.opensource.org/licenses/gpl-license.html
13790 + * http://www.gnu.org/copyleft/gpl.html
13793 +#include <linux/kernel.h>
13794 +#include <linux/module.h>
13795 +#include <linux/init.h>
13796 +#include <linux/blkdev.h>
13797 +#include <scsi/scsi_host.h>
13798 +#include <linux/ata.h>
13799 +#include <linux/libata.h>
13800 +#include <linux/platform_device.h>
13801 +#include <linux/fsl_devices.h>
13802 +#ifdef CONFIG_FSL_PATA_USE_DMA
13803 +#include <asm/dma.h>
13806 +#define DRV_NAME "pata_fsl"
13807 +#define DRV_VERSION "1.0"
13809 +#ifdef CONFIG_M54455
13810 +#define WRITE_ATA8(val, reg) \
13811 + __raw_writeb(val, (ata_regs + reg));
13812 +#define WRITE_ATA16(val, reg) \
13813 + __raw_writew(val, (ata_regs + reg));
13815 +#define WRITE_ATA8(val, reg) \
13816 + __raw_writel(val, (ata_regs + reg));
13817 +#define WRITE_ATA16(val, reg) \
13818 + __raw_writel(val, (ata_regs + reg));
13821 +struct pata_fsl_priv {
13822 +#ifdef CONFIG_FSL_PATA_USE_DMA
13825 + u8 *fsl_ata_regs;
13826 +#ifdef CONFIG_FSL_PATA_USE_DMA
13835 + /* various constants */
13837 +#ifdef CONFIG_FSL_PATA_USE_DMA
13838 + FSL_ATA_MAX_SG_LEN = 65534,
13841 + /* offsets to registers */
13843 + FSL_ATA_TIMING_REGS = 0x00,
13844 + FSL_ATA_FIFO_FILL = 0x20,
13845 + FSL_ATA_CONTROL = 0x24,
13846 + FSL_ATA_INT_PEND = 0x28,
13847 + FSL_ATA_INT_EN = 0x2C,
13848 + FSL_ATA_INT_CLEAR = 0x30,
13849 + FSL_ATA_FIFO_ALARM = 0x34,
13850 + FSL_ATA_DRIVE_DATA = 0xA0,
13851 + FSL_ATA_DRIVE_CONTROL = 0xD8,
13853 + /* bits within FSL_ATA_CONTROL */
13855 + FSL_ATA_CTRL_FIFO_RST_B = 0x80,
13856 + FSL_ATA_CTRL_ATA_RST_B = 0x40,
13857 + FSL_ATA_CTRL_FIFO_TX_EN = 0x20,
13858 + FSL_ATA_CTRL_FIFO_RCV_EN = 0x10,
13859 + FSL_ATA_CTRL_DMA_PENDING = 0x08,
13860 + FSL_ATA_CTRL_DMA_ULTRA = 0x04,
13861 + FSL_ATA_CTRL_DMA_WRITE = 0x02,
13862 + FSL_ATA_CTRL_IORDY_EN = 0x01,
13864 + /* bits within the interrupt control registers */
13866 + FSL_ATA_INTR_ATA_INTRQ1 = 0x80,
13867 + FSL_ATA_INTR_FIFO_UNDERFLOW = 0x40,
13868 + FSL_ATA_INTR_FIFO_OVERFLOW = 0x20,
13869 + FSL_ATA_INTR_CTRL_IDLE = 0x10,
13870 + FSL_ATA_INTR_ATA_INTRQ2 = 0x08,
13874 + * This structure contains the timing parameters for
13875 + * ATA bus timing in the 5 PIO modes. The timings
13876 + * are in nanoseconds, and are converted to clock
13877 + * cycles before being stored in the ATA controller
13878 + * timing registers.
13881 + short t0, t1, t2_8, t2_16, t2i, t4, t9, tA;
13884 + .t0 = 600, .t1 = 70, .t2_8 = 290, .t2_16 = 165, .t2i = 0,
13885 + .t4 = 30,.t9 = 20,.tA = 50
13888 + .t0 = 383, .t1 = 50, .t2_8 = 290, .t2_16 = 125, .t2i = 0,
13889 + .t4 = 20, .t9 = 15, .tA = 50
13892 + .t0 = 240, .t1 = 30, .t2_8 = 290, .t2_16 = 100, .t2i = 0,
13893 + .t4 = 15, .t9 = 10, .tA = 50
13896 + .t0 = 180, .t1 = 30, .t2_8 = 80, .t2_16 = 80, .t2i = 0,
13897 + .t4 = 10, .t9 = 10, .tA = 50
13900 + .t0 = 120, .t1 = 25, .t2_8 = 70, .t2_16 = 70, .t2i = 0,
13901 + .t4 = 10, .t9 = 10, .tA = 50
13905 +#define NR_PIO_SPECS (sizeof pio_specs / sizeof pio_specs[0])
13908 + * This structure contains the timing parameters for
13909 + * ATA bus timing in the 3 MDMA modes. The timings
13910 + * are in nanoseconds, and are converted to clock
13911 + * cycles before being stored in the ATA controller
13912 + * timing registers.
13915 + short t0M, tD, tH, tJ, tKW, tM, tN, tJNH;
13916 +} mdma_specs[] = {
13918 + .t0M = 480, .tD = 215, .tH = 20, .tJ = 20, .tKW = 215,
13919 + .tM = 50, .tN = 15, .tJNH = 20
13922 + .t0M = 150, .tD = 80, .tH = 15, .tJ = 5, .tKW = 50,
13923 + .tM = 30, .tN = 10, .tJNH = 15
13926 + .t0M = 120, .tD = 70, .tH = 10, .tJ = 5, .tKW = 25,
13927 + .tM = 25, .tN = 10, .tJNH = 10
13931 +#define NR_MDMA_SPECS (sizeof mdma_specs / sizeof mdma_specs[0])
13934 + * This structure contains the timing parameters for
13935 + * ATA bus timing in the 6 UDMA modes. The timings
13936 + * are in nanoseconds, and are converted to clock
13937 + * cycles before being stored in the ATA controller
13938 + * timing registers.
13941 + short t2CYC, tCYC, tDS, tDH, tDVS, tDVH, tCVS, tCVH, tFS_min, tLI_max,
13942 + tMLI, tAZ, tZAH, tENV_min, tSR, tRFS, tRP, tACK, tSS, tDZFS;
13943 +} udma_specs[] = {
13945 + .t2CYC = 235, .tCYC = 114, .tDS = 15, .tDH = 5, .tDVS = 70,
13946 + .tDVH = 6, .tCVS = 70, .tCVH = 6, .tFS_min = 0,
13947 + .tLI_max = 100, .tMLI = 20, .tAZ = 10, .tZAH = 20,
13948 + .tENV_min = 20, .tSR = 50, .tRFS = 75, .tRP = 160,
13949 + .tACK = 20, .tSS = 50, .tDZFS = 80
13952 + .t2CYC = 156, .tCYC = 75, .tDS = 10, .tDH = 5, .tDVS = 48,
13953 + .tDVH = 6, .tCVS = 48, .tCVH = 6, .tFS_min = 0,
13954 + .tLI_max = 100, .tMLI = 20, .tAZ = 10, .tZAH = 20,
13955 + .tENV_min = 20, .tSR = 30, .tRFS = 70, .tRP = 125,
13956 + .tACK = 20, .tSS = 50, .tDZFS = 63
13959 + .t2CYC = 117, .tCYC = 55, .tDS = 7, .tDH = 5, .tDVS = 34,
13960 + .tDVH = 6, .tCVS = 34, .tCVH = 6, .tFS_min = 0,
13961 + .tLI_max = 100, .tMLI = 20, .tAZ = 10, .tZAH = 20,
13962 + .tENV_min = 20, .tSR = 20, .tRFS = 60, .tRP = 100,
13963 + .tACK = 20, .tSS = 50, .tDZFS = 47
13966 + .t2CYC = 86, .tCYC = 39, .tDS = 7, .tDH = 5, .tDVS = 20,
13967 + .tDVH = 6, .tCVS = 20, .tCVH = 6, .tFS_min = 0,
13968 + .tLI_max = 100, .tMLI = 20, .tAZ = 10, .tZAH = 20,
13969 + .tENV_min = 20, .tSR = 20, .tRFS = 60, .tRP = 100,
13970 + .tACK = 20, .tSS = 50, .tDZFS = 35
13973 + .t2CYC = 57, .tCYC = 25, .tDS = 5, .tDH = 5, .tDVS = 7,
13974 + .tDVH = 6, .tCVS = 7, .tCVH = 6, .tFS_min = 0,
13975 + .tLI_max = 100, .tMLI = 20, .tAZ = 10, .tZAH = 20,
13976 + .tENV_min = 20, .tSR = 50, .tRFS = 60, .tRP = 100,
13977 + .tACK = 20, .tSS = 50, .tDZFS = 25
13980 + .t2CYC = 38, .tCYC = 17, .tDS = 4, .tDH = 5, .tDVS = 5,
13981 + .tDVH = 6, .tCVS = 10, .tCVH = 10, .tFS_min = 0,
13982 + .tLI_max = 75, .tMLI = 20, .tAZ = 10, .tZAH = 20,
13983 + .tENV_min = 20, .tSR = 20, .tRFS = 50, .tRP = 85,
13984 + .tACK = 20, .tSS = 50, .tDZFS = 40
13988 +#define NR_UDMA_SPECS (sizeof udma_specs / sizeof udma_specs[0])
13990 +struct fsl_ata_time_regs {
13991 + u8 time_off, time_on, time_1, time_2w;
13992 + u8 time_2r, time_ax, time_pio_rdx, time_4;
13993 + u8 time_9, time_m, time_jn, time_d;
13994 + u8 time_k, time_ack, time_env, time_rpx;
13995 + u8 time_zah, time_mlix, time_dvh, time_dzfs;
13996 + u8 time_dvs, time_cvh, time_ss, time_cyc;
13999 +static void update_timing_config(struct fsl_ata_time_regs *tp, struct ata_host *host)
14001 + u32 *lp = (u32 *)tp;
14002 + struct pata_fsl_priv *priv = host->private_data;
14003 + u32 *ctlp = (u32 *)priv->fsl_ata_regs;
14007 + * JKM - this could have endianess issues on BE depending
14008 + * on how the controller is glued to the bus -- probably
14009 + * should rewrite this to write byte at a time.
14011 + for (i = 0; i < 5; i++) {
14012 + __raw_writel(*lp, ctlp);
14020 + * Calculate values for the ATA bus timing registers and store
14021 + * them into the hardware.
14023 + * @param xfer_mode specifies XFER xfer_mode
14024 + * @param pdev specifies platform_device
14026 + * @return EINVAL speed out of range, or illegal mode
14028 +static int set_ata_bus_timing(u8 xfer_mode, struct platform_device *pdev)
14030 + struct fsl_ata_platform_data *plat = (struct fsl_ata_platform_data *)
14031 + pdev->dev.platform_data;
14032 + struct ata_host *host = dev_get_drvdata(&pdev->dev);
14034 + /* get the bus clock cycle time, in ns */
14035 + int T = 1 * 1000 * 1000 * 1000 / plat->get_clk_rate();
14036 + struct fsl_ata_time_regs tr = {0};
14037 + DPRINTK("clk_rate = %d T = %d\n",plat->get_clk_rate(), T);
14040 + * every mode gets the same t_off and t_on
14045 + if (xfer_mode >= XFER_UDMA_0) {
14046 + int speed = xfer_mode - XFER_UDMA_0;
14047 + if (speed >= NR_UDMA_SPECS) {
14050 + tr.time_ack = (udma_specs[speed].tACK + T) / T;
14051 + tr.time_env = (udma_specs[speed].tENV_min + T) / T;
14052 + tr.time_rpx = (udma_specs[speed].tRP + T) / T + 2;
14054 + tr.time_zah = (udma_specs[speed].tZAH + T) / T;
14055 + tr.time_mlix = (udma_specs[speed].tMLI + T) / T;
14056 + tr.time_dvh = (udma_specs[speed].tDVH + T) / T + 1;
14057 + tr.time_dzfs = (udma_specs[speed].tDZFS + T) / T;
14059 + tr.time_dvs = (udma_specs[speed].tDVS + T) / T;
14060 + tr.time_cvh = (udma_specs[speed].tCVH + T) / T;
14061 + tr.time_ss = (udma_specs[speed].tSS + T) / T;
14062 + tr.time_cyc = (udma_specs[speed].tCYC + T) / T;
14063 + } else if (xfer_mode >= XFER_MW_DMA_0) {
14064 + int speed = xfer_mode - XFER_MW_DMA_0;
14065 + if (speed >= NR_MDMA_SPECS) {
14068 + tr.time_m = (mdma_specs[speed].tM + T) / T;
14069 + tr.time_jn = (mdma_specs[speed].tJNH + T) / T;
14070 + tr.time_d = (mdma_specs[speed].tD + T) / T;
14072 + tr.time_k = (mdma_specs[speed].tKW + T) / T;
14074 + int speed = xfer_mode - XFER_PIO_0;
14075 + if (speed >= NR_PIO_SPECS) {
14078 + tr.time_1 = (pio_specs[speed].t1 + T) / T;
14079 + tr.time_2w = (pio_specs[speed].t2_8 + T) / T;
14081 + tr.time_2r = (pio_specs[speed].t2_8 + T) / T;
14082 + tr.time_ax = (pio_specs[speed].tA + T) / T + 2;
14083 + tr.time_pio_rdx = 1;
14084 + tr.time_4 = (pio_specs[speed].t4 + T) / T;
14086 + tr.time_9 = (pio_specs[speed].t9 + T) / T;
14089 + update_timing_config(&tr, host);
14094 +static void pata_fsl_set_piomode(struct ata_port *ap, struct ata_device *adev)
14096 + set_ata_bus_timing(adev->pio_mode, to_platform_device(ap->dev));
14099 +#ifdef CONFIG_FSL_PATA_USE_DMA
14100 +static void pata_fsl_set_dmamode(struct ata_port *ap, struct ata_device *adev)
14102 + struct pata_fsl_priv *priv = ap->host->private_data;
14104 + priv->ultra = adev->dma_mode >= XFER_UDMA_0;
14106 + set_ata_bus_timing(adev->dma_mode, to_platform_device(ap->dev));
14110 +static int pata_fsl_port_start(struct ata_port *ap)
14115 +#ifdef CONFIG_FSL_PATA_USE_DMA
14116 +static void dma_callback(void *arg, int error_status, unsigned int count)
14118 + struct ata_port *ap = arg;
14119 + struct pata_fsl_priv *priv = ap->host->private_data;
14120 + u8 *ata_regs = priv->fsl_ata_regs;
14122 + priv->dma_done = 1;
14124 + * DMA is finished, so unmask INTRQ from the drive to allow the
14125 + * normal ISR to fire.
14128 + __raw_writel(FSL_ATA_INTR_ATA_INTRQ2, ata_regs + FSL_ATA_INT_EN);
14130 + WRITE_ATA8(FSL_ATA_INTR_ATA_INTRQ2, FSL_ATA_INT_EN);
14135 +static void pata_fsl_bmdma_setup(struct ata_queued_cmd *qc)
14139 + int dma_mode = 0, dma_ultra;
14141 + struct ata_port *ap = qc->ap;
14142 + struct pata_fsl_priv *priv = ap->host->private_data;
14143 + u8 *ata_regs = priv->fsl_ata_regs;
14144 + struct fsl_ata_platform_data *plat = ap->dev->platform_data;
14145 + struct scatterlist tmp[plat->max_sg], *tsg, *sg;
14148 + DPRINTK("ENTER\n");
14150 + priv->dma_dir = qc->dma_dir;
14153 + * Configure the on-chip ATA interface hardware.
14155 + dma_ultra = priv->ultra ?
14156 + FSL_ATA_CTRL_DMA_ULTRA : 0;
14158 + ata_control = FSL_ATA_CTRL_FIFO_RST_B |
14159 + FSL_ATA_CTRL_ATA_RST_B |
14160 + FSL_ATA_CTRL_DMA_PENDING |
14163 + if (qc->dma_dir == DMA_TO_DEVICE) {
14164 + chan = priv->dma_wchan;
14165 + ata_control |= FSL_ATA_CTRL_FIFO_TX_EN |
14166 + FSL_ATA_CTRL_DMA_WRITE;
14167 + dma_mode = DMA_MODE_WRITE;
14169 + chan = priv->dma_rchan;
14170 + ata_control |= FSL_ATA_CTRL_FIFO_RCV_EN;
14171 + dma_mode = DMA_MODE_READ;
14174 + __raw_writel(ata_control, ata_regs + FSL_ATA_CONTROL);
14175 + __raw_writel(plat->fifo_alarm, ata_regs + FSL_ATA_FIFO_ALARM);
14176 + __raw_writel(FSL_ATA_INTR_ATA_INTRQ1, ata_regs + FSL_ATA_INT_EN);
14178 + WRITE_ATA8(ata_control, FSL_ATA_CONTROL);
14179 + WRITE_ATA8(plat->fifo_alarm, FSL_ATA_FIFO_ALARM);
14180 + WRITE_ATA8(FSL_ATA_INTR_ATA_INTRQ1, FSL_ATA_INT_EN);
14185 + * Set up the DMA completion callback.
14187 + mxc_dma_callback_set(chan, dma_callback, (void *)ap);
14190 + * Copy the sg list to an array.
14193 + ata_for_each_sg(sg, qc) {
14194 + memcpy(tsg, sg, sizeof *sg);
14199 + err = mxc_dma_sg_config(chan, tmp, nr_sg, 0, dma_mode);
14201 + printk(KERN_ERR "pata_fsl_bmdma_setup: error %d\n", err);
14203 + DPRINTK("EXIT\n");
14206 +static void pata_fsl_bmdma_start(struct ata_queued_cmd *qc)
14208 + struct ata_port *ap = qc->ap;
14209 + struct pata_fsl_priv *priv = ap->host->private_data;
14214 + * Start the channel.
14216 + chan = qc->dma_dir == DMA_TO_DEVICE ? priv->dma_wchan : priv->dma_rchan;
14218 + priv->dma_done = 0;
14220 + err = mxc_dma_enable(chan);
14222 + printk(KERN_ERR "%s: : error %d\n", __func__, err);
14225 + ap->ops->exec_command(ap, &qc->tf);
14228 +static void pata_fsl_bmdma_stop(struct ata_queued_cmd *qc)
14230 + struct ata_port *ap = qc->ap;
14232 + /* do a dummy read as in ata_bmdma_stop */
14233 + ata_altstatus(ap);
14236 +static u8 pata_fsl_bmdma_status(struct ata_port *ap)
14238 + struct pata_fsl_priv *priv = ap->host->private_data;
14240 + return priv->dma_done ? ATA_DMA_INTR : 0;
14243 +static void pata_fsl_dma_init(struct ata_port *ap)
14245 + struct pata_fsl_priv *priv = ap->host->private_data;
14247 + priv->dma_rchan = -1;
14248 + priv->dma_wchan = -1;
14250 + priv->dma_rchan = mxc_dma_request(MXC_DMA_ATA_RX, "MXC ATA RX");
14251 + if (priv->dma_rchan < 0) {
14252 + dev_printk(KERN_ERR, ap->dev, "couldn't get RX DMA channel\n");
14256 + priv->dma_wchan = mxc_dma_request(MXC_DMA_ATA_TX, "MXC ATA TX");
14257 + if (priv->dma_wchan < 0) {
14258 + dev_printk(KERN_ERR, ap->dev, "couldn't get TX DMA channel\n");
14262 + dev_printk(KERN_ERR, ap->dev, "rchan=%d wchan=%d\n", priv->dma_rchan,
14263 + priv->dma_wchan);
14267 + ap->mwdma_mask = 0;
14268 + ap->udma_mask = 0;
14269 + mxc_dma_free(priv->dma_rchan);
14270 + mxc_dma_free(priv->dma_wchan);
14273 +#endif /* CONFIG_FSL_PATA_USE_DMA */
14275 +static void ata_dummy_noret(struct ata_port *ap) { return; }
14277 +static struct scsi_host_template pata_fsl_sht = {
14278 + .module = THIS_MODULE,
14279 + .name = DRV_NAME,
14280 + .ioctl = ata_scsi_ioctl,
14281 + .queuecommand = ata_scsi_queuecmd,
14282 + .can_queue = ATA_DEF_QUEUE,
14283 + .this_id = ATA_SHT_THIS_ID,
14284 + .sg_tablesize = LIBATA_MAX_PRD,
14285 + .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
14286 + .emulated = ATA_SHT_EMULATED,
14287 + .use_clustering = ATA_SHT_USE_CLUSTERING,
14288 + .proc_name = DRV_NAME,
14289 +#ifdef CONFIG_FSL_PATA_USE_DMA
14290 + .dma_boundary = FSL_ATA_MAX_SG_LEN,
14292 + .slave_configure = ata_scsi_slave_config,
14293 + .slave_destroy = ata_scsi_slave_destroy,
14294 + .bios_param = ata_std_bios_param,
14297 +static struct ata_port_operations pata_fsl_port_ops = {
14298 + .set_piomode = pata_fsl_set_piomode,
14299 +#ifdef CONFIG_FSL_PATA_USE_DMA
14300 + .set_dmamode = pata_fsl_set_dmamode,
14303 + .tf_load = ata_tf_load,
14304 + .tf_read = ata_tf_read,
14305 + .check_status = ata_check_status,
14306 + .exec_command = ata_exec_command,
14307 + .dev_select = ata_std_dev_select,
14309 + .freeze = ata_bmdma_freeze,
14310 + .thaw = ata_bmdma_thaw,
14311 + .error_handler = ata_bmdma_error_handler,
14312 + .post_internal_cmd = ata_bmdma_post_internal_cmd,
14313 + .cable_detect = ata_cable_unknown,
14315 +#ifdef CONFIG_FSL_PATA_USE_DMA
14316 + .bmdma_setup = pata_fsl_bmdma_setup,
14317 + .bmdma_start = pata_fsl_bmdma_start,
14320 + .qc_prep = ata_noop_qc_prep,
14321 + .qc_issue = ata_qc_issue_prot,
14323 + .data_xfer = ata_data_xfer_noirq,
14325 + .irq_clear = ata_dummy_noret,
14326 + .irq_on = ata_irq_on,
14328 + .port_start = pata_fsl_port_start,
14330 +#ifdef CONFIG_FSL_PATA_USE_DMA
14331 + .bmdma_stop = pata_fsl_bmdma_stop,
14332 + .bmdma_status = pata_fsl_bmdma_status,
14336 +static void fsl_setup_port(struct ata_ioports *ioaddr)
14338 + unsigned int shift = 2;
14340 + ioaddr->data_addr = ioaddr->cmd_addr + (ATA_REG_DATA << shift);
14341 + ioaddr->error_addr = ioaddr->cmd_addr + (ATA_REG_ERR << shift);
14342 + ioaddr->feature_addr = ioaddr->cmd_addr + (ATA_REG_FEATURE << shift);
14343 + ioaddr->nsect_addr = ioaddr->cmd_addr + (ATA_REG_NSECT << shift);
14344 + ioaddr->lbal_addr = ioaddr->cmd_addr + (ATA_REG_LBAL << shift);
14345 + ioaddr->lbam_addr = ioaddr->cmd_addr + (ATA_REG_LBAM << shift);
14346 + ioaddr->lbah_addr = ioaddr->cmd_addr + (ATA_REG_LBAH << shift);
14347 + ioaddr->device_addr = ioaddr->cmd_addr + (ATA_REG_DEVICE << shift);
14348 + ioaddr->status_addr = ioaddr->cmd_addr + (ATA_REG_STATUS << shift);
14349 + ioaddr->command_addr = ioaddr->cmd_addr + (ATA_REG_CMD << shift);
14353 + * pata_fsl_probe - attach a platform interface
14354 + * @pdev: platform device
14356 + * Register a platform bus integrated ATA host controller
14358 + * The 3 platform device resources are used as follows:
14360 + * - I/O Base (IORESOURCE_MEM) virt. addr. of ATA controller regs
14361 + * - CTL Base (IORESOURCE_MEM) unused
14362 + * - IRQ (IORESOURCE_IRQ) platform IRQ assigned to ATA
14365 +static int __devinit pata_fsl_probe(struct platform_device *pdev)
14367 + struct resource *io_res;
14368 + struct ata_host *host;
14369 + struct ata_port *ap;
14370 + struct fsl_ata_platform_data *plat = (struct fsl_ata_platform_data *)
14371 + pdev->dev.platform_data;
14372 + struct pata_fsl_priv *priv;
14376 + DPRINTK("ENTER\n");
14378 + * Get an ata_host structure for this device
14380 + host = ata_host_alloc(&pdev->dev, 1);
14383 + ap = host->ports[0];
14386 + * Allocate private data
14388 + priv = kzalloc(sizeof (struct pata_fsl_priv), GFP_KERNEL);
14389 + if(priv == NULL) {
14390 + /* free(host); */
14393 + host->private_data = priv;
14396 + * Set up resources
14398 + if (unlikely(pdev->num_resources != 3)) {
14399 + dev_err(&pdev->dev, "invalid number of resources\n");
14403 + io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
14404 + ata_regs = (u8 *)io_res->start;
14405 + priv->fsl_ata_regs = ata_regs;
14406 + ap->ioaddr.cmd_addr = (void *)(ata_regs + FSL_ATA_DRIVE_DATA);
14407 + ap->ioaddr.ctl_addr = (void *)(ata_regs + FSL_ATA_DRIVE_CONTROL);
14408 + ap->ioaddr.altstatus_addr = ap->ioaddr.ctl_addr;
14409 + ap->ops = &pata_fsl_port_ops;
14410 + ap->pio_mask = 0x7F;
14411 +#ifdef CONFIG_FSL_PATA_USE_DMA
14412 + ap->mwdma_mask = 0x7F;
14413 + ap->udma_mask = plat->udma_mask;
14414 + pata_fsl_sht.sg_tablesize = plat->max_sg;
14416 + ap->mwdma_mask = 0x00;
14417 + ap->udma_mask = 0x00;
14419 + fsl_setup_port(&ap->ioaddr);
14422 + * Do platform-specific initialization (e.g. allocate pins,
14423 + * turn on clock). After this call it is assumed that
14424 + * plat->get_clk_rate() can be called to calculate
14427 + if (plat->init && plat->init(pdev)) {
14428 + /* REVISIT: don't leak what ata_host_alloc() allocated */
14432 + /* Deassert the reset bit to enable the interface */
14433 + WRITE_ATA8(FSL_ATA_CTRL_ATA_RST_B, FSL_ATA_CONTROL);
14436 + /* Set initial timing and mode */
14437 + set_ata_bus_timing(XFER_PIO_4, pdev);
14439 +#ifdef CONFIG_FSL_PATA_USE_DMA
14440 + /* get DMA ready */
14441 + pata_fsl_dma_init(ap);
14445 + * Enable the ATA INTRQ interrupt from the bus, but
14446 + * only allow the CPU to see it (INTRQ2) at this point.
14447 + * INTRQ1, which goes to the DMA, will be enabled later.
14450 + __raw_writel(FSL_ATA_INTR_ATA_INTRQ2, ata_regs + FSL_ATA_INT_EN);
14452 + WRITE_ATA8(FSL_ATA_INTR_ATA_INTRQ2, FSL_ATA_INT_EN);
14457 + ret = ata_host_activate(host, platform_get_irq(pdev, 0), ata_interrupt,
14458 + 0, &pata_fsl_sht);
14459 + DPRINTK("EXIT ret=%d\n", ret);
14464 + * pata_fsl_remove - unplug a platform interface
14465 + * @pdev: platform device
14467 + * A platform bus ATA device has been unplugged. Perform the needed
14468 + * cleanup. Also called on module unload for any active devices.
14470 +static int __devexit pata_fsl_remove(struct platform_device *pdev)
14472 + struct device *dev = &pdev->dev;
14473 + struct ata_host *host = dev_get_drvdata(dev);
14474 + struct pata_fsl_priv *priv = host->private_data;
14475 + struct fsl_ata_platform_data *plat = (struct fsl_ata_platform_data *)
14476 + pdev->dev.platform_data;
14477 + u8 *ata_regs = priv->fsl_ata_regs;
14480 + __raw_writel(0, ata_regs + FSL_ATA_INT_EN); /* Disable interrupts */
14482 + WRITE_ATA8(0, FSL_ATA_INT_EN); /* Disable interrupts */
14486 + ata_host_detach(host);
14497 +static int pata_fsl_suspend(struct platform_device *pdev, pm_message_t state)
14499 + struct ata_host *host = dev_get_drvdata(&pdev->dev);
14500 + struct pata_fsl_priv *priv = host->private_data;
14501 + struct fsl_ata_platform_data *plat = (struct fsl_ata_platform_data *)
14502 + pdev->dev.platform_data;
14503 + u8 *ata_regs = priv->fsl_ata_regs;
14505 + /* Disable interrupts. */
14507 + __raw_writel(0, ata_regs + FSL_ATA_INT_EN);
14509 + WRITE_ATA8(0, FSL_ATA_INT_EN);
14519 +static int pata_fsl_resume(struct platform_device *pdev)
14521 + struct ata_host *host = dev_get_drvdata(&pdev->dev);
14522 + struct pata_fsl_priv *priv = host->private_data;
14523 + struct fsl_ata_platform_data *plat = (struct fsl_ata_platform_data *)
14524 + pdev->dev.platform_data;
14525 + u8 *ata_regs = priv->fsl_ata_regs;
14527 + if (plat->init && plat->init(pdev)) {
14531 + /* Deassert the reset bit to enable the interface */
14533 + __raw_writel(FSL_ATA_CTRL_ATA_RST_B, ata_regs + FSL_ATA_CONTROL);
14535 + WRITE_ATA8(FSL_ATA_CTRL_ATA_RST_B, FSL_ATA_CONTROL);
14539 + /* Set initial timing and mode */
14540 + set_ata_bus_timing(XFER_PIO_4, pdev);
14543 + * Enable hardware interrupts.
14546 + __raw_writel(FSL_ATA_INTR_ATA_INTRQ2, ata_regs + FSL_ATA_INT_EN);
14548 + WRITE_ATA8(FSL_ATA_INTR_ATA_INTRQ2, FSL_ATA_INT_EN);
14556 +static struct platform_driver pata_fsl_driver = {
14557 + .probe = pata_fsl_probe,
14558 + .remove = __devexit_p(pata_fsl_remove),
14560 + .suspend = pata_fsl_suspend,
14561 + .resume = pata_fsl_resume,
14564 + .name = DRV_NAME,
14565 + .owner = THIS_MODULE,
14569 +static int __init pata_fsl_init(void)
14573 + DPRINTK("ENTER\n");
14574 + ret = platform_driver_register(&pata_fsl_driver);
14575 + DPRINTK("EXIT ret=%d\n", ret);
14579 +static void __exit pata_fsl_exit(void)
14581 + platform_driver_unregister(&pata_fsl_driver);
14583 +module_init(pata_fsl_init);
14584 +module_exit(pata_fsl_exit);
14586 +MODULE_AUTHOR("Freescale Semiconductor, Inc.");
14587 +MODULE_DESCRIPTION("low-level driver for Freescale ATA");
14588 +MODULE_LICENSE("GPL");
14589 +MODULE_VERSION(DRV_VERSION);
14590 --- a/drivers/crypto/Kconfig
14591 +++ b/drivers/crypto/Kconfig
14592 @@ -60,6 +60,69 @@ config CRYPTO_DEV_GEODE
14593 To compile this driver as a module, choose M here: the module
14594 will be called geode-aes.
14596 +config CRYPTO_DEV_MCFCAU
14597 + bool "Support for Freescale Coldfire Cryptographic Acceleration Unit (CAU)"
14598 + depends on M5445X
14599 + select CRYPTO_ALGAPI
14601 + The cryptographic acceleration unit (CAU) is a ColdFire coprocessor
14602 + implementing a set of specialized operations in hardware. For example, you can
14603 + find it on MCF5445X.
14605 +config CRYPTO_DEV_MCFCAU_DES
14606 + tristate "DES and Triple DES cipher algorithms (MCF5445X)"
14607 + depends on CRYPTO_DEV_MCFCAU
14608 + select CRYPTO_ALGAPI
14609 + select CRYPTO_BLKCIPHER
14611 + DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
14613 + Say 'Y' here to use the CAU coprocessor for
14614 + the CryptoAPI DES and 3DES alogrithms.
14616 + To compile this driver as a module, choose M here: the module
14617 + will be called mcfcau-des.
14619 +config CRYPTO_DEV_MCFCAU_AES
14620 + tristate "AES cipher algorithm (MCF5445X)"
14621 + depends on CRYPTO_DEV_MCFCAU
14622 + select CRYPTO_ALGAPI
14623 + select CRYPTO_BLKCIPHER
14625 + AES cipher algorithm (FIPS 197).
14627 + Say 'Y' here to use the CAU coprocessor for
14628 + the CryptoAPI AES alogrithm.
14630 + To compile this driver as a module, choose M here: the module
14631 + will be called mcfcau-aes.
14633 +config CRYPTO_DEV_MCFCAU_MD5
14634 + tristate "MD5 digest algorithm (MCF5445X)"
14635 + depends on CRYPTO_DEV_MCFCAU
14636 + select CRYPTO_ALGAPI
14638 + MD5 message digest algorithm (RFC1321).
14640 + Say 'Y' here to use the CAU coprocessor for
14641 + the CryptoAPI MD5 alogrithm.
14643 + To compile this driver as a module, choose M here: the module
14644 + will be called mcfcau-md5.
14646 +config CRYPTO_DEV_MCFCAU_SHA1
14647 + tristate "SHA1 digest algorithm (MCF5445X)"
14648 + depends on CRYPTO_DEV_MCFCAU
14649 + select CRYPTO_ALGAPI
14651 + SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
14653 + Say 'Y' here to use the CAU coprocessor for
14654 + the CryptoAPI SHA1 alogrithm.
14656 + To compile this driver as a module, choose M here: the module
14657 + will be called mcfcau-sha1.
14660 tristate "Support for PCI-attached cryptographic adapters"
14662 --- a/drivers/crypto/Makefile
14663 +++ b/drivers/crypto/Makefile
14664 @@ -2,3 +2,8 @@ obj-$(CONFIG_CRYPTO_DEV_PADLOCK_AES) +=
14665 obj-$(CONFIG_CRYPTO_DEV_PADLOCK_SHA) += padlock-sha.o
14666 obj-$(CONFIG_CRYPTO_DEV_GEODE) += geode-aes.o
14667 obj-$(CONFIG_CRYPTO_DEV_HIFN_795X) += hifn_795x.o
14668 +obj-$(CONFIG_CRYPTO_DEV_MCFCAU) += mcfcau.o
14669 +obj-$(CONFIG_CRYPTO_DEV_MCFCAU_DES) += mcfcau-des.o
14670 +obj-$(CONFIG_CRYPTO_DEV_MCFCAU_AES) += mcfcau-aes.o
14671 +obj-$(CONFIG_CRYPTO_DEV_MCFCAU_MD5) += mcfcau-md5.o
14672 +obj-$(CONFIG_CRYPTO_DEV_MCFCAU_SHA1) += mcfcau-sha1.o
14674 +++ b/drivers/crypto/mcfcau-aes.c
14676 + /***************************************************************************
14677 + * mcfcau-aes.c - Implementation of AES Cipher Algorithm
14678 + * for Freescale ColdFire Cryptographic Acceleration Unit (CAU).
14680 + * Author: Andrey Butok
14681 + * Copyright Freescale Semiconductor Inc. 2007
14683 + * NOTE: You can find the ColdFire CAU module on MCF5445X and MCF52235.
14685 + * This program is free software; you can redistribute it and/or modify it
14686 + * under the terms of the GNU General Public License as published by the
14687 + * Free Software Foundation; either version 2 of the License, or (at your
14688 + * option) any later version.
14690 + * This program is distributed in the hope that it will be useful, but
14691 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14692 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14693 + * for more details.
14695 + * You should have received a copy of the GNU General Public License
14696 + * along with this program; if not, write to the Free Software Foundation,
14697 + * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
14699 + ***************************************************************************
14701 + * v0.01 17 September 2007 Andrey Butok
14702 + * Initial Release - developed on 2.6.20 Linux kernel.
14705 +#include <linux/module.h>
14706 +#include <linux/init.h>
14707 +#include <linux/types.h>
14708 +#include <linux/errno.h>
14709 +#include <linux/crypto.h>
14716 +#include "mcfcau.h"
14718 +#define MCFCAU_AES_MIN_KEY_SIZE (16)
14719 +#define MCFCAU_AES_MAX_KEY_SIZE (32)
14720 +#define MCFCAU_AES_BLOCK_SIZE (16)
14722 +#define MCFCAU_AES_DRIVER_DESC "AES ColdFire CAU driver"
14723 +#define MCFCAU_AES_DRIVER_VERSION "v0.01"
14725 +struct mcfcau_aes_ctx {
14731 +static u32 mcfcau_rco_tab[10]={ 0x01000000, 0x02000000, 0x04000000, 0x08000000,
14732 + 0x10000000, 0x20000000, 0x40000000, 0x80000000,
14733 + 0x1b000000, 0x36000000};
14735 +int mcfcau_aes_setkey(struct crypto_tfm *tfm, const u8 *in_key,
14736 + unsigned int key_len)
14738 + struct mcfcau_aes_ctx *ctx = crypto_tfm_ctx(tfm);
14739 + const u32 * key = (const u32 *)in_key;
14740 + u32 *flags = &tfm->crt_flags;
14742 + u32* key_sch = (&ctx->buf[0]);
14743 + u32 * temp_p, * rcon_p;
14746 + unsigned long iflags;
14750 + if (key_len % 8) {
14751 + *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
14757 + for(i=0;i<Nk;i++){
14758 + key_sch[i] = key[i];
14761 + ctx->Nr_1 = Nk+5;
14763 + /* Key Expansion */
14764 + temp_p=&key_sch[Nk-1];
14765 + rcon_p=&mcfcau_rco_tab[0];
14767 + spin_lock_irqsave(&mcfcau_lock, iflags);
14769 + asm volatile ("move.l %0, %%a1"::"m"(temp_p):"a1");
14770 + asm volatile ("move.l %0, %%a3"::"m"(rcon_p):"a3");
14771 + asm volatile ("move.l %0, %%a4"::"m"(key_sch):"a4");
14773 + Nx=(Nk+7)<<2; /* (Nr+1)*Nb */
14775 + for(i=Nk; i<Nx; i++)
14777 + /* temp = key_sch[Nk-1] */
14778 + asm volatile ("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CAA):"a1");
14781 + asm volatile ("moveq #8, %%d0":::"d0");
14782 + /* CAA=RotWord(temp) */
14783 + asm volatile ("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA):"d0");
14784 + /* SubWord(CAA) */
14785 + asm volatile ("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_AESS+MCFCAU_CAA));
14786 + /* ACC xor rcon[i/Nk] */
14787 + asm volatile ("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CAA):"a3");
14789 + }else if((Nk>6) && (i%Nk ==4)){
14790 + /* SubWord(ACC) */
14791 + asm volatile ("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_AESS+MCFCAU_CAA));
14794 + /* key_sch[i]^=key_sch[i-Nk]; store ACC to key_sch[i] */
14795 + asm volatile ("cp0ld.l (%%a4)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CAA):"a4");
14796 + asm volatile ("cp0st.l %%d0,(%%a1),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CAA));
14798 + spin_unlock_irqrestore(&mcfcau_lock, iflags);
14804 +/* encrypt a block of text */
14805 +static void mcfcau_aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
14807 + struct mcfcau_aes_ctx *ctx = crypto_tfm_ctx(tfm);
14808 + const int Nr_1 = ctx->Nr_1;
14810 + u32* key_sch = &(ctx->buf[0]);
14812 + unsigned long iflags;
14816 + spin_lock_irqsave(&mcfcau_lock, iflags);
14817 + asm("move.l %0, %%a1"::"m"(in):"a1");
14818 + asm("move.l %0, %%a0"::"m"(key_sch):"a0");
14820 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
14821 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1):"a1");
14822 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA2):"a1");
14823 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA3):"a1");
14824 + /* AddRoundKey() */
14825 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA0):"a0");
14826 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA1):"a0");
14827 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA2):"a0");
14828 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA3):"a0");
14830 + for(i=Nr_1;i>0;i--){
14831 + /* SubBytes(state) */
14832 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESS+MCFCAU_CA0));
14833 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESS+MCFCAU_CA1));
14834 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESS+MCFCAU_CA2));
14835 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESS+MCFCAU_CA3));
14836 + /* ShiftRows(state) */
14837 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESR));
14838 + /* MixColumns(state); AddRoundKey() */
14839 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_AESC+MCFCAU_CA0):"a0");
14840 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_AESC+MCFCAU_CA1):"a0");
14841 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_AESC+MCFCAU_CA2):"a0");
14842 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_AESC+MCFCAU_CA3):"a0");
14844 + /* SubBytes(state)*/
14845 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESS+MCFCAU_CA0));
14846 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESS+MCFCAU_CA1));
14847 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESS+MCFCAU_CA2));
14848 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESS+MCFCAU_CA3));
14849 + /* ShiftRows(state) */
14850 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESR));
14851 + /* AddRoundKey() */
14852 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA0):"a0");
14853 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA1):"a0");
14854 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA2):"a0");
14855 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA3):"a0");
14856 + /* out = state */
14857 + asm("move.l %0, %%a1" ::"m"(out):"a1");
14858 + asm("cp0st.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA0):"d0");
14859 + asm("cp0st.l %%d0,%%d1,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA1):"d1");
14861 + asm("move.l %%d0,(%%a1)+":::"a1");
14862 + asm("move.l %%d1,(%%a1)+":::"a1");
14864 + asm("cp0st.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA2):"d0");
14865 + asm("cp0st.l %%d0,%%d1,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA3):"d1");
14867 + asm("move.l %%d0,(%%a1)+":::"a1");
14868 + asm("move.l %%d1,(%%a1)+":::"a1");
14869 + spin_unlock_irqrestore(&mcfcau_lock, iflags);
14873 +/* decrypt a block of text */
14874 +static void mcfcau_aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
14876 + struct mcfcau_aes_ctx *ctx = crypto_tfm_ctx(tfm);
14877 + u32* key_sch = &(ctx->buf[0]);
14879 + unsigned long iflags;
14880 + const int Nr_1 = ctx->Nr_1;
14881 + key_sch=&key_sch[(Nr_1+2)*4];
14885 + spin_lock_irqsave(&mcfcau_lock, iflags);
14887 + asm("move.l %0, %%a1"::"m"(in):"a1");
14888 + asm("move.l %0, %%a0"::"m"(key_sch):"a0");
14890 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
14891 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1):"a1");
14892 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA2):"a1");
14893 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA3):"a1");
14894 + /* AddRoundKey() */
14895 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA3):"a0");
14896 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA2):"a0");
14897 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA1):"a0");
14898 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA0):"a0");
14900 + for(i=Nr_1;i>0;i--){
14901 + /* InvShiftRows(state) */
14902 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIR));
14903 + /* InvSubBytes(state) */
14904 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIS+MCFCAU_CA3));
14905 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIS+MCFCAU_CA2));
14906 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIS+MCFCAU_CA1));
14907 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIS+MCFCAU_CA0));
14908 + /* InvMixColumns(state); AddRoundKey() */
14909 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_AESIC+MCFCAU_CA3):"a0");
14910 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_AESIC+MCFCAU_CA2):"a0");
14911 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_AESIC+MCFCAU_CA1):"a0");
14912 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_AESIC+MCFCAU_CA0):"a0");
14914 + /* InvShiftRows(state) */
14915 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIR));
14916 + /* InvSubBytes(state)*/
14917 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIS+MCFCAU_CA3));
14918 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIS+MCFCAU_CA2));
14919 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIS+MCFCAU_CA1));
14920 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_AESIS+MCFCAU_CA0));
14921 + /* AddRoundKey() */
14922 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA3):"a0");
14923 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA2):"a0");
14924 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA1):"a0");
14925 + asm("cp0ld.l -(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA0):"a0");
14926 + /* out = state */
14927 + asm("move.l %0, %%a1" ::"m"(out):"a1");
14928 + asm("cp0st.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA0):"d0");
14929 + asm("cp0st.l %%d0,%%d1,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA1):"d1");
14931 + asm("move.l %%d0,(%%a1)+":::"a1");
14932 + asm("move.l %%d1,(%%a1)+":::"a1");
14934 + asm("cp0st.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA2):"d0");
14935 + asm("cp0st.l %%d0,%%d1,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA3):"d1");
14937 + asm("move.l %%d0,(%%a1)+":::"a1");
14938 + asm("move.l %%d1,(%%a1)+":::"a1");
14939 + spin_unlock_irqrestore(&mcfcau_lock, iflags);
14944 +static struct crypto_alg mcfcau_aes_alg = {
14945 + .cra_name = "aes",
14946 + .cra_driver_name = "aes-mcfcau",
14947 + .cra_priority = MCFCAU_CRA_PRIORITY,
14948 + .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
14949 + .cra_blocksize = MCFCAU_AES_BLOCK_SIZE,
14950 + .cra_ctxsize = sizeof(struct mcfcau_aes_ctx),
14951 + .cra_alignmask = 3,
14952 + .cra_module = THIS_MODULE,
14953 + .cra_list = LIST_HEAD_INIT(mcfcau_aes_alg.cra_list),
14956 + .cia_min_keysize = MCFCAU_AES_MIN_KEY_SIZE,
14957 + .cia_max_keysize = MCFCAU_AES_MAX_KEY_SIZE,
14958 + .cia_setkey = mcfcau_aes_setkey,
14959 + .cia_encrypt = mcfcau_aes_encrypt,
14960 + .cia_decrypt = mcfcau_aes_decrypt
14965 +static int __init mcfcau_aes_init(void)
14967 + int ret = crypto_register_alg(&mcfcau_aes_alg);
14969 + printk(KERN_INFO MCFCAU_AES_DRIVER_DESC " "
14970 + MCFCAU_AES_DRIVER_VERSION " %s.\n",ret?"failed":"registered");
14974 +static void __exit mcfcau_aes_fini(void)
14976 + crypto_unregister_alg(&mcfcau_aes_alg);
14977 + printk(KERN_INFO MCFCAU_AES_DRIVER_DESC " "
14978 + MCFCAU_AES_DRIVER_VERSION " unregistered.\n");
14981 +module_init(mcfcau_aes_init);
14982 +module_exit(mcfcau_aes_fini);
14984 +MODULE_DESCRIPTION(MCFCAU_AES_DRIVER_DESC);
14985 +MODULE_LICENSE("Dual BSD/GPL");
14986 +MODULE_AUTHOR("Andrey Butok");
14988 +++ b/drivers/crypto/mcfcau.c
14990 +/***************************************************************************
14991 + * mcfcau.c - Implementation of DES & Triple DES EDE Cipher Algorithms
14992 + * for Freescale ColdFire Cryptographic Acceleration Unit (CAU).
14994 + * Author: Andrey Butok
14995 + * Copyright Freescale Semiconductor Inc. 2007
14997 + * NOTE: You can find the ColdFire CAU module on MCF5445X and MCF52235.
14999 + * This program is free software; you can redistribute it and/or modify it
15000 + * under the terms of the GNU General Public License as published by the
15001 + * Free Software Foundation; either version 2 of the License, or (at your
15002 + * option) any later version.
15004 + * This program is distributed in the hope that it will be useful, but
15005 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15006 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15007 + * for more details.
15009 + * You should have received a copy of the GNU General Public License
15010 + * along with this program; if not, write to the Free Software Foundation,
15011 + * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15013 + ***************************************************************************
15015 + * v0.01 28 September 2006 Andrey Butok
15016 + * Initial Release - developed on 2.6.20 Linux kernel.
15018 +#include <linux/module.h>
15020 +DEFINE_SPINLOCK(mcfcau_lock);
15021 +EXPORT_SYMBOL(mcfcau_lock);
15023 +++ b/drivers/crypto/mcfcau-des.c
15025 +/***************************************************************************
15026 + * mcfcau-des.c - Implementation of DES & Triple DES EDE Cipher Algorithms
15027 + * for Freescale ColdFire Cryptographic Acceleration Unit (CAU).
15029 + * Author: Andrey Butok
15030 + * Copyright Freescale Semiconductor Inc. 2007
15032 + * NOTE: You can find the ColdFire CAU module on MCF5445X and MCF52235.
15034 + * This program is free software; you can redistribute it and/or modify it
15035 + * under the terms of the GNU General Public License as published by the
15036 + * Free Software Foundation; either version 2 of the License, or (at your
15037 + * option) any later version.
15039 + * This program is distributed in the hope that it will be useful, but
15040 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15041 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15042 + * for more details.
15044 + * You should have received a copy of the GNU General Public License
15045 + * along with this program; if not, write to the Free Software Foundation,
15046 + * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15048 + ***************************************************************************
15050 + * v0.01 14 August 2007 Andrey Butok
15051 + * Initial Release - developed on 2.6.20 Linux kernel.
15054 +#include <linux/init.h>
15055 +#include <linux/module.h>
15056 +#include <linux/errno.h>
15057 +#include <linux/crypto.h>
15058 +#include <linux/types.h>
15065 +#include "mcfcau.h"
15067 +#define MCFCAU_DES_KEY_SIZE (8)
15068 +#define MCFCAU_DES_EXPKEY_WORDS (32)
15069 +#define MCFCAU_DES_BLOCK_SIZE (8)
15071 +#define MCFCAU_DES3_EDE_KEY_SIZE (3 * MCFCAU_DES_KEY_SIZE)
15072 +#define MCFCAU_DES3_EDE_EXPKEY_WORDS (3 * MCFCAU_DES_EXPKEY_WORDS)
15073 +#define MCFCAU_DES3_EDE_BLOCK_SIZE (MCFCAU_DES_BLOCK_SIZE)
15075 +#define MCFCAU_DES_DRIVER_DESC "DES & 3DES ColdFire CAU driver"
15076 +#define MCFCAU_DES_DRIVER_VERSION "v0.01"
15078 +struct mcfcau_des_ctx {
15079 + u32 expkey[MCFCAU_DES_EXPKEY_WORDS];
15082 +struct mcfcau_des3_ede_ctx {
15083 + u32 expkey[MCFCAU_DES3_EDE_EXPKEY_WORDS];
15086 +/* DES round operations */
15087 +static inline void mcfcau_des_encipher(void)
15089 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESK));
15090 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_IP+MCFCAU_KSL1));
15091 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15092 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15093 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15094 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15095 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15096 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15097 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL1));
15098 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15099 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15100 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15101 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15102 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15103 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL2));
15104 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSL1));
15105 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_FP+MCFCAU_KSL1));
15108 +static inline void mcfcau_des_decipher(void)
15110 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESK+MCFCAU_DC));
15111 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_IP+MCFCAU_KSR1));
15112 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15113 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15114 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15115 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15116 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15117 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15118 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR1));
15119 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15120 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15121 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15122 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15123 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15124 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR2));
15125 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_KSR1));
15126 + asm("cp0ld.l %%d0,%%d0,#1,%0"::"n"(MCFCAU_DESR+MCFCAU_FP+MCFCAU_KSL1));
15130 +static int mcfcau_des_setkey(struct crypto_tfm *tfm, const u8 *key_p,
15131 + unsigned int keylen)
15133 + struct mcfcau_des_ctx *dctx = crypto_tfm_ctx(tfm);
15134 + u32 *flags = &tfm->crt_flags;
15135 + u32 * key = (u32 *) key_p;
15140 + * RFC2451: Weak key checks SHOULD be performed.
15143 + * Keys having duals are keys which produce all zeros, all ones, or
15144 + * alternating zero-one patterns in the C and D registers after Permuted
15145 + * Choice 1 has operated on the key.
15148 + if(*flags & CRYPTO_TFM_REQ_WEAK_KEY){ /* FIPS 74 */
15149 + if(key[0]<0xE001E00l){
15150 + if(key[0]<0x1FE01FE0){
15151 + if(key[0]<0x01E001E0){
15152 + if(((key[0]==0x01010101)&&(key[1]==0x01010101))||
15153 + ((key[0]==0x011F011F)&&(key[1]==0x010E010E)) )
15157 + if(((key[0]==0x01E001E0)&&(key[1]==0x01F101F1))||
15158 + ((key[0]==0x01FE01FE)&&(key[1]==0x01FE01FE)) )
15163 + if(key[0]<0x1F1F1F1F){
15164 + if(((key[0]==0x1FE01FE0)&&(key[1]==0x0EF10EF1))||
15165 + ((key[0]==0x1F011F0l)&&(key[1]==0x0E010E01)) )
15169 + if(((key[0]==0x1F1F1F1F)&&(key[1]==0x0E0E0E0E))||
15170 + ((key[0]==0x1FFE1FFE)&&(key[1]==0x0EFE0EFE)) )
15175 + if(key[0]<0xFE01FE01){
15176 + if(key[0]<0xE0E0E0E0){
15177 + if(((key[0]==0xE001E00l)&&(key[1]==0xF101F101))||
15178 + ((key[0]==0xE01FE01F)&&(key[1]==0xF10EF10E)) )
15182 + if(((key[0]==0xE0E0E0E0)&&(key[1]==0xF1F1F1F1))||
15183 + ((key[0]==0xE0FEE0FE)&&(key[1]==0xF1FEF1FE)) )
15188 + if(key[0]<0xFEE0FEE0){
15189 + if(((key[0]==0xFE01FE01)&&(key[1]==0xFE01FE01))||
15190 + ((key[0]==0xFE1FFE1F)&&(key[1]==0xFE0EFE0E)) )
15194 + if(((key[0]==0xFEE0FEE0)&&(key[1]==0xFEF1FEF1))||
15195 + ((key[0]==0xFEFEFEFE)&&(key[1]==0xFEFEFEFE)) )
15201 + memcpy(dctx->expkey, key_p, keylen);
15204 + *flags |= CRYPTO_TFM_RES_WEAK_KEY;
15209 +void mcfcau_des_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
15211 + struct mcfcau_des_ctx *ctx = crypto_tfm_ctx(tfm);
15212 + u32 * des_key_tmp = ctx->expkey;
15213 + unsigned long iflags;
15217 + spin_lock_irqsave(&mcfcau_lock, iflags);
15219 + asm("move.l %0, %%a0"::"m"(src):"a0");
15220 + asm("move.l %0, %%a1"::"m"(des_key_tmp):"a1");
15222 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA2):"a0");
15223 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA3));
15224 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
15225 + asm("cp0ld.l (%%a1),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1));
15227 + mcfcau_des_encipher();
15229 + asm("cp0st.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA2):"d0");
15230 + asm("cp0st.l %%d0,%%d1,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA3):"d1");
15231 + asm("move.l %0, %%a1" ::"m"(dst):"a1");
15232 + asm("move.l %d0,(%a1)+");
15233 + asm("move.l %d1,(%a1)");
15235 + spin_unlock_irqrestore(&mcfcau_lock, iflags);
15239 +void mcfcau_des_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
15241 + struct mcfcau_des_ctx *ctx = crypto_tfm_ctx(tfm);
15242 + u32 * des_key_tmp = ctx->expkey;
15243 + unsigned long iflags;
15247 + spin_lock_irqsave(&mcfcau_lock, iflags);
15249 + asm("move.l %0, %%a0"::"m"(src):"a0");
15250 + asm("move.l %0, %%a1"::"m"(des_key_tmp):"a1");
15252 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA2):"a0");
15253 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA3));
15254 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
15255 + asm("cp0ld.l (%%a1),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1));
15257 + mcfcau_des_decipher();
15259 + asm("move.l %0, %%a1" ::"m"(dst):"a1");
15260 + asm("cp0st.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA2):"d0");
15261 + asm("cp0st.l %%d0,%%d1,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA3):"d1");
15262 + asm("move.l %d0,(%a1)+");
15263 + asm("move.l %d1,(%a1)");
15265 + spin_unlock_irqrestore(&mcfcau_lock, iflags);
15272 + * For DES-EDE3, there is no known need to reject weak or
15273 + * complementation keys. Any weakness is obviated by the use of
15276 + * However, if the first two or last two independent 64-bit keys are
15277 + * equal (k1 == k2 or k2 == k3), then the DES3 operation is simply the
15278 + * same as DES. Implementers MUST reject keys that exhibit this
15283 +static int mcfcau_des3_ede_setkey(struct crypto_tfm *tfm, const u8 *key_p, unsigned int keylen)
15285 + const u32 *key = (const u32 *)key_p;
15286 + struct mcfcau_des3_ede_ctx *dctx = crypto_tfm_ctx(tfm);
15287 + u32 *flags = &tfm->crt_flags;
15291 + if (unlikely(!((key[0] ^ key[2]) | (key[1] ^ key[3])) ||
15292 + !((key[2] ^ key[4]) | (key[3] ^ key[5]))))
15294 + *flags |= CRYPTO_TFM_RES_BAD_KEY_SCHED;
15298 + memcpy(dctx->expkey,key_p,keylen);
15303 +static void mcfcau_des3_ede_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
15305 + struct mcfcau_des3_ede_ctx *dctx = crypto_tfm_ctx(tfm);
15306 + const u32 * des_key_tmp = dctx->expkey;
15307 + unsigned long iflags;
15311 + spin_lock_irqsave(&mcfcau_lock, iflags);
15314 + asm("move.l %0, %%a0"::"m"(src):"a0");
15315 + asm("move.l %0, %%a1"::"m"(des_key_tmp):"a1");
15317 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA2):"a0");
15318 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA3));
15319 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
15320 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1):"a1");
15322 + mcfcau_des_encipher();
15325 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
15326 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1):"a1");
15328 + mcfcau_des_decipher();
15331 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
15332 + asm("cp0ld.l (%%a1),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1));
15334 + mcfcau_des_encipher();
15336 + asm("move.l %0, %%a1" ::"m"(dst):"a1");
15337 + asm("cp0st.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA2):"d0");
15338 + asm("cp0st.l %%d0,%%d1,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA3):"d1");
15339 + asm("move.l %d0,(%a1)+");
15340 + asm("move.l %d1,(%a1)");
15342 + spin_unlock_irqrestore(&mcfcau_lock, iflags);
15345 +static void mcfcau_des3_ede_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
15347 + struct mcfcau_des3_ede_ctx *dctx = crypto_tfm_ctx(tfm);
15348 + const u32 * des_key_tmp = dctx->expkey + 6 - 2;
15349 + unsigned long iflags;
15353 + spin_lock_irqsave(&mcfcau_lock, iflags);
15356 + asm("move.l %0, %%a0"::"m"(src):"a0");
15357 + asm("move.l %0, %%a1"::"m"(des_key_tmp):"a1");
15359 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA2):"a0");
15360 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA3));
15361 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
15362 + asm("cp0ld.l (%%a1),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1));
15364 + mcfcau_des_decipher();
15367 + asm("suba.l #12,%a1"); /*dec key pointer*/
15369 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
15370 + asm("cp0ld.l (%%a1),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1));
15372 + mcfcau_des_encipher();
15375 + asm("suba.l #12,%a1"); /*dec key pointer*/
15377 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a1");
15378 + asm("cp0ld.l (%%a1),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1));
15380 + mcfcau_des_decipher();
15382 + asm("move.l %0, %%a1" ::"m"(dst):"a1");
15383 + asm("cp0st.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA2):"d0");
15384 + asm("cp0st.l %%d0,%%d1,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA3):"d1");
15385 + asm("move.l %d0,(%a1)+");
15386 + asm("move.l %d1,(%a1)");
15388 + spin_unlock_irqrestore(&mcfcau_lock, iflags);
15392 +static struct crypto_alg mcfcau_des_alg = {
15393 + .cra_name = "des",
15394 + .cra_driver_name = "des-mcfcau",
15395 + .cra_priority = MCFCAU_CRA_PRIORITY,
15396 + .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
15397 + .cra_blocksize = MCFCAU_DES_BLOCK_SIZE,
15398 + .cra_ctxsize = sizeof(struct mcfcau_des_ctx),
15399 + .cra_module = THIS_MODULE,
15400 + .cra_alignmask = 3,
15401 + .cra_list = LIST_HEAD_INIT(mcfcau_des_alg.cra_list),
15402 + .cra_u = { .cipher = {
15403 + .cia_min_keysize = MCFCAU_DES_KEY_SIZE,
15404 + .cia_max_keysize = MCFCAU_DES_KEY_SIZE,
15405 + .cia_setkey = mcfcau_des_setkey,
15406 + .cia_encrypt = mcfcau_des_encrypt,
15407 + .cia_decrypt = mcfcau_des_decrypt } }
15410 +static struct crypto_alg mcfcau_des3_ede_alg = {
15411 + .cra_name = "des3_ede",
15412 + .cra_driver_name = "des3_ede-mcfcau",
15413 + .cra_priority = MCFCAU_CRA_PRIORITY,
15414 + .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
15415 + .cra_blocksize = MCFCAU_DES3_EDE_BLOCK_SIZE,
15416 + .cra_ctxsize = sizeof(struct mcfcau_des3_ede_ctx),
15417 + .cra_module = THIS_MODULE,
15418 + .cra_alignmask = 3,
15419 + .cra_list = LIST_HEAD_INIT(mcfcau_des3_ede_alg.cra_list),
15420 + .cra_u = { .cipher = {
15421 + .cia_min_keysize = MCFCAU_DES3_EDE_KEY_SIZE,
15422 + .cia_max_keysize = MCFCAU_DES3_EDE_KEY_SIZE,
15423 + .cia_setkey = mcfcau_des3_ede_setkey,
15424 + .cia_encrypt = mcfcau_des3_ede_encrypt,
15425 + .cia_decrypt = mcfcau_des3_ede_decrypt } }
15428 +MODULE_ALIAS("mcfcau_des3_ede");
15430 +static int __init mcfcau_des_init(void)
15434 + ret = crypto_register_alg(&mcfcau_des_alg);
15438 + ret = crypto_register_alg(&mcfcau_des3_ede_alg);
15440 + crypto_unregister_alg(&mcfcau_des_alg);
15442 + printk(KERN_INFO MCFCAU_DES_DRIVER_DESC " "
15443 + MCFCAU_DES_DRIVER_VERSION " %s.\n",ret?"failed":"registered");
15447 +static void __exit mcfcau_des_exit(void)
15449 + crypto_unregister_alg(&mcfcau_des3_ede_alg);
15450 + crypto_unregister_alg(&mcfcau_des_alg);
15452 + printk(KERN_INFO MCFCAU_DES_DRIVER_DESC " "
15453 + MCFCAU_DES_DRIVER_VERSION " unregistered.\n");
15456 +module_init(mcfcau_des_init);
15457 +module_exit(mcfcau_des_exit);
15459 +MODULE_LICENSE("GPL");
15460 +MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms for ColdFire CAU");
15461 +MODULE_AUTHOR("Andrey Butok");
15463 +++ b/drivers/crypto/mcfcau.h
15465 +/***************************************************************************
15466 + * mcfcau.h - Common header file for Freescale ColdFire
15467 + * Cryptographic Acceleration Unit (CAU) drivers.
15469 + * Author: Andrey Butok
15470 + * Copyright Freescale Semiconductor Inc. 2007
15472 + * NOTE: You can find the ColdFire CAU module on MCF5445X and MCF52235.
15474 + * This program is free software; you can redistribute it and/or modify it
15475 + * under the terms of the GNU General Public License as published by the
15476 + * Free Software Foundation; either version 2 of the License, or (at your
15477 + * option) any later version.
15479 + * This program is distributed in the hope that it will be useful, but
15480 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15481 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15482 + * for more details.
15484 + * You should have received a copy of the GNU General Public License
15485 + * along with this program; if not, write to the Free Software Foundation,
15486 + * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15488 + ***************************************************************************
15490 + * v0.01 14 August 2007 Andrey Butok
15496 +#include <linux/spinlock.h>
15498 +/* CAU Registers (CAx) */
15499 +#define MCFCAU_CASR (0x0)
15500 +#define MCFCAU_CAA (0x1)
15501 +#define MCFCAU_CA0 (0x2)
15502 +#define MCFCAU_CA1 (0x3)
15503 +#define MCFCAU_CA2 (0x4)
15504 +#define MCFCAU_CA3 (0x5)
15505 +#define MCFCAU_CA4 (0x6)
15506 +#define MCFCAU_CA5 (0x7)
15508 + /* CAU Commands */
15509 +#define MCFCAU_CNOP (0x000)
15510 +#define MCFCAU_LDR (0x010)
15511 +#define MCFCAU_STR (0x020)
15512 +#define MCFCAU_ADR (0x030)
15513 +#define MCFCAU_RADR (0x040)
15514 +#define MCFCAU_ADRA (0x050)
15515 +#define MCFCAU_XOR (0x060)
15516 +#define MCFCAU_ROTL (0x070)
15517 +#define MCFCAU_MVRA (0x080)
15518 +#define MCFCAU_MVAR (0x090)
15519 +#define MCFCAU_AESS (0x0A0)
15520 +#define MCFCAU_AESIS (0x0B0)
15521 +#define MCFCAU_AESC (0x0C0)
15522 +#define MCFCAU_AESIC (0x0D0)
15523 +#define MCFCAU_AESR (0x0E0)
15524 +#define MCFCAU_AESIR (0x0F0)
15525 +#define MCFCAU_DESR (0x100)
15526 +#define MCFCAU_DESK (0x110)
15527 +#define MCFCAU_HASH (0x120)
15528 +#define MCFCAU_SHS (0x130)
15529 +#define MCFCAU_MDS (0x140)
15530 +#define MCFCAU_ILL (0x1F0)
15533 +#define MCFCAU_IP (0x08) /* initial permutation */
15534 +#define MCFCAU_FP (0x04) /* final permutation */
15535 +#define MCFCAU_KSL1 (0x00) /* key schedule left 1 bit */
15536 +#define MCFCAU_KSL2 (0x01) /* key schedule left 2 bits */
15537 +#define MCFCAU_KSR1 (0x02) /* key schedule right 1 bit */
15538 +#define MCFCAU_KSR2 (0x03) /* key schedule right 2 bits */
15541 +#define MCFCAU_DC (0x01) /* decrypt key schedule */
15542 +#define MCFCAU_CP (0x02) /* check parity */
15544 +/* HASH Functions Codes */
15545 +#define MCFCAU_HFF (0x0) /* MD5 F() CA1&CA2 | ~CA1&CA3 */
15546 +#define MCFCAU_HFG (0x1) /* MD5 G() CA1&CA3 | CA2&~CA3 */
15547 +#define MCFCAU_HFH (0x2) /* MD5 H(), SHA Parity() CA1^CA2^CA3 */
15548 +#define MCFCAU_HFI (0x3) /* MD5 I() CA2^(CA1|~CA3) */
15549 +#define MCFCAU_HFC (0x4) /* SHA Ch() CA1&CA2 ^ ~CA1&CA3 */
15550 +#define MCFCAU_HFM (0x5) /* SHA Maj() CA1&CA2 ^ CA1&CA3 ^ CA2&CA3 */
15552 +#define MCFCAU_CRA_PRIORITY (300)
15554 +extern spinlock_t mcfcau_lock;
15557 +#define DBG(fmt, args...) printk( "[%s] " fmt , __FUNCTION__, ## args)
15559 +#define DBG(fmt, args...) do{}while(0)
15564 +++ b/drivers/crypto/mcfcau-md5.c
15566 + /***************************************************************************
15567 + * mcfcau-md5.c - Implementation of MD5 Message Digest Algorithm (RFC1321)
15568 + * for Freescale ColdFire Cryptographic Acceleration Unit (CAU).
15570 + * Author: Andrey Butok
15571 + * Copyright Freescale Semiconductor Inc. 2007
15573 + * NOTE: You can find the ColdFire CAU module on MCF5445X and MCF52235.
15575 + * This program is free software; you can redistribute it and/or modify it
15576 + * under the terms of the GNU General Public License as published by the
15577 + * Free Software Foundation; either version 2 of the License, or (at your
15578 + * option) any later version.
15580 + * This program is distributed in the hope that it will be useful, but
15581 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15582 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15583 + * for more details.
15585 + * You should have received a copy of the GNU General Public License
15586 + * along with this program; if not, write to the Free Software Foundation,
15587 + * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15589 + ***************************************************************************
15591 + * v0.01 30 September 2007 Andrey Butok
15592 + * Initial Release - developed on 2.6.20 Linux kernel.
15594 +#include <linux/init.h>
15595 +#include <linux/module.h>
15596 +#include <linux/string.h>
15597 +#include <linux/crypto.h>
15598 +#include <linux/types.h>
15599 +#include <asm/byteorder.h>
15606 +#include "mcfcau.h"
15609 +#define MCFCAU_MD5_DIGEST_SIZE (16)
15610 +#define MCFCAU_MD5_HMAC_BLOCK_SIZE (64)
15611 +#define MCFCAU_MD5_BLOCK_WORDS (16)
15612 +#define MCFCAU_MD5_HASH_WORDS (4)
15614 +#define MCFCAU_MD5_DRIVER_DESC "MD5 ColdFire CAU driver"
15615 +#define MCFCAU_MD5_DRIVER_VERSION "v0.01"
15618 +struct mcfcau_md5_ctx {
15619 + u32 hash[MCFCAU_MD5_HASH_WORDS];
15620 + u32 block[MCFCAU_MD5_BLOCK_WORDS];
15624 +u32 mcfcau_md5_t[64]={0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,
15625 + 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
15626 + 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
15627 + 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
15628 + 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
15629 + 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
15630 + 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
15631 + 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
15632 + 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,
15633 + 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
15634 + 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05,
15635 + 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
15636 + 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,
15637 + 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
15638 + 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
15639 + 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391};
15643 +static void mcfcau_md5_transform(u32 *hash, u32 const *in)
15646 + u32 * md5_t_p=&mcfcau_md5_t[0];
15647 + unsigned long iflags;
15649 + spin_lock_irqsave(&mcfcau_lock, iflags);
15650 + asm("move.l %0, %%a1"::"m"(hash):"a1");
15651 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CAA):"a1");/*a*/
15652 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1):"a1");/*b*/
15653 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA2):"a1");/*c*/
15654 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA3):"a1");/*d*/
15655 + asm("move.l %0, %%a0"::"m"(in):"a0"); /* X[] */
15656 + asm("move.l %0, %%a3"::"m"(md5_t_p):"a3"); /* T[] */
15660 + asm("moveq.l #7, %%d4":::"d4"); /* for rotating by 7 */
15661 + asm("moveq.l #12, %%d5":::"d5"); /* for rotating by 12 */
15662 + asm("moveq.l #17, %%d6":::"d6"); /* for rotating by 17 */
15663 + asm("moveq.l #22, %%d7":::"d7"); /* for rotating by 22 */
15665 + for(i=0; i<4;i++){
15666 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFF)); /* a+F(b,c,d) */
15667 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0"); /* add byterev x[i] */
15668 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3"); /* add t[i] */
15669 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA)); /* rotate by 7 */
15670 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1)); /* add b */
15671 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS)); /* register to register shift */
15673 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFF));
15674 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15675 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15676 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15677 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15678 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15680 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFF));
15681 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15682 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15683 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15684 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15685 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15687 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFF));
15688 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15689 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15690 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15691 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15692 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15697 + asm("moveq.l #5, %%d4":::"d4"); /* for rotating by 5 */
15698 + asm("moveq.l #9, %%d5":::"d5"); /* for rotating by 9 */
15699 + asm("moveq.l #14, %%d6":::"d6"); /* for rotating by 14 */
15700 + asm("moveq.l #20, %%d7":::"d7"); /* for rotating by 20 */
15702 + asm("lea -60(%%a0),%%a0":::"a0");
15704 + for(i=0; i<2;i++){
15705 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15706 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15707 + asm("lea 20(%%a0),%%a0" :::"a0");
15708 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15709 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15710 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15711 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15713 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15714 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15715 + asm("lea 20(%%a0),%%a0" :::"a0");
15716 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15717 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15718 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15719 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15721 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15722 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15723 + asm("lea -44(%%a0),%%a0" :::"a0");
15724 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15725 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15726 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15727 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15729 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15730 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15731 + asm("lea 20(%%a0),%%a0" :::"a0");
15732 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15733 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15734 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15735 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15738 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15739 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15740 + asm("lea 20(%%a0),%%a0" :::"a0");
15741 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15742 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15743 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15744 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15746 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15747 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15748 + asm("lea -44(%%a0),%%a0" :::"a0");
15749 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15750 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15751 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15752 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15754 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15755 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15756 + asm("lea 20(%%a0),%%a0" :::"a0");
15757 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15758 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15759 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15760 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15762 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15763 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15764 + asm("lea 20(%%a0),%%a0" :::"a0");
15765 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15766 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15767 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15768 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15771 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15772 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15773 + asm("lea -44(%%a0),%%a0" :::"a0");
15774 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15775 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15776 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15777 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15779 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15780 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15781 + asm("lea 20(%%a0),%%a0" :::"a0");
15782 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15783 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15784 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15785 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15787 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15788 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15789 + asm("lea 20(%%a0),%%a0" :::"a0");
15790 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15791 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15792 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15793 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15795 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFG));
15796 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15797 + asm("lea -28(%%a0),%%a0" :::"a0");
15798 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15799 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15800 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15801 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15805 + asm("moveq.l #4, %%d4":::"d4"); /* for rotating by 5 */
15806 + asm("moveq.l #11, %%d5":::"d5"); /* for rotating by 9 */
15807 + asm("moveq.l #16, %%d6":::"d6"); /* for rotating by 14 */
15808 + asm("moveq.l #23, %%d7":::"d7"); /* for rotating by 20 */
15811 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15812 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15813 + asm("lea 12(%%a0),%%a0" :::"a0");
15814 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15815 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15816 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15817 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15819 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15820 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15821 + asm("lea 12(%%a0),%%a0" :::"a0");
15822 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15823 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15824 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15825 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15827 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15828 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15829 + asm("lea 12(%%a0),%%a0" :::"a0");
15830 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15831 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15832 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15833 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15835 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15836 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15837 + asm("lea -52(%%a0),%%a0" :::"a0");
15838 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15839 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15840 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15841 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15844 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15845 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15846 + asm("lea 12(%%a0),%%a0" :::"a0");
15847 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15848 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15849 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15850 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15852 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15853 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15854 + asm("lea 12(%%a0),%%a0" :::"a0");
15855 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15856 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15857 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15858 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15860 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15861 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15862 + asm("lea 12(%%a0),%%a0" :::"a0");
15863 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15864 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15865 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15866 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15868 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15869 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15870 + asm("lea 12(%%a0),%%a0" :::"a0");
15871 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15872 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15873 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15874 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15877 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15878 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15879 + asm("lea -52(%%a0),%%a0" :::"a0");
15880 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15881 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15882 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15883 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15885 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15886 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15887 + asm("lea 12(%%a0),%%a0" :::"a0");
15888 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15889 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15890 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15891 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15893 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15894 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15895 + asm("lea 12(%%a0),%%a0" :::"a0");
15896 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15897 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15898 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15899 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15901 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15902 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15903 + asm("lea 12(%%a0),%%a0" :::"a0");
15904 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15905 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15906 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15907 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15910 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15911 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15912 + asm("lea 12(%%a0),%%a0" :::"a0");
15913 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15914 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15915 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15916 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15918 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15919 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15920 + asm("lea 12(%%a0),%%a0" :::"a0");
15921 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15922 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15923 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15924 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15926 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15927 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15928 + asm("lea -52(%%a0),%%a0" :::"a0");
15929 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15930 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15931 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15932 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15934 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH));
15935 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15936 + asm("lea -8(%%a0),%%a0" :::"a0");
15937 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15938 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15939 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15940 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15944 + asm("moveq.l #6, %%d4":::"d4"); /* for rotating by 6 */
15945 + asm("moveq.l #10, %%d5":::"d5"); /* for rotating by 10 */
15946 + asm("moveq.l #15, %%d6":::"d6"); /* for rotating by 15 */
15947 + asm("moveq.l #21, %%d7":::"d7"); /* for rotating by 21 */
15950 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
15951 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15952 + asm("lea 28(%%a0),%%a0" :::"a0");
15953 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15954 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15955 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15956 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15958 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
15959 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15960 + asm("lea 28(%%a0),%%a0" :::"a0");
15961 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15962 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15963 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15964 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15966 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
15967 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15968 + asm("lea -36(%%a0),%%a0" :::"a0");
15969 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15970 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15971 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15972 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15974 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
15975 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15976 + asm("lea 28(%%a0),%%a0" :::"a0");
15977 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15978 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15979 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15980 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15983 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
15984 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15985 + asm("lea -36(%%a0),%%a0" :::"a0");
15986 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15987 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15988 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15989 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15991 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
15992 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
15993 + asm("lea 28(%%a0),%%a0" :::"a0");
15994 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
15995 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
15996 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
15997 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
15999 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16000 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16001 + asm("lea -36(%%a0),%%a0" :::"a0");
16002 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16003 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16004 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16005 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16007 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16008 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16009 + asm("lea 28(%%a0),%%a0" :::"a0");
16010 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16011 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16012 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16013 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16016 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16017 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16018 + asm("lea 28(%%a0),%%a0" :::"a0");
16019 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16020 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16021 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16022 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16024 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16025 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16026 + asm("lea -36(%%a0),%%a0" :::"a0");
16027 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16028 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16029 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16030 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16032 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16033 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16034 + asm("lea 28(%%a0),%%a0" :::"a0");
16035 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16036 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16037 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16038 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16040 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16041 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16042 + asm("lea -36(%%a0),%%a0" :::"a0");
16043 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16044 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16045 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16046 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16049 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16050 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16051 + asm("lea 28(%%a0),%%a0" :::"a0");
16052 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16053 + asm("cp0ld.l %%d4,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16054 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16055 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16057 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16058 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16059 + asm("lea -36(%%a0),%%a0" :::"a0");
16060 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16061 + asm("cp0ld.l %%d5,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16062 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16063 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16065 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16066 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16067 + asm("lea 28(%%a0),%%a0" :::"a0");
16068 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16069 + asm("cp0ld.l %%d6,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16070 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16071 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16073 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFI));
16074 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_RADR+MCFCAU_CAA):"a0");
16075 + asm("lea 28(%%a0),%%a0" :::"a0");
16076 + asm("cp0ld.l (%%a3)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a3");
16077 + asm("cp0ld.l %%d7,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA));
16078 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA1));
16079 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MDS));
16082 + asm("move.l %0, %%a1"::"m"(hash):"a1");
16084 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a1");/*a*/
16085 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CA1):"a1");/*b*/
16086 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CA2):"a1");/*c*/
16087 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CA3):"a1");/*d*/
16089 + asm("cp0st.l %%d0,-(%%a1),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA3):"a1");/*d*/
16090 + asm("cp0st.l %%d0,-(%%a1),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA2):"a1");/*c*/
16091 + asm("cp0st.l %%d0,-(%%a1),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA1):"a1");/*b*/
16092 + asm("cp0st.l %%d0,-(%%a1),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CAA):"a1");/*a*/
16093 + spin_unlock_irqrestore(&mcfcau_lock, iflags);
16096 +static inline void le32_to_cpu_array(u32 *buf, unsigned int words)
16098 + while (words--) {
16099 + __le32_to_cpus(buf);
16104 +static inline void cpu_to_le32_array(u32 *buf, unsigned int words)
16106 + while (words--) {
16107 + __cpu_to_le32s(buf);
16112 +static void mcfcau_md5_initialization(struct crypto_tfm *tfm)
16114 + struct mcfcau_md5_ctx *mctx = crypto_tfm_ctx(tfm);
16117 + mctx->hash[0] = 0x67452301;
16118 + mctx->hash[1] = 0xefcdab89;
16119 + mctx->hash[2] = 0x98badcfe;
16120 + mctx->hash[3] = 0x10325476;
16121 + mctx->byte_count = 0;
16124 +static void mcfcau_md5_update(struct crypto_tfm *tfm, const u8 *data, unsigned int len)
16126 + struct mcfcau_md5_ctx *mctx = crypto_tfm_ctx(tfm);
16127 + const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f);
16130 + mctx->byte_count += len;
16132 + if (avail > len) {
16133 + memcpy((char *)mctx->block + (sizeof(mctx->block) - avail),
16137 + memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), data, avail);
16139 + mcfcau_md5_transform(mctx->hash, mctx->block);
16143 + while (len >= sizeof(mctx->block)) {
16144 + memcpy(mctx->block, data, sizeof(mctx->block));
16145 + mcfcau_md5_transform(mctx->hash, mctx->block);
16146 + data += sizeof(mctx->block);
16147 + len -= sizeof(mctx->block);
16150 + memcpy(mctx->block, data, len);
16154 +static void mcfcau_md5_final(struct crypto_tfm *tfm, u8 *out)
16156 + struct mcfcau_md5_ctx *mctx = crypto_tfm_ctx(tfm);
16157 + const unsigned int offset = mctx->byte_count & 0x3f;
16158 + char *p = (char *)mctx->block + offset;
16159 + int padding = 56 - (offset + 1);
16164 + if (padding < 0) {
16165 + memset(p, 0x00, padding + sizeof (u64));
16166 + mcfcau_md5_transform(mctx->hash, mctx->block);
16167 + p = (char *)mctx->block;
16171 + memset(p, 0, padding);
16172 + mctx->block[14] = mctx->byte_count << 3;
16173 + mctx->block[15] = mctx->byte_count >> 29;
16174 + le32_to_cpu_array(&mctx->block[14], 2);
16176 + mcfcau_md5_transform(mctx->hash, mctx->block);
16178 + cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(u32));
16179 + memcpy(out, mctx->hash, sizeof(mctx->hash));
16180 + memset(mctx, 0, sizeof(*mctx));
16183 +static struct crypto_alg mcfcau_md5_alg = {
16184 + .cra_name = "md5",
16185 + .cra_driver_name = "md5-mcfcau",
16186 + .cra_priority = MCFCAU_CRA_PRIORITY,
16187 + .cra_flags = CRYPTO_ALG_TYPE_DIGEST,
16188 + .cra_blocksize = MCFCAU_MD5_HMAC_BLOCK_SIZE,
16189 + .cra_ctxsize = sizeof(struct mcfcau_md5_ctx),
16190 + .cra_module = THIS_MODULE,
16191 + .cra_list = LIST_HEAD_INIT(mcfcau_md5_alg.cra_list),
16192 + .cra_u = { .digest = {
16193 + .dia_digestsize = MCFCAU_MD5_DIGEST_SIZE,
16194 + .dia_init = mcfcau_md5_initialization,
16195 + .dia_update = mcfcau_md5_update,
16196 + .dia_final = mcfcau_md5_final } }
16199 +static int __init mcfcau_md5_init(void)
16201 + int ret = crypto_register_alg(&mcfcau_md5_alg);
16202 + printk(KERN_INFO MCFCAU_MD5_DRIVER_DESC " "
16203 + MCFCAU_MD5_DRIVER_VERSION " %s.\n",ret?"failed":"registered");
16207 +static void __exit mcfcau_md5_exit(void)
16209 + crypto_unregister_alg(&mcfcau_md5_alg);
16210 + printk(KERN_INFO MCFCAU_MD5_DRIVER_DESC " "
16211 + MCFCAU_MD5_DRIVER_VERSION " unregistered.\n");
16214 +module_init(mcfcau_md5_init);
16215 +module_exit(mcfcau_md5_exit);
16217 +MODULE_LICENSE("GPL");
16218 +MODULE_DESCRIPTION(MCFCAU_MD5_DRIVER_DESC);
16219 +MODULE_AUTHOR("Andrey Butok");
16221 +++ b/drivers/crypto/mcfcau-sha1.c
16223 + /***************************************************************************
16224 + * mcfcau-sha1.c - Implementation of SHA1 Secure Hash Algorithm
16225 + * for Freescale ColdFire Cryptographic Acceleration Unit (CAU).
16227 + * Author: Andrey Butok
16228 + * Copyright Freescale Semiconductor Inc. 2007
16230 + * NOTE: You can find the ColdFire CAU module on MCF5445X and MCF52235.
16232 + * This program is free software; you can redistribute it and/or modify it
16233 + * under the terms of the GNU General Public License as published by the
16234 + * Free Software Foundation; either version 2 of the License, or (at your
16235 + * option) any later version.
16237 + * This program is distributed in the hope that it will be useful, but
16238 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16239 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16240 + * for more details.
16242 + * You should have received a copy of the GNU General Public License
16243 + * along with this program; if not, write to the Free Software Foundation,
16244 + * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16246 + ***************************************************************************
16248 + * v0.01 15 October 2007 Andrey Butok
16249 + * Initial Release - developed on 2.6.20 Linux kernel.
16252 +#include <linux/init.h>
16253 +#include <linux/module.h>
16254 +#include <linux/mm.h>
16255 +#include <linux/crypto.h>
16256 +#include <linux/types.h>
16264 +#include "mcfcau.h"
16266 +#define MCFCAU_SHA1_DIGEST_WORDS (5)
16267 +#define MCFCAU_SHA1_WORKSPACE_WORDS (80)
16269 +#define MCFCAU_SHA1_DIGEST_SIZE (20)
16270 +#define MCFCAU_SHA1_HMAC_BLOCK_SIZE (64)
16272 +#define MCFCAU_SHA1_DRIVER_DESC "SHA1 ColdFire CAU driver"
16273 +#define MCFCAU_SHA1_DRIVER_VERSION "v0.01"
16275 +struct mcfcau_sha1_ctx {
16281 +const static u32 K[4]={0x5A827999L, /* Rounds 0-19: sqrt(2) * 2^30 */
16282 + 0x6ED9EBA1L, /* Rounds 20-39: sqrt(3) * 2^30 */
16283 + 0x8F1BBCDCL, /* Rounds 40-59: sqrt(5) * 2^30 */
16284 + 0xCA62C1D6L}; /* Rounds 60-79: sqrt(10) * 2^30 */
16286 +static void noinline mcfcau_sha1_transform(__u32 *digest, const char *in, __u32 *W)
16290 + unsigned long iflags;
16292 + /* (a) Devide M(i) into 16 words W */
16293 + for (i = 0; i < 16; i++)
16294 + W[i] = ((const u32 *)in)[i];
16296 + /* (b) W[i+16] = S^1(W[i+13] ^ W[i+8] ^ W[i+2] ^ W[i]) */
16299 + spin_lock_irqsave(&mcfcau_lock, iflags);
16300 + asm("move.l %0, %%a0"::"m"(tmp_p):"a0");
16301 + asm("moveq.l #1, %%d3":::"d3");
16303 + for (i = 0; i < 64; i++){
16304 + asm("cp0ld.l -64(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0));
16305 + asm("cp0ld.l -56(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA0));
16306 + asm("cp0ld.l -32(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA0));
16307 + asm("cp0ld.l -12(%%a0),%%d0,#1,%0" ::"n"(MCFCAU_XOR+MCFCAU_CA0));
16308 + asm("cp0ld.l %%d3,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CA0):"d3");
16309 + asm("cp0st.l %%d0,(%%a0)+,#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA0));
16313 + asm("move.l %0, %%a0"::"m"(digest):"a0");
16314 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA0):"a0"); /* a */
16315 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA1):"a0"); /* b */
16316 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA2):"a0"); /* c */
16317 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA3):"a0"); /* d */
16318 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_LDR+MCFCAU_CA4):"a0"); /* e */
16321 + asm("moveq.l #5, %%d0":::"d0");
16322 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_MVRA+MCFCAU_CA0));
16323 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ROTL+MCFCAU_CAA)); /*S^5(A)*/
16326 + asm("move.l %0, %%a0"::"m"(tmp_p):"a0");
16327 + asm("move.l %0, %%a1"::"m"(W):"a1");
16329 + for (i = 0; i < 20; i++) {
16330 + /* t = f1(b, c, d) + K1 + rol32(a, 5) + e + W[i]; */
16331 + /* e = d; d = c; c = rol32(b, 30); b = a; a = t; */
16332 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFC)); /*f(b,c,d)*/
16333 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA4)); /*+e*/
16334 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA)); /*+K*/
16335 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a1"); /*+W*/
16336 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_SHS));
16339 + asm("add.l #4,%%a0" :::"a0"); /* update K */
16341 + for (; i < 40; i ++) {
16342 + /* t = f2(b, c, d) + K2 + rol32(a, 5) + e + W[i]; */
16343 + /* e = d; d = c; c = rol32(b, 30); b = a; a = t; */
16344 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH)); /*f(b,c,d)*/
16345 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA4)); /*+e*/
16346 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA)); /*+K*/
16347 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a1"); /*+W*/
16348 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_SHS));
16351 + asm("add.l #4,%%a0" :::"a0"); /* update K */
16353 + for (; i < 60; i ++) {
16354 + /* t = f3(b, c, d) + K3 + rol32(a, 5) + e + W[i]; */
16355 + /* e = d; d = c; c = rol32(b, 30); b = a; a = t; */
16356 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFM)); /*f(b,c,d)*/
16357 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA4)); /*+e*/
16358 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA)); /*+K*/
16359 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a1"); /*+W*/
16360 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_SHS));
16363 + asm("add.l #4,%%a0" :::"a0"); /* update K */
16365 + for (; i < 80; i ++) {
16366 + /* t = f2(b, c, d) + K4 + rol32(a, 5) + e + W[i]; */
16367 + /* e = d; d = c; c = rol32(b, 30); b = a; a = t; */
16368 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_HASH+MCFCAU_HFH)); /*f(b,c,d)*/
16369 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_ADRA+MCFCAU_CA4)); /*+e*/
16370 + asm("cp0ld.l (%%a0),%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA)); /*+K*/
16371 + asm("cp0ld.l (%%a1)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CAA):"a1"); /*+W*/
16372 + asm("cp0ld.l %%d0,%%d0,#1,%0" ::"n"(MCFCAU_SHS));
16376 + asm("move.l %0, %%a0"::"m"(digest):"a0");
16377 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CA0):"a0"); /* +a */
16378 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CA1):"a0"); /* +b */
16379 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CA2):"a0"); /* +c */
16380 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CA3):"a0"); /* +d */
16381 + asm("cp0ld.l (%%a0)+,%%d0,#1,%0" ::"n"(MCFCAU_ADR+MCFCAU_CA4):"a0"); /* +e */
16383 + asm("cp0st.l %%d0,-(%%a0),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA4):"a0");
16384 + asm("cp0st.l %%d0,-(%%a0),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA3):"a0");
16385 + asm("cp0st.l %%d0,-(%%a0),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA2):"a0");
16386 + asm("cp0st.l %%d0,-(%%a0),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA1):"a0");
16387 + asm("cp0st.l %%d0,-(%%a0),#1,%0" ::"n"(MCFCAU_STR+MCFCAU_CA0):"a0");
16388 + spin_unlock_irqrestore(&mcfcau_lock, iflags);
16391 +static void mcfcau_sha1_init(struct crypto_tfm *tfm)
16393 + struct mcfcau_sha1_ctx *sctx = crypto_tfm_ctx(tfm);
16394 + static const struct mcfcau_sha1_ctx initstate = {
16396 + { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 },
16400 + *sctx = initstate;
16403 +static void mcfcau_sha1_update(struct crypto_tfm *tfm, const u8 *data,
16404 + unsigned int len)
16406 + struct mcfcau_sha1_ctx *sctx = crypto_tfm_ctx(tfm);
16407 + unsigned int partial, done;
16410 + partial = sctx->count & 0x3f;
16411 + sctx->count += len;
16415 + if ((partial + len) > 63) {
16416 + u32 temp[MCFCAU_SHA1_WORKSPACE_WORDS];
16420 + memcpy(sctx->buffer + partial, data, done + 64);
16421 + src = sctx->buffer;
16425 + mcfcau_sha1_transform(sctx->state, src, temp);
16427 + src = data + done;
16428 + } while (done + 63 < len);
16430 + memset(temp, 0, sizeof(temp));
16433 + memcpy(sctx->buffer + partial, src, len - done);
16437 +/* Add padding and return the message digest. */
16438 +static void mcfcau_sha1_final(struct crypto_tfm *tfm, u8 *out)
16440 + struct mcfcau_sha1_ctx *sctx = crypto_tfm_ctx(tfm);
16441 + u32 *dst = (u32 *)out;
16442 + u32 i, index, padlen;
16444 + static const u8 padding[64] = { 0x80, };
16446 + bits = sctx->count << 3;
16448 + /* Pad out to 56 mod 64 */
16449 + index = sctx->count & 0x3f;
16450 + padlen = (index < 56) ? (56 - index) : ((64+56) - index);
16451 + mcfcau_sha1_update(tfm, padding, padlen);
16453 + /* Append length */
16454 + mcfcau_sha1_update(tfm, (const u8 *)&bits, sizeof(bits));
16456 + /* Store state in digest */
16457 + for (i = 0; i < 5; i++)
16458 + dst[i] = sctx->state[i];
16461 + /* Wipe context */
16462 + memset(sctx, 0, sizeof *sctx);
16465 +static struct crypto_alg mcfcau_sha1_alg = {
16466 + .cra_name = "sha1",
16467 + .cra_driver_name= "sha1-mcfcau",
16468 + .cra_priority = MCFCAU_CRA_PRIORITY,
16469 + .cra_flags = CRYPTO_ALG_TYPE_DIGEST,
16470 + .cra_blocksize = MCFCAU_SHA1_HMAC_BLOCK_SIZE,
16471 + .cra_ctxsize = sizeof(struct mcfcau_sha1_ctx),
16472 + .cra_module = THIS_MODULE,
16473 + .cra_alignmask = 3,
16474 + .cra_list = LIST_HEAD_INIT(mcfcau_sha1_alg.cra_list),
16475 + .cra_u = { .digest = {
16476 + .dia_digestsize = MCFCAU_SHA1_DIGEST_SIZE,
16477 + .dia_init = mcfcau_sha1_init,
16478 + .dia_update = mcfcau_sha1_update,
16479 + .dia_final = mcfcau_sha1_final } }
16482 +static int __init init(void)
16484 + int ret = crypto_register_alg(&mcfcau_sha1_alg);
16485 + printk(KERN_INFO MCFCAU_SHA1_DRIVER_DESC " "
16486 + MCFCAU_SHA1_DRIVER_VERSION " %s.\n",ret?"failed":"registered");
16490 +static void __exit fini(void)
16492 + crypto_unregister_alg(&mcfcau_sha1_alg);
16493 + printk(KERN_INFO MCFCAU_SHA1_DRIVER_DESC " "
16494 + MCFCAU_SHA1_DRIVER_VERSION " unregistered.\n");
16497 +module_init(init);
16498 +module_exit(fini);
16500 +MODULE_LICENSE("GPL");
16501 +MODULE_DESCRIPTION(MCFCAU_SHA1_DRIVER_DESC);
16502 +MODULE_AUTHOR("Andrey Butok");
16503 --- a/drivers/dma/Makefile
16504 +++ b/drivers/dma/Makefile
16505 @@ -4,3 +4,5 @@ obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o
16506 ioatdma-objs := ioat.o ioat_dma.o ioat_dca.o
16507 obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
16508 obj-$(CONFIG_FSL_DMA) += fsldma.o
16509 +obj-$(CONFIG_MCD_DMA) += mcddma.o
16510 +mcddma-objs := MCD_dmaApi.o MCD_tasks.o MCD_tasksInit.o
16512 +++ b/drivers/dma/MCD_dmaApi.c
16515 + * drivers/dma/MCD_dmaApi.c
16517 + * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
16518 + * Kurt Mahan <kmahan@freescale.com>
16520 + * This program is free software; you can redistribute it and/or
16521 + * modify it under the terms of the GNU General Public License as
16522 + * published by the Free Software Foundation; either version 2 of
16523 + * the License, or (at your option) any later version.
16525 + * This program is distributed in the hope that it will be useful,
16526 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16527 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16528 + * GNU General Public License for more details.
16530 + * You should have received a copy of the GNU General Public License
16531 + * along with this program; if not, write to the Free Software
16532 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
16533 + * MA 02111-1307 USA
16536 +#include "MCD_dma.h"
16537 +#include "MCD_tasksInit.h"
16538 +#include "MCD_progCheck.h"
16540 +/********************************************************************/
16542 + * This is an API-internal pointer to the DMA's registers
16544 +dmaRegs *MCD_dmaBar;
16547 + * These are the real and model task tables as generated by the
16550 +extern TaskTableEntry MCD_realTaskTableSrc[NCHANNELS];
16551 +extern TaskTableEntry MCD_modelTaskTableSrc[NUMOFVARIANTS];
16554 + * However, this (usually) gets relocated to on-chip SRAM, at which
16555 + * point we access them as these tables
16557 +volatile TaskTableEntry *MCD_taskTable;
16558 +TaskTableEntry *MCD_modelTaskTable;
16562 + * MCD_chStatus[] is an array of status indicators for remembering
16563 + * whether a DMA has ever been attempted on each channel, pausing
16566 +static int MCD_chStatus[NCHANNELS] =
16568 + MCD_NO_DMA, MCD_NO_DMA, MCD_NO_DMA, MCD_NO_DMA,
16569 + MCD_NO_DMA, MCD_NO_DMA, MCD_NO_DMA, MCD_NO_DMA,
16570 + MCD_NO_DMA, MCD_NO_DMA, MCD_NO_DMA, MCD_NO_DMA,
16571 + MCD_NO_DMA, MCD_NO_DMA, MCD_NO_DMA, MCD_NO_DMA
16575 + * Prototypes for local functions
16577 +static void MCD_memcpy (int *dest, int *src, u32 size);
16578 +static void MCD_resmActions (int channel);
16581 + * Buffer descriptors used for storage of progress info for single Dmas
16582 + * Also used as storage for the DMA for CRCs for single DMAs
16583 + * Otherwise, the DMA does not parse these buffer descriptors
16585 +#ifdef MCD_INCLUDE_EU
16586 +extern MCD_bufDesc MCD_singleBufDescs[NCHANNELS];
16588 +MCD_bufDesc MCD_singleBufDescs[NCHANNELS];
16590 +MCD_bufDesc *MCD_relocBuffDesc;
16594 + * Defines for the debug control register's functions
16596 +#define DBG_CTL_COMP1_TASK (0x00002000) /* have comparator 1 look for a task # */
16597 +#define DBG_CTL_ENABLE (DBG_CTL_AUTO_ARM | \
16598 + DBG_CTL_BREAK | \
16599 + DBG_CTL_INT_BREAK | \
16600 + DBG_CTL_COMP1_TASK)
16601 +#define DBG_CTL_DISABLE (DBG_CTL_AUTO_ARM | \
16602 + DBG_CTL_INT_BREAK | \
16603 + DBG_CTL_COMP1_TASK)
16604 +#define DBG_KILL_ALL_STAT (0xFFFFFFFF)
16607 + * Offset to context save area where progress info is stored
16609 +#define CSAVE_OFFSET 10
16612 + * Defines for Byte Swapping
16614 +#define MCD_BYTE_SWAP_KILLER 0xFFF8888F
16615 +#define MCD_NO_BYTE_SWAP_ATALL 0x00040000
16618 + * Execution Unit Identifiers
16620 +#define MAC 0 /* legacy - not used */
16621 +#define LUAC 1 /* legacy - not used */
16622 +#define CRC 2 /* legacy - not used */
16623 +#define LURC 3 /* Logic Unit with CRC */
16626 + * Task Identifiers
16628 +#define TASK_CHAINNOEU 0
16629 +#define TASK_SINGLENOEU 1
16630 +#ifdef MCD_INCLUDE_EU
16631 +#define TASK_CHAINEU 2
16632 +#define TASK_SINGLEEU 3
16633 +#define TASK_FECRX 4
16634 +#define TASK_FECTX 5
16636 +#define TASK_CHAINEU 0
16637 +#define TASK_SINGLEEU 1
16638 +#define TASK_FECRX 2
16639 +#define TASK_FECTX 3
16643 + * Structure to remember which variant is on which channel
16645 +typedef struct MCD_remVariants_struct MCD_remVariant;
16646 +struct MCD_remVariants_struct
16648 + int remDestRsdIncr[NCHANNELS]; /* -1,0,1 */
16649 + int remSrcRsdIncr[NCHANNELS]; /* -1,0,1 */
16650 + s16 remDestIncr[NCHANNELS]; /* DestIncr */
16651 + s16 remSrcIncr[NCHANNELS]; /* srcIncr */
16652 + u32 remXferSize[NCHANNELS]; /* xferSize */
16656 + * Structure to remember the startDma parameters for each channel
16658 +MCD_remVariant MCD_remVariants;
16660 +/********************************************************************/
16662 + * Function: MCD_initDma
16663 + * Purpose: Initializes the DMA API by setting up a pointer to the DMA
16664 + * registers, relocating and creating the appropriate task
16665 + * structures, and setting up some global settings
16667 + * dmaBarAddr - pointer to the multichannel DMA registers
16668 + * taskTableDest - location to move DMA task code and structs to
16669 + * flags - operational parameters
16671 + * MCD_TABLE_UNALIGNED if taskTableDest is not 512-byte aligned
16672 + * MCD_OK otherwise
16674 +extern u32 MCD_funcDescTab0[];
16676 +int MCD_initDma (dmaRegs *dmaBarAddr, void *taskTableDest, u32 flags)
16679 + TaskTableEntry *entryPtr;
16681 + /* Setup the local pointer to register set */
16682 + MCD_dmaBar = dmaBarAddr;
16684 + /* Do we need to move/create a task table */
16685 + if ((flags & MCD_RELOC_TASKS) != 0)
16689 + int varTabsOffset, funcDescTabsOffset, contextSavesOffset;
16690 + int taskDescTabsOffset;
16691 + int taskTableSize, varTabsSize, funcDescTabsSize, contextSavesSize;
16692 + int taskDescTabSize;
16696 + /* Check if physical address is aligned on 512 byte boundary */
16697 + if (((u32)taskTableDest & 0x000001ff) != 0)
16698 + return(MCD_TABLE_UNALIGNED);
16700 + MCD_taskTable = taskTableDest; /* set up local pointer to task Table */
16703 + * Create a task table:
16704 + * - compute aligned base offsets for variable tables and
16705 + * function descriptor tables, then
16706 + * - loop through the task table and setup the pointers
16707 + * - copy over model task table with the the actual task descriptor
16710 + taskTableSize = NCHANNELS * sizeof(TaskTableEntry);
16711 + /* Align variable tables to size */
16712 + varTabsOffset = taskTableSize + (u32)taskTableDest;
16713 + if ((varTabsOffset & (VAR_TAB_SIZE - 1)) != 0)
16714 + varTabsOffset = (varTabsOffset + VAR_TAB_SIZE) & (~VAR_TAB_SIZE);
16715 + /* Align function descriptor tables */
16716 + varTabsSize = NCHANNELS * VAR_TAB_SIZE;
16717 + funcDescTabsOffset = varTabsOffset + varTabsSize;
16719 + if ((funcDescTabsOffset & (FUNCDESC_TAB_SIZE - 1)) != 0)
16720 + funcDescTabsOffset = (funcDescTabsOffset + FUNCDESC_TAB_SIZE) &
16721 + (~FUNCDESC_TAB_SIZE);
16723 + funcDescTabsSize = FUNCDESC_TAB_NUM * FUNCDESC_TAB_SIZE;
16724 + contextSavesOffset = funcDescTabsOffset + funcDescTabsSize;
16725 + contextSavesSize = (NCHANNELS * CONTEXT_SAVE_SIZE);
16726 + fixedSize = taskTableSize + varTabsSize + funcDescTabsSize +
16727 + contextSavesSize;
16729 + /* Zero the thing out */
16730 + fixedPtr = (u32 *)taskTableDest;
16731 + for (i = 0;i<(fixedSize/4);i++)
16734 + entryPtr = (TaskTableEntry*)MCD_taskTable;
16735 + /* Set up fixed pointers */
16736 + for (i = 0; i < NCHANNELS; i++)
16738 + entryPtr[i].varTab = (u32)varTabsOffset; /* update ptr to local value */
16739 + entryPtr[i].FDTandFlags = (u32)funcDescTabsOffset | MCD_TT_FLAGS_DEF;
16740 + entryPtr[i].contextSaveSpace = (u32)contextSavesOffset;
16741 + varTabsOffset += VAR_TAB_SIZE;
16742 +#ifdef MCD_INCLUDE_EU /* if not there is only one, just point to the same one */
16743 + funcDescTabsOffset += FUNCDESC_TAB_SIZE;
16745 + contextSavesOffset += CONTEXT_SAVE_SIZE;
16747 + /* Copy over the function descriptor table */
16748 + for ( i = 0; i < FUNCDESC_TAB_NUM; i++)
16750 + MCD_memcpy((void*)(entryPtr[i].FDTandFlags & ~MCD_TT_FLAGS_MASK),
16751 + (void*)MCD_funcDescTab0, FUNCDESC_TAB_SIZE);
16754 + /* Copy model task table to where the context save stuff leaves off */
16755 + MCD_modelTaskTable = (TaskTableEntry*)contextSavesOffset;
16757 + MCD_memcpy ((void*)MCD_modelTaskTable, (void*)MCD_modelTaskTableSrc,
16758 + NUMOFVARIANTS * sizeof(TaskTableEntry));
16760 + /* Point to local version of model task table */
16761 + entryPtr = MCD_modelTaskTable;
16762 + taskDescTabsOffset = (u32)MCD_modelTaskTable +
16763 + (NUMOFVARIANTS * sizeof(TaskTableEntry));
16765 + /* Copy actual task code and update TDT ptrs in local model task table */
16766 + for (i = 0; i < NUMOFVARIANTS; i++)
16768 + taskDescTabSize = entryPtr[i].TDTend - entryPtr[i].TDTstart + 4;
16769 + MCD_memcpy ((void*)taskDescTabsOffset, (void*)entryPtr[i].TDTstart, taskDescTabSize);
16770 + entryPtr[i].TDTstart = (u32)taskDescTabsOffset;
16771 + taskDescTabsOffset += taskDescTabSize;
16772 + entryPtr[i].TDTend = (u32)taskDescTabsOffset - 4;
16774 +#ifdef MCD_INCLUDE_EU
16776 + * Tack single DMA BDs onto end of code so API controls where
16777 + * they are since DMA might write to them
16779 + MCD_relocBuffDesc = (MCD_bufDesc*)(entryPtr[NUMOFVARIANTS - 1].TDTend + 4);
16782 + * DMA does not touch them so they can be wherever and we don't need to
16783 + * waste SRAM on them
16785 + MCD_relocBuffDesc = MCD_singleBufDescs;
16791 + * Point the would-be relocated task tables and the buffer descriptors
16792 + * to the ones the linker generated
16794 + if (((u32)MCD_realTaskTableSrc & 0x000001ff) != 0)
16795 + return(MCD_TABLE_UNALIGNED);
16797 + entryPtr = MCD_realTaskTableSrc;
16798 + for (i = 0; i < NCHANNELS; i++)
16800 + if (((entryPtr[i].varTab & (VAR_TAB_SIZE - 1)) != 0) ||
16801 + ((entryPtr[i].FDTandFlags & (FUNCDESC_TAB_SIZE - 1)) != 0))
16802 + return(MCD_TABLE_UNALIGNED);
16805 + MCD_taskTable = MCD_realTaskTableSrc;
16806 + MCD_modelTaskTable = MCD_modelTaskTableSrc;
16807 + MCD_relocBuffDesc = MCD_singleBufDescs;
16810 + /* Make all channels inactive, and remember them as such: */
16811 + MCD_dmaBar->taskbar = (u32) MCD_taskTable;
16812 + for (i = 0; i < NCHANNELS; i++)
16814 + MCD_dmaBar->taskControl[i] = 0x0;
16815 + MCD_chStatus[i] = MCD_NO_DMA;
16818 + /* Set up pausing mechanism to inactive state: */
16819 + MCD_dmaBar->debugComp1 = 0;
16820 + MCD_dmaBar->debugComp2 = 0;
16821 + MCD_dmaBar->debugControl = DBG_CTL_DISABLE;
16822 + MCD_dmaBar->debugStatus = DBG_KILL_ALL_STAT;
16824 + /* Enable or disable commbus prefetch */
16825 + if ((flags & MCD_COMM_PREFETCH_EN) != 0)
16826 + MCD_dmaBar->ptdControl &= ~PTD_CTL_COMM_PREFETCH;
16828 + MCD_dmaBar->ptdControl |= PTD_CTL_COMM_PREFETCH;
16832 +/*********************** End of MCD_initDma() ***********************/
16834 +/********************************************************************/
16835 +/* Function: MCD_dmaStatus
16836 + * Purpose: Returns the status of the DMA on the requested channel
16837 + * Arguments: channel - channel number
16838 + * Returns: Predefined status indicators
16840 +int MCD_dmaStatus (int channel)
16844 + if((channel < 0) || (channel >= NCHANNELS))
16845 + return(MCD_CHANNEL_INVALID);
16847 + tcrValue = MCD_dmaBar->taskControl[channel];
16848 + if ((tcrValue & TASK_CTL_EN) == 0)
16849 + { /* Nothing running if last reported with task enabled */
16850 + if ( MCD_chStatus[channel] == MCD_RUNNING
16851 + || MCD_chStatus[channel] == MCD_IDLE)
16852 + MCD_chStatus[channel] = MCD_DONE;
16854 + else /* something is running */
16856 + /* There are three possibilities: paused, running or idle. */
16857 + if ( MCD_chStatus[channel] == MCD_RUNNING
16858 + || MCD_chStatus[channel] == MCD_IDLE)
16860 + MCD_dmaBar->ptdDebug = PTD_DBG_TSK_VLD_INIT;
16861 + /* Determine which initiator is asserted. */
16862 + if ((MCD_dmaBar->ptdDebug >> channel ) & 0x1 )
16863 + MCD_chStatus[channel] = MCD_RUNNING;
16865 + MCD_chStatus[channel] = MCD_IDLE;
16866 + /* Do not change the status if it is already paused */
16869 + return MCD_chStatus[channel];
16871 +/******************** End of MCD_dmaStatus() ************************/
16873 +/********************************************************************/
16874 +/* Function: MCD_startDma
16875 + * Ppurpose: Starts a particular kind of DMA
16876 + * Arguments: see below
16877 + * Returns: MCD_CHANNEL_INVALID if channel is invalid, else MCD_OK
16880 +int MCD_startDma (
16881 + int channel, /* the channel on which to run the DMA */
16882 + s8 *srcAddr, /* the address to move data from, or physical buffer-descriptor address */
16883 + s16 srcIncr, /* the amount to increment the source address per transfer */
16884 + s8 *destAddr, /* the address to move data to */
16885 + s16 destIncr, /* the amount to increment the destination address per transfer */
16886 + u32 dmaSize, /* the number of bytes to transfer independent of the transfer size */
16887 + u32 xferSize, /* the number bytes in of each data movement (1, 2, or 4) */
16888 + u32 initiator, /* what device initiates the DMA */
16889 + int priority, /* priority of the DMA */
16890 + u32 flags, /* flags describing the DMA */
16891 + u32 funcDesc /* a description of byte swapping, bit swapping, and CRC actions */
16892 +#ifdef MCD_NEED_ADDR_TRANS
16893 + s8 *srcAddrVirt /* virtual buffer descriptor address TBD*/
16897 + int srcRsdIncr, destRsdIncr;
16899 + short xferSizeIncr;
16900 + int tcrCount = 0;
16901 +#ifdef MCD_INCLUDE_EU
16902 + u32 *realFuncArray;
16905 + if((channel < 0) || (channel >= NCHANNELS))
16906 + return(MCD_CHANNEL_INVALID);
16908 +#ifndef MCD_INCLUDE_EU
16909 + funcDesc = MCD_FUNC_NOEU1;
16913 +printf("startDma:Setting up params\n");
16916 + /* Enable task-wise priority */
16917 + MCD_dmaBar->ptdControl |= (u16) 0x8000;
16919 + /* Calculate additional parameters to the regular DMA calls. */
16920 + srcRsdIncr = srcIncr < 0 ? -1 : (srcIncr > 0 ? 1 : 0);
16921 + destRsdIncr = destIncr < 0 ? -1 : (destIncr > 0 ? 1 : 0);
16922 + xferSizeIncr = (xferSize & 0xffff) | 0x20000000;
16924 + /* Remember which variant is running for each channel */
16925 + MCD_remVariants.remSrcRsdIncr[channel] = srcRsdIncr;
16926 + MCD_remVariants.remDestRsdIncr[channel] = destRsdIncr;
16927 + MCD_remVariants.remDestIncr[channel] = destIncr;
16928 + MCD_remVariants.remSrcIncr[channel] = srcIncr;
16929 + MCD_remVariants.remXferSize[channel] = xferSize;
16931 + cSave = (int*)(MCD_taskTable[channel].contextSaveSpace)
16935 +#ifdef MCD_INCLUDE_EU
16936 + realFuncArray = (u32 *) (MCD_taskTable[channel].FDTandFlags & 0xffffff00);
16939 + * Modify the LURC's normal and byte-residue-loop functions
16940 + * according to parameter.
16942 + switch (xferSize)
16945 + realFuncArray[(LURC*16)] = funcDesc;
16948 + realFuncArray[(LURC*16)] = funcDesc & 0xfffff00f;
16952 + realFuncArray[(LURC*16)] = funcDesc & 0xffff000f;
16956 + realFuncArray[(LURC*16+1)] = 0
16957 + | (funcDesc & MCD_BYTE_SWAP_KILLER)
16958 + | MCD_NO_BYTE_SWAP_ATALL;
16961 + /* Write the initiator field in the TCR and set the initiator-hold bit*/
16962 + MCD_dmaBar->taskControl[channel] = 0
16963 + | (initiator << 8)
16964 + | TASK_CTL_HIPRITSKEN
16965 + | TASK_CTL_HLDINITNUM;
16968 + * Current versions of the MPC8220 MCD have a hardware quirk that could
16969 + * cause the write to the TCR to collide with an MDE access to the
16970 + * initiator-register file, so we have to verify that the write occurred
16971 + * correctly by reading back the value. On MCF547x/8x devices and any
16972 + * future revisions of the MPC8220, this loop will not be entered.
16974 + while(((MCD_dmaBar->taskControl[channel] & 0x1fff) !=
16975 + ((initiator << 8) | TASK_CTL_HIPRITSKEN | TASK_CTL_HLDINITNUM)) &&
16976 + (tcrCount < 1000))
16979 + MCD_dmaBar->taskControl[channel] = 0
16980 + | (initiator << 8)
16981 + | TASK_CTL_HIPRITSKEN
16982 + | TASK_CTL_HLDINITNUM;
16985 + MCD_dmaBar->priority[channel] = (u8)priority & PRIORITY_PRI_MASK;
16987 + if (channel < 8 && channel >= 0)
16989 + MCD_dmaBar->taskSize0 &= ~(0xf << (7-channel)*4);
16990 + MCD_dmaBar->taskSize0 |= (xferSize & 3) << (((7 - channel)*4) + 2);
16991 + MCD_dmaBar->taskSize0 |= (xferSize & 3) << ((7 - channel)*4);
16995 + MCD_dmaBar->taskSize1 &= ~(0xf << (15-channel)*4);
16996 + MCD_dmaBar->taskSize1 |= (xferSize & 3) << (((15 - channel)*4) + 2);
16997 + MCD_dmaBar->taskSize1 |= (xferSize & 3) << ((15 - channel)*4);
17000 + /* Setup task table flags/options */
17001 + MCD_taskTable[channel].FDTandFlags &= ~MCD_TT_FLAGS_MASK;
17002 + MCD_taskTable[channel].FDTandFlags |= (MCD_TT_FLAGS_MASK & flags);
17004 + if (flags & MCD_FECTX_DMA)
17006 + /* TDTStart and TDTEnd */
17007 + MCD_taskTable[channel].TDTstart = MCD_modelTaskTable[TASK_FECTX].TDTstart;
17008 + MCD_taskTable[channel].TDTend = MCD_modelTaskTable[TASK_FECTX].TDTend;
17009 + MCD_startDmaENetXmit(srcAddr, srcAddr, destAddr, MCD_taskTable, channel);
17011 + else if (flags & MCD_FECRX_DMA)
17013 + /* TDTStart and TDTEnd */
17014 + MCD_taskTable[channel].TDTstart = MCD_modelTaskTable[TASK_FECRX].TDTstart;
17015 + MCD_taskTable[channel].TDTend = MCD_modelTaskTable[TASK_FECRX].TDTend;
17016 + MCD_startDmaENetRcv(srcAddr, srcAddr, destAddr, MCD_taskTable, channel);
17018 + else if(flags & MCD_SINGLE_DMA)
17021 + * This buffer descriptor is used for storing off initial parameters
17022 + * for later progress query calculation and for the DMA to write the
17023 + * resulting checksum. The DMA does not use this to determine how to
17024 + * operate, that info is passed with the init routine
17026 + MCD_relocBuffDesc[channel].srcAddr = srcAddr;
17027 + MCD_relocBuffDesc[channel].destAddr = destAddr;
17028 + MCD_relocBuffDesc[channel].lastDestAddr = destAddr;
17029 + MCD_relocBuffDesc[channel].dmaSize = dmaSize;
17030 + MCD_relocBuffDesc[channel].flags = 0; /* not used */
17031 + MCD_relocBuffDesc[channel].csumResult = 0; /* not used */
17032 + MCD_relocBuffDesc[channel].next = 0; /* not used */
17034 + /* Initialize the progress-querying stuff to show no progress:*/
17035 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[SRCPTR + CSAVE_OFFSET]
17037 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[DESTPTR + CSAVE_OFFSET]
17039 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[DCOUNT + CSAVE_OFFSET]
17041 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[CURRBD + CSAVE_OFFSET]
17042 + = (u32) &(MCD_relocBuffDesc[channel]);
17044 + if( funcDesc == MCD_FUNC_NOEU1 || funcDesc == MCD_FUNC_NOEU2)
17046 + /* TDTStart and TDTEnd */
17047 + MCD_taskTable[channel].TDTstart = MCD_modelTaskTable[TASK_SINGLENOEU].TDTstart;
17048 + MCD_taskTable[channel].TDTend = MCD_modelTaskTable[TASK_SINGLENOEU].TDTend;
17049 + MCD_startDmaSingleNoEu(srcAddr, srcIncr, destAddr, destIncr, dmaSize,
17050 + xferSizeIncr, flags, (int *)&(MCD_relocBuffDesc[channel]),
17051 + cSave, MCD_taskTable, channel);
17055 + /* TDTStart and TDTEnd */
17056 + MCD_taskTable[channel].TDTstart = MCD_modelTaskTable[TASK_SINGLEEU].TDTstart;
17057 + MCD_taskTable[channel].TDTend = MCD_modelTaskTable[TASK_SINGLEEU].TDTend;
17058 + MCD_startDmaSingleEu(srcAddr, srcIncr, destAddr, destIncr, dmaSize,
17059 + xferSizeIncr, flags, (int *)&(MCD_relocBuffDesc[channel]),
17060 + cSave, MCD_taskTable, channel);
17063 + else /* Chained DMA */
17065 + /* Initialize the progress-querying stuff to show no progress:*/
17066 +#if 1 /* (!defined(MCD_NEED_ADDR_TRANS)) */
17067 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[SRCPTR + CSAVE_OFFSET]
17068 + = (int)((MCD_bufDesc*) srcAddr)->srcAddr;
17069 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[DESTPTR + CSAVE_OFFSET]
17070 + = (int)((MCD_bufDesc*) srcAddr)->destAddr;
17071 +#else /* if using address translation, need the virtual addr of the first buffdesc */
17072 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[SRCPTR + CSAVE_OFFSET]
17073 + = (int)((MCD_bufDesc*) srcAddrVirt)->srcAddr;
17074 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[DESTPTR + CSAVE_OFFSET]
17075 + = (int)((MCD_bufDesc*) srcAddrVirt)->destAddr;
17077 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[DCOUNT + CSAVE_OFFSET]
17079 + ((volatile int *)MCD_taskTable[channel].contextSaveSpace)[CURRBD + CSAVE_OFFSET]
17082 + if( funcDesc == MCD_FUNC_NOEU1 || funcDesc == MCD_FUNC_NOEU2)
17084 + /* TDTStart and TDTEnd */
17085 + MCD_taskTable[channel].TDTstart = MCD_modelTaskTable[TASK_CHAINNOEU].TDTstart;
17086 + MCD_taskTable[channel].TDTend = MCD_modelTaskTable[TASK_CHAINNOEU].TDTend;
17087 + MCD_startDmaChainNoEu((int *)srcAddr, srcIncr, destIncr, xferSize,
17088 + xferSizeIncr, cSave, MCD_taskTable, channel);
17092 + /* TDTStart and TDTEnd */
17093 + MCD_taskTable[channel].TDTstart = MCD_modelTaskTable[TASK_CHAINEU].TDTstart;
17094 + MCD_taskTable[channel].TDTend = MCD_modelTaskTable[TASK_CHAINEU].TDTend;
17095 + MCD_startDmaChainEu((int *)srcAddr, srcIncr, destIncr, xferSize,
17096 + xferSizeIncr, cSave, MCD_taskTable, channel);
17100 + MCD_chStatus[channel] = MCD_IDLE;
17104 +/************************ End of MCD_startDma() *********************/
17106 +/********************************************************************/
17107 +/* Function: MCD_XferProgrQuery
17108 + * Purpose: Returns progress of DMA on requested channel
17109 + * Arguments: channel - channel to retrieve progress for
17110 + * progRep - pointer to user supplied MCD_XferProg struct
17111 + * Returns: MCD_CHANNEL_INVALID if channel is invalid, else MCD_OK
17114 + * MCD_XferProgrQuery() upon completing or after aborting a DMA, or
17115 + * while the DMA is in progress, this function returns the first
17116 + * DMA-destination address not (or not yet) used in the DMA. When
17117 + * encountering a non-ready buffer descriptor, the information for
17118 + * the last completed descriptor is returned.
17120 + * MCD_XferProgQuery() has to avoid the possibility of getting
17121 + * partially-updated information in the event that we should happen
17122 + * to query DMA progress just as the DMA is updating it. It does that
17123 + * by taking advantage of the fact context is not saved frequently for
17124 + * the most part. We therefore read it at least twice until we get the
17125 + * same information twice in a row.
17127 + * Because a small, but not insignificant, amount of time is required
17128 + * to write out the progress-query information, especially upon
17129 + * completion of the DMA, it would be wise to guarantee some time lag
17130 + * between successive readings of the progress-query information.
17134 + * How many iterations of the loop below to execute to stabilize values
17136 +#define STABTIME 0
17138 +int MCD_XferProgrQuery (int channel, MCD_XferProg *progRep)
17140 + MCD_XferProg prevRep;
17141 + int again; /* true if we are to try again to get consistent results */
17142 + int i; /* used as a time-waste counter */
17143 + int destDiffBytes; /* Total number of bytes that we think actually got xfered. */
17144 + int numIterations; /* number of iterations */
17145 + int bytesNotXfered; /* bytes that did not get xfered. */
17146 + s8 *LWAlignedInitDestAddr, *LWAlignedCurrDestAddr;
17147 + int subModVal, addModVal; /* Mode values to added and subtracted from the
17148 + final destAddr */
17150 + if((channel < 0) || (channel >= NCHANNELS))
17151 + return(MCD_CHANNEL_INVALID);
17153 + /* Read a trial value for the progress-reporting values*/
17154 + prevRep.lastSrcAddr =
17155 + (s8 *) ((volatile int*) MCD_taskTable[channel].contextSaveSpace)[SRCPTR + CSAVE_OFFSET];
17156 + prevRep.lastDestAddr =
17157 + (s8 *) ((volatile int*) MCD_taskTable[channel].contextSaveSpace)[DESTPTR + CSAVE_OFFSET];
17158 + prevRep.dmaSize = ((volatile int*) MCD_taskTable[channel].contextSaveSpace)[DCOUNT + CSAVE_OFFSET];
17159 + prevRep.currBufDesc =
17160 + (MCD_bufDesc*) ((volatile int*) MCD_taskTable[channel].contextSaveSpace)[CURRBD + CSAVE_OFFSET];
17162 + /* Repeatedly reread those values until they match previous values: */
17164 + /* Take a little bit of time to ensure stability: */
17165 + for (i = 0; i < STABTIME; i++)
17166 + i += i >> 2; /* make sure this loop does something so that it
17167 + doesn't get optimized out */
17168 + /* Check them again: */
17169 + progRep->lastSrcAddr =
17170 + (s8 *) ((volatile int*) MCD_taskTable[channel].contextSaveSpace)[SRCPTR + CSAVE_OFFSET];
17171 + progRep->lastDestAddr =
17172 + (s8 *) ((volatile int*) MCD_taskTable[channel].contextSaveSpace)[DESTPTR + CSAVE_OFFSET];
17173 + progRep->dmaSize = ((volatile int*) MCD_taskTable[channel].contextSaveSpace)[DCOUNT + CSAVE_OFFSET];
17174 + progRep->currBufDesc =
17175 + (MCD_bufDesc*) ((volatile int*) MCD_taskTable[channel].contextSaveSpace)[CURRBD + CSAVE_OFFSET];
17177 + /* See if they match: */
17178 + if ( prevRep.lastSrcAddr != progRep->lastSrcAddr
17179 + || prevRep.lastDestAddr != progRep->lastDestAddr
17180 + || prevRep.dmaSize != progRep->dmaSize
17181 + || prevRep.currBufDesc != progRep->currBufDesc)
17183 + /* If they don't match, remember previous values and try again:*/
17184 + prevRep.lastSrcAddr = progRep->lastSrcAddr;
17185 + prevRep.lastDestAddr = progRep->lastDestAddr;
17186 + prevRep.dmaSize = progRep->dmaSize;
17187 + prevRep.currBufDesc = progRep->currBufDesc;
17188 + again = MCD_TRUE;
17191 + again = MCD_FALSE;
17192 + } while (again == MCD_TRUE);
17195 + /* Update dmaSize and lastDestAddr */
17196 + switch(MCD_remVariants.remDestRsdIncr[channel])
17199 + subModVal = ((int)progRep->lastDestAddr)
17200 + & ((MCD_remVariants.remXferSize[channel]) - 1);
17201 + addModVal = ((int)progRep->currBufDesc->destAddr)
17202 + & ((MCD_remVariants.remXferSize[channel]) - 1);
17203 + LWAlignedInitDestAddr = (progRep->currBufDesc->destAddr) - addModVal;
17204 + LWAlignedCurrDestAddr = (progRep->lastDestAddr) - subModVal;
17205 + destDiffBytes = LWAlignedInitDestAddr - LWAlignedCurrDestAddr;
17206 + bytesNotXfered = (destDiffBytes/MCD_remVariants.remDestIncr[channel]) *
17207 + ( MCD_remVariants.remDestIncr[channel]
17208 + + MCD_remVariants.remXferSize[channel]);
17209 + progRep->dmaSize = destDiffBytes - bytesNotXfered + addModVal - subModVal;
17212 + progRep->lastDestAddr = progRep->currBufDesc->destAddr;
17215 + /* This value has to be subtracted from the final calculated dmaSize. */
17216 + subModVal = ((int)progRep->currBufDesc->destAddr)
17217 + & ((MCD_remVariants.remXferSize[channel]) - 1);
17218 + /* These bytes are already in lastDestAddr. */
17219 + addModVal = ((int)progRep->lastDestAddr)
17220 + & ((MCD_remVariants.remXferSize[channel]) - 1);
17221 + LWAlignedInitDestAddr = (progRep->currBufDesc->destAddr) - subModVal;
17222 + LWAlignedCurrDestAddr = (progRep->lastDestAddr) - addModVal;
17223 + destDiffBytes = (progRep->lastDestAddr - LWAlignedInitDestAddr);
17224 + numIterations = ( LWAlignedCurrDestAddr - LWAlignedInitDestAddr)/MCD_remVariants.remDestIncr[channel];
17225 + bytesNotXfered = numIterations *
17226 + (MCD_remVariants.remDestIncr[channel]
17227 + - MCD_remVariants.remXferSize[channel]);
17228 + progRep->dmaSize = destDiffBytes - bytesNotXfered - subModVal;
17234 + /* This covers M1,P1,Z for source */
17235 + switch(MCD_remVariants.remSrcRsdIncr[channel])
17238 + progRep->lastSrcAddr =
17239 + progRep->currBufDesc->srcAddr +
17240 + ( MCD_remVariants.remSrcIncr[channel] *
17241 + (progRep->dmaSize/MCD_remVariants.remXferSize[channel]));
17244 + progRep->lastSrcAddr = progRep->currBufDesc->srcAddr;
17247 + progRep->lastSrcAddr =
17248 + progRep->currBufDesc->srcAddr +
17249 + ( MCD_remVariants.remSrcIncr[channel] *
17250 + (progRep->dmaSize/MCD_remVariants.remXferSize[channel]));
17258 +/******************* End of MCD_XferProgrQuery() ********************/
17260 +/********************************************************************/
17261 +/* MCD_resmActions() does the majority of the actions of a DMA resume.
17262 + * It is called from MCD_killDma() and MCD_resumeDma(). It has to be
17263 + * a separate function because the kill function has to negate the task
17264 + * enable before resuming it, but the resume function has to do nothing
17265 + * if there is no DMA on that channel (i.e., if the enable bit is 0).
17267 +static void MCD_resmActions (int channel)
17269 + MCD_dmaBar->debugControl = DBG_CTL_DISABLE;
17270 + MCD_dmaBar->debugStatus = MCD_dmaBar->debugStatus;
17272 + /* Determine which initiators are asserted */
17273 + MCD_dmaBar->ptdDebug = PTD_DBG_TSK_VLD_INIT;
17275 + if((MCD_dmaBar->ptdDebug >> channel ) & 0x1)
17276 + MCD_chStatus[channel] = MCD_RUNNING;
17278 + MCD_chStatus[channel] = MCD_IDLE;
17280 +/********************* End of MCD_resmActions() *********************/
17282 +/********************************************************************/
17283 +/* Function: MCD_killDma
17284 + * Purpose: Halt the DMA on the requested channel, without any
17285 + * intention of resuming the DMA.
17286 + * Arguments: channel - requested channel
17287 + * Returns: MCD_CHANNEL_INVALID if channel is invalid, else MCD_OK
17290 + * A DMA may be killed from any state, including paused state, and it
17291 + * always goes to the MCD_HALTED state even if it is killed while in
17292 + * the MCD_NO_DMA or MCD_IDLE states.
17294 +int MCD_killDma (int channel)
17296 + if((channel < 0) || (channel >= NCHANNELS))
17297 + return(MCD_CHANNEL_INVALID);
17299 + MCD_dmaBar->taskControl[channel] = 0x0;
17301 + /* Clean up after a paused task */
17302 + if (MCD_chStatus[channel] == MCD_PAUSED)
17304 + MCD_dmaBar->debugControl = DBG_CTL_DISABLE;
17305 + MCD_dmaBar->debugStatus = MCD_dmaBar->debugStatus;
17308 + MCD_chStatus[channel] = MCD_HALTED;
17312 +/************************ End of MCD_killDma() **********************/
17314 +/********************************************************************/
17315 +/* Function: MCD_continDma
17316 + * Purpose: Continue a DMA which as stopped due to encountering an
17317 + * unready buffer descriptor.
17318 + * Arguments: channel - channel to continue the DMA on
17319 + * Returns: MCD_CHANNEL_INVALID if channel is invalid, else MCD_OK
17322 + * This routine does not check to see if there is a task which can
17323 + * be continued. Also this routine should not be used with single DMAs.
17325 +int MCD_continDma (int channel)
17327 + if((channel < 0) || (channel >= NCHANNELS))
17328 + return(MCD_CHANNEL_INVALID);
17330 + MCD_dmaBar->taskControl[channel] |= TASK_CTL_EN;
17331 + MCD_chStatus[channel] = MCD_RUNNING;
17335 +/********************** End of MCD_continDma() **********************/
17337 +/*********************************************************************
17338 + * MCD_pauseDma() and MCD_resumeDma() below use the DMA's debug unit
17339 + * to freeze a task and resume it. We freeze a task by breakpointing
17340 + * on the stated task. That is, not any specific place in the task,
17341 + * but any time that task executes. In particular, when that task
17342 + * executes, we want to freeze that task and only that task.
17344 + * The bits of the debug control register influence interrupts vs.
17345 + * breakpoints as follows:
17346 + * - Bits 14 and 0 enable or disable debug functions. If enabled, you
17347 + * will get the interrupt but you may or may not get a breakpoint.
17348 + * - Bits 2 and 1 decide whether you also get a breakpoint in addition
17349 + * to an interrupt.
17351 + * The debug unit can do these actions in response to either internally
17352 + * detected breakpoint conditions from the comparators, or in response
17353 + * to the external breakpoint pin, or both.
17354 + * - Bits 14 and 1 perform the above-described functions for
17355 + * internally-generated conditions, i.e., the debug comparators.
17356 + * - Bits 0 and 2 perform the above-described functions for external
17357 + * conditions, i.e., the breakpoint external pin.
17359 + * Note that, although you "always" get the interrupt when you turn
17360 + * the debug functions, the interrupt can nevertheless, if desired, be
17361 + * masked by the corresponding bit in the PTD's IMR. Note also that
17362 + * this means that bits 14 and 0 must enable debug functions before
17363 + * bits 1 and 2, respectively, have any effect.
17365 + * NOTE: It's extremely important to not pause more than one DMA channel
17367 + ********************************************************************/
17369 +/********************************************************************/
17370 +/* Function: MCD_pauseDma
17371 + * Purpose: Pauses the DMA on a given channel (if any DMA is running
17372 + * on that channel).
17373 + * Arguments: channel
17374 + * Returns: MCD_CHANNEL_INVALID if channel is invalid, else MCD_OK
17376 +int MCD_pauseDma (int channel)
17378 + if((channel < 0) || (channel >= NCHANNELS))
17379 + return(MCD_CHANNEL_INVALID);
17381 + if (MCD_dmaBar->taskControl[channel] & TASK_CTL_EN)
17383 + MCD_dmaBar->debugComp1 = channel;
17384 + MCD_dmaBar->debugControl = DBG_CTL_ENABLE | (1 << (channel + 16));
17385 + MCD_chStatus[channel] = MCD_PAUSED;
17389 +/************************* End of MCD_pauseDma() ********************/
17391 +/********************************************************************/
17392 +/* Function: MCD_resumeDma
17393 + * Purpose: Resumes the DMA on a given channel (if any DMA is
17394 + * running on that channel).
17395 + * Arguments: channel - channel on which to resume DMA
17396 + * Returns: MCD_CHANNEL_INVALID if channel is invalid, else MCD_OK
17398 +int MCD_resumeDma (int channel)
17400 + if((channel < 0) || (channel >= NCHANNELS))
17401 + return(MCD_CHANNEL_INVALID);
17403 + if (MCD_dmaBar->taskControl[channel] & TASK_CTL_EN)
17404 + MCD_resmActions (channel);
17408 +/************************ End of MCD_resumeDma() ********************/
17410 +/********************************************************************/
17411 +/* Function: MCD_csumQuery
17412 + * Purpose: Provide the checksum after performing a non-chained DMA
17413 + * Arguments: channel - channel to report on
17414 + * csum - pointer to where to write the checksum/CRC
17415 + * Returns: MCD_ERROR if the channel is invalid, else MCD_OK
17420 +int MCD_csumQuery (int channel, u32 *csum)
17422 +#ifdef MCD_INCLUDE_EU
17423 + if((channel < 0) || (channel >= NCHANNELS))
17424 + return(MCD_CHANNEL_INVALID);
17426 + *csum = MCD_relocBuffDesc[channel].csumResult;
17429 + return(MCD_ERROR);
17432 +/*********************** End of MCD_resumeDma() *********************/
17434 +/********************************************************************/
17435 +/* Function: MCD_getCodeSize
17436 + * Purpose: Provide the size requirements of the microcoded tasks
17437 + * Returns: Size in bytes
17439 +int MCD_getCodeSize(void)
17441 +#ifdef MCD_INCLUDE_EU
17447 +/********************** End of MCD_getCodeSize() ********************/
17449 +/********************************************************************/
17450 +/* Function: MCD_getVersion
17451 + * Purpose: Provide the version string and number
17452 + * Arguments: longVersion - user supplied pointer to a pointer to a char
17453 + * which points to the version string
17454 + * Returns: Version number and version string (by reference)
17456 +char MCD_versionString[] = "Multi-channel DMA API v1.0";
17457 +#define MCD_REV_MAJOR 0x01
17458 +#define MCD_REV_MINOR 0x00
17460 +int MCD_getVersion(char **longVersion)
17462 + *longVersion = MCD_versionString;
17463 + return((MCD_REV_MAJOR << 8) | MCD_REV_MINOR);
17465 +/********************** End of MCD_getVersion() *********************/
17467 +/********************************************************************/
17468 +/* Private version of memcpy()
17469 + * Note that everything this is used for is longword-aligned.
17471 +static void MCD_memcpy (int *dest, int *src, u32 size)
17475 + for (i = 0; i < size; i += sizeof(int), dest++, src++)
17478 +/********************************************************************/
17480 +++ b/drivers/dma/MCD_dma.h
17483 + * drivers/dma/MCD_dma.h
17485 + * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
17486 + * Kurt Mahan <kmahan@freescale.com>
17488 + * This program is free software; you can redistribute it and/or
17489 + * modify it under the terms of the GNU General Public License as
17490 + * published by the Free Software Foundation; either version 2 of
17491 + * the License, or (at your option) any later version.
17493 + * This program is distributed in the hope that it will be useful,
17494 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17495 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17496 + * GNU General Public License for more details.
17498 + * You should have received a copy of the GNU General Public License
17499 + * along with this program; if not, write to the Free Software
17500 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17501 + * MA 02111-1307 USA
17503 +#ifndef _MCD_API_H
17504 +#define _MCD_API_H
17507 + * Turn Execution Unit tasks ON (#define) or OFF (#undef)
17509 +#undef MCD_INCLUDE_EU
17512 + * Number of DMA channels
17514 +#define NCHANNELS 16
17517 + * Total number of variants
17519 +#ifdef MCD_INCLUDE_EU
17520 +#define NUMOFVARIANTS 6
17522 +#define NUMOFVARIANTS 4
17526 + * Define sizes of the various tables
17528 +#define TASK_TABLE_SIZE (NCHANNELS*32)
17529 +#define VAR_TAB_SIZE (128)
17530 +#define CONTEXT_SAVE_SIZE (128)
17531 +#define FUNCDESC_TAB_SIZE (256)
17533 +#ifdef MCD_INCLUDE_EU
17534 +#define FUNCDESC_TAB_NUM 16
17536 +#define FUNCDESC_TAB_NUM 1
17540 +#ifndef DEFINESONLY
17543 + * Portability typedefs
17546 +typedef unsigned int u32;
17547 +typedef short s16;
17548 +typedef unsigned short u16;
17550 +typedef unsigned char u8;
17553 + * These structures represent the internal registers of the
17554 + * multi-channel DMA
17556 +struct dmaRegs_s {
17557 + u32 taskbar; /* task table base address register */
17562 + u16 ptdControl; /* ptd control */
17563 + u32 intPending; /* interrupt pending register */
17564 + u32 intMask; /* interrupt mask register */
17565 + u16 taskControl[16]; /* task control registers */
17566 + u8 priority[32]; /* priority registers */
17567 + u32 initiatorMux; /* initiator mux control */
17568 + u32 taskSize0; /* task size control register 0. */
17569 + u32 taskSize1; /* task size control register 1. */
17570 + u32 dma_rsvd1; /* reserved */
17571 + u32 dma_rsvd2; /* reserved */
17572 + u32 debugComp1; /* debug comparator 1 */
17573 + u32 debugComp2; /* debug comparator 2 */
17574 + u32 debugControl; /* debug control */
17575 + u32 debugStatus; /* debug status */
17576 + u32 ptdDebug; /* priority task decode debug */
17577 + u32 dma_rsvd3[31]; /* reserved */
17579 +typedef volatile struct dmaRegs_s dmaRegs;
17584 + * PTD contrl reg bits
17586 +#define PTD_CTL_TSK_PRI 0x8000
17587 +#define PTD_CTL_COMM_PREFETCH 0x0001
17590 + * Task Control reg bits and field masks
17592 +#define TASK_CTL_EN 0x8000
17593 +#define TASK_CTL_VALID 0x4000
17594 +#define TASK_CTL_ALWAYS 0x2000
17595 +#define TASK_CTL_INIT_MASK 0x1f00
17596 +#define TASK_CTL_ASTRT 0x0080
17597 +#define TASK_CTL_HIPRITSKEN 0x0040
17598 +#define TASK_CTL_HLDINITNUM 0x0020
17599 +#define TASK_CTL_ASTSKNUM_MASK 0x000f
17602 + * Priority reg bits and field masks
17604 +#define PRIORITY_HLD 0x80
17605 +#define PRIORITY_PRI_MASK 0x07
17608 + * Debug Control reg bits and field masks
17610 +#define DBG_CTL_BLOCK_TASKS_MASK 0xffff0000
17611 +#define DBG_CTL_AUTO_ARM 0x00008000
17612 +#define DBG_CTL_BREAK 0x00004000
17613 +#define DBG_CTL_COMP1_TYP_MASK 0x00003800
17614 +#define DBG_CTL_COMP2_TYP_MASK 0x00000070
17615 +#define DBG_CTL_EXT_BREAK 0x00000004
17616 +#define DBG_CTL_INT_BREAK 0x00000002
17619 + * PTD Debug reg selector addresses
17620 + * This reg must be written with a value to show the contents of
17621 + * one of the desired internal register.
17623 +#define PTD_DBG_REQ 0x00 /* shows the state of 31 initiators */
17624 +#define PTD_DBG_TSK_VLD_INIT 0x01 /* shows which 16 tasks are valid and
17625 + have initiators asserted */
17629 + * General return values
17632 +#define MCD_ERROR -1
17633 +#define MCD_TABLE_UNALIGNED -2
17634 +#define MCD_CHANNEL_INVALID -3
17637 + * MCD_initDma input flags
17639 +#define MCD_RELOC_TASKS 0x00000001
17640 +#define MCD_NO_RELOC_TASKS 0x00000000
17641 +#define MCD_COMM_PREFETCH_EN 0x00000002 /* Commbus Prefetching - MCF547x/548x ONLY */
17644 + * MCD_dmaStatus Status Values for each channel
17646 +#define MCD_NO_DMA 1 /* No DMA has been requested since reset */
17647 +#define MCD_IDLE 2 /* DMA active, but the initiator is currently inactive */
17648 +#define MCD_RUNNING 3 /* DMA active, and the initiator is currently active */
17649 +#define MCD_PAUSED 4 /* DMA active but it is currently paused */
17650 +#define MCD_HALTED 5 /* the most recent DMA has been killed with MCD_killTask() */
17651 +#define MCD_DONE 6 /* the most recent DMA has completed. */
17655 + * MCD_startDma parameter defines
17659 + * Constants for the funcDesc parameter
17661 +/* Byte swapping: */
17662 +#define MCD_NO_BYTE_SWAP 0x00045670 /* to disable byte swapping. */
17663 +#define MCD_BYTE_REVERSE 0x00076540 /* to reverse the bytes of each u32 of the DMAed data. */
17664 +#define MCD_U16_REVERSE 0x00067450 /* to reverse the 16-bit halves of
17665 + each 32-bit data value being DMAed.*/
17666 +#define MCD_U16_BYTE_REVERSE 0x00054760 /* to reverse the byte halves of each
17667 + 16-bit half of each 32-bit data value DMAed */
17668 +#define MCD_NO_BIT_REV 0x00000000 /* do not reverse the bits of each byte DMAed. */
17669 +#define MCD_BIT_REV 0x00088880 /* reverse the bits of each byte DMAed */
17671 +#define MCD_CRC16 0xc0100000 /* to perform CRC-16 on DMAed data. */
17672 +#define MCD_CRCCCITT 0xc0200000 /* to perform CRC-CCITT on DMAed data. */
17673 +#define MCD_CRC32 0xc0300000 /* to perform CRC-32 on DMAed data. */
17674 +#define MCD_CSUMINET 0xc0400000 /* to perform internet checksums on DMAed data.*/
17675 +#define MCD_NO_CSUM 0xa0000000 /* to perform no checksumming. */
17677 +#define MCD_FUNC_NOEU1 (MCD_NO_BYTE_SWAP | MCD_NO_BIT_REV | MCD_NO_CSUM)
17678 +#define MCD_FUNC_NOEU2 (MCD_NO_BYTE_SWAP | MCD_NO_CSUM)
17681 + * Constants for the flags parameter
17683 +#define MCD_TT_FLAGS_RL 0x00000001 /* Read line */
17684 +#define MCD_TT_FLAGS_CW 0x00000002 /* Combine Writes */
17685 +#define MCD_TT_FLAGS_SP 0x00000004 /* Speculative prefetch(XLB) MCF547x/548x ONLY */
17686 +#define MCD_TT_FLAGS_PI 0x00000040 /* Precise Increment */
17687 +#define MCD_TT_FLAGS_MASK 0x000000ff
17688 +#define MCD_TT_FLAGS_DEF (MCD_TT_FLAGS_RL | MCD_TT_FLAGS_CW)
17690 +#define MCD_SINGLE_DMA 0x00000100 /* Unchained DMA */
17691 +#define MCD_CHAIN_DMA /* TBD */
17692 +#define MCD_EU_DMA /* TBD */
17693 +#define MCD_FECTX_DMA 0x00001000 /* FEC TX ring DMA */
17694 +#define MCD_FECRX_DMA 0x00002000 /* FEC RX ring DMA */
17697 +/* these flags are valid for MCD_startDma and the chained buffer descriptors */
17698 +#define MCD_BUF_READY 0x80000000 /* indicates that this buffer is now under the DMA's control */
17699 +#define MCD_WRAP 0x20000000 /* to tell the FEC Dmas to wrap to the first BD */
17700 +#define MCD_INTERRUPT 0x10000000 /* to generate an interrupt after completion of the DMA. */
17701 +#define MCD_END_FRAME 0x08000000 /* tell the DMA to end the frame when transferring
17702 + last byte of data in buffer */
17703 +#define MCD_CRC_RESTART 0x40000000 /* to empty out the accumulated checksum
17704 + prior to performing the DMA. */
17706 +/* Defines for the FEC buffer descriptor control/status word*/
17707 +#define MCD_FEC_BUF_READY 0x8000
17708 +#define MCD_FEC_WRAP 0x2000
17709 +#define MCD_FEC_INTERRUPT 0x1000
17710 +#define MCD_FEC_END_FRAME 0x0800
17714 + * Defines for general intuitiveness
17717 +#define MCD_TRUE 1
17718 +#define MCD_FALSE 0
17721 + * Three different cases for destination and source.
17727 +#ifndef DEFINESONLY
17729 +/* Task Table Entry struct*/
17731 + u32 TDTstart; /* task descriptor table start */
17732 + u32 TDTend; /* task descriptor table end */
17733 + u32 varTab; /* variable table start */
17734 + u32 FDTandFlags; /* function descriptor table start and flags */
17735 + volatile u32 descAddrAndStatus;
17736 + volatile u32 modifiedVarTab;
17737 + u32 contextSaveSpace; /* context save space start */
17738 + u32 literalBases;
17742 +/* Chained buffer descriptor */
17743 +typedef volatile struct MCD_bufDesc_struct MCD_bufDesc;
17744 +struct MCD_bufDesc_struct {
17745 + u32 flags; /* flags describing the DMA */
17746 + u32 csumResult; /* checksum from checksumming performed since last checksum reset */
17747 + s8 *srcAddr; /* the address to move data from */
17748 + s8 *destAddr; /* the address to move data to */
17749 + s8 *lastDestAddr; /* the last address written to */
17750 + u32 dmaSize; /* the number of bytes to transfer independent of the transfer size */
17751 + MCD_bufDesc *next; /* next buffer descriptor in chain */
17752 + u32 info; /* private information about this descriptor; DMA does not affect it */
17755 +/* Progress Query struct */
17756 +typedef volatile struct MCD_XferProg_struct {
17757 + s8 *lastSrcAddr; /* the most-recent or last, post-increment source address */
17758 + s8 *lastDestAddr; /* the most-recent or last, post-increment destination address */
17759 + u32 dmaSize; /* the amount of data transferred for the current buffer */
17760 + MCD_bufDesc *currBufDesc;/* pointer to the current buffer descriptor being DMAed */
17764 +/* FEC buffer descriptor */
17765 +typedef volatile struct MCD_bufDescFec_struct {
17772 +/*************************************************************************/
17774 + * API function Prototypes - see MCD_dmaApi.c for further notes
17778 + * MCD_startDma starts a particular kind of DMA .
17780 +int MCD_startDma (
17781 + int channel, /* the channel on which to run the DMA */
17782 + s8 *srcAddr, /* the address to move data from, or buffer-descriptor address */
17783 + s16 srcIncr, /* the amount to increment the source address per transfer */
17784 + s8 *destAddr, /* the address to move data to */
17785 + s16 destIncr, /* the amount to increment the destination address per transfer */
17786 + u32 dmaSize, /* the number of bytes to transfer independent of the transfer size */
17787 + u32 xferSize, /* the number bytes in of each data movement (1, 2, or 4) */
17788 + u32 initiator, /* what device initiates the DMA */
17789 + int priority, /* priority of the DMA */
17790 + u32 flags, /* flags describing the DMA */
17791 + u32 funcDesc /* a description of byte swapping, bit swapping, and CRC actions */
17795 + * MCD_initDma() initializes the DMA API by setting up a pointer to the DMA
17796 + * registers, relocating and creating the appropriate task structures, and
17797 + * setting up some global settings
17799 +int MCD_initDma (dmaRegs *sDmaBarAddr, void *taskTableDest, u32 flags);
17802 + * MCD_dmaStatus() returns the status of the DMA on the requested channel.
17804 +int MCD_dmaStatus (int channel);
17807 + * MCD_XferProgrQuery() returns progress of DMA on requested channel
17809 +int MCD_XferProgrQuery (int channel, MCD_XferProg *progRep);
17812 + * MCD_killDma() halts the DMA on the requested channel, without any
17813 + * intention of resuming the DMA.
17815 +int MCD_killDma (int channel);
17818 + * MCD_continDma() continues a DMA which as stopped due to encountering an
17819 + * unready buffer descriptor.
17821 +int MCD_continDma (int channel);
17824 + * MCD_pauseDma() pauses the DMA on the given channel ( if any DMA is
17825 + * running on that channel).
17827 +int MCD_pauseDma (int channel);
17830 + * MCD_resumeDma() resumes the DMA on a given channel (if any DMA is
17831 + * running on that channel).
17833 +int MCD_resumeDma (int channel);
17836 + * MCD_csumQuery provides the checksum/CRC after performing a non-chained DMA
17838 +int MCD_csumQuery (int channel, u32 *csum);
17841 + * MCD_getCodeSize provides the packed size required by the microcoded task
17842 + * and structures.
17844 +int MCD_getCodeSize(void);
17847 + * MCD_getVersion provides a pointer to a version string and returns a
17848 + * version number.
17850 +int MCD_getVersion(char **longVersion);
17852 +/* macro for setting a location in the variable table */
17853 +#define MCD_SET_VAR(taskTab,idx,value) ((u32 *)(taskTab)->varTab)[idx] = value
17854 + /* Note that MCD_SET_VAR() is invoked many times in firing up a DMA function,
17855 + so I'm avoiding surrounding it with "do {} while(0)" */
17857 +#endif /* DEFINESONLY */
17859 +#endif /* _MCD_API_H */
17861 +++ b/drivers/dma/MCD_progCheck.h
17864 + * drivers/dma/MCD_progCheck.h
17866 + * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
17867 + * Kurt Mahan <kmahan@freescale.com>
17869 + * This program is free software; you can redistribute it and/or
17870 + * modify it under the terms of the GNU General Public License as
17871 + * published by the Free Software Foundation; either version 2 of
17872 + * the License, or (at your option) any later version.
17874 + * This program is distributed in the hope that it will be useful,
17875 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17876 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17877 + * GNU General Public License for more details.
17879 + * You should have received a copy of the GNU General Public License
17880 + * along with this program; if not, write to the Free Software
17881 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17882 + * MA 02111-1307 USA
17885 +/* This file is autogenerated. Do not change */
17892 +++ b/drivers/dma/MCD_tasks.c
17895 + * drivers/dma/MCD_tasks.c
17897 + * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
17898 + * Kurt Mahan <kmahan@freescale.com>
17900 + * This program is free software; you can redistribute it and/or
17901 + * modify it under the terms of the GNU General Public License as
17902 + * published by the Free Software Foundation; either version 2 of
17903 + * the License, or (at your option) any later version.
17905 + * This program is distributed in the hope that it will be useful,
17906 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17907 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17908 + * GNU General Public License for more details.
17910 + * You should have received a copy of the GNU General Public License
17911 + * along with this program; if not, write to the Free Software
17912 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17913 + * MA 02111-1307 USA
17916 +#include "MCD_dma.h"
17918 +u32 MCD_varTab0[];
17919 +u32 MCD_varTab1[];
17920 +u32 MCD_varTab2[];
17921 +u32 MCD_varTab3[];
17922 +u32 MCD_varTab4[];
17923 +u32 MCD_varTab5[];
17924 +u32 MCD_varTab6[];
17925 +u32 MCD_varTab7[];
17926 +u32 MCD_varTab8[];
17927 +u32 MCD_varTab9[];
17928 +u32 MCD_varTab10[];
17929 +u32 MCD_varTab11[];
17930 +u32 MCD_varTab12[];
17931 +u32 MCD_varTab13[];
17932 +u32 MCD_varTab14[];
17933 +u32 MCD_varTab15[];
17935 +u32 MCD_funcDescTab0[];
17936 +#ifdef MCD_INCLUDE_EU
17937 +u32 MCD_funcDescTab1[];
17938 +u32 MCD_funcDescTab2[];
17939 +u32 MCD_funcDescTab3[];
17940 +u32 MCD_funcDescTab4[];
17941 +u32 MCD_funcDescTab5[];
17942 +u32 MCD_funcDescTab6[];
17943 +u32 MCD_funcDescTab7[];
17944 +u32 MCD_funcDescTab8[];
17945 +u32 MCD_funcDescTab9[];
17946 +u32 MCD_funcDescTab10[];
17947 +u32 MCD_funcDescTab11[];
17948 +u32 MCD_funcDescTab12[];
17949 +u32 MCD_funcDescTab13[];
17950 +u32 MCD_funcDescTab14[];
17951 +u32 MCD_funcDescTab15[];
17954 +u32 MCD_contextSave0[];
17955 +u32 MCD_contextSave1[];
17956 +u32 MCD_contextSave2[];
17957 +u32 MCD_contextSave3[];
17958 +u32 MCD_contextSave4[];
17959 +u32 MCD_contextSave5[];
17960 +u32 MCD_contextSave6[];
17961 +u32 MCD_contextSave7[];
17962 +u32 MCD_contextSave8[];
17963 +u32 MCD_contextSave9[];
17964 +u32 MCD_contextSave10[];
17965 +u32 MCD_contextSave11[];
17966 +u32 MCD_contextSave12[];
17967 +u32 MCD_contextSave13[];
17968 +u32 MCD_contextSave14[];
17969 +u32 MCD_contextSave15[];
17971 +u32 MCD_realTaskTableSrc[] =
17975 + (u32)MCD_varTab0, /* Task 0 Variable Table */
17976 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
17979 + (u32)MCD_contextSave0, /* Task 0 context save space */
17983 + (u32)MCD_varTab1, /* Task 1 Variable Table */
17984 +#ifdef MCD_INCLUDE_EU
17985 + (u32)MCD_funcDescTab1, /* Task 1 Function Descriptor Table & Flags */
17987 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
17991 + (u32)MCD_contextSave1, /* Task 1 context save space */
17995 + (u32)MCD_varTab2, /* Task 2 Variable Table */
17996 +#ifdef MCD_INCLUDE_EU
17997 + (u32)MCD_funcDescTab2, /* Task 2 Function Descriptor Table & Flags */
17999 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18003 + (u32)MCD_contextSave2, /* Task 2 context save space */
18007 + (u32)MCD_varTab3, /* Task 3 Variable Table */
18008 +#ifdef MCD_INCLUDE_EU
18009 + (u32)MCD_funcDescTab3, /* Task 3 Function Descriptor Table & Flags */
18011 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18015 + (u32)MCD_contextSave3, /* Task 3 context save space */
18019 + (u32)MCD_varTab4, /* Task 4 Variable Table */
18020 +#ifdef MCD_INCLUDE_EU
18021 + (u32)MCD_funcDescTab4, /* Task 4 Function Descriptor Table & Flags */
18023 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18027 + (u32)MCD_contextSave4, /* Task 4 context save space */
18031 + (u32)MCD_varTab5, /* Task 5 Variable Table */
18032 +#ifdef MCD_INCLUDE_EU
18033 + (u32)MCD_funcDescTab5, /* Task 5 Function Descriptor Table & Flags */
18035 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18039 + (u32)MCD_contextSave5, /* Task 5 context save space */
18043 + (u32)MCD_varTab6, /* Task 6 Variable Table */
18044 +#ifdef MCD_INCLUDE_EU
18045 + (u32)MCD_funcDescTab6, /* Task 6 Function Descriptor Table & Flags */
18047 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18051 + (u32)MCD_contextSave6, /* Task 6 context save space */
18055 + (u32)MCD_varTab7, /* Task 7 Variable Table */
18056 +#ifdef MCD_INCLUDE_EU
18057 + (u32)MCD_funcDescTab7, /* Task 7 Function Descriptor Table & Flags */
18059 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18063 + (u32)MCD_contextSave7, /* Task 7 context save space */
18067 + (u32)MCD_varTab8, /* Task 8 Variable Table */
18068 +#ifdef MCD_INCLUDE_EU
18069 + (u32)MCD_funcDescTab8, /* Task 8 Function Descriptor Table & Flags */
18071 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18075 + (u32)MCD_contextSave8, /* Task 8 context save space */
18079 + (u32)MCD_varTab9, /* Task 9 Variable Table */
18080 +#ifdef MCD_INCLUDE_EU
18081 + (u32)MCD_funcDescTab9, /* Task 9 Function Descriptor Table & Flags */
18083 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18087 + (u32)MCD_contextSave9, /* Task 9 context save space */
18091 + (u32)MCD_varTab10, /* Task 10 Variable Table */
18092 +#ifdef MCD_INCLUDE_EU
18093 + (u32)MCD_funcDescTab10, /* Task 10 Function Descriptor Table & Flags */
18095 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18099 + (u32)MCD_contextSave10, /* Task 10 context save space */
18103 + (u32)MCD_varTab11, /* Task 11 Variable Table */
18104 +#ifdef MCD_INCLUDE_EU
18105 + (u32)MCD_funcDescTab11, /* Task 11 Function Descriptor Table & Flags */
18107 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18111 + (u32)MCD_contextSave11, /* Task 11 context save space */
18115 + (u32)MCD_varTab12, /* Task 12 Variable Table */
18116 +#ifdef MCD_INCLUDE_EU
18117 + (u32)MCD_funcDescTab12, /* Task 12 Function Descriptor Table & Flags */
18119 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18123 + (u32)MCD_contextSave12, /* Task 12 context save space */
18127 + (u32)MCD_varTab13, /* Task 13 Variable Table */
18128 +#ifdef MCD_INCLUDE_EU
18129 + (u32)MCD_funcDescTab13, /* Task 13 Function Descriptor Table & Flags */
18131 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18135 + (u32)MCD_contextSave13, /* Task 13 context save space */
18139 + (u32)MCD_varTab14, /* Task 14 Variable Table */
18140 +#ifdef MCD_INCLUDE_EU
18141 + (u32)MCD_funcDescTab14, /* Task 14 Function Descriptor Table & Flags */
18143 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18147 + (u32)MCD_contextSave14, /* Task 14 context save space */
18151 + (u32)MCD_varTab15, /* Task 15 Variable Table */
18152 +#ifdef MCD_INCLUDE_EU
18153 + (u32)MCD_funcDescTab15, /* Task 15 Function Descriptor Table & Flags */
18155 + (u32)MCD_funcDescTab0, /* Task 0 Function Descriptor Table & Flags */
18159 + (u32)MCD_contextSave15, /* Task 15 context save space */
18164 +u32 MCD_varTab0[] =
18165 +{ /* Task 0 Variable Table */
18166 + 0x00000000, /* var[0] */
18167 + 0x00000000, /* var[1] */
18168 + 0x00000000, /* var[2] */
18169 + 0x00000000, /* var[3] */
18170 + 0x00000000, /* var[4] */
18171 + 0x00000000, /* var[5] */
18172 + 0x00000000, /* var[6] */
18173 + 0x00000000, /* var[7] */
18174 + 0x00000000, /* var[8] */
18175 + 0x00000000, /* var[9] */
18176 + 0x00000000, /* var[10] */
18177 + 0x00000000, /* var[11] */
18178 + 0x00000000, /* var[12] */
18179 + 0x00000000, /* var[13] */
18180 + 0x00000000, /* var[14] */
18181 + 0x00000000, /* var[15] */
18182 + 0x00000000, /* var[16] */
18183 + 0x00000000, /* var[17] */
18184 + 0x00000000, /* var[18] */
18185 + 0x00000000, /* var[19] */
18186 + 0x00000000, /* var[20] */
18187 + 0x00000000, /* var[21] */
18188 + 0x00000000, /* var[22] */
18189 + 0x00000000, /* var[23] */
18190 + 0xe0000000, /* inc[0] */
18191 + 0x20000000, /* inc[1] */
18192 + 0x2000ffff, /* inc[2] */
18193 + 0x00000000, /* inc[3] */
18194 + 0x00000000, /* inc[4] */
18195 + 0x00000000, /* inc[5] */
18196 + 0x00000000, /* inc[6] */
18197 + 0x00000000, /* inc[7] */
18201 +u32 MCD_varTab1[] =
18202 +{ /* Task 1 Variable Table */
18203 + 0x00000000, /* var[0] */
18204 + 0x00000000, /* var[1] */
18205 + 0x00000000, /* var[2] */
18206 + 0x00000000, /* var[3] */
18207 + 0x00000000, /* var[4] */
18208 + 0x00000000, /* var[5] */
18209 + 0x00000000, /* var[6] */
18210 + 0x00000000, /* var[7] */
18211 + 0x00000000, /* var[8] */
18212 + 0x00000000, /* var[9] */
18213 + 0x00000000, /* var[10] */
18214 + 0x00000000, /* var[11] */
18215 + 0x00000000, /* var[12] */
18216 + 0x00000000, /* var[13] */
18217 + 0x00000000, /* var[14] */
18218 + 0x00000000, /* var[15] */
18219 + 0x00000000, /* var[16] */
18220 + 0x00000000, /* var[17] */
18221 + 0x00000000, /* var[18] */
18222 + 0x00000000, /* var[19] */
18223 + 0x00000000, /* var[20] */
18224 + 0x00000000, /* var[21] */
18225 + 0x00000000, /* var[22] */
18226 + 0x00000000, /* var[23] */
18227 + 0xe0000000, /* inc[0] */
18228 + 0x20000000, /* inc[1] */
18229 + 0x2000ffff, /* inc[2] */
18230 + 0x00000000, /* inc[3] */
18231 + 0x00000000, /* inc[4] */
18232 + 0x00000000, /* inc[5] */
18233 + 0x00000000, /* inc[6] */
18234 + 0x00000000, /* inc[7] */
18237 +u32 MCD_varTab2[]=
18238 +{ /* Task 2 Variable Table */
18239 + 0x00000000, /* var[0] */
18240 + 0x00000000, /* var[1] */
18241 + 0x00000000, /* var[2] */
18242 + 0x00000000, /* var[3] */
18243 + 0x00000000, /* var[4] */
18244 + 0x00000000, /* var[5] */
18245 + 0x00000000, /* var[6] */
18246 + 0x00000000, /* var[7] */
18247 + 0x00000000, /* var[8] */
18248 + 0x00000000, /* var[9] */
18249 + 0x00000000, /* var[10] */
18250 + 0x00000000, /* var[11] */
18251 + 0x00000000, /* var[12] */
18252 + 0x00000000, /* var[13] */
18253 + 0x00000000, /* var[14] */
18254 + 0x00000000, /* var[15] */
18255 + 0x00000000, /* var[16] */
18256 + 0x00000000, /* var[17] */
18257 + 0x00000000, /* var[18] */
18258 + 0x00000000, /* var[19] */
18259 + 0x00000000, /* var[20] */
18260 + 0x00000000, /* var[21] */
18261 + 0x00000000, /* var[22] */
18262 + 0x00000000, /* var[23] */
18263 + 0xe0000000, /* inc[0] */
18264 + 0x20000000, /* inc[1] */
18265 + 0x2000ffff, /* inc[2] */
18266 + 0x00000000, /* inc[3] */
18267 + 0x00000000, /* inc[4] */
18268 + 0x00000000, /* inc[5] */
18269 + 0x00000000, /* inc[6] */
18270 + 0x00000000, /* inc[7] */
18273 +u32 MCD_varTab3[]=
18274 +{ /* Task 3 Variable Table */
18275 + 0x00000000, /* var[0] */
18276 + 0x00000000, /* var[1] */
18277 + 0x00000000, /* var[2] */
18278 + 0x00000000, /* var[3] */
18279 + 0x00000000, /* var[4] */
18280 + 0x00000000, /* var[5] */
18281 + 0x00000000, /* var[6] */
18282 + 0x00000000, /* var[7] */
18283 + 0x00000000, /* var[8] */
18284 + 0x00000000, /* var[9] */
18285 + 0x00000000, /* var[10] */
18286 + 0x00000000, /* var[11] */
18287 + 0x00000000, /* var[12] */
18288 + 0x00000000, /* var[13] */
18289 + 0x00000000, /* var[14] */
18290 + 0x00000000, /* var[15] */
18291 + 0x00000000, /* var[16] */
18292 + 0x00000000, /* var[17] */
18293 + 0x00000000, /* var[18] */
18294 + 0x00000000, /* var[19] */
18295 + 0x00000000, /* var[20] */
18296 + 0x00000000, /* var[21] */
18297 + 0x00000000, /* var[22] */
18298 + 0x00000000, /* var[23] */
18299 + 0xe0000000, /* inc[0] */
18300 + 0x20000000, /* inc[1] */
18301 + 0x2000ffff, /* inc[2] */
18302 + 0x00000000, /* inc[3] */
18303 + 0x00000000, /* inc[4] */
18304 + 0x00000000, /* inc[5] */
18305 + 0x00000000, /* inc[6] */
18306 + 0x00000000, /* inc[7] */
18309 +u32 MCD_varTab4[]=
18310 +{ /* Task 4 Variable Table */
18311 + 0x00000000, /* var[0] */
18312 + 0x00000000, /* var[1] */
18313 + 0x00000000, /* var[2] */
18314 + 0x00000000, /* var[3] */
18315 + 0x00000000, /* var[4] */
18316 + 0x00000000, /* var[5] */
18317 + 0x00000000, /* var[6] */
18318 + 0x00000000, /* var[7] */
18319 + 0x00000000, /* var[8] */
18320 + 0x00000000, /* var[9] */
18321 + 0x00000000, /* var[10] */
18322 + 0x00000000, /* var[11] */
18323 + 0x00000000, /* var[12] */
18324 + 0x00000000, /* var[13] */
18325 + 0x00000000, /* var[14] */
18326 + 0x00000000, /* var[15] */
18327 + 0x00000000, /* var[16] */
18328 + 0x00000000, /* var[17] */
18329 + 0x00000000, /* var[18] */
18330 + 0x00000000, /* var[19] */
18331 + 0x00000000, /* var[20] */
18332 + 0x00000000, /* var[21] */
18333 + 0x00000000, /* var[22] */
18334 + 0x00000000, /* var[23] */
18335 + 0xe0000000, /* inc[0] */
18336 + 0x20000000, /* inc[1] */
18337 + 0x2000ffff, /* inc[2] */
18338 + 0x00000000, /* inc[3] */
18339 + 0x00000000, /* inc[4] */
18340 + 0x00000000, /* inc[5] */
18341 + 0x00000000, /* inc[6] */
18342 + 0x00000000, /* inc[7] */
18345 +u32 MCD_varTab5[]=
18346 +{ /* Task 5 Variable Table */
18347 + 0x00000000, /* var[0] */
18348 + 0x00000000, /* var[1] */
18349 + 0x00000000, /* var[2] */
18350 + 0x00000000, /* var[3] */
18351 + 0x00000000, /* var[4] */
18352 + 0x00000000, /* var[5] */
18353 + 0x00000000, /* var[6] */
18354 + 0x00000000, /* var[7] */
18355 + 0x00000000, /* var[8] */
18356 + 0x00000000, /* var[9] */
18357 + 0x00000000, /* var[10] */
18358 + 0x00000000, /* var[11] */
18359 + 0x00000000, /* var[12] */
18360 + 0x00000000, /* var[13] */
18361 + 0x00000000, /* var[14] */
18362 + 0x00000000, /* var[15] */
18363 + 0x00000000, /* var[16] */
18364 + 0x00000000, /* var[17] */
18365 + 0x00000000, /* var[18] */
18366 + 0x00000000, /* var[19] */
18367 + 0x00000000, /* var[20] */
18368 + 0x00000000, /* var[21] */
18369 + 0x00000000, /* var[22] */
18370 + 0x00000000, /* var[23] */
18371 + 0xe0000000, /* inc[0] */
18372 + 0x20000000, /* inc[1] */
18373 + 0x2000ffff, /* inc[2] */
18374 + 0x00000000, /* inc[3] */
18375 + 0x00000000, /* inc[4] */
18376 + 0x00000000, /* inc[5] */
18377 + 0x00000000, /* inc[6] */
18378 + 0x00000000, /* inc[7] */
18381 +u32 MCD_varTab6[]=
18382 +{ /* Task 6 Variable Table */
18383 + 0x00000000, /* var[0] */
18384 + 0x00000000, /* var[1] */
18385 + 0x00000000, /* var[2] */
18386 + 0x00000000, /* var[3] */
18387 + 0x00000000, /* var[4] */
18388 + 0x00000000, /* var[5] */
18389 + 0x00000000, /* var[6] */
18390 + 0x00000000, /* var[7] */
18391 + 0x00000000, /* var[8] */
18392 + 0x00000000, /* var[9] */
18393 + 0x00000000, /* var[10] */
18394 + 0x00000000, /* var[11] */
18395 + 0x00000000, /* var[12] */
18396 + 0x00000000, /* var[13] */
18397 + 0x00000000, /* var[14] */
18398 + 0x00000000, /* var[15] */
18399 + 0x00000000, /* var[16] */
18400 + 0x00000000, /* var[17] */
18401 + 0x00000000, /* var[18] */
18402 + 0x00000000, /* var[19] */
18403 + 0x00000000, /* var[20] */
18404 + 0x00000000, /* var[21] */
18405 + 0x00000000, /* var[22] */
18406 + 0x00000000, /* var[23] */
18407 + 0xe0000000, /* inc[0] */
18408 + 0x20000000, /* inc[1] */
18409 + 0x2000ffff, /* inc[2] */
18410 + 0x00000000, /* inc[3] */
18411 + 0x00000000, /* inc[4] */
18412 + 0x00000000, /* inc[5] */
18413 + 0x00000000, /* inc[6] */
18414 + 0x00000000, /* inc[7] */
18417 +u32 MCD_varTab7[]=
18418 +{ /* Task 7 Variable Table */
18419 + 0x00000000, /* var[0] */
18420 + 0x00000000, /* var[1] */
18421 + 0x00000000, /* var[2] */
18422 + 0x00000000, /* var[3] */
18423 + 0x00000000, /* var[4] */
18424 + 0x00000000, /* var[5] */
18425 + 0x00000000, /* var[6] */
18426 + 0x00000000, /* var[7] */
18427 + 0x00000000, /* var[8] */
18428 + 0x00000000, /* var[9] */
18429 + 0x00000000, /* var[10] */
18430 + 0x00000000, /* var[11] */
18431 + 0x00000000, /* var[12] */
18432 + 0x00000000, /* var[13] */
18433 + 0x00000000, /* var[14] */
18434 + 0x00000000, /* var[15] */
18435 + 0x00000000, /* var[16] */
18436 + 0x00000000, /* var[17] */
18437 + 0x00000000, /* var[18] */
18438 + 0x00000000, /* var[19] */
18439 + 0x00000000, /* var[20] */
18440 + 0x00000000, /* var[21] */
18441 + 0x00000000, /* var[22] */
18442 + 0x00000000, /* var[23] */
18443 + 0xe0000000, /* inc[0] */
18444 + 0x20000000, /* inc[1] */
18445 + 0x2000ffff, /* inc[2] */
18446 + 0x00000000, /* inc[3] */
18447 + 0x00000000, /* inc[4] */
18448 + 0x00000000, /* inc[5] */
18449 + 0x00000000, /* inc[6] */
18450 + 0x00000000, /* inc[7] */
18453 +u32 MCD_varTab8[]=
18454 +{ /* Task 8 Variable Table */
18455 + 0x00000000, /* var[0] */
18456 + 0x00000000, /* var[1] */
18457 + 0x00000000, /* var[2] */
18458 + 0x00000000, /* var[3] */
18459 + 0x00000000, /* var[4] */
18460 + 0x00000000, /* var[5] */
18461 + 0x00000000, /* var[6] */
18462 + 0x00000000, /* var[7] */
18463 + 0x00000000, /* var[8] */
18464 + 0x00000000, /* var[9] */
18465 + 0x00000000, /* var[10] */
18466 + 0x00000000, /* var[11] */
18467 + 0x00000000, /* var[12] */
18468 + 0x00000000, /* var[13] */
18469 + 0x00000000, /* var[14] */
18470 + 0x00000000, /* var[15] */
18471 + 0x00000000, /* var[16] */
18472 + 0x00000000, /* var[17] */
18473 + 0x00000000, /* var[18] */
18474 + 0x00000000, /* var[19] */
18475 + 0x00000000, /* var[20] */
18476 + 0x00000000, /* var[21] */
18477 + 0x00000000, /* var[22] */
18478 + 0x00000000, /* var[23] */
18479 + 0xe0000000, /* inc[0] */
18480 + 0x20000000, /* inc[1] */
18481 + 0x2000ffff, /* inc[2] */
18482 + 0x00000000, /* inc[3] */
18483 + 0x00000000, /* inc[4] */
18484 + 0x00000000, /* inc[5] */
18485 + 0x00000000, /* inc[6] */
18486 + 0x00000000, /* inc[7] */
18489 +u32 MCD_varTab9[]=
18490 +{ /* Task 9 Variable Table */
18491 + 0x00000000, /* var[0] */
18492 + 0x00000000, /* var[1] */
18493 + 0x00000000, /* var[2] */
18494 + 0x00000000, /* var[3] */
18495 + 0x00000000, /* var[4] */
18496 + 0x00000000, /* var[5] */
18497 + 0x00000000, /* var[6] */
18498 + 0x00000000, /* var[7] */
18499 + 0x00000000, /* var[8] */
18500 + 0x00000000, /* var[9] */
18501 + 0x00000000, /* var[10] */
18502 + 0x00000000, /* var[11] */
18503 + 0x00000000, /* var[12] */
18504 + 0x00000000, /* var[13] */
18505 + 0x00000000, /* var[14] */
18506 + 0x00000000, /* var[15] */
18507 + 0x00000000, /* var[16] */
18508 + 0x00000000, /* var[17] */
18509 + 0x00000000, /* var[18] */
18510 + 0x00000000, /* var[19] */
18511 + 0x00000000, /* var[20] */
18512 + 0x00000000, /* var[21] */
18513 + 0x00000000, /* var[22] */
18514 + 0x00000000, /* var[23] */
18515 + 0xe0000000, /* inc[0] */
18516 + 0x20000000, /* inc[1] */
18517 + 0x2000ffff, /* inc[2] */
18518 + 0x00000000, /* inc[3] */
18519 + 0x00000000, /* inc[4] */
18520 + 0x00000000, /* inc[5] */
18521 + 0x00000000, /* inc[6] */
18522 + 0x00000000, /* inc[7] */
18525 +u32 MCD_varTab10[]=
18526 +{ /* Task 10 Variable Table */
18527 + 0x00000000, /* var[0] */
18528 + 0x00000000, /* var[1] */
18529 + 0x00000000, /* var[2] */
18530 + 0x00000000, /* var[3] */
18531 + 0x00000000, /* var[4] */
18532 + 0x00000000, /* var[5] */
18533 + 0x00000000, /* var[6] */
18534 + 0x00000000, /* var[7] */
18535 + 0x00000000, /* var[8] */
18536 + 0x00000000, /* var[9] */
18537 + 0x00000000, /* var[10] */
18538 + 0x00000000, /* var[11] */
18539 + 0x00000000, /* var[12] */
18540 + 0x00000000, /* var[13] */
18541 + 0x00000000, /* var[14] */
18542 + 0x00000000, /* var[15] */
18543 + 0x00000000, /* var[16] */
18544 + 0x00000000, /* var[17] */
18545 + 0x00000000, /* var[18] */
18546 + 0x00000000, /* var[19] */
18547 + 0x00000000, /* var[20] */
18548 + 0x00000000, /* var[21] */
18549 + 0x00000000, /* var[22] */
18550 + 0x00000000, /* var[23] */
18551 + 0xe0000000, /* inc[0] */
18552 + 0x20000000, /* inc[1] */
18553 + 0x2000ffff, /* inc[2] */
18554 + 0x00000000, /* inc[3] */
18555 + 0x00000000, /* inc[4] */
18556 + 0x00000000, /* inc[5] */
18557 + 0x00000000, /* inc[6] */
18558 + 0x00000000, /* inc[7] */
18561 +u32 MCD_varTab11[]=
18562 +{ /* Task 11 Variable Table */
18563 + 0x00000000, /* var[0] */
18564 + 0x00000000, /* var[1] */
18565 + 0x00000000, /* var[2] */
18566 + 0x00000000, /* var[3] */
18567 + 0x00000000, /* var[4] */
18568 + 0x00000000, /* var[5] */
18569 + 0x00000000, /* var[6] */
18570 + 0x00000000, /* var[7] */
18571 + 0x00000000, /* var[8] */
18572 + 0x00000000, /* var[9] */
18573 + 0x00000000, /* var[10] */
18574 + 0x00000000, /* var[11] */
18575 + 0x00000000, /* var[12] */
18576 + 0x00000000, /* var[13] */
18577 + 0x00000000, /* var[14] */
18578 + 0x00000000, /* var[15] */
18579 + 0x00000000, /* var[16] */
18580 + 0x00000000, /* var[17] */
18581 + 0x00000000, /* var[18] */
18582 + 0x00000000, /* var[19] */
18583 + 0x00000000, /* var[20] */
18584 + 0x00000000, /* var[21] */
18585 + 0x00000000, /* var[22] */
18586 + 0x00000000, /* var[23] */
18587 + 0xe0000000, /* inc[0] */
18588 + 0x20000000, /* inc[1] */
18589 + 0x2000ffff, /* inc[2] */
18590 + 0x00000000, /* inc[3] */
18591 + 0x00000000, /* inc[4] */
18592 + 0x00000000, /* inc[5] */
18593 + 0x00000000, /* inc[6] */
18594 + 0x00000000, /* inc[7] */
18597 +u32 MCD_varTab12[]=
18598 +{ /* Task 12 Variable Table */
18599 + 0x00000000, /* var[0] */
18600 + 0x00000000, /* var[1] */
18601 + 0x00000000, /* var[2] */
18602 + 0x00000000, /* var[3] */
18603 + 0x00000000, /* var[4] */
18604 + 0x00000000, /* var[5] */
18605 + 0x00000000, /* var[6] */
18606 + 0x00000000, /* var[7] */
18607 + 0x00000000, /* var[8] */
18608 + 0x00000000, /* var[9] */
18609 + 0x00000000, /* var[10] */
18610 + 0x00000000, /* var[11] */
18611 + 0x00000000, /* var[12] */
18612 + 0x00000000, /* var[13] */
18613 + 0x00000000, /* var[14] */
18614 + 0x00000000, /* var[15] */
18615 + 0x00000000, /* var[16] */
18616 + 0x00000000, /* var[17] */
18617 + 0x00000000, /* var[18] */
18618 + 0x00000000, /* var[19] */
18619 + 0x00000000, /* var[20] */
18620 + 0x00000000, /* var[21] */
18621 + 0x00000000, /* var[22] */
18622 + 0x00000000, /* var[23] */
18623 + 0xe0000000, /* inc[0] */
18624 + 0x20000000, /* inc[1] */
18625 + 0x2000ffff, /* inc[2] */
18626 + 0x00000000, /* inc[3] */
18627 + 0x00000000, /* inc[4] */
18628 + 0x00000000, /* inc[5] */
18629 + 0x00000000, /* inc[6] */
18630 + 0x00000000, /* inc[7] */
18633 +u32 MCD_varTab13[]=
18634 +{ /* Task 13 Variable Table */
18635 + 0x00000000, /* var[0] */
18636 + 0x00000000, /* var[1] */
18637 + 0x00000000, /* var[2] */
18638 + 0x00000000, /* var[3] */
18639 + 0x00000000, /* var[4] */
18640 + 0x00000000, /* var[5] */
18641 + 0x00000000, /* var[6] */
18642 + 0x00000000, /* var[7] */
18643 + 0x00000000, /* var[8] */
18644 + 0x00000000, /* var[9] */
18645 + 0x00000000, /* var[10] */
18646 + 0x00000000, /* var[11] */
18647 + 0x00000000, /* var[12] */
18648 + 0x00000000, /* var[13] */
18649 + 0x00000000, /* var[14] */
18650 + 0x00000000, /* var[15] */
18651 + 0x00000000, /* var[16] */
18652 + 0x00000000, /* var[17] */
18653 + 0x00000000, /* var[18] */
18654 + 0x00000000, /* var[19] */
18655 + 0x00000000, /* var[20] */
18656 + 0x00000000, /* var[21] */
18657 + 0x00000000, /* var[22] */
18658 + 0x00000000, /* var[23] */
18659 + 0xe0000000, /* inc[0] */
18660 + 0x20000000, /* inc[1] */
18661 + 0x2000ffff, /* inc[2] */
18662 + 0x00000000, /* inc[3] */
18663 + 0x00000000, /* inc[4] */
18664 + 0x00000000, /* inc[5] */
18665 + 0x00000000, /* inc[6] */
18666 + 0x00000000, /* inc[7] */
18669 +u32 MCD_varTab14[]=
18670 +{ /* Task 14 Variable Table */
18671 + 0x00000000, /* var[0] */
18672 + 0x00000000, /* var[1] */
18673 + 0x00000000, /* var[2] */
18674 + 0x00000000, /* var[3] */
18675 + 0x00000000, /* var[4] */
18676 + 0x00000000, /* var[5] */
18677 + 0x00000000, /* var[6] */
18678 + 0x00000000, /* var[7] */
18679 + 0x00000000, /* var[8] */
18680 + 0x00000000, /* var[9] */
18681 + 0x00000000, /* var[10] */
18682 + 0x00000000, /* var[11] */
18683 + 0x00000000, /* var[12] */
18684 + 0x00000000, /* var[13] */
18685 + 0x00000000, /* var[14] */
18686 + 0x00000000, /* var[15] */
18687 + 0x00000000, /* var[16] */
18688 + 0x00000000, /* var[17] */
18689 + 0x00000000, /* var[18] */
18690 + 0x00000000, /* var[19] */
18691 + 0x00000000, /* var[20] */
18692 + 0x00000000, /* var[21] */
18693 + 0x00000000, /* var[22] */
18694 + 0x00000000, /* var[23] */
18695 + 0xe0000000, /* inc[0] */
18696 + 0x20000000, /* inc[1] */
18697 + 0x2000ffff, /* inc[2] */
18698 + 0x00000000, /* inc[3] */
18699 + 0x00000000, /* inc[4] */
18700 + 0x00000000, /* inc[5] */
18701 + 0x00000000, /* inc[6] */
18702 + 0x00000000, /* inc[7] */
18705 +u32 MCD_varTab15[]=
18706 +{ /* Task 15 Variable Table */
18707 + 0x00000000, /* var[0] */
18708 + 0x00000000, /* var[1] */
18709 + 0x00000000, /* var[2] */
18710 + 0x00000000, /* var[3] */
18711 + 0x00000000, /* var[4] */
18712 + 0x00000000, /* var[5] */
18713 + 0x00000000, /* var[6] */
18714 + 0x00000000, /* var[7] */
18715 + 0x00000000, /* var[8] */
18716 + 0x00000000, /* var[9] */
18717 + 0x00000000, /* var[10] */
18718 + 0x00000000, /* var[11] */
18719 + 0x00000000, /* var[12] */
18720 + 0x00000000, /* var[13] */
18721 + 0x00000000, /* var[14] */
18722 + 0x00000000, /* var[15] */
18723 + 0x00000000, /* var[16] */
18724 + 0x00000000, /* var[17] */
18725 + 0x00000000, /* var[18] */
18726 + 0x00000000, /* var[19] */
18727 + 0x00000000, /* var[20] */
18728 + 0x00000000, /* var[21] */
18729 + 0x00000000, /* var[22] */
18730 + 0x00000000, /* var[23] */
18731 + 0xe0000000, /* inc[0] */
18732 + 0x20000000, /* inc[1] */
18733 + 0x2000ffff, /* inc[2] */
18734 + 0x00000000, /* inc[3] */
18735 + 0x00000000, /* inc[4] */
18736 + 0x00000000, /* inc[5] */
18737 + 0x00000000, /* inc[6] */
18738 + 0x00000000, /* inc[7] */
18741 +u32 MCD_funcDescTab0[]=
18742 +{ /* Task 0 Function Descriptor Table */
18791 + 0xa0045670, /* mainFunc(), EU# 3 */
18792 + 0xa0000000, /* rsduFunc(), EU# 3 */
18793 + 0xa0000000, /* crcAccumVal(), EU# 3 */
18794 + 0x20000000, /* setCrcAccum(), EU# 3 */
18795 + 0x21800000, /* and(), EU# 3 */
18796 + 0x21e00000, /* or(), EU# 3 */
18797 + 0x20400000, /* add(), EU# 3 */
18798 + 0x20500000, /* sub(), EU# 3 */
18799 + 0x205a0000, /* andNot(), EU# 3 */
18800 + 0x20a00000, /* shiftR(), EU# 3 */
18801 + 0x202fa000, /* andReadyBit(), EU# 3 */
18802 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
18803 + 0x202ea000, /* andWrapBit(), EU# 3 */
18804 + 0x202da000, /* andLastBit(), EU# 3 */
18805 + 0x202e2000, /* andInterruptBit(), EU# 3 */
18806 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
18809 +#ifdef MCD_INCLUDE_EU
18810 +u32 MCD_funcDescTab1[]=
18811 +{ /* Task 1 Function Descriptor Table */
18860 + 0xa0045670, /* mainFunc(), EU# 3 */
18861 + 0xa0000000, /* rsduFunc(), EU# 3 */
18862 + 0xa0000000, /* crcAccumVal(), EU# 3 */
18863 + 0x20000000, /* setCrcAccum(), EU# 3 */
18864 + 0x21800000, /* and(), EU# 3 */
18865 + 0x21e00000, /* or(), EU# 3 */
18866 + 0x20400000, /* add(), EU# 3 */
18867 + 0x20500000, /* sub(), EU# 3 */
18868 + 0x205a0000, /* andNot(), EU# 3 */
18869 + 0x20a00000, /* shiftR(), EU# 3 */
18870 + 0x202fa000, /* andReadyBit(), EU# 3 */
18871 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
18872 + 0x202ea000, /* andWrapBit(), EU# 3 */
18873 + 0x202da000, /* andLastBit(), EU# 3 */
18874 + 0x202e2000, /* andInterruptBit(), EU# 3 */
18875 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
18878 +u32 MCD_funcDescTab2[]=
18879 +{ /* Task 2 Function Descriptor Table */
18928 + 0xa0045670, /* mainFunc(), EU# 3 */
18929 + 0xa0000000, /* rsduFunc(), EU# 3 */
18930 + 0xa0000000, /* crcAccumVal(), EU# 3 */
18931 + 0x20000000, /* setCrcAccum(), EU# 3 */
18932 + 0x21800000, /* and(), EU# 3 */
18933 + 0x21e00000, /* or(), EU# 3 */
18934 + 0x20400000, /* add(), EU# 3 */
18935 + 0x20500000, /* sub(), EU# 3 */
18936 + 0x205a0000, /* andNot(), EU# 3 */
18937 + 0x20a00000, /* shiftR(), EU# 3 */
18938 + 0x202fa000, /* andReadyBit(), EU# 3 */
18939 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
18940 + 0x202ea000, /* andWrapBit(), EU# 3 */
18941 + 0x202da000, /* andLastBit(), EU# 3 */
18942 + 0x202e2000, /* andInterruptBit(), EU# 3 */
18943 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
18946 +u32 MCD_funcDescTab3[]=
18947 +{ /* Task 3 Function Descriptor Table */
18996 + 0xa0045670, /* mainFunc(), EU# 3 */
18997 + 0xa0000000, /* rsduFunc(), EU# 3 */
18998 + 0xa0000000, /* crcAccumVal(), EU# 3 */
18999 + 0x20000000, /* setCrcAccum(), EU# 3 */
19000 + 0x21800000, /* and(), EU# 3 */
19001 + 0x21e00000, /* or(), EU# 3 */
19002 + 0x20400000, /* add(), EU# 3 */
19003 + 0x20500000, /* sub(), EU# 3 */
19004 + 0x205a0000, /* andNot(), EU# 3 */
19005 + 0x20a00000, /* shiftR(), EU# 3 */
19006 + 0x202fa000, /* andReadyBit(), EU# 3 */
19007 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19008 + 0x202ea000, /* andWrapBit(), EU# 3 */
19009 + 0x202da000, /* andLastBit(), EU# 3 */
19010 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19011 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19014 +u32 MCD_funcDescTab4[]=
19015 +{ /* Task 4 Function Descriptor Table */
19064 + 0xa0045670, /* mainFunc(), EU# 3 */
19065 + 0xa0000000, /* rsduFunc(), EU# 3 */
19066 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19067 + 0x20000000, /* setCrcAccum(), EU# 3 */
19068 + 0x21800000, /* and(), EU# 3 */
19069 + 0x21e00000, /* or(), EU# 3 */
19070 + 0x20400000, /* add(), EU# 3 */
19071 + 0x20500000, /* sub(), EU# 3 */
19072 + 0x205a0000, /* andNot(), EU# 3 */
19073 + 0x20a00000, /* shiftR(), EU# 3 */
19074 + 0x202fa000, /* andReadyBit(), EU# 3 */
19075 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19076 + 0x202ea000, /* andWrapBit(), EU# 3 */
19077 + 0x202da000, /* andLastBit(), EU# 3 */
19078 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19079 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19082 +u32 MCD_funcDescTab5[]=
19083 +{ /* Task 5 Function Descriptor Table */
19132 + 0xa0045670, /* mainFunc(), EU# 3 */
19133 + 0xa0000000, /* rsduFunc(), EU# 3 */
19134 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19135 + 0x20000000, /* setCrcAccum(), EU# 3 */
19136 + 0x21800000, /* and(), EU# 3 */
19137 + 0x21e00000, /* or(), EU# 3 */
19138 + 0x20400000, /* add(), EU# 3 */
19139 + 0x20500000, /* sub(), EU# 3 */
19140 + 0x205a0000, /* andNot(), EU# 3 */
19141 + 0x20a00000, /* shiftR(), EU# 3 */
19142 + 0x202fa000, /* andReadyBit(), EU# 3 */
19143 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19144 + 0x202ea000, /* andWrapBit(), EU# 3 */
19145 + 0x202da000, /* andLastBit(), EU# 3 */
19146 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19147 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19150 +u32 MCD_funcDescTab6[]=
19151 +{ /* Task 6 Function Descriptor Table */
19200 + 0xa0045670, /* mainFunc(), EU# 3 */
19201 + 0xa0000000, /* rsduFunc(), EU# 3 */
19202 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19203 + 0x20000000, /* setCrcAccum(), EU# 3 */
19204 + 0x21800000, /* and(), EU# 3 */
19205 + 0x21e00000, /* or(), EU# 3 */
19206 + 0x20400000, /* add(), EU# 3 */
19207 + 0x20500000, /* sub(), EU# 3 */
19208 + 0x205a0000, /* andNot(), EU# 3 */
19209 + 0x20a00000, /* shiftR(), EU# 3 */
19210 + 0x202fa000, /* andReadyBit(), EU# 3 */
19211 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19212 + 0x202ea000, /* andWrapBit(), EU# 3 */
19213 + 0x202da000, /* andLastBit(), EU# 3 */
19214 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19215 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19218 +u32 MCD_funcDescTab7[]=
19219 +{ /* Task 7 Function Descriptor Table */
19268 + 0xa0045670, /* mainFunc(), EU# 3 */
19269 + 0xa0000000, /* rsduFunc(), EU# 3 */
19270 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19271 + 0x20000000, /* setCrcAccum(), EU# 3 */
19272 + 0x21800000, /* and(), EU# 3 */
19273 + 0x21e00000, /* or(), EU# 3 */
19274 + 0x20400000, /* add(), EU# 3 */
19275 + 0x20500000, /* sub(), EU# 3 */
19276 + 0x205a0000, /* andNot(), EU# 3 */
19277 + 0x20a00000, /* shiftR(), EU# 3 */
19278 + 0x202fa000, /* andReadyBit(), EU# 3 */
19279 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19280 + 0x202ea000, /* andWrapBit(), EU# 3 */
19281 + 0x202da000, /* andLastBit(), EU# 3 */
19282 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19283 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19286 +u32 MCD_funcDescTab8[]=
19287 +{ /* Task 8 Function Descriptor Table */
19336 + 0xa0045670, /* mainFunc(), EU# 3 */
19337 + 0xa0000000, /* rsduFunc(), EU# 3 */
19338 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19339 + 0x20000000, /* setCrcAccum(), EU# 3 */
19340 + 0x21800000, /* and(), EU# 3 */
19341 + 0x21e00000, /* or(), EU# 3 */
19342 + 0x20400000, /* add(), EU# 3 */
19343 + 0x20500000, /* sub(), EU# 3 */
19344 + 0x205a0000, /* andNot(), EU# 3 */
19345 + 0x20a00000, /* shiftR(), EU# 3 */
19346 + 0x202fa000, /* andReadyBit(), EU# 3 */
19347 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19348 + 0x202ea000, /* andWrapBit(), EU# 3 */
19349 + 0x202da000, /* andLastBit(), EU# 3 */
19350 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19351 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19354 +u32 MCD_funcDescTab9[]=
19355 +{ /* Task 9 Function Descriptor Table */
19404 + 0xa0045670, /* mainFunc(), EU# 3 */
19405 + 0xa0000000, /* rsduFunc(), EU# 3 */
19406 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19407 + 0x20000000, /* setCrcAccum(), EU# 3 */
19408 + 0x21800000, /* and(), EU# 3 */
19409 + 0x21e00000, /* or(), EU# 3 */
19410 + 0x20400000, /* add(), EU# 3 */
19411 + 0x20500000, /* sub(), EU# 3 */
19412 + 0x205a0000, /* andNot(), EU# 3 */
19413 + 0x20a00000, /* shiftR(), EU# 3 */
19414 + 0x202fa000, /* andReadyBit(), EU# 3 */
19415 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19416 + 0x202ea000, /* andWrapBit(), EU# 3 */
19417 + 0x202da000, /* andLastBit(), EU# 3 */
19418 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19419 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19422 +u32 MCD_funcDescTab10[]=
19423 +{ /* Task 10 Function Descriptor Table */
19472 + 0xa0045670, /* mainFunc(), EU# 3 */
19473 + 0xa0000000, /* rsduFunc(), EU# 3 */
19474 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19475 + 0x20000000, /* setCrcAccum(), EU# 3 */
19476 + 0x21800000, /* and(), EU# 3 */
19477 + 0x21e00000, /* or(), EU# 3 */
19478 + 0x20400000, /* add(), EU# 3 */
19479 + 0x20500000, /* sub(), EU# 3 */
19480 + 0x205a0000, /* andNot(), EU# 3 */
19481 + 0x20a00000, /* shiftR(), EU# 3 */
19482 + 0x202fa000, /* andReadyBit(), EU# 3 */
19483 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19484 + 0x202ea000, /* andWrapBit(), EU# 3 */
19485 + 0x202da000, /* andLastBit(), EU# 3 */
19486 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19487 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19490 +u32 MCD_funcDescTab11[]=
19491 +{ /* Task 11 Function Descriptor Table */
19540 + 0xa0045670, /* mainFunc(), EU# 3 */
19541 + 0xa0000000, /* rsduFunc(), EU# 3 */
19542 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19543 + 0x20000000, /* setCrcAccum(), EU# 3 */
19544 + 0x21800000, /* and(), EU# 3 */
19545 + 0x21e00000, /* or(), EU# 3 */
19546 + 0x20400000, /* add(), EU# 3 */
19547 + 0x20500000, /* sub(), EU# 3 */
19548 + 0x205a0000, /* andNot(), EU# 3 */
19549 + 0x20a00000, /* shiftR(), EU# 3 */
19550 + 0x202fa000, /* andReadyBit(), EU# 3 */
19551 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19552 + 0x202ea000, /* andWrapBit(), EU# 3 */
19553 + 0x202da000, /* andLastBit(), EU# 3 */
19554 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19555 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19558 +u32 MCD_funcDescTab12[]=
19559 +{ /* Task 12 Function Descriptor Table */
19608 + 0xa0045670, /* mainFunc(), EU# 3 */
19609 + 0xa0000000, /* rsduFunc(), EU# 3 */
19610 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19611 + 0x20000000, /* setCrcAccum(), EU# 3 */
19612 + 0x21800000, /* and(), EU# 3 */
19613 + 0x21e00000, /* or(), EU# 3 */
19614 + 0x20400000, /* add(), EU# 3 */
19615 + 0x20500000, /* sub(), EU# 3 */
19616 + 0x205a0000, /* andNot(), EU# 3 */
19617 + 0x20a00000, /* shiftR(), EU# 3 */
19618 + 0x202fa000, /* andReadyBit(), EU# 3 */
19619 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19620 + 0x202ea000, /* andWrapBit(), EU# 3 */
19621 + 0x202da000, /* andLastBit(), EU# 3 */
19622 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19623 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19626 +u32 MCD_funcDescTab13[]=
19627 +{ /* Task 13 Function Descriptor Table */
19676 + 0xa0045670, /* mainFunc(), EU# 3 */
19677 + 0xa0000000, /* rsduFunc(), EU# 3 */
19678 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19679 + 0x20000000, /* setCrcAccum(), EU# 3 */
19680 + 0x21800000, /* and(), EU# 3 */
19681 + 0x21e00000, /* or(), EU# 3 */
19682 + 0x20400000, /* add(), EU# 3 */
19683 + 0x20500000, /* sub(), EU# 3 */
19684 + 0x205a0000, /* andNot(), EU# 3 */
19685 + 0x20a00000, /* shiftR(), EU# 3 */
19686 + 0x202fa000, /* andReadyBit(), EU# 3 */
19687 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19688 + 0x202ea000, /* andWrapBit(), EU# 3 */
19689 + 0x202da000, /* andLastBit(), EU# 3 */
19690 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19691 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19694 +u32 MCD_funcDescTab14[]=
19695 +{ /* Task 14 Function Descriptor Table */
19744 + 0xa0045670, /* mainFunc(), EU# 3 */
19745 + 0xa0000000, /* rsduFunc(), EU# 3 */
19746 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19747 + 0x20000000, /* setCrcAccum(), EU# 3 */
19748 + 0x21800000, /* and(), EU# 3 */
19749 + 0x21e00000, /* or(), EU# 3 */
19750 + 0x20400000, /* add(), EU# 3 */
19751 + 0x20500000, /* sub(), EU# 3 */
19752 + 0x205a0000, /* andNot(), EU# 3 */
19753 + 0x20a00000, /* shiftR(), EU# 3 */
19754 + 0x202fa000, /* andReadyBit(), EU# 3 */
19755 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19756 + 0x202ea000, /* andWrapBit(), EU# 3 */
19757 + 0x202da000, /* andLastBit(), EU# 3 */
19758 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19759 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19762 +u32 MCD_funcDescTab15[]=
19763 +{ /* Task 15 Function Descriptor Table */
19812 + 0xa0045670, /* mainFunc(), EU# 3 */
19813 + 0xa0000000, /* rsduFunc(), EU# 3 */
19814 + 0xa0000000, /* crcAccumVal(), EU# 3 */
19815 + 0x20000000, /* setCrcAccum(), EU# 3 */
19816 + 0x21800000, /* and(), EU# 3 */
19817 + 0x21e00000, /* or(), EU# 3 */
19818 + 0x20400000, /* add(), EU# 3 */
19819 + 0x20500000, /* sub(), EU# 3 */
19820 + 0x205a0000, /* andNot(), EU# 3 */
19821 + 0x20a00000, /* shiftR(), EU# 3 */
19822 + 0x202fa000, /* andReadyBit(), EU# 3 */
19823 + 0x202f9000, /* andNotReadyBit(), EU# 3 */
19824 + 0x202ea000, /* andWrapBit(), EU# 3 */
19825 + 0x202da000, /* andLastBit(), EU# 3 */
19826 + 0x202e2000, /* andInterruptBit(), EU# 3 */
19827 + 0x202f2000, /* andCrcRestartBit(), EU# 3 */
19829 +#endif /*MCD_INCLUDE_EU*/
19831 +u32 MCD_contextSave0[128]; /* Task 0 context save space */
19832 +u32 MCD_contextSave1[128]; /* Task 1 context save space */
19833 +u32 MCD_contextSave2[128]; /* Task 2 context save space */
19834 +u32 MCD_contextSave3[128]; /* Task 3 context save space */
19835 +u32 MCD_contextSave4[128]; /* Task 4 context save space */
19836 +u32 MCD_contextSave5[128]; /* Task 5 context save space */
19837 +u32 MCD_contextSave6[128]; /* Task 6 context save space */
19838 +u32 MCD_contextSave7[128]; /* Task 7 context save space */
19839 +u32 MCD_contextSave8[128]; /* Task 8 context save space */
19840 +u32 MCD_contextSave9[128]; /* Task 9 context save space */
19841 +u32 MCD_contextSave10[128]; /* Task 10 context save space */
19842 +u32 MCD_contextSave11[128]; /* Task 11 context save space */
19843 +u32 MCD_contextSave12[128]; /* Task 12 context save space */
19844 +u32 MCD_contextSave13[128]; /* Task 13 context save space */
19845 +u32 MCD_contextSave14[128]; /* Task 14 context save space */
19846 +u32 MCD_contextSave15[128]; /* Task 15 context save space */
19848 +u32 MCD_ChainNoEu_TDT[];
19849 +u32 MCD_SingleNoEu_TDT[];
19850 +#ifdef MCD_INCLUDE_EU
19851 +u32 MCD_ChainEu_TDT[];
19852 +u32 MCD_SingleEu_TDT[];
19854 +u32 MCD_ENetRcv_TDT[];
19855 +u32 MCD_ENetXmit_TDT[];
19857 +u32 MCD_modelTaskTableSrc[]=
19859 + (u32)MCD_ChainNoEu_TDT,
19860 + (u32)&((u8*)MCD_ChainNoEu_TDT)[0x0000016c],
19867 + (u32)MCD_SingleNoEu_TDT,
19868 + (u32)&((u8*)MCD_SingleNoEu_TDT)[0x000000d4],
19875 +#ifdef MCD_INCLUDE_EU
19876 + (u32)MCD_ChainEu_TDT,
19877 + (u32)&((u8*)MCD_ChainEu_TDT)[0x000001b4],
19884 + (u32)MCD_SingleEu_TDT,
19885 + (u32)&((u8*)MCD_SingleEu_TDT)[0x00000124],
19893 + (u32)MCD_ENetRcv_TDT,
19894 + (u32)&((u8*)MCD_ENetRcv_TDT)[0x000000a4],
19901 + (u32)MCD_ENetXmit_TDT,
19902 + (u32)&((u8*)MCD_ENetXmit_TDT)[0x000000d0],
19910 +u32 MCD_ChainNoEu_TDT[]=
19912 + 0x80004000, /* 0000(:370): LCDEXT: idx0 = 0x00000000; ; */
19913 + 0x8118801b, /* 0004(:370): LCD: idx1 = var2; idx1 once var0; idx1 += inc3 */
19914 + 0xb8c60018, /* 0008(:371): LCD: idx2 = *(idx1 + var12); idx2 once var0; idx2 += inc3 */
19915 + 0x10002b10, /* 000C(:372): DRD1A: var10 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
19916 + 0x7000000d, /* 0010(:373): DRD2A: EU0=0 EU1=0 EU2=0 EU3=13 EXT MORE init=0 WS=0 RS=0 */
19917 + 0x018cf89f, /* 0014(:373): DRD2B1: var6 = EU3(); EU3(idx2) */
19918 + 0x6000000a, /* 0018(:374): DRD2A: EU0=0 EU1=0 EU2=0 EU3=10 EXT init=0 WS=0 RS=0 */
19919 + 0x080cf89f, /* 001C(:374): DRD2B1: idx0 = EU3(); EU3(idx2) */
19920 + 0x000001f8, /* 0020(:0): NOP */
19921 + 0x98180364, /* 0024(:378): LCD: idx0 = idx0; idx0 == var13; idx0 += inc4 */
19922 + 0x8118801b, /* 0028(:380): LCD: idx1 = var2; idx1 once var0; idx1 += inc3 */
19923 + 0xf8c6001a, /* 002C(:381): LCDEXT: idx2 = *(idx1 + var12 + 8); idx2 once var0; idx2 += inc3 */
19924 + 0xb8c6601b, /* 0030(:382): LCD: idx3 = *(idx1 + var12 + 12); ; idx3 += inc3 */
19925 + 0x10002710, /* 0034(:384): DRD1A: var9 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
19926 + 0x00000f18, /* 0038(:385): DRD1A: var3 = idx3; FN=0 init=0 WS=0 RS=0 */
19927 + 0xb8c6001d, /* 003C(:387): LCD: idx2 = *(idx1 + var12 + 20); idx2 once var0; idx2 += inc3 */
19928 + 0x10001310, /* 0040(:388): DRD1A: var4 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
19929 + 0x60000007, /* 0044(:389): DRD2A: EU0=0 EU1=0 EU2=0 EU3=7 EXT init=0 WS=0 RS=0 */
19930 + 0x014cf88b, /* 0048(:389): DRD2B1: var5 = EU3(); EU3(idx2,var11) */
19931 + 0x98c6001c, /* 004C(:391): LCD: idx2 = idx1 + var12 + 4; idx2 once var0; idx2 += inc3 */
19932 + 0x00000710, /* 0050(:392): DRD1A: var1 = idx2; FN=0 init=0 WS=0 RS=0 */
19933 + 0x98c70018, /* 0054(:393): LCD: idx2 = idx1 + var14; idx2 once var0; idx2 += inc3 */
19934 + 0x10001f10, /* 0058(:394): DRD1A: var7 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
19935 + 0x0000c818, /* 005C(:395): DRD1A: *idx2 = var3; FN=0 init=0 WS=0 RS=0 */
19936 + 0x000001f8, /* 0060(:0): NOP */
19937 + 0xc1476018, /* 0064(:399): LCDEXT: idx1 = var2 + var14; ; idx1 += inc3 */
19938 + 0xc003231d, /* 0068(:399): LCDEXT: idx2 = var0, idx3 = var6; idx3 == var12; idx2 += inc3, idx3 += inc5 */
19939 + 0x811a601b, /* 006C(:400): LCD: idx4 = var2; ; idx4 += inc3 */
19940 + 0xc1862102, /* 0070(:403): LCDEXT: idx5 = var3, idx6 = var12; idx6 < var4; idx5 += inc0, idx6 += inc2 */
19941 + 0x849be009, /* 0074(:403): LCD: idx7 = var9; ; idx7 += inc1 */
19942 + 0x03fed7b8, /* 0078(:406): DRD1A: *idx7; FN=0 init=31 WS=3 RS=3 */
19943 + 0xda9b001b, /* 007C(:408): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
19944 + 0x9b9be01b, /* 0080(:408): LCD: idx7 = idx7; ; idx7 += inc3 */
19945 + 0x1000cb20, /* 0084(:409): DRD1A: *idx2 = idx4; FN=0 MORE init=0 WS=0 RS=0 */
19946 + 0x70000006, /* 0088(:410): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
19947 + 0x088cf88f, /* 008C(:410): DRD2B1: idx2 = EU3(); EU3(idx2,var15) */
19948 + 0x1000cb28, /* 0090(:411): DRD1A: *idx2 = idx5; FN=0 MORE init=0 WS=0 RS=0 */
19949 + 0x70000006, /* 0094(:412): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
19950 + 0x088cf88f, /* 0098(:412): DRD2B1: idx2 = EU3(); EU3(idx2,var15) */
19951 + 0x1000cb30, /* 009C(:413): DRD1A: *idx2 = idx6; FN=0 MORE init=0 WS=0 RS=0 */
19952 + 0x70000006, /* 00A0(:414): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
19953 + 0x088cf88f, /* 00A4(:414): DRD2B1: idx2 = EU3(); EU3(idx2,var15) */
19954 + 0x1000cb38, /* 00A8(:415): DRD1A: *idx2 = idx7; FN=0 MORE init=0 WS=0 RS=0 */
19955 + 0x0000c728, /* 00AC(:416): DRD1A: *idx1 = idx5; FN=0 init=0 WS=0 RS=0 */
19956 + 0x000001f8, /* 00B0(:0): NOP */
19957 + 0xc1476018, /* 00B4(:420): LCDEXT: idx1 = var2 + var14; ; idx1 += inc3 */
19958 + 0xc003241d, /* 00B8(:420): LCDEXT: idx2 = var0, idx3 = var6; idx3 == var16; idx2 += inc3, idx3 += inc5 */
19959 + 0x811a601b, /* 00BC(:421): LCD: idx4 = var2; ; idx4 += inc3 */
19960 + 0xda9b001b, /* 00C0(:424): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
19961 + 0x9b9be01b, /* 00C4(:424): LCD: idx7 = idx7; ; idx7 += inc3 */
19962 + 0x0000d3a0, /* 00C8(:425): DRD1A: *idx4; FN=0 init=0 WS=0 RS=0 */
19963 + 0xc1862102, /* 00CC(:427): LCDEXT: idx5 = var3, idx6 = var12; idx6 < var4; idx5 += inc0, idx6 += inc2 */
19964 + 0x849be009, /* 00D0(:427): LCD: idx7 = var9; ; idx7 += inc1 */
19965 + 0x0bfed7b8, /* 00D4(:430): DRD1A: *idx7; FN=0 TFD init=31 WS=3 RS=3 */
19966 + 0xda9b001b, /* 00D8(:432): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
19967 + 0x9b9be01b, /* 00DC(:432): LCD: idx7 = idx7; ; idx7 += inc3 */
19968 + 0x1000cb20, /* 00E0(:433): DRD1A: *idx2 = idx4; FN=0 MORE init=0 WS=0 RS=0 */
19969 + 0x70000006, /* 00E4(:434): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
19970 + 0x088cf88f, /* 00E8(:434): DRD2B1: idx2 = EU3(); EU3(idx2,var15) */
19971 + 0x1000cb28, /* 00EC(:435): DRD1A: *idx2 = idx5; FN=0 MORE init=0 WS=0 RS=0 */
19972 + 0x70000006, /* 00F0(:436): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
19973 + 0x088cf88f, /* 00F4(:436): DRD2B1: idx2 = EU3(); EU3(idx2,var15) */
19974 + 0x1000cb30, /* 00F8(:437): DRD1A: *idx2 = idx6; FN=0 MORE init=0 WS=0 RS=0 */
19975 + 0x70000006, /* 00FC(:438): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
19976 + 0x088cf88f, /* 0100(:438): DRD2B1: idx2 = EU3(); EU3(idx2,var15) */
19977 + 0x1000cb38, /* 0104(:439): DRD1A: *idx2 = idx7; FN=0 MORE init=0 WS=0 RS=0 */
19978 + 0x0000c728, /* 0108(:440): DRD1A: *idx1 = idx5; FN=0 init=0 WS=0 RS=0 */
19979 + 0x000001f8, /* 010C(:0): NOP */
19980 + 0x8118801b, /* 0110(:444): LCD: idx1 = var2; idx1 once var0; idx1 += inc3 */
19981 + 0xd8c60018, /* 0114(:446): LCDEXT: idx2 = idx1 + var12; idx2 once var0; idx2 += inc3 */
19982 + 0x98c6601c, /* 0118(:446): LCD: idx3 = idx1 + var12 + 4; ; idx3 += inc3 */
19983 + 0x6000000b, /* 011C(:447): DRD2A: EU0=0 EU1=0 EU2=0 EU3=11 EXT init=0 WS=0 RS=0 */
19984 + 0x0c8cfc9f, /* 0120(:447): DRD2B1: *idx2 = EU3(); EU3(*idx2) */
19985 + 0x000001f8, /* 0124(:0): NOP */
19986 + 0xa146001e, /* 0128(:450): LCD: idx1 = *(var2 + var12 + 24); idx1 once var0; idx1 += inc3 */
19987 + 0x10000b08, /* 012C(:451): DRD1A: var2 = idx1; FN=0 MORE init=0 WS=0 RS=0 */
19988 + 0x10002050, /* 0130(:452): DRD1A: var8 = var10; FN=0 MORE init=0 WS=0 RS=0 */
19989 + 0xb8c60018, /* 0134(:453): LCD: idx2 = *(idx1 + var12); idx2 once var0; idx2 += inc3 */
19990 + 0x10002b10, /* 0138(:454): DRD1A: var10 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
19991 + 0x7000000a, /* 013C(:455): DRD2A: EU0=0 EU1=0 EU2=0 EU3=10 EXT MORE init=0 WS=0 RS=0 */
19992 + 0x080cf89f, /* 0140(:455): DRD2B1: idx0 = EU3(); EU3(idx2) */
19993 + 0x6000000d, /* 0144(:456): DRD2A: EU0=0 EU1=0 EU2=0 EU3=13 EXT init=0 WS=0 RS=0 */
19994 + 0x018cf89f, /* 0148(:456): DRD2B1: var6 = EU3(); EU3(idx2) */
19995 + 0x000001f8, /* 014C(:0): NOP */
19996 + 0x8618801b, /* 0150(:462): LCD: idx1 = var12; idx1 once var0; idx1 += inc3 */
19997 + 0x7000000e, /* 0154(:463): DRD2A: EU0=0 EU1=0 EU2=0 EU3=14 EXT MORE init=0 WS=0 RS=0 */
19998 + 0x084cf21f, /* 0158(:463): DRD2B1: idx1 = EU3(); EU3(var8) */
19999 + 0xd8990336, /* 015C(:464): LCDEXT: idx2 = idx1; idx2 > var12; idx2 += inc6 */
20000 + 0x8019801b, /* 0160(:464): LCD: idx3 = var0; idx3 once var0; idx3 += inc3 */
20001 + 0x040001f8, /* 0164(:465): DRD1A: FN=0 INT init=0 WS=0 RS=0 */
20002 + 0x000001f8, /* 0168(:0): NOP */
20003 + 0x000001f8, /* 016C(:0): NOP */
20005 +u32 MCD_SingleNoEu_TDT[]=
20007 + 0x8198001b, /* 0000(:657): LCD: idx0 = var3; idx0 once var0; idx0 += inc3 */
20008 + 0x7000000d, /* 0004(:658): DRD2A: EU0=0 EU1=0 EU2=0 EU3=13 EXT MORE init=0 WS=0 RS=0 */
20009 + 0x080cf81f, /* 0008(:658): DRD2B1: idx0 = EU3(); EU3(idx0) */
20010 + 0x8198801b, /* 000C(:659): LCD: idx1 = var3; idx1 once var0; idx1 += inc3 */
20011 + 0x6000000e, /* 0010(:660): DRD2A: EU0=0 EU1=0 EU2=0 EU3=14 EXT init=0 WS=0 RS=0 */
20012 + 0x084cf85f, /* 0014(:660): DRD2B1: idx1 = EU3(); EU3(idx1) */
20013 + 0x000001f8, /* 0018(:0): NOP */
20014 + 0x8298001b, /* 001C(:664): LCD: idx0 = var5; idx0 once var0; idx0 += inc3 */
20015 + 0x7000000d, /* 0020(:665): DRD2A: EU0=0 EU1=0 EU2=0 EU3=13 EXT MORE init=0 WS=0 RS=0 */
20016 + 0x010cf81f, /* 0024(:665): DRD2B1: var4 = EU3(); EU3(idx0) */
20017 + 0x6000000e, /* 0028(:666): DRD2A: EU0=0 EU1=0 EU2=0 EU3=14 EXT init=0 WS=0 RS=0 */
20018 + 0x018cf81f, /* 002C(:666): DRD2B1: var6 = EU3(); EU3(idx0) */
20019 + 0xc202601b, /* 0030(:669): LCDEXT: idx0 = var4, idx1 = var4; ; idx0 += inc3, idx1 += inc3 */
20020 + 0xc002221c, /* 0034(:669): LCDEXT: idx2 = var0, idx3 = var4; idx3 == var8; idx2 += inc3, idx3 += inc4 */
20021 + 0x809a601b, /* 0038(:670): LCD: idx4 = var1; ; idx4 += inc3 */
20022 + 0xc10420c2, /* 003C(:673): LCDEXT: idx5 = var2, idx6 = var8; idx6 < var3; idx5 += inc0, idx6 += inc2 */
20023 + 0x839be009, /* 0040(:673): LCD: idx7 = var7; ; idx7 += inc1 */
20024 + 0x03fed7b8, /* 0044(:676): DRD1A: *idx7; FN=0 init=31 WS=3 RS=3 */
20025 + 0xda9b001b, /* 0048(:678): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
20026 + 0x9b9be01b, /* 004C(:678): LCD: idx7 = idx7; ; idx7 += inc3 */
20027 + 0x70000006, /* 0050(:680): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20028 + 0x088cf889, /* 0054(:680): DRD2B1: idx2 = EU3(); EU3(idx2,var9) */
20029 + 0x1000cb28, /* 0058(:681): DRD1A: *idx2 = idx5; FN=0 MORE init=0 WS=0 RS=0 */
20030 + 0x70000006, /* 005C(:682): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20031 + 0x088cf889, /* 0060(:682): DRD2B1: idx2 = EU3(); EU3(idx2,var9) */
20032 + 0x1000cb30, /* 0064(:683): DRD1A: *idx2 = idx6; FN=0 MORE init=0 WS=0 RS=0 */
20033 + 0x70000006, /* 0068(:684): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20034 + 0x088cf889, /* 006C(:684): DRD2B1: idx2 = EU3(); EU3(idx2,var9) */
20035 + 0x0000cb38, /* 0070(:685): DRD1A: *idx2 = idx7; FN=0 init=0 WS=0 RS=0 */
20036 + 0x000001f8, /* 0074(:0): NOP */
20037 + 0xc202601b, /* 0078(:689): LCDEXT: idx0 = var4, idx1 = var4; ; idx0 += inc3, idx1 += inc3 */
20038 + 0xc002229c, /* 007C(:689): LCDEXT: idx2 = var0, idx3 = var4; idx3 == var10; idx2 += inc3, idx3 += inc4 */
20039 + 0x809a601b, /* 0080(:690): LCD: idx4 = var1; ; idx4 += inc3 */
20040 + 0xda9b001b, /* 0084(:693): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
20041 + 0x9b9be01b, /* 0088(:693): LCD: idx7 = idx7; ; idx7 += inc3 */
20042 + 0x0000d3a0, /* 008C(:694): DRD1A: *idx4; FN=0 init=0 WS=0 RS=0 */
20043 + 0xc10420c2, /* 0090(:696): LCDEXT: idx5 = var2, idx6 = var8; idx6 < var3; idx5 += inc0, idx6 += inc2 */
20044 + 0x839be009, /* 0094(:696): LCD: idx7 = var7; ; idx7 += inc1 */
20045 + 0x0bfed7b8, /* 0098(:699): DRD1A: *idx7; FN=0 TFD init=31 WS=3 RS=3 */
20046 + 0xda9b001b, /* 009C(:701): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
20047 + 0x9b9be01b, /* 00A0(:701): LCD: idx7 = idx7; ; idx7 += inc3 */
20048 + 0x70000006, /* 00A4(:703): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20049 + 0x088cf889, /* 00A8(:703): DRD2B1: idx2 = EU3(); EU3(idx2,var9) */
20050 + 0x1000cb28, /* 00AC(:704): DRD1A: *idx2 = idx5; FN=0 MORE init=0 WS=0 RS=0 */
20051 + 0x70000006, /* 00B0(:705): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20052 + 0x088cf889, /* 00B4(:705): DRD2B1: idx2 = EU3(); EU3(idx2,var9) */
20053 + 0x1000cb30, /* 00B8(:706): DRD1A: *idx2 = idx6; FN=0 MORE init=0 WS=0 RS=0 */
20054 + 0x70000006, /* 00BC(:707): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20055 + 0x088cf889, /* 00C0(:707): DRD2B1: idx2 = EU3(); EU3(idx2,var9) */
20056 + 0x0000cb38, /* 00C4(:708): DRD1A: *idx2 = idx7; FN=0 init=0 WS=0 RS=0 */
20057 + 0x000001f8, /* 00C8(:0): NOP */
20058 + 0xc318022d, /* 00CC(:712): LCDEXT: idx0 = var6; idx0 > var8; idx0 += inc5 */
20059 + 0x8018801b, /* 00D0(:712): LCD: idx1 = var0; idx1 once var0; idx1 += inc3 */
20060 + 0x040001f8, /* 00D4(:713): DRD1A: FN=0 INT init=0 WS=0 RS=0 */
20062 +#ifdef MCD_INCLUDE_EU
20063 +u32 MCD_ChainEu_TDT[]=
20065 + 0x80004000, /* 0000(:947): LCDEXT: idx0 = 0x00000000; ; */
20066 + 0x8198801b, /* 0004(:947): LCD: idx1 = var3; idx1 once var0; idx1 += inc3 */
20067 + 0xb8c68018, /* 0008(:948): LCD: idx2 = *(idx1 + var13); idx2 once var0; idx2 += inc3 */
20068 + 0x10002f10, /* 000C(:949): DRD1A: var11 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
20069 + 0x7000000d, /* 0010(:950): DRD2A: EU0=0 EU1=0 EU2=0 EU3=13 EXT MORE init=0 WS=0 RS=0 */
20070 + 0x01ccf89f, /* 0014(:950): DRD2B1: var7 = EU3(); EU3(idx2) */
20071 + 0x6000000a, /* 0018(:951): DRD2A: EU0=0 EU1=0 EU2=0 EU3=10 EXT init=0 WS=0 RS=0 */
20072 + 0x080cf89f, /* 001C(:951): DRD2B1: idx0 = EU3(); EU3(idx2) */
20073 + 0x000001f8, /* 0020(:0): NOP */
20074 + 0x981803a4, /* 0024(:955): LCD: idx0 = idx0; idx0 == var14; idx0 += inc4 */
20075 + 0x8198801b, /* 0028(:957): LCD: idx1 = var3; idx1 once var0; idx1 += inc3 */
20076 + 0xf8c6801a, /* 002C(:958): LCDEXT: idx2 = *(idx1 + var13 + 8); idx2 once var0; idx2 += inc3 */
20077 + 0xb8c6e01b, /* 0030(:959): LCD: idx3 = *(idx1 + var13 + 12); ; idx3 += inc3 */
20078 + 0x10002b10, /* 0034(:961): DRD1A: var10 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
20079 + 0x00001318, /* 0038(:962): DRD1A: var4 = idx3; FN=0 init=0 WS=0 RS=0 */
20080 + 0xb8c6801d, /* 003C(:964): LCD: idx2 = *(idx1 + var13 + 20); idx2 once var0; idx2 += inc3 */
20081 + 0x10001710, /* 0040(:965): DRD1A: var5 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
20082 + 0x60000007, /* 0044(:966): DRD2A: EU0=0 EU1=0 EU2=0 EU3=7 EXT init=0 WS=0 RS=0 */
20083 + 0x018cf88c, /* 0048(:966): DRD2B1: var6 = EU3(); EU3(idx2,var12) */
20084 + 0x98c6801c, /* 004C(:968): LCD: idx2 = idx1 + var13 + 4; idx2 once var0; idx2 += inc3 */
20085 + 0x00000b10, /* 0050(:969): DRD1A: var2 = idx2; FN=0 init=0 WS=0 RS=0 */
20086 + 0x98c78018, /* 0054(:970): LCD: idx2 = idx1 + var15; idx2 once var0; idx2 += inc3 */
20087 + 0x10002310, /* 0058(:971): DRD1A: var8 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
20088 + 0x0000c820, /* 005C(:972): DRD1A: *idx2 = var4; FN=0 init=0 WS=0 RS=0 */
20089 + 0x000001f8, /* 0060(:0): NOP */
20090 + 0x8698801b, /* 0064(:976): LCD: idx1 = var13; idx1 once var0; idx1 += inc3 */
20091 + 0x7000000f, /* 0068(:977): DRD2A: EU0=0 EU1=0 EU2=0 EU3=15 EXT MORE init=0 WS=0 RS=0 */
20092 + 0x084cf2df, /* 006C(:977): DRD2B1: idx1 = EU3(); EU3(var11) */
20093 + 0xd899042d, /* 0070(:978): LCDEXT: idx2 = idx1; idx2 >= var16; idx2 += inc5 */
20094 + 0x8019801b, /* 0074(:978): LCD: idx3 = var0; idx3 once var0; idx3 += inc3 */
20095 + 0x60000003, /* 0078(:979): DRD2A: EU0=0 EU1=0 EU2=0 EU3=3 EXT init=0 WS=0 RS=0 */
20096 + 0x2cd7c7df, /* 007C(:979): DRD2B2: EU3(var13) */
20097 + 0xd8990364, /* 0080(:980): LCDEXT: idx2 = idx1; idx2 == var13; idx2 += inc4 */
20098 + 0x8019801b, /* 0084(:980): LCD: idx3 = var0; idx3 once var0; idx3 += inc3 */
20099 + 0x60000003, /* 0088(:981): DRD2A: EU0=0 EU1=0 EU2=0 EU3=3 EXT init=0 WS=0 RS=0 */
20100 + 0x2c17c7df, /* 008C(:981): DRD2B2: EU3(var1) */
20101 + 0x000001f8, /* 0090(:0): NOP */
20102 + 0xc1c7e018, /* 0094(:984): LCDEXT: idx1 = var3 + var15; ; idx1 += inc3 */
20103 + 0xc003a35e, /* 0098(:984): LCDEXT: idx2 = var0, idx3 = var7; idx3 == var13; idx2 += inc3, idx3 += inc6 */
20104 + 0x819a601b, /* 009C(:985): LCD: idx4 = var3; ; idx4 += inc3 */
20105 + 0xc206a142, /* 00A0(:988): LCDEXT: idx5 = var4, idx6 = var13; idx6 < var5; idx5 += inc0, idx6 += inc2 */
20106 + 0x851be009, /* 00A4(:988): LCD: idx7 = var10; ; idx7 += inc1 */
20107 + 0x63fe0000, /* 00A8(:991): DRD2A: EU0=0 EU1=0 EU2=0 EU3=0 EXT init=31 WS=3 RS=3 */
20108 + 0x0d4cfddf, /* 00AC(:991): DRD2B1: *idx5 = EU3(); EU3(*idx7) */
20109 + 0xda9b001b, /* 00B0(:993): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
20110 + 0x9b9be01b, /* 00B4(:993): LCD: idx7 = idx7; ; idx7 += inc3 */
20111 + 0x70000002, /* 00B8(:994): DRD2A: EU0=0 EU1=0 EU2=0 EU3=2 EXT MORE init=0 WS=0 RS=0 */
20112 + 0x004cf81f, /* 00BC(:994): DRD2B1: var1 = EU3(); EU3(idx0) */
20113 + 0x1000cb20, /* 00C0(:995): DRD1A: *idx2 = idx4; FN=0 MORE init=0 WS=0 RS=0 */
20114 + 0x70000006, /* 00C4(:996): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20115 + 0x088cf891, /* 00C8(:996): DRD2B1: idx2 = EU3(); EU3(idx2,var17) */
20116 + 0x1000cb28, /* 00CC(:997): DRD1A: *idx2 = idx5; FN=0 MORE init=0 WS=0 RS=0 */
20117 + 0x70000006, /* 00D0(:998): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20118 + 0x088cf891, /* 00D4(:998): DRD2B1: idx2 = EU3(); EU3(idx2,var17) */
20119 + 0x1000cb30, /* 00D8(:999): DRD1A: *idx2 = idx6; FN=0 MORE init=0 WS=0 RS=0 */
20120 + 0x70000006, /* 00DC(:1000): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20121 + 0x088cf891, /* 00E0(:1000): DRD2B1: idx2 = EU3(); EU3(idx2,var17) */
20122 + 0x1000cb38, /* 00E4(:1001): DRD1A: *idx2 = idx7; FN=0 MORE init=0 WS=0 RS=0 */
20123 + 0x0000c728, /* 00E8(:1002): DRD1A: *idx1 = idx5; FN=0 init=0 WS=0 RS=0 */
20124 + 0x000001f8, /* 00EC(:0): NOP */
20125 + 0xc1c7e018, /* 00F0(:1006): LCDEXT: idx1 = var3 + var15; ; idx1 += inc3 */
20126 + 0xc003a49e, /* 00F4(:1006): LCDEXT: idx2 = var0, idx3 = var7; idx3 == var18; idx2 += inc3, idx3 += inc6 */
20127 + 0x819a601b, /* 00F8(:1007): LCD: idx4 = var3; ; idx4 += inc3 */
20128 + 0xda9b001b, /* 00FC(:1010): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
20129 + 0x9b9be01b, /* 0100(:1010): LCD: idx7 = idx7; ; idx7 += inc3 */
20130 + 0x0000d3a0, /* 0104(:1011): DRD1A: *idx4; FN=0 init=0 WS=0 RS=0 */
20131 + 0xc206a142, /* 0108(:1013): LCDEXT: idx5 = var4, idx6 = var13; idx6 < var5; idx5 += inc0, idx6 += inc2 */
20132 + 0x851be009, /* 010C(:1013): LCD: idx7 = var10; ; idx7 += inc1 */
20133 + 0x6bfe0000, /* 0110(:1016): DRD2A: EU0=0 EU1=0 EU2=0 EU3=0 TFD EXT init=31 WS=3 RS=3 */
20134 + 0x0d4cfddf, /* 0114(:1016): DRD2B1: *idx5 = EU3(); EU3(*idx7) */
20135 + 0xda9b001b, /* 0118(:1018): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
20136 + 0x9b9be01b, /* 011C(:1018): LCD: idx7 = idx7; ; idx7 += inc3 */
20137 + 0x70000002, /* 0120(:1019): DRD2A: EU0=0 EU1=0 EU2=0 EU3=2 EXT MORE init=0 WS=0 RS=0 */
20138 + 0x004cf81f, /* 0124(:1019): DRD2B1: var1 = EU3(); EU3(idx0) */
20139 + 0x1000cb20, /* 0128(:1020): DRD1A: *idx2 = idx4; FN=0 MORE init=0 WS=0 RS=0 */
20140 + 0x70000006, /* 012C(:1021): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20141 + 0x088cf891, /* 0130(:1021): DRD2B1: idx2 = EU3(); EU3(idx2,var17) */
20142 + 0x1000cb28, /* 0134(:1022): DRD1A: *idx2 = idx5; FN=0 MORE init=0 WS=0 RS=0 */
20143 + 0x70000006, /* 0138(:1023): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20144 + 0x088cf891, /* 013C(:1023): DRD2B1: idx2 = EU3(); EU3(idx2,var17) */
20145 + 0x1000cb30, /* 0140(:1024): DRD1A: *idx2 = idx6; FN=0 MORE init=0 WS=0 RS=0 */
20146 + 0x70000006, /* 0144(:1025): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20147 + 0x088cf891, /* 0148(:1025): DRD2B1: idx2 = EU3(); EU3(idx2,var17) */
20148 + 0x1000cb38, /* 014C(:1026): DRD1A: *idx2 = idx7; FN=0 MORE init=0 WS=0 RS=0 */
20149 + 0x0000c728, /* 0150(:1027): DRD1A: *idx1 = idx5; FN=0 init=0 WS=0 RS=0 */
20150 + 0x000001f8, /* 0154(:0): NOP */
20151 + 0x8198801b, /* 0158(:1031): LCD: idx1 = var3; idx1 once var0; idx1 += inc3 */
20152 + 0xd8c68018, /* 015C(:1033): LCDEXT: idx2 = idx1 + var13; idx2 once var0; idx2 += inc3 */
20153 + 0x98c6e01c, /* 0160(:1033): LCD: idx3 = idx1 + var13 + 4; ; idx3 += inc3 */
20154 + 0x6000000b, /* 0164(:1034): DRD2A: EU0=0 EU1=0 EU2=0 EU3=11 EXT init=0 WS=0 RS=0 */
20155 + 0x0c8cfc9f, /* 0168(:1034): DRD2B1: *idx2 = EU3(); EU3(*idx2) */
20156 + 0x0000cc08, /* 016C(:1035): DRD1A: *idx3 = var1; FN=0 init=0 WS=0 RS=0 */
20157 + 0xa1c6801e, /* 0170(:1038): LCD: idx1 = *(var3 + var13 + 24); idx1 once var0; idx1 += inc3 */
20158 + 0x10000f08, /* 0174(:1039): DRD1A: var3 = idx1; FN=0 MORE init=0 WS=0 RS=0 */
20159 + 0x10002458, /* 0178(:1040): DRD1A: var9 = var11; FN=0 MORE init=0 WS=0 RS=0 */
20160 + 0xb8c68018, /* 017C(:1041): LCD: idx2 = *(idx1 + var13); idx2 once var0; idx2 += inc3 */
20161 + 0x10002f10, /* 0180(:1042): DRD1A: var11 = idx2; FN=0 MORE init=0 WS=0 RS=0 */
20162 + 0x7000000a, /* 0184(:1043): DRD2A: EU0=0 EU1=0 EU2=0 EU3=10 EXT MORE init=0 WS=0 RS=0 */
20163 + 0x080cf89f, /* 0188(:1043): DRD2B1: idx0 = EU3(); EU3(idx2) */
20164 + 0x6000000d, /* 018C(:1044): DRD2A: EU0=0 EU1=0 EU2=0 EU3=13 EXT init=0 WS=0 RS=0 */
20165 + 0x01ccf89f, /* 0190(:1044): DRD2B1: var7 = EU3(); EU3(idx2) */
20166 + 0x000001f8, /* 0194(:0): NOP */
20167 + 0x8698801b, /* 0198(:1050): LCD: idx1 = var13; idx1 once var0; idx1 += inc3 */
20168 + 0x7000000e, /* 019C(:1051): DRD2A: EU0=0 EU1=0 EU2=0 EU3=14 EXT MORE init=0 WS=0 RS=0 */
20169 + 0x084cf25f, /* 01A0(:1051): DRD2B1: idx1 = EU3(); EU3(var9) */
20170 + 0xd899037f, /* 01A4(:1052): LCDEXT: idx2 = idx1; idx2 > var13; idx2 += inc7 */
20171 + 0x8019801b, /* 01A8(:1052): LCD: idx3 = var0; idx3 once var0; idx3 += inc3 */
20172 + 0x040001f8, /* 01AC(:1053): DRD1A: FN=0 INT init=0 WS=0 RS=0 */
20173 + 0x000001f8, /* 01B0(:0): NOP */
20174 + 0x000001f8, /* 01B4(:0): NOP */
20176 +u32 MCD_SingleEu_TDT[]=
20178 + 0x8218001b, /* 0000(:1248): LCD: idx0 = var4; idx0 once var0; idx0 += inc3 */
20179 + 0x7000000d, /* 0004(:1249): DRD2A: EU0=0 EU1=0 EU2=0 EU3=13 EXT MORE init=0 WS=0 RS=0 */
20180 + 0x080cf81f, /* 0008(:1249): DRD2B1: idx0 = EU3(); EU3(idx0) */
20181 + 0x8218801b, /* 000C(:1250): LCD: idx1 = var4; idx1 once var0; idx1 += inc3 */
20182 + 0x6000000e, /* 0010(:1251): DRD2A: EU0=0 EU1=0 EU2=0 EU3=14 EXT init=0 WS=0 RS=0 */
20183 + 0x084cf85f, /* 0014(:1251): DRD2B1: idx1 = EU3(); EU3(idx1) */
20184 + 0x000001f8, /* 0018(:0): NOP */
20185 + 0x8318001b, /* 001C(:1255): LCD: idx0 = var6; idx0 once var0; idx0 += inc3 */
20186 + 0x7000000d, /* 0020(:1256): DRD2A: EU0=0 EU1=0 EU2=0 EU3=13 EXT MORE init=0 WS=0 RS=0 */
20187 + 0x014cf81f, /* 0024(:1256): DRD2B1: var5 = EU3(); EU3(idx0) */
20188 + 0x6000000e, /* 0028(:1257): DRD2A: EU0=0 EU1=0 EU2=0 EU3=14 EXT init=0 WS=0 RS=0 */
20189 + 0x01ccf81f, /* 002C(:1257): DRD2B1: var7 = EU3(); EU3(idx0) */
20190 + 0x8498001b, /* 0030(:1260): LCD: idx0 = var9; idx0 once var0; idx0 += inc3 */
20191 + 0x7000000f, /* 0034(:1261): DRD2A: EU0=0 EU1=0 EU2=0 EU3=15 EXT MORE init=0 WS=0 RS=0 */
20192 + 0x080cf19f, /* 0038(:1261): DRD2B1: idx0 = EU3(); EU3(var6) */
20193 + 0xd81882a4, /* 003C(:1262): LCDEXT: idx1 = idx0; idx1 >= var10; idx1 += inc4 */
20194 + 0x8019001b, /* 0040(:1262): LCD: idx2 = var0; idx2 once var0; idx2 += inc3 */
20195 + 0x60000003, /* 0044(:1263): DRD2A: EU0=0 EU1=0 EU2=0 EU3=3 EXT init=0 WS=0 RS=0 */
20196 + 0x2c97c7df, /* 0048(:1263): DRD2B2: EU3(var9) */
20197 + 0xd818826d, /* 004C(:1264): LCDEXT: idx1 = idx0; idx1 == var9; idx1 += inc5 */
20198 + 0x8019001b, /* 0050(:1264): LCD: idx2 = var0; idx2 once var0; idx2 += inc3 */
20199 + 0x60000003, /* 0054(:1265): DRD2A: EU0=0 EU1=0 EU2=0 EU3=3 EXT init=0 WS=0 RS=0 */
20200 + 0x2c17c7df, /* 0058(:1265): DRD2B2: EU3(var1) */
20201 + 0x000001f8, /* 005C(:0): NOP */
20202 + 0xc282e01b, /* 0060(:1268): LCDEXT: idx0 = var5, idx1 = var5; ; idx0 += inc3, idx1 += inc3 */
20203 + 0xc002a25e, /* 0064(:1268): LCDEXT: idx2 = var0, idx3 = var5; idx3 == var9; idx2 += inc3, idx3 += inc6 */
20204 + 0x811a601b, /* 0068(:1269): LCD: idx4 = var2; ; idx4 += inc3 */
20205 + 0xc184a102, /* 006C(:1272): LCDEXT: idx5 = var3, idx6 = var9; idx6 < var4; idx5 += inc0, idx6 += inc2 */
20206 + 0x841be009, /* 0070(:1272): LCD: idx7 = var8; ; idx7 += inc1 */
20207 + 0x63fe0000, /* 0074(:1275): DRD2A: EU0=0 EU1=0 EU2=0 EU3=0 EXT init=31 WS=3 RS=3 */
20208 + 0x0d4cfddf, /* 0078(:1275): DRD2B1: *idx5 = EU3(); EU3(*idx7) */
20209 + 0xda9b001b, /* 007C(:1277): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
20210 + 0x9b9be01b, /* 0080(:1277): LCD: idx7 = idx7; ; idx7 += inc3 */
20211 + 0x70000002, /* 0084(:1279): DRD2A: EU0=0 EU1=0 EU2=0 EU3=2 EXT MORE init=0 WS=0 RS=0 */
20212 + 0x004cf99f, /* 0088(:1279): DRD2B1: var1 = EU3(); EU3(idx6) */
20213 + 0x70000006, /* 008C(:1280): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20214 + 0x088cf88b, /* 0090(:1280): DRD2B1: idx2 = EU3(); EU3(idx2,var11) */
20215 + 0x1000cb28, /* 0094(:1281): DRD1A: *idx2 = idx5; FN=0 MORE init=0 WS=0 RS=0 */
20216 + 0x70000006, /* 0098(:1282): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20217 + 0x088cf88b, /* 009C(:1282): DRD2B1: idx2 = EU3(); EU3(idx2,var11) */
20218 + 0x1000cb30, /* 00A0(:1283): DRD1A: *idx2 = idx6; FN=0 MORE init=0 WS=0 RS=0 */
20219 + 0x70000006, /* 00A4(:1284): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20220 + 0x088cf88b, /* 00A8(:1284): DRD2B1: idx2 = EU3(); EU3(idx2,var11) */
20221 + 0x0000cb38, /* 00AC(:1285): DRD1A: *idx2 = idx7; FN=0 init=0 WS=0 RS=0 */
20222 + 0x000001f8, /* 00B0(:0): NOP */
20223 + 0xc282e01b, /* 00B4(:1289): LCDEXT: idx0 = var5, idx1 = var5; ; idx0 += inc3, idx1 += inc3 */
20224 + 0xc002a31e, /* 00B8(:1289): LCDEXT: idx2 = var0, idx3 = var5; idx3 == var12; idx2 += inc3, idx3 += inc6 */
20225 + 0x811a601b, /* 00BC(:1290): LCD: idx4 = var2; ; idx4 += inc3 */
20226 + 0xda9b001b, /* 00C0(:1293): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
20227 + 0x9b9be01b, /* 00C4(:1293): LCD: idx7 = idx7; ; idx7 += inc3 */
20228 + 0x0000d3a0, /* 00C8(:1294): DRD1A: *idx4; FN=0 init=0 WS=0 RS=0 */
20229 + 0xc184a102, /* 00CC(:1296): LCDEXT: idx5 = var3, idx6 = var9; idx6 < var4; idx5 += inc0, idx6 += inc2 */
20230 + 0x841be009, /* 00D0(:1296): LCD: idx7 = var8; ; idx7 += inc1 */
20231 + 0x6bfe0000, /* 00D4(:1299): DRD2A: EU0=0 EU1=0 EU2=0 EU3=0 TFD EXT init=31 WS=3 RS=3 */
20232 + 0x0d4cfddf, /* 00D8(:1299): DRD2B1: *idx5 = EU3(); EU3(*idx7) */
20233 + 0xda9b001b, /* 00DC(:1301): LCDEXT: idx5 = idx5, idx6 = idx6; idx5 once var0; idx5 += inc3, idx6 += inc3 */
20234 + 0x9b9be01b, /* 00E0(:1301): LCD: idx7 = idx7; ; idx7 += inc3 */
20235 + 0x70000002, /* 00E4(:1303): DRD2A: EU0=0 EU1=0 EU2=0 EU3=2 EXT MORE init=0 WS=0 RS=0 */
20236 + 0x004cf99f, /* 00E8(:1303): DRD2B1: var1 = EU3(); EU3(idx6) */
20237 + 0x70000006, /* 00EC(:1304): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20238 + 0x088cf88b, /* 00F0(:1304): DRD2B1: idx2 = EU3(); EU3(idx2,var11) */
20239 + 0x1000cb28, /* 00F4(:1305): DRD1A: *idx2 = idx5; FN=0 MORE init=0 WS=0 RS=0 */
20240 + 0x70000006, /* 00F8(:1306): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20241 + 0x088cf88b, /* 00FC(:1306): DRD2B1: idx2 = EU3(); EU3(idx2,var11) */
20242 + 0x1000cb30, /* 0100(:1307): DRD1A: *idx2 = idx6; FN=0 MORE init=0 WS=0 RS=0 */
20243 + 0x70000006, /* 0104(:1308): DRD2A: EU0=0 EU1=0 EU2=0 EU3=6 EXT MORE init=0 WS=0 RS=0 */
20244 + 0x088cf88b, /* 0108(:1308): DRD2B1: idx2 = EU3(); EU3(idx2,var11) */
20245 + 0x0000cb38, /* 010C(:1309): DRD1A: *idx2 = idx7; FN=0 init=0 WS=0 RS=0 */
20246 + 0x000001f8, /* 0110(:0): NOP */
20247 + 0x8144801c, /* 0114(:1312): LCD: idx0 = var2 + var9 + 4; idx0 once var0; idx0 += inc3 */
20248 + 0x0000c008, /* 0118(:1313): DRD1A: *idx0 = var1; FN=0 init=0 WS=0 RS=0 */
20249 + 0xc398027f, /* 011C(:1315): LCDEXT: idx0 = var7; idx0 > var9; idx0 += inc7 */
20250 + 0x8018801b, /* 0120(:1315): LCD: idx1 = var0; idx1 once var0; idx1 += inc3 */
20251 + 0x040001f8, /* 0124(:1316): DRD1A: FN=0 INT init=0 WS=0 RS=0 */
20254 +u32 MCD_ENetRcv_TDT[]=
20256 + 0x80004000, /* 0000(:1389): LCDEXT: idx0 = 0x00000000; ; */
20257 + 0x81988000, /* 0004(:1389): LCD: idx1 = var3; idx1 once var0; idx1 += inc0 */
20258 + 0x10000788, /* 0008(:1390): DRD1A: var1 = *idx1; FN=0 MORE init=0 WS=0 RS=0 */
20259 + 0x6000000a, /* 000C(:1391): DRD2A: EU0=0 EU1=0 EU2=0 EU3=10 EXT init=0 WS=0 RS=0 */
20260 + 0x080cf05f, /* 0010(:1391): DRD2B1: idx0 = EU3(); EU3(var1) */
20261 + 0x98180209, /* 0014(:1394): LCD: idx0 = idx0; idx0 != var8; idx0 += inc1 */
20262 + 0x81c40004, /* 0018(:1396): LCD: idx1 = var3 + var8 + 4; idx1 once var0; idx1 += inc0 */
20263 + 0x7000000e, /* 001C(:1397): DRD2A: EU0=0 EU1=0 EU2=0 EU3=14 EXT MORE init=0 WS=0 RS=0 */
20264 + 0x010cf05f, /* 0020(:1397): DRD2B1: var4 = EU3(); EU3(var1) */
20265 + 0x7000000c, /* 0024(:1398): DRD2A: EU0=0 EU1=0 EU2=0 EU3=12 EXT MORE init=0 WS=0 RS=0 */
20266 + 0x01ccf05f, /* 0028(:1398): DRD2B1: var7 = EU3(); EU3(var1) */
20267 + 0x70000004, /* 002C(:1399): DRD2A: EU0=0 EU1=0 EU2=0 EU3=4 EXT MORE init=0 WS=0 RS=0 */
20268 + 0x014cf049, /* 0030(:1399): DRD2B1: var5 = EU3(); EU3(var1,var9) */
20269 + 0x70000004, /* 0034(:1400): DRD2A: EU0=0 EU1=0 EU2=0 EU3=4 EXT MORE init=0 WS=0 RS=0 */
20270 + 0x004cf04a, /* 0038(:1400): DRD2B1: var1 = EU3(); EU3(var1,var10) */
20271 + 0x00000b88, /* 003C(:1403): DRD1A: var2 = *idx1; FN=0 init=0 WS=0 RS=0 */
20272 + 0xc4030150, /* 0040(:1406): LCDEXT: idx1 = var8, idx2 = var6; idx1 < var5; idx1 += inc2, idx2 += inc0 */
20273 + 0x8119e012, /* 0044(:1406): LCD: idx3 = var2; ; idx3 += inc2 */
20274 + 0x03e0cf90, /* 0048(:1409): DRD1A: *idx3 = *idx2; FN=0 init=31 WS=0 RS=0 */
20275 + 0x81188000, /* 004C(:1412): LCD: idx1 = var2; idx1 once var0; idx1 += inc0 */
20276 + 0x000ac788, /* 0050(:1413): DRD1A: *idx1 = *idx1; FN=0 init=0 WS=1 RS=1 */
20277 + 0xc4030000, /* 0054(:1415): LCDEXT: idx1 = var8, idx2 = var6; idx1 once var0; idx1 += inc0, idx2 += inc0 */
20278 + 0x8199e000, /* 0058(:1415): LCD: idx3 = var3; ; idx3 += inc0 */
20279 + 0x63e00004, /* 005C(:1418): DRD2A: EU0=0 EU1=0 EU2=0 EU3=4 EXT init=31 WS=0 RS=0 */
20280 + 0x084cfc8b, /* 0060(:1418): DRD2B1: idx1 = EU3(); EU3(*idx2,var11) */
20281 + 0xd8990000, /* 0064(:1421): LCDEXT: idx1 = idx1, idx2 = idx2; idx1 once var0; idx1 += inc0, idx2 += inc0 */
20282 + 0x9999e000, /* 0068(:1421): LCD: idx3 = idx3; ; idx3 += inc0 */
20283 + 0x60000005, /* 006C(:1422): DRD2A: EU0=0 EU1=0 EU2=0 EU3=5 EXT init=0 WS=0 RS=0 */
20284 + 0x0cccf841, /* 0070(:1422): DRD2B1: *idx3 = EU3(); EU3(idx1,var1) */
20285 + 0x81c60000, /* 0074(:1427): LCD: idx1 = var3 + var12; idx1 once var0; idx1 += inc0 */
20286 + 0xc399021b, /* 0078(:1429): LCDEXT: idx2 = var7; idx2 > var8; idx2 += inc3 */
20287 + 0x80198000, /* 007C(:1429): LCD: idx3 = var0; idx3 once var0; idx3 += inc0 */
20288 + 0x00008400, /* 0080(:1430): DRD1A: idx1 = var0; FN=0 init=0 WS=0 RS=0 */
20289 + 0x00000f08, /* 0084(:1431): DRD1A: var3 = idx1; FN=0 init=0 WS=0 RS=0 */
20290 + 0x81988000, /* 0088(:1434): LCD: idx1 = var3; idx1 once var0; idx1 += inc0 */
20291 + 0x10000788, /* 008C(:1435): DRD1A: var1 = *idx1; FN=0 MORE init=0 WS=0 RS=0 */
20292 + 0x6000000a, /* 0090(:1436): DRD2A: EU0=0 EU1=0 EU2=0 EU3=10 EXT init=0 WS=0 RS=0 */
20293 + 0x080cf05f, /* 0094(:1436): DRD2B1: idx0 = EU3(); EU3(var1) */
20294 + 0xc2188209, /* 0098(:1439): LCDEXT: idx1 = var4; idx1 != var8; idx1 += inc1 */
20295 + 0x80190000, /* 009C(:1439): LCD: idx2 = var0; idx2 once var0; idx2 += inc0 */
20296 + 0x040001f8, /* 00A0(:1440): DRD1A: FN=0 INT init=0 WS=0 RS=0 */
20297 + 0x000001f8, /* 00A4(:0): NOP */
20299 +u32 MCD_ENetXmit_TDT[]=
20301 + 0x80004000, /* 0000(:1515): LCDEXT: idx0 = 0x00000000; ; */
20302 + 0x81988000, /* 0004(:1515): LCD: idx1 = var3; idx1 once var0; idx1 += inc0 */
20303 + 0x10000788, /* 0008(:1516): DRD1A: var1 = *idx1; FN=0 MORE init=0 WS=0 RS=0 */
20304 + 0x6000000a, /* 000C(:1517): DRD2A: EU0=0 EU1=0 EU2=0 EU3=10 EXT init=0 WS=0 RS=0 */
20305 + 0x080cf05f, /* 0010(:1517): DRD2B1: idx0 = EU3(); EU3(var1) */
20306 + 0x98180309, /* 0014(:1520): LCD: idx0 = idx0; idx0 != var12; idx0 += inc1 */
20307 + 0x80004003, /* 0018(:1522): LCDEXT: idx1 = 0x00000003; ; */
20308 + 0x81c60004, /* 001C(:1522): LCD: idx2 = var3 + var12 + 4; idx2 once var0; idx2 += inc0 */
20309 + 0x7000000e, /* 0020(:1523): DRD2A: EU0=0 EU1=0 EU2=0 EU3=14 EXT MORE init=0 WS=0 RS=0 */
20310 + 0x014cf05f, /* 0024(:1523): DRD2B1: var5 = EU3(); EU3(var1) */
20311 + 0x7000000c, /* 0028(:1524): DRD2A: EU0=0 EU1=0 EU2=0 EU3=12 EXT MORE init=0 WS=0 RS=0 */
20312 + 0x028cf05f, /* 002C(:1524): DRD2B1: var10 = EU3(); EU3(var1) */
20313 + 0x7000000d, /* 0030(:1525): DRD2A: EU0=0 EU1=0 EU2=0 EU3=13 EXT MORE init=0 WS=0 RS=0 */
20314 + 0x018cf05f, /* 0034(:1525): DRD2B1: var6 = EU3(); EU3(var1) */
20315 + 0x70000004, /* 0038(:1526): DRD2A: EU0=0 EU1=0 EU2=0 EU3=4 EXT MORE init=0 WS=0 RS=0 */
20316 + 0x01ccf04d, /* 003C(:1526): DRD2B1: var7 = EU3(); EU3(var1,var13) */
20317 + 0x10000b90, /* 0040(:1527): DRD1A: var2 = *idx2; FN=0 MORE init=0 WS=0 RS=0 */
20318 + 0x60000004, /* 0044(:1528): DRD2A: EU0=0 EU1=0 EU2=0 EU3=4 EXT init=0 WS=0 RS=0 */
20319 + 0x020cf0a1, /* 0048(:1528): DRD2B1: var8 = EU3(); EU3(var2,idx1) */
20320 + 0xc3188312, /* 004C(:1531): LCDEXT: idx1 = var6; idx1 > var12; idx1 += inc2 */
20321 + 0x83c70000, /* 0050(:1531): LCD: idx2 = var7 + var14; idx2 once var0; idx2 += inc0 */
20322 + 0x00001f10, /* 0054(:1532): DRD1A: var7 = idx2; FN=0 init=0 WS=0 RS=0 */
20323 + 0xc583a3c3, /* 0058(:1534): LCDEXT: idx1 = var11, idx2 = var7; idx2 >= var15; idx1 += inc0, idx2 += inc3 */
20324 + 0x81042325, /* 005C(:1534): LCD: idx3 = var2, idx4 = var8; idx4 == var12; idx3 += inc4, idx4 += inc5 */
20325 + 0x03e0c798, /* 0060(:1539): DRD1A: *idx1 = *idx3; FN=0 init=31 WS=0 RS=0 */
20326 + 0xd8990000, /* 0064(:1542): LCDEXT: idx1 = idx1, idx2 = idx2; idx1 once var0; idx1 += inc0, idx2 += inc0 */
20327 + 0x9999e000, /* 0068(:1542): LCD: idx3 = idx3; ; idx3 += inc0 */
20328 + 0x000acf98, /* 006C(:1543): DRD1A: *idx3 = *idx3; FN=0 init=0 WS=1 RS=1 */
20329 + 0xd8992306, /* 0070(:1545): LCDEXT: idx1 = idx1, idx2 = idx2; idx2 > var12; idx1 += inc0, idx2 += inc6 */
20330 + 0x9999e03f, /* 0074(:1545): LCD: idx3 = idx3; ; idx3 += inc7 */
20331 + 0x03eac798, /* 0078(:1548): DRD1A: *idx1 = *idx3; FN=0 init=31 WS=1 RS=1 */
20332 + 0xd8990000, /* 007C(:1551): LCDEXT: idx1 = idx1, idx2 = idx2; idx1 once var0; idx1 += inc0, idx2 += inc0 */
20333 + 0x9999e000, /* 0080(:1551): LCD: idx3 = idx3; ; idx3 += inc0 */
20334 + 0x000acf98, /* 0084(:1552): DRD1A: *idx3 = *idx3; FN=0 init=0 WS=1 RS=1 */
20335 + 0xd8990000, /* 0088(:1554): LCDEXT: idx1 = idx1, idx2 = idx2; idx1 once var0; idx1 += inc0, idx2 += inc0 */
20336 + 0x99832302, /* 008C(:1554): LCD: idx3 = idx3, idx4 = var6; idx4 > var12; idx3 += inc0, idx4 += inc2 */
20337 + 0x0beac798, /* 0090(:1557): DRD1A: *idx1 = *idx3; FN=0 TFD init=31 WS=1 RS=1 */
20338 + 0x81988000, /* 0094(:1559): LCD: idx1 = var3; idx1 once var0; idx1 += inc0 */
20339 + 0x6000000b, /* 0098(:1560): DRD2A: EU0=0 EU1=0 EU2=0 EU3=11 EXT init=0 WS=0 RS=0 */
20340 + 0x0c4cfc5f, /* 009C(:1560): DRD2B1: *idx1 = EU3(); EU3(*idx1) */
20341 + 0x81c80000, /* 00A0(:1562): LCD: idx1 = var3 + var16; idx1 once var0; idx1 += inc0 */
20342 + 0xc5190312, /* 00A4(:1564): LCDEXT: idx2 = var10; idx2 > var12; idx2 += inc2 */
20343 + 0x80198000, /* 00A8(:1564): LCD: idx3 = var0; idx3 once var0; idx3 += inc0 */
20344 + 0x00008400, /* 00AC(:1565): DRD1A: idx1 = var0; FN=0 init=0 WS=0 RS=0 */
20345 + 0x00000f08, /* 00B0(:1566): DRD1A: var3 = idx1; FN=0 init=0 WS=0 RS=0 */
20346 + 0x81988000, /* 00B4(:1569): LCD: idx1 = var3; idx1 once var0; idx1 += inc0 */
20347 + 0x10000788, /* 00B8(:1570): DRD1A: var1 = *idx1; FN=0 MORE init=0 WS=0 RS=0 */
20348 + 0x6000000a, /* 00BC(:1571): DRD2A: EU0=0 EU1=0 EU2=0 EU3=10 EXT init=0 WS=0 RS=0 */
20349 + 0x080cf05f, /* 00C0(:1571): DRD2B1: idx0 = EU3(); EU3(var1) */
20350 + 0xc2988309, /* 00C4(:1574): LCDEXT: idx1 = var5; idx1 != var12; idx1 += inc1 */
20351 + 0x80190000, /* 00C8(:1574): LCD: idx2 = var0; idx2 once var0; idx2 += inc0 */
20352 + 0x040001f8, /* 00CC(:1575): DRD1A: FN=0 INT init=0 WS=0 RS=0 */
20353 + 0x000001f8, /* 00D0(:0): NOP */
20356 +#ifdef MCD_INCLUDE_EU
20357 +MCD_bufDesc MCD_singleBufDescs[NCHANNELS];
20360 +++ b/drivers/dma/MCD_tasksInit.c
20363 + * drivers/dma/MCD_tasksInit.c
20365 + * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
20366 + * Kurt Mahan <kmahan@freescale.com>
20368 + * This program is free software; you can redistribute it and/or
20369 + * modify it under the terms of the GNU General Public License as
20370 + * published by the Free Software Foundation; either version 2 of
20371 + * the License, or (at your option) any later version.
20373 + * This program is distributed in the hope that it will be useful,
20374 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
20375 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20376 + * GNU General Public License for more details.
20378 + * You should have received a copy of the GNU General Public License
20379 + * along with this program; if not, write to the Free Software
20380 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20381 + * MA 02111-1307 USA
20385 + * Autogenerated - Do not edit!
20388 +#include "MCD_dma.h"
20390 +extern dmaRegs *MCD_dmaBar;
20397 +void MCD_startDmaChainNoEu(int *currBD, short srcIncr, short destIncr, int xferSize, short xferSizeIncr, int *cSave, volatile TaskTableEntry *taskTable, int channel)
20400 + MCD_SET_VAR(taskTable+channel, 2, (u32)currBD); /* var[2] */
20401 + MCD_SET_VAR(taskTable+channel, 25, (u32)(0xe000 << 16) | (0xffff & srcIncr)); /* inc[1] */
20402 + MCD_SET_VAR(taskTable+channel, 24, (u32)(0xe000 << 16) | (0xffff & destIncr)); /* inc[0] */
20403 + MCD_SET_VAR(taskTable+channel, 11, (u32)xferSize); /* var[11] */
20404 + MCD_SET_VAR(taskTable+channel, 26, (u32)(0x2000 << 16) | (0xffff & xferSizeIncr)); /* inc[2] */
20405 + MCD_SET_VAR(taskTable+channel, 0, (u32)cSave); /* var[0] */
20406 + MCD_SET_VAR(taskTable+channel, 1, (u32)0x00000000); /* var[1] */
20407 + MCD_SET_VAR(taskTable+channel, 3, (u32)0x00000000); /* var[3] */
20408 + MCD_SET_VAR(taskTable+channel, 4, (u32)0x00000000); /* var[4] */
20409 + MCD_SET_VAR(taskTable+channel, 5, (u32)0x00000000); /* var[5] */
20410 + MCD_SET_VAR(taskTable+channel, 6, (u32)0x00000000); /* var[6] */
20411 + MCD_SET_VAR(taskTable+channel, 7, (u32)0x00000000); /* var[7] */
20412 + MCD_SET_VAR(taskTable+channel, 8, (u32)0x00000000); /* var[8] */
20413 + MCD_SET_VAR(taskTable+channel, 9, (u32)0x00000000); /* var[9] */
20414 + MCD_SET_VAR(taskTable+channel, 10, (u32)0x00000000); /* var[10] */
20415 + MCD_SET_VAR(taskTable+channel, 12, (u32)0x00000000); /* var[12] */
20416 + MCD_SET_VAR(taskTable+channel, 13, (u32)0x80000000); /* var[13] */
20417 + MCD_SET_VAR(taskTable+channel, 14, (u32)0x00000010); /* var[14] */
20418 + MCD_SET_VAR(taskTable+channel, 15, (u32)0x00000004); /* var[15] */
20419 + MCD_SET_VAR(taskTable+channel, 16, (u32)0x08000000); /* var[16] */
20420 + MCD_SET_VAR(taskTable+channel, 27, (u32)0x00000000); /* inc[3] */
20421 + MCD_SET_VAR(taskTable+channel, 28, (u32)0x80000000); /* inc[4] */
20422 + MCD_SET_VAR(taskTable+channel, 29, (u32)0x80000001); /* inc[5] */
20423 + MCD_SET_VAR(taskTable+channel, 30, (u32)0x40000000); /* inc[6] */
20425 + /* Set the task's Enable bit in its Task Control Register */
20426 + MCD_dmaBar->taskControl[channel] |= (u16)0x8000;
20434 +void MCD_startDmaSingleNoEu(char *srcAddr, short srcIncr, char *destAddr, short destIncr, int dmaSize, short xferSizeIncr, int flags, int *currBD, int *cSave, volatile TaskTableEntry *taskTable, int channel)
20437 + MCD_SET_VAR(taskTable+channel, 7, (u32)srcAddr); /* var[7] */
20438 + MCD_SET_VAR(taskTable+channel, 25, (u32)(0xe000 << 16) | (0xffff & srcIncr)); /* inc[1] */
20439 + MCD_SET_VAR(taskTable+channel, 2, (u32)destAddr); /* var[2] */
20440 + MCD_SET_VAR(taskTable+channel, 24, (u32)(0xe000 << 16) | (0xffff & destIncr)); /* inc[0] */
20441 + MCD_SET_VAR(taskTable+channel, 3, (u32)dmaSize); /* var[3] */
20442 + MCD_SET_VAR(taskTable+channel, 26, (u32)(0x2000 << 16) | (0xffff & xferSizeIncr)); /* inc[2] */
20443 + MCD_SET_VAR(taskTable+channel, 5, (u32)flags); /* var[5] */
20444 + MCD_SET_VAR(taskTable+channel, 1, (u32)currBD); /* var[1] */
20445 + MCD_SET_VAR(taskTable+channel, 0, (u32)cSave); /* var[0] */
20446 + MCD_SET_VAR(taskTable+channel, 4, (u32)0x00000000); /* var[4] */
20447 + MCD_SET_VAR(taskTable+channel, 6, (u32)0x00000000); /* var[6] */
20448 + MCD_SET_VAR(taskTable+channel, 8, (u32)0x00000000); /* var[8] */
20449 + MCD_SET_VAR(taskTable+channel, 9, (u32)0x00000004); /* var[9] */
20450 + MCD_SET_VAR(taskTable+channel, 10, (u32)0x08000000); /* var[10] */
20451 + MCD_SET_VAR(taskTable+channel, 27, (u32)0x00000000); /* inc[3] */
20452 + MCD_SET_VAR(taskTable+channel, 28, (u32)0x80000001); /* inc[4] */
20453 + MCD_SET_VAR(taskTable+channel, 29, (u32)0x40000000); /* inc[5] */
20455 + /* Set the task's Enable bit in its Task Control Register */
20456 + MCD_dmaBar->taskControl[channel] |= (u16)0x8000;
20464 +void MCD_startDmaChainEu(int *currBD, short srcIncr, short destIncr, int xferSize, short xferSizeIncr, int *cSave, volatile TaskTableEntry *taskTable, int channel)
20467 + MCD_SET_VAR(taskTable+channel, 3, (u32)currBD); /* var[3] */
20468 + MCD_SET_VAR(taskTable+channel, 25, (u32)(0xe000 << 16) | (0xffff & srcIncr)); /* inc[1] */
20469 + MCD_SET_VAR(taskTable+channel, 24, (u32)(0xe000 << 16) | (0xffff & destIncr)); /* inc[0] */
20470 + MCD_SET_VAR(taskTable+channel, 12, (u32)xferSize); /* var[12] */
20471 + MCD_SET_VAR(taskTable+channel, 26, (u32)(0x2000 << 16) | (0xffff & xferSizeIncr)); /* inc[2] */
20472 + MCD_SET_VAR(taskTable+channel, 0, (u32)cSave); /* var[0] */
20473 + MCD_SET_VAR(taskTable+channel, 1, (u32)0x00000000); /* var[1] */
20474 + MCD_SET_VAR(taskTable+channel, 2, (u32)0x00000000); /* var[2] */
20475 + MCD_SET_VAR(taskTable+channel, 4, (u32)0x00000000); /* var[4] */
20476 + MCD_SET_VAR(taskTable+channel, 5, (u32)0x00000000); /* var[5] */
20477 + MCD_SET_VAR(taskTable+channel, 6, (u32)0x00000000); /* var[6] */
20478 + MCD_SET_VAR(taskTable+channel, 7, (u32)0x00000000); /* var[7] */
20479 + MCD_SET_VAR(taskTable+channel, 8, (u32)0x00000000); /* var[8] */
20480 + MCD_SET_VAR(taskTable+channel, 9, (u32)0x00000000); /* var[9] */
20481 + MCD_SET_VAR(taskTable+channel, 10, (u32)0x00000000); /* var[10] */
20482 + MCD_SET_VAR(taskTable+channel, 11, (u32)0x00000000); /* var[11] */
20483 + MCD_SET_VAR(taskTable+channel, 13, (u32)0x00000000); /* var[13] */
20484 + MCD_SET_VAR(taskTable+channel, 14, (u32)0x80000000); /* var[14] */
20485 + MCD_SET_VAR(taskTable+channel, 15, (u32)0x00000010); /* var[15] */
20486 + MCD_SET_VAR(taskTable+channel, 16, (u32)0x00000001); /* var[16] */
20487 + MCD_SET_VAR(taskTable+channel, 17, (u32)0x00000004); /* var[17] */
20488 + MCD_SET_VAR(taskTable+channel, 18, (u32)0x08000000); /* var[18] */
20489 + MCD_SET_VAR(taskTable+channel, 27, (u32)0x00000000); /* inc[3] */
20490 + MCD_SET_VAR(taskTable+channel, 28, (u32)0x80000000); /* inc[4] */
20491 + MCD_SET_VAR(taskTable+channel, 29, (u32)0xc0000000); /* inc[5] */
20492 + MCD_SET_VAR(taskTable+channel, 30, (u32)0x80000001); /* inc[6] */
20493 + MCD_SET_VAR(taskTable+channel, 31, (u32)0x40000000); /* inc[7] */
20495 + /* Set the task's Enable bit in its Task Control Register */
20496 + MCD_dmaBar->taskControl[channel] |= (u16)0x8000;
20504 +void MCD_startDmaSingleEu(char *srcAddr, short srcIncr, char *destAddr, short destIncr, int dmaSize, short xferSizeIncr, int flags, int *currBD, int *cSave, volatile TaskTableEntry *taskTable, int channel)
20507 + MCD_SET_VAR(taskTable+channel, 8, (u32)srcAddr); /* var[8] */
20508 + MCD_SET_VAR(taskTable+channel, 25, (u32)(0xe000 << 16) | (0xffff & srcIncr)); /* inc[1] */
20509 + MCD_SET_VAR(taskTable+channel, 3, (u32)destAddr); /* var[3] */
20510 + MCD_SET_VAR(taskTable+channel, 24, (u32)(0xe000 << 16) | (0xffff & destIncr)); /* inc[0] */
20511 + MCD_SET_VAR(taskTable+channel, 4, (u32)dmaSize); /* var[4] */
20512 + MCD_SET_VAR(taskTable+channel, 26, (u32)(0x2000 << 16) | (0xffff & xferSizeIncr)); /* inc[2] */
20513 + MCD_SET_VAR(taskTable+channel, 6, (u32)flags); /* var[6] */
20514 + MCD_SET_VAR(taskTable+channel, 2, (u32)currBD); /* var[2] */
20515 + MCD_SET_VAR(taskTable+channel, 0, (u32)cSave); /* var[0] */
20516 + MCD_SET_VAR(taskTable+channel, 1, (u32)0x00000000); /* var[1] */
20517 + MCD_SET_VAR(taskTable+channel, 5, (u32)0x00000000); /* var[5] */
20518 + MCD_SET_VAR(taskTable+channel, 7, (u32)0x00000000); /* var[7] */
20519 + MCD_SET_VAR(taskTable+channel, 9, (u32)0x00000000); /* var[9] */
20520 + MCD_SET_VAR(taskTable+channel, 10, (u32)0x00000001); /* var[10] */
20521 + MCD_SET_VAR(taskTable+channel, 11, (u32)0x00000004); /* var[11] */
20522 + MCD_SET_VAR(taskTable+channel, 12, (u32)0x08000000); /* var[12] */
20523 + MCD_SET_VAR(taskTable+channel, 27, (u32)0x00000000); /* inc[3] */
20524 + MCD_SET_VAR(taskTable+channel, 28, (u32)0xc0000000); /* inc[4] */
20525 + MCD_SET_VAR(taskTable+channel, 29, (u32)0x80000000); /* inc[5] */
20526 + MCD_SET_VAR(taskTable+channel, 30, (u32)0x80000001); /* inc[6] */
20527 + MCD_SET_VAR(taskTable+channel, 31, (u32)0x40000000); /* inc[7] */
20529 + /* Set the task's Enable bit in its Task Control Register */
20530 + MCD_dmaBar->taskControl[channel] |= (u16)0x8000;
20538 +void MCD_startDmaENetRcv(char *bDBase, char *currBD, char *rcvFifoPtr, volatile TaskTableEntry *taskTable, int channel)
20541 + MCD_SET_VAR(taskTable+channel, 0, (u32)bDBase); /* var[0] */
20542 + MCD_SET_VAR(taskTable+channel, 3, (u32)currBD); /* var[3] */
20543 + MCD_SET_VAR(taskTable+channel, 6, (u32)rcvFifoPtr); /* var[6] */
20544 + MCD_SET_VAR(taskTable+channel, 1, (u32)0x00000000); /* var[1] */
20545 + MCD_SET_VAR(taskTable+channel, 2, (u32)0x00000000); /* var[2] */
20546 + MCD_SET_VAR(taskTable+channel, 4, (u32)0x00000000); /* var[4] */
20547 + MCD_SET_VAR(taskTable+channel, 5, (u32)0x00000000); /* var[5] */
20548 + MCD_SET_VAR(taskTable+channel, 7, (u32)0x00000000); /* var[7] */
20549 + MCD_SET_VAR(taskTable+channel, 8, (u32)0x00000000); /* var[8] */
20550 + MCD_SET_VAR(taskTable+channel, 9, (u32)0x0000ffff); /* var[9] */
20551 + MCD_SET_VAR(taskTable+channel, 10, (u32)0x30000000); /* var[10] */
20552 + MCD_SET_VAR(taskTable+channel, 11, (u32)0x0fffffff); /* var[11] */
20553 + MCD_SET_VAR(taskTable+channel, 12, (u32)0x00000008); /* var[12] */
20554 + MCD_SET_VAR(taskTable+channel, 24, (u32)0x00000000); /* inc[0] */
20555 + MCD_SET_VAR(taskTable+channel, 25, (u32)0x60000000); /* inc[1] */
20556 + MCD_SET_VAR(taskTable+channel, 26, (u32)0x20000004); /* inc[2] */
20557 + MCD_SET_VAR(taskTable+channel, 27, (u32)0x40000000); /* inc[3] */
20559 + /* Set the task's Enable bit in its Task Control Register */
20560 + MCD_dmaBar->taskControl[channel] |= (u16)0x8000;
20568 +void MCD_startDmaENetXmit(char *bDBase, char *currBD, char *xmitFifoPtr, volatile TaskTableEntry *taskTable, int channel)
20571 + MCD_SET_VAR(taskTable+channel, 0, (u32)bDBase); /* var[0] */
20572 + MCD_SET_VAR(taskTable+channel, 3, (u32)currBD); /* var[3] */
20573 + MCD_SET_VAR(taskTable+channel, 11, (u32)xmitFifoPtr); /* var[11] */
20574 + MCD_SET_VAR(taskTable+channel, 1, (u32)0x00000000); /* var[1] */
20575 + MCD_SET_VAR(taskTable+channel, 2, (u32)0x00000000); /* var[2] */
20576 + MCD_SET_VAR(taskTable+channel, 4, (u32)0x00000000); /* var[4] */
20577 + MCD_SET_VAR(taskTable+channel, 5, (u32)0x00000000); /* var[5] */
20578 + MCD_SET_VAR(taskTable+channel, 6, (u32)0x00000000); /* var[6] */
20579 + MCD_SET_VAR(taskTable+channel, 7, (u32)0x00000000); /* var[7] */
20580 + MCD_SET_VAR(taskTable+channel, 8, (u32)0x00000000); /* var[8] */
20581 + MCD_SET_VAR(taskTable+channel, 9, (u32)0x00000000); /* var[9] */
20582 + MCD_SET_VAR(taskTable+channel, 10, (u32)0x00000000); /* var[10] */
20583 + MCD_SET_VAR(taskTable+channel, 12, (u32)0x00000000); /* var[12] */
20584 + MCD_SET_VAR(taskTable+channel, 13, (u32)0x0000ffff); /* var[13] */
20585 + MCD_SET_VAR(taskTable+channel, 14, (u32)0xffffffff); /* var[14] */
20586 + MCD_SET_VAR(taskTable+channel, 15, (u32)0x00000004); /* var[15] */
20587 + MCD_SET_VAR(taskTable+channel, 16, (u32)0x00000008); /* var[16] */
20588 + MCD_SET_VAR(taskTable+channel, 24, (u32)0x00000000); /* inc[0] */
20589 + MCD_SET_VAR(taskTable+channel, 25, (u32)0x60000000); /* inc[1] */
20590 + MCD_SET_VAR(taskTable+channel, 26, (u32)0x40000000); /* inc[2] */
20591 + MCD_SET_VAR(taskTable+channel, 27, (u32)0xc000fffc); /* inc[3] */
20592 + MCD_SET_VAR(taskTable+channel, 28, (u32)0xe0000004); /* inc[4] */
20593 + MCD_SET_VAR(taskTable+channel, 29, (u32)0x80000000); /* inc[5] */
20594 + MCD_SET_VAR(taskTable+channel, 30, (u32)0x4000ffff); /* inc[6] */
20595 + MCD_SET_VAR(taskTable+channel, 31, (u32)0xe0000001); /* inc[7] */
20597 + /* Set the task's Enable bit in its Task Control Register */
20598 + MCD_dmaBar->taskControl[channel] |= (u16)0x8000;
20601 +++ b/drivers/dma/MCD_tasksInit.h
20604 + * drivers/dma/MCD_tasksInit.h
20606 + * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
20607 + * Kurt Mahan <kmahan@freescale.com>
20609 + * This program is free software; you can redistribute it and/or
20610 + * modify it under the terms of the GNU General Public License as
20611 + * published by the Free Software Foundation; either version 2 of
20612 + * the License, or (at your option) any later version.
20614 + * This program is distributed in the hope that it will be useful,
20615 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
20616 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20617 + * GNU General Public License for more details.
20619 + * You should have received a copy of the GNU General Public License
20620 + * along with this program; if not, write to the Free Software
20621 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20622 + * MA 02111-1307 USA
20624 +#ifndef MCD_TSK_INIT_H
20625 +#define MCD_TSK_INIT_H 1
20628 + * Autogenerated - Do not edit!
20634 +void MCD_startDmaChainNoEu(int *currBD, short srcIncr, short destIncr, int xferSize, short xferSizeIncr, int *cSave, volatile TaskTableEntry *taskTable, int channel);
20640 +void MCD_startDmaSingleNoEu(char *srcAddr, short srcIncr, char *destAddr, short destIncr, int dmaSize, short xferSizeIncr, int flags, int *currBD, int *cSave, volatile TaskTableEntry *taskTable, int channel);
20646 +void MCD_startDmaChainEu(int *currBD, short srcIncr, short destIncr, int xferSize, short xferSizeIncr, int *cSave, volatile TaskTableEntry *taskTable, int channel);
20652 +void MCD_startDmaSingleEu(char *srcAddr, short srcIncr, char *destAddr, short destIncr, int dmaSize, short xferSizeIncr, int flags, int *currBD, int *cSave, volatile TaskTableEntry *taskTable, int channel);
20658 +void MCD_startDmaENetRcv(char *bDBase, char *currBD, char *rcvFifoPtr, volatile TaskTableEntry *taskTable, int channel);
20664 +void MCD_startDmaENetXmit(char *bDBase, char *currBD, char *xmitFifoPtr, volatile TaskTableEntry *taskTable, int channel);
20666 +#endif /* MCD_TSK_INIT_H */
20668 +++ b/drivers/i2c/busses/i2c-algo-mcf.h
20670 +#ifndef I2C_ALGO_MCF_H
20671 +#define I2C_ALGO_MCF_H 1
20673 +/* --- Defines for pcf-adapters --------------------------------------- */
20674 +#include <linux/i2c.h>
20676 +struct i2c_algo_mcf_data {
20677 + void *data; /* private data for lolevel routines */
20678 + void (*setmcf) (void *data, int ctl, int val);
20679 + int (*getmcf) (void *data, int ctl);
20680 + int (*getown) (void *data);
20681 + int (*getclock) (void *data);
20682 + void (*waitforpin) (void);
20683 + /* local settings */
20689 +int i2c_mcf_add_bus(struct i2c_adapter *);
20690 +int i2c_mcf_del_bus(struct i2c_adapter *);
20692 +#endif /* I2C_ALGO_MCF_H */
20694 +++ b/drivers/i2c/busses/i2c-mcf548x.c
20697 + * Performance and stability improvements: (C) Copyright 2008,
20698 + * Adrian Cox <adrian@humboldt.co.uk>
20699 + * ColdFire 547x/548x I2C master support
20700 + * Shrek Wu (b16972@freescale.com )moved the code driver/i2c/alg/mcf.c
20701 + * into driver/i2c/busses.And changed the driver to a platform driver.
20703 +#include <linux/i2c.h>
20704 +#include "i2c-algo-mcf.h"
20706 +#include <linux/init.h>
20707 +#include <linux/kernel.h>
20708 +#include <linux/module.h>
20709 +#include <linux/delay.h>
20710 +#include <linux/platform_device.h>
20711 +#include <linux/sched.h>
20712 +#include <linux/interrupt.h>
20713 +#include <asm/io.h>
20715 +#include <asm/coldfire.h>
20716 +#include <asm/m5485sim.h>
20717 +#include <asm/m5485i2c.h>
20719 +#define get_clock(adap) (clock)
20720 +#define get_own(adap) (own)
20722 +static int clock = 0x3b; /*50000 / 1024 ~ 49 KHz*/
20723 +module_param(clock, int, 0);
20724 +MODULE_PARM_DESC(clock,
20725 + "Set I2C clock in kHz: 400=fast mode (default == 49khz)");
20727 +static int own = 0x78;
20728 +module_param(own, int, 0);
20729 +MODULE_PARM_DESC(clock, "Set I2C Master controller address(0x78)");
20731 +static struct i2c_algo_mcf_data i2c_mcf_board_data = {
20732 + .timeout = 10000,
20735 +static struct i2c_adapter i2c_mcf_board_adapter = {
20736 + .owner = THIS_MODULE,
20737 + .name = "MCF5485 adapter",
20738 + .id = I2C_HW_MPC107,
20739 + .algo_data = &i2c_mcf_board_data,
20740 + .class = I2C_CLASS_HWMON,
20745 + * static void i2c_start()
20747 + * Generates START signal
20751 + struct i2c_algo_mcf_data *adap
20753 + MCF_I2CR |= MCF_I2CR_MSTA;
20758 + * static void i2c_stop()
20760 + * Generates STOP signal
20764 + struct i2c_algo_mcf_data *adap
20766 + MCF_I2CR &= ~MCF_I2CR_MSTA;
20771 + struct i2c_algo_mcf_data *adap
20773 + return !(MCF_I2SR & MCF_I2SR_RXAK);
20777 + * static void i2c_repstart()
20779 + * Generates repeated start signal (without STOP while mastering the bus)
20783 + struct i2c_algo_mcf_data *adap
20785 + MCF_I2CR |= MCF_I2CR_RSTA;
20786 + MCF_I2CR |= MCF_I2CR_MTX;
20791 + * static void wait_for_bb()
20793 + * Wait for bus idle state
20797 + struct i2c_algo_mcf_data *adap
20800 + for (i = 0; i < adap->timeout; i++) {
20801 + if (!(MCF_I2SR & MCF_I2SR_IBB))
20805 + printk(KERN_ERR "%s: timeout", __FUNCTION__);
20806 + return -ETIMEDOUT;
20810 + * static void wait_for_not_bb()
20812 + * Wait for bus busy state
20816 + struct i2c_algo_mcf_data *adap
20819 + for (i = 0; i < adap->timeout; i++) {
20820 + if (MCF_I2SR & MCF_I2SR_IBB)
20824 + printk(KERN_ERR "%s: timeout", __FUNCTION__);
20825 + return -ETIMEDOUT;
20829 + * static void wait_xfer_done()
20831 + * Wait for transfer to complete
20835 + struct i2c_algo_mcf_data *adap
20839 + for (i = 0; i < adap->timeout; i++) {
20840 + if (MCF_I2SR & MCF_I2SR_IIF) {
20841 + MCF_I2SR &= ~MCF_I2SR_IIF;
20846 + printk(KERN_ERR "%s: timeout", __FUNCTION__);
20847 + return -ETIMEDOUT;
20852 + * static void i2c_set_addr()
20854 + * Sets slave address to communicate
20858 + struct i2c_algo_mcf_data *adap,
20859 + struct i2c_msg *msg,
20862 + unsigned short flags = msg->flags;
20863 + unsigned char addr;
20864 + MCF_I2CR |= MCF_I2CR_MTX;
20865 + if ((flags & I2C_M_TEN)) {
20866 + /* 10 bit address not supported yet */
20869 + /* normal 7bit address */
20870 + addr = (msg->addr << 1);
20871 + if (flags & I2C_M_RD)
20873 + if (flags & I2C_M_REV_DIR_ADDR)
20883 + * static void mcf_i2c_init()
20885 + * Perform ColdFire i2c initialization
20888 +mcf_i2c_init(struct i2c_algo_mcf_data *adap)
20891 + /* Setup GPIO lines */
20892 + MCF_PAR_FECI2CIRQ |= MCF_PAR_SDA;
20893 + MCF_PAR_FECI2CIRQ |= MCF_PAR_SCL;
20895 + /* Ensure slaves are in idle state */
20896 + if (MCF_I2SR & MCF_I2SR_IBB) {
20897 + MCF_I2ICR = 0x00;
20900 + dummy = MCF_I2DR;
20903 + MCF_I2ICR = 0x01;
20906 + /* setup SCL clock */
20907 + MCF_I2FDR = get_clock(adap);
20909 + /* set slave address */
20910 + MCF_I2AR = get_own(adap);
20912 + /* enable I2C module */
20913 + MCF_I2CR = MCF_I2CR_IEN;
20916 +static int i2c_outb(
20917 + struct i2c_adapter *i2c_adap,
20921 + struct i2c_algo_mcf_data *adap = i2c_adap->algo_data;
20923 + /* Put data to be sent */
20925 + /* Wait for xfer completed*/
20926 + timeout = wait_xfer_done(adap);
20929 + wait_for_bb(adap);
20930 + printk(KERN_ERR "i2c-algo-mcf: %s i2c_write: "
20931 + "error - timeout.\n", i2c_adap->name);
20932 + return -EREMOTEIO; /* got a better one ?? */
20940 + * static void mcf_sendbytes()
20942 + * Perform tx data transfer
20946 + struct i2c_adapter *i2c_adap,
20948 + int count, int last
20950 + struct i2c_algo_mcf_data *adap = i2c_adap->algo_data;
20953 + /* Set master TX mode */
20954 + MCF_I2CR |= MCF_I2CR_MTX;
20956 + for (i = 0; i < count; ++i) {
20957 + printk(KERN_DEBUG "i2c-algo-mcf: %s i2c_write: writing %2.2X\n",
20958 + i2c_adap->name, buf[i]&0xff);
20959 + ret = i2c_outb(i2c_adap, buf[i]);
20965 + wait_for_bb(adap);
20967 + /* i2c_repstart(adap);*/
20975 + * static void mcf_readbytes()
20977 + * Perform rx data transfer
20981 + struct i2c_adapter *i2c_adap,
20983 + int count, int last
20986 + struct i2c_algo_mcf_data *adap = i2c_adap->algo_data;
20989 + /* Set master RX mode */
20990 + MCF_I2CR &= ~MCF_I2CR_MTX;
20991 + MCF_I2CR &= ~MCF_I2CR_TXAK;
20992 + dummy = MCF_I2DR;
20994 + for (i = 0; i < count-1; i++) {
20995 + if (wait_xfer_done(adap)) {
20997 + wait_for_bb(adap);
20998 + printk(KERN_DEBUG
20999 + "i2c-algo-mcf: mcf_readbytes timed out.\n");
21003 + /* store next data byte */
21004 + buf[i] = MCF_I2DR;
21007 + if (wait_xfer_done(adap)) {
21009 + wait_for_bb(adap);
21010 + printk(KERN_DEBUG "i2c-algo-mcf: mcf_readbytes timed out.\n");
21014 + /* Disable acknowlege (set I2CR.TXAK) */
21015 + MCF_I2CR |= MCF_I2CR_TXAK;
21016 + buf[i] = MCF_I2DR;
21017 + if (wait_xfer_done(adap)) {
21019 + wait_for_bb(adap);
21020 + printk(KERN_DEBUG "i2c-algo-mcf: mcf_readbytes timed out.\n");
21026 + wait_for_bb(adap);
21028 + /* i2c_repstart(adap);*/
21036 + * static void mcf_xfer()
21038 + * Perform master data I/O transfer
21042 + struct i2c_adapter *i2c_adap,
21043 + struct i2c_msg *msgs,
21046 + struct i2c_algo_mcf_data *adap = i2c_adap->algo_data;
21047 + struct i2c_msg *pmsg;
21049 + int ret = 0, timeout;
21051 + /* Skip own address */
21052 + if (get_own(adap) == (msgs[0].addr << 1))
21055 + /* Ensure slaves are in idle state */
21056 + if (MCF_I2SR & MCF_I2SR_IBB) {
21057 + MCF_I2ICR = 0x00;
21060 + timeout = MCF_I2DR;
21063 + MCF_I2ICR = 0x01;
21065 + /* setup SCL clock */
21066 + MCF_I2FDR = get_clock(adap);
21067 + /* set slave address */
21068 + MCF_I2AR = get_own(adap);
21069 + /* enable I2C module */
21070 + MCF_I2CR = MCF_I2CR_IEN;
21072 + MCF_I2CR |= MCF_I2CR_TXAK;
21074 + /* Check for bus busy */
21075 + wait_for_bb(adap);
21077 + for (i = 0; ret >= 0 && i < num; i++) {
21078 + if (MCF_I2SR & MCF_I2SR_IBB) {
21079 + MCF_I2ICR = 0x00;
21082 + timeout = MCF_I2DR;
21085 + MCF_I2ICR = 0x01;
21087 + /* setup SCL clock */
21088 + MCF_I2FDR = get_clock(adap);
21089 + /* set slave address */
21090 + MCF_I2AR = get_own(adap);
21091 + /* enable I2C module */
21092 + MCF_I2CR = MCF_I2CR_IEN;
21094 + MCF_I2CR |= MCF_I2CR_TXAK;
21096 + /* Check for bus busy */
21097 + wait_for_bb(adap);
21101 + printk(KERN_DEBUG "i2c-algo-mcf: Doing %s %d bytes "
21102 + "to 0x%02x - %d of %d messages\n",
21103 + pmsg->flags & I2C_M_RD ? "read" : "write",
21104 + pmsg->len, pmsg->addr, i + 1, num);
21110 + /* Wait for Bus Busy */
21111 + wait_for_not_bb(adap);
21113 + MCF_I2CR |= MCF_I2CR_MTX;
21115 + ret = i2c_set_addr(adap, pmsg, i2c_adap->retries);
21119 + /* Wait for address transfer completion */
21120 + wait_xfer_done(adap);
21122 + /* Check for ACK */
21123 + if (!i2c_getack(adap)) {
21125 + wait_for_bb(adap);
21126 + printk(KERN_DEBUG "i2c-algo-mcf: No ack after "
21127 + "send address in mcf_xfer\n");
21128 + return (-EREMOTEIO);
21131 + printk(KERN_DEBUG "i2c-algo-mcf: Msg %d, "
21132 + "addr = 0x%x, flags = 0x%x, len = %d\n",
21133 + i, msgs[i].addr, msgs[i].flags, msgs[i].len);
21135 + if (pmsg->flags & I2C_M_RD) {
21136 + /* read bytes into buffer*/
21137 + ret = mcf_readbytes(i2c_adap, pmsg->buf, pmsg->len,
21140 + if (ret != pmsg->len) {
21141 + printk(KERN_DEBUG "i2c-algo-mcf: fail: "
21142 + "only read %d bytes.\n", ret);
21144 + printk(KERN_DEBUG "i2c-algo-mcf: "
21145 + "read %d bytes.\n", ret);
21148 + /* write bytes into buffer*/
21149 + ret = mcf_sendbytes(i2c_adap, pmsg->buf, pmsg->len,
21151 + if (ret != pmsg->len) {
21152 + printk(KERN_DEBUG "i2c-algo-mcf: fail: "
21153 + "only wrote %d bytes.\n", ret);
21155 + printk(KERN_DEBUG "i2c-algo-mcf: wrote"
21156 + "%d bytes.\n", ret);
21162 + /* Disable I2C module */
21169 + * static void mcf_func()
21171 + * Return algorithm funtionality
21175 + struct i2c_adapter *i2c_adap
21177 + return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
21181 + * ColdFire bus algorithm callbacks
21183 +static struct i2c_algorithm mcf_algo = {
21184 + .master_xfer = mcf_xfer,
21185 + .functionality = mcf_func,
21188 +/***********************************************************/
21189 +struct coldfire_i2c {
21190 + void __iomem *base;
21191 + struct resource *irqarea;
21192 + struct resource *ioarea;
21194 + struct i2c_adapter *adap;
21199 + * registering functions to load algorithms at runtime
21201 +int i2c_mcf_add_bus(struct i2c_adapter *adap)
21203 + struct i2c_algo_mcf_data *mcf_adap = adap->algo_data;
21205 + /*adap->id |= mcf_algo.id;*/
21206 + adap->algo = &mcf_algo;
21207 + adap->timeout = 100;
21209 + mcf_i2c_init(mcf_adap);
21212 + MOD_INC_USE_COUNT;
21215 + i2c_add_adapter(adap);
21220 +static int mcf548x_i2c_probe(struct platform_device *pdev)
21222 + struct coldfire_i2c *i2c;
21225 + /************************************************************/
21226 + i2c = kzalloc(sizeof(*i2c), GFP_KERNEL);
21228 + printk(KERN_ERR "%s kzalloc coldfire_i2c faile\n",
21232 + /****************************************************************/
21233 + platform_set_drvdata(pdev, i2c);
21235 + i2c->adap = &i2c_mcf_board_adapter;
21236 + i2c->adap->dev.parent = &pdev->dev;
21237 + rc = i2c_mcf_add_bus(i2c->adap);
21239 + printk(KERN_ERR "%s - failed to add adapter\n", __FUNCTION__);
21244 + printk(KERN_INFO "i2c-algo-mcf.o: I2C ColdFire algorithm"
21245 + " module is loaded.\n");
21253 +static int mcf548x_i2c_remove(struct platform_device *pdev)
21255 + struct coldfire_i2c *i2c = platform_get_drvdata(pdev);
21257 + i2c_del_adapter(i2c->adap);
21258 + platform_set_drvdata(pdev, NULL);
21259 + iounmap(i2c->base);
21264 +/* Structure for a device driver */
21265 +static struct platform_driver mcf548x_i2c_driver = {
21266 + .probe = mcf548x_i2c_probe,
21267 + .remove = mcf548x_i2c_remove,
21269 + .owner = THIS_MODULE,
21270 + .name = "MCF548X-i2c",
21274 +static int __init coldfire_i2c_init(void)
21276 + return platform_driver_register(&mcf548x_i2c_driver);
21279 +static void __exit coldfire_i2c_exit(void)
21281 + platform_driver_unregister(&mcf548x_i2c_driver);
21284 +module_init(coldfire_i2c_init);
21285 +module_exit(coldfire_i2c_exit);
21287 +MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>");
21288 +MODULE_DESCRIPTION
21289 + ("I2C-Bus adapter for MCF547x and MCF548x processors");
21290 +MODULE_LICENSE("GPL");
21292 +++ b/drivers/i2c/busses/i2c-mcf.c
21295 + i2c-mcf.c - Part of lm_sensors, Linux kernel modules for hardware monitoring
21297 + Copyright (c) 2005, Derek CL Cheung <derek.cheung@sympatico.ca>
21298 + <http://www3.sympatico.ca/derek.cheung>
21300 + Copyright (c) 2006-2007, emlix
21301 + Sebastian Hess <sh@emlix.com>
21303 + Copyright (c) 2006-2007 Freescale Semiconductor, Inc
21304 + Yaroslav Vinogradov <yaroslav.vinogradov@freescale.com>
21305 + Matt Waddel <Matt.Waddel@freescale.com>
21307 + This program is free software; you can redistribute it and/or modify
21308 + it under the terms of the GNU General Public License as published by
21309 + the Free Software Foundation; either version 2 of the License, or
21310 + (at your option) any later version.
21312 + This program is distributed in the hope that it will be useful,
21313 + but WITHOUT ANY WARRANTY; without even the implied warranty of
21314 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21315 + GNU General Public License for more details.
21317 + You should have received a copy of the GNU General Public License
21318 + along with this program; if not, write to the Free Software
21319 + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21322 + v0.1 26 March 2005
21323 + Initial Release - developed on uClinux with 2.6.9 kernel
21326 + Modified to be more generic and added support for
21329 + This I2C adaptor supports the ColdFire CPU I2C module. Since most Coldfire
21330 + CPUs' I2C module use the same register set (e.g., MCF5249), the code is very
21331 + portable and re-usable to other Coldfire CPUs.
21333 + The transmission frequency is set at about 100KHz for the CPU board with
21334 + 8MHz crystal. If the CPU board uses different system clock frequency, you
21335 + should change the following line:
21336 + static int __init i2c_coldfire_init(void)
21339 + // Set transmission frequency 0x15 = ~100kHz
21340 + *MCF_I2C_I2FDR = 0x15;
21344 + Remember to perform a dummy read to set the ColdFire CPU's I2C module for
21345 + read before reading the actual byte from a device
21347 + The I2C_SM_BUS_BLOCK_DATA function are not yet ready but most lm_senors
21351 +#include <linux/init.h>
21352 +#include <linux/module.h>
21353 +#include <linux/kernel.h>
21354 +#include <linux/errno.h>
21355 +#include <linux/i2c.h>
21356 +#include <linux/delay.h>
21357 +#include <linux/string.h>
21358 +#include <asm/coldfire.h>
21359 +#include <asm/mcfsim.h>
21360 +#include <asm/types.h>
21361 +#include <linux/platform_device.h>
21362 +#include "i2c-mcf.h"
21365 +static struct i2c_algorithm coldfire_algorithm = {
21366 + /*.name = "ColdFire I2C algorithm",
21367 + .id = I2C_ALGO_SMBUS,*/
21368 + .smbus_xfer = coldfire_i2c_access,
21369 + .master_xfer = coldfire_i2c_master,
21370 + .functionality = coldfire_func,
21374 +static struct i2c_adapter coldfire_adapter = {
21375 + .owner = THIS_MODULE,
21376 + .class = I2C_CLASS_HWMON,
21377 + .algo = &coldfire_algorithm,
21378 + .name = "ColdFire I2C adapter",
21385 +static inline int coldfire_do_first_start(__u16 addr,__u16 flags)
21389 + * Generate a stop and put the I2C module into slave mode
21391 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_MSTA;
21394 + * Generate a new Start signal
21396 + err = coldfire_i2c_start(flags & I2C_M_RD ? I2C_SMBUS_READ : I2C_SMBUS_WRITE,
21397 + addr, FIRST_START);
21398 + if(err) return err;
21401 + lastop = flags & I2C_M_RD; /* Ensure everything for new start */
21407 + * read one byte data from the I2C bus
21409 +static int coldfire_read_data(u8 * const rxData, const enum I2C_ACK_TYPE ackType) {
21413 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_MTX; /* master receive mode*/
21415 + if (ackType == NACK)
21416 + *MCF_I2C_I2CR |= MCF_I2C_I2CR_TXAK; /* generate NA */
21418 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_TXAK; /* generate ACK */
21421 + /* read data from the I2C bus */
21422 + *rxData = *MCF_I2C_I2DR;
21424 + /* printk(">>> %s I2DR data is %.2x \n", __FUNCTION__, *rxData); */
21426 + /* wait for data transfer to complete */
21428 + while (timeout-- && !(*MCF_I2C_I2SR & MCF_I2C_I2SR_IIF))
21430 + if (timeout <= 0)
21431 + printk("%s - I2C IIF never set. Timeout is %d \n", __FUNCTION__,
21435 + /* reset the interrupt bit */
21436 + *MCF_I2C_I2SR &= ~MCF_I2C_I2SR_IIF;
21438 + if (timeout <= 0 )
21447 + * write one byte data onto the I2C bus
21449 +static int coldfire_write_data(const u8 txData) {
21455 + *MCF_I2C_I2CR |= MCF_I2C_I2CR_MTX; /* I2C module into TX mode */
21456 + *MCF_I2C_I2DR = txData; /* send the data */
21458 + /* wait for data transfer to complete */
21459 + /* rely on the interrupt handling bit */
21461 + while (timeout-- && !(*MCF_I2C_I2SR & MCF_I2C_I2SR_IIF))
21464 + printk("%s - I2C IIF never set. Timeout is %d \n", __FUNCTION__,
21468 + /* reset the interrupt bit */
21469 + *MCF_I2C_I2SR &= ~MCF_I2C_I2SR_IIF;
21471 + if (timeout <= 0 )
21482 + * Generate I2C start or repeat start signal
21483 + * Combine the 7 bit target_address and the R/W bit and put it onto the I2C bus
21485 +static int coldfire_i2c_start(const char read_write, const u16 target_address, const enum I2C_START_TYPE start_type) {
21489 + /* printk(">>> %s START TYPE %s \n", __FUNCTION__,
21490 + start_type == FIRST_START ? "FIRST_START":"REPEAT_START");*/
21492 + *MCF_I2C_I2CR |= MCF_I2C_I2CR_IEN;
21494 + if (start_type == FIRST_START) {
21495 + /* Make sure the I2C bus is idle */
21496 + timeout = 500; /* 500us timeout */
21497 + while (timeout-- && (*MCF_I2C_I2SR & MCF_I2C_I2SR_IBB))
21499 + if (timeout <= 0) {
21500 + printk("%s - I2C bus always busy in the past 500us timeout is %d \n", __FUNCTION__, timeout);
21503 + /* generate a START and put the I2C module into MASTER TX mode*/
21504 + *MCF_I2C_I2CR |= (MCF_I2C_I2CR_MSTA | MCF_I2C_I2CR_MTX);
21506 + /* wait for bus busy to be set */
21508 + while (timeout-- && !(*MCF_I2C_I2SR & MCF_I2C_I2SR_IBB))
21510 + if (timeout <= 0) {
21511 + printk("%s - I2C bus is never busy after START. Timeout is %d \n", __FUNCTION__, timeout);
21516 + /* this is repeat START */
21517 + udelay(500); /* need some delay before repeat start */
21518 + *MCF_I2C_I2CR |= (MCF_I2C_I2CR_MSTA | MCF_I2C_I2CR_RSTA);
21522 + /* combine the R/W bit and the 7 bit target address and put it onto
21524 + *MCF_I2C_I2DR = ((target_address & 0x7F) << 1) | (read_write == I2C_SMBUS_WRITE ? 0x00 : 0x01);
21526 + /* wait for bus transfer to complete */
21527 + /* when one byte transfer is completed, IIF set at the faling edge of
21530 + while (timeout-- && !(*MCF_I2C_I2SR & MCF_I2C_I2SR_IIF))
21532 + if (timeout <= 0)
21533 + printk("%s - I2C IIF never set. Timeout is %d \n", __FUNCTION__, timeout);
21537 + /* reset the interrupt bit */
21538 + *MCF_I2C_I2SR &= ~MCF_I2C_I2SR_IIF;
21540 + if (timeout <= 0)
21548 + * 5282 SMBUS supporting functions
21551 +static s32 coldfire_i2c_access(struct i2c_adapter *adap, u16 addr,
21552 + unsigned short flags, char read_write,
21553 + u8 command, int size, union i2c_smbus_data *data)
21556 + u8 rxData, tempRxData[2];
21559 + case I2C_SMBUS_QUICK:
21560 + rc = coldfire_i2c_start(read_write, addr, FIRST_START); /* generate START */
21562 + case I2C_SMBUS_BYTE:
21563 + rc = coldfire_i2c_start(read_write, addr, FIRST_START);
21564 + *MCF_I2C_I2CR |= MCF_I2C_I2CR_TXAK; /*generate NA */
21565 + if (read_write == I2C_SMBUS_WRITE)
21566 + rc += coldfire_write_data(command);
21568 + coldfire_read_data(&rxData, NACK);/*dummy read*/
21569 + rc += coldfire_read_data(&rxData, NACK);
21570 + data->byte = rxData;
21572 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_TXAK; /* reset ACK bit */
21574 + case I2C_SMBUS_BYTE_DATA:
21575 + rc = coldfire_i2c_start(I2C_SMBUS_WRITE, addr, FIRST_START);
21576 + rc += coldfire_write_data(command);
21577 + if (read_write == I2C_SMBUS_WRITE)
21578 + rc += coldfire_write_data(data->byte);
21580 + /* This is SMBus READ Byte Data Request.
21581 + Perform REPEAT START */
21582 + rc += coldfire_i2c_start(I2C_SMBUS_READ, addr,
21584 + coldfire_read_data(&rxData, ACK);/* dummy read*/
21585 + /* Disable Acknowledge, generate STOP after
21586 + next byte transfer */
21587 + rc += coldfire_read_data(&rxData, NACK);
21588 + data->byte = rxData;
21590 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_TXAK;/* reset to normal ACk */
21592 + case I2C_SMBUS_PROC_CALL:
21593 + case I2C_SMBUS_WORD_DATA:
21594 + dev_info(&adap->dev, "size = I2C_SMBUS_WORD_DATA \n");
21595 + rc = coldfire_i2c_start(I2C_SMBUS_WRITE, addr,
21597 + rc += coldfire_write_data(command);
21598 + if (read_write == I2C_SMBUS_WRITE) {
21599 + rc += coldfire_write_data(data->word & 0x00FF);
21600 + rc += coldfire_write_data((data->word & 0x00FF) >> 8);
21602 + /* This is SMBUS READ WORD request.
21603 + Peform REPEAT START */
21604 + rc += coldfire_i2c_start(I2C_SMBUS_READ, addr,
21606 + coldfire_read_data(&rxData, ACK);/* dummy read*/
21607 + /* Disable Acknowledge, generate STOP after
21608 + next byte transfer */
21609 + /* read the MS byte from the device */
21610 + rc += coldfire_read_data(&rxData, NACK);
21611 + tempRxData[1] = rxData;
21612 + /* read the LS byte from the device */
21613 + rc += coldfire_read_data(&rxData, NACK);
21614 + tempRxData[0] = rxData;
21615 + /* the host driver expect little endian
21616 + convention. Swap the byte */
21617 + data->word = (tempRxData[0] << 8)|tempRxData[1];
21619 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_TXAK;
21621 + case I2C_SMBUS_BLOCK_DATA:
21622 + /* Not done yet */
21625 + printk("Unsupported I2C size \n");
21630 + /* Generate a STOP and put I2C module into slave mode */
21631 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_MSTA;
21633 + /* restore interrupt */
21634 + *MCF_I2C_I2CR |= MCF_I2C_I2CR_IIEN;
21644 + * List the SMBUS functions supported by this I2C adaptor
21645 + * Also tell the I2C Subsystem that we are able of master_xfer()
21647 +static u32 coldfire_func(struct i2c_adapter *adapter)
21649 + return(I2C_FUNC_SMBUS_QUICK |
21650 + I2C_FUNC_SMBUS_BYTE |
21651 + I2C_FUNC_SMBUS_PROC_CALL |
21652 + I2C_FUNC_SMBUS_BYTE_DATA |
21653 + I2C_FUNC_SMBUS_WORD_DATA |
21655 + I2C_FUNC_SMBUS_BLOCK_DATA);
21658 +static int coldfire_i2c_master(struct i2c_adapter *adap,struct i2c_msg *msgs,
21662 + struct i2c_msg *p;
21669 + /* disable the IRQ, we are doing polling */
21670 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_IIEN;
21672 + dev_dbg(&adap->dev,"Num of actions: %d\n", num);
21674 + for (i = 0; !err && i < num; i++) {
21680 + dev_dbg(&adap->dev,"p->len == 0!\n");
21684 + * Generate a new Start, if the target address differs from
21685 + * the last target, generate a stop in this case first
21687 + if(p->addr != lastaddr)
21689 + err = coldfire_do_first_start(p->addr,p->flags);
21692 + dev_dbg(&adap->dev,"First Init failed!\n");
21697 + else if((p->flags & I2C_M_RD) != lastop)
21700 + * If the Operational Mode changed, we need to do this
21703 + dev_dbg(&adap->dev,"%s(): Direction changed, was: %d; is now: %d\n", __FUNCTION__, lastop, p->flags & I2C_M_RD);
21705 + /* Last op was an read, now it's write: complete stop
21707 + if (lastop & I2C_M_RD)
21709 + dev_dbg(&adap->dev,"%s(): The device is in read state, we must reset!\n", __FUNCTION__);
21710 + if((err = coldfire_do_first_start(p->addr,p->flags)))
21715 + dev_dbg(&adap->dev,"%s(): We switchted to read mode\n",__FUNCTION__);
21716 + if((err = coldfire_i2c_start((p->flags & I2C_M_RD) ? I2C_SMBUS_READ : I2C_SMBUS_WRITE,
21717 + p->addr, REPEAT_START)))
21721 + lastop = p->flags & I2C_M_RD; /* Save the last op */
21724 + if (p->flags & I2C_M_RD)
21727 + * When ever we get here, a new session was activated,
21728 + * so read a dummy byte
21730 + coldfire_read_data(&dummyRead, ACK);
21732 + * read p->len -1 bytes with ACK to the slave,
21733 + * read the last byte without the ACK, to inform him
21734 + * about the stop afterwards
21737 + while(!err && (ic < p->len-1 ))
21739 + err = coldfire_read_data(p->buf+ic, ACK );
21743 + err = coldfire_read_data(p->buf+ic, NACK);
21744 + dev_dbg(&coldfire_adapter.dev,"read: %2x\n",p->buf[ic]);
21749 + dev_dbg(&coldfire_adapter.dev,"writing: 0x %2x %2x\n", p->buf[0], p->buf[1]);
21752 + * Write data to the slave
21754 + for(ic=0; !err && ic < p->len; ic++)
21756 + err = coldfire_write_data(p->buf[ic]);
21759 + dev_dbg(&coldfire_adapter.dev, "Failed to write data\n");
21766 + * Put the device into slave mode to enable the STOP Generation
21767 + * (the RTC needs this)
21769 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_MSTA;
21771 + *MCF_I2C_I2CR &= ~MCF_I2C_I2CR_TXAK; /* reset the ACK bit */
21773 + /* restore interrupt */
21774 + *MCF_I2C_I2CR |= MCF_I2C_I2CR_IIEN;
21776 + /* Return the number of messages processed, or the error code. */
21784 + * Initalize the 5282 I2C module
21785 + * Disable the 5282 I2C interrupt capability. Just use callback
21788 +static int __init i2c_coldfire_init(void)
21793 +#if defined(CONFIG_M532x) || defined(CONFIG_M5445X)
21795 + * Initialize the GPIOs for I2C
21797 + MCF_GPIO_PAR_FECI2C |= (0
21798 + | MCF_GPIO_PAR_FECI2C_PAR_SDA(3)
21799 + | MCF_GPIO_PAR_FECI2C_PAR_SCL(3));
21800 +#elif defined(CONFIG_M5253)
21802 + volatile u32 *reg;
21803 + /* GPIO Bit 41 = SCL0, Bit 42 = SDA0 */
21804 + reg = (volatile u32 *)(MCF_MBAR2 + MCFSIM2_GPIO1FUNC);
21805 + *reg &= 0xFFFFF9FF;
21808 + /* Initialize PASP0 and PASP1 to I2C functions, 5282 user guide 26-19 */
21809 + /* Port AS Pin Assignment Register (PASPAR) */
21810 + /* PASPA1 = 11 = AS1 pin is I2C SDA */
21811 + /* PASPA0 = 11 = AS0 pin is I2C SCL */
21812 + *MCF_GPIO_PASPAR |= 0x000F; /* u16 declaration */
21816 + /* Set transmission frequency 0x15 = ~100kHz */
21817 + *MCF_I2C_I2FDR = 0x15;
21819 + /* set the 5282 I2C slave address though we never use it */
21820 + *MCF_I2C_I2ADR = 0x6A;
21822 + /* Enable I2C module and if IBB is set, do the special initialzation */
21823 + /* procedures as are documented at the 5282 User Guide page 24-11 */
21824 + *MCF_I2C_I2CR |= MCF_I2C_I2CR_IEN;
21825 + if ((*MCF_I2C_I2SR & MCF_I2C_I2SR_IBB) == 1) {
21826 + printk("%s - do special 5282 I2C init procedures \n",
21828 + *MCF_I2C_I2CR = 0x00;
21829 + *MCF_I2C_I2CR = 0xA0;
21830 + dummyRead = *MCF_I2C_I2DR;
21831 + *MCF_I2C_I2SR = 0x00;
21832 + *MCF_I2C_I2CR = 0x00;
21835 + /* default I2C mode is - slave and receive */
21836 + *MCF_I2C_I2CR &= ~(MCF_I2C_I2CR_MSTA | MCF_I2C_I2CR_MTX);
21838 + coldfire_adapter.dev.parent = &platform_bus;
21839 + retval = i2c_add_adapter(&coldfire_adapter);
21842 + printk("%s - return code is: %d \n", __FUNCTION__, retval);
21849 + * I2C module exit function
21852 +static void __exit i2c_coldfire_exit(void)
21854 + /* disable I2C and Interrupt */
21855 + *MCF_I2C_I2CR &= ~(MCF_I2C_I2CR_IEN | MCF_I2C_I2CR_IIEN);
21856 + i2c_del_adapter(&coldfire_adapter);
21861 +MODULE_AUTHOR("Derek CL Cheung <derek.cheung@sympatico.ca>");
21862 +MODULE_DESCRIPTION("MCF5282 I2C adaptor");
21863 +MODULE_LICENSE("GPL");
21865 +module_init(i2c_coldfire_init);
21866 +module_exit(i2c_coldfire_exit);
21868 +++ b/drivers/i2c/busses/i2c-mcf.h
21871 + i2c-mcf.h - header file for i2c-mcf.c
21873 + Copyright (c) 2005, Derek CL Cheung <derek.cheung@sympatico.ca>
21874 + <http://www3.sympatico.ca/derek.cheung>
21876 + Copyright (c) 2006-2007, emlix
21877 + Sebastian Hess <sh@emlix.com>
21879 + Copyright (c) 2006-2007 Freescale Semiconductor, Inc
21880 + Yaroslav Vinogradov <yaroslav.vinogradov@freescale.com>
21881 + Matt Waddel <Matt.Waddel@freescale.com>
21883 + This program is free software; you can redistribute it and/or modify
21884 + it under the terms of the GNU General Public License as published by
21885 + the Free Software Foundation; either version 2 of the License, or
21886 + (at your option) any later version.
21888 + This program is distributed in the hope that it will be useful,
21889 + but WITHOUT ANY WARRANTY; without even the implied warranty of
21890 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21891 + GNU General Public License for more details.
21893 + You should have received a copy of the GNU General Public License
21894 + along with this program; if not, write to the Free Software
21895 + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21898 + v0.1 26 March 2005
21899 + Initial Release - developed on uClinux with 2.6.9 kernel
21901 + Modified to be more generic and added support for
21906 +#ifndef __I2C_MCF_H__
21907 +#define __I2C_MCF_H__
21909 +enum I2C_START_TYPE { FIRST_START, REPEAT_START };
21910 +enum I2C_ACK_TYPE { ACK, NACK};
21912 +/* Function prototypes */
21913 +static u32 coldfire_func(struct i2c_adapter *adapter);
21914 +static s32 coldfire_i2c_access(struct i2c_adapter *adap, u16 address,
21915 + unsigned short flags, char read_write,
21916 + u8 command, int size, union i2c_smbus_data *data);
21917 +static int coldfire_write_data(const u8 data);
21918 +static int coldfire_i2c_start(const char read_write, const u16 target_address, const enum I2C_START_TYPE i2c_start);
21919 +static int coldfire_read_data(u8 * const rxData, const enum I2C_ACK_TYPE ackType);
21920 +static int coldfire_i2c_master(struct i2c_adapter *adap,struct i2c_msg *msgs, int num);
21921 +void dumpReg(char *, u16 addr, u8 data);
21923 +#define MCF_I2C_I2ADR_ADDR(x) (((x)&0x7F)<<0x01)
21924 +#define MCF_I2C_I2FDR_IC(x) (((x)&0x3F))
21926 +/* I2C Control Register */
21927 +#define MCF_I2C_I2CR_IEN (0x80) /* I2C enable */
21928 +#define MCF_I2C_I2CR_IIEN (0x40) /* interrupt enable */
21929 +#define MCF_I2C_I2CR_MSTA (0x20) /* master/slave mode */
21930 +#define MCF_I2C_I2CR_MTX (0x10) /* transmit/receive mode */
21931 +#define MCF_I2C_I2CR_TXAK (0x08) /* transmit acknowledge enable */
21932 +#define MCF_I2C_I2CR_RSTA (0x04) /* repeat start */
21934 +/* I2C Status Register */
21935 +#define MCF_I2C_I2SR_ICF (0x80) /* data transfer bit */
21936 +#define MCF_I2C_I2SR_IAAS (0x40) /* I2C addressed as a slave */
21937 +#define MCF_I2C_I2SR_IBB (0x20) /* I2C bus busy */
21938 +#define MCF_I2C_I2SR_IAL (0x10) /* aribitration lost */
21939 +#define MCF_I2C_I2SR_SRW (0x04) /* slave read/write */
21940 +#define MCF_I2C_I2SR_IIF (0x02) /* I2C interrupt */
21941 +#define MCF_I2C_I2SR_RXAK (0x01) /* received acknowledge */
21943 +/********************************************************************/
21944 +#endif /* __I2C_MCF_H__ */
21945 --- a/drivers/i2c/busses/Kconfig
21946 +++ b/drivers/i2c/busses/Kconfig
21949 menu "I2C Hardware Bus support"
21951 +config I2C_MCF548x
21952 + tristate "I2C MCF547x/548x interfaces"
21955 + This allows you to use the I2C adapters found on the Freescale
21956 + MCF547x/548x microcontrollers.
21957 + Say Y if you own an I2C adapter belonging to this class and then say
21958 + Y to the specific driver for you adapter below.
21960 + This support is also available as a module. If so, the module
21961 + will be called i2c-algo-mcf.
21964 tristate "ALI 1535"
21966 @@ -290,6 +302,16 @@ config I2C_POWERMAC
21967 This support is also available as a module. If so, the module
21968 will be called i2c-powermac.
21971 + tristate "MCF ColdFire"
21972 + depends on I2C && EXPERIMENTAL
21974 + If you say yes to this option, support will be included for the
21975 + I2C on most ColdFire CPUs
21977 + This driver can also be built as a module. If so, the module
21978 + will be called i2c-mcf.
21981 tristate "MPC107/824x/85xx/52xx/86xx"
21983 --- a/drivers/i2c/busses/Makefile
21984 +++ b/drivers/i2c/busses/Makefile
21985 @@ -52,6 +52,8 @@ obj-$(CONFIG_I2C_VIAPRO) += i2c-viapro.o
21986 obj-$(CONFIG_I2C_VOODOO3) += i2c-voodoo3.o
21987 obj-$(CONFIG_SCx200_ACB) += scx200_acb.o
21988 obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o
21989 +obj-$(CONFIG_I2C_MCF548x) += i2c-mcf548x.o
21990 +obj-$(CONFIG_I2C_MCF) += i2c-mcf.o
21992 ifeq ($(CONFIG_I2C_DEBUG_BUS),y)
21993 EXTRA_CFLAGS += -DDEBUG
21994 --- a/drivers/macintosh/Kconfig
21995 +++ b/drivers/macintosh/Kconfig
21996 @@ -118,7 +118,6 @@ config PMAC_SMU
21998 config PMAC_APM_EMU
21999 tristate "APM emulation"
22000 - select APM_EMULATION
22001 depends on ADB_PMU && PM && PPC32
22003 config PMAC_MEDIABAY
22004 --- a/drivers/Makefile
22005 +++ b/drivers/Makefile
22006 @@ -93,3 +93,5 @@ obj-$(CONFIG_PPC_PS3) += ps3/
22007 obj-$(CONFIG_OF) += of/
22008 obj-$(CONFIG_SSB) += ssb/
22009 obj-$(CONFIG_VIRTIO) += virtio/
22011 +obj-$(CONFIG_MCD_DMA) += dma/
22013 +++ b/drivers/net/can/flexcan/flexcan.c
22019 + * CAN bus driver for the alone generic (as possible as) FLEXCAN controller.
22022 + * Andrey Volkov <avolkov@varma-el.com>
22025 + * 2005-2006, Varma Electronics Oy
22028 + * This program is free software; you can redistribute it and/or modify
22029 + * it under the terms of the GNU General Public License as published by
22030 + * the Free Software Foundation; either version 2 of the License, or
22031 + * (at your option) any later version.
22033 + * This program is distributed in the hope that it will be useful,
22034 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
22035 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22036 + * GNU General Public License for more details.
22038 + * You should have received a copy of the GNU General Public License
22039 + * along with this program; if not, write to the Free Software
22040 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22043 + * 2008-06-23 Support for MCF548x's FlexCAN
22044 + * Huan, Wang <b18965@freescale.com>
22049 +#include <linux/kernel.h>
22050 +#include <linux/module.h>
22051 +#include <linux/interrupt.h>
22052 +#include <linux/delay.h>
22053 +#include <linux/netdevice.h>
22054 +#include <linux/if_arp.h>
22055 +#include <linux/if_ether.h>
22056 +#include <linux/can.h>
22057 +#include <linux/list.h>
22058 +#include <linux/io.h>
22060 +#include <linux/can/dev.h>
22061 +#include <linux/can/error.h>
22062 +#include "flexcan.h"
22063 +#include <asm/coldfire.h>
22064 +#include <asm/m5485sim.h>
22065 +#include <linux/can/version.h> /* for RCSID. Removed by mkpatch script */
22068 +struct flexcan_priv {
22069 + struct can_priv can;
22070 + volatile unsigned long flags;
22071 + u8 shadow_statflg;
22072 + u8 shadow_canrier;
22076 + struct list_head tx_head;
22077 + struct napi_struct napi;
22078 + struct net_device *dev;
22082 +static int flexcan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
22084 + struct can_frame *frame = (struct can_frame *)skb->data;
22085 + struct flexcan_regs *regs = (struct flexcan_regs *)dev->base_addr;
22088 + u32 can_id, can_ext, tmp, tmp1;
22090 + /* Transmission inactive */
22091 + regs->cantxfg[txbuf].can_dlc = MB_CNT_CODE(0x08);
22093 + can_ext = frame->can_id;
22094 + if (can_ext & CAN_EFF_FLAG) {
22095 + /* Frame format is extended */
22096 + regs->cantxfg[txbuf].can_dlc |= (1 << 21);
22097 + regs->cantxfg[txbuf].can_dlc |= (1 << 22);
22098 + can_id = frame->can_id & MB_ID_EXT;
22099 + if (frame->can_id & CAN_RTR_FLAG)
22100 + regs->cantxfg[txbuf].can_dlc |= (1 << 20);
22102 + tmp = (can_id & CAN_SFF_MASK) << 18;
22103 + tmp1 = can_id >> 11;
22104 + can_id = tmp | tmp1;
22105 + regs->cantxfg[txbuf].can_id = can_id;
22107 + /* Frame format is standard */
22108 + can_id = frame->can_id & MB_ID_EXT;
22109 + if (frame->can_id & CAN_RTR_FLAG)
22110 + regs->cantxfg[txbuf].can_dlc |= (1 << 20);
22112 + regs->cantxfg[txbuf].can_id = can_id << 18;
22116 + for (i = 0; i < len; i++)
22117 + regs->cantxfg[txbuf].data[i] = frame->data[i];
22119 + regs->cantxfg[txbuf].can_dlc |= len << 16;
22120 + /* Transmission active */
22121 + regs->cantxfg[txbuf].can_dlc |= MB_CNT_CODE(0x0c);
22123 + return NETDEV_TX_OK;
22126 +static void flexcan_tx_timeout(struct net_device *dev)
22128 + struct sk_buff *skb;
22129 + struct flexcan_regs *regs = (struct flexcan_regs *)dev->base_addr;
22130 + struct can_frame *frame;
22133 + /* Diable the interrupts */
22134 + regs->imask = IMASK_BUFF_DISABLE_ALL;
22136 + skb = dev_alloc_skb(sizeof(struct can_frame));
22138 + if (printk_ratelimit())
22139 + dev_notice(ND2D(dev), "TIMEOUT packet dropped.\n");
22142 + frame = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
22144 + frame->can_dlc = length;
22147 + skb->protocol = __constant_htons(ETH_P_CAN);
22148 + skb->pkt_type = PACKET_BROADCAST;
22149 + skb->ip_summed = CHECKSUM_UNNECESSARY;
22154 +static irqreturn_t flexcan_isr(int irq, void *dev_id)
22156 + struct net_device *dev = (struct net_device *)dev_id;
22157 + struct flexcan_regs *regs = (struct flexcan_regs *)dev->base_addr;
22158 + struct net_device_stats *stats = dev->get_stats(dev);
22159 + struct sk_buff *skb;
22160 + struct can_frame *frame;
22161 + u32 iflags, oflags;
22165 + iflags = regs->iflag;
22167 + for (i = 0; i < 16; i++) {
22168 + if (iflags & (0x01 << i)) {
22169 + struct flexcan_mb *mb = ®s->cantxfg[i];
22170 + int ctrl = mb->can_dlc;
22171 + int code = (ctrl >> 24) & 0x0f;
22172 + int length = (ctrl >> 16) & 0x0f;
22175 + if (code < 8 && (length > 0)) {
22176 + /* receive frame */
22177 + skb = dev_alloc_skb(sizeof(struct can_frame));
22179 + dev_notice(ND2D(dev),
22180 + "Packets dropped.\n");
22182 + frame = (struct can_frame *)skb_put(skb,
22183 + sizeof(struct can_frame));
22185 + frame->can_id &= 0x0;
22186 + frame->can_dlc = length;
22187 + tmp1 = mb->can_id & MB_ID_EXT;
22188 + if (ctrl & MB_CNT_IDE) {
22190 + tmp = (tmp >> 18) & CAN_SFF_MASK;
22191 + frame->can_id = (tmp1 << 11) | tmp;
22192 + frame->can_id &= CAN_EFF_MASK;
22193 + frame->can_id |= CAN_EFF_FLAG;
22194 + if (ctrl & MB_CNT_RTR)
22195 + frame->can_id |= CAN_RTR_FLAG;
22197 + frame->can_id = tmp1 >> 18;
22198 + if (ctrl & MB_CNT_RTR)
22199 + frame->can_id |= CAN_RTR_FLAG;
22202 + for (k = 0; k < 8; k++)
22203 + frame->data[k] = mb->data[k];
22205 + mb->can_dlc &= MB_CODE_MASK;
22206 + mb->can_dlc |= MB_CNT_CODE(0x04);
22208 + stats->rx_packets++;
22209 + stats->rx_bytes += frame->can_dlc;
22211 + skb->protocol = __constant_htons(ETH_P_CAN);
22212 + skb->ip_summed = CHECKSUM_UNNECESSARY;
22214 + retval = netif_rx(skb);
22215 + if (retval == NET_RX_DROP)
22216 + dev_notice(ND2D(dev),
22217 + "Packets dropped.\n");
22219 + /* transmit frame */
22220 + mb->can_dlc = MB_CNT_CODE(0x04);
22224 + regs->iflag = oflags;
22226 + return IRQ_HANDLED;
22229 +static int flexcan_do_set_bit_time(struct net_device *dev,
22230 + struct can_bittime *bt)
22232 + struct flexcan_priv *priv = netdev_priv(dev);
22233 + struct flexcan_regs *regs = (struct flexcan_regs *)dev->base_addr;
22237 + if (bt->type != CAN_BITTIME_STD)
22240 + spin_lock_irq(&priv->can.irq_lock);
22242 + reg = CANCTRL_PRESDIV(bt->std.brp) | CANCTRL_PSEG1(bt->std.phase_seg1
22243 + - 1) | CANCTRL_PSEG2(bt->std.phase_seg2 - 1);
22244 + regs->canctrl &= CANCTRL_BITTIME;
22245 + regs->canctrl |= (reg | CANCTRL_SAMP(bt->std.sam) |
22246 + CANCTRL_PROPSEG(bt->std.prop_seg - 1));
22248 + spin_unlock_irq(&priv->can.irq_lock);
22253 +static int flexcan_open(struct net_device *dev)
22256 + struct flexcan_regs *regs = (struct flexcan_regs *)dev->base_addr;
22258 +#if defined(CONFIG_M547X_8X)
22259 + MCF_PAR_TIMER = MCF_PAR_TIMER | 0x28;
22260 + MCF_PAR_TIMER = MCF_PAR_TIMER & 0xf8;
22261 + MCF_PAR_DSPI = MCF_PAR_DSPI | 0x0a00;
22262 + MCF_PAR_FECI2CIRQ = MCF_PAR_FECI2CIRQ | 0x0283;
22263 + MCF_PAR_PSCn(2) = MCF_PAR_PSCn(2) & 0x0f;
22264 + MCF_PAR_PSCn(2) = MCF_PAR_PSCn(2) | 0x50;
22267 + regs->canmcr |= CANMCR_SOFTRST;
22268 + regs->canmcr |= CANMCR_MDIS;
22271 + if ((regs->canmcr & CANMCR_SOFTRST) != 0x0) {
22272 + dev_err(ND2D(dev), "Failed to softreset can module.\n");
22276 + /* Enable error and bus off interrupt */
22277 + regs->canctrl |= (CANCTRL_RJW(3) | CANCTRL_ERRMSK |
22278 + CANCTRL_BOFFMSK);
22280 + /* Set lowest buffer transmitted first */
22281 + regs->canctrl |= CANCTRL_LBUF;
22283 + for (i = 0; i < 16; i++) {
22284 + regs->cantxfg[i].can_dlc = 0;
22285 + regs->cantxfg[i].can_id = 0;
22286 + for (j = 0; j < 8; j++)
22287 + regs->cantxfg[i].data[j] = 0;
22289 + /* Put MB into rx queue */
22290 + regs->cantxfg[i].can_dlc = MB_CNT_CODE(0x04);
22293 + /* acceptance mask/acceptance code (accept everything) */
22294 + regs->rxgmask = 0x00000000;
22295 + regs->rx14mask = 0x00000000;
22296 + regs->rx15mask = 0x00000000;
22297 + /* extended frame */
22298 + regs->cantxfg[14].can_dlc |= 0x600000;
22299 + /* Enable flexcan module */
22300 + regs->canmcr &= ~CANMCR_MDIS;
22301 + /* Synchronize with the can bus */
22302 + regs->canmcr &= ~CANMCR_HALT;
22304 +#if defined(CONFIG_M547X_8X)
22305 + for (i = 0; i < 2; i++) {
22306 + MCF_ICR(ISC_CANn_MBOR(i)) = 0x33;
22307 + MCF_ICR(ISC_CANn_ERR(i)) = 0x33;
22308 + MCF_ICR(ISC_CANn_BUSOFF(i)) = 0x33;
22311 + ret = request_irq(dev->irq + 64, flexcan_isr, IRQF_DISABLED,
22313 + ret = request_irq(dev->irq + 1 + 64, flexcan_isr, IRQF_DISABLED,
22315 + ret = request_irq(dev->irq + 2 + 64, flexcan_isr, IRQF_DISABLED,
22318 + printk(KERN_ERR "%s - failed to attach interrupt.\n",
22324 + /* Enable all interrupts */
22325 + regs->imask = IMASK_BUFF_ENABLE_ALL;
22326 + netif_start_queue(dev);
22330 +static int flexcan_close(struct net_device *dev)
22332 + struct flexcan_regs *regs = (struct flexcan_regs *)dev->base_addr;
22334 + netif_stop_queue(dev);
22336 + /* Disable all interrupts */
22337 + regs->imask = IMASK_BUFF_DISABLE_ALL;
22338 + free_irq(dev->irq + 64, dev);
22339 + free_irq(dev->irq + 1 + 64, dev);
22340 + free_irq(dev->irq + 2 + 64, dev);
22342 + /* Disable module */
22343 + regs->canmcr |= CANMCR_MDIS;
22347 +int register_flexcandev(struct net_device *dev, int clock_src)
22349 + struct flexcan_regs *regs = (struct flexcan_regs *)dev->base_addr;
22351 + regs->canmcr &= ~CANMCR_MDIS;
22353 + regs->canmcr |= (CANMCR_FRZ | CANMCR_HALT);
22354 + return register_netdev(dev);
22356 +EXPORT_SYMBOL(register_flexcandev);
22358 +void unregister_flexcandev(struct net_device *dev)
22360 + struct flexcan_regs *regs = (struct flexcan_regs *)dev->base_addr;
22362 + regs->canmcr |= (CANMCR_FRZ | CANMCR_HALT);
22363 + regs->canmcr |= CANMCR_MDIS;
22365 + unregister_netdev(dev);
22367 +EXPORT_SYMBOL(unregister_flexcandev);
22369 +struct net_device *alloc_flexcandev(void)
22371 + struct net_device *dev;
22372 + struct flexcan_priv *priv;
22374 + dev = alloc_candev(sizeof(struct flexcan_priv));
22378 + priv = netdev_priv(dev);
22380 + dev->open = flexcan_open;
22381 + dev->stop = flexcan_close;
22382 + dev->hard_start_xmit = flexcan_hard_start_xmit;
22383 + dev->tx_timeout = flexcan_tx_timeout;
22384 + dev->flags |= IFF_NOARP;
22385 + priv->can.do_set_bit_time = flexcan_do_set_bit_time;
22388 +EXPORT_SYMBOL(alloc_flexcandev);
22390 +MODULE_AUTHOR("Andrey Volkov <avolkov@varma-el.com>");
22391 +MODULE_LICENSE("GPL v2");
22392 +MODULE_DESCRIPTION("CAN port driver for flexcan based chip");
22394 +++ b/drivers/net/can/flexcan/flexcan.h
22400 + * Definitions of consts/structs to drive the Freescale FLEXCAN.
22404 +#ifndef __FLEXCAN_H__
22405 +#define __FLEXCAN_H__
22407 +#include <linux/autoconf.h>
22408 +#include <linux/types.h>
22410 +/* FLEXCAN module configuration register (CANMCR) bits */
22411 +#define CANMCR_MDIS 0x80000000
22412 +#define CANMCR_FRZ 0x40000000
22413 +#define CANMCR_HALT 0x10000000
22414 +#define CANMCR_SOFTRST 0x02000000
22415 +#define CANMCR_FRZACK 0x01000000
22416 +#define CANMCR_SUPV 0x00800000
22417 +#define CANMCR_MAXMB(x) ((x)&0x0f)
22419 +/* FLEXCAN control register (CANCTRL) bits */
22420 +#define CANCTRL_PRESDIV(x) (((x)&0xff)<<24)
22421 +#define CANCTRL_RJW(x) (((x)&0x03)<<22)
22422 +#define CANCTRL_PSEG1(x) (((x)&0x07)<<19)
22423 +#define CANCTRL_PSEG2(x) (((x)&0x07)<<16)
22424 +#define CANCTRL_BOFFMSK 0x00008000
22425 +#define CANCTRL_ERRMSK 0x00004000
22426 +#define CANCTRL_LPB 0x00001000
22427 +#define CANCTRL_SAMP(x) (((x)&0x1)<<7)
22428 +#define CANCTRL_BOFFREC 0x00000040
22429 +#define CANCTRL_TSYNC 0x00000020
22430 +#define CANCTRL_LBUF 0x00000010
22431 +#define CANCTRL_LOM 0x00000008
22432 +#define CANCTRL_PROPSEG(x) ((x)&0x07)
22433 +#define CANCTRL_BITTIME 0x00c0d078
22435 +/* FLEXCAN error counter register (ERRCNT) bits */
22436 +#define ERRCNT_REXECTR(x) (((x)&0xff)<<8)
22437 +#define ERRCNT_TXECTR(x) ((x)&0xff)
22439 +/* FLEXCAN error and status register (ERRSTAT) bits */
22440 +#define ERRSTAT_BITERR(x) (((x)&0x03)<<14)
22441 +#define ERRSTAT_ACKERR 0x00002000
22442 +#define ERRSTAT_CRCERR 0x00001000
22443 +#define ERRSTAT_FRMERR 0x00000800
22444 +#define ERRSTAT_STFERR 0x00000400
22445 +#define ERRSTAT_TXWRN 0x00000200
22446 +#define ERRSTAT_RXWRN 0x00000100
22447 +#define ERRSTAT_IDLE 0x00000080
22448 +#define ERRSTAT_TXRX 0x00000040
22449 +#define ERRSTAT_FLTCONF(x) (((x)&0x03)<<4)
22450 +#define ERRSTAT_BOFFINT 0x00000004
22451 +#define ERRSTAT_ERRINT 0x00000002
22453 +/* FLEXCAN interrupt mask register (IMASK) bits */
22454 +#define IMASK_BUF15M 0x8000
22455 +#define IMASK_BUF14M 0x4000
22456 +#define IMASK_BUF13M 0x2000
22457 +#define IMASK_BUF12M 0x1000
22458 +#define IMASK_BUF11M 0x0800
22459 +#define IMASK_BUF10M 0x0400
22460 +#define IMASK_BUF9M 0x0200
22461 +#define IMASK_BUF8M 0x0100
22462 +#define IMASK_BUF7M 0x0080
22463 +#define IMASK_BUF6M 0x0040
22464 +#define IMASK_BUF5M 0x0020
22465 +#define IMASK_BUF4M 0x0010
22466 +#define IMASK_BUF3M 0x0008
22467 +#define IMASK_BUF2M 0x0004
22468 +#define IMASK_BUF1M 0x0002
22469 +#define IMASK_BUF0M 0x0001
22470 +#define IMASK_BUFnM(x) (0x1<<(x))
22471 +#define IMASK_BUFF_ENABLE_ALL 0xffff
22472 +#define IMASK_BUFF_DISABLE_ALL 0x0000
22474 +/* FLEXCAN interrupt flag register (IFLAG) bits */
22475 +#define IFLAG_BUF15M 0x8000
22476 +#define IFLAG_BUF14M 0x4000
22477 +#define IFLAG_BUF13M 0x2000
22478 +#define IFLAG_BUF12M 0x1000
22479 +#define IFLAG_BUF11M 0x0800
22480 +#define IFLAG_BUF10M 0x0400
22481 +#define IFLAG_BUF9M 0x0200
22482 +#define IFLAG_BUF8M 0x0100
22483 +#define IFLAG_BUF7M 0x0080
22484 +#define IFLAG_BUF6M 0x0040
22485 +#define IFLAG_BUF5M 0x0020
22486 +#define IFLAG_BUF4M 0x0010
22487 +#define IFLAG_BUF3M 0x0008
22488 +#define IFLAG_BUF2M 0x0004
22489 +#define IFLAG_BUF1M 0x0002
22490 +#define IFLAG_BUF0M 0x0001
22491 +#define IFLAG_BUFnM(x) (0x1<<(x))
22492 +#define IFLAG_BUFF_SET_ALL 0xffff
22493 +#define IFLAG_BUFF_DISABLE_ALL 0x0000
22495 +/* FLEXCAN message buffers */
22496 +#define MB_CNT_CODE(x) (((x)&0x0f)<<24)
22497 +#define MB_CNT_SRR 0x00400000
22498 +#define MB_CNT_IDE 0x00200000
22499 +#define MB_CNT_RTR 0x00100000
22500 +#define MB_CNT_LENGTH(x) (((x)&0x0f)<<16)
22501 +#define MB_CNT_TIMESTAMP(x) ((x)&0xffff)
22503 +#define MB_ID_STD ((0x7ff)<<18)
22504 +#define MB_ID_EXT 0x1fffffff
22505 +#define MB_CODE_MASK 0xf0ffffff
22507 +/* Structure of the message buffer */
22508 +struct flexcan_mb {
22514 +/* Structure of the hardware registers */
22515 +struct flexcan_regs {
22529 + u32 reserved4[19];
22530 + struct flexcan_mb cantxfg[16];
22533 +struct flexcan_platform_data {
22534 + u8 clock_src; /* FLEXCAN clock source CRIN or SYSCLK */
22535 + u32 clock_frq; /* can ref. clock, in Hz */
22538 +struct net_device *alloc_flexcandev(void);
22540 +extern int register_flexcandev(struct net_device *dev, int clock_src);
22541 +extern void unregister_flexcandev(struct net_device *dev);
22543 +#endif /* __FLEXCAN_H__ */
22545 +++ b/drivers/net/can/flexcan/Makefile
22548 +obj-$(CONFIG_CAN_MCF547X_8X) += flexcan-mcf548x.o
22550 +flexcan-mcf548x-objs := flexcan.o mcf548x_can.o
22553 +++ b/drivers/net/can/flexcan/mcf548x_can.c
22557 + * CAN bus driver for the Freescale MCF548x embedded CPU.
22560 + * Andrey Volkov <avolkov@varma-el.com>
22563 + * 2004-2005, Varma Electronics Oy
22566 + * This program is free software; you can redistribute it and/or modify
22567 + * it under the terms of the GNU General Public License as published by
22568 + * the Free Software Foundation; either version 2 of the License, or
22569 + * (at your option) any later version.
22571 + * This program is distributed in the hope that it will be useful,
22572 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
22573 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22574 + * GNU General Public License for more details.
22576 + * You should have received a copy of the GNU General Public License
22577 + * along with this program; if not, write to the Free Software
22578 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22581 + * 2008-06-23 support for MCF548x's FlexCAN
22582 + * Huan, Wang <b18965@freescale.com>
22583 + * 2005-02-03 created
22587 +#include <linux/kernel.h>
22588 +#include <linux/module.h>
22589 +#include <linux/interrupt.h>
22590 +#include <linux/platform_device.h>
22591 +#include <linux/netdevice.h>
22592 +#include <linux/can.h>
22593 +#include <linux/can/dev.h>
22594 +#include <linux/io.h>
22596 +#include "flexcan.h"
22597 +#include <asm/coldfire.h>
22598 +#include <asm/m5485sim.h>
22599 +#include <linux/can/version.h> /* for RCSID. Removed by mkpatch script */
22603 +#define PDEV_MAX 2
22605 +struct platform_device *pdev[PDEV_MAX];
22607 +static int __devinit mcf548x_can_probe(struct platform_device *pdev)
22609 + struct resource *mem;
22610 + struct net_device *dev;
22611 + struct flexcan_platform_data *pdata = pdev->dev.platform_data;
22612 + struct can_priv *can;
22614 + int ret = -ENODEV;
22619 + dev = alloc_flexcandev();
22622 + can = netdev_priv(dev);
22624 + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
22626 + dev->irq = platform_get_irq(pdev, 0);
22627 + if (!mem || !dev->irq)
22630 + mem_size = mem->end - mem->start + 1;
22631 + if (!request_mem_region(mem->start, mem_size, pdev->dev.driver->name)) {
22632 + dev_err(&pdev->dev, "resource unavailable\n");
22635 + SET_NETDEV_DEV(dev, &pdev->dev);
22637 + dev->base_addr = (unsigned long)ioremap_nocache(mem->start, mem_size);
22638 + if (!dev->base_addr) {
22639 + dev_err(&pdev->dev, "failed to map can port\n");
22643 + can->can_sys_clock = pdata->clock_frq;
22644 + platform_set_drvdata(pdev, dev);
22645 + ret = register_flexcandev(dev, pdata->clock_src);
22647 + dev_info(&pdev->dev, "probe for port 0x%lX done\n",
22652 + iounmap((unsigned long *)dev->base_addr);
22654 + release_mem_region(mem->start, mem_size);
22656 + free_candev(dev);
22657 + dev_err(&pdev->dev, "probe failed\n");
22661 +static int __devexit mcf548x_can_remove(struct platform_device *pdev)
22663 + struct net_device *dev = platform_get_drvdata(pdev);
22664 + struct resource *mem;
22666 + platform_set_drvdata(pdev, NULL);
22667 + unregister_flexcandev(dev);
22668 + iounmap((unsigned long *)dev->base_addr);
22670 + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
22671 + release_mem_region(mem->start, mem->end - mem->start + 1);
22672 + free_candev(dev);
22676 +static struct platform_driver mcf548x_can_driver = {
22678 + .name = "mcf548x-flexcan",
22680 + .probe = mcf548x_can_probe,
22681 + .remove = __devexit_p(mcf548x_can_remove),
22684 +static struct resource mcf548x_can0_resources[] = {
22686 + .start = MCF_MBAR + 0x0000A000,
22687 + .end = MCF_MBAR + 0x0000A7FF,
22688 + .flags = IORESOURCE_MEM,
22693 + .flags = IORESOURCE_IRQ,
22697 +static struct resource mcf548x_can1_resources[] = {
22699 + .start = MCF_MBAR + 0x0000A800,
22700 + .end = MCF_MBAR + 0x0000AFFF,
22701 + .flags = IORESOURCE_MEM,
22706 + .flags = IORESOURCE_IRQ,
22711 +static int __init mcf548x_of_to_pdev(void)
22714 + int err = -ENODEV;
22715 + struct flexcan_platform_data pdata;
22717 + pdev[0] = platform_device_register_simple("mcf548x-flexcan", 0,
22718 + mcf548x_can0_resources, 2);
22719 + if (IS_ERR(pdev[0])) {
22720 + err = PTR_ERR(pdev[0]);
22723 + pdev[1] = platform_device_register_simple("mcf548x-flexcan", 1,
22724 + mcf548x_can1_resources, 2);
22725 + if (IS_ERR(pdev[1])) {
22726 + err = PTR_ERR(pdev[1]);
22730 + /* FlexCAN clock */
22731 + pdata.clock_frq = 100000000;
22733 + for (i = 0; i < PDEV_MAX; i++) {
22734 + err = platform_device_add_data(pdev[i], &pdata, sizeof(pdata));
22741 +int __init mcf548x_can_init(void)
22743 + int err = mcf548x_of_to_pdev();
22746 + printk(KERN_ERR "%s init failed with err=%d\n",
22747 + mcf548x_can_driver.driver.name, err);
22751 + return platform_driver_register(&mcf548x_can_driver);
22754 +void __exit mcf548x_can_exit(void)
22757 + platform_driver_unregister(&mcf548x_can_driver);
22758 + for (i = 0; i < PDEV_MAX; i++)
22759 + platform_device_unregister(pdev[i]);
22762 +module_init(mcf548x_can_init);
22763 +module_exit(mcf548x_can_exit);
22765 +MODULE_AUTHOR("Andrey Volkov <avolkov@varma-el.com>");
22766 +MODULE_DESCRIPTION("Freescale MCF548x CAN driver");
22767 +MODULE_LICENSE("GPL v2");
22768 --- a/drivers/net/can/Kconfig
22769 +++ b/drivers/net/can/Kconfig
22770 @@ -12,6 +12,19 @@ config CAN_VCAN
22771 This driver can also be built as a module. If so, the module
22772 will be called vcan.
22774 +config CAN_FLEXCAN
22775 + tristate "Support for Freescale FLEXCAN based chips"
22776 + depends on CAN && (PPC || M68K || M68KNOMMU)
22778 + Say Y here if you want to support for Freescale FlexCAN.
22780 +config CAN_MCF547X_8X
22781 + tristate "Freescale MCF547X/MCF548X onboard CAN controller"
22782 + depends on CAN_FLEXCAN && (M547X || M548X)
22784 + Say Y here if you want to support for Freescale MCF547x/MCF548x
22785 + onboard dualCAN controller.
22787 config CAN_DEBUG_DEVICES
22788 bool "CAN devices debugging messages"
22790 --- a/drivers/net/can/Makefile
22791 +++ b/drivers/net/can/Makefile
22795 obj-$(CONFIG_CAN_VCAN) += vcan.o
22796 +obj-$(CONFIG_CAN_FLEXCAN) += flexcan/
22798 +++ b/drivers/net/fec/fec.c
22801 + * Performance and stability improvements: (C) Copyright 2008,
22802 + * Daniel Krueger, SYSTEC electronic GmbH
22804 + * Code crunched to get it to work on 2.6.24 -- FEC cleanup coming
22805 + * soon -- Kurt Mahan
22807 +#include <linux/module.h>
22808 +#include <linux/kernel.h>
22809 +#include <linux/string.h>
22810 +#include <linux/ptrace.h>
22811 +#include <linux/errno.h>
22812 +#include <linux/ioport.h>
22813 +#include <linux/slab.h>
22814 +#include <linux/interrupt.h>
22815 +#include <linux/pci.h>
22816 +#include <linux/init.h>
22817 +#include <linux/delay.h>
22818 +#include <linux/netdevice.h>
22819 +#include <linux/etherdevice.h>
22820 +#include <linux/skbuff.h>
22821 +#include <linux/spinlock.h>
22822 +#include <linux/workqueue.h>
22823 +#include <linux/bitops.h>
22825 +#include <asm/coldfire.h>
22826 +#include <asm/mcfsim.h>
22828 +#include <asm/dma.h>
22829 +#include <asm/MCD_dma.h>
22830 +#include <asm/m5485sram.h>
22831 +#include <asm/virtconvert.h>
22832 +#include <asm/irq.h>
22835 +#include "ks8721.h"
22837 +#ifdef CONFIG_FEC_548x_ENABLE_FEC2
22838 +#define FEC_MAX_PORTS 2
22841 +#define FEC_MAX_PORTS 1
22845 +#define VERSION "0.20"
22846 +MODULE_DESCRIPTION( "DMA Fast Ethernet Controller driver ver " VERSION);
22850 + struct net_device *netdev; /* owning net device */
22851 + void* fecpriv_txbuf[FEC_TX_BUF_NUMBER]; /* tx buffer ptrs */
22852 + MCD_bufDescFec *fecpriv_txdesc; /* tx descriptor ptrs */
22853 + volatile unsigned int fecpriv_current_tx; /* current tx desc index */
22854 + volatile unsigned int fecpriv_next_tx; /* next tx desc index */
22855 + unsigned int fecpriv_current_rx; /* current rx desc index */
22856 + MCD_bufDescFec *fecpriv_rxdesc; /* rx descriptor ptrs */
22857 + struct sk_buff *askb_rx[FEC_RX_BUF_NUMBER]; /* rx SKB ptrs */
22858 + unsigned int fecpriv_initiator_rx; /* rx dma initiator */
22859 + unsigned int fecpriv_initiator_tx; /* tx dma initiator */
22860 + int fecpriv_fec_rx_channel; /* rx dma channel */
22861 + int fecpriv_fec_tx_channel; /* tx dma channel */
22862 + int fecpriv_rx_requestor; /* rx dma requestor */
22863 + int fecpriv_tx_requestor; /* tx dma requestor */
22864 + void *fecpriv_interrupt_fec_rx_handler; /* dma rx handler */
22865 + void *fecpriv_interrupt_fec_tx_handler; /* dma tx handler */
22866 + unsigned char *fecpriv_mac_addr; /* private fec mac addr */
22867 + struct net_device_stats fecpriv_stat; /* stats ptr */
22868 + spinlock_t fecpriv_lock;
22869 + int fecpriv_rxflag;
22870 + struct tasklet_struct fecpriv_tasklet_reinit;
22871 + int index; /* fec hw number */
22874 +struct net_device *fec_dev[FEC_MAX_PORTS];
22876 +/* FEC functions */
22877 +int __init fec_init(void);
22878 +struct net_device_stats *fec_get_stat(struct net_device *dev);
22879 +int fec_open(struct net_device *dev);
22880 +int fec_close(struct net_device *nd);
22881 +int fec_tx(struct sk_buff *skb, struct net_device *dev);
22882 +void fec_set_multicast_list(struct net_device *nd);
22883 +int fec_set_mac_address(struct net_device *dev, void *p);
22884 +void fec_tx_timeout(struct net_device *dev);
22885 +void fec_interrupt_fec_tx_handler(struct net_device *dev);
22886 +void fec_interrupt_fec_rx_handler(struct net_device *dev);
22887 +irqreturn_t fec_interrupt_handler(int irq, void *dev_id);
22888 +void fec_interrupt_fec_tx_handler_fec0(void);
22889 +void fec_interrupt_fec_rx_handler_fec0(void);
22890 +void fec_interrupt_fec_reinit(unsigned long data);
22892 +/* default fec0 address */
22893 +unsigned char fec_mac_addr_fec0[6] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x50 };
22896 +/* default fec1 address */
22897 +unsigned char fec_mac_addr_fec1[6] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x51 };
22900 +extern unsigned char uboot_enet0[];
22901 +extern unsigned char uboot_enet1[];
22904 +int fec_str_to_mac( char *str_mac, unsigned char* addr);
22905 +int __init fec_mac_setup0 (char *s);
22910 +void fec_interrupt_fec_tx_handler_fec1(void);
22911 +void fec_interrupt_fec_rx_handler_fec1(void);
22915 +int __init fec_mac_setup1 (char *s);
22918 +int fec_read_mii(unsigned int base_addr, unsigned int pa, unsigned int ra, unsigned int *data);
22919 +int fec_write_mii(unsigned int base_addr, unsigned int pa, unsigned int ra, unsigned int data);
22921 +module_init(fec_init);
22922 +/* module_exit(fec_cleanup); */
22924 +__setup("mac0=", fec_mac_setup0);
22927 +__setup("mac1=", fec_mac_setup1);
22931 + * Initialize a FEC device
22933 +int fec_enet_init(struct net_device *dev)
22935 + static int index = 0;
22936 + struct fec_priv *fp = netdev_priv(dev);
22939 + fp->index = index;
22940 + fp->netdev = dev;
22941 + fec_dev[ index ] = dev;
22943 + if (index == 0) {
22944 + /* disable fec0 */
22945 + FEC_ECR(FEC_BASE_ADDR_FEC0) = FEC_ECR_DISABLE;
22947 + /* setup the interrupt handler */
22948 + dev->irq = 64 + ISC_FEC0;
22950 + if (request_irq(dev->irq, fec_interrupt_handler,
22951 + IRQF_DISABLED, "ColdFire FEC 0", dev)) {
22953 + printk("Cannot allocate FEC0 IRQ\n");
22955 + /* interrupt priority and level */
22956 + MCF_ICR(ISC_FEC0) = ILP_FEC0;
22959 + /* fec base address */
22960 + dev->base_addr = FEC_BASE_ADDR_FEC0;
22962 + /* requestor numbers */
22963 + fp->fecpriv_rx_requestor = DMA_FEC0_RX;
22964 + fp->fecpriv_tx_requestor = DMA_FEC0_TX;
22966 + /* fec0 handlers */
22967 + fp->fecpriv_interrupt_fec_rx_handler = fec_interrupt_fec_rx_handler_fec0;
22968 + fp->fecpriv_interrupt_fec_tx_handler = fec_interrupt_fec_tx_handler_fec0;
22970 + /* tx descriptors */
22971 + fp->fecpriv_txdesc = (void*)FEC_TX_DESC_FEC0;
22973 + /* rx descriptors */
22974 + fp->fecpriv_rxdesc = (void*)FEC_RX_DESC_FEC0;
22977 + if (uboot_enet0[0] || uboot_enet0[1] || uboot_enet0[2] ||
22978 + uboot_enet0[3] || uboot_enet0[4] || uboot_enet0[5]) {
22979 + /* use uboot enet 0 addr */
22980 + memcpy(fec_mac_addr_fec0, uboot_enet0, 6);
22983 + fp->fecpriv_mac_addr = fec_mac_addr_fec0;
22986 + /* disable fec1 */
22987 + FEC_ECR(FEC_BASE_ADDR_FEC1) = FEC_ECR_DISABLE;
22989 + /* setup the interrupt handler */
22990 + dev->irq = 64 + ISC_FEC1;
22992 + if (request_irq(dev->irq, fec_interrupt_handler,
22993 + IRQF_DISABLED, "ColdFire FEC 1", dev)) {
22995 + printk("Cannot allocate FEC1 IRQ\n");
22997 + /* interrupt priority and level */
22998 + MCF_ICR(ISC_FEC1) = ILP_FEC1;
23001 + /* fec base address */
23002 + dev->base_addr = FEC_BASE_ADDR_FEC1;
23004 + /* requestor numbers */
23005 + fp->fecpriv_rx_requestor = DMA_FEC1_RX;
23006 + fp->fecpriv_tx_requestor = DMA_FEC1_TX;
23008 + /* fec1 handlers */
23009 + fp->fecpriv_interrupt_fec_rx_handler = fec_interrupt_fec_rx_handler_fec1;
23010 + fp->fecpriv_interrupt_fec_tx_handler = fec_interrupt_fec_tx_handler_fec1;
23012 + /* tx descriptors */
23013 + fp->fecpriv_txdesc = (void*)FEC_TX_DESC_FEC1;
23015 + /* rx descriptors */
23016 + fp->fecpriv_rxdesc = (void*)FEC_RX_DESC_FEC1;
23019 + if (uboot_enet1[0] || uboot_enet1[1] || uboot_enet1[2] ||
23020 + uboot_enet1[3] || uboot_enet1[4] || uboot_enet1[5]) {
23021 + /* use uboot enet 1 addr */
23022 + memcpy(fec_mac_addr_fec1, uboot_enet1, 6);
23024 + fp->fecpriv_mac_addr = fec_mac_addr_fec1;
23029 + memset((void *) (dev->base_addr + 0x200), 0, FEC_MIB_LEN);
23031 + /* clear the statistics structure */
23032 + memset((void *) &(fp->fecpriv_stat), 0,
23033 + sizeof(struct net_device_stats));
23035 + /* grab the FEC initiators */
23036 + dma_set_initiator(fp->fecpriv_tx_requestor);
23037 + fp->fecpriv_initiator_tx = dma_get_initiator(fp->fecpriv_tx_requestor);
23038 + dma_set_initiator(fp->fecpriv_rx_requestor);
23039 + fp->fecpriv_initiator_rx = dma_get_initiator(fp->fecpriv_rx_requestor);
23041 + /* reset the DMA channels */
23042 + fp->fecpriv_fec_rx_channel = -1;
23043 + fp->fecpriv_fec_tx_channel = -1;
23045 + for (i = 0; i < FEC_RX_BUF_NUMBER; i++)
23046 + fp->askb_rx[i] = NULL;
23048 + /* initialize the pointers to the socket buffers */
23049 + for (i = 0; i < FEC_TX_BUF_NUMBER; i++)
23050 + fp->fecpriv_txbuf[i] = NULL;
23052 + ether_setup(dev);
23054 + dev->open = fec_open;
23055 + dev->stop = fec_close;
23056 + dev->hard_start_xmit = fec_tx;
23057 + dev->get_stats = fec_get_stat;
23058 + dev->set_multicast_list = fec_set_multicast_list;
23059 + dev->set_mac_address = fec_set_mac_address;
23060 + dev->tx_timeout = fec_tx_timeout;
23061 + dev->watchdog_timeo = FEC_TX_TIMEOUT * HZ;
23063 + memcpy(dev->dev_addr, fp->fecpriv_mac_addr, ETH_ALEN);
23065 + spin_lock_init(&fp->fecpriv_lock);
23067 + // Initialize FEC/I2C/IRQ Pin Assignment Register
23068 + FEC_GPIO_PAR_FECI2CIRQ &= 0xF;
23069 + FEC_GPIO_PAR_FECI2CIRQ |= FEC_FECI2CIRQ;
23076 + * Module Initialization
23078 +int __init fec_init(void)
23080 + struct net_device *dev;
23083 + DECLARE_MAC_BUF(mac);
23085 + printk(KERN_INFO "FEC ENET (DMA) Version %s\n", VERSION);
23087 + for (i = 0; i < FEC_MAX_PORTS; i++) {
23088 + dev = alloc_etherdev(sizeof(struct fec_priv));
23091 + err = fec_enet_init(dev);
23093 + free_netdev(dev);
23096 + if (register_netdev(dev) != 0) {
23097 + free_netdev(dev);
23101 + printk(KERN_INFO "%s: ethernet %s\n",
23102 + dev->name, print_mac(mac, dev->dev_addr));
23110 +void fec_stop(struct net_device *dev)
23112 + struct fec_priv *fp = netdev_priv(dev);
23114 + dma_remove_initiator(fp->fecpriv_initiator_tx);
23115 + dma_remove_initiator(fp->fecpriv_initiator_rx);
23118 + free_irq(dev->irq, dev);
23121 +/************************************************************************
23124 +* DESCRIPTION: This function performs the initialization of
23125 +* of FEC and corresponding KS8721 transiver
23127 +* RETURNS: If no error occurs, this function returns zero.
23128 +*************************************************************************/
23129 +int fec_open(struct net_device *dev)
23131 + struct fec_priv *fp = netdev_priv(dev);
23132 + unsigned long base_addr = (unsigned long) dev->base_addr;
23136 + int error_code = -EBUSY;
23138 + /* Receive the DMA channels */
23139 + channel = dma_set_channel_fec(fp->fecpriv_rx_requestor);
23141 + if (channel == -1) {
23142 + printk("Dma channel cannot be reserved\n");
23146 + fp->fecpriv_fec_rx_channel = channel;
23148 + dma_connect(channel, (int) fp->fecpriv_interrupt_fec_rx_handler);
23150 + channel = dma_set_channel_fec(fp->fecpriv_tx_requestor);
23152 + if (channel == -1) {
23153 + printk("Dma channel cannot be reserved\n");
23157 + fp->fecpriv_fec_tx_channel = channel;
23159 + dma_connect(channel, (int) fp->fecpriv_interrupt_fec_tx_handler);
23161 + /* init tasklet for controller reinitialization */
23162 + tasklet_init(&fp->fecpriv_tasklet_reinit, fec_interrupt_fec_reinit, (unsigned long) dev);
23164 + /* Reset FIFOs */
23165 + FEC_FECFRST(base_addr) |= FEC_SW_RST | FEC_RST_CTL;
23166 + FEC_FECFRST(base_addr) &= ~FEC_SW_RST;
23168 + /* Reset and disable FEC */
23169 + FEC_ECR(base_addr) = FEC_ECR_RESET;
23173 + /* Clear all events */
23174 + FEC_EIR(base_addr) = FEC_EIR_CLEAR;
23176 + /* Reset FIFO status */
23177 + FEC_FECTFSR(base_addr) = FEC_FECTFSR_MSK;
23178 + FEC_FECRFSR(base_addr) = FEC_FECRFSR_MSK;
23180 + /* Set the default address */
23181 + FEC_PALR(base_addr) = (fp->fecpriv_mac_addr[0] << 24) |
23182 + (fp->fecpriv_mac_addr[1] << 16) |
23183 + (fp->fecpriv_mac_addr[2] << 8) |
23184 + fp->fecpriv_mac_addr[3];
23185 + FEC_PAUR(base_addr) = (fp->fecpriv_mac_addr[4] << 24) |
23186 + (fp->fecpriv_mac_addr[5] << 16) | 0x8808;
23188 + /* Reset the group address descriptor */
23189 + FEC_GALR(base_addr) = 0x00000000;
23190 + FEC_GAUR(base_addr) = 0x00000000;
23192 + /* Reset the individual address descriptor */
23193 + FEC_IALR(base_addr) = 0x00000000;
23194 + FEC_IAUR(base_addr) = 0x00000000;
23196 + /* Set the receive control register */
23197 + FEC_RCR(base_addr) = FEC_RCR_MAX_FRM_SIZE | FEC_RCR_MII;
23199 + /* Set the receive FIFO control register */
23200 +// FEC_FECRFCR(base_addr) = FEC_FECRFCR_FRM | FEC_FECRFCR_GR | FEC_FECRFCR_MSK;
23201 + FEC_FECRFCR(base_addr) = FEC_FECRFCR_FRM | FEC_FECRFCR_GR
23202 + | (FEC_FECRFCR_MSK // disable all but ...
23203 + & ~FEC_FECRFCR_FAE // enable frame accept error
23204 + & ~FEC_FECRFCR_RXW // enable receive wait condition
23205 +// & ~FEC_FECRFCR_UF // enable FIFO underflow
23208 + /* Set the receive FIFO alarm register */
23209 + FEC_FECRFAR(base_addr) = FEC_FECRFAR_ALARM;
23211 + /* Set the transmit FIFO control register */
23212 +// FEC_FECTFCR(base_addr) = FEC_FECTFCR_FRM | FEC_FECTFCR_GR | FEC_FECTFCR_MSK;
23213 + FEC_FECTFCR(base_addr) = FEC_FECTFCR_FRM | FEC_FECTFCR_GR
23214 + | (FEC_FECTFCR_MSK // disable all but ...
23215 + & ~FEC_FECTFCR_FAE // enable frame accept error
23216 +// & ~FEC_FECTFCR_TXW // enable transmit wait condition
23217 +// & ~FEC_FECTFCR_UF // enable FIFO underflow
23218 + & ~FEC_FECTFCR_OF); // enable FIFO overflow
23220 + /* Set the transmit FIFO alarm register */
23221 + FEC_FECTFAR(base_addr) = FEC_FECTFAR_ALARM;
23223 + /* Set the Tx FIFO watermark */
23224 + FEC_FECTFWR(base_addr) = FEC_FECTFWR_XWMRK;
23226 + /* Enable the transmitter to append the CRC */
23227 + FEC_CTCWR(base_addr) = FEC_CTCWR_TFCW_CRC;
23229 + /* Enable the ethernet interrupts */
23230 +// FEC_EIMR(base_addr) = FEC_EIMR_MASK;
23231 + FEC_EIMR(base_addr) = FEC_EIMR_DISABLE
23243 + * There's a problem with the PHY initialization code --
23244 + * for now assume uboot left it in an initialized state.
23246 +// printk(KERN_INFO "FECOPEN: starting auto-negotiation\n");
23247 +// #ifdef CONFIG_FEC_548x_AUTO_NEGOTIATION
23249 + if ((error_code = init_transceiver(base_addr, &fduplex)) != 0)
23251 + printk("Initialization of the transceiver is failed\n");
23257 +// printk(KERN_INFO "FECOPEN: done with auto-negotiation\n");
23260 + /* Enable the full duplex mode */
23261 + FEC_TCR(base_addr) = FEC_TCR_FDEN | FEC_TCR_HBC;
23263 + /* Disable reception of frames while transmitting */
23264 + FEC_RCR(base_addr) |= FEC_RCR_DRT;
23267 + FEC_MIBC(base_addr) = FEC_MIBC_ENABLE;
23270 + FEC_ECR(base_addr) |= FEC_ECR_ETHEREN;
23272 + /* Initialize tx descriptors and start DMA for the transmission */
23273 + for (i = 0; i < FEC_TX_BUF_NUMBER; i++)
23274 + fp->fecpriv_txdesc[i].statCtrl = MCD_FEC_INTERRUPT;
23276 + fp->fecpriv_txdesc[i - 1].statCtrl |= MCD_FEC_WRAP;
23278 + fp->fecpriv_current_tx = fp->fecpriv_next_tx = 0;
23280 + MCD_startDma(fp->fecpriv_fec_tx_channel, (char *) fp->fecpriv_txdesc, 0,
23281 + (unsigned char *) &(FEC_FECTFDR(base_addr)), 0,
23282 + FEC_MAX_FRM_SIZE, 0, fp->fecpriv_initiator_tx,
23283 + FEC_TX_DMA_PRI, MCD_FECTX_DMA | MCD_INTERRUPT,
23284 + MCD_NO_CSUM | MCD_NO_BYTE_SWAP);
23286 + /* Initialize rx descriptors and start DMA for the reception */
23287 + for (i = 0; i < FEC_RX_BUF_NUMBER; i++) {
23288 + fp->askb_rx[i] = alloc_skb(FEC_MAXBUF_SIZE + 16, GFP_DMA);
23289 + if (!fp->askb_rx[i]) {
23290 + fp->fecpriv_rxdesc[i].dataPointer = 0;
23291 + fp->fecpriv_rxdesc[i].statCtrl = 0;
23292 + fp->fecpriv_rxdesc[i].length = 0;
23295 + skb_reserve(fp->askb_rx[i], 16);
23296 + fp->askb_rx[i]->dev = dev;
23297 + fp->fecpriv_rxdesc[i].dataPointer = (unsigned int) virt_to_phys(fp->askb_rx[i]->tail);
23298 + fp->fecpriv_rxdesc[i].statCtrl = MCD_FEC_BUF_READY | MCD_FEC_INTERRUPT;
23299 + fp->fecpriv_rxdesc[i].length = FEC_MAXBUF_SIZE;
23303 + fp->fecpriv_rxdesc[i - 1].statCtrl |= MCD_FEC_WRAP;
23304 + fp->fecpriv_current_rx = 0;
23306 + /* flush entire data cache before restarting the DMA */
23308 +/* JKM -- currently running with cache turned off */
23309 + DcacheFlushInvalidate();
23312 + MCD_startDma(fp->fecpriv_fec_rx_channel, (char *) fp->fecpriv_rxdesc, 0,
23313 + (unsigned char *) &(FEC_FECRFDR(base_addr)), 0,
23314 + FEC_MAX_FRM_SIZE, 0, fp->fecpriv_initiator_rx,
23315 + FEC_RX_DMA_PRI, MCD_FECRX_DMA | MCD_INTERRUPT,
23316 + MCD_NO_CSUM | MCD_NO_BYTE_SWAP);
23318 + netif_start_queue(dev);
23323 + /* Remove the channels and return with the error code */
23324 + if (fp->fecpriv_fec_rx_channel != -1) {
23325 + dma_disconnect(fp->fecpriv_fec_rx_channel);
23326 + dma_remove_channel_by_number(fp->fecpriv_fec_rx_channel);
23327 + fp->fecpriv_fec_rx_channel = -1;
23330 + if (fp->fecpriv_fec_tx_channel != -1) {
23331 + dma_disconnect(fp->fecpriv_fec_tx_channel);
23332 + dma_remove_channel_by_number(fp->fecpriv_fec_tx_channel);
23333 + fp->fecpriv_fec_tx_channel = -1;
23336 + return error_code;
23339 +/************************************************************************
23342 +* DESCRIPTION: This function performs the graceful stop of the
23343 +* transmission and disables FEC
23345 +* RETURNS: This function always returns zero.
23346 +*************************************************************************/
23347 +int fec_close(struct net_device *dev)
23349 + struct fec_priv *fp = netdev_priv(dev);
23350 + unsigned long base_addr = (unsigned long) dev->base_addr;
23351 + unsigned long time;
23354 + netif_stop_queue(dev);
23356 + /* Perform the graceful stop */
23357 + FEC_TCR(base_addr) |= FEC_TCR_GTS;
23361 + /* Wait for the graceful stop */
23362 + while (!(FEC_EIR(base_addr) & FEC_EIR_GRA) && jiffies - time < FEC_GR_TIMEOUT * HZ)
23365 + /* Disable FEC */
23366 + FEC_ECR(base_addr) = FEC_ECR_DISABLE;
23368 + /* Reset the DMA channels */
23369 + spin_lock_irq(&fp->fecpriv_lock);
23370 + MCD_killDma(fp->fecpriv_fec_tx_channel);
23371 + spin_unlock_irq(&fp->fecpriv_lock);
23372 + dma_remove_channel_by_number(fp->fecpriv_fec_tx_channel);
23373 + dma_disconnect(fp->fecpriv_fec_tx_channel);
23374 + fp->fecpriv_fec_tx_channel = -1;
23376 + for (i = 0; i < FEC_TX_BUF_NUMBER; i++) {
23377 + if (fp->fecpriv_txbuf[i]) {
23378 + kfree(fp->fecpriv_txbuf[i]);
23379 + fp->fecpriv_txbuf[i] = NULL;
23383 + spin_lock_irq(&fp->fecpriv_lock);
23384 + MCD_killDma(fp->fecpriv_fec_rx_channel);
23385 + spin_unlock_irq(&fp->fecpriv_lock);
23387 + dma_remove_channel_by_number(fp->fecpriv_fec_rx_channel);
23388 + dma_disconnect(fp->fecpriv_fec_rx_channel);
23389 + fp->fecpriv_fec_rx_channel = -1;
23391 + for (i = 0; i < FEC_RX_BUF_NUMBER; i++) {
23392 + if (fp->askb_rx[i]) {
23393 + kfree_skb(fp->askb_rx[i]);
23394 + fp->askb_rx[i] = NULL;
23401 +/************************************************************************
23402 +* +NAME: fec_get_stat
23404 +* RETURNS: This function returns the statistical information.
23405 +*************************************************************************/
23406 +struct net_device_stats * fec_get_stat(struct net_device *dev)
23408 + struct fec_priv *fp = netdev_priv(dev);
23409 + unsigned long base_addr = dev->base_addr;
23411 + /* Receive the statistical information */
23412 + fp->fecpriv_stat.rx_packets = FECSTAT_RMON_R_PACKETS(base_addr);
23413 + fp->fecpriv_stat.tx_packets = FECSTAT_RMON_T_PACKETS(base_addr);
23414 + fp->fecpriv_stat.rx_bytes = FECSTAT_RMON_R_OCTETS(base_addr);
23415 + fp->fecpriv_stat.tx_bytes = FECSTAT_RMON_T_OCTETS(base_addr);
23417 + fp->fecpriv_stat.multicast = FECSTAT_RMON_R_MC_PKT(base_addr);
23418 + fp->fecpriv_stat.collisions = FECSTAT_RMON_T_COL(base_addr);
23420 + fp->fecpriv_stat.rx_length_errors = FECSTAT_RMON_R_UNDERSIZE(base_addr) +
23421 + FECSTAT_RMON_R_OVERSIZE(base_addr) +
23422 + FECSTAT_RMON_R_FRAG(base_addr) +
23423 + FECSTAT_RMON_R_JAB(base_addr);
23424 + fp->fecpriv_stat.rx_crc_errors = FECSTAT_IEEE_R_CRC(base_addr);
23425 + fp->fecpriv_stat.rx_frame_errors = FECSTAT_IEEE_R_ALIGN(base_addr);
23426 + fp->fecpriv_stat.rx_over_errors = FECSTAT_IEEE_R_MACERR(base_addr);
23428 + fp->fecpriv_stat.tx_carrier_errors = FECSTAT_IEEE_T_CSERR(base_addr);
23429 + fp->fecpriv_stat.tx_fifo_errors = FECSTAT_IEEE_T_MACERR(base_addr);
23430 + fp->fecpriv_stat.tx_window_errors = FECSTAT_IEEE_T_LCOL(base_addr);
23432 + /* I hope that one frame doesn't have more than one error */
23433 + fp->fecpriv_stat.rx_errors = fp->fecpriv_stat.rx_length_errors +
23434 + fp->fecpriv_stat.rx_crc_errors +
23435 + fp->fecpriv_stat.rx_frame_errors +
23436 + fp->fecpriv_stat.rx_over_errors +
23437 + fp->fecpriv_stat.rx_dropped;
23438 + fp->fecpriv_stat.tx_errors = fp->fecpriv_stat.tx_carrier_errors +
23439 + fp->fecpriv_stat.tx_fifo_errors +
23440 + fp->fecpriv_stat.tx_window_errors +
23441 + fp->fecpriv_stat.tx_aborted_errors +
23442 + fp->fecpriv_stat.tx_heartbeat_errors +
23443 + fp->fecpriv_stat.tx_dropped;
23445 + return &fp->fecpriv_stat;
23448 +/************************************************************************
23449 +* NAME: fec_set_multicast_list
23451 +* DESCRIPTION: This function sets the frame filtering parameters
23452 +*************************************************************************/
23453 +void fec_set_multicast_list(struct net_device *dev)
23455 + struct dev_mc_list *dmi;
23456 + unsigned int crc, data;
23458 + unsigned long base_addr = (unsigned long) dev->base_addr;
23460 + if (dev->flags & IFF_PROMISC || dev->flags & IFF_ALLMULTI) {
23461 + /* Allow all incoming frames */
23462 + FEC_GALR(base_addr) = 0xFFFFFFFF;
23463 + FEC_GAUR(base_addr) = 0xFFFFFFFF;
23467 + /* Reset the group address register */
23468 + FEC_GALR(base_addr) = 0x00000000;
23469 + FEC_GAUR(base_addr) = 0x00000000;
23471 + /* Process all addresses */
23472 + for (i = 0, dmi = dev->mc_list; i < dev->mc_count; i++, dmi = dmi->next) {
23473 + /* Processing must be only for the group addresses */
23474 + if (!(dmi->dmi_addr[0] & 1))
23477 + /* Calculate crc value for the current address */
23478 + crc = 0xFFFFFFFF;
23479 + for (j = 0; j < dmi->dmi_addrlen; j++) {
23480 + for (k = 0, data = dmi->dmi_addr[j]; k < 8; k++, data >>= 1) {
23481 + if ((crc ^ data) & 1)
23482 + crc = (crc >> 1) ^ FEC_CRCPOL;
23488 + /* Add this value */
23492 + FEC_GAUR(base_addr) |= 0x1 << (crc - 32);
23494 + FEC_GALR(base_addr) |= 0x1 << crc;
23498 +/************************************************************************
23499 +* NAME: fec_set_mac_address
23501 +* DESCRIPTION: This function sets the MAC address
23502 +*************************************************************************/
23503 +int fec_set_mac_address(struct net_device *dev, void *p)
23505 + struct fec_priv *fp = netdev_priv(dev);
23506 + unsigned long base_addr = (unsigned long) dev->base_addr;
23507 + struct sockaddr *addr = p;
23509 + if (netif_running(dev))
23512 + /* Copy a new address to the device structure */
23513 + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
23515 + /* Copy a new address to the private structure */
23516 + memcpy(fp->fecpriv_mac_addr, addr->sa_data, 6);
23518 + /* Set the address to the registers */
23519 + FEC_PALR(base_addr) = (fp->fecpriv_mac_addr[0] << 24) |
23520 + (fp->fecpriv_mac_addr[1] << 16) |
23521 + (fp->fecpriv_mac_addr[2] << 8) |
23522 + fp->fecpriv_mac_addr[3];
23523 + FEC_PAUR(base_addr) = (fp->fecpriv_mac_addr[4] << 24) |
23524 + (fp->fecpriv_mac_addr[5] << 16) |
23530 +/************************************************************************
23533 +* DESCRIPTION: This function starts transmission of the frame using DMA
23535 +* RETURNS: This function always returns zero.
23536 +*************************************************************************/
23537 +int fec_tx(struct sk_buff *skb, struct net_device *dev)
23539 + struct fec_priv *fp = netdev_priv(dev);
23540 + void *data, *data_aligned;
23543 + data = kmalloc(skb->len + 15, GFP_DMA | GFP_ATOMIC);
23546 + fp->fecpriv_stat.tx_dropped++;
23547 + dev_kfree_skb(skb);
23551 + offset = (((unsigned long)virt_to_phys(data) + 15) & 0xFFFFFFF0) -
23552 + (unsigned long)virt_to_phys(data);
23553 + data_aligned = (void*)((unsigned long)data + offset);
23554 + memcpy(data_aligned, skb->data, skb->len);
23556 + /* flush data cache before initializing the descriptor and starting DMA */
23558 +/* JKM -- currently running with cache turned off */
23559 + DcacheFlushInvalidateCacheBlock((void*)virt_to_phys(data_aligned), skb->len);
23562 + spin_lock_irq(&fp->fecpriv_lock);
23564 + /* Initialize the descriptor */
23565 + fp->fecpriv_txbuf[fp->fecpriv_next_tx] = data;
23566 + fp->fecpriv_txdesc[fp->fecpriv_next_tx].dataPointer = (unsigned int) virt_to_phys(data_aligned);
23567 + fp->fecpriv_txdesc[fp->fecpriv_next_tx].length = skb->len;
23568 + fp->fecpriv_txdesc[fp->fecpriv_next_tx].statCtrl |= (MCD_FEC_END_FRAME | MCD_FEC_BUF_READY);
23569 + fp->fecpriv_next_tx = (fp->fecpriv_next_tx + 1) & FEC_TX_INDEX_MASK;
23571 + if (fp->fecpriv_txbuf[fp->fecpriv_current_tx] && fp->fecpriv_current_tx == fp->fecpriv_next_tx)
23572 + netif_stop_queue(dev);
23574 + spin_unlock_irq(&fp->fecpriv_lock);
23576 + /* Tell the DMA to continue the transmission */
23577 + MCD_continDma(fp->fecpriv_fec_tx_channel);
23579 + dev_kfree_skb(skb);
23581 + dev->trans_start = jiffies;
23586 +/************************************************************************
23587 +* NAME: fec_tx_timeout
23589 +* DESCRIPTION: If the interrupt processing of received frames was lost
23590 +* and DMA stopped the reception, this function clears
23591 +* the transmission descriptors and starts DMA
23593 +*************************************************************************/
23594 +void fec_tx_timeout(struct net_device *dev)
23597 + struct fec_priv *fp = netdev_priv(dev);
23598 + unsigned long base_addr = (unsigned long) dev->base_addr;
23600 + spin_lock_irq(&fp->fecpriv_lock);
23601 + MCD_killDma(fp->fecpriv_fec_tx_channel);
23602 + for (i = 0; i < FEC_TX_BUF_NUMBER; i++) {
23603 + if (fp->fecpriv_txbuf[i]) {
23604 + kfree(fp->fecpriv_txbuf[i]);
23605 + fp->fecpriv_txbuf[i] = NULL;
23607 + fp->fecpriv_txdesc[i].statCtrl = MCD_FEC_INTERRUPT;
23609 + fp->fecpriv_txdesc[i - 1].statCtrl |= MCD_FEC_WRAP;
23611 + fp->fecpriv_current_tx = fp->fecpriv_next_tx = 0;
23613 + /* Reset FIFOs */
23614 + FEC_FECFRST(base_addr) |= FEC_SW_RST;
23615 + FEC_FECFRST(base_addr) &= ~FEC_SW_RST;
23617 + /* Reset and disable FEC */
23618 +// FEC_ECR(base_addr) = FEC_ECR_RESET;
23621 + FEC_ECR(base_addr) |= FEC_ECR_ETHEREN;
23623 + MCD_startDma(fp->fecpriv_fec_tx_channel, (char *) fp->fecpriv_txdesc, 0,
23624 + (unsigned char *) &(FEC_FECTFDR(base_addr)), 0,
23625 + FEC_MAX_FRM_SIZE, 0, fp->fecpriv_initiator_tx,
23626 + FEC_TX_DMA_PRI, MCD_FECTX_DMA | MCD_INTERRUPT,
23627 + MCD_NO_CSUM | MCD_NO_BYTE_SWAP);
23629 + spin_unlock_irq(&fp->fecpriv_lock);
23631 + netif_wake_queue(dev);
23635 +/************************************************************************
23636 +* NAME: fec_read_mii
23638 +* DESCRIPTION: This function reads the value from the MII register
23640 +* RETURNS: If no error occurs, this function returns zero.
23641 +*************************************************************************/
23642 +int fec_read_mii(unsigned int base_addr, unsigned int pa, unsigned int ra, unsigned int *data)
23644 + unsigned long time;
23646 + /* Clear the MII interrupt bit */
23647 + FEC_EIR(base_addr) = FEC_EIR_MII;
23649 + /* Write to the MII management frame register */
23650 + FEC_MMFR(base_addr) = FEC_MMFR_READ | (pa << 23) | (ra << 18);
23654 + /* Wait for the reading */
23655 + while (!(FEC_EIR(base_addr) & FEC_EIR_MII)) {
23656 + if (jiffies - time > FEC_MII_TIMEOUT * HZ)
23661 + /* Clear the MII interrupt bit */
23662 + FEC_EIR(base_addr) = FEC_EIR_MII;
23664 + *data = FEC_MMFR(base_addr) & 0x0000FFFF;
23669 +/************************************************************************
23670 +* NAME: fec_write_mii
23672 +* DESCRIPTION: This function writes the value to the MII register
23674 +* RETURNS: If no error occurs, this function returns zero.
23675 +*************************************************************************/
23676 +int fec_write_mii(unsigned int base_addr, unsigned int pa, unsigned int ra, unsigned int data)
23678 + unsigned long time;
23680 + /* Clear the MII interrupt bit */
23681 + FEC_EIR(base_addr) = FEC_EIR_MII;
23683 + /* Write to the MII management frame register */
23684 + FEC_MMFR(base_addr) = FEC_MMFR_WRITE | (pa << 23) | (ra << 18) | data;
23688 + /* Wait for the writing */
23689 + while (!(FEC_EIR(base_addr) & FEC_EIR_MII)) {
23690 + if (jiffies - time > FEC_MII_TIMEOUT * HZ)
23695 + /* Clear the MII interrupt bit */
23696 + FEC_EIR(base_addr) = FEC_EIR_MII;
23701 +/************************************************************************
23702 +* NAME: fec_interrupt_tx_handler
23704 +* DESCRIPTION: This function is called when the data
23705 +* transmission from the buffer to the FEC is completed.
23707 +*************************************************************************/
23708 +void fec_interrupt_fec_tx_handler(struct net_device *dev)
23710 + struct fec_priv *fp = netdev_priv(dev);
23712 + /* Release the socket buffer */
23713 + if(fp->fecpriv_txbuf[fp->fecpriv_current_tx]) {
23714 + kfree(fp->fecpriv_txbuf[fp->fecpriv_current_tx]);
23715 + fp->fecpriv_txbuf[fp->fecpriv_current_tx] = NULL;
23717 + fp->fecpriv_current_tx = (fp->fecpriv_current_tx + 1) & FEC_TX_INDEX_MASK;
23719 + if (MCD_dmaStatus(fp->fecpriv_fec_tx_channel) == MCD_DONE) {
23720 + for (; fp->fecpriv_current_tx != fp->fecpriv_next_tx; fp->fecpriv_current_tx = (fp->fecpriv_current_tx + 1) & FEC_TX_INDEX_MASK) {
23721 + if(fp->fecpriv_txbuf[fp->fecpriv_current_tx]) {
23722 + kfree(fp->fecpriv_txbuf[fp->fecpriv_current_tx]);
23723 + fp->fecpriv_txbuf[fp->fecpriv_current_tx] = NULL;
23728 + if (netif_queue_stopped(dev))
23729 + netif_wake_queue(dev);
23732 +/************************************************************************
23733 +* NAME: fec_interrupt_rx_handler
23735 +* DESCRIPTION: This function is called when the data
23736 +* reception from the FEC to the reception buffer is completed.
23738 +*************************************************************************/
23739 +void fec_interrupt_fec_rx_handler(struct net_device *dev)
23741 + struct fec_priv *fp = netdev_priv(dev);
23742 + struct sk_buff *skb;
23745 + fp->fecpriv_rxflag = 1;
23746 + // Some buffers can be missed
23747 + if(!(fp->fecpriv_rxdesc[fp->fecpriv_current_rx].statCtrl & MCD_FEC_END_FRAME))
23749 + // Find a valid index
23750 + for(i = 0; i < FEC_RX_BUF_NUMBER && !(fp->fecpriv_rxdesc[fp->fecpriv_current_rx].statCtrl & MCD_FEC_END_FRAME); i++, fp->fecpriv_current_rx = (fp->fecpriv_current_rx + 1) & FEC_RX_INDEX_MASK);
23752 + if(i == FEC_RX_BUF_NUMBER)
23754 + // There are no data to process
23755 + // Tell the DMA to continue the reception
23756 + MCD_continDma(fp->fecpriv_fec_rx_channel);
23758 + fp->fecpriv_rxflag = 0;
23764 + for (; fp->fecpriv_rxdesc[fp->fecpriv_current_rx].statCtrl & MCD_FEC_END_FRAME; fp->fecpriv_current_rx = (fp->fecpriv_current_rx + 1) & FEC_RX_INDEX_MASK) {
23765 + if( (fp->fecpriv_rxdesc[fp->fecpriv_current_rx].length <= FEC_MAXBUF_SIZE) &&
23766 + (fp->fecpriv_rxdesc[fp->fecpriv_current_rx].length > 4)) { /* --tym-- */
23767 + skb = fp->askb_rx[fp->fecpriv_current_rx];
23769 + fp->fecpriv_stat.rx_dropped++;
23771 + /* flush data cache before initializing the descriptor and starting DMA */
23772 +// DcacheFlushInvalidateCacheBlock((void*)virt_to_phys(fp->askb_rx[fp->fecpriv_current_rx]->tail), fp->askb_rx[fp->fecpriv_current_rx]->len);
23774 + skb_put(skb, fp->fecpriv_rxdesc[fp->fecpriv_current_rx].length - 4);
23775 + skb->protocol = eth_type_trans(skb, dev);
23778 + fp->fecpriv_rxdesc[fp->fecpriv_current_rx].statCtrl &= ~MCD_FEC_END_FRAME;
23779 + /* allocate new skbuff */
23780 + fp->askb_rx[fp->fecpriv_current_rx] = alloc_skb(FEC_MAXBUF_SIZE + 16, /*GFP_ATOMIC |*/ GFP_DMA);
23781 + if (!fp->askb_rx[fp->fecpriv_current_rx]) {
23782 + fp->fecpriv_rxdesc[fp->fecpriv_current_rx].dataPointer = 0;
23783 + fp->fecpriv_rxdesc[fp->fecpriv_current_rx].length = 0;
23784 + fp->fecpriv_stat.rx_dropped++;
23787 + skb_reserve(fp->askb_rx[fp->fecpriv_current_rx], 16);
23788 + fp->askb_rx[fp->fecpriv_current_rx]->dev = dev;
23790 + /* flush data cache before initializing the descriptor and starting DMA */
23792 +/* JKM -- currently running with cache turned off */
23793 + DcacheFlushInvalidateCacheBlock((void*)virt_to_phys(fp->askb_rx[fp->fecpriv_current_rx]->tail), FEC_MAXBUF_SIZE);
23796 + fp->fecpriv_rxdesc[fp->fecpriv_current_rx].dataPointer = (unsigned int) virt_to_phys(fp->askb_rx[fp->fecpriv_current_rx]->tail);
23797 + fp->fecpriv_rxdesc[fp->fecpriv_current_rx].length = FEC_MAXBUF_SIZE;
23798 + fp->fecpriv_rxdesc[fp->fecpriv_current_rx].statCtrl |= MCD_FEC_BUF_READY;
23800 + // flush data cache before initializing the descriptor and starting DMA
23801 +// DcacheFlushInvalidateCacheBlock((void*)virt_to_phys(fp->askb_rx[fp->fecpriv_current_rx]->tail), FEC_MAXBUF_SIZE);
23807 + /* Tell the DMA to continue the reception */
23808 + MCD_continDma(fp->fecpriv_fec_rx_channel);
23810 + fp->fecpriv_rxflag = 0;
23813 +/************************************************************************
23814 +* NAME: fec_interrupt_handler
23816 +* DESCRIPTION: This function is called when some special errors occur
23818 +*************************************************************************/
23819 +irqreturn_t fec_interrupt_handler(int irq, void *dev_id)
23822 + struct net_device *dev = (struct net_device *)dev_id;
23823 + struct fec_priv *fp = netdev_priv(dev);
23824 + unsigned long base_addr = (unsigned long) dev->base_addr;
23825 + unsigned long events;
23827 + /* Read and clear the events */
23828 + events = FEC_EIR(base_addr) & FEC_EIMR(base_addr);
23830 + if (events & FEC_EIR_HBERR) {
23831 + fp->fecpriv_stat.tx_heartbeat_errors++;
23832 + FEC_EIR(base_addr) = FEC_EIR_HBERR;
23835 + /* receive/transmit FIFO error */
23836 + if (((events & FEC_EIR_RFERR) != 0) || ((events & FEC_EIR_XFERR) != 0)) {
23837 + /* kill DMA receive channel */
23838 + MCD_killDma (fp->fecpriv_fec_rx_channel);
23840 + /* kill running transmission by DMA */
23841 + MCD_killDma (fp->fecpriv_fec_tx_channel);
23843 + /* Reset FIFOs */
23844 + FEC_FECFRST(base_addr) |= FEC_SW_RST;
23845 + FEC_FECFRST(base_addr) &= ~FEC_SW_RST;
23847 + /* reset receive FIFO status register */
23848 + FEC_FECRFSR(base_addr) = FEC_FECRFSR_FAE |
23849 + FEC_FECRFSR_RXW |
23852 + /* reset transmit FIFO status register */
23853 + FEC_FECTFSR(base_addr) = FEC_FECTFSR_FAE |
23854 + FEC_FECTFSR_TXW |
23858 + /* reset RFERR and XFERR event */
23859 + FEC_EIR(base_addr) = FEC_EIR_RFERR | FEC_EIR_XFERR;
23862 + netif_stop_queue(dev);
23864 + /* execute reinitialization as tasklet */
23865 + tasklet_schedule(&fp->fecpriv_tasklet_reinit);
23867 + fp->fecpriv_stat.rx_dropped++;
23870 + /* transmit FIFO underrun */
23871 + if ((events & FEC_EIR_XFUN) != 0) {
23872 + /* reset XFUN event */
23873 + FEC_EIR(base_addr) = FEC_EIR_XFUN;
23874 + fp->fecpriv_stat.tx_aborted_errors++;
23877 + /* late collision */
23878 + if ((events & FEC_EIR_LC) != 0) {
23879 + /* reset LC event */
23880 + FEC_EIR(base_addr) = FEC_EIR_LC;
23881 + fp->fecpriv_stat.tx_aborted_errors++;
23884 + /* collision retry limit */
23885 + if ((events & FEC_EIR_RL) != 0) {
23886 + /* reset RL event */
23887 + FEC_EIR(base_addr) = FEC_EIR_RL;
23888 + fp->fecpriv_stat.tx_aborted_errors++;
23893 +/************************************************************************
23894 +* NAME: fec_interrupt_reinit
23896 +* DESCRIPTION: This function is called from interrupt handler
23897 +* when controller must be reinitialized.
23899 +*************************************************************************/
23900 +void fec_interrupt_fec_reinit(unsigned long data)
23903 + struct net_device *dev = (struct net_device*)data;
23904 + struct fec_priv *fp = netdev_priv(dev);
23905 + unsigned long base_addr = (unsigned long) dev->base_addr;
23907 + /* Initialize reception descriptors and start DMA for the reception */
23908 + for (i = 0; i < FEC_RX_BUF_NUMBER; i++) {
23909 + if (!fp->askb_rx[i]) {
23910 + fp->askb_rx[i] = alloc_skb(FEC_MAXBUF_SIZE + 16, GFP_ATOMIC | GFP_DMA);
23911 + if (!fp->askb_rx[i]) {
23912 + fp->fecpriv_rxdesc[i].dataPointer = 0;
23913 + fp->fecpriv_rxdesc[i].statCtrl = 0;
23914 + fp->fecpriv_rxdesc[i].length = 0;
23917 + fp->askb_rx[i]->dev = dev;
23918 + skb_reserve(fp->askb_rx[i], 16);
23920 + fp->fecpriv_rxdesc[i].dataPointer = (unsigned int) virt_to_phys(fp->askb_rx[i]->tail);
23921 + fp->fecpriv_rxdesc[i].statCtrl = MCD_FEC_BUF_READY | MCD_FEC_INTERRUPT;
23922 + fp->fecpriv_rxdesc[i].length = FEC_MAXBUF_SIZE;
23925 + fp->fecpriv_rxdesc[i - 1].statCtrl |= MCD_FEC_WRAP;
23926 + fp->fecpriv_current_rx = 0;
23928 + /* restart frame transmission */
23929 + for (i = 0; i < FEC_TX_BUF_NUMBER; i++) {
23930 + if (fp->fecpriv_txbuf[i]) {
23931 + kfree(fp->fecpriv_txbuf[i]);
23932 + fp->fecpriv_txbuf[i] = NULL;
23933 + fp->fecpriv_stat.tx_dropped++;
23935 + fp->fecpriv_txdesc[i].statCtrl = MCD_FEC_INTERRUPT;
23937 + fp->fecpriv_txdesc[i - 1].statCtrl |= MCD_FEC_WRAP;
23938 + fp->fecpriv_current_tx = fp->fecpriv_next_tx = 0;
23940 + /* flush entire data cache before restarting the DMA */
23942 +/* JKM -- currently running with cache turned off */
23943 + DcacheFlushInvalidate();
23946 + /* restart DMA from beginning */
23947 + MCD_startDma(fp->fecpriv_fec_rx_channel,
23948 + (char *) fp->fecpriv_rxdesc, 0,
23949 + (unsigned char *) &(FEC_FECRFDR(base_addr)), 0,
23950 + FEC_MAX_FRM_SIZE, 0, fp->fecpriv_initiator_rx,
23951 + FEC_RX_DMA_PRI, MCD_FECRX_DMA | MCD_INTERRUPT,
23952 + MCD_NO_CSUM | MCD_NO_BYTE_SWAP);
23954 + MCD_startDma(fp->fecpriv_fec_tx_channel, (char *) fp->fecpriv_txdesc, 0,
23955 + (unsigned char *) &(FEC_FECTFDR(base_addr)), 0,
23956 + FEC_MAX_FRM_SIZE, 0, fp->fecpriv_initiator_tx,
23957 + FEC_TX_DMA_PRI, MCD_FECTX_DMA | MCD_INTERRUPT,
23958 + MCD_NO_CSUM | MCD_NO_BYTE_SWAP);
23961 + FEC_ECR(base_addr) |= FEC_ECR_ETHEREN;
23963 + netif_wake_queue(dev);
23966 +/************************************************************************
23967 +* NAME: fec_interrupt_tx_handler_fec0
23969 +* DESCRIPTION: This is the DMA interrupt handler using for FEC0
23972 +*************************************************************************/
23973 +void fec_interrupt_fec_tx_handler_fec0(void)
23975 + fec_interrupt_fec_tx_handler(fec_dev[0]);
23979 +/************************************************************************
23980 +* NAME: fec_interrupt_tx_handler_fec1
23982 +* DESCRIPTION: This is the DMA interrupt handler using for the FEC1
23985 +*************************************************************************/
23986 +void fec_interrupt_fec_tx_handler_fec1(void)
23988 + fec_interrupt_fec_tx_handler(fec_dev[1]);
23992 +/************************************************************************
23993 +* NAME: fec_interrupt_rx_handler_fec0
23995 +* DESCRIPTION: This is the DMA interrupt handler using for the FEC0
23998 +*************************************************************************/
23999 +void fec_interrupt_fec_rx_handler_fec0(void)
24001 + fec_interrupt_fec_rx_handler(fec_dev[0]);
24005 +/************************************************************************
24006 +* NAME: fec_interrupt_rx_handler_fec1
24008 +* DESCRIPTION: This is the DMA interrupt handler using for the FEC1
24011 +*************************************************************************/
24012 +void fec_interrupt_fec_rx_handler_fec1(void)
24014 + fec_interrupt_fec_rx_handler(fec_dev[1]);
24020 +/************************************************************************
24021 +* NAME: fec_mac_setup0
24023 +* DESCRIPTION: This function sets the MAC address of FEC0 from command line
24025 +*************************************************************************/
24026 +int __init fec_mac_setup0(char *s)
24031 + if(fec_str_to_mac(s, fec_mac_addr_fec0))
24032 + printk("The MAC address of FEC0 cannot be set from command line");
24038 +/************************************************************************
24039 +* NAME: fec_mac_setup1
24041 +* DESCRIPTION: This function sets the MAC address of FEC1 from command line
24043 +*************************************************************************/
24044 +int __init fec_mac_setup1(char *s)
24049 + if(fec_str_to_mac(s, fec_mac_addr_fec1))
24050 + printk("The MAC address of FEC1 cannot be set from command line");
24055 +/************************************************************************
24056 +* NAME: fec_str_to_mac
24058 +* DESCRIPTION: This function interprets the character string into MAC addr
24060 +*************************************************************************/
24061 +int fec_str_to_mac( char *str_mac, unsigned char* addr)
24063 + unsigned long val;
24065 + unsigned long octet[6], *octetptr = octet;
24070 + while ((c = *str_mac) != '\0') {
24071 + if ((c>='0')&&(c<='9')) {
24072 + val = (val * 16) + (c - '0');
24076 + else if (((c>='a')&&(c<='f'))||((c>='A')&&(c<='F'))) {
24077 + val = (val << 4) + (c + 10 - (((c>='a')&&(c<='f')) ? 'a' : 'A'));
24083 + if (*str_mac == ':') {
24084 + *octetptr++ = val, str_mac++;
24085 + if (octetptr >= octet + 6)
24090 + /* Check for trailing characters */
24091 + if (*str_mac && !(*str_mac==' '))
24094 + *octetptr++ = val;
24096 + if ((octetptr - octet)==6) {
24097 + for(i=0;i<=6;i++)
24098 + addr[i]=octet[i];
24107 +++ b/drivers/net/fec/fec.h
24110 +#define FEC_BASE_ADDR_FEC0 ((unsigned int)MCF_MBAR + 0x9000)
24111 +#define FEC_BASE_ADDR_FEC1 ((unsigned int)MCF_MBAR + 0x9800)
24113 +//#define FEC_INTC_IMRH_INT_MASK38 (0x00000040)
24114 +//#define FEC_INTC_IMRH_INT_MASK39 (0x00000080)
24115 +//#define FEC_INTC_ICR_FEC0 (0x30)
24116 +//#define FEC_INTC_ICR_FEC1 (0x31)
24117 +#define FEC_FECI2CIRQ (0xFFC0)
24118 +#define FEC_GPIO_PAR_FECI2CIRQ *(volatile unsigned short*)((unsigned int)MCF_MBAR + 0xA44)
24119 +//#define FEC_INTC_ICRn(x) (*(volatile unsigned char *)(void*)((unsigned int) MCF_MBAR + 0x000740+((x)*0x001)))
24120 +//#define FEC_INTC_IMRH *(volatile unsigned int*)((unsigned int)MCF_MBAR + 0x000708)
24122 +#define FEC_ECR_DISABLE (0x00000000)
24124 +#define FEC_ECR(x) *(volatile unsigned int *)(x + 0x024)
24125 +#define FEC_EIR(x) *(volatile unsigned int*)(x + 0x004)
24126 +#define FEC_PALR(x) *(volatile unsigned int*)(x + 0x0E4)
24127 +#define FEC_PAUR(x) *(volatile unsigned int*)(x + 0x0E8)
24128 +#define FEC_IALR(x) *(volatile unsigned int*)(x + 0x11C)
24129 +#define FEC_IAUR(x) *(volatile unsigned int*)(x + 0x118)
24130 +#define FEC_GALR(x) *(volatile unsigned int*)(x + 0x124)
24131 +#define FEC_GAUR(x) *(volatile unsigned int*)(x + 0x120)
24132 +#define FEC_RCR(x) *(volatile unsigned int*)(x + 0x084)
24133 +#define FEC_FECRFCR(x) *(volatile unsigned int*)(x + 0x18C)
24134 +#define FEC_FECRFAR(x) *(volatile unsigned int*)(x + 0x198)
24135 +#define FEC_FECTFCR(x) *(volatile unsigned int*)(x + 0x1AC)
24136 +#define FEC_FECTFAR(x) *(volatile unsigned int*)(x + 0x1B8)
24137 +#define FEC_FECTFWR(x) *(volatile unsigned int*)(x + 0x144)
24138 +#define FEC_CTCWR(x) *(volatile unsigned int*)(x + 0x1C8)
24139 +#define FEC_EIMR(x) *(volatile unsigned int*)(x + 0x008)
24140 +#define FEC_TCR(x) *(volatile unsigned int*)(x + 0x0C4)
24141 +#define FEC_MIBC(x) *(volatile unsigned int*)(x + 0x064)
24142 +#define FEC_MSCR(x) *(volatile unsigned int*)(x + 0x044)
24143 +#define FEC_FECTFDR(x) *(volatile unsigned int*)(x + 0x1A4)
24144 +#define FEC_FECRFDR(x) *(volatile unsigned int*)(x + 0x184)
24145 +#define FEC_FECTFSR(x) *(volatile unsigned int*)(x + 0x1A8)
24146 +#define FEC_FECRFSR(x) *(volatile unsigned int*)(x + 0x188)
24147 +#define FECSTAT_RMON_R_PACKETS(x) *(volatile unsigned int*)(x + 0x284)
24148 +#define FECSTAT_RMON_T_PACKETS(x) *(volatile unsigned int*)(x + 0x204)
24149 +#define FECSTAT_RMON_R_OCTETS(x) *(volatile unsigned int*)(x + 0x2C4)
24150 +#define FECSTAT_RMON_T_OCTETS(x) *(volatile unsigned int*)(x + 0x244)
24151 +#define FECSTAT_RMON_R_UNDERSIZE(x) *(volatile unsigned int*)(x + 0x294)
24152 +#define FECSTAT_RMON_R_OVERSIZE(x) *(volatile unsigned int*)(x + 0x298)
24153 +#define FECSTAT_RMON_R_FRAG(x) *(volatile unsigned int*)(x + 0x29C)
24154 +#define FECSTAT_RMON_R_JAB(x) *(volatile unsigned int*)(x + 0x2A0)
24155 +#define FECSTAT_RMON_R_MC_PKT(x) *(volatile unsigned int*)(x + 0x28C)
24156 +#define FECSTAT_RMON_T_COL(x) *(volatile unsigned int*)(x + 0x224)
24157 +#define FECSTAT_IEEE_R_ALIGN(x) *(volatile unsigned int*)(x + 0x2D4)
24158 +#define FECSTAT_IEEE_R_CRC(x) *(volatile unsigned int*)(x + 0x2D0)
24159 +#define FECSTAT_IEEE_R_MACERR(x) *(volatile unsigned int*)(x + 0x2D8)
24160 +#define FECSTAT_IEEE_T_CSERR(x) *(volatile unsigned int*)(x + 0x268)
24161 +#define FECSTAT_IEEE_T_MACERR(x) *(volatile unsigned int*)(x + 0x264)
24162 +#define FECSTAT_IEEE_T_LCOL(x) *(volatile unsigned int*)(x + 0x25C)
24163 +#define FECSTAT_IEEE_R_OCTETS_OK(x) *(volatile unsigned int*)(x + 0x2E0)
24164 +#define FECSTAT_IEEE_T_OCTETS_OK(x) *(volatile unsigned int*)(x + 0x274)
24165 +#define FECSTAT_IEEE_R_DROP(x) *(volatile unsigned int*)(x + 0x2C8)
24166 +#define FECSTAT_IEEE_T_DROP(x) *(volatile unsigned int*)(x + 0x248)
24167 +#define FECSTAT_IEEE_R_FRAME_OK(x) *(volatile unsigned int*)(x + 0x2CC)
24168 +#define FECSTAT_IEEE_T_FRAME_OK(x) *(volatile unsigned int*)(x + 0x24C)
24169 +#define FEC_MMFR(x) *(volatile unsigned int*)(x + 0x040)
24170 +#define FEC_FECFRST(x) *(volatile unsigned int*)(x + 0x1C4)
24172 +#define FEC_MAX_FRM_SIZE (1518)
24173 +#define FEC_MAXBUF_SIZE (1520)
24175 +// Register values
24176 +#define FEC_ECR_RESET (0x00000001)
24177 +#define FEC_EIR_CLEAR (0xFFFFFFFF)
24178 +#define FEC_EIR_RL (0x00100000)
24179 +#define FEC_EIR_HBERR (0x80000000)
24180 +#define FEC_EIR_BABR (0x40000000) // babbling receive error
24181 +#define FEC_EIR_BABT (0x20000000) // babbling transmit error
24182 +#define FEC_EIR_TXF (0x08000000) // transmit frame interrupt
24183 +#define FEC_EIR_MII (0x00800000) // MII interrupt
24184 +#define FEC_EIR_LC (0x00200000) // late collision
24185 +#define FEC_EIR_XFUN (0x00080000) // transmit FIFO underrun
24186 +#define FEC_EIR_XFERR (0x00040000) // transmit FIFO error
24187 +#define FEC_EIR_RFERR (0x00020000) // receive FIFO error
24188 +#define FEC_RCR_MAX_FRM_SIZE (FEC_MAX_FRM_SIZE << 16)
24189 +#define FEC_RCR_MII (0x00000004)
24190 +#define FEC_FECRFCR_FAE (0x00400000) // frame accept error
24191 +#define FEC_FECRFCR_RXW (0x00200000) // receive wait condition
24192 +#define FEC_FECRFCR_UF (0x00100000) // receive FIFO underflow
24193 +#define FEC_FECRFCR_FRM (0x08000000)
24194 +#define FEC_FECRFCR_GR (0x7 << 24)
24196 +#define FEC_EIMR_DISABLE (0x00000000)
24198 +#define FEC_FECRFAR_ALARM (0x300)
24199 +#define FEC_FECTFCR_FRM (0x08000000)
24200 +#define FEC_FECTFCR_GR (0x7 << 24)
24201 +#define FEC_FECTFCR_FAE (0x00400000) // frame accept error
24202 +#define FEC_FECTFCR_TXW (0x00040000) // transmit wait condition
24203 +#define FEC_FECTFCR_UF (0x00100000) // transmit FIFO underflow
24204 +#define FEC_FECTFCR_OF (0x00080000) // transmit FIFO overflow
24206 +#define FEC_FECTFAR_ALARM (0x100)
24207 +#define FEC_FECTFWR_XWMRK (0x00000000)
24209 +#define FEC_FECTFSR_MSK (0xC0B00000)
24210 +#define FEC_FECTFSR_TXW (0x40000000) // transmit wait condition
24211 +#define FEC_FECTFSR_FAE (0x00800000) // frame accept error
24212 +#define FEC_FECTFSR_UF (0x00200000) // transmit FIFO underflow
24213 +#define FEC_FECTFSR_OF (0x00100000) // transmit FIFO overflow
24215 +#define FEC_FECRFSR_MSK (0x80F00000)
24216 +#define FEC_FECRFSR_FAE (0x00800000) // frame accept error
24217 +#define FEC_FECRFSR_RXW (0x00400000) // receive wait condition
24218 +#define FEC_FECRFSR_UF (0x00200000) // receive FIFO underflow
24220 +#define FEC_CTCWR_TFCW_CRC (0x03000000)
24221 +#define FEC_TCR_FDEN (0x00000004)
24222 +#define FEC_TCR_HBC (0x00000002)
24223 +#define FEC_RCR_DRT (0x00000002)
24224 +#define FEC_EIMR_MASK (FEC_EIR_RL | FEC_EIR_HBERR)
24225 +#define FEC_ECR_ETHEREN (0x00000002)
24226 +#define FEC_FECTFCR_MSK (0x00FC0000)
24227 +#define FEC_FECRFCR_MSK (0x00F80000)
24228 +#define FEC_EIR_GRA (0x10000000)
24229 +#define FEC_TCR_GTS (0x00000001)
24230 +#define FEC_MIBC_ENABLE (0x00000000)
24231 +#define FEC_MIB_LEN (228)
24232 +#define FEC_PHY_ADDR (0x01)
24234 +#define FEC_RX_DMA_PRI (6)
24235 +#define FEC_TX_DMA_PRI (6)
24237 +#define FEC_TX_BUF_NUMBER (8)
24238 +#define FEC_RX_BUF_NUMBER (64)
24240 +#define FEC_TX_INDEX_MASK (0x7)
24241 +#define FEC_RX_INDEX_MASK (0x3f)
24243 +#define FEC_RX_DESC_FEC0 SYS_SRAM_FEC_START
24244 +#define FEC_TX_DESC_FEC0 FEC_RX_DESC_FEC0 + FEC_RX_BUF_NUMBER * sizeof(MCD_bufDescFec)
24246 +#define FEC_RX_DESC_FEC1 SYS_SRAM_FEC_START + SYS_SRAM_FEC_SIZE/2
24247 +#define FEC_TX_DESC_FEC1 FEC_RX_DESC_FEC1 + FEC_RX_BUF_NUMBER * sizeof(MCD_bufDescFec)
24249 +#define FEC_EIR_MII (0x00800000)
24250 +#define FEC_MMFR_READ (0x60020000)
24251 +#define FEC_MMFR_WRITE (0x50020000)
24253 +#define FEC_FLAGS_RX (0x00000001)
24255 +#define FEC_CRCPOL (0xEDB88320)
24257 +#define FEC_MII_TIMEOUT (2)
24258 +#define FEC_GR_TIMEOUT (1)
24259 +#define FEC_TX_TIMEOUT (1)
24260 +#define FEC_RX_TIMEOUT (1)
24262 +#define FEC_SW_RST 0x2000000
24263 +#define FEC_RST_CTL 0x1000000
24265 +int fec_read_mii(unsigned int base_addr, unsigned int pa, unsigned int ra,
24266 + unsigned int *data);
24267 +int fec_write_mii(unsigned int base_addr, unsigned int pa, unsigned int ra,
24268 + unsigned int data);
24270 +#define init_transceiver ks8721_init_transceiver
24272 +++ b/drivers/net/fec/Kconfig
24275 + tristate "MCF547x/MCF548x Fast Ethernet Controller support"
24276 + depends on M547X_8X
24278 + The MCF547x and MCF548x have a built-in Fast Ethernet Controller.
24279 + Saying Y here will include support for this device in the kernel.
24281 + To compile this driver as a module, choose M here: the module
24282 + will be called fecm.
24284 +config FEC_548x_AUTO_NEGOTIATION
24285 + bool "Enable Auto-Negotiation"
24286 + depends on FEC_548x
24288 + This option enables the FEC to automatically detect the
24289 + half/full duplex mode and the network speed at initialization
24290 + If you want this, say Y.
24292 +config FEC_548x_ENABLE_FEC2
24293 + bool "Enable the second FEC"
24294 + depends on FEC_548x
24296 + This enables the second FEC on the 547x/548x. If you want to use
24300 +++ b/drivers/net/fec/ks8721.c
24302 +#include <linux/module.h>
24303 +#include <linux/kernel.h>
24304 +#include <linux/string.h>
24305 +#include <linux/ptrace.h>
24306 +#include <linux/errno.h>
24307 +#include <linux/ioport.h>
24308 +#include <linux/slab.h>
24309 +#include <linux/interrupt.h>
24310 +#include <linux/pci.h>
24311 +#include <linux/init.h>
24312 +#include <linux/delay.h>
24313 +#include <linux/netdevice.h>
24314 +#include <linux/etherdevice.h>
24315 +#include <linux/skbuff.h>
24316 +#include <linux/spinlock.h>
24317 +#include <linux/workqueue.h>
24318 +#include <linux/bitops.h>
24321 +#include <linux/config.h>
24322 +#include <linux/sched.h>
24323 +#include <linux/errno.h>
24324 +#include <asm/coldfire.h>
24326 +#include <asm/coldfire.h>
24327 +#include <asm/mcfsim.h>
24330 +#include "ks8721.h"
24332 +#ifdef CONFIG_FEC_548x_AUTO_NEGOTIATION
24333 +#define KS8721_AUTO_NEGOTIATION_ENABLE
24336 +/************************************************************************
24337 +* +NAME: ks8721_init_transceiver
24339 +* DESCRIPTION: This function initializes the transceiver
24341 +* RETURNS: If no error occurs, this function returns zero.
24342 +* Otherwise, it returns 1
24343 +*************************************************************************/
24345 +int ks8721_init_transceiver(unsigned long base_addr, int *fduplex)
24349 + unsigned long time;
24354 + // Set the frequency of MII
24355 + FEC_MSCR(base_addr) = FEC_MII_SPEED;
24358 + if ((result = fec_write_mii(base_addr, FEC_PHY_ADDR, KS8721_CTRL, KS8721_CTRL_RESET)))
24362 + if ((result = fec_read_mii(base_addr, FEC_PHY_ADDR, KS8721_CTRL, &data)) != 0)
24365 + // If reset bit is set, return
24366 + if (data & KS8721_CTRL_RESET)
24369 +#ifdef KS8721_AUTO_NEGOTIATION_ENABLE
24371 + // Disable the auto-negotiation
24372 + if ((result = fec_write_mii(base_addr, FEC_PHY_ADDR, KS8721_CTRL, 0)) != 0)
24375 + // Set the auto-negotiation advertisement register
24376 + if ((result = fec_write_mii(base_addr, FEC_PHY_ADDR, KS8721_ANADV, KS8721_ANADV_ADV_ALL)) != 0)
24379 + // Enable the auto-negotiation
24380 + if ((result = fec_write_mii(base_addr, FEC_PHY_ADDR, KS8721_CTRL, KS8721_CTRL_AN_ENABLE)) != 0)
24383 + // Read PHY status register
24384 + if ((result = fec_read_mii(base_addr, FEC_PHY_ADDR, KS8721_STAT, &data)) != 0)
24386 + // Set the current time
24389 + // Wait for the auto-negotiation completion
24390 + while (!(data & KS8721_STAT_ANCOMPLETE))
24393 + if (jiffies - time > KS8721_TIMEOUT * HZ)
24401 + // Read PHY status register
24402 + if ((result = fec_read_mii(base_addr, FEC_PHY_ADDR, KS8721_STAT, &data)) != 0)
24408 + // Set the duplex flag
24409 + if (data & KS8721_STAT_FDUPLEX)
24419 + // Set the default mode (Full duplex, 100 Mbps)
24420 + if ((result = fec_write_mii(base_addr, FEC_PHY_ADDR, KS8721_CTRL, KS8721_CTRL_DEFAULT_MODE)) != 0)
24422 + *fduplex = KS8721_CTRL_DEFAULT_MODE & 0x100;
24428 +++ b/drivers/net/fec/ks8721.h
24431 +#define FEC_MII_SPEED (((unsigned int)(MCF_BUSCLK / 5000000)) << 1)
24433 +// Numbers of the transceiver registers
24434 +#define KS8721_CTRL 0x00
24435 +#define KS8721_ANADV 0x04
24436 +#define KS8721_STAT 0x01
24438 +// Register values
24439 +#define KS8721_CTRL_RESET 0x8000
24440 +#define KS8721_ANADV_ADV_ALL 0x01E1
24441 +#define KS8721_CTRL_AN_ENABLE 0x1280
24442 +#define KS8721_CTRL_DEFAULT_MODE 0x2100
24443 +#define KS8721_STAT_ANCOMPLETE 0x0020
24444 +#define KS8721_STAT_LINK 0x0004
24445 +#define KS8721_STAT_FDUPLEX 0x5000
24447 +// Timeout for the auto-negotiation mode
24448 +#define KS8721_TIMEOUT 5
24450 +int ks8721_init_transceiver(unsigned long base_addr, int *fduplex);
24452 +++ b/drivers/net/fec/Makefile
24455 +# Makefile for the FEC ethernet driver
24458 +obj-$(CONFIG_FEC_548x) += fecm.o
24460 +fecm-objs := fec.o ks8721.o
24461 --- a/drivers/net/fec.c
24462 +++ b/drivers/net/fec.c
24465 * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be)
24466 * Copyright (c) 2004-2006 Macq Electronique SA.
24468 + * Coldfire bug fixes and cleanup by Kurt Mahan (kmahan@freescale.com)
24469 + * Copyright 2007-2008 Freescale Semiconductor, Inc. All Rights Reserved.
24472 #include <linux/module.h>
24475 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \
24476 defined(CONFIG_M5272) || defined(CONFIG_M528x) || \
24477 - defined(CONFIG_M520x) || defined(CONFIG_M532x)
24478 + defined(CONFIG_M520x) || defined(CONFIG_M532x) || \
24479 + defined(CONFIG_M5445X)
24481 #include <asm/coldfire.h>
24482 #include <asm/mcfsim.h>
24484 @@ -82,6 +87,11 @@ static unsigned int fec_hw[] = {
24485 (MCF_MBAR+0x30000),
24486 #elif defined(CONFIG_M532x)
24487 (MCF_MBAR+0xfc030000),
24488 +#elif defined(CONFIG_M5445X)
24489 + (MCF_MBAR+0xfc030000),
24490 +#if defined(CONFIG_FEC2)
24491 + (MCF_MBAR+0xfc034000),
24494 &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec),
24496 @@ -172,7 +182,7 @@ typedef struct {
24497 * account when setting it.
24499 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
24500 - defined(CONFIG_M520x) || defined(CONFIG_M532x)
24501 + defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_M5445X)
24502 #define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16)
24504 #define OPT_FRAME_SIZE 0
24505 @@ -213,6 +223,7 @@ struct fec_enet_private {
24507 phy_info_t const *phy;
24508 struct work_struct phy_task;
24509 + volatile fec_t *phy_hwp;
24511 uint sequence_done;
24512 uint mii_phy_task_queued;
24513 @@ -349,7 +360,8 @@ fec_enet_start_xmit(struct sk_buff *skb,
24514 if (bdp->cbd_bufaddr & 0x3) {
24515 unsigned int index;
24516 index = bdp - fep->tx_bd_base;
24517 - memcpy(fep->tx_bounce[index], (void *) bdp->cbd_bufaddr, bdp->cbd_datlen);
24518 + memcpy(fep->tx_bounce[index],
24519 + (void *)skb->data, bdp->cbd_datlen);
24520 bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]);
24523 @@ -702,7 +714,7 @@ fec_enet_mii(struct net_device *dev)
24526 fep = netdev_priv(dev);
24528 + ep = fep->phy_hwp;
24529 mii_reg = ep->fec_mii_data;
24531 spin_lock(&fep->lock);
24532 @@ -753,7 +765,7 @@ mii_queue(struct net_device *dev, int re
24535 mii_head = mii_tail = mip;
24536 - fep->hwp->fec_mii_data = regval;
24537 + fep->phy_hwp->fec_mii_data = regval;
24541 @@ -1151,8 +1163,7 @@ static phy_info_t const phy_info_ks8721b
24544 /* ------------------------------------------------------------------------- */
24545 -/* register definitions for the DP83848 */
24547 +/* register definitions for the DP83848 and DP83849 */
24548 #define MII_DP8384X_PHYSTST 16 /* PHY Status Register */
24550 static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev)
24551 @@ -1186,27 +1197,50 @@ static void mii_parse_dp8384x_sr2(uint m
24552 *s |= PHY_STAT_FAULT;
24555 +static phy_cmd_t const phy_cmd_dp8384x_ack_int[] = {
24559 +static phy_cmd_t const phy_cmd_dp8384x_shutdown[] = {
24563 static phy_info_t phy_info_dp83848= {
24566 + .id = 0x020005c9,
24567 + .name = "DP83848",
24569 - (const phy_cmd_t []) { /* config */
24570 + .config = (const phy_cmd_t []) { /* config */
24571 { mk_mii_read(MII_REG_CR), mii_parse_cr },
24572 { mk_mii_read(MII_REG_ANAR), mii_parse_anar },
24573 { mk_mii_read(MII_DP8384X_PHYSTST), mii_parse_dp8384x_sr2 },
24576 - (const phy_cmd_t []) { /* startup - enable interrupts */
24577 + .startup = (const phy_cmd_t []) { /* startup - enable interrupts */
24578 { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
24579 { mk_mii_read(MII_REG_SR), mii_parse_sr },
24582 - (const phy_cmd_t []) { /* ack_int - never happens, no interrupt */
24583 + .ack_int = phy_cmd_dp8384x_ack_int,
24584 + .shutdown = phy_cmd_dp8384x_shutdown,
24587 +static phy_info_t phy_info_dp83849 = {
24588 + .id = 0x020005ca,
24589 + .name = "DP83849",
24591 + .config = (const phy_cmd_t []) { /* config */
24592 + { mk_mii_read(MII_REG_CR), mii_parse_cr },
24593 + { mk_mii_read(MII_REG_ANAR), mii_parse_anar },
24594 + { mk_mii_read(MII_DP8384X_PHYSTST), mii_parse_dp8384x_sr2 },
24597 - (const phy_cmd_t []) { /* shutdown */
24598 + .startup = (const phy_cmd_t []) { /* startup - enable interrupts */
24599 + { mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
24600 + { mk_mii_read(MII_REG_SR), mii_parse_sr },
24603 + .ack_int = phy_cmd_dp8384x_ack_int,
24604 + .shutdown = phy_cmd_dp8384x_shutdown,
24607 /* ------------------------------------------------------------------------- */
24608 @@ -1218,6 +1252,7 @@ static phy_info_t const * const phy_info
24609 &phy_info_am79c874,
24610 &phy_info_ks8721bl,
24612 + &phy_info_dp83849,
24616 @@ -1799,6 +1834,138 @@ static void __inline__ fec_uncache(unsig
24618 /* ------------------------------------------------------------------------- */
24620 +#elif defined(CONFIG_M5445X)
24622 + * Code specific for M5445X
24625 +static void __inline__ fec_request_intrs(struct net_device *dev)
24627 + struct fec_enet_private *fep;
24629 + static const struct idesc {
24631 + unsigned short irq;
24633 + { "fec(TXF)", 36 },
24634 + { "fec(TXB)", 37 },
24635 + { "fec(TXFIFO)", 38 },
24636 + { "fec(TXCR)", 39 },
24637 + { "fec(RXF)", 40 },
24638 + { "fec(RXB)", 41 },
24639 + { "fec(MII)", 42 },
24640 + { "fec(LC)", 43 },
24641 + { "fec(HBERR)", 44 },
24642 + { "fec(GRA)", 45 },
24643 + { "fec(EBERR)", 46 },
24644 + { "fec(BABT)", 47 },
24645 + { "fec(BABR)", 48 },
24649 + fep = netdev_priv(dev);
24650 + b = (fep->index) ? 77 : 64;
24652 + /* Setup interrupt handlers. */
24653 + for (idp = id; idp->name; idp++) {
24654 + if (request_irq(b+idp->irq, fec_enet_interrupt, IRQF_DISABLED,
24655 + idp->name, dev) != 0)
24656 + printk(KERN_ERR "FEC: Could not alloc %s IRQ(%d)!\n",
24657 + idp->name, b+idp->irq);
24660 + if (fep->index) {
24661 + /* Configure RMII */
24662 + MCF_GPIO_PAR_FEC = (MCF_GPIO_PAR_FEC &
24663 + MCF_GPIO_PAR_FEC_FEC1_MASK) |
24664 + MCF_GPIO_PAR_FEC_FEC1_RMII_GPIO;
24666 + /* Configure RMII */
24667 + MCF_GPIO_PAR_FEC = (MCF_GPIO_PAR_FEC &
24668 + MCF_GPIO_PAR_FEC_FEC0_MASK) |
24669 + MCF_GPIO_PAR_FEC_FEC0_RMII_GPIO;
24672 + /* Set up gpio outputs for MII lines on FEC0 */
24673 + MCF_GPIO_PAR_FECI2C |= (0 |
24674 + MCF_GPIO_PAR_FECI2C_MDIO0_MDIO0 |
24675 + MCF_GPIO_PAR_FECI2C_MDC0_MDC0);
24678 +static void __inline__ fec_set_mii(struct net_device *dev,
24679 + struct fec_enet_private *fep)
24681 + volatile fec_t *fecp;
24684 + fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;
24685 + fecp->fec_x_cntrl = 0x00;
24688 + * Set MII speed to 2.5 MHz
24690 + fep->phy_speed = ((((MCF_CLK / 2) / (2500000 / 10)) + 5) / 10) * 2;
24691 + fecp->fec_mii_speed = fep->phy_speed;
24693 + fec_restart(dev, 0);
24696 +static void __inline__ fec_get_mac(struct net_device *dev)
24698 + struct fec_enet_private *fep = netdev_priv(dev);
24699 + volatile fec_t *fecp;
24700 + unsigned char *iap, tmpaddr[ETH_ALEN];
24704 + if (FEC_FLASHMAC) {
24706 + * Get MAC address from FLASH.
24707 + * If it is all 1's or 0's, use the default.
24709 + iap = FEC_FLASHMAC;
24710 + if ((iap[0] == 0) && (iap[1] == 0) && (iap[2] == 0) &&
24711 + (iap[3] == 0) && (iap[4] == 0) && (iap[5] == 0))
24712 + iap = fec_mac_default;
24713 + if ((iap[0] == 0xff) && (iap[1] == 0xff) && (iap[2] == 0xff) &&
24714 + (iap[3] == 0xff) && (iap[4] == 0xff) && (iap[5] == 0xff))
24715 + iap = fec_mac_default;
24717 + *((unsigned long *) &tmpaddr[0]) = fecp->fec_addr_low;
24718 + *((unsigned short *) &tmpaddr[4]) = (fecp->fec_addr_high >> 16);
24719 + iap = &tmpaddr[0];
24722 + memcpy(dev->dev_addr, iap, ETH_ALEN);
24724 + /* Adjust MAC if using default MAC address */
24725 + if (iap == fec_mac_default)
24726 + dev->dev_addr[ETH_ALEN-1] = fec_mac_default[ETH_ALEN-1] +
24730 +static void __inline__ fec_enable_phy_intr(void)
24734 +static void __inline__ fec_disable_phy_intr(void)
24738 +static void __inline__ fec_phy_ack_intr(void)
24742 +static void __inline__ fec_localhw_setup(void)
24746 +static void __inline__ fec_uncache(unsigned long addr)
24750 +/* ------------------------------------------------------------------------- */
24755 @@ -2305,7 +2472,7 @@ fec_set_mac_address(struct net_device *d
24759 -/* Initialize the FEC Ethernet on 860T (or ColdFire 5272).
24760 +/* Initialize the FEC Ethernet.
24763 * XXX: We need to clean up on failure exits here.
24764 @@ -2326,7 +2493,7 @@ int __init fec_enet_init(struct net_devi
24766 /* Allocate memory for buffer descriptors.
24768 - mem_addr = __get_free_page(GFP_KERNEL);
24769 + mem_addr = __get_free_page(GFP_DMA);
24770 if (mem_addr == 0) {
24771 printk("FEC: allocate descriptor memory failed?\n");
24773 @@ -2339,6 +2506,11 @@ int __init fec_enet_init(struct net_devi
24774 fep->index = index;
24777 +#ifdef CONFIG_FEC_SHARED_PHY
24778 + fep->phy_hwp = (volatile fec_t *) fec_hw[index & ~1];
24780 + fep->phy_hwp = fecp;
24783 /* Whack a reset. We should wait for this.
24785 @@ -2375,7 +2547,7 @@ int __init fec_enet_init(struct net_devi
24787 /* Allocate a page.
24789 - mem_addr = __get_free_page(GFP_KERNEL);
24790 + mem_addr = __get_free_page(GFP_DMA);
24791 /* XXX: missing check for allocation failure */
24793 fec_uncache(mem_addr);
24794 @@ -2400,7 +2572,7 @@ int __init fec_enet_init(struct net_devi
24795 bdp = fep->tx_bd_base;
24796 for (i=0, j=FEC_ENET_TX_FRPPG; i<TX_RING_SIZE; i++) {
24797 if (j >= FEC_ENET_TX_FRPPG) {
24798 - mem_addr = __get_free_page(GFP_KERNEL);
24799 + mem_addr = __get_free_page(GFP_DMA);
24802 mem_addr += FEC_ENET_TX_FRSIZE;
24803 @@ -2462,7 +2634,11 @@ int __init fec_enet_init(struct net_devi
24804 * remainder of the interface.
24806 fep->phy_id_done = 0;
24807 +#ifndef CONFIG_FEC_SHARED_PHY
24810 + fep->phy_addr = fep->index;
24812 mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy);
24815 --- a/drivers/net/fec.h
24816 +++ b/drivers/net/fec.h
24818 /****************************************************************************/
24820 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
24821 - defined(CONFIG_M520x) || defined(CONFIG_M532x)
24822 + defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_M5445X)
24824 * Just figures, Motorola would have to change the offsets for
24825 * registers in the same peripheral device on different models
24826 --- a/drivers/net/Kconfig
24827 +++ b/drivers/net/Kconfig
24828 @@ -351,6 +351,8 @@ config MACB
24830 source "drivers/net/arm/Kconfig"
24832 +source "drivers/net/fec/Kconfig"
24835 tristate "ASIX AX88796 NE2000 clone support"
24836 depends on ARM || MIPS || SUPERH
24837 @@ -1973,7 +1975,7 @@ config 68360_ENET
24840 bool "FEC ethernet controller (of ColdFire CPUs)"
24841 - depends on M523x || M527x || M5272 || M528x || M520x
24842 + depends on M523x || M527x || M5272 || M528x || M520x || M5445X
24844 Say Y here if you want to use the built-in 10/100 Fast ethernet
24845 controller on some Motorola ColdFire processors.
24846 @@ -1985,6 +1987,12 @@ config FEC2
24847 Say Y here if you want to use the second built-in 10/100 Fast
24848 ethernet controller on some Motorola ColdFire processors.
24850 +config FEC_SHARED_PHY
24851 + bool "Shared PHY interface(on some ColdFire designs)"
24854 + Say Y here if both PHYs are controlled via a single channel.
24857 tristate "MPC52xx FEC driver"
24858 depends on PPC_MERGE && PPC_MPC52xx && PPC_BESTCOMM_FEC
24859 --- a/drivers/net/Makefile
24860 +++ b/drivers/net/Makefile
24861 @@ -226,6 +226,8 @@ obj-$(CONFIG_ENC28J60) += enc28j60.o
24863 obj-$(CONFIG_MACB) += macb.o
24865 +obj-$(CONFIG_FEC_548x) += fec/
24867 obj-$(CONFIG_ARM) += arm/
24868 obj-$(CONFIG_DEV_APPLETALK) += appletalk/
24869 obj-$(CONFIG_TR) += tokenring/
24870 --- a/drivers/pci/access.c
24871 +++ b/drivers/pci/access.c
24872 @@ -23,6 +23,7 @@ static DEFINE_SPINLOCK(pci_lock);
24873 #define PCI_word_BAD (pos & 1)
24874 #define PCI_dword_BAD (pos & 3)
24876 +#ifdef NL_ORIGINAL
24877 #define PCI_OP_READ(size,type,len) \
24878 int pci_bus_read_config_##size \
24879 (struct pci_bus *bus, unsigned int devfn, int pos, type *value) \
24880 @@ -37,7 +38,20 @@ int pci_bus_read_config_##size \
24881 spin_unlock_irqrestore(&pci_lock, flags); \
24885 +#else /* NL_ORIGINAL */
24886 +#define PCI_OP_READ(size,type,len) \
24887 +int pci_bus_read_config_##size \
24888 + (struct pci_bus *bus, unsigned int devfn, int pos, type *value) \
24891 + unsigned long flags; \
24892 + if (PCI_##size##_BAD) return PCIBIOS_BAD_REGISTER_NUMBER; \
24893 + spin_lock_irqsave(&pci_lock, flags); \
24894 + res = bus->ops->read(bus, devfn, pos, len, (u32 *)value); \
24895 + spin_unlock_irqrestore(&pci_lock, flags); \
24898 +#endif /* NL_ORIGINAL */
24899 #define PCI_OP_WRITE(size,type,len) \
24900 int pci_bus_write_config_##size \
24901 (struct pci_bus *bus, unsigned int devfn, int pos, type value) \
24902 --- a/drivers/pci/Makefile
24903 +++ b/drivers/pci/Makefile
24904 @@ -39,6 +39,7 @@ obj-$(CONFIG_PPC) += setup-bus.o
24905 obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o
24906 obj-$(CONFIG_X86_VISWS) += setup-irq.o
24907 obj-$(CONFIG_MN10300) += setup-bus.o
24908 +obj-$(CONFIG_M54455) += setup-bus.o setup-irq.o
24911 # ACPI Related PCI FW Functions
24912 --- a/drivers/rtc/rtc-rs5c372.c
24913 +++ b/drivers/rtc/rtc-rs5c372.c
24916 #define DRV_VERSION "0.5"
24920 * Ricoh has a family of I2C based RTCs, which differ only slightly from
24921 * each other. Differences center on pinout (e.g. how many interrupts,
24923 /* to read (style 1) or write registers starting at R */
24924 #define RS5C_ADDR(R) (((R) << 4) | 0)
24926 +#ifdef CONFIG_M547X_8X
24927 +#define DRV_NAME "rv5c387a"
24928 +/* i2c configuration */
24929 +#define RV5C387_I2C_ADDR 0x32
24930 +static unsigned short normal_i2c[] = {
24931 + RV5C387_I2C_ADDR, I2C_CLIENT_END
24933 +I2C_CLIENT_INSMOD; /* defines addr_data */
24938 @@ -506,14 +514,14 @@ static int rs5c372_probe(struct i2c_clie
24943 - if (!(rs5c372 = kzalloc(sizeof(struct rs5c372), GFP_KERNEL))) {
24944 + rs5c372 = kzalloc(sizeof(struct rs5c372), GFP_KERNEL);
24950 /* we read registers 0x0f then 0x00-0x0f; skip the first one */
24951 - rs5c372->regs=&rs5c372->buf[1];
24952 + rs5c372->regs = &rs5c372->buf[1];
24954 rs5c372->client = client;
24955 i2c_set_clientdata(client, rs5c372);
24956 @@ -605,7 +613,7 @@ static int rs5c372_probe(struct i2c_clie
24957 case rtc_rv5c386: s = "rv5c386"; break;
24958 case rtc_rv5c387a: s = "rv5c387a"; break;
24959 default: s = "chip"; break;
24962 rs5c372->time24 ? "24hr" : "am/pm"
24965 @@ -645,12 +653,61 @@ static int rs5c372_remove(struct i2c_cli
24969 +#ifdef CONFIG_M547X_8X
24970 +static int rv5c387_probe(struct i2c_adapter *adapter, int addr, int kind)
24973 + struct i2c_client *new_client = NULL;
24975 + if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
24977 + printk(KERN_DEBUG "%s i2c_check_functionality\n", __FUNCTION__);
24981 + new_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
24982 + if (new_client == NULL) {
24984 + printk(KERN_DEBUG "%s kzalloc new_client\n", __FUNCTION__);
24988 + new_client->addr = addr;
24989 + new_client->adapter = adapter;
24990 + new_client->driver = &rs5c372_driver;
24991 + new_client->flags = 0;
24992 + strcpy(new_client->name, DRV_NAME);
24994 + rc = i2c_attach_client(new_client);
24996 + printk(KERN_DEBUG "%s i2c_attach_client\n", __FUNCTION__);
25000 + rs5c372_probe(new_client);
25003 + kfree(new_client);
25008 +rv5c387_attach_adapter(struct i2c_adapter *adapter)
25010 + return i2c_probe(adapter, &addr_data, rv5c387_probe);
25014 static struct i2c_driver rs5c372_driver = {
25016 .name = "rtc-rs5c372",
25018 +#ifdef CONFIG_M547X_8X
25019 + .attach_adapter = &rv5c387_attach_adapter,
25021 .probe = rs5c372_probe,
25022 .remove = rs5c372_remove,
25026 static __init int rs5c372_init(void)
25027 --- a/drivers/serial/Kconfig
25028 +++ b/drivers/serial/Kconfig
25029 @@ -979,6 +979,12 @@ config SERIAL_COLDFIRE
25030 This driver supports the built-in serial ports of the Motorola ColdFire
25033 +config SERIAL_COLDFIRE_IRDA
25034 + bool "ColdFire IRDA support"
25035 + depends on SERIAL_COLDFIRE
25037 + This driver supports IRDA on the Motorola ColdFire.
25040 bool "Coldfire serial support (new style driver)"
25041 depends on COLDFIRE
25042 --- a/drivers/serial/mcfserial.c
25043 +++ b/drivers/serial/mcfserial.c
25045 #include <asm/coldfire.h>
25046 #include <asm/mcfsim.h>
25047 #include <asm/mcfuart.h>
25048 +#if defined(CONFIG_M547X_8X)
25049 +#include <asm/m5485sim.h>
25050 +#include <asm/m5485psc.h>
25051 +#include <asm/m5485gpio.h>
25053 +#ifdef CONFIG_NETtel
25054 #include <asm/nettel.h>
25056 #include <asm/uaccess.h>
25057 #include "mcfserial.h"
25059 @@ -61,7 +68,8 @@ struct timer_list mcfrs_timer_struct;
25060 #define CONSOLE_BAUD_RATE 38400
25061 #define DEFAULT_CBAUD B38400
25062 #elif defined(CONFIG_MOD5272) || defined(CONFIG_M5208EVB) || \
25063 - defined(CONFIG_M5329EVB) || defined(CONFIG_GILBARCO)
25064 + defined(CONFIG_M5329EVB) || defined(CONFIG_GILBARCO) || \
25065 + defined(CONFIG_M5445X) || defined(CONFIG_M547X_8X)
25066 #define CONSOLE_BAUD_RATE 115200
25067 #define DEFAULT_CBAUD B115200
25068 #elif defined(CONFIG_ARNEWSH) || defined(CONFIG_FREESCALE) || \
25069 @@ -94,12 +102,17 @@ static struct tty_driver *mcfrs_serial_d
25070 #undef SERIAL_DEBUG_FLOW
25072 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
25073 - defined(CONFIG_M520x) || defined(CONFIG_M532x)
25074 + defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_M5445X) || \
25075 + defined(CONFIG_M547X_8X)
25076 #define IRQBASE (MCFINT_VECBASE+MCFINT_UART0)
25081 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25082 +#define SERIAL_IRDA_LINE (2)
25086 * Configuration table, UARTs to look for at startup.
25088 @@ -114,7 +127,11 @@ static struct mcf_serial mcfrs_table[] =
25091 .addr = (volatile unsigned char *) (MCF_MBAR+MCFUART_BASE2),
25092 +#if defined(CONFIG_M547X_8X)
25093 + .irq = IRQBASE-1,
25097 .flags = ASYNC_BOOT_AUTOCONF,
25100 @@ -122,7 +139,11 @@ static struct mcf_serial mcfrs_table[] =
25103 .addr = (volatile unsigned char *) (MCF_MBAR+MCFUART_BASE3),
25104 +#if defined(CONFIG_M547X_8X)
25105 + .irq = IRQBASE-2,
25109 .flags = ASYNC_BOOT_AUTOCONF,
25112 @@ -130,7 +151,11 @@ static struct mcf_serial mcfrs_table[] =
25115 .addr = (volatile unsigned char *) (MCF_MBAR+MCFUART_BASE4),
25116 +#if defined(CONFIG_M547X_8X)
25117 + .irq = IRQBASE-3,
25121 .flags = ASYNC_BOOT_AUTOCONF,
25124 @@ -372,6 +397,9 @@ static inline void receive_chars(struct
25125 static inline void transmit_chars(struct mcf_serial *info)
25127 volatile unsigned char *uartp;
25128 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25132 uartp = info->addr;
25134 @@ -383,13 +411,36 @@ static inline void transmit_chars(struct
25137 if ((info->xmit_cnt <= 0) || info->tty->stopped) {
25138 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25139 + if (info->line == SERIAL_IRDA_LINE) {
25140 + /* Enable receiver for IRDA */
25141 + uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETRX;
25143 + uartp[MCFUART_UCR] = MCFUART_UCR_TXENABLE | MCFUART_UCR_RXENABLE;
25146 info->imr &= ~MCFUART_UIR_TXREADY;
25147 uartp[MCFUART_UIMR] = info->imr;
25151 while (uartp[MCFUART_USR] & MCFUART_USR_TXREADY) {
25152 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25153 + if (info->line == SERIAL_IRDA_LINE) {
25154 + while (!(uartp[MCFUART_USR] & MCFUART_USR_TXEMPTY));
25156 + /* delay for settle */
25157 +#if defined(CONFIG_M548X)
25159 +#elif defined(CONFIG_M547X)
25162 + while (i++ < 25000) udelay(1);
25166 uartp[MCFUART_UTB] = info->xmit_buf[info->xmit_tail++];
25168 info->xmit_tail = info->xmit_tail & (SERIAL_XMIT_SIZE-1);
25170 if (--info->xmit_cnt <= 0)
25171 @@ -409,7 +460,12 @@ irqreturn_t mcfrs_interrupt(int irq, voi
25172 struct mcf_serial *info;
25175 +/* JKM -- revisit! IRQ compute */
25176 +#if defined(CONFIG_M547X_8X)
25177 + info = &mcfrs_table[(IRQBASE - irq)];
25179 info = &mcfrs_table[(irq - IRQBASE)];
25181 isr = info->addr[MCFUART_UISR] & info->imr;
25183 if (isr & MCFUART_UIR_RXREADY)
25184 @@ -541,6 +597,28 @@ static int startup(struct mcf_serial * i
25186 mcfrs_change_speed(info);
25188 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25189 + if (info->line == SERIAL_IRDA_LINE) {
25190 + /* Put PSC in IrDA mode */
25191 + MCF_PSC_SICR(info->line) = MCF_PSC_SICR_SIM_SIR;
25193 + /* Set pulse width to 1.6 uS */
25194 + MCF_PSC_IRSDR(info->line) = (uint8_t)
25195 + (16 * (CONFIG_MCFCLK / 10000000));
25196 + MCF_PSC_IRCR1(info->line) = MCF_PSC_IRCR1_SPUL;
25197 + MCF_PSC_IRCR2(info->line) = 0;
25199 + /* Enable RTS to send */
25200 + MCF_PSC_OPSET(info->line) = MCF_PSC_OPSET_RTS;
25202 + /* Setup FIFO Alarms */
25203 + MCF_PSC_RFAR(info->line) = MCF_PSC_RFAR_ALARM(248);
25204 + MCF_PSC_TFAR(info->line) = MCF_PSC_TFAR_ALARM(248);
25206 + MCF_PSC_RFCR(info->line) = MCF_PSC_RFCR_FRMEN | MCF_PSC_RFCR_GR(4);
25207 + MCF_PSC_TFCR(info->line) = MCF_PSC_TFCR_FRMEN | MCF_PSC_RFCR_GR(4);
25211 * Lastly enable the UART transmitter and receiver, and
25212 * interrupt enables.
25213 @@ -562,10 +640,20 @@ static void shutdown(struct mcf_serial *
25215 volatile unsigned char *uartp;
25216 unsigned long flags;
25217 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25218 + unsigned long delay_counter = 0;
25221 if (!(info->flags & ASYNC_INITIALIZED))
25224 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25225 + uartp = (volatile unsigned char *) info->addr;
25226 + while (!(uartp[MCFUART_USR] & MCFUART_USR_TXEMPTY)) {
25227 + if(delay_counter++ > 25000)
25232 #ifdef SERIAL_DEBUG_OPEN
25233 printk("Shutting down serial port %d (irq %d)....\n", info->line,
25235 @@ -794,10 +882,19 @@ static int mcfrs_write(struct tty_struct
25237 local_irq_disable();
25238 uartp = info->addr;
25240 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25241 + if (info->line == SERIAL_IRDA_LINE) {
25242 + /* Disable IRDA receiver*/
25243 + uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETRX; /* reset RX */
25244 + uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETTX; /* reset TX */
25246 + uartp[MCFUART_UCR] = MCFUART_UCR_TXENABLE;
25249 info->imr |= MCFUART_UIR_TXREADY;
25250 uartp[MCFUART_UIMR] = info->imr;
25251 local_irq_restore(flags);
25256 @@ -858,9 +955,21 @@ static void mcfrs_throttle(struct tty_st
25258 if (serial_paranoia_check(info, tty->name, "mcfrs_throttle"))
25261 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25262 + if (I_IXOFF(tty)) {
25263 + /* Force STOP_CHAR (xoff) out */
25264 + volatile unsigned char *uartp;
25265 + unsigned long flags;
25266 + uartp = (volatile unsigned char *) info->addr;
25267 + local_irq_save(flags);
25268 + info->imr |= MCFUART_UIR_TXREADY;
25269 + uartp[MCFUART_UIMR] = info->imr;
25270 + local_irq_restore(flags);
25274 info->x_char = STOP_CHAR(tty);
25277 /* Turn off RTS line (do this atomic) */
25279 @@ -881,8 +990,22 @@ static void mcfrs_unthrottle(struct tty_
25280 if (I_IXOFF(tty)) {
25283 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25285 + /* Force START_CHAR (xon) out */
25286 + volatile unsigned char *uartp;
25287 + unsigned long flags;
25288 + info->x_char = START_CHAR(tty);
25289 + uartp = (volatile unsigned char *) info->addr;
25290 + local_irq_save(flags);
25291 + info->imr |= MCFUART_UIR_TXREADY;
25292 + uartp[MCFUART_UIMR] = info->imr;
25293 + local_irq_restore(flags);
25297 info->x_char = START_CHAR(tty);
25301 /* Assert RTS line (do this atomic) */
25302 @@ -1130,12 +1253,17 @@ static int mcfrs_ioctl(struct tty_struct
25303 static void mcfrs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
25305 struct mcf_serial *info = (struct mcf_serial *)tty->driver_data;
25306 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25307 + int i = 0; /* hush GCC */
25310 if (tty->termios->c_cflag == old_termios->c_cflag)
25313 +#ifdef CONFIG_SERIAL_COLDFIRE_IRDA
25314 + while (i++ < 35000) udelay(1);
25316 mcfrs_change_speed(info);
25318 if ((old_termios->c_cflag & CRTSCTS) &&
25319 !(tty->termios->c_cflag & CRTSCTS)) {
25320 tty->hw_stopped = 0;
25321 @@ -1604,6 +1732,36 @@ static void mcfrs_irqinit(struct mcf_ser
25322 /* GPIOs also must be initalized, depends on board */
25325 +#elif defined(CONFIG_M5445X)
25326 + volatile unsigned char *uartp;
25327 + uartp = info->addr;
25328 + switch (info->line) {
25330 + MCF_GPIO_PAR_UART |= 0x000F;
25333 + MCF_GPIO_PAR_UART |= 0x0FF0;
25336 + /* GPIOs also must be initalized, depends on board */
25339 +#elif defined(CONFIG_M547X_8X)
25340 + volatile unsigned char *uartp;
25341 + uartp = (volatile unsigned char *)info->addr;
25343 + if (info->line > 3) {
25344 + printk("SERIAL: don't know how to handle UART %d interrupt?\n",
25349 + /* Set GPIO port register to enable PSC(port) signals */
25350 + MCF_PAR_PSCn(info->line) = (0
25351 + | MCF_PAR_PSC_TXD
25352 + | MCF_PAR_PSC_RXD);
25354 + MCF_ICR(info->irq - 64) = ILP_PSCn(info->line);
25356 volatile unsigned char *icrp, *uartp;
25358 @@ -1966,7 +2124,9 @@ struct console mcfrs_console = {
25360 static int __init mcfrs_console_init(void)
25362 +#if !(defined(CONFIG_M5445X) || defined(CONFIG_M547X_8X))
25363 register_console(&mcfrs_console);
25369 +++ b/drivers/spi/coldfire_edma.c
25373 + * coldfire_edma.c - eDMA driver for Coldfire MCF5445x
25375 + * Yaroslav Vinogradov yaroslav.vinogradov@freescale.com
25377 + * Copyright Freescale Semiconductor, Inc. 2007
25379 + * This program is free software; you can redistribute it and/or modify it
25380 + * under the terms of the GNU General Public License as published by the
25381 + * Free Software Foundation; either version 2 of the License, or (at your
25382 + * option) any later version.
25385 +#include <linux/init.h>
25386 +#include <linux/module.h>
25387 +#include <asm/virtconvert.h>
25388 +#include <asm/coldfire.h>
25389 +#include <linux/fs.h>
25390 +#include <linux/cdev.h>
25391 +#include <linux/seq_file.h>
25392 +#include <linux/proc_fs.h>
25393 +#ifdef CONFIG_M5445X
25394 +#include <asm/mcf5445x_edma.h>
25395 +#include <asm/mcf5445x_intc.h>
25396 +#endif /* CONFIG_M5445X */
25397 +#include <asm/coldfire_edma.h>
25400 + * Callback handler data for each TCD
25402 +struct edma_isr_record {
25403 + edma_irq_handler irq_handler; /* interrupt handler */
25404 + edma_error_handler error_handler; /* error interrupt handler */
25405 + void *arg; /* argument to pass back */
25406 + int allocated; /* busy flag */
25407 + spinlock_t *lock; /* spin lock (optional) */
25408 + const char *device_id; /* dev id string, used in procfs */
25412 + * Device structure
25414 +struct coldfire_edma_dev {
25415 + struct cdev cdev; /* character device */
25416 + struct edma_isr_record dma_interrupt_handlers[EDMA_CHANNELS];
25419 +/* allocated major device number */
25420 +static int coldfire_dma_major;
25422 +/* device driver structure */
25423 +static struct coldfire_edma_dev *devp = NULL;
25425 +/* device driver file operations */
25426 +struct file_operations coldfire_edma_fops = {
25427 + .owner = THIS_MODULE,
25431 + * dmaisr - eDMA channel interrupt handler
25432 + * @irq: interrupt number
25433 + * @dev_id: argument
25435 +static int dmaisr(int irq, void *dev_id)
25437 + int channel = irq - EDMA_INT_CONTROLLER_BASE - EDMA_INT_CHANNEL_BASE;
25438 + int result = IRQ_HANDLED;
25440 + if ((devp != NULL) &&
25441 + (devp->dma_interrupt_handlers[channel].irq_handler)) {
25442 + /* call user irq handler */
25443 + if (devp->dma_interrupt_handlers[channel].lock)
25444 + spin_lock(devp->dma_interrupt_handlers[channel].lock);
25446 + result = devp->dma_interrupt_handlers[channel].irq_handler(
25447 + channel, devp->dma_interrupt_handlers[channel].arg);
25449 + if (devp->dma_interrupt_handlers[channel].lock)
25450 + spin_unlock(devp->dma_interrupt_handlers[channel].lock);
25452 + /* no irq handler so just ack it */
25453 + confirm_edma_interrupt_handled(channel);
25454 + printk(EDMA_DRIVER_NAME ": No handler for DMA channel %d\n",
25462 + * dma_error_isr - eDMA error interrupt handler
25463 + * @irq: interrupt number
25464 + * @dev_id: argument
25466 +static int dma_error_isr(int irq, void* dev_id)
25471 + err = MCF_EDMA_ERR;
25472 + for (i=0; i<EDMA_CHANNELS; i++) {
25473 + if (err & (1<<i)) {
25474 + if (devp!=NULL && devp->dma_interrupt_handlers[i].error_handler)
25475 + devp->dma_interrupt_handlers[i].error_handler(i, devp->dma_interrupt_handlers[i].arg);
25477 + printk(KERN_WARNING EDMA_DRIVER_NAME ": DMA error on channel %d\n", i);
25481 + MCF_EDMA_CERR = MCF_EDMA_CERR_CAER;
25482 + return IRQ_HANDLED;
25486 + * set_edma_params - Set transfer control descriptor (TCD)
25487 + * @channel: channel number
25488 + * @source: source address
25489 + * @dest: destination address
25490 + * @attr: attributes
25491 + * @soff: source offset
25492 + * @nbytes: number of bytes to be transfered in minor loop
25493 + * @slast: last source address adjustment
25494 + * @citer: major loop count
25495 + * @biter: beginning minor loop count
25496 + * @doff: destination offset
25497 + * @dlast_sga: last destination address adjustment
25498 + * @major_int: generate interrupt after each major loop
25499 + * @disable_req: disable DMA request after major loop
25501 +void set_edma_params(int channel, u32 source, u32 dest,
25502 + u32 attr, u32 soff, u32 nbytes, u32 slast,
25503 + u32 citer, u32 biter, u32 doff, u32 dlast_sga,
25504 + int major_int, int disable_req)
25507 + if (channel<0 || channel>EDMA_CHANNELS)
25510 + MCF_EDMA_TCD_SADDR(channel) = source;
25511 + MCF_EDMA_TCD_DADDR(channel) = dest;
25512 + MCF_EDMA_TCD_ATTR(channel) = attr;
25513 + MCF_EDMA_TCD_SOFF(channel) = MCF_EDMA_TCD_SOFF_SOFF(soff);
25514 + MCF_EDMA_TCD_NBYTES(channel) = MCF_EDMA_TCD_NBYTES_NBYTES(nbytes);
25515 + MCF_EDMA_TCD_SLAST(channel) = MCF_EDMA_TCD_SLAST_SLAST(slast);
25516 + MCF_EDMA_TCD_CITER(channel) = MCF_EDMA_TCD_CITER_CITER(citer);
25517 + MCF_EDMA_TCD_BITER(channel)=MCF_EDMA_TCD_BITER_BITER(biter);
25518 + MCF_EDMA_TCD_DOFF(channel) = MCF_EDMA_TCD_DOFF_DOFF(doff);
25519 + MCF_EDMA_TCD_DLAST_SGA(channel) = MCF_EDMA_TCD_DLAST_SGA_DLAST_SGA(dlast_sga);
25521 + /* interrupt at the end of major loop */
25523 + MCF_EDMA_TCD_CSR(channel) |= MCF_EDMA_TCD_CSR_INT_MAJOR;
25525 + MCF_EDMA_TCD_CSR(channel) &= ~MCF_EDMA_TCD_CSR_INT_MAJOR;
25527 + /* disable request at the end of major loop of transfer or not*/
25529 + MCF_EDMA_TCD_CSR(channel) |= MCF_EDMA_TCD_CSR_D_REQ;
25531 + MCF_EDMA_TCD_CSR(channel) &= ~MCF_EDMA_TCD_CSR_D_REQ;
25533 +EXPORT_SYMBOL(set_edma_params);
25536 + * init_edma - Initialize the eDMA controller
25538 +void init_edma(void)
25542 +EXPORT_SYMBOL(init_edma);
25545 + * request_edma_channel - Request an eDMA channel
25546 + * @channel: channel number
25547 + * @handler: dma handler
25548 + * @error_handler: dma error handler
25549 + * @arg: argument to pass back
25550 + * @lock: optional spinlock to hold over interrupt
25551 + * @device_id: device id
25553 + * Returns 0 if success or a negative value if failure
25555 +int request_edma_channel(int channel,
25556 + edma_irq_handler handler,
25557 + edma_error_handler error_handler,
25559 + spinlock_t *lock,
25560 + const char *device_id )
25562 + if (devp!=NULL && channel>=0 && channel<=EDMA_CHANNELS) {
25563 + if (devp->dma_interrupt_handlers[channel].allocated)
25566 + devp->dma_interrupt_handlers[channel].allocated = 1;
25567 + devp->dma_interrupt_handlers[channel].irq_handler = handler;
25568 + devp->dma_interrupt_handlers[channel].error_handler = error_handler;
25569 + devp->dma_interrupt_handlers[channel].arg = arg;
25570 + devp->dma_interrupt_handlers[channel].lock = lock;
25571 + devp->dma_interrupt_handlers[channel].device_id = device_id;
25576 +EXPORT_SYMBOL(request_edma_channel);
25579 + * set_edma_callback - Update the channel callback/arg
25580 + * @channel: channel number
25581 + * @handler: dma handler
25582 + * @error_handler: dma error handler
25583 + * @arg: argument to pass back
25585 + * Returns 0 if success or a negative value if failure
25587 +int set_edma_callback(int channel,
25588 + edma_irq_handler handler,
25589 + edma_error_handler error_handler,
25592 + if (devp!=NULL && channel>=0 && channel<=EDMA_CHANNELS &&
25593 + devp->dma_interrupt_handlers[channel].allocated) {
25594 + devp->dma_interrupt_handlers[channel].irq_handler = handler;
25595 + devp->dma_interrupt_handlers[channel].error_handler = error_handler;
25596 + devp->dma_interrupt_handlers[channel].arg = arg;
25601 +EXPORT_SYMBOL(set_edma_callback);
25604 + * free_edma_channel - Free the edma channel
25605 + * @channel: channel number
25606 + * @arg: argument created with
25608 + * Returns 0 if success or a negative value if failure
25610 +int free_edma_channel(int channel, void *arg)
25612 + if (devp!=NULL && channel>=0 && channel<=EDMA_CHANNELS) {
25613 + if (devp->dma_interrupt_handlers[channel].allocated) {
25615 + if (devp->dma_interrupt_handlers[channel].arg != arg)
25619 + devp->dma_interrupt_handlers[channel].allocated = 0;
25620 + devp->dma_interrupt_handlers[channel].arg = NULL;
25621 + devp->dma_interrupt_handlers[channel].irq_handler = NULL;
25622 + devp->dma_interrupt_handlers[channel].error_handler = NULL;
25623 + devp->dma_interrupt_handlers[channel].lock = NULL;
25629 +EXPORT_SYMBOL(free_edma_channel);
25632 + * coldfire_edma_cleanup - cleanup driver allocated resources
25634 +static void coldfire_edma_cleanup(void)
25639 + /* free interrupts/memory */
25641 + for (i=0; i<EDMA_CHANNELS; i++)
25642 + free_irq(EDMA_INT_BASE+i, devp);
25644 + free_irq(EDMA_INT_BASE+EDMA_INT_ERR, devp);
25645 + cdev_del(&devp->cdev);
25649 + /* unregister character device */
25650 + devno = MKDEV(coldfire_dma_major, 0);
25651 + unregister_chrdev_region(devno, 1);
25654 +#ifdef CONFIG_PROC_FS
25656 + * proc file system support
25659 +#define FREE_CHANNEL "free"
25660 +#define DEVICE_UNKNOWN "device unknown"
25663 + * proc_edma_show - print out proc info
25667 +static int proc_edma_show(struct seq_file *m, void *v)
25671 + if (devp == NULL)
25674 + for (i = 0 ; i < EDMA_CHANNELS ; i++) {
25675 + if (devp->dma_interrupt_handlers[i].allocated) {
25676 + if (devp->dma_interrupt_handlers[i].device_id)
25677 + seq_printf(m, "%2d: %s\n", i, devp->dma_interrupt_handlers[i].device_id);
25679 + seq_printf(m, "%2d: %s\n", i, DEVICE_UNKNOWN);
25681 + seq_printf(m, "%2d: %s\n", i, FREE_CHANNEL);
25687 + * proc_edma_open - open the proc file
25688 + * @inode: inode ptr
25689 + * @file: file ptr
25691 +static int proc_edma_open(struct inode *inode, struct file *file)
25693 + return single_open(file, proc_edma_show, NULL);
25696 +static const struct file_operations proc_edma_operations = {
25697 + .open = proc_edma_open,
25698 + .read = seq_read,
25699 + .llseek = seq_lseek,
25700 + .release = single_release,
25704 + * proc_edma_init - initialize proc filesystem
25706 +static int __init proc_edma_init(void)
25708 + struct proc_dir_entry *e;
25710 + e = create_proc_entry("edma", 0, NULL);
25712 + e->proc_fops = &proc_edma_operations;
25720 + * coldfire_edma_init - eDMA module init
25722 +static int __init coldfire_edma_init(void)
25728 + /* allocate free major number */
25729 + result = alloc_chrdev_region(&dev, DMA_DEV_MINOR, 1, EDMA_DRIVER_NAME);
25730 + if (result < 0) {
25731 + printk(KERN_WARNING EDMA_DRIVER_NAME": can't get major %d\n",
25735 + coldfire_dma_major = MAJOR(dev);
25737 + /* allocate device driver structure */
25738 + devp = kmalloc(sizeof(struct coldfire_edma_dev), GFP_KERNEL);
25740 + result = -ENOMEM;
25744 + /* init handlers (no handlers for beginning) */
25745 + for (i = 0; i < EDMA_CHANNELS; i++) {
25746 + devp->dma_interrupt_handlers[i].irq_handler = NULL;
25747 + devp->dma_interrupt_handlers[i].error_handler = NULL;
25748 + devp->dma_interrupt_handlers[i].arg = NULL;
25749 + devp->dma_interrupt_handlers[i].allocated = 0;
25750 + devp->dma_interrupt_handlers[i].lock = NULL;
25751 + devp->dma_interrupt_handlers[i].device_id = NULL;
25754 + /* register char device */
25755 + cdev_init(&devp->cdev, &coldfire_edma_fops);
25756 + devp->cdev.owner = THIS_MODULE;
25757 + devp->cdev.ops = &coldfire_edma_fops;
25758 + result = cdev_add(&devp->cdev, dev, 1);
25760 + printk(KERN_NOTICE EDMA_DRIVER_NAME
25761 + ": Error %d adding coldfire-dma device\n", result);
25762 + result = -ENODEV;
25766 + /* request/enable irq for each eDMA channel */
25767 + for (i = 0; i < EDMA_CHANNELS;i++) {
25768 + result = request_irq(EDMA_INT_BASE + i,
25769 + dmaisr, IRQF_DISABLED,
25770 + EDMA_DRIVER_NAME, devp);
25772 + printk(KERN_WARNING EDMA_DRIVER_NAME
25773 + ": Cannot request irq %d\n",
25774 + (EDMA_INT_BASE + EDMA_INT_ERR+i));
25780 + /* request error interrupt */
25781 + result = request_irq(EDMA_INT_BASE + EDMA_INT_ERR,
25782 + dma_error_isr, IRQF_DISABLED,
25783 + EDMA_DRIVER_NAME, devp);
25785 + printk(KERN_WARNING EDMA_DRIVER_NAME
25786 + ": Cannot request irq %d\n",
25787 + (EDMA_INT_BASE + EDMA_INT_ERR));
25792 +#ifdef CONFIG_PROC_FS
25793 + proc_edma_init();
25796 + printk(EDMA_DRIVER_NAME ": initialized successfully\n");
25799 + coldfire_edma_cleanup();
25804 + * coldfire_edma_exit - eDMA module exit
25806 +static void __exit coldfire_edma_exit(void)
25808 + coldfire_edma_cleanup();
25811 +module_init(coldfire_edma_init);
25812 +module_exit(coldfire_edma_exit);
25814 +MODULE_LICENSE("GPL");
25815 +MODULE_AUTHOR("Freescale Semiconductor, Inc.");
25816 +MODULE_DESCRIPTION("eDMA library for Coldfire M5445x");
25818 +++ b/drivers/spi/dspi_mcf.c
25821 + * dspi_mcf.c - DSPI controller for ColdFire processors
25824 + * Matt Waddel Matt.Waddel@freescale.com
25825 + * Copyright Freescale Semiconductor, Inc. 2008
25827 + * M547x/M548x changes by Kurt Mahan kmahan@freescale.com
25828 + * Copyright Freescale Semiconductor, Inc. 2008
25830 + * Based on spi_coldfire.c done by:
25832 + * Yaroslav Vinogradov
25833 + * Copyright Freescale Semiconductor, Inc. 2006-2007
25834 + * Mike Lavender (mike@steroidmicros)
25835 + * (C) Copyright 2005, Intec Automation,
25837 + * This program is free software; you can redistribute it and/or modify it
25838 + * under the terms of the GNU General Public License as published by the
25839 + * Free Software Foundation; either version 2 of the License, or (at your
25840 + * option) any later version.
25842 + * This program is distributed in the hope that it will be useful,
25843 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25844 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25845 + * GNU General Public License for more details.
25847 + * You should have received a copy of the GNU General Public License
25848 + * along with this program; if not, write to the Free Software
25849 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25851 + ***************************************************************************
25853 + * v0.002 M547x/M548x support.
25854 + * v0.001 Initial version. Coldfire DSPI master driver.
25855 + ****************************************************************************/
25861 +#include <linux/autoconf.h>
25862 +#include <linux/init.h>
25863 +#include <linux/module.h>
25864 +#include <linux/device.h>
25865 +#include <linux/interrupt.h>
25866 +#include <linux/platform_device.h>
25867 +#include <linux/spi/spi.h>
25868 +#include <linux/workqueue.h>
25869 +#include <linux/delay.h>
25870 +#include <asm/mcfsim.h>
25871 +#include <asm/mcfqspi.h>
25872 +#include <asm/coldfire.h>
25873 +#include <linux/io.h>
25874 +#include <asm/mcfdspi.h>
25875 +#include <linux/dma-mapping.h>
25877 +#undef DSPI_COLDFIRE_DEBUG
25879 +#ifdef DSPI_COLDFIRE_DEBUG
25880 +#define DBG(fmt, args...) \
25881 + printk(KERN_INFO "[%s] " fmt , __FUNCTION__, ## args)
25883 +#define DBG(fmt, args...) do {} while (0)
25886 +#if defined(CONFIG_M54455)
25887 +#include <asm/mcf5445x_dspi.h>
25888 +#if defined(CONFIG_SPI_COLDFIRE_DSPI_EDMA)
25889 + #include <asm/mcf5445x_edma.h>
25893 +#if defined(CONFIG_M547X_8X)
25894 +#include <asm/virtconvert.h>
25895 +#include <asm/m5485dspi.h>
25898 +#if defined(CONFIG_SPI_COLDFIRE_DSPI_EDMA)
25899 +#include <asm/mcf_edma.h>
25900 +#define SPI_DSPI_EDMA
25901 +#define EDMA_BUFSIZE_KMALLOC (DSPI_FIFO_SIZE*4)
25902 +#define DSPI_DMA_RX_TCD MCF_EDMA_CHAN_DSPI_RX
25903 +#define DSPI_DMA_TX_TCD MCF_EDMA_CHAN_DSPI_TX
25906 +#define DSPI_BITS MCF_DSPI_DCTAR_FMSZ(0xF)
25907 +#define DSPI_BITS_16 MCF_DSPI_DCTAR_FMSZ(0xF)
25908 +#define DSPI_BITS_8 MCF_DSPI_DCTAR_FMSZ(0x7)
25909 +#define DSPI_FIFO_SIZE 16
25911 +#define DRIVER_NAME "Coldfire DSPI"
25913 +/****************************************************************************/
25916 + * Local constants and macros
25919 +#define START_STATE ((void *)0)
25920 +#define RUNNING_STATE ((void *)1)
25921 +#define DONE_STATE ((void *)2)
25922 +#define ERROR_STATE ((void *)-1)
25924 +#define QUEUE_RUNNING 0
25925 +#define QUEUE_STOPPED 1
25927 +/****************************************************************************/
25930 + * Local Data Structures
25934 + unsigned master:1;
25935 + unsigned cont_scke:1;
25936 + unsigned dconf:2;
25939 + unsigned pcsse:1;
25941 + unsigned pcsis:8;
25942 + unsigned reserved15:1;
25944 + unsigned dis_tx:1;
25945 + unsigned dis_rxf:1;
25946 + unsigned clr_tx:1;
25947 + unsigned clr_rxf:1;
25948 + unsigned smpl_pt:2;
25949 + unsigned reserved71:7;
25953 +struct DSPI_CTAR {
25958 + unsigned lsbfe:1;
25959 + unsigned pcssck:2;
25963 + unsigned cssck:4;
25969 +struct chip_data {
25973 + struct DSPI_MCR mcr;
25977 + struct DSPI_CTAR ctar;
25979 + u16 void_write_data;
25983 +struct driver_data {
25984 + /* Driver model hookup */
25985 + struct platform_device *pdev;
25987 + /* SPI framework hookup */
25988 + struct spi_master *master;
25990 + /* Driver message queue */
25991 + struct workqueue_struct *workqueue;
25992 + struct work_struct pump_messages;
25993 + spinlock_t lock; /* lock */
25994 + struct list_head queue;
25998 + /* Message Transfer pump */
25999 + struct tasklet_struct pump_transfers;
26001 + /* Current message transfer state info */
26002 + struct spi_message *cur_msg;
26003 + struct spi_transfer *cur_transfer;
26004 + struct chip_data *cur_chip;
26011 +#define TRAN_STATE_RX_VOID 0x01
26012 +#define TRAN_STATE_TX_VOID 0x02
26013 +#define TRAN_STATE_WORD_ODD_NUM 0x04
26015 + u16 void_write_data;
26016 + unsigned cs_change:1;
26021 + u32 *mcr; /* DSPI MCR register */
26022 + u32 *ctar; /* DSPI CTAR register */
26023 + u32 *dspi_dtfr; /* DSPI DTFR register */
26024 + u32 *dspi_drfr; /* DSPI DRFR register */
26025 + u32 *dspi_rser; /* DSPI RSER register */
26026 + u32 *dspi_sr; /* DSPI status register */
26028 +#if defined(SPI_DSPI_EDMA)
26029 + void *edma_tx_buf;
26030 + void *edma_rx_buf;
26033 +#if defined(CONFIG_M532x) || defined(CONFIG_M537x)
26034 + u16 *par; /* Pin assignment register */
26036 + u8 *par; /* Pin assignment register */
26038 + u8 *int_icr; /* Interrupt level and priority register */
26039 + u32 *int_mr; /* Interrupt mask register */
26040 + void (*cs_control)(u8 cs, u8 command);
26043 +#define DSPI_CS(cs) ((1<<(cs))<<16)
26045 +/****************************************************************************/
26048 + * SPI local functions
26051 +static void *next_transfer(struct driver_data *drv_data)
26053 + struct spi_message *msg = drv_data->cur_msg;
26054 + struct spi_transfer *trans = drv_data->cur_transfer;
26057 + /* Move to next transfer */
26058 + if (trans->transfer_list.next != &msg->transfers) {
26059 + drv_data->cur_transfer = list_entry(trans->transfer_list.next,
26060 + struct spi_transfer,
26063 + if (drv_data->cur_transfer->transfer_list.next
26064 + == &msg->transfers) /* last transfer */
26065 + drv_data->cur_transfer->cs_change = 1;
26067 + return RUNNING_STATE;
26069 + return DONE_STATE;
26073 +static inline int is_word_transfer(struct driver_data *drv_data)
26075 + return ((*(drv_data->ctar+drv_data->cs) & DSPI_BITS_16) ==
26076 + DSPI_BITS_8) ? 0 : 1;
26079 +static inline void set_8bit_transfer_mode(struct driver_data *drv_data)
26082 + *(drv_data->ctar+drv_data->cs) =
26083 + (*(drv_data->ctar + drv_data->cs) & ~DSPI_BITS) | DSPI_BITS_8;
26086 +static inline void set_16bit_transfer_mode(struct driver_data *drv_data)
26089 + *(drv_data->ctar+drv_data->cs) =
26090 + (*(drv_data->ctar + drv_data->cs) & ~DSPI_BITS) | DSPI_BITS_16;
26093 +static unsigned char hz_to_spi_baud(int pbr, int dbr, int speed_hz)
26095 + int pbr_tbl[4] = {2, 3, 5, 7}; /* Valid baud rate pre-scaler values */
26096 + int brs[16] = { 2, 4, 6, 8,
26098 + 256, 512, 1024, 2048,
26099 + 4096, 8192, 16384, 32768 };
26100 + int temp, index = 0;
26102 + if ((pbr < 0) || (pbr > 3) ||
26103 + (dbr < 0) || (dbr > 1))
26104 + return 15; /* table indexes out of range, go slow */
26106 + temp = ((((MCF_CLK / 2) / pbr_tbl[pbr]) * (1 + dbr)) / speed_hz);
26108 + while (temp >= brs[index])
26109 + if (index++ >= 15)
26112 + DBG("baud rate scaler = 0x%x - %d\n", index, brs[index]);
26116 +static int write(struct driver_data *drv_data)
26118 + int tx_count = 0;
26119 + int tx_word = is_word_transfer(drv_data);
26122 + u32 dspi_pushr = 0;
26124 +#if defined(SPI_DSPI_EDMA)
26125 + u32 *edma_wr = (u32 *)(drv_data->edma_tx_buf);
26128 + /* If we are in word mode, but only have a single byte to transfer
26129 + * then switch to byte mode temporarily. Will switch back at the
26130 + * end of the transfer. */
26131 + if (tx_word && ((drv_data->tx_end - drv_data->tx) == 1)) {
26132 + drv_data->flags |= TRAN_STATE_WORD_ODD_NUM;
26133 + set_8bit_transfer_mode(drv_data);
26137 + while ((drv_data->tx < drv_data->tx_end) && (tx_count < DSPI_FIFO_SIZE)) {
26138 +// DBG("while\n");
26140 + if ((drv_data->tx_end - drv_data->tx) == 1)
26143 + if (!(drv_data->flags & TRAN_STATE_TX_VOID))
26144 + d16 = *(u16 *)drv_data->tx;
26146 + d16 = drv_data->void_write_data;
26148 + dspi_pushr = MCF_DSPI_DTFR_TXDATA(d16) |
26149 + DSPI_CS(drv_data->cs) |
26150 + MCF_DSPI_DTFR_CTAS(drv_data->cs) |
26151 + MCF_DSPI_DTFR_CONT;
26153 + drv_data->tx += 2;
26155 + if (!(drv_data->flags & TRAN_STATE_TX_VOID))
26156 + d8 = *(u8 *)drv_data->tx;
26158 + d8 = *(u8 *)&drv_data->void_write_data;
26160 + dspi_pushr = MCF_DSPI_DTFR_TXDATA(d8) |
26161 + DSPI_CS(drv_data->cs) |
26162 + MCF_DSPI_DTFR_CTAS(drv_data->cs) |
26163 + MCF_DSPI_DTFR_CONT;
26168 + if (drv_data->tx == drv_data->tx_end
26169 + || tx_count == DSPI_FIFO_SIZE-1) {
26170 + /* last transfer in the queue */
26171 + dspi_pushr |= MCF_DSPI_DTFR_EOQ;
26172 + if ((drv_data->cs_change)
26173 + && (drv_data->tx == drv_data->tx_end))
26174 + dspi_pushr &= ~MCF_DSPI_DTFR_CONT;
26175 +#ifdef CONFIG_M547X_8X
26176 + /* EOQ gets missed if we don't delay */
26179 + } else if (tx_word && ((drv_data->tx_end - drv_data->tx) == 1))
26180 + dspi_pushr |= MCF_DSPI_DTFR_EOQ;
26184 + dspi_pushr |= MCF_DSPI_DTFR_CTCNT; /* clear counter */
26186 +#if defined(SPI_DSPI_EDMA)
26187 + *edma_wr = dspi_pushr;
26190 + *drv_data->dspi_dtfr = dspi_pushr;
26195 +#if defined(SPI_DSPI_EDMA)
26196 + if (tx_count > 0) {
26198 + mcf_edma_set_tcd_params(DSPI_DMA_TX_TCD,
26199 + virt_to_phys(drv_data->edma_tx_buf),
26200 + (u32)drv_data->dspi_dtfr,
26201 + MCF_EDMA_TCD_ATTR_SSIZE_32BIT
26202 + | MCF_EDMA_TCD_ATTR_DSIZE_32BIT,
26204 + 4 * tx_count, /* nbytes */
26209 + 0, /* dlastsga */
26210 + 0, /* major_int */
26211 + 1); /* disable_req */
26213 + mcf_edma_set_tcd_params(DSPI_DMA_RX_TCD,
26214 + (u32)drv_data->dspi_drfr,
26215 + virt_to_phys(drv_data->edma_rx_buf),
26216 + MCF_EDMA_TCD_ATTR_SSIZE_32BIT
26217 + | MCF_EDMA_TCD_ATTR_DSIZE_32BIT,
26219 + 4 * tx_count, /* nbytes */
26224 + 0, /* dlastsga */
26225 + 0, /* major_int */
26226 + 1); /* disable_req */
26228 + mcf_edma_start_transfer(DSPI_DMA_TX_TCD);
26231 + return (tx_count * (tx_word + 1));
26234 +static int read(struct driver_data *drv_data)
26236 + int rx_count = 0;
26237 + int rx_word = is_word_transfer(drv_data);
26239 +#if defined(SPI_DSPI_EDMA)
26240 + u32 *rx_edma = (u32 *) drv_data->edma_rx_buf;
26242 + /* receive SPI data */
26243 + mcf_edma_start_transfer(DSPI_DMA_RX_TCD);
26245 + while ((drv_data->rx < drv_data->rx_end)
26246 + && (rx_count < DSPI_FIFO_SIZE)) {
26249 + if ((drv_data->rx_end - drv_data->rx) == 1)
26251 +#if defined(SPI_DSPI_EDMA)
26252 + d = MCF_DSPI_DRFR_RXDATA(*rx_edma);
26255 + d = MCF_DSPI_DRFR_RXDATA(*drv_data->dspi_drfr);
26257 + if (!(drv_data->flags & TRAN_STATE_RX_VOID))
26258 + *(u16 *)drv_data->rx = d;
26259 + drv_data->rx += 2;
26262 +#if defined(SPI_DSPI_EDMA)
26263 + d = MCF_DSPI_DRFR_RXDATA(*rx_edma);
26266 + d = MCF_DSPI_DRFR_RXDATA(*drv_data->dspi_drfr);
26268 + if (!(drv_data->flags & TRAN_STATE_RX_VOID))
26269 + *(u8 *)drv_data->rx = d;
26273 + DBG("rxd=0x%x\n", d);
26279 +static inline void dspi_setup_chip(struct driver_data *drv_data)
26281 + struct chip_data *chip = drv_data->cur_chip;
26284 + *drv_data->mcr = chip->mcr_val;
26285 + *(drv_data->ctar+drv_data->cs) = chip->ctar_val;
26286 + *drv_data->dspi_rser = MCF_DSPI_DRSER_EOQFE;
26289 +#if defined(SPI_DSPI_EDMA)
26290 +static int edma_tx_handler(int channel, void *dev)
26293 + if (channel == DSPI_DMA_TX_TCD)
26294 + mcf_edma_stop_transfer(DSPI_DMA_TX_TCD);
26295 + return IRQ_HANDLED;
26298 +static int edma_rx_handler(int channel, void *dev)
26301 + if (channel == DSPI_DMA_RX_TCD)
26302 + mcf_edma_stop_transfer(DSPI_DMA_RX_TCD);
26303 + return IRQ_HANDLED;
26307 +static irqreturn_t dspi_interrupt(int irq, void *dev_id)
26309 + struct driver_data *drv_data = (struct driver_data *)dev_id;
26310 + struct spi_message *msg = drv_data->cur_msg;
26312 + /* Clear all flags immediately */
26313 + *drv_data->dspi_sr = MCF_DSPI_DSR_EOQF;
26315 + if (!drv_data->cur_msg || !drv_data->cur_msg->state) {
26316 +#if !defined(SPI_DSPI_EDMA)
26317 + u32 irq_status = *drv_data->dspi_sr;
26318 + /* if eDMA is used it happens some time (at least once)*/
26319 + printk(KERN_ERR "Bad message or transfer state handler. \
26320 + IRQ status = %x\n", irq_status);
26327 + * Read the data into the buffer and reload and start
26328 + * queue with new data if not finished. If finished
26329 + * then setup the next transfer
26333 + if (drv_data->rx == drv_data->rx_end) {
26335 + * Finished now - fall through and schedule next
26336 + * transfer tasklet
26338 + if (drv_data->flags & TRAN_STATE_WORD_ODD_NUM)
26339 + set_16bit_transfer_mode(drv_data);
26341 + msg->state = next_transfer(drv_data);
26343 + /* not finished yet - keep going */
26344 + msg->actual_length += write(drv_data);
26345 + return IRQ_HANDLED;
26348 + tasklet_schedule(&drv_data->pump_transfers);
26350 + return IRQ_HANDLED;
26353 +/* caller already set message->status; dma and pio irqs are blocked */
26354 +static void giveback(struct driver_data *drv_data)
26356 + struct spi_transfer *last_transfer;
26357 + unsigned long flags;
26358 + struct spi_message *msg;
26361 + spin_lock_irqsave(&drv_data->lock, flags);
26362 + msg = drv_data->cur_msg;
26363 + drv_data->cur_msg = NULL;
26364 + drv_data->cur_transfer = NULL;
26365 + drv_data->cur_chip = NULL;
26366 + queue_work(drv_data->workqueue, &drv_data->pump_messages);
26367 + spin_unlock_irqrestore(&drv_data->lock, flags);
26369 + last_transfer = list_entry(msg->transfers.prev,
26370 + struct spi_transfer, transfer_list);
26372 + if (!last_transfer->cs_change)
26373 + drv_data->cs_control(drv_data->cs, QSPI_CS_DROP);
26375 + msg->state = NULL;
26376 + if (msg->complete)
26377 + msg->complete(msg->context);
26381 +static void pump_transfers(unsigned long data)
26383 + struct driver_data *drv_data = (struct driver_data *)data;
26384 + struct spi_message *message = NULL;
26385 + struct spi_transfer *transfer = NULL;
26386 + struct spi_transfer *previous = NULL;
26387 + struct chip_data *chip = NULL;
26388 + unsigned long flags;
26390 + /* Get current state information */
26391 + message = drv_data->cur_msg;
26392 + transfer = drv_data->cur_transfer;
26393 + chip = drv_data->cur_chip;
26395 + /* Handle for abort */
26396 + if (message->state == ERROR_STATE) {
26397 + message->status = -EIO;
26398 + giveback(drv_data);
26402 + /* Handle end of message */
26403 + if (message->state == DONE_STATE) {
26404 + message->status = 0;
26405 + giveback(drv_data);
26409 + if (message->state == START_STATE) {
26410 + dspi_setup_chip(drv_data);
26412 + if (drv_data->cs_control)
26413 + drv_data->cs_control(message->spi->chip_select,
26417 + /* Delay if requested at end of transfer*/
26418 + if (message->state == RUNNING_STATE) {
26419 + previous = list_entry(transfer->transfer_list.prev,
26420 + struct spi_transfer,
26423 + if (drv_data->cs_control && transfer->cs_change)
26424 + drv_data->cs_control(message->spi->chip_select,
26427 + if (previous->delay_usecs)
26428 + udelay(previous->delay_usecs);
26430 + if (drv_data->cs_control && transfer->cs_change)
26431 + drv_data->cs_control(message->spi->chip_select,
26435 + drv_data->flags = 0;
26436 + drv_data->tx = (void *)transfer->tx_buf;
26437 + drv_data->tx_end = drv_data->tx + transfer->len;
26438 + drv_data->rx = transfer->rx_buf;
26439 + drv_data->rx_end = drv_data->rx + transfer->len;
26441 + if (!drv_data->rx)
26442 + drv_data->flags |= TRAN_STATE_RX_VOID;
26443 + if (!drv_data->tx)
26444 + drv_data->flags |= TRAN_STATE_TX_VOID;
26445 + drv_data->cs = message->spi->chip_select;
26446 + drv_data->cs_change = transfer->cs_change;
26447 + drv_data->void_write_data = chip->void_write_data;
26448 + if (transfer->speed_hz) {
26449 + *(drv_data->ctar + drv_data->cs) = \
26450 + ((chip->ctar_val & ~0xF) | \
26451 + hz_to_spi_baud(chip->ctar.pbr, \
26452 + chip->ctar.dbr, \
26453 + transfer->speed_hz));
26456 + message->state = RUNNING_STATE;
26457 + /* Go baby, go */
26458 + local_irq_save(flags);
26459 + message->actual_length += write(drv_data);
26460 + local_irq_restore(flags);
26464 +static void pump_messages(struct work_struct *work)
26466 + struct driver_data *drv_data;
26467 + unsigned long flags;
26470 + drv_data = container_of(work, struct driver_data, pump_messages);
26472 + /* Lock queue and check for queue work */
26473 + spin_lock_irqsave(&drv_data->lock, flags);
26474 + if (list_empty(&drv_data->queue)
26475 + || drv_data->run == QUEUE_STOPPED) {
26476 + drv_data->busy = 0;
26477 + spin_unlock_irqrestore(&drv_data->lock, flags);
26481 + /* Make sure we are not already running a message */
26482 + if (drv_data->cur_msg) {
26483 + spin_unlock_irqrestore(&drv_data->lock, flags);
26487 + /* Extract head of queue */
26488 + drv_data->cur_msg = list_entry(drv_data->queue.next,
26489 + struct spi_message, queue);
26490 + list_del_init(&drv_data->cur_msg->queue);
26492 + /* Initial message state*/
26493 + drv_data->cur_msg->state = START_STATE;
26494 + drv_data->cur_transfer = list_entry(drv_data->cur_msg->transfers.next,
26495 + struct spi_transfer,
26498 + if (drv_data->cur_transfer->transfer_list.next
26499 + == &drv_data->cur_msg->transfers)
26500 + drv_data->cur_transfer->cs_change = 1; /* last */
26503 + /* Setup the SPI Registers using the per chip configuration */
26504 + drv_data->cur_chip = spi_get_ctldata(drv_data->cur_msg->spi);
26506 + /* Mark as busy and launch transfers */
26507 + tasklet_schedule(&drv_data->pump_transfers);
26509 + drv_data->busy = 1;
26510 + spin_unlock_irqrestore(&drv_data->lock, flags);
26513 +/****************************************************************************/
26516 + * SPI master implementation
26519 +static int transfer(struct spi_device *spi, struct spi_message *msg)
26521 + struct driver_data *drv_data = spi_master_get_devdata(spi->master);
26522 + unsigned long flags;
26525 + spin_lock_irqsave(&drv_data->lock, flags);
26527 + if (drv_data->run == QUEUE_STOPPED) {
26528 + spin_unlock_irqrestore(&drv_data->lock, flags);
26529 + return -ESHUTDOWN;
26532 + msg->actual_length = 0;
26533 + msg->status = -EINPROGRESS;
26534 + msg->state = START_STATE;
26536 + list_add_tail(&msg->queue, &drv_data->queue);
26538 + if (drv_data->run == QUEUE_RUNNING && !drv_data->busy)
26539 + queue_work(drv_data->workqueue, &drv_data->pump_messages);
26541 + spin_unlock_irqrestore(&drv_data->lock, flags);
26547 +static int setup(struct spi_device *spi)
26550 + struct chip_data *chip;
26551 + struct coldfire_dspi_chip *chip_info
26552 + = (struct coldfire_dspi_chip *)spi->controller_data;
26555 + /* Only alloc on first setup */
26556 + chip = spi_get_ctldata(spi);
26557 + if (chip == NULL) {
26558 + chip = kcalloc(1, sizeof(struct chip_data), GFP_KERNEL);
26561 + spi->mode = chip_info->mode;
26562 + spi->bits_per_word = chip_info->bits_per_word;
26565 + chip->mcr.master = 1;
26566 + chip->mcr.cont_scke = 0;
26567 + chip->mcr.dconf = 0;
26568 + chip->mcr.frz = 0;
26569 + chip->mcr.mtfe = 0;
26570 + chip->mcr.pcsse = 0;
26571 + chip->mcr.rooe = 0;
26572 + chip->mcr.pcsis = 0xFF;
26573 + chip->mcr.reserved15 = 0;
26574 + chip->mcr.mdis = 0;
26575 + chip->mcr.dis_tx = 0;
26576 + chip->mcr.dis_rxf = 0;
26577 + chip->mcr.clr_tx = 1;
26578 + chip->mcr.clr_rxf = 1;
26579 + chip->mcr.smpl_pt = 0;
26580 + chip->mcr.reserved71 = 0;
26581 + chip->mcr.halt = 0;
26583 + if ((spi->bits_per_word >= 4) && (spi->bits_per_word <= 16)) {
26584 + chip->ctar.fmsz = spi->bits_per_word-1;
26586 + printk(KERN_ERR "Invalid wordsize\n");
26591 + chip->void_write_data = chip_info->void_write_data;
26593 + if (spi->max_speed_hz != 0)
26594 + chip_info->br = hz_to_spi_baud(chip_info->pbr, chip_info->dbr, \
26595 + spi->max_speed_hz);
26597 + chip->ctar.cpha = (spi->mode & SPI_CPHA) ? 1 : 0;
26598 + chip->ctar.cpol = (spi->mode & SPI_CPOL) ? 1 : 0;
26599 + chip->ctar.lsbfe = (spi->mode & SPI_LSB_FIRST) ? 1 : 0;
26600 + chip->ctar.dbr = chip_info->dbr;
26601 + chip->ctar.pbr = chip_info->pbr;
26602 + chip->ctar.br = chip_info->br;
26603 + chip->ctar.pcssck = chip_info->pcssck;
26604 + chip->ctar.pasc = chip_info->pasc;
26605 + chip->ctar.pdt = chip_info->pdt;
26606 + chip->ctar.cssck = chip_info->cssck;
26607 + chip->ctar.asc = chip_info->asc;
26608 + chip->ctar.dt = chip_info->dt;
26610 + spi_set_ctldata(spi, chip);
26615 +static int init_queue(struct driver_data *drv_data)
26617 + INIT_LIST_HEAD(&drv_data->queue);
26618 + spin_lock_init(&drv_data->lock);
26620 + drv_data->run = QUEUE_STOPPED;
26621 + drv_data->busy = 0;
26623 + tasklet_init(&drv_data->pump_transfers,
26624 + pump_transfers, (unsigned long)drv_data);
26626 + INIT_WORK(&drv_data->pump_messages, pump_messages);
26628 + drv_data->workqueue = create_singlethread_workqueue(
26629 + drv_data->master->dev.parent->bus_id);
26630 + if (drv_data->workqueue == NULL)
26636 +static int start_queue(struct driver_data *drv_data)
26638 + unsigned long flags;
26640 + spin_lock_irqsave(&drv_data->lock, flags);
26642 + if (drv_data->run == QUEUE_RUNNING || drv_data->busy) {
26643 + spin_unlock_irqrestore(&drv_data->lock, flags);
26647 + drv_data->run = QUEUE_RUNNING;
26648 + drv_data->cur_msg = NULL;
26649 + drv_data->cur_transfer = NULL;
26650 + drv_data->cur_chip = NULL;
26651 + spin_unlock_irqrestore(&drv_data->lock, flags);
26653 + queue_work(drv_data->workqueue, &drv_data->pump_messages);
26658 +static int stop_queue(struct driver_data *drv_data)
26660 + unsigned long flags;
26661 + unsigned limit = 500;
26664 + spin_lock_irqsave(&drv_data->lock, flags);
26666 + /* This is a bit lame, but is optimized for the common execution path.
26667 + * A wait_queue on the drv_data->busy could be used, but then the common
26668 + * execution path (pump_messages) would be required to call wake_up or
26669 + * friends on every SPI message. Do this instead */
26670 + drv_data->run = QUEUE_STOPPED;
26671 + while (!list_empty(&drv_data->queue) && drv_data->busy && limit--) {
26672 + spin_unlock_irqrestore(&drv_data->lock, flags);
26674 + spin_lock_irqsave(&drv_data->lock, flags);
26677 + if (!list_empty(&drv_data->queue) || drv_data->busy)
26680 + spin_unlock_irqrestore(&drv_data->lock, flags);
26685 +static int destroy_queue(struct driver_data *drv_data)
26689 + status = stop_queue(drv_data);
26693 + destroy_workqueue(drv_data->workqueue);
26699 +static void cleanup(struct spi_device *spi)
26701 + struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi);
26703 + dev_dbg(&spi->dev, "spi_device %u.%u cleanup\n",
26704 + spi->master->bus_num, spi->chip_select);
26710 +/****************************************************************************/
26713 + * Generic Device driver routines and interface implementation
26716 +static int coldfire_spi_probe(struct platform_device *pdev)
26718 + struct device *dev = &pdev->dev;
26719 + struct coldfire_spi_master *platform_info;
26720 + struct spi_master *master;
26721 + struct driver_data *drv_data = 0;
26722 + struct resource *memory_resource;
26726 +#if defined(SPI_DSPI_EDMA)
26727 + dma_addr_t dma_handle;
26730 + platform_info = (struct coldfire_spi_master *)dev->platform_data;
26732 + master = spi_alloc_master(dev, sizeof(struct driver_data));
26736 + drv_data = spi_master_get_devdata(master);
26737 + drv_data->master = master;
26739 + INIT_LIST_HEAD(&drv_data->queue);
26740 + spin_lock_init(&drv_data->lock);
26742 + master->bus_num = platform_info->bus_num;
26743 + master->num_chipselect = platform_info->num_chipselect;
26744 + master->cleanup = cleanup;
26745 + master->setup = setup;
26746 + master->transfer = transfer;
26748 + drv_data->cs_control = platform_info->cs_control;
26749 + if (drv_data->cs_control)
26750 + for (i = 0; i < master->num_chipselect; i++)
26751 + drv_data->cs_control(i, QSPI_CS_INIT | QSPI_CS_DROP);
26753 + /* Setup register addresses */
26754 + memory_resource = platform_get_resource_byname(pdev,
26755 + IORESOURCE_MEM, "spi-module");
26756 + if (!memory_resource) {
26757 + dev_dbg(dev, "can not find platform module memory\n");
26758 + goto out_error_master_alloc;
26761 +#if defined(SPI_DSPI_EDMA)
26762 + drv_data->edma_tx_buf = dma_alloc_coherent(NULL, EDMA_BUFSIZE_KMALLOC, \
26763 + &dma_handle, GFP_DMA);
26764 + if (!drv_data->edma_tx_buf) {
26765 + dev_dbg(dev, "cannot allocate eDMA TX memory\n");
26766 + goto out_error_master_alloc;
26768 + drv_data->edma_rx_buf = dma_alloc_coherent(NULL, EDMA_BUFSIZE_KMALLOC, \
26769 + &dma_handle, GFP_DMA);
26770 + if (!drv_data->edma_rx_buf) {
26771 + dma_free_coherent(NULL, EDMA_BUFSIZE_KMALLOC, \
26772 + drv_data->edma_tx_buf, dma_handle);
26773 + kfree(drv_data->edma_tx_buf);
26774 + dev_dbg(dev, "cannot allocate eDMA RX memory\n");
26775 + goto out_error_master_alloc;
26779 + drv_data->mcr = (void *)&MCF_DSPI_DMCR;
26780 + drv_data->ctar = (void *)&MCF_DSPI_DCTAR0;
26781 + drv_data->dspi_sr = (void *)&MCF_DSPI_DSR;
26782 + drv_data->dspi_rser = (void *)&MCF_DSPI_DRSER;
26783 + drv_data->dspi_dtfr = (void *)&MCF_DSPI_DTFR;
26784 + drv_data->dspi_drfr = (void *)&MCF_DSPI_DRFR;
26786 + memory_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM,
26788 + if (!memory_resource) {
26789 + dev_dbg(dev, "No spi-par memory\n");
26790 + goto out_error_master_alloc;
26792 + drv_data->par = (void *)memory_resource->start;
26794 + memory_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM,
26795 + "spi-int-level");
26796 + if (!memory_resource) {
26797 + dev_dbg(dev, "No spi-int-level memory\n");
26798 + goto out_error_master_alloc;
26800 + drv_data->int_icr = (void *)memory_resource->start;
26802 + memory_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM,
26804 + if (!memory_resource) {
26805 + dev_dbg(dev, "No spi-int-mask memory\n");
26806 + goto out_error_master_alloc;
26808 + drv_data->int_mr = (void *)memory_resource->start;
26810 + if (platform_info->irq_list) {
26811 + /* multiple IRQs */
26812 + int *irqlist = platform_info->irq_list;
26813 + while ((irq = *irqlist++)) {
26814 + int off = *irqlist++;
26815 + int lvl = *irqlist++;
26816 + int msk = *irqlist++;
26817 + status = request_irq(irq, dspi_interrupt, IRQF_DISABLED,
26818 + dev->bus_id, drv_data);
26819 + if (status < 0) {
26820 + dev_err(&pdev->dev,
26821 + "Unable to attach ColdFire DSPI interrupt\n");
26822 + goto out_error_master_alloc;
26826 + *(drv_data->int_icr + off) = lvl;
26829 + *drv_data->int_mr &= ~msk;
26833 + irq = platform_info->irq_vector;
26835 + status = request_irq(platform_info->irq_vector, dspi_interrupt,
26836 + IRQF_DISABLED, dev->bus_id, drv_data);
26837 + if (status < 0) {
26838 + dev_err(&pdev->dev, "Unable to attach ColdFire DSPI interrupt\n");
26839 + goto out_error_master_alloc;
26842 + *drv_data->int_icr = platform_info->irq_lp;
26843 + *drv_data->int_mr &= ~platform_info->irq_mask;
26846 + /* Now that we have all the addresses etc. Let's set it up */
26847 + if (platform_info->par_val)
26848 + *drv_data->par = platform_info->par_val;
26850 + /* Initial and start queue */
26851 + status = init_queue(drv_data);
26852 + if (status != 0) {
26853 + dev_err(&pdev->dev, "Problem initializing DSPI queue\n");
26854 + goto out_error_irq_alloc;
26856 + status = start_queue(drv_data);
26857 + if (status != 0) {
26858 + dev_err(&pdev->dev, "Problem starting DSPI queue\n");
26859 + goto out_error_irq_alloc;
26862 + /* Register with the SPI framework */
26863 + platform_set_drvdata(pdev, drv_data);
26864 + status = spi_register_master(master);
26865 + if (status != 0) {
26866 + dev_err(&pdev->dev, "Problem registering DSPI master\n");
26867 + status = -EINVAL;
26868 + goto out_error_queue_alloc;
26871 +#if defined(SPI_DSPI_EDMA)
26872 + if (mcf_edma_request_channel(DSPI_DMA_TX_TCD,
26877 + NULL, /* spinlock */
26878 + DRIVER_NAME) < 0){
26879 + dev_err(&pdev->dev, "eDMA transmit channel request\n");
26880 + status = -EINVAL;
26881 + goto out_error_queue_alloc;
26884 + if (mcf_edma_request_channel(DSPI_DMA_RX_TCD,
26889 + NULL, /* spinlock */
26890 + DRIVER_NAME) < 0){
26891 + dev_err(&pdev->dev, "eDAM receive channel request\n");
26892 + status = -EINVAL;
26893 + mcf_edma_free_channel(DSPI_DMA_TX_TCD, pdev);
26894 + goto out_error_queue_alloc;
26898 + printk(KERN_INFO "DSPI: Coldfire master initialized\n");
26901 +out_error_queue_alloc:
26902 + destroy_queue(drv_data);
26904 +out_error_irq_alloc:
26905 + free_irq(platform_info->irq_vector, drv_data);
26907 +out_error_master_alloc:
26908 + spi_master_put(master);
26913 +static int coldfire_spi_remove(struct platform_device *pdev)
26915 + struct driver_data *drv_data = platform_get_drvdata(pdev);
26922 +#if defined(SPI_DSPI_EDMA)
26923 + mcf_edma_free_channel(DSPI_DMA_TX_TCD, pdev);
26924 + mcf_edma_free_channel(DSPI_DMA_RX_TCD, pdev);
26927 + /* Remove the queue */
26928 + status = destroy_queue(drv_data);
26932 + /* Release IRQ */
26933 + irq = platform_get_irq(pdev, 0);
26935 + free_irq(irq, drv_data);
26937 + /* Disconnect from the SPI framework */
26938 + spi_unregister_master(drv_data->master);
26940 + /* Prevent double remove */
26941 + platform_set_drvdata(pdev, NULL);
26946 +static void coldfire_spi_shutdown(struct platform_device *pdev)
26948 + int status = coldfire_spi_remove(pdev);
26951 + dev_err(&pdev->dev, "shutdown failed with %d\n", status);
26956 +static int suspend_devices(struct device *dev, void *pm_message)
26958 + pm_message_t *state = pm_message;
26960 + if (dev->power.power_state.event != state->event) {
26961 + dev_warn(dev, "pm state does not match request\n");
26968 +static int coldfire_spi_suspend(struct platform_device *pdev,
26969 + pm_message_t state)
26971 + struct driver_data *drv_data = platform_get_drvdata(pdev);
26974 + /* Check all childern for current power state */
26975 + if (device_for_each_child(&pdev->dev,
26976 + &state, suspend_devices) != 0) {
26977 + dev_warn(&pdev->dev, "suspend aborted\n");
26981 + status = stop_queue(drv_data);
26988 +static int coldfire_spi_resume(struct platform_device *pdev)
26990 + struct driver_data *drv_data = platform_get_drvdata(pdev);
26993 + /* Start the queue running */
26994 + status = start_queue(drv_data);
26995 + if (status != 0) {
26996 + dev_err(&pdev->dev, "problem starting queue (%d)\n", status);
27003 +#define coldfire_spi_suspend NULL
27004 +#define coldfire_spi_resume NULL
27005 +#endif /* CONFIG_PM */
27007 +static struct platform_driver driver = {
27009 + .name = "spi_coldfire",
27010 + .bus = &platform_bus_type,
27011 + .owner = THIS_MODULE,
27013 + .probe = coldfire_spi_probe,
27014 + .remove = __devexit_p(coldfire_spi_remove),
27015 + .shutdown = coldfire_spi_shutdown,
27016 + .suspend = coldfire_spi_suspend,
27017 + .resume = coldfire_spi_resume,
27020 +static int __init coldfire_spi_init(void)
27022 + platform_driver_register(&driver);
27026 +module_init(coldfire_spi_init);
27028 +static void __exit coldfire_spi_exit(void)
27030 + platform_driver_unregister(&driver);
27032 +module_exit(coldfire_spi_exit);
27034 +MODULE_AUTHOR("Matt Waddel");
27035 +MODULE_DESCRIPTION("ColdFire DSPI Contoller");
27036 +MODULE_LICENSE("GPL");
27037 --- a/drivers/spi/Kconfig
27038 +++ b/drivers/spi/Kconfig
27039 @@ -35,6 +35,15 @@ config SPI_DEBUG
27040 Say "yes" to enable debug messaging (like dev_dbg and pr_debug),
27041 sysfs, and debugfs support in SPI controller and protocol drivers.
27043 +config COLDFIRE_EDMA
27044 + tristate "Coldfire eDMA"
27045 + depends on COLDFIRE && EXPERIMENTAL
27047 + Support for Coldfire eDMA controller. Required for example
27048 + by SSI audio device driver.
27053 # MASTER side ... talking to discrete SPI slave chips including microcontrollers
27055 @@ -113,6 +122,27 @@ config SPI_GPIO
27059 +config SPI_COLDFIRE
27060 + tristate "Coldfire QSPI/DSPI SPI Master"
27061 + depends on SPI_MASTER && COLDFIRE && EXPERIMENTAL
27063 + SPI driver for Freescale Coldfire QSPI module in master mode.
27064 + Tested with the 5282 processor, but should also work with other
27065 + Coldfire variants.
27068 + tristate "Coldfire DSPI"
27069 + depends on SPI_MASTER && COLDFIRE
27071 + SPI driver for Coldfire DSPI driver only.
27073 +config SPI_COLDFIRE_DSPI_EDMA
27074 + boolean "Coldfire DSPI master driver uses eDMA"
27075 + depends on SPI_MASTER && COLDFIRE && SPI_COLDFIRE && EXPERIMENTAL && COLDFIRE_EDMA
27078 + Say "yes" if you want DSPI master driver to use eDMA for transfers.
27081 tristate "Freescale iMX SPI controller"
27082 depends on SPI_MASTER && ARCH_IMX && EXPERIMENTAL
27083 @@ -255,6 +285,18 @@ config SPI_TLE62X0
27085 # Add new SPI protocol masters in alphabetical order above this line
27087 +config SPI_COLDFIRE_SSI_AUDIO
27088 + tristate "Coldfire SSI AUDIO"
27089 + depends on SPI_MASTER && SPI_COLDFIRE && EXPERIMENTAL
27091 + SSI audio device driver
27093 +config SSIAUDIO_USE_EDMA
27094 + boolean "Coldfire DSPI master driver uses eDMA"
27096 + depends on EXPERIMENTAL && COLDFIRE_EDMA && SPI_COLDFIRE_SSI_AUDIO
27098 + Say "yes" if you want SSI audio driver to use eDMA for SSI transfers.
27100 # (slave support would go here)
27102 --- a/drivers/spi/Makefile
27103 +++ b/drivers/spi/Makefile
27104 @@ -6,6 +6,8 @@ ifeq ($(CONFIG_SPI_DEBUG),y)
27105 EXTRA_CFLAGS += -DDEBUG
27108 +obj-$(CONFIG_COLDFIRE_EDMA) += coldfire_edma.o
27110 # small core, mostly translating board-specific
27111 # config declarations into driver model code
27112 obj-$(CONFIG_SPI_MASTER) += spi.o
27113 @@ -16,6 +18,8 @@ obj-$(CONFIG_SPI_BFIN) += spi_bfin5xx.
27114 obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o
27115 obj-$(CONFIG_SPI_AU1550) += au1550_spi.o
27116 obj-$(CONFIG_SPI_BUTTERFLY) += spi_butterfly.o
27117 +# obj-$(CONFIG_SPI_COLDFIRE) += spi_coldfire.o spi-m5445x.o
27118 +obj-$(CONFIG_SPI_DSPI) += dspi_mcf.o
27119 obj-$(CONFIG_SPI_GPIO) += spi_gpio.o
27120 obj-$(CONFIG_SPI_IMX) += spi_imx.o
27121 obj-$(CONFIG_SPI_LM70_LLP) += spi_lm70llp.o
27122 @@ -35,6 +39,7 @@ obj-$(CONFIG_SPI_SH_SCI) += spi_sh_sci.
27123 obj-$(CONFIG_SPI_AT25) += at25.o
27124 obj-$(CONFIG_SPI_SPIDEV) += spidev.o
27125 obj-$(CONFIG_SPI_TLE62X0) += tle62x0.o
27126 +obj-$(CONFIG_SPI_COLDFIRE_SSI_AUDIO) += ssi_audio.o
27127 # ... add above this line ...
27129 # SPI slave controller drivers (upstream link)
27131 +++ b/drivers/spi/spi_coldfire.c
27134 + * spi_coldfire.c - Master QSPI/DSPI controller for the ColdFire processors
27137 + * (C) Copyright 2005, Intec Automation,
27138 + * Mike Lavender (mike@steroidmicros)
27140 + * (C) Copyright 2007-2008, Freescale Inc,
27141 + * Yaroslav Vinogradov
27145 + * This program is free software; you can redistribute it and/or modify it
27146 + * under the terms of the GNU General Public License as published by the
27147 + * Free Software Foundation; either version 2 of the License, or (at your
27148 + * option) any later version.
27150 + * This program is distributed in the hope that it will be useful,
27151 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
27152 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27153 + * GNU General Public License for more details.
27155 + * You should have received a copy of the GNU General Public License
27156 + * along with this program; if not, write to the Free Software
27157 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27159 + ***************************************************************************
27161 + * v0.003 12 February 2008 Andrey Butok, Freescale Semiconductor
27162 + * Added suport of MCF5227x DSPI module.
27163 + * v0.002 2007 Yaroslav Vinogradov, Freescale Semiconductor
27164 + * Added suport of MCF5445x DSPI module.
27165 + * v0.001 2005 Mike Lavender, Intec Automation,
27166 + * Intial version. Coldfire QSPI master driver.
27171 +/****************************************************************************/
27177 +#include <linux/autoconf.h>
27178 +#include <linux/init.h>
27179 +#include <linux/module.h>
27180 +#include <linux/device.h>
27181 +#include <linux/interrupt.h>
27182 +#include <linux/platform_device.h>
27183 +#include <linux/spi/spi.h>
27184 +#include <linux/workqueue.h>
27185 +#include <linux/delay.h>
27187 +#include <asm/delay.h>
27188 +#include <asm/mcfsim.h>
27189 +#include <asm/mcfqspi.h>
27190 +#include <asm/coldfire.h>
27192 +#if defined(CONFIG_M5445X)
27193 + #include <asm/virtconvert.h>
27196 + #if defined(CONFIG_SPI_COLDFIRE_DSPI_EDMA)
27197 + #define SPI_DSPI_EDMA
27198 + #ifdef CONFIG_MMU
27199 + #define SPI_USE_MMU
27201 + #include <asm/mcf5445x_edma.h>
27204 + #include <asm/mcf5445x_dspi.h>
27207 +#if defined(CONFIG_M547X_8X)
27210 + #include <asm/virtconvert.h>
27211 + #include <asm/m5485dspi.h>
27214 +#ifdef CONFIG_M5227x
27217 + #if defined(CONFIG_SPI_COLDFIRE_DSPI_EDMA)
27218 + #define SPI_DSPI_EDMA
27223 +#if defined(SPI_DSPI_EDMA)
27225 +/* edma buffer size in transfer units (32bits) */
27226 +#define EDMA_BUFFER_SIZE (PAGE_SIZE/4)
27227 +#define EDMA_BUFSIZE_KMALLOC (EDMA_BUFFER_SIZE*4)
27229 +#define DSPI_DMA_RX_TCD MCF_EDMA_CHAN_DSPI_RX
27230 +#define DSPI_DMA_TX_TCD MCF_EDMA_CHAN_DSPI_TX
27232 +#include <asm/mcf_edma.h>
27235 +MODULE_AUTHOR("Mike Lavender");
27236 +MODULE_DESCRIPTION("ColdFire SPI Contoller");
27237 +MODULE_LICENSE("GPL");
27239 +#define DRIVER_NAME "Coldfire QSPI/DSPI"
27241 +/****************************************************************************/
27244 + * Local constants and macros
27247 +#define QSPI_RAM_SIZE 0x10 /* 16 word table */
27248 +#define QSPI_TRANSMIT_RAM 0x00
27249 +#define QSPI_RECEIVE_RAM 0x10
27250 +#define QSPI_COMMAND_RAM 0x20
27252 +#define QSPI_COMMAND 0x7000 /* 15: X = Continuous CS
27253 + * 14: 1 = Get BITSE from QMR[BITS]
27254 + * 13: 1 = Get DT from QDLYR[DTL]
27255 + * 12: 1 = Get DSK from QDLYR[QCD]
27256 + * 8-11: XXXX = next 4 bytes for CS
27257 + * 0-7: 0000 0000 Reserved
27260 +#define QIR_WCEF 0x0008 /* write collison */
27261 +#define QIR_ABRT 0x0004 /* abort */
27262 +#define QIR_SPIF 0x0001 /* finished */
27264 +#define QIR_WCEFE 0x0800
27265 +#define QIR_ABRTE 0x0400
27266 +#define QIR_SPIFE 0x0100
27268 +#define QIR_WCEFB 0x8000
27269 +#define QIR_ABRTB 0x4000
27270 +#define QIR_ABRTL 0x1000
27272 +#define QMR_BITS 0x3C00
27273 +#define QMR_BITS_8 0x2000
27275 +#define QCR_CONT 0x8000
27277 +#define QDLYR_SPE 0x8000
27279 +#define QWR_ENDQP_MASK 0x0F00
27280 +#define QWR_CSIV 0x1000 /* 1 = active low chip selects */
27283 +#define START_STATE ((void*)0)
27284 +#define RUNNING_STATE ((void*)1)
27285 +#define DONE_STATE ((void*)2)
27286 +#define ERROR_STATE ((void*)-1)
27288 +#define QUEUE_RUNNING 0
27289 +#define QUEUE_STOPPED 1
27291 +/****************************************************************************/
27294 + * Local Data Structures
27297 +struct transfer_state {
27305 +#define TRAN_STATE_RX_VOID 0x01
27306 +#define TRAN_STATE_TX_VOID 0x02
27307 +#define TRAN_STATE_WORD_ODD_NUM 0x04
27309 + u16 void_write_data;
27310 + unsigned cs_change:1;
27314 + unsigned master:1;
27315 + unsigned dohie:1;
27333 + unsigned endqp:4;
27334 + unsigned cptqp:4;
27335 + unsigned newqp:4;
27340 + unsigned master:1;
27341 + unsigned cont_scke:1;
27342 + unsigned dconf:2;
27345 + unsigned pcsse:1;
27347 + unsigned pcsis:8;
27348 + unsigned reserved15:1;
27350 + unsigned dis_tx:1;
27351 + unsigned dis_rxf:1;
27352 + unsigned clr_tx:1;
27353 + unsigned clr_rxf:1;
27354 + unsigned smpl_pt:2;
27355 + unsigned reserved71:7;
27364 + unsigned lsbfe:1;
27365 + unsigned pcssck:2;
27369 + unsigned cssck:4;
27375 +struct chip_data {
27376 +#if defined(SPI_DSPI)
27401 + u16 void_write_data;
27405 +struct driver_data {
27406 + /* Driver model hookup */
27407 + struct platform_device *pdev;
27409 + /* SPI framework hookup */
27410 + struct spi_master *master;
27412 + /* Driver message queue */
27413 + struct workqueue_struct *workqueue;
27414 + struct work_struct pump_messages;
27416 + struct list_head queue;
27420 + /* Message Transfer pump */
27421 + struct tasklet_struct pump_transfers;
27423 + /* Current message transfer state info */
27424 + struct spi_message* cur_msg;
27425 + struct spi_transfer* cur_transfer;
27426 + struct chip_data *cur_chip;
27433 +#define TRAN_STATE_RX_VOID 0x01
27434 +#define TRAN_STATE_TX_VOID 0x02
27435 +#define TRAN_STATE_WORD_ODD_NUM 0x04
27437 + u16 void_write_data;
27438 + unsigned cs_change:1;
27443 +#if defined(SPI_DSPI)
27444 + u32 *mcr; /* DSPI MCR register */
27445 + u32 *ctar; /* DSPI CTAR register */
27446 + u32 *dspi_dtfr; /* DSPI DTFR register */
27447 + u32 *dspi_drfr; /* DSPI DRFR register */
27448 + u32 *dspi_rser; /* DSPI RSER register */
27449 + u32 *dspi_sr; /* DSPI status register */
27450 + u8 dspi_ctas; /* DSPI CTAS value*/
27451 +#if defined(SPI_DSPI_EDMA)
27452 + void* edma_tx_buf;
27453 + void* edma_rx_buf;
27456 + u16 *qmr; /* QSPI mode register */
27457 + u16 *qdlyr; /* QSPI delay register */
27458 + u16 *qwr; /* QSPI wrap register */
27459 + u16 *qir; /* QSPI interrupt register */
27460 + u16 *qar; /* QSPI address register */
27461 + u16 *qdr; /* QSPI data register */
27462 + u16 *qcr; /* QSPI command register */
27464 +#if defined(CONFIG_M532x) || defined(CONFIG_M537x)
27465 + u16 *par; /* Pin assignment register */
27467 + u8 *par; /* Pin assignment register */
27469 + u8 *int_icr; /* Interrupt level and priority register */
27470 + u32 *int_mr; /* Interrupt mask register */
27471 + void (*cs_control)(u8 cs, u8 command);
27474 +#define DSPI_CS(cs) ((1<<(cs))<<16)
27477 +/****************************************************************************/
27480 + * SPI local functions
27483 +static void *next_transfer(struct driver_data *drv_data)
27485 + struct spi_message *msg = drv_data->cur_msg;
27486 + struct spi_transfer *trans = drv_data->cur_transfer;
27488 + /* Move to next transfer */
27489 + if (trans->transfer_list.next != &msg->transfers) {
27490 + drv_data->cur_transfer =
27491 + list_entry(trans->transfer_list.next,
27492 + struct spi_transfer,
27494 + return RUNNING_STATE;
27496 + return DONE_STATE;
27500 +#define DSPI_BITS MCF_DSPI_DCTAR_FMSZ(15)
27501 +#define DSPI_BITS_16 MCF_DSPI_DCTAR_FMSZ(15)
27502 +#define DSPI_BITS_8 MCF_DSPI_DCTAR_FMSZ(7)
27503 +#define DSPI_FIFO_SIZE 16
27505 +static inline int is_word_transfer(struct driver_data *drv_data)
27507 +#if defined(SPI_DSPI)
27508 + return ((*drv_data->ctar & DSPI_BITS_16) == DSPI_BITS_8) ? 0 : 1;
27510 + return ((*drv_data->qmr & QMR_BITS) == QMR_BITS_8) ? 0 : 1;
27514 +static void inline set_8bit_transfer_mode(struct driver_data *drv_data)
27516 +#if defined(SPI_DSPI)
27517 + *drv_data->ctar |= (*drv_data->ctar & ~DSPI_BITS) | DSPI_BITS_8;
27519 + *drv_data->qmr |= (*drv_data->qmr & ~QMR_BITS) | QMR_BITS_8;
27523 +static void inline set_16bit_transfer_mode(struct driver_data *drv_data)
27525 +#if defined(SPI_DSPI)
27526 + *drv_data->ctar |= (*drv_data->ctar & ~DSPI_BITS) | DSPI_BITS_16;
27528 + *drv_data->qmr |= (*drv_data->qmr & ~QMR_BITS);
27532 +static int write(struct driver_data *drv_data)
27534 + int tx_count = 0;
27536 + int cmd_count = 0;
27540 +#if defined(SPI_DSPI)
27541 +#if defined(SPI_DSPI_EDMA)
27550 + tx_word = is_word_transfer(drv_data);
27552 + /* If we are in word mode, but only have a single byte to transfer
27553 + * then switch to byte mode temporarily. Will switch back at the
27554 + * end of the transfer. */
27555 + if (tx_word && ((drv_data->tx_end - drv_data->tx) == 1)) {
27556 + drv_data->flags |= TRAN_STATE_WORD_ODD_NUM;
27557 + set_8bit_transfer_mode(drv_data);
27562 +#if defined(SPI_DSPI)
27563 +#if defined(SPI_DSPI_EDMA)
27564 + edma_wr = (u32*)(drv_data->edma_tx_buf);
27567 +#if defined(SPI_DSPI_EDMA)
27568 + while ((drv_data->tx < drv_data->tx_end) && (tx_count < EDMA_BUFFER_SIZE)) {
27570 + while ((drv_data->tx < drv_data->tx_end) && (tx_count < DSPI_FIFO_SIZE)) {
27573 + if ((drv_data->tx_end - drv_data->tx) == 1)
27575 + if (!(drv_data->flags & TRAN_STATE_TX_VOID)) {
27576 + d16 = *(u16 *)drv_data->tx;
27578 + d16 = drv_data->void_write_data;
27581 + dspi_pushr = MCF_DSPI_DTFR_TXDATA(d16)
27582 + | DSPI_CS(drv_data->cs)
27583 + | MCF_DSPI_DTFR_CTAS(drv_data->dspi_ctas);
27584 + drv_data->tx += 2;
27586 +#if defined(SPI_DSPI_EDMA)
27587 + if (drv_data->tx == drv_data->tx_end || tx_count==EDMA_BUFFER_SIZE-1) {
27589 + if (drv_data->tx == drv_data->tx_end || tx_count==DSPI_FIFO_SIZE-1) {
27591 + /* last transfer in the queue */
27592 + dspi_pushr |= MCF_DSPI_DTFR_EOQ;
27593 + if (drv_data->cs_change) {
27594 + dspi_pushr &= ~MCF_DSPI_DTFR_CONT;
27600 + dspi_pushr |= MCF_DSPI_DTFR_CTCNT; /* clear counter */
27602 +#if defined(SPI_DSPI_EDMA)
27603 + *edma_wr = dspi_pushr;
27606 + *drv_data->dspi_dtfr = dspi_pushr;
27611 + if (!(drv_data->flags & TRAN_STATE_TX_VOID)) {
27612 + d8 = *(u8 *)drv_data->tx;
27614 + d8 = *(u8 *)&drv_data->void_write_data;
27617 + dspi_pushr = MCF_DSPI_DTFR_TXDATA(d8)
27618 + | DSPI_CS(drv_data->cs)
27619 + | MCF_DSPI_DTFR_CTAS(drv_data->dspi_ctas)
27620 + | MCF_DSPI_DTFR_CONT;
27624 + if (drv_data->tx == drv_data->tx_end || tx_count==DSPI_FIFO_SIZE-1) {
27625 + /* last transfer in the queue */
27626 + dspi_pushr |= MCF_DSPI_DTFR_EOQ;
27627 + if (drv_data->cs_change) {
27628 + dspi_pushr &= ~MCF_DSPI_DTFR_CONT;
27634 + dspi_pushr |= MCF_DSPI_DTFR_CTCNT; /* clear counter */
27637 +#if defined(SPI_DSPI_EDMA)
27638 + *edma_wr = dspi_pushr;
27641 + *drv_data->dspi_dtfr = dspi_pushr;
27648 +#if defined(SPI_DSPI_EDMA)
27650 + if (tx_count>0) {
27652 + /* TBD: initiate eDMA transfer */
27653 + mcf_edma_set_tcd_params(DSPI_DMA_TX_TCD,
27654 +#ifdef SPI_USE_MMU
27655 + virt_to_phys(drv_data->edma_tx_buf),
27657 + drv_data->edma_tx_buf,
27659 + (u32)drv_data->dspi_dtfr,
27660 + MCF_EDMA_TCD_ATTR_SSIZE_32BIT | MCF_EDMA_TCD_ATTR_DSIZE_32BIT,
27664 + tx_count, /* citer */
27665 + tx_count, /* biter */
27667 + 0, /* dlastsga */
27668 + 0, /* major_int */
27669 + 1 /* disable_req */
27672 + mcf_edma_set_tcd_params(DSPI_DMA_RX_TCD,
27673 + (u32)drv_data->dspi_drfr,
27674 +#ifdef SPI_USE_MMU
27675 + virt_to_phys(drv_data->edma_rx_buf),
27677 + drv_data->edma_rx_buf,
27679 + MCF_EDMA_TCD_ATTR_SSIZE_32BIT | MCF_EDMA_TCD_ATTR_DSIZE_32BIT,
27683 + tx_count, /* citer */
27684 + tx_count, /* biter */
27686 + 0, /* dlastsga */
27687 + 0, /* major_int */
27688 + 1 /* disable_req */
27692 + start_edma_transfer(DSPI_DMA_TX_TCD); /* transmit SPI data */
27693 + start_edma_transfer(DSPI_DMA_RX_TCD); /* receive SPI data */
27699 + *drv_data->qar = QSPI_TRANSMIT_RAM;
27700 + while ((drv_data->tx < drv_data->tx_end) && (tx_count < QSPI_RAM_SIZE)) {
27702 + if ((drv_data->tx_end - drv_data->tx) == 1)
27705 + if (!(drv_data->flags & TRAN_STATE_TX_VOID))
27706 + *drv_data->qdr = *(u16 *)drv_data->tx;
27708 + *drv_data->qdr = drv_data->void_write_data;
27709 + drv_data->tx += 2;
27711 + if (!(drv_data->flags & TRAN_STATE_TX_VOID))
27712 + *drv_data->qdr = *(u8 *)drv_data->tx;
27714 + *drv_data->qdr = *(u8 *)&drv_data->void_write_data;
27721 + *drv_data->qar = QSPI_COMMAND_RAM;
27722 + while (cmd_count < tx_count) {
27723 + u16 qcr = QSPI_COMMAND
27725 + | (~((0x01 << drv_data->cs) << 8) & 0x0F00);
27727 + if ( (cmd_count == tx_count - 1)
27728 + && (drv_data->tx == drv_data->tx_end)
27729 + && (drv_data->cs_change) ) {
27730 + qcr &= ~QCR_CONT;
27732 + *drv_data->qcr = qcr;
27736 + *drv_data->qwr = (*drv_data->qwr & ~QWR_ENDQP_MASK) | ((cmd_count - 1) << 8);
27738 + /* Fire it up! */
27739 + *drv_data->qdlyr |= QDLYR_SPE;
27746 +static int read(struct driver_data *drv_data)
27748 + int rx_count = 0;
27750 +#if defined(SPI_DSPI_EDMA)
27754 + rx_word = is_word_transfer(drv_data);
27756 +#if defined(SPI_DSPI)
27757 +#if defined(SPI_DSPI_EDMA)
27758 + rx_edma = (u32*) drv_data->edma_tx_buf;
27759 + while ((drv_data->rx < drv_data->rx_end) && (rx_count < EDMA_BUFFER_SIZE)) {
27761 + while ((drv_data->rx < drv_data->rx_end) && (rx_count < DSPI_FIFO_SIZE)) {
27764 + if ((drv_data->rx_end - drv_data->rx) == 1)
27766 +#if defined(SPI_DSPI_EDMA)
27767 + d = MCF_DSPI_DRFR_RXDATA(*rx_edma);
27770 + d = MCF_DSPI_DRFR_RXDATA(*drv_data->dspi_drfr);
27773 + if (!(drv_data->flags & TRAN_STATE_RX_VOID))
27774 + *(u16 *)drv_data->rx = d;
27775 + drv_data->rx += 2;
27777 +#if defined(SPI_DSPI_EDMA)
27778 + d = MCF_DSPI_DRFR_RXDATA(*rx_edma);
27781 + d = MCF_DSPI_DRFR_RXDATA(*drv_data->dspi_drfr);
27783 + if (!(drv_data->flags & TRAN_STATE_RX_VOID))
27784 + *(u8 *)drv_data->rx = d;
27790 + *drv_data->qar = QSPI_RECEIVE_RAM;
27791 + while ((drv_data->rx < drv_data->rx_end) && (rx_count < QSPI_RAM_SIZE)) {
27793 + if ((drv_data->rx_end - drv_data->rx) == 1)
27796 + if (!(drv_data->flags & TRAN_STATE_RX_VOID))
27797 + *(u16 *)drv_data->rx = *drv_data->qdr;
27798 + drv_data->rx += 2;
27800 + if (!(drv_data->flags & TRAN_STATE_RX_VOID))
27801 + *(u8 *)drv_data->rx = *drv_data->qdr;
27812 +static inline void qspi_setup_chip(struct driver_data *drv_data)
27814 + struct chip_data *chip = drv_data->cur_chip;
27816 +#if defined(SPI_DSPI)
27818 + *drv_data->mcr = chip->mcr_val;
27820 + /* TBD: remove later */
27821 +/* JKM -- validate */
27822 + chip->ctar_val = 0x78560118;
27824 + *drv_data->ctar = chip->ctar_val;
27825 + *drv_data->dspi_rser = 0
27826 + | MCF_DSPI_DRSER_EOQFE
27827 +#if defined(SPI_DSPI_EDMA)
27828 + | MCF_DSPI_DRSER_TFFFE
27829 + | MCF_DSPI_DRSER_TFFFS
27833 + *drv_data->qmr = chip->qmr_val;
27834 + *drv_data->qdlyr = chip->qdlyr_val;
27835 + *drv_data->qwr = chip->qwr_val;
27838 + * Enable all the interrupts and clear all the flags
27840 + *drv_data->qir = (QIR_SPIFE | QIR_ABRTE | QIR_WCEFE)
27841 + | (QIR_WCEFB | QIR_ABRTB | QIR_ABRTL)
27842 + | (QIR_SPIF | QIR_ABRT | QIR_WCEF);
27846 +#if defined(SPI_DSPI_EDMA)
27847 +static int edma_tx_handler(int channel, void* dev)
27849 + if (channel == DSPI_DMA_TX_TCD) {
27850 + stop_edma_transfer(DSPI_DMA_TX_TCD);
27852 + return IRQ_HANDLED;
27855 +static int edma_rx_handler(int channel, void* dev)
27857 + if (channel == DSPI_DMA_RX_TCD) {
27858 + stop_edma_transfer(DSPI_DMA_RX_TCD);
27861 + return IRQ_HANDLED;
27865 +static irqreturn_t qspi_interrupt(int irq, void *dev_id)
27867 + struct driver_data *drv_data = (struct driver_data *)dev_id;
27868 + struct spi_message *msg = drv_data->cur_msg;
27869 +#if defined(SPI_DSPI)
27870 +#if !defined(SPI_DSPI_EDMA)
27871 + u32 irq_status = *drv_data->dspi_sr;
27874 + u16 irq_status = *drv_data->qir;
27877 + /* Clear all flags immediately */
27878 +#if defined(SPI_DSPI)
27879 + *drv_data->dspi_sr = MCF_DSPI_DSR_EOQF;
27881 + *drv_data->qir |= (QIR_SPIF | QIR_ABRT | QIR_WCEF);
27884 + if (!drv_data->cur_msg || !drv_data->cur_msg->state) {
27885 +#if !defined(SPI_DSPI_EDMA)
27886 + /* if eDMA is used it happens some time (at least once)*/
27887 + printk(KERN_ERR "coldfire-qspi: bad message or transfer "
27888 + "state in interrupt handler. IRQ status=%x\n", irq_status);
27893 +#if !defined(SPI_DSPI)
27894 + if (irq_status & QIR_SPIF) {
27897 + * Read the data into the buffer and reload and start
27898 + * queue with new data if not finished. If finished
27899 + * then setup the next transfer
27903 + if (drv_data->rx == drv_data->rx_end) {
27905 + * Finished now - fall through and schedule next
27906 + * transfer tasklet
27908 + if (drv_data->flags & TRAN_STATE_WORD_ODD_NUM) {
27909 + set_16bit_transfer_mode(drv_data);
27912 + msg->state = next_transfer(drv_data);
27913 + msg->actual_length += drv_data->len;
27915 + /* not finished yet - keep going */
27917 + return IRQ_HANDLED;
27919 +#if !defined(SPI_DSPI)
27921 + if (irq_status & QIR_WCEF)
27922 + drv_data->wce_cnt++;
27924 + if (irq_status & QIR_ABRT)
27925 + drv_data->abrt_cnt++;
27927 + msg->state = ERROR_STATE;
27931 + tasklet_schedule(&drv_data->pump_transfers);
27933 + return IRQ_HANDLED;
27936 +/* caller already set message->status; dma and pio irqs are blocked */
27937 +static void giveback(struct driver_data *drv_data)
27939 + struct spi_transfer* last_transfer;
27940 + unsigned long flags;
27941 + struct spi_message *msg;
27943 + spin_lock_irqsave(&drv_data->lock, flags);
27944 + msg = drv_data->cur_msg;
27945 + drv_data->cur_msg = NULL;
27946 + drv_data->cur_transfer = NULL;
27947 + drv_data->cur_chip = NULL;
27948 + queue_work(drv_data->workqueue, &drv_data->pump_messages);
27949 + spin_unlock_irqrestore(&drv_data->lock, flags);
27951 + last_transfer = list_entry(msg->transfers.prev,
27952 + struct spi_transfer,
27955 + if (!last_transfer->cs_change)
27956 + drv_data->cs_control(drv_data->cs, QSPI_CS_DROP);
27958 + msg->state = NULL;
27959 + if (msg->complete)
27960 + msg->complete(msg->context);
27964 +static void pump_transfers(unsigned long data)
27966 + struct driver_data *drv_data = (struct driver_data *)data;
27967 + struct spi_message *message = NULL;
27968 + struct spi_transfer *transfer = NULL;
27969 + struct spi_transfer *previous = NULL;
27970 + struct chip_data *chip = NULL;
27971 + unsigned long flags;
27973 + /* Get current state information */
27974 + message = drv_data->cur_msg;
27975 + transfer = drv_data->cur_transfer;
27976 + chip = drv_data->cur_chip;
27978 + /* Handle for abort */
27979 + if (message->state == ERROR_STATE) {
27980 + message->status = -EIO;
27981 + giveback(drv_data);
27985 + /* Handle end of message */
27986 + if (message->state == DONE_STATE) {
27987 + message->status = 0;
27988 + giveback(drv_data);
27992 + if (message->state == START_STATE) {
27993 + qspi_setup_chip(drv_data);
27995 + if (drv_data->cs_control)
27996 + drv_data->cs_control(message->spi->chip_select, QSPI_CS_ASSERT);
27999 + /* Delay if requested at end of transfer*/
28000 + if (message->state == RUNNING_STATE) {
28001 + previous = list_entry(transfer->transfer_list.prev,
28002 + struct spi_transfer,
28005 + if (drv_data->cs_control && transfer->cs_change)
28006 + drv_data->cs_control(message->spi->chip_select, QSPI_CS_DROP);
28008 + if (previous->delay_usecs)
28009 + udelay(previous->delay_usecs);
28011 + if (drv_data->cs_control && transfer->cs_change)
28012 + drv_data->cs_control(message->spi->chip_select, QSPI_CS_ASSERT);
28015 + drv_data->flags = 0;
28016 + drv_data->tx = (void *)transfer->tx_buf;
28017 + drv_data->tx_end = drv_data->tx + transfer->len;
28018 + drv_data->rx = transfer->rx_buf;
28019 + drv_data->rx_end = drv_data->rx + transfer->len;
28020 + drv_data->len = transfer->len;
28021 + if (!drv_data->rx)
28022 + drv_data->flags |= TRAN_STATE_RX_VOID;
28023 + if (!drv_data->tx)
28024 + drv_data->flags |= TRAN_STATE_TX_VOID;
28025 + drv_data->cs = message->spi->chip_select;
28026 + drv_data->cs_change = transfer->cs_change;
28027 + drv_data->void_write_data = chip->void_write_data;
28029 + message->state = RUNNING_STATE;
28031 + /* Go baby, go */
28032 + local_irq_save(flags);
28034 + local_irq_restore(flags);
28038 +static void pump_messages(struct work_struct *work)
28040 + struct driver_data *drv_data;
28041 + unsigned long flags;
28043 + drv_data = container_of(work, struct driver_data, pump_messages);
28045 + /* Lock queue and check for queue work */
28046 + spin_lock_irqsave(&drv_data->lock, flags);
28047 + if (list_empty(&drv_data->queue) || drv_data->run == QUEUE_STOPPED) {
28048 + drv_data->busy = 0;
28049 + spin_unlock_irqrestore(&drv_data->lock, flags);
28053 + /* Make sure we are not already running a message */
28054 + if (drv_data->cur_msg) {
28055 + spin_unlock_irqrestore(&drv_data->lock, flags);
28059 + /* Extract head of queue */
28060 + drv_data->cur_msg = list_entry(drv_data->queue.next,
28061 + struct spi_message, queue);
28062 + list_del_init(&drv_data->cur_msg->queue);
28064 + /* Initial message state*/
28065 + drv_data->cur_msg->state = START_STATE;
28066 + drv_data->cur_transfer = list_entry(drv_data->cur_msg->transfers.next,
28067 + struct spi_transfer,
28070 + /* Setup the SPI Registers using the per chip configuration */
28071 + drv_data->cur_chip = spi_get_ctldata(drv_data->cur_msg->spi);
28073 + /* Mark as busy and launch transfers */
28074 + tasklet_schedule(&drv_data->pump_transfers);
28076 + drv_data->busy = 1;
28077 + spin_unlock_irqrestore(&drv_data->lock, flags);
28080 +/****************************************************************************/
28083 + * SPI master implementation
28086 +static int transfer(struct spi_device *spi, struct spi_message *msg)
28088 + struct driver_data *drv_data = spi_master_get_devdata(spi->master);
28089 + unsigned long flags;
28091 + spin_lock_irqsave(&drv_data->lock, flags);
28093 + if (drv_data->run == QUEUE_STOPPED) {
28094 + spin_unlock_irqrestore(&drv_data->lock, flags);
28095 + return -ESHUTDOWN;
28098 + msg->actual_length = 0;
28099 + msg->status = -EINPROGRESS;
28100 + msg->state = START_STATE;
28102 + list_add_tail(&msg->queue, &drv_data->queue);
28104 + if (drv_data->run == QUEUE_RUNNING && !drv_data->busy)
28105 + queue_work(drv_data->workqueue, &drv_data->pump_messages);
28107 + spin_unlock_irqrestore(&drv_data->lock, flags);
28113 +static int setup(struct spi_device *spi)
28115 + struct coldfire_spi_chip *chip_info;
28116 + struct chip_data *chip;
28118 + u32 baud_divisor = 255;
28121 + chip_info = (struct coldfire_spi_chip *)spi->controller_data;
28123 + /* Only alloc on first setup */
28124 + chip = spi_get_ctldata(spi);
28125 + if (chip == NULL) {
28126 + chip = kcalloc(1, sizeof(struct chip_data), GFP_KERNEL);
28129 + spi->mode = chip_info->mode;
28130 + spi->bits_per_word = chip_info->bits_per_word;
28133 +#if defined(SPI_DSPI)
28134 + chip->mcr.master = 1;
28135 + chip->mcr.cont_scke = 0;
28136 + chip->mcr.dconf = 0;
28137 + chip->mcr.frz = 0;
28138 + chip->mcr.mtfe = 0;
28139 + chip->mcr.pcsse = 0;
28140 + chip->mcr.rooe = 0;
28141 + chip->mcr.pcsis = 0xFF;
28142 + chip->mcr.reserved15 = 0;
28143 + chip->mcr.mdis = 0;
28144 + chip->mcr.dis_tx = 0;
28145 + chip->mcr.dis_rxf = 0;
28146 + chip->mcr.clr_tx = 1;
28147 + chip->mcr.clr_rxf = 1;
28148 + chip->mcr.smpl_pt = 0;
28149 + chip->mcr.reserved71 = 0;
28150 + chip->mcr.halt = 0;
28152 + if ((spi->bits_per_word >= 4) && (spi->bits_per_word <= 16)) {
28153 + chip->ctar.fmsz = spi->bits_per_word-1;
28155 + printk(KERN_ERR "coldfire-spi: invalid wordsize\n");
28160 + if (spi->mode & SPI_CPHA)
28161 + chip->ctar.cpha = 1;
28163 + chip->ctar.cpha = 0;
28165 + if (spi->mode & SPI_CPOL)
28166 + chip->ctar.cpol = 1;
28168 + chip->ctar.cpol = 0;
28170 + if (spi->mode & SPI_LSB_FIRST)
28171 + chip->ctar.lsbfe = 1;
28173 + chip->ctar.lsbfe = 0;
28175 + /* This values are default for audio device */
28176 + chip->ctar.dbr = 0;
28177 + chip->ctar.pbr = 2;
28178 + chip->ctar.br = 8;
28180 + /* This values are default for audio device */
28181 + chip->ctar.pcssck = 1;
28182 + chip->ctar.pasc = 1;
28183 + chip->ctar.pdt = 1;
28184 + chip->ctar.cssck = 0;
28185 + chip->ctar.asc = 1;
28186 + chip->ctar.dt = 1;
28188 + chip->void_write_data = chip_info->void_write_data;
28192 + chip->qwr.csiv = 1; /* Chip selects are active low */
28193 + chip->qmr.master = 1; /* Must set to master mode */
28194 + chip->qmr.dohie = 1; /* Data output high impediance enabled */
28195 + chip->void_write_data = chip_info->void_write_data;
28197 + chip->qdlyr.qcd = chip_info->del_cs_to_clk;
28198 + chip->qdlyr.dtl = chip_info->del_after_trans;
28200 + if (spi->max_speed_hz != 0)
28201 + baud_divisor = (MCF_CLK/(2*spi->max_speed_hz));
28203 + if (baud_divisor < 2)
28204 + baud_divisor = 2;
28206 + if (baud_divisor > 255)
28207 + baud_divisor = 255;
28209 + chip->qmr.baud = baud_divisor;
28211 + /*printk( "SPI: spi->max_speed_hz %d\n", spi->max_speed_hz );*/
28212 + /*printk( "SPI: Baud set to %d\n", chip->qmr.baud );*/
28214 + if (spi->mode & SPI_CPHA)
28215 + chip->qmr.cpha = 1;
28217 + if (spi->mode & SPI_CPOL)
28218 + chip->qmr.cpol = 1;
28220 + if (spi->bits_per_word == 16) {
28221 + chip->qmr.bits = 0;
28222 + } else if ((spi->bits_per_word >= 8) && (spi->bits_per_word <= 15)) {
28223 + chip->qmr.bits = spi->bits_per_word;
28225 + printk(KERN_ERR "coldfire-spi: invalid wordsize\n");
28232 + spi_set_ctldata(spi, chip);
28237 +static int init_queue(struct driver_data *drv_data)
28239 + INIT_LIST_HEAD(&drv_data->queue);
28240 + spin_lock_init(&drv_data->lock);
28242 + drv_data->run = QUEUE_STOPPED;
28243 + drv_data->busy = 0;
28245 + tasklet_init(&drv_data->pump_transfers,
28246 + pump_transfers, (unsigned long)drv_data);
28248 + INIT_WORK(&drv_data->pump_messages, pump_messages);
28250 + drv_data->workqueue = create_singlethread_workqueue(
28251 + drv_data->master->dev.parent->bus_id);
28252 + if (drv_data->workqueue == NULL)
28258 +static int start_queue(struct driver_data *drv_data)
28260 + unsigned long flags;
28262 + spin_lock_irqsave(&drv_data->lock, flags);
28264 + if (drv_data->run == QUEUE_RUNNING || drv_data->busy) {
28265 + spin_unlock_irqrestore(&drv_data->lock, flags);
28269 + drv_data->run = QUEUE_RUNNING;
28270 + drv_data->cur_msg = NULL;
28271 + drv_data->cur_transfer = NULL;
28272 + drv_data->cur_chip = NULL;
28273 + spin_unlock_irqrestore(&drv_data->lock, flags);
28275 + queue_work(drv_data->workqueue, &drv_data->pump_messages);
28280 +static int stop_queue(struct driver_data *drv_data)
28282 + unsigned long flags;
28283 + unsigned limit = 500;
28286 + spin_lock_irqsave(&drv_data->lock, flags);
28288 + /* This is a bit lame, but is optimized for the common execution path.
28289 + * A wait_queue on the drv_data->busy could be used, but then the common
28290 + * execution path (pump_messages) would be required to call wake_up or
28291 + * friends on every SPI message. Do this instead */
28292 + drv_data->run = QUEUE_STOPPED;
28293 + while (!list_empty(&drv_data->queue) && drv_data->busy && limit--) {
28294 + spin_unlock_irqrestore(&drv_data->lock, flags);
28296 + spin_lock_irqsave(&drv_data->lock, flags);
28299 + if (!list_empty(&drv_data->queue) || drv_data->busy)
28302 + spin_unlock_irqrestore(&drv_data->lock, flags);
28307 +static int destroy_queue(struct driver_data *drv_data)
28311 + status = stop_queue(drv_data);
28315 + destroy_workqueue(drv_data->workqueue);
28321 +static void cleanup(struct spi_device *spi)
28323 + struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi);
28325 + dev_dbg(&spi->dev, "spi_device %u.%u cleanup\n",
28326 + spi->master->bus_num, spi->chip_select);
28332 +/****************************************************************************/
28335 + * Generic Device driver routines and interface implementation
28338 +static int coldfire_spi_probe(struct platform_device *pdev)
28340 + struct device *dev = &pdev->dev;
28341 + struct coldfire_spi_master *platform_info;
28342 + struct spi_master *master;
28343 + struct driver_data *drv_data = 0;
28344 + struct resource *memory_resource;
28349 + platform_info = (struct coldfire_spi_master *)pdev->dev.platform_data;
28351 + master = spi_alloc_master(dev, sizeof(struct driver_data));
28355 + drv_data = spi_master_get_devdata(master);
28356 + drv_data->master = master;
28358 + INIT_LIST_HEAD(&drv_data->queue);
28359 + spin_lock_init(&drv_data->lock);
28361 + master->bus_num = platform_info->bus_num;
28362 + master->num_chipselect = platform_info->num_chipselect;
28363 + master->cleanup = cleanup;
28364 + master->setup = setup;
28365 + master->transfer = transfer;
28367 + drv_data->cs_control = platform_info->cs_control;
28368 + if (drv_data->cs_control)
28369 + for(i = 0; i < master->num_chipselect; i++)
28370 + drv_data->cs_control(i, QSPI_CS_INIT | QSPI_CS_DROP);
28372 + /* Setup register addresses */
28373 + memory_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, "spi-module");
28374 + if (!memory_resource) {
28375 + dev_dbg(dev, "can not find platform module memory\n");
28376 + goto out_error_master_alloc;
28379 +#if defined(SPI_DSPI_EDMA)
28380 + drv_data->edma_tx_buf = kmalloc(EDMA_BUFSIZE_KMALLOC, GFP_DMA);
28381 + if (!drv_data->edma_tx_buf) {
28382 + dev_dbg(dev, "cannot allocate eDMA TX memory\n");
28383 + goto out_error_master_alloc;
28385 + drv_data->edma_rx_buf = kmalloc(EDMA_BUFSIZE_KMALLOC, GFP_DMA);
28386 + if (!drv_data->edma_rx_buf) {
28387 + kfree(drv_data->edma_tx_buf);
28388 + dev_dbg(dev, "cannot allocate eDMA RX memory\n");
28389 + goto out_error_master_alloc;
28393 +#if defined(SPI_DSPI)
28395 + drv_data->mcr = (void *)(memory_resource->start + 0x00000000);
28396 + drv_data->ctar = (void *)(memory_resource->start + 0x0000000C);
28397 + drv_data->dspi_sr = (void *)(memory_resource->start + 0x0000002C);
28398 + drv_data->dspi_rser = (void *)(memory_resource->start + 0x00000030);
28399 + drv_data->dspi_dtfr = (void *)(memory_resource->start + 0x00000034);
28400 + drv_data->dspi_drfr = (void *)(memory_resource->start + 0x00000038);
28404 + drv_data->qmr = (void *)(memory_resource->start + 0x00000000);
28405 + drv_data->qdlyr = (void *)(memory_resource->start + 0x00000004);
28406 + drv_data->qwr = (void *)(memory_resource->start + 0x00000008);
28407 + drv_data->qir = (void *)(memory_resource->start + 0x0000000c);
28408 + drv_data->qar = (void *)(memory_resource->start + 0x00000010);
28409 + drv_data->qdr = (void *)(memory_resource->start + 0x00000014);
28410 + drv_data->qcr = (void *)(memory_resource->start + 0x00000014);
28414 + /* Setup register addresses */
28415 + memory_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, "spi-par");
28416 + if (!memory_resource) {
28417 + dev_dbg(dev, "can not find platform par memory\n");
28418 + goto out_error_master_alloc;
28421 + drv_data->par = (void *)memory_resource->start;
28423 + /* Setup register addresses */
28424 + memory_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, "spi-int-level");
28425 + if (!memory_resource) {
28426 + dev_dbg(dev, "can not find platform par memory\n");
28427 + goto out_error_master_alloc;
28430 + drv_data->int_icr = (void *)memory_resource->start;
28432 + /* Setup register addresses */
28433 + memory_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, "spi-int-mask");
28434 + if (!memory_resource) {
28435 + dev_dbg(dev, "can not find platform par memory\n");
28436 + goto out_error_master_alloc;
28439 + drv_data->int_mr = (void *)memory_resource->start;
28441 + if (platform_info->irq_list) {
28442 + /* multiple IRQs */
28443 + int *irqlist = platform_info->irq_list;
28444 + while ((irq = *irqlist++)) {
28445 + int off = *irqlist++;
28446 + int lvl = *irqlist++;
28447 + int msk = *irqlist++;
28448 + status = request_irq(irq, qspi_interrupt, IRQF_DISABLED,
28449 + dev->bus_id, drv_data);
28450 + if (status < 0) {
28451 + dev_err(&pdev->dev,
28452 + "unable to attach ColdFire DSPI interrupt\n");
28453 + goto out_error_master_alloc;
28457 + *(drv_data->int_icr + off) = lvl;
28460 + *drv_data->int_mr &= ~msk;
28464 + irq = platform_info->irq_vector;
28466 + status = request_irq(platform_info->irq_vector, qspi_interrupt,
28467 + IRQF_DISABLED, dev->bus_id, drv_data);
28468 + if (status < 0) {
28469 + dev_err(&pdev->dev, "unable to attach ColdFire QSPI interrupt\n");
28470 + goto out_error_master_alloc;
28473 + *drv_data->int_icr = platform_info->irq_lp;
28474 + *drv_data->int_mr &= ~platform_info->irq_mask;
28477 + /* Now that we have all the addresses etc. Let's set it up */
28478 + if (platform_info->par_val)
28479 + *drv_data->par = platform_info->par_val;
28481 +#ifdef CONFIG_M5227x
28482 + MCF_GPIO_PAR_IRQ = 0x04; /* Mistake in RM documentation */
28486 + drv_data->dspi_ctas = 0; /* TBD: change later */
28489 + /* Initial and start queue */
28490 + status = init_queue(drv_data);
28491 + if (status != 0) {
28492 + dev_err(&pdev->dev, "problem initializing queue\n");
28493 + goto out_error_irq_alloc;
28495 + status = start_queue(drv_data);
28496 + if (status != 0) {
28497 + dev_err(&pdev->dev, "problem starting queue\n");
28498 + goto out_error_irq_alloc;
28501 + /* Register with the SPI framework */
28502 + platform_set_drvdata(pdev, drv_data);
28503 + status = spi_register_master(master);
28504 + if (status != 0) {
28505 + dev_err(&pdev->dev, "problem registering spi master\n");
28506 + status = -EINVAL;
28507 + goto out_error_queue_alloc;
28510 +#if defined(SPI_DSPI_EDMA)
28511 + if (mcf_edma_request_channel(DSPI_DMA_TX_TCD,
28515 + NULL, /* spinlock */
28518 + dev_err(&pdev->dev, "problem requesting edma transmit channel\n");
28519 + status = -EINVAL;
28520 + goto out_error_queue_alloc;
28523 + if (mcf_edma_request_channel(DSPI_DMA_RX_TCD,
28527 + NULL, /* spinlock */
28530 + dev_err(&pdev->dev, "problem requesting edma receive channel\n");
28531 + status = -EINVAL;
28532 + goto out_edma_transmit;
28536 + printk(KERN_INFO "SPI: Coldfire master initialized\n" );
28539 +#if defined(SPI_DSPI_EDMA)
28540 +out_edma_transmit:
28541 + mcf_edma_free_channel(DSPI_DMA_TX_TCD, pdev);
28544 +out_error_queue_alloc:
28545 + destroy_queue(drv_data);
28547 +out_error_irq_alloc:
28548 + free_irq(irq, drv_data);
28550 +out_error_master_alloc:
28551 + spi_master_put(master);
28556 +static int coldfire_spi_remove(struct platform_device *pdev)
28558 + struct driver_data *drv_data = platform_get_drvdata(pdev);
28565 +#if defined(SPI_DSPI_EDMA)
28566 + mcf_edma_free_channel(DSPI_DMA_TX_TCD, pdev);
28567 + mcf_edma_free_channel(DSPI_DMA_RX_TCD, pdev);
28570 + /* Remove the queue */
28571 + status = destroy_queue(drv_data);
28575 + /* Release IRQ */
28576 +/* JKM -- check for list and remove list */
28577 + irq = platform_get_irq(pdev, 0);
28579 + free_irq(irq, drv_data);
28581 + /* Disconnect from the SPI framework */
28582 + spi_unregister_master(drv_data->master);
28584 + /* Prevent double remove */
28585 + platform_set_drvdata(pdev, NULL);
28590 +static void coldfire_spi_shutdown(struct platform_device *pdev)
28594 + if ((status = coldfire_spi_remove(pdev)) != 0)
28595 + dev_err(&pdev->dev, "shutdown failed with %d\n", status);
28600 +static int suspend_devices(struct device *dev, void *pm_message)
28602 + pm_message_t *state = pm_message;
28604 + if (dev->power.power_state.event != state->event) {
28605 + dev_warn(dev, "pm state does not match request\n");
28612 +static int coldfire_spi_suspend(struct platform_device *pdev, pm_message_t state)
28614 + struct driver_data *drv_data = platform_get_drvdata(pdev);
28617 + /* Check all childern for current power state */
28618 + if (device_for_each_child(&pdev->dev, &state, suspend_devices) != 0) {
28619 + dev_warn(&pdev->dev, "suspend aborted\n");
28623 + status = stop_queue(drv_data);
28630 +static int coldfire_spi_resume(struct platform_device *pdev)
28632 + struct driver_data *drv_data = platform_get_drvdata(pdev);
28635 + /* Start the queue running */
28636 + status = start_queue(drv_data);
28637 + if (status != 0) {
28638 + dev_err(&pdev->dev, "problem starting queue (%d)\n", status);
28645 +#define coldfire_spi_suspend NULL
28646 +#define coldfire_spi_resume NULL
28647 +#endif /* CONFIG_PM */
28649 +static struct platform_driver driver = {
28651 + .name = "spi_coldfire",
28652 + .bus = &platform_bus_type,
28653 + .owner = THIS_MODULE,
28655 + .probe = coldfire_spi_probe,
28656 + .remove = __devexit_p(coldfire_spi_remove),
28657 + .shutdown = coldfire_spi_shutdown,
28658 + .suspend = coldfire_spi_suspend,
28659 + .resume = coldfire_spi_resume,
28662 +static int __init coldfire_spi_init(void)
28664 + platform_driver_register(&driver);
28668 +module_init(coldfire_spi_init);
28670 +static void __exit coldfire_spi_exit(void)
28672 + platform_driver_unregister(&driver);
28674 +module_exit(coldfire_spi_exit);
28676 +++ b/drivers/spi/spi-m5445x.c
28678 +/***************************************************************************/
28680 + * linux/arch/m68k/coldfire/spi-m5445x.c
28682 + * Sub-architcture dependant initialization code for the Freescale
28683 + * 5445x SPI module
28685 + * Yaroslav Vinogradov yaroslav.vinogradov@freescale.com
28686 + * Copyright Freescale Semiconductor, Inc 2007
28688 + * This program is free software; you can redistribute it and/or modify
28689 + * it under the terms of the GNU General Public License as published by
28690 + * the Free Software Foundation; either version 2 of the License, or
28691 + * (at your option) any later version.
28693 +/***************************************************************************/
28696 +#include <linux/kernel.h>
28697 +#include <linux/sched.h>
28698 +#include <linux/param.h>
28699 +#include <linux/init.h>
28700 +#include <linux/interrupt.h>
28701 +#include <linux/device.h>
28702 +#include <linux/platform_device.h>
28703 +#include <linux/spi/spi.h>
28705 +#include <asm/dma.h>
28706 +#include <asm/traps.h>
28707 +#include <asm/machdep.h>
28708 +#include <asm/coldfire.h>
28709 +#include <asm/mcfsim.h>
28710 +#include <asm/mcfqspi.h>
28711 +#include <asm/mcf5445x_gpio.h>
28713 +#define SPI_NUM_CHIPSELECTS 0x10
28714 +#define SPI_PAR_VAL (0 | MCF_GPIO_PAR_DSPI_PCS5_PCS5 | MCF_GPIO_PAR_DSPI_PCS2_PCS2 \
28715 + | MCF_GPIO_PAR_DSPI_PCS1_PCS1 | MCF_GPIO_PAR_DSPI_PCS0_PCS0 | MCF_GPIO_PAR_DSPI_SIN_SIN \
28716 + | MCF_GPIO_PAR_DSPI_SOUT_SOUT | MCF_GPIO_PAR_DSPI_SCK_SCK)
28718 +#define MCF5445x_DSPI_IRQ_SOURCE (31)
28719 +#define MCF5445x_DSPI_IRQ_VECTOR (64 + MCF5445x_DSPI_IRQ_SOURCE)
28721 +#define MCF5445x_DSPI_PAR (0xFC0A4063)
28722 +#define MCF5445x_DSPI_MCR (0xFC05C000)
28723 +#define MCF5445x_INTC0_ICR (0xFC048040)
28724 +#define MCF5445x_INTC0_IMRL (0xFC04800C)
28727 +#define M5445x_AUDIO_IRQ_SOURCE 49
28728 +#define M5445x_AUDIO_IRQ_VECTOR (128+M5445x_AUDIO_IRQ_SOURCE)
28729 +#define M5445x_AUDIO_IRQ_LEVEL 4
28731 +void coldfire_qspi_cs_control(u8 cs, u8 command)
28735 +#if defined(CONFIG_SPI_COLDFIRE_SSI_AUDIO)
28736 +static struct coldfire_spi_chip ssi_audio_chip_info = {
28737 + .mode = SPI_MODE_0,
28738 + .bits_per_word = 16,
28739 + .del_cs_to_clk = 16,
28740 + .del_after_trans = 16,
28741 + .void_write_data = 0
28746 +static struct spi_board_info spi_board_info[] = {
28748 +#if defined(CONFIG_SPI_COLDFIRE_SSI_AUDIO)
28750 + .modalias = "ssi_audio",
28751 + .max_speed_hz = 300000,
28753 + .chip_select = 5,
28754 + .irq = M5445x_AUDIO_IRQ_VECTOR,
28755 + .platform_data = NULL,
28756 + .controller_data = &ssi_audio_chip_info
28762 +static struct coldfire_spi_master coldfire_master_info = {
28764 + .num_chipselect = SPI_NUM_CHIPSELECTS,
28765 + .irq_source = MCF5445x_DSPI_IRQ_SOURCE,
28766 + .irq_vector = MCF5445x_DSPI_IRQ_VECTOR,
28767 + .irq_mask = (0x01 << MCF5445x_DSPI_IRQ_SOURCE),
28768 + .irq_lp = 0x2, /* Level */
28769 + .par_val = SPI_PAR_VAL,
28770 +// .par_val16 = SPI_PAR_VAL,
28771 + .cs_control = coldfire_qspi_cs_control,
28774 +static struct resource coldfire_spi_resources[] = {
28776 + .name = "qspi-par",
28777 + .start = MCF5445x_DSPI_PAR,
28778 + .end = MCF5445x_DSPI_PAR,
28779 + .flags = IORESOURCE_MEM
28783 + .name = "qspi-module",
28784 + .start = MCF5445x_DSPI_MCR,
28785 + .end = MCF5445x_DSPI_MCR + 0xB8,
28786 + .flags = IORESOURCE_MEM
28790 + .name = "qspi-int-level",
28791 + .start = MCF5445x_INTC0_ICR + MCF5445x_DSPI_IRQ_SOURCE,
28792 + .end = MCF5445x_INTC0_ICR + MCF5445x_DSPI_IRQ_SOURCE,
28793 + .flags = IORESOURCE_MEM
28797 + .name = "qspi-int-mask",
28798 + .start = MCF5445x_INTC0_IMRL,
28799 + .end = MCF5445x_INTC0_IMRL,
28800 + .flags = IORESOURCE_MEM
28804 +static struct platform_device coldfire_spi = {
28805 + .name = "spi_coldfire", //"coldfire-qspi",
28807 + .resource = coldfire_spi_resources,
28808 + .num_resources = ARRAY_SIZE(coldfire_spi_resources),
28810 + .platform_data = &coldfire_master_info,
28814 +static int __init spi_dev_init(void)
28818 + retval = platform_device_register(&coldfire_spi);
28820 + if (retval < 0) {
28821 + printk(KERN_ERR "SPI-m5445x: platform_device_register failed with code=%d\n", retval);
28825 + if (ARRAY_SIZE(spi_board_info))
28826 + retval = spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
28833 +arch_initcall(spi_dev_init);
28835 +++ b/drivers/spi/ssi_audio.c
28838 + * MCF5445x audio driver.
28840 + * Yaroslav Vinogradov yaroslav.vinogradov@freescale.com
28841 + * Copyright Freescale Semiconductor, Inc. 2006, 2007
28843 + * This program is free software; you can redistribute it and/or modify
28844 + * it under the terms of the GNU General Public License as published by
28845 + * the Free Software Foundation; either version 2 of the License, or
28846 + * (at your option) any later version.
28849 +#include <linux/device.h>
28850 +#include <linux/init.h>
28851 +#include <linux/delay.h>
28852 +#include <linux/spi/spi.h>
28853 +#include <linux/fs.h>
28854 +#include <linux/kernel.h>
28855 +#include <linux/major.h>
28856 +#include <asm/mcfsim.h>
28857 +#include <linux/interrupt.h>
28858 +#include <linux/soundcard.h>
28859 +#include <asm/uaccess.h>
28860 +#include <asm/virtconvert.h>
28862 +#include <asm/coldfire.h>
28863 +#include <asm/coldfire_edma.h>
28864 +#ifdef CONFIG_M5445X
28865 +#include <asm/mcf5445x_ssi.h>
28866 +#include <asm/mcf5445x_ccm.h>
28867 +#include <asm/mcf5445x_gpio.h>
28870 +#define SOUND_DEVICE_NAME "sound"
28871 +#define DRIVER_NAME "ssi_audio"
28873 +/* #define AUDIO_DEBUG */
28879 +#define MAX_SPEED_HZ 12000000
28881 +#define M5445x_AUDIO_IRQ_SOURCE 49
28882 +#define M5445x_AUDIO_IRQ_VECTOR (128+M5445x_AUDIO_IRQ_SOURCE)
28883 +#define M5445x_AUDIO_IRQ_LEVEL 5
28885 +/* TLV320DAC23 audio chip registers */
28887 +#define CODEC_LEFT_IN_REG (0x00)
28888 +#define CODEC_RIGHT_IN_REG (0x01)
28889 +#define CODEC_LEFT_HP_VOL_REG (0x02)
28890 +#define CODEC_RIGHT_HP_VOL_REG (0x03)
28891 +#define CODEC_ANALOG_APATH_REG (0x04)
28892 +#define CODEC_DIGITAL_APATH_REG (0x05)
28893 +#define CODEC_POWER_DOWN_REG (0x06)
28894 +#define CODEC_DIGITAL_IF_FMT_REG (0x07)
28895 +#define CODEC_SAMPLE_RATE_REG (0x08)
28896 +#define CODEC_DIGITAL_IF_ACT_REG (0x09)
28897 +#define CODEC_RESET_REG (0x0f)
28899 +#define CODEC_SAMPLE_8KHZ (0x0C)
28900 +#define CODEC_SAMPLE_16KHZ (0x58)
28901 +#define CODEC_SAMPLE_22KHZ (0x62)
28902 +#define CODEC_SAMPLE_32KHZ (0x18)
28903 +#define CODEC_SAMPLE_44KHZ (0x22)
28904 +#define CODEC_SAMPLE_48KHZ (0x00)
28906 +/* Audio buffer data size */
28907 +#define BUFSIZE (64*1024)
28908 +/* DMA transfer size */
28909 +#define DMASIZE (16*1024)
28911 +/* eDMA channel for SSI channel 0 TX */
28912 +#define DMA_TCD MCF_EDMA_CHAN_TIMER2
28913 +/* eDMA channel for SSI channel 1 TX */
28914 +#define DMA_TCD2 MCF_EDMA_CHAN_TIMER3
28916 +struct ssi_audio {
28917 + struct spi_device *spi;
28930 +static struct ssi_audio* audio_device = NULL;
28931 +volatile u32 audio_start;
28932 +volatile u32 audio_count;
28933 +volatile u32 audio_append;
28934 +volatile u32 audio_appstart;
28935 +volatile u32 audio_txbusy;
28937 +struct ssi_audio_format {
28938 + unsigned int format;
28939 + unsigned int bits;
28940 +} ssi_audio_formattable[] = {
28941 + { AFMT_MU_LAW, 8 },
28942 + { AFMT_A_LAW, 8 },
28943 + { AFMT_IMA_ADPCM, 8 },
28945 + { AFMT_S16_LE, 16 },
28946 + { AFMT_S16_BE, 16 },
28948 + { AFMT_U16_LE, 16 },
28949 + { AFMT_U16_BE, 16 },
28952 +#define FORMATSIZE (sizeof(ssi_audio_formattable) / sizeof(struct ssi_audio_format))
28954 +static void ssi_audio_setsamplesize(int val)
28958 + if (audio_device == NULL) return;
28960 + for (i = 0; (i < FORMATSIZE); i++) {
28961 + if (ssi_audio_formattable[i].format == val) {
28962 + audio_device->format = ssi_audio_formattable[i].format;
28963 + audio_device->bits = ssi_audio_formattable[i].bits;
28968 +#ifdef AUDIO_DEBUG
28969 + printk(DRIVER_NAME ":ssi_audio_setsamplesize %d %d\n",
28970 + audio_device->format, audio_device->bits);
28974 +static void ssi_audio_txdrain(void)
28976 +#ifdef AUDIO_DEBUG
28977 + printk(DRIVER_NAME ":ssi_audio_txdrain()\n");
28980 + if (audio_device == NULL) return;
28982 + while (!signal_pending(current)) {
28983 + if (audio_txbusy == 0)
28985 + current->state = TASK_INTERRUPTIBLE;
28986 + schedule_timeout(1);
28990 +#ifdef CONFIG_SSIAUDIO_USE_EDMA
28992 + * Configure and start DMA engine.
28994 +void __inline__ ssi_audio_dmarun(void)
28996 + set_edma_params(DMA_TCD,
28998 + virt_to_phys(&(audio_device->audio_buf[audio_start])),
29000 + (u32)&(audio_device->audio_buf[audio_start]),
29002 + (u32)&MCF_SSI_TX0,
29003 + MCF_EDMA_TCD_ATTR_SSIZE_32BIT | MCF_EDMA_TCD_ATTR_DSIZE_32BIT,
29015 + set_edma_params(DMA_TCD2,
29017 + virt_to_phys(&(audio_device->audio_buf[audio_start+4])),
29019 + (u32)&(audio_device->audio_buf[audio_start+4]),
29021 + (u32)&MCF_SSI_TX1,
29022 + MCF_EDMA_TCD_ATTR_SSIZE_32BIT | MCF_EDMA_TCD_ATTR_DSIZE_32BIT,
29034 + audio_device->dmaing = 1;
29035 + audio_txbusy = 1;
29037 + start_edma_transfer(DMA_TCD);
29038 + start_edma_transfer(DMA_TCD2);
29042 + * ssi_audio_dmabuf - Start DMA'ing a new buffer of data if any available.
29044 +static void ssi_audio_dmabuf(void)
29046 +#ifdef AUDIO_DEBUG
29047 + printk(DRIVER_NAME ":ssi_audio_dmabuf(): append=%x start=%x\n",
29048 + audio_append, audio_appstart);
29051 + /* If already running then nothing to do... */
29052 + if (audio_device->dmaing)
29055 + /* Set DMA buffer size */
29056 + audio_count = (audio_append >= audio_appstart) ?
29057 + (audio_append - audio_appstart) :
29058 + (BUFSIZE - audio_appstart);
29059 + if (audio_count > DMASIZE)
29060 + audio_count = DMASIZE;
29062 + /* Adjust pointers and counters accordingly */
29063 + audio_appstart += audio_count;
29064 + if (audio_appstart >= BUFSIZE)
29065 + audio_appstart = 0;
29067 + if (audio_count > 0)
29068 + ssi_audio_dmarun();
29070 + audio_txbusy = 0;
29071 +#ifdef AUDIO_DEBUG
29072 + printk(DRIVER_NAME ":DMA buffer is empty!\n");
29077 +void __inline__ stop_dma(void)
29079 + stop_edma_transfer(DMA_TCD);
29080 + stop_edma_transfer(DMA_TCD2);
29083 +static int ssi_audio_dma_handler_empty(int channel, void *dev_id)
29085 + return IRQ_HANDLED;
29088 +static int ssi_audio_dma_handler(int channel, void *dev_id)
29090 +#ifdef AUDIO_DEBUG
29091 + printk(DRIVER_NAME ":ssi_audio_dma_handler(channel=%d)\n", channel);
29094 + /* Clear DMA interrupt */
29097 + audio_device->dmaing = 0;
29099 + /* Update data pointers and counts */
29100 + audio_start += audio_count;
29101 + if (audio_start >= BUFSIZE)
29105 + /* Start new DMA buffer if we can */
29106 + ssi_audio_dmabuf();
29108 + return IRQ_HANDLED;
29111 +static void init_dma(void)
29113 + /* SSI DMA Signals mapped to DMA request */
29114 + MCF_CCM_MISCCR &= ~MCF_CCM_MISCCR_TIMDMA;
29118 +#endif /* CONFIG_SSIAUDIO_USE_EDMA */
29120 +/* Write CODEC register using SPI
29121 + * address - CODEC register address
29122 + * data - data to be written into register
29124 +static int codec_write(u8 addr, u16 data)
29128 + if (audio_device==NULL || audio_device->spi==NULL)
29131 + spi_word = ((addr & 0x7F)<<9)|(data & 0x1FF);
29132 + return spi_write(audio_device->spi, (const u8*)&spi_word,
29133 + sizeof(spi_word));
29136 +static inline void enable_ssi(void)
29138 + if (audio_device==NULL || audio_device->ssi_enabled) return;
29139 + audio_device->ssi_enabled = 1;
29140 + MCF_SSI_CR |= MCF_SSI_CR_SSI_EN; /* enable SSI module */
29141 + MCF_SSI_CR |= MCF_SSI_CR_TE; /* enable tranmitter */
29144 +static inline void disable_ssi(void)
29146 + if (audio_device==NULL || audio_device->ssi_enabled==0) return;
29147 + MCF_SSI_CR &= ~MCF_SSI_CR_TE; /* disable transmitter */
29148 + MCF_SSI_CR &= ~MCF_SSI_CR_SSI_EN; /* disable SSI module */
29149 + audio_device->ssi_enabled = 0;
29152 +/* Audio CODEC initialization */
29153 +static void adjust_codec_speed(void) {
29154 +#ifdef AUDIO_DEBUG
29155 + printk(DRIVER_NAME ":adjust_codec_speed: %d\n", audio_device->speed);
29158 + switch (audio_device->speed) {
29160 + MCF_CCM_CDR = MCF_CCM_CDR_SSIDIV(255);
29161 + codec_write(CODEC_SAMPLE_RATE_REG,CODEC_SAMPLE_8KHZ);
29164 + MCF_CCM_CDR = MCF_CCM_CDR_SSIDIV(129);
29165 + codec_write(CODEC_SAMPLE_RATE_REG,CODEC_SAMPLE_16KHZ);
29169 + MCF_CCM_CDR = MCF_CCM_CDR_SSIDIV(94);
29170 + codec_write(CODEC_SAMPLE_RATE_REG,CODEC_SAMPLE_22KHZ);
29174 + MCF_CCM_CDR = MCF_CCM_CDR_SSIDIV(47);
29175 + codec_write(CODEC_SAMPLE_RATE_REG,CODEC_SAMPLE_44KHZ);
29178 + MCF_CCM_CDR = MCF_CCM_CDR_SSIDIV(42);
29179 + codec_write(CODEC_SAMPLE_RATE_REG,CODEC_SAMPLE_48KHZ);
29182 + MCF_CCM_CDR = MCF_CCM_CDR_SSIDIV(47);
29183 + codec_write(CODEC_SAMPLE_RATE_REG,CODEC_SAMPLE_44KHZ);
29187 +static void codec_reset(void)
29189 + codec_write(CODEC_RESET_REG, 0); /* reset the audio chip */
29190 + udelay(1500); /* wait for reset */
29193 +static void init_audio_codec(void)
29195 +#ifdef AUDIO_DEBUG
29196 + printk(DRIVER_NAME ":init_audio_codec()\n");
29200 + codec_write(CODEC_LEFT_IN_REG, 0x017);
29201 + codec_write(CODEC_RIGHT_IN_REG, 0x017);
29202 + codec_write(CODEC_POWER_DOWN_REG, 0x000); /* Turn off line input */
29203 + codec_write(CODEC_DIGITAL_IF_FMT_REG, 0x00A); /* I2S slave mode */
29204 + /* codec_write(CODEC_DIGITAL_IF_FMT_REG, 0x042); // I2S master mode */
29205 + codec_write(CODEC_DIGITAL_APATH_REG, 0x007); /* Set A path */
29207 + /* set sample rate */
29208 + adjust_codec_speed();
29210 + codec_write(CODEC_LEFT_HP_VOL_REG, 0x075); /* set volume */
29211 + codec_write(CODEC_RIGHT_HP_VOL_REG, 0x075); /* set volume */
29212 + codec_write(CODEC_DIGITAL_IF_ACT_REG, 1); /* Activate digital interface */
29213 + codec_write(CODEC_ANALOG_APATH_REG, 0x0F2);
29217 +static void chip_init(void)
29219 +#ifdef CONFIG_SSIAUDIO_USE_EDMA
29223 + /* Enable the SSI pins */
29224 + MCF_GPIO_PAR_SSI = (0
29225 + | MCF_GPIO_PAR_SSI_MCLK
29226 + | MCF_GPIO_PAR_SSI_STXD(3)
29227 + | MCF_GPIO_PAR_SSI_SRXD(3)
29228 + | MCF_GPIO_PAR_SSI_FS(3)
29229 + | MCF_GPIO_PAR_SSI_BCLK(3) );
29232 +static void init_ssi(void)
29234 +#ifdef AUDIO_DEBUG
29235 + printk(DRIVER_NAME ":init_ssi()\n");
29238 + /* Dividers are for MCF54445 on 266Mhz, the output is 44.1Khz*/
29239 + /* Enable SSI clock in CCM */
29240 + MCF_CCM_CDR = MCF_CCM_CDR_SSIDIV(47);
29242 + /* Issue a SSI reset */
29243 + MCF_SSI_CR &= ~MCF_SSI_CR_SSI_EN; /* disable SSI module */
29245 + /* SSI module uses internal CPU clock */
29246 + MCF_CCM_MISCCR |= MCF_CCM_MISCCR_SSISRC;
29248 + MCF_CCM_MISCCR |= MCF_CCM_MISCCR_SSIPUE;
29249 + MCF_CCM_MISCCR |= MCF_CCM_MISCCR_SSIPUS_UP;
29253 + | MCF_SSI_CR_TCH /* Enable two channel mode */
29254 + | MCF_SSI_CR_MCE /* Set clock out on SSI_MCLK pin */
29255 + | MCF_SSI_CR_I2S_MASTER /* Set I2S master mode */
29256 + | MCF_SSI_CR_SYN /* Enable synchronous mode */
29261 + | MCF_SSI_TCR_TXDIR /* internally generated bit clock */
29262 + | MCF_SSI_TCR_TFDIR /* internally generated frame sync */
29263 + | MCF_SSI_TCR_TSCKP /* Clock data on falling edge of bit clock */
29264 + | MCF_SSI_TCR_TFSI /* Frame sync active low */
29265 + | MCF_SSI_TCR_TEFS /* TX frame sync 1 bit before data */
29266 + | MCF_SSI_TCR_TFEN0 /* TX FIFO 0 enabled */
29267 + | MCF_SSI_TCR_TFEN1 /* TX FIFO 1 enabled */
29268 + | MCF_SSI_TCR_TXBIT0
29271 + MCF_SSI_CCR = MCF_SSI_CCR_WL(7) /* 16 bit word length */
29272 + | MCF_SSI_CCR_DC(1) /* Frame rate divider */
29273 + | MCF_SSI_CCR_PM(0)
29274 + | MCF_SSI_CCR_DIV2
29278 + | MCF_SSI_FCSR_TFWM0(2)
29279 + | MCF_SSI_FCSR_TFWM1(2)
29282 + MCF_SSI_IER = 0 // interrupts
29283 +#ifndef CONFIG_SSIAUDIO_USE_EDMA
29284 + | MCF_SSI_IER_TIE /* transmit interrupts */
29285 + | MCF_SSI_IER_TFE0 /* transmit FIFO 0 empty */
29286 + | MCF_SSI_IER_TFE1 /* transmit FIFO 1 empty */
29288 + | MCF_SSI_IER_TDMAE /* DMA request enabled */
29289 + | MCF_SSI_IER_TFE0 /* transmit FIFO 0 empty */
29290 + | MCF_SSI_IER_TFE1 /* transmit FIFO 1 empty */
29294 +#ifndef CONFIG_SSIAUDIO_USE_EDMA
29295 + /* enable IRQ: SSI interrupt */
29296 + MCF_INTC1_ICR(M5445x_AUDIO_IRQ_SOURCE) = M5445x_AUDIO_IRQ_LEVEL;
29297 + MCF_INTC1_CIMR = M5445x_AUDIO_IRQ_SOURCE;
29301 +#ifndef CONFIG_SSIAUDIO_USE_EDMA
29302 +/* interrupt for SSI */
29303 +static int ssi_audio_isr(int irq, void *dev_id)
29305 + unsigned long *bp;
29307 + if (audio_txbusy==0)
29308 + return IRQ_HANDLED;
29310 + spin_lock(&(audio_device->lock));
29312 + if (audio_start == audio_append) {
29314 + audio_txbusy = 0;
29316 + if (MCF_SSI_ISR & (MCF_SSI_ISR_TFE0|MCF_SSI_ISR_TFE1)) {
29317 + bp = (unsigned long *) &audio_device->audio_buf[audio_start];
29318 + if (audio_device->channel) {
29319 + MCF_SSI_TX1 = *bp;
29320 + audio_device->channel = 0;
29322 + MCF_SSI_TX0 = *bp;
29323 + audio_device->channel = 1;
29325 + audio_start += 4;
29326 + if (audio_start >= BUFSIZE)
29331 + spin_unlock(&(audio_device->lock));
29333 + return IRQ_HANDLED;
29337 +/* Set initial driver playback defaults. */
29338 +static void init_driver_variables(void)
29340 + audio_device->speed = 44100;
29341 + audio_device->format = AFMT_S16_LE;
29342 + audio_device->bits = 16;
29343 + audio_device->stereo = 1;
29344 + audio_device->ssi_enabled = 0;
29348 + audio_append = 0;
29349 + audio_appstart = 0;
29350 + audio_txbusy = 0;
29351 + audio_device->dmaing = 0;
29354 +/* open audio device */
29355 +static int ssi_audio_open(struct inode *inode, struct file *filp)
29357 +#ifdef AUDIO_DEBUG
29358 + printk(DRIVER_NAME ":ssi_audio_open()\n");
29361 + if (audio_device==NULL) return (-ENODEV);
29363 + if (audio_device->isopen)
29366 + spin_lock(&(audio_device->lock));
29368 + audio_device->isopen = 1;
29370 + init_driver_variables();
29372 + init_audio_codec();
29374 + spin_unlock(&(audio_device->lock));
29381 +/* close audio device */
29382 +static int ssi_audio_close(struct inode *inode, struct file *filp)
29384 +#ifdef AUDIO_DEBUG
29385 + printk(DRIVER_NAME ":ssi_audio_close()\n");
29388 + if (audio_device==NULL) return (-ENODEV);
29390 + ssi_audio_txdrain();
29392 + spin_lock(&(audio_device->lock));
29394 +#ifdef CONFIG_SSIAUDIO_USE_EDMA
29399 + init_driver_variables();
29400 + audio_device->isopen = 0;
29402 + spin_unlock(&(audio_device->lock));
29406 +/* write to audio device */
29407 +static ssize_t ssi_audio_write(struct file *filp, const char *buf,
29408 + size_t count, loff_t *ppos)
29410 + unsigned long *dp, *buflp;
29411 + unsigned short *bufwp;
29412 + unsigned char *bufbp;
29413 + unsigned int slen, bufcnt, i, s, e;
29415 +#ifdef AUDIO_DEBUG
29416 + printk(DRIVER_NAME ":ssi_audio_write(buf=%x,count=%d)\n",
29417 + (int)buf, count);
29420 + if (audio_device==NULL)
29421 + return (-ENODEV);
29426 + spin_lock(&(audio_device->lock));
29428 + buflp = (unsigned long *) buf;
29429 + bufwp = (unsigned short *) buf;
29430 + bufbp = (unsigned char *) buf;
29432 + bufcnt = count & ~0x3;
29435 + if (audio_device->stereo == 0)
29437 + if (audio_device->bits == 8)
29442 + * Get a snapshot of buffer, so we can figure out how
29443 + * much data we can fit in...
29446 + e = audio_append;
29447 + dp = (unsigned long *) &(audio_device->audio_buf[e]);
29449 + slen = ((s > e) ? (s - e) : (BUFSIZE - (e - s))) - 4;
29450 + if (slen > bufcnt)
29452 + if ((BUFSIZE - e) < slen)
29453 + slen = BUFSIZE - e;
29456 + if (signal_pending(current))
29457 + return(-ERESTARTSYS);
29458 + set_current_state(TASK_INTERRUPTIBLE);
29459 + schedule_timeout(1);
29464 + * For DMA we need to have data as 32 bit
29465 + * values (since SSI TX register is 32 bit).
29466 + * So, the incoming 16 bit data must be put to buffer as 32 bit values.
29467 + * Also, the endianess is converted if needed
29469 + if (audio_device->stereo) {
29470 + if (audio_device->bits == 16) {
29471 + if (audio_device->format==AFMT_S16_LE) {
29472 + /*- convert endianess, probably could be done by SSI also */
29473 + for (i = 0; (i < slen); i += 4) {
29474 + unsigned short val = le16_to_cpu((*bufwp++));
29478 + for (i = 0; (i < slen); i += 4) {
29479 + *dp++ = *bufwp++;
29483 + for (i = 0; (i < slen); i += 4) {
29484 + *dp = (((unsigned long) *bufbp++) << 24);
29485 + *dp++ |= (((unsigned long) *bufbp++) << 8);
29489 + if (audio_device->bits == 16) {
29490 + for (i = 0; (i < slen); i += 4) {
29491 + *dp++ = (((unsigned long)*bufwp)<<16) | *bufwp;
29495 + for (i = 0; (i < slen); i += 4) {
29496 + *dp++ = (((unsigned long) *bufbp) << 24) |
29497 + (((unsigned long) *bufbp) << 8);
29504 + if (e >= BUFSIZE)
29506 + audio_append = e;
29508 + /* If not outputing audio, then start now */
29509 + if (audio_txbusy == 0) {
29511 + audio_device->channel = 0;
29513 +#ifdef CONFIG_SSIAUDIO_USE_EDMA
29514 + ssi_audio_dmabuf(); /* start first DMA transfer */
29523 + spin_unlock(&(audio_device->lock));
29528 +/* ioctl: control the driver */
29529 +static int ssi_audio_ioctl(struct inode *inode, struct file *filp,
29530 + unsigned int cmd, unsigned long arg)
29535 +#ifdef AUDIO_DEBUG
29536 + printk(DRIVER_NAME ":ssi_audio_ioctl(cmd=%x,arg=%x)\n",
29537 + (int)cmd, (int)arg);
29540 + if (audio_device==NULL)
29541 + return (-ENODEV);
29545 + case SNDCTL_DSP_SPEED:
29546 + if (access_ok(VERIFY_READ, (void *) arg, sizeof(val))) {
29547 + get_user(val, (unsigned long *) arg);
29548 +#ifdef AUDIO_DEBUG
29549 + printk(DRIVER_NAME ":ssi_audio_ioctl: SNDCTL_DSP_SPEED: %ld\n", val);
29551 + ssi_audio_txdrain();
29552 + audio_device->speed = val;
29553 + init_audio_codec();
29559 + case SNDCTL_DSP_SAMPLESIZE:
29560 + if (access_ok(VERIFY_READ, (void *) arg, sizeof(val))) {
29561 + get_user(val, (unsigned long *) arg);
29562 +#ifdef AUDIO_DEBUG
29563 + printk(DRIVER_NAME ":ssi_audio_ioctl: SNDCTL_DSP_SAMPLESIZE: %d\n", val);
29565 + ssi_audio_txdrain();
29566 + ssi_audio_setsamplesize(val);
29572 + case SNDCTL_DSP_STEREO:
29573 + if (access_ok(VERIFY_READ, (void *) arg, sizeof(val))) {
29574 + get_user(val, (unsigned long *) arg);
29575 + ssi_audio_txdrain();
29576 + audio_device->stereo = val;
29582 + case SNDCTL_DSP_GETBLKSIZE:
29583 + if (access_ok(VERIFY_WRITE, (void *) arg, sizeof(long)))
29584 + put_user(BUFSIZE, (long *) arg);
29589 + case SNDCTL_DSP_SYNC:
29590 + ssi_audio_txdrain();
29601 +struct file_operations ssi_audio_fops = {
29602 + open: ssi_audio_open, /* open */
29603 + release: ssi_audio_close, /* close */
29604 + write: ssi_audio_write, /* write */
29605 + ioctl: ssi_audio_ioctl, /* ioctl */
29608 +/* initialize audio driver */
29609 +static int __devinit ssi_audio_probe(struct spi_device *spi)
29611 + struct ssi_audio *audio;
29614 +#ifdef AUDIO_DEBUG
29615 + printk(DRIVER_NAME": probe\n");
29619 + dev_dbg(&spi->dev, "no IRQ?\n");
29623 + /* don't exceed max specified sample rate */
29624 + if (spi->max_speed_hz > MAX_SPEED_HZ) {
29625 + dev_dbg(&spi->dev, "f(sample) %d KHz?\n",
29626 + (spi->max_speed_hz)/1000);
29630 + /* register charcter device */
29631 + if (register_chrdev(SOUND_MAJOR, SOUND_DEVICE_NAME, &ssi_audio_fops) < 0) {
29632 + printk(KERN_WARNING DRIVER_NAME ": failed to register major %d\n", SOUND_MAJOR);
29633 + dev_dbg(&spi->dev, DRIVER_NAME ": failed to register major %d\n", SOUND_MAJOR);
29637 + audio = kzalloc(sizeof(struct ssi_audio), GFP_KERNEL);
29643 + /* DMA buffer must be from GFP_DMA zone, so it will not be cached */
29644 + audio->audio_buf = kmalloc(BUFSIZE, GFP_DMA);
29645 + if (audio->audio_buf == NULL) {
29646 + dev_dbg(&spi->dev, DRIVER_NAME ": failed to allocate DMA[%d] buffer\n", BUFSIZE);
29648 + goto err_free_mem;
29651 + audio_device = audio;
29653 + dev_set_drvdata(&spi->dev, audio);
29654 + spi->dev.power.power_state = PMSG_ON;
29656 + audio->spi = spi;
29658 +#ifndef CONFIG_SSIAUDIO_USE_EDMA
29659 + if (request_irq(spi->irq, ssi_audio_isr, IRQF_DISABLED, spi->dev.bus_id, audio)) {
29660 + dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
29662 + goto err_free_mem;
29666 + /* request 2 eDMA channels since two channel output mode is used */
29667 + if (request_edma_channel(DMA_TCD,
29668 + ssi_audio_dma_handler_empty,
29671 + &(audio_device->lock),
29672 + DRIVER_NAME)!=0) {
29673 + dev_dbg(&spi->dev, "DMA channel %d busy?\n", DMA_TCD);
29675 + goto err_free_mem;
29677 + if (request_edma_channel(DMA_TCD2,
29678 + ssi_audio_dma_handler,
29681 + &(audio_device->lock),
29682 + DRIVER_NAME)!=0) {
29683 + dev_dbg(&spi->dev, "DMA channel %d busy?\n", DMA_TCD2);
29685 + goto err_free_mem;
29690 + printk(DRIVER_NAME ": Probed successfully\n");
29696 + audio_device = NULL;
29698 + unregister_chrdev(SOUND_MAJOR, SOUND_DEVICE_NAME);
29702 +static int __devexit ssi_audio_remove(struct spi_device *spi)
29704 + struct ssi_audio *audio = dev_get_drvdata(&spi->dev);
29706 + ssi_audio_txdrain();
29707 +#ifndef CONFIG_SSIAUDIO_USE_EDMA
29708 + free_irq(spi->irq, audio);
29710 + free_edma_channel(DMA_TCD, audio);
29711 + free_edma_channel(DMA_TCD2, audio);
29713 + kfree(audio->audio_buf);
29715 + audio_device = NULL;
29716 + unregister_chrdev(SOUND_MAJOR, SOUND_DEVICE_NAME);
29717 + dev_dbg(&spi->dev, "unregistered audio\n");
29721 +static int ssi_audio_suspend(struct spi_device *spi, pm_message_t message)
29726 +static int ssi_audio_resume(struct spi_device *spi)
29731 +static struct spi_driver ssi_audio_driver = {
29733 + .name = DRIVER_NAME,
29734 + .bus = &spi_bus_type,
29735 + .owner = THIS_MODULE,
29737 + .probe = ssi_audio_probe,
29738 + .remove = __devexit_p(ssi_audio_remove),
29739 + .suspend = ssi_audio_suspend,
29740 + .resume = ssi_audio_resume,
29743 +static int __init ssi_audio_init(void)
29745 + return spi_register_driver(&ssi_audio_driver);
29747 +module_init(ssi_audio_init);
29749 +static void __exit ssi_audio_exit(void)
29751 + spi_unregister_driver(&ssi_audio_driver);
29753 +module_exit(ssi_audio_exit);
29755 +MODULE_LICENSE("GPL");
29756 +MODULE_AUTHOR("Freescale Semiconductor, Inc.");
29757 +MODULE_DESCRIPTION("SSI/I2S Audio Driver");
29758 --- a/drivers/usb/gadget/ether.c
29759 +++ b/drivers/usb/gadget/ether.c
29760 @@ -287,6 +287,9 @@ MODULE_PARM_DESC(host_addr, "Host Ethern
29761 #define DEV_CONFIG_CDC
29764 +#ifdef CONFIG_USB_GADGET_MCF5445X
29765 +#define DEV_CONFIG_CDC
29768 /*-------------------------------------------------------------------------*/
29770 --- a/drivers/usb/gadget/fsl_usb2_udc.h
29771 +++ b/drivers/usb/gadget/fsl_usb2_udc.h
29772 @@ -83,16 +83,6 @@ struct usb_dr_host {
29773 u32 endptctrl[6]; /* Endpoint Control Registers */
29776 - /* non-EHCI USB system interface registers (Big Endian) */
29777 -struct usb_sys_interface {
29780 - u32 age_cnt_thresh; /* Age Count Threshold Register */
29781 - u32 pri_ctrl; /* Priority Control Register */
29782 - u32 si_ctrl; /* System Interface Control Register */
29784 - u32 control; /* General Purpose Control Register */
29787 /* ep0 transfer state */
29788 #define WAIT_FOR_SETUP 0
29789 @@ -101,10 +91,6 @@ struct usb_sys_interface {
29790 #define WAIT_FOR_OUT_STATUS 3
29791 #define DATA_STATE_RECV 4
29793 -/* Device Controller Capability Parameter register */
29794 -#define DCCPARAMS_DC 0x00000080
29795 -#define DCCPARAMS_DEN_MASK 0x0000001f
29797 /* Frame Index Register Bit Masks */
29798 #define USB_FRINDEX_MASKS 0x3fff
29799 /* USB CMD Register Bit Masks */
29800 @@ -180,172 +166,6 @@ struct usb_sys_interface {
29801 /* endpoint list address bit masks */
29802 #define USB_EP_LIST_ADDRESS_MASK 0xfffff800
29804 -/* PORTSCX Register Bit Masks */
29805 -#define PORTSCX_CURRENT_CONNECT_STATUS 0x00000001
29806 -#define PORTSCX_CONNECT_STATUS_CHANGE 0x00000002
29807 -#define PORTSCX_PORT_ENABLE 0x00000004
29808 -#define PORTSCX_PORT_EN_DIS_CHANGE 0x00000008
29809 -#define PORTSCX_OVER_CURRENT_ACT 0x00000010
29810 -#define PORTSCX_OVER_CURRENT_CHG 0x00000020
29811 -#define PORTSCX_PORT_FORCE_RESUME 0x00000040
29812 -#define PORTSCX_PORT_SUSPEND 0x00000080
29813 -#define PORTSCX_PORT_RESET 0x00000100
29814 -#define PORTSCX_LINE_STATUS_BITS 0x00000C00
29815 -#define PORTSCX_PORT_POWER 0x00001000
29816 -#define PORTSCX_PORT_INDICTOR_CTRL 0x0000C000
29817 -#define PORTSCX_PORT_TEST_CTRL 0x000F0000
29818 -#define PORTSCX_WAKE_ON_CONNECT_EN 0x00100000
29819 -#define PORTSCX_WAKE_ON_CONNECT_DIS 0x00200000
29820 -#define PORTSCX_WAKE_ON_OVER_CURRENT 0x00400000
29821 -#define PORTSCX_PHY_LOW_POWER_SPD 0x00800000
29822 -#define PORTSCX_PORT_FORCE_FULL_SPEED 0x01000000
29823 -#define PORTSCX_PORT_SPEED_MASK 0x0C000000
29824 -#define PORTSCX_PORT_WIDTH 0x10000000
29825 -#define PORTSCX_PHY_TYPE_SEL 0xC0000000
29827 -/* bit 11-10 are line status */
29828 -#define PORTSCX_LINE_STATUS_SE0 0x00000000
29829 -#define PORTSCX_LINE_STATUS_JSTATE 0x00000400
29830 -#define PORTSCX_LINE_STATUS_KSTATE 0x00000800
29831 -#define PORTSCX_LINE_STATUS_UNDEF 0x00000C00
29832 -#define PORTSCX_LINE_STATUS_BIT_POS 10
29834 -/* bit 15-14 are port indicator control */
29835 -#define PORTSCX_PIC_OFF 0x00000000
29836 -#define PORTSCX_PIC_AMBER 0x00004000
29837 -#define PORTSCX_PIC_GREEN 0x00008000
29838 -#define PORTSCX_PIC_UNDEF 0x0000C000
29839 -#define PORTSCX_PIC_BIT_POS 14
29841 -/* bit 19-16 are port test control */
29842 -#define PORTSCX_PTC_DISABLE 0x00000000
29843 -#define PORTSCX_PTC_JSTATE 0x00010000
29844 -#define PORTSCX_PTC_KSTATE 0x00020000
29845 -#define PORTSCX_PTC_SEQNAK 0x00030000
29846 -#define PORTSCX_PTC_PACKET 0x00040000
29847 -#define PORTSCX_PTC_FORCE_EN 0x00050000
29848 -#define PORTSCX_PTC_BIT_POS 16
29850 -/* bit 27-26 are port speed */
29851 -#define PORTSCX_PORT_SPEED_FULL 0x00000000
29852 -#define PORTSCX_PORT_SPEED_LOW 0x04000000
29853 -#define PORTSCX_PORT_SPEED_HIGH 0x08000000
29854 -#define PORTSCX_PORT_SPEED_UNDEF 0x0C000000
29855 -#define PORTSCX_SPEED_BIT_POS 26
29857 -/* bit 28 is parallel transceiver width for UTMI interface */
29858 -#define PORTSCX_PTW 0x10000000
29859 -#define PORTSCX_PTW_8BIT 0x00000000
29860 -#define PORTSCX_PTW_16BIT 0x10000000
29862 -/* bit 31-30 are port transceiver select */
29863 -#define PORTSCX_PTS_UTMI 0x00000000
29864 -#define PORTSCX_PTS_ULPI 0x80000000
29865 -#define PORTSCX_PTS_FSLS 0xC0000000
29866 -#define PORTSCX_PTS_BIT_POS 30
29868 -/* otgsc Register Bit Masks */
29869 -#define OTGSC_CTRL_VUSB_DISCHARGE 0x00000001
29870 -#define OTGSC_CTRL_VUSB_CHARGE 0x00000002
29871 -#define OTGSC_CTRL_OTG_TERM 0x00000008
29872 -#define OTGSC_CTRL_DATA_PULSING 0x00000010
29873 -#define OTGSC_STS_USB_ID 0x00000100
29874 -#define OTGSC_STS_A_VBUS_VALID 0x00000200
29875 -#define OTGSC_STS_A_SESSION_VALID 0x00000400
29876 -#define OTGSC_STS_B_SESSION_VALID 0x00000800
29877 -#define OTGSC_STS_B_SESSION_END 0x00001000
29878 -#define OTGSC_STS_1MS_TOGGLE 0x00002000
29879 -#define OTGSC_STS_DATA_PULSING 0x00004000
29880 -#define OTGSC_INTSTS_USB_ID 0x00010000
29881 -#define OTGSC_INTSTS_A_VBUS_VALID 0x00020000
29882 -#define OTGSC_INTSTS_A_SESSION_VALID 0x00040000
29883 -#define OTGSC_INTSTS_B_SESSION_VALID 0x00080000
29884 -#define OTGSC_INTSTS_B_SESSION_END 0x00100000
29885 -#define OTGSC_INTSTS_1MS 0x00200000
29886 -#define OTGSC_INTSTS_DATA_PULSING 0x00400000
29887 -#define OTGSC_INTR_USB_ID 0x01000000
29888 -#define OTGSC_INTR_A_VBUS_VALID 0x02000000
29889 -#define OTGSC_INTR_A_SESSION_VALID 0x04000000
29890 -#define OTGSC_INTR_B_SESSION_VALID 0x08000000
29891 -#define OTGSC_INTR_B_SESSION_END 0x10000000
29892 -#define OTGSC_INTR_1MS_TIMER 0x20000000
29893 -#define OTGSC_INTR_DATA_PULSING 0x40000000
29895 -/* USB MODE Register Bit Masks */
29896 -#define USB_MODE_CTRL_MODE_IDLE 0x00000000
29897 -#define USB_MODE_CTRL_MODE_DEVICE 0x00000002
29898 -#define USB_MODE_CTRL_MODE_HOST 0x00000003
29899 -#define USB_MODE_CTRL_MODE_RSV 0x00000001
29900 -#define USB_MODE_SETUP_LOCK_OFF 0x00000008
29901 -#define USB_MODE_STREAM_DISABLE 0x00000010
29902 -/* Endpoint Flush Register */
29903 -#define EPFLUSH_TX_OFFSET 0x00010000
29904 -#define EPFLUSH_RX_OFFSET 0x00000000
29906 -/* Endpoint Setup Status bit masks */
29907 -#define EP_SETUP_STATUS_MASK 0x0000003F
29908 -#define EP_SETUP_STATUS_EP0 0x00000001
29910 -/* ENDPOINTCTRLx Register Bit Masks */
29911 -#define EPCTRL_TX_ENABLE 0x00800000
29912 -#define EPCTRL_TX_DATA_TOGGLE_RST 0x00400000 /* Not EP0 */
29913 -#define EPCTRL_TX_DATA_TOGGLE_INH 0x00200000 /* Not EP0 */
29914 -#define EPCTRL_TX_TYPE 0x000C0000
29915 -#define EPCTRL_TX_DATA_SOURCE 0x00020000 /* Not EP0 */
29916 -#define EPCTRL_TX_EP_STALL 0x00010000
29917 -#define EPCTRL_RX_ENABLE 0x00000080
29918 -#define EPCTRL_RX_DATA_TOGGLE_RST 0x00000040 /* Not EP0 */
29919 -#define EPCTRL_RX_DATA_TOGGLE_INH 0x00000020 /* Not EP0 */
29920 -#define EPCTRL_RX_TYPE 0x0000000C
29921 -#define EPCTRL_RX_DATA_SINK 0x00000002 /* Not EP0 */
29922 -#define EPCTRL_RX_EP_STALL 0x00000001
29924 -/* bit 19-18 and 3-2 are endpoint type */
29925 -#define EPCTRL_EP_TYPE_CONTROL 0
29926 -#define EPCTRL_EP_TYPE_ISO 1
29927 -#define EPCTRL_EP_TYPE_BULK 2
29928 -#define EPCTRL_EP_TYPE_INTERRUPT 3
29929 -#define EPCTRL_TX_EP_TYPE_SHIFT 18
29930 -#define EPCTRL_RX_EP_TYPE_SHIFT 2
29932 -/* SNOOPn Register Bit Masks */
29933 -#define SNOOP_ADDRESS_MASK 0xFFFFF000
29934 -#define SNOOP_SIZE_ZERO 0x00 /* snooping disable */
29935 -#define SNOOP_SIZE_4KB 0x0B /* 4KB snoop size */
29936 -#define SNOOP_SIZE_8KB 0x0C
29937 -#define SNOOP_SIZE_16KB 0x0D
29938 -#define SNOOP_SIZE_32KB 0x0E
29939 -#define SNOOP_SIZE_64KB 0x0F
29940 -#define SNOOP_SIZE_128KB 0x10
29941 -#define SNOOP_SIZE_256KB 0x11
29942 -#define SNOOP_SIZE_512KB 0x12
29943 -#define SNOOP_SIZE_1MB 0x13
29944 -#define SNOOP_SIZE_2MB 0x14
29945 -#define SNOOP_SIZE_4MB 0x15
29946 -#define SNOOP_SIZE_8MB 0x16
29947 -#define SNOOP_SIZE_16MB 0x17
29948 -#define SNOOP_SIZE_32MB 0x18
29949 -#define SNOOP_SIZE_64MB 0x19
29950 -#define SNOOP_SIZE_128MB 0x1A
29951 -#define SNOOP_SIZE_256MB 0x1B
29952 -#define SNOOP_SIZE_512MB 0x1C
29953 -#define SNOOP_SIZE_1GB 0x1D
29954 -#define SNOOP_SIZE_2GB 0x1E /* 2GB snoop size */
29956 -/* pri_ctrl Register Bit Masks */
29957 -#define PRI_CTRL_PRI_LVL1 0x0000000C
29958 -#define PRI_CTRL_PRI_LVL0 0x00000003
29960 -/* si_ctrl Register Bit Masks */
29961 -#define SI_CTRL_ERR_DISABLE 0x00000010
29962 -#define SI_CTRL_IDRC_DISABLE 0x00000008
29963 -#define SI_CTRL_RD_SAFE_EN 0x00000004
29964 -#define SI_CTRL_RD_PREFETCH_DISABLE 0x00000002
29965 -#define SI_CTRL_RD_PREFEFETCH_VAL 0x00000001
29967 -/* control Register Bit Masks */
29968 -#define USB_CTRL_IOENB 0x00000004
29969 -#define USB_CTRL_ULPI_INT0EN 0x00000001
29971 /* Endpoint Queue Head data struct
29972 * Rem: all the variables of qh are LittleEndian Mode
29973 @@ -477,7 +297,10 @@ struct fsl_udc {
29976 struct usb_ctrlrequest local_setup_buff;
29978 + spinlock_t lock; /* udc lock */
29979 + struct fsl_usb2_platform_data *pdata;
29982 struct otg_transceiver *transceiver;
29983 unsigned softconnect:1;
29984 unsigned vbus_active:1;
29985 @@ -514,7 +337,7 @@ struct fsl_udc {
29986 #define DBG(fmt, args...) printk(KERN_DEBUG "[%s] " fmt "\n", \
29987 __FUNCTION__, ## args)
29989 -#define DBG(fmt, args...) do{}while(0)
29990 +#define DBG(fmt, args...) do {} while (0)
29994 @@ -548,7 +371,7 @@ static void dump_msg(const char *label,
29998 -#define VDBG(stuff...) do{}while(0)
29999 +#define VDBG(stuff...) do {} while (0)
30002 #define ERR(stuff...) pr_err("udc: " stuff)
30003 @@ -573,11 +396,14 @@ static void dump_msg(const char *label,
30004 #define ep_maxpacket(EP) ((EP)->ep.maxpacket)
30005 #define ep_is_in(EP) ( (ep_index(EP) == 0) ? (EP->udc->ep0_dir == \
30006 USB_DIR_IN ):((EP)->desc->bEndpointAddress \
30007 - & USB_DIR_IN)==USB_DIR_IN)
30008 + & USB_DIR_IN) == USB_DIR_IN)
30009 #define get_ep_by_pipe(udc, pipe) ((pipe == 1)? &udc->eps[0]: \
30011 #define get_pipe_by_windex(windex) ((windex & USB_ENDPOINT_NUMBER_MASK) \
30012 * 2 + ((windex & USB_DIR_IN) ? 1 : 0))
30013 #define get_pipe_by_ep(EP) (ep_index(EP) * 2 + ep_is_in(EP))
30015 +/* Bulk only class request */
30016 +#define USB_BULK_RESET_REQUEST 0xff
30019 --- a/drivers/usb/gadget/gadget_chips.h
30020 +++ b/drivers/usb/gadget/gadget_chips.h
30021 @@ -147,6 +147,11 @@
30022 #define gadget_is_m66592(g) 0
30025 +#ifdef CONFIG_USB_GADGET_MCF5445X
30026 +#define gadget_is_mcf5445x(g) !strcmp("fsl-usb2-udc", (g)->name)
30028 +#define gadget_is_mcf5445x(g) 0
30031 // CONFIG_USB_GADGET_SX2
30032 // CONFIG_USB_GADGET_AU1X00
30033 @@ -212,5 +217,7 @@ static inline int usb_gadget_controller_
30035 else if (gadget_is_m66592(gadget))
30037 + else if (gadget_is_mcf5445x(gadget))
30041 --- a/drivers/usb/gadget/Kconfig
30042 +++ b/drivers/usb/gadget/Kconfig
30043 @@ -231,6 +231,26 @@ config SUPERH_BUILT_IN_M66592
30044 However, this problem is improved if change a value of
30047 +config USB_GADGET_MCF5445X
30048 + boolean "MCF5445X USB Device Controller"
30049 + depends on M54455 && USB_M5445X_ULPI
30050 + select USB_GADGET_DUALSPEED
30052 + Freescale's MCF5445X processors include
30053 + an integrated device controller (as part of the OTG module).
30054 + It has four programmable, bidirectional endpoints,
30055 + including endpoint 0.
30057 + Say "y" to link the driver statically, or "m" to build a
30058 + dynamically linked module called "mcf5445_udc" and force all
30059 + gadget drivers to also be dynamically linked.
30061 +config USB_MCF5445X
30063 + depends on USB_GADGET_MCF5445X
30064 + default USB_GADGET
30065 + select USB_GADGET_SELECTED
30067 config USB_GADGET_GOKU
30068 boolean "Toshiba TC86C001 'Goku-S'"
30070 @@ -285,17 +305,6 @@ config USB_OMAP
30072 select USB_GADGET_SELECTED
30075 - boolean "OTG Support"
30076 - depends on USB_GADGET_OMAP && ARCH_OMAP_OTG && USB_OHCI_HCD
30078 - The most notable feature of USB OTG is support for a
30079 - "Dual-Role" device, which can act as either a device
30080 - or a host. The initial role choice can be changed
30081 - later, when two dual-role devices talk to each other.
30083 - Select this only if your OMAP board has a Mini-AB connector.
30085 config USB_GADGET_S3C2410
30086 boolean "S3C2410 USB Device Controller"
30087 depends on ARCH_S3C2410
30088 @@ -369,6 +378,18 @@ config USB_DUMMY_HCD
30093 + boolean "OTG Support"
30094 + depends on (USB_GADGET_OMAP && ARCH_OMAP_OTG && USB_OHCI_HCD) || \
30095 + (USB_GADGET_MCF5445X && USB_M5445X_ULPI)
30097 + The most notable feature of USB OTG is support for a
30098 + "Dual-Role" device, which can act as either a device
30099 + or a host. The initial role choice can be changed
30100 + later, when two dual-role devices talk to each other.
30102 + Select this only if your OMAP board has a Mini-AB connector.
30104 config USB_GADGET_DUALSPEED
30106 depends on USB_GADGET
30107 --- a/drivers/usb/gadget/Makefile
30108 +++ b/drivers/usb/gadget/Makefile
30109 @@ -17,6 +17,7 @@ obj-$(CONFIG_USB_AT91) += at91_udc.o
30110 obj-$(CONFIG_USB_ATMEL_USBA) += atmel_usba_udc.o
30111 obj-$(CONFIG_USB_FSL_USB2) += fsl_usb2_udc.o
30112 obj-$(CONFIG_USB_M66592) += m66592-udc.o
30113 +obj-$(CONFIG_USB_MCF5445X) += mcf5445x_udc.o
30116 # USB gadget drivers
30118 +++ b/drivers/usb/gadget/mcf5445x_udc.c
30121 + * Copyright Freescale Semiconductor, Inc. 2006-2007
30123 + * Based on mpc_udc.c code
30124 + * of Li Yang and Jiang Bo (Freescale Semiconductor, Inc.)
30127 + * This program is free software; you can redistribute it and/or modify it
30128 + * under the terms of the GNU General Public License as published by the
30129 + * Free Software Foundation; either version 2 of the License, or (at your
30130 + * option) any later version.
30132 + * This program is distributed in the hope that it will be useful,
30133 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
30134 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30135 + * GNU General Public License for more details.
30137 + * You should have received a copy of the GNU General Public License
30138 + * along with this program; if not, write to the Free Software
30139 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30141 + ***************************************************************************
30143 + * v0.004 30 July 2007 Duck
30145 + * v0.003 27 October 2006 Andrey Butok
30146 + * Added M5329EVB support (without external transceiver).
30147 + * v0.002 29 September 2006 Andrey Butok
30148 + * Some little changes. Added OTG support.
30149 + * v0.001 12 July 2006 Andrey Butok
30150 + * Initial Release - developed on uClinux with 2.6.17.1 kernel.
30151 + * Based on mpc_udc.c code
30152 + * of Li Yang and Jiang Bo (Freescale Semiconductor, Inc.)
30159 +#include <linux/module.h>
30160 +#include <linux/kernel.h>
30161 +#include <linux/ioport.h>
30162 +#include <linux/types.h>
30163 +#include <linux/errno.h>
30164 +#include <linux/delay.h>
30165 +#include <linux/sched.h>
30166 +#include <linux/slab.h>
30167 +#include <linux/init.h>
30168 +#include <linux/io.h>
30169 +#include <linux/irq.h>
30170 +#include <linux/timer.h>
30171 +#include <linux/list.h>
30172 +#include <linux/interrupt.h>
30173 +#include <linux/proc_fs.h>
30174 +#include <linux/mm.h>
30175 +#include <linux/platform_device.h>
30176 +#include <linux/moduleparam.h>
30177 +#include <linux/device.h>
30178 +#include <linux/usb/ch9.h>
30179 +#include <linux/usb/gadget.h>
30180 +#include <linux/usb/otg.h>
30181 +#include <linux/dma-mapping.h>
30182 +#include <linux/dmapool.h>
30183 +#include <linux/fsl_devices.h>
30184 +#include <linux/usb/fsl_xcvr.h>
30185 +#include <linux/usb/fsl_usb2.h>
30186 +#include <linux/pm.h>
30188 +#include <asm/byteorder.h>
30189 +#include <asm/system.h>
30190 +#include <asm/unaligned.h>
30191 +#include <asm/dma.h>
30193 +#include <asm/mcfsim.h>
30194 +#include <asm/cacheflush.h>
30196 +#include "fsl_usb2_udc.h"
30198 +#define DRIVER_DESC "Freescale High-Speed USB SoC Device Controller driver"
30199 +#define DRIVER_AUTHOR "Freescale Semiconductor Inc."
30200 +#define DRIVER_VERSION "30 July 2007"
30202 +#define cpu_to_hc32(x) (x)
30203 +#define hc32_to_cpu(x) (x)
30205 +static int udc_suspend(struct fsl_udc *udc);
30207 +#define DMA_ADDR_INVALID (~(dma_addr_t)0)
30209 +static const char driver_name[] = "fsl-usb2-udc";
30210 +static const char driver_desc[] = DRIVER_DESC;
30212 +volatile static struct fsl_usb_device_regs *dr_regs;
30213 +volatile static struct usb_sys_interface *usb_sys_regs;
30215 +/* it is initialized in probe() */
30216 +static struct fsl_udc *udc_controller;
30218 +static const struct usb_endpoint_descriptor
30220 + .bLength = USB_DT_ENDPOINT_SIZE,
30221 + .bDescriptorType = USB_DT_ENDPOINT,
30222 + .bEndpointAddress = 0,
30223 + .bmAttributes = USB_ENDPOINT_XFER_CONTROL,
30224 + .wMaxPacketSize = USB_MAX_CTRL_PAYLOAD,
30227 +static int fsl_udc_suspend(struct device *dev, pm_message_t state);
30228 +static int fsl_udc_resume(struct device *dev);
30229 +static void fsl_ep_fifo_flush(struct usb_ep *_ep);
30231 +/********************************************************************
30232 + * Internal Used Function
30233 +********************************************************************/
30234 +/*-----------------------------------------------------------------
30235 + * done() - retire a request; caller blocked irqs
30236 + * @status : request status to be set, only works when
30237 + * request is still in progress.
30238 + *--------------------------------------------------------------*/
30239 +static void done(struct fsl_ep *ep, struct fsl_req *req, int status)
30241 + struct fsl_udc *udc = NULL;
30242 + unsigned char stopped = ep->stopped;
30244 + udc = (struct fsl_udc *)ep->udc;
30246 + pr_debug("udc: req=0x%p\n", req);
30248 + pr_debug("udc: freeing head=0x%p\n", req->head);
30249 + dma_pool_free(udc->td_pool, req->head, req->head->td_dma);
30252 + /* the req->queue pointer is used by ep_queue() func, in which
30253 + * the request will be added into a udc_ep->queue 'd tail
30254 + * so here the req will be dropped from the ep->queue
30256 + list_del_init(&req->queue);
30258 + /* req.status should be set as -EINPROGRESS in ep_queue() */
30259 + if (req->req.status == -EINPROGRESS)
30260 + req->req.status = status;
30262 + status = req->req.status;
30264 + pr_debug("udc: req=0x%p mapped=%x\n", req, req->mapped);
30266 + if (req->mapped) {
30267 + pr_debug("udc: calling dma_unmap_single(buf,%s) req=0x%p "
30268 + "a=0x%x len=%d\n",
30269 + ep_is_in(ep) ? "to_dvc" : "from_dvc",
30270 + req, req->req.dma, req->req.length);
30272 + dma_unmap_single(ep->udc->gadget.dev.parent,
30273 + req->req.dma, req->req.length, ep_is_in(ep) ?
30274 + DMA_TO_DEVICE : DMA_FROM_DEVICE);
30276 + req->req.dma = DMA_ADDR_INVALID;
30278 + pr_debug("udc: req=0x%p set req.dma=0x%x\n", req, req->req.dma);
30280 + if ((req->req.length != 0)
30281 + && (req->req.dma != DMA_ADDR_INVALID)) {
30282 + pr_debug("udc: calling dma_sync_single_for_cpu(buf,%s) "
30283 + "req=0x%p dma=0x%x len=%d\n",
30284 + ep_is_in(ep) ? "to_dvc" : "from_dvc", req,
30285 + req->req.dma, req->req.length);
30287 + dma_sync_single_for_cpu(ep->udc->gadget.dev.parent,
30288 + req->req.dma, req->req.length,
30289 + ep_is_in(ep) ? DMA_TO_DEVICE :
30290 + DMA_FROM_DEVICE);
30294 + if (status && (status != -ESHUTDOWN)) {
30295 + pr_debug("udc: complete %s req 0c%p stat %d len %u/%u\n",
30296 + ep->ep.name, &req->req, status,
30297 + req->req.actual, req->req.length);
30300 + /* don't modify queue heads during completion callback */
30303 + spin_unlock(&ep->udc->lock);
30305 + /* this complete() should a func implemented by gadget layer,
30306 + * eg fsg->bulk_in_complete() */
30307 + if (req->req.complete) {
30308 + pr_debug("udc: calling gadget's complete() req=0x%p\n", req);
30309 + req->req.complete(&ep->ep, &req->req);
30310 + pr_debug("udc: back from gadget's complete()\n");
30313 + spin_lock(&ep->udc->lock);
30314 + ep->stopped = stopped;
30318 + * nuke(): delete all requests related to this ep
30319 + * called with spinlock held
30320 + *--------------------------------------------------------------*/
30321 +static void nuke(struct fsl_ep *ep, int status)
30326 + fsl_ep_fifo_flush(&ep->ep);
30328 + /* Whether this eq has request linked */
30329 + while (!list_empty(&ep->queue)) {
30330 + struct fsl_req *req = NULL;
30332 + req = list_entry(ep->queue.next, struct fsl_req, queue);
30333 + done(ep, req, status);
30337 +/*------------------------------------------------------------------
30338 + Internal Hardware related function
30339 + ------------------------------------------------------------------*/
30341 +static int dr_controller_setup(struct fsl_udc *udc)
30343 + unsigned int tmp;
30344 + unsigned int __attribute((unused)) ctrl = 0;
30345 + unsigned long timeout;
30346 + struct fsl_usb2_platform_data *pdata;
30348 +#define FSL_UDC_RESET_TIMEOUT 1000
30350 + /* before here, make sure dr_regs has been initialized */
30353 + pdata = udc->pdata;
30355 + /* Stop and reset the usb controller */
30356 + tmp = fsl_readl(&dr_regs->usbcmd);
30357 + tmp &= ~USB_CMD_RUN_STOP;
30358 + fsl_writel(tmp, &dr_regs->usbcmd);
30360 + tmp = fsl_readl(&dr_regs->usbcmd);
30361 + tmp |= USB_CMD_CTRL_RESET;
30362 + fsl_writel(tmp, &dr_regs->usbcmd);
30364 + /* Wait for reset to complete */
30365 + timeout = jiffies + FSL_UDC_RESET_TIMEOUT;
30366 + while (fsl_readl(&dr_regs->usbcmd) & USB_CMD_CTRL_RESET) {
30367 + if (time_after(jiffies, timeout)) {
30368 + ERR("udc reset timeout! \n");
30369 + return -ETIMEDOUT;
30374 + tmp = fsl_readl(&dr_regs->usbmode);
30375 + tmp &= ~0x3; /* clear mode bits */
30376 + tmp |= USB_MODE_CTRL_MODE_DEVICE;
30377 + /* Disable Setup Lockout */
30378 + tmp |= USB_MODE_SETUP_LOCK_OFF;
30380 + tmp |= USBMODE_ES;
30381 + fsl_writel(tmp, &dr_regs->usbmode);
30383 + if (pdata->xcvr_ops && pdata->xcvr_ops->set_device)
30384 + pdata->xcvr_ops->set_device();
30386 + /* Clear the setup status */
30387 + fsl_writel(0, &dr_regs->usbsts);
30389 + tmp = udc->ep_qh_dma;
30390 + tmp &= USB_EP_LIST_ADDRESS_MASK;
30391 + fsl_writel(tmp, &dr_regs->endpointlistaddr);
30394 + VDBG("vir[qh_base] is %p phy[qh_base] is 0x%8x reg is 0x%8x",
30395 + (int)udc->ep_qh, (int)tmp,
30396 + fsl_readl(&dr_regs->endpointlistaddr));
30400 + if (pdata->have_sysif_regs) {
30401 + /* Config control enable i/o output, cpu endian register */
30402 + ctrl = __raw_readl(&usb_sys_regs->control);
30403 + ctrl |= USB_CTRL_IOENB;
30404 + __raw_writel(ctrl, &usb_sys_regs->control);
30407 +#if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
30408 + /* Turn on cache snooping hardware, since some PowerPC platforms
30409 + * wholly rely on hardware to deal with cache coherent. */
30411 + if (pdata->have_sysif_regs) {
30412 + /* Setup Snooping for all the 4GB space */
30413 + tmp = SNOOP_SIZE_2GB; /* starts from 0x0, size 2G */
30414 + __raw_writel(tmp, &usb_sys_regs->snoop1);
30415 + tmp |= 0x80000000; /* starts from 0x8000000, size 2G */
30416 + __raw_writel(tmp, &usb_sys_regs->snoop2);
30423 +static void pullup_enable(struct fsl_udc *udc)
30427 + unsigned short ccm = fsl_readw(&MCF_CCM_UOCSR);
30428 + ccm |= MCF_CCM_UOCSR_BVLD;
30429 + ccm &= ~MCF_CCM_UOCSR_SEND;
30430 + fsl_writew(ccm, &MCF_CCM_UOCSR);
30432 + /* Enable DR irq reg */
30433 + temp = USB_INTR_INT_EN | USB_INTR_ERR_INT_EN
30434 + | USB_INTR_PTC_DETECT_EN | USB_INTR_RESET_EN
30435 + | USB_INTR_DEVICE_SUSPEND | USB_INTR_SYS_ERR_EN;
30437 + fsl_writel(temp, &dr_regs->usbintr);
30439 + /* Set controller to Run */
30440 + temp = fsl_readl(&dr_regs->usbcmd);
30441 + temp |= USB_CMD_RUN_STOP;
30442 + fsl_writel(temp, &dr_regs->usbcmd);
30445 +static void pullup_disable(struct fsl_udc *udc)
30447 + unsigned int tmp;
30448 + unsigned short ccm;
30451 + /* disable all INTRs */
30452 + fsl_writel(0, &dr_regs->usbintr);
30454 + ccm = fsl_readw(&MCF_CCM_UOCSR);
30455 + ccm &= ~MCF_CCM_UOCSR_BVLD;
30456 + fsl_writew(ccm, &MCF_CCM_UOCSR);
30458 + /* set controller to Stop */
30459 + tmp = fsl_readl(&dr_regs->usbcmd);
30460 + tmp &= ~USB_CMD_RUN_STOP;
30461 + fsl_writel(tmp, &dr_regs->usbcmd);
30464 +static void dr_controller_run(struct fsl_udc *udc)
30467 + pullup_enable(udc);
30468 + udc->stopped = 0;
30471 +static void dr_controller_stop(struct fsl_udc *udc)
30473 + pullup_disable(udc);
30474 + udc->stopped = 1;
30475 + udc->gadget.b_hnp_enable = 0;
30476 + udc->gadget.a_hnp_support = 0;
30477 + udc->gadget.a_alt_hnp_support = 0;
30480 +void dr_ep_setup(unsigned char ep_num, unsigned char dir, unsigned char ep_type)
30482 + unsigned int tmp_epctrl = 0;
30484 + tmp_epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
30487 + tmp_epctrl |= EPCTRL_TX_DATA_TOGGLE_RST;
30488 + tmp_epctrl |= EPCTRL_TX_ENABLE;
30489 + tmp_epctrl |= ((unsigned int)(ep_type)
30490 + << EPCTRL_TX_EP_TYPE_SHIFT);
30493 + tmp_epctrl |= EPCTRL_RX_DATA_TOGGLE_RST;
30494 + tmp_epctrl |= EPCTRL_RX_ENABLE;
30495 + tmp_epctrl |= ((unsigned int)(ep_type)
30496 + << EPCTRL_RX_EP_TYPE_SHIFT);
30499 + fsl_writel(tmp_epctrl, &dr_regs->endptctrl[ep_num]);
30502 +static void dr_ep_change_stall(unsigned char ep_num, unsigned char dir,
30505 + u32 tmp_epctrl = 0;
30507 + tmp_epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
30510 + /* set the stall bit */
30512 + tmp_epctrl |= EPCTRL_TX_EP_STALL;
30514 + tmp_epctrl |= EPCTRL_RX_EP_STALL;
30516 + /* clear the stall bit and reset data toggle */
30518 + tmp_epctrl &= ~EPCTRL_TX_EP_STALL;
30519 + tmp_epctrl |= EPCTRL_TX_DATA_TOGGLE_RST;
30521 + tmp_epctrl &= ~EPCTRL_RX_EP_STALL;
30522 + tmp_epctrl |= EPCTRL_RX_DATA_TOGGLE_RST;
30525 + fsl_writel(tmp_epctrl, &dr_regs->endptctrl[ep_num]);
30528 +/* Get stall status of a specific ep
30529 + Return: 0: not stalled; 1:stalled */
30530 +static int dr_ep_get_stall(unsigned char ep_num, unsigned char dir)
30534 + epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
30536 + return (epctrl & EPCTRL_TX_EP_STALL) ? 1 : 0;
30538 + return (epctrl & EPCTRL_RX_EP_STALL) ? 1 : 0;
30541 +/********************************************************************
30542 + Internal Structure Build up functions
30543 +********************************************************************/
30545 +/*------------------------------------------------------------------
30546 +* struct_ep_qh_setup(): set the Endpoint Capabilites field of QH
30547 + * @zlt: Zero Length Termination Select (1: disable; 0: enable)
30548 + * @mult: Mult field
30549 + ------------------------------------------------------------------*/
30550 +static void struct_ep_qh_setup(struct fsl_udc *udc, unsigned char ep_num,
30551 + unsigned char dir, unsigned char ep_type,
30552 + unsigned int max_pkt_len,
30553 + unsigned int zlt, unsigned char mult)
30555 + struct ep_queue_head *p_QH = &udc->ep_qh[2 * ep_num + dir];
30556 + unsigned int tmp = 0;
30558 + /* set the Endpoint Capabilites in QH */
30559 + switch (ep_type) {
30560 + case USB_ENDPOINT_XFER_CONTROL:
30561 + /* Interrupt On Setup (IOS). for control ep */
30562 + tmp = (max_pkt_len << EP_QUEUE_HEAD_MAX_PKT_LEN_POS)
30563 + | EP_QUEUE_HEAD_IOS;
30565 + case USB_ENDPOINT_XFER_ISOC:
30566 + tmp = (max_pkt_len << EP_QUEUE_HEAD_MAX_PKT_LEN_POS)
30567 + | (mult << EP_QUEUE_HEAD_MULT_POS);
30569 + case USB_ENDPOINT_XFER_BULK:
30570 + case USB_ENDPOINT_XFER_INT:
30571 + tmp = max_pkt_len << EP_QUEUE_HEAD_MAX_PKT_LEN_POS;
30574 + VDBG("error ep type is %d", ep_type);
30578 + tmp |= EP_QUEUE_HEAD_ZLT_SEL;
30579 + p_QH->max_pkt_length = cpu_to_hc32(tmp);
30584 +/* Setup qh structure and ep register for ep0. */
30585 +static void ep0_setup(struct fsl_udc *udc)
30587 + /* the intialization of an ep includes: fields in QH, Regs,
30588 + * fsl_ep struct */
30589 + struct_ep_qh_setup(udc, 0, USB_RECV, USB_ENDPOINT_XFER_CONTROL,
30590 + USB_MAX_CTRL_PAYLOAD, 0, 0);
30591 + struct_ep_qh_setup(udc, 0, USB_SEND, USB_ENDPOINT_XFER_CONTROL,
30592 + USB_MAX_CTRL_PAYLOAD, 0, 0);
30593 + dr_ep_setup(0, USB_RECV, USB_ENDPOINT_XFER_CONTROL);
30594 + dr_ep_setup(0, USB_SEND, USB_ENDPOINT_XFER_CONTROL);
30600 +/***********************************************************************
30601 + Endpoint Management Functions
30602 +***********************************************************************/
30604 +/*-------------------------------------------------------------------------
30605 + * when configurations are set, or when interface settings change
30606 + * for example the do_set_interface() in gadget layer,
30607 + * the driver will enable or disable the relevant endpoints
30608 + * ep0 doesn't use this routine. It is always enabled.
30609 +-------------------------------------------------------------------------*/
30610 +static int fsl_ep_enable(struct usb_ep *_ep,
30611 + const struct usb_endpoint_descriptor *desc)
30613 + struct fsl_udc *udc = NULL;
30614 + struct fsl_ep *ep = NULL;
30615 + unsigned short max = 0;
30616 + unsigned char mult = 0, zlt;
30617 + int retval = -EINVAL;
30618 + unsigned long flags = 0;
30620 + ep = container_of(_ep, struct fsl_ep, ep);
30622 + /* catch various bogus parameters */
30623 + if (!_ep || !desc || ep->desc
30624 + || (desc->bDescriptorType != USB_DT_ENDPOINT))
30629 + if (!udc->driver || (udc->gadget.speed == USB_SPEED_UNKNOWN))
30630 + return -ESHUTDOWN;
30632 + max = le16_to_cpu(desc->wMaxPacketSize);
30634 + /* Disable automatic zlp generation. Driver is reponsible to indicate
30635 + * explicitly through req->req.zero. This is needed to enable multi-td
30639 + /* Assume the max packet size from gadget is always correct */
30640 + switch (desc->bmAttributes & 0x03) {
30641 + case USB_ENDPOINT_XFER_CONTROL:
30642 + case USB_ENDPOINT_XFER_BULK:
30643 + case USB_ENDPOINT_XFER_INT:
30644 + /* mult = 0. Execute N Transactions as demonstrated by
30645 + * the USB variable length packet protocol where N is
30646 + * computed using the Maximum Packet Length (dQH) and
30647 + * the Total Bytes field (dTD) */
30650 + case USB_ENDPOINT_XFER_ISOC:
30651 + /* Calculate transactions needed for high bandwidth iso */
30652 + mult = (unsigned char)(1 + ((max >> 11) & 0x03));
30653 + max = max & 0x8ff; /* bit 0~10 */
30654 + /* 3 transactions at most */
30662 + spin_lock_irqsave(&udc->lock, flags);
30663 + ep->ep.maxpacket = max;
30667 + /* Controller related setup */
30668 + /* Init EPx Queue Head (Ep Capabilites field in QH
30669 + * according to max, zlt, mult) */
30670 + struct_ep_qh_setup(udc, (unsigned char) ep_index(ep),
30671 + (unsigned char) ((desc->bEndpointAddress & USB_DIR_IN)
30672 + ? USB_SEND : USB_RECV),
30673 + (unsigned char) (desc->bmAttributes
30674 + & USB_ENDPOINT_XFERTYPE_MASK),
30677 + /* Init endpoint ctrl register */
30678 + dr_ep_setup((unsigned char) ep_index(ep),
30679 + (unsigned char) ((desc->bEndpointAddress & USB_DIR_IN)
30680 + ? USB_SEND : USB_RECV),
30681 + (unsigned char) (desc->bmAttributes
30682 + & USB_ENDPOINT_XFERTYPE_MASK));
30684 + spin_unlock_irqrestore(&udc->lock, flags);
30687 + VDBG("enabled %s (ep%d%s) maxpacket %d", ep->ep.name,
30688 + ep->desc->bEndpointAddress & 0x0f,
30689 + (desc->bEndpointAddress & USB_DIR_IN)
30690 + ? "in" : "out", max);
30695 +/*---------------------------------------------------------------------
30696 + * @ep : the ep being unconfigured. May not be ep0
30697 + * Any pending and uncomplete req will complete with status (-ESHUTDOWN)
30698 +*---------------------------------------------------------------------*/
30699 +static int fsl_ep_disable(struct usb_ep *_ep)
30701 + struct fsl_udc *udc = NULL;
30702 + struct fsl_ep *ep = NULL;
30703 + unsigned long flags = 0;
30707 + ep = container_of(_ep, struct fsl_ep, ep);
30708 + if (!_ep || !ep->desc) {
30709 + pr_debug("udc: %s not enabled\n", _ep ? ep->ep.name : NULL);
30713 + /* disable ep on controller */
30714 + ep_num = ep_index(ep);
30715 + epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
30716 + if (ep_is_in(ep))
30717 + epctrl &= ~EPCTRL_TX_ENABLE;
30719 + epctrl &= ~EPCTRL_RX_ENABLE;
30720 + fsl_writel(epctrl, &dr_regs->endptctrl[ep_num]);
30722 + udc = (struct fsl_udc *)ep->udc;
30723 + spin_lock_irqsave(&udc->lock, flags);
30725 + /* nuke all pending requests (does flush) */
30726 + nuke(ep, -ESHUTDOWN);
30730 + spin_unlock_irqrestore(&udc->lock, flags);
30732 + pr_debug("udc: disabled %s OK\n", _ep->name);
30736 +/*---------------------------------------------------------------------
30737 + * allocate a request object used by this endpoint
30738 + * the main operation is to insert the req->queue to the eq->queue
30739 + * Returns the request, or null if one could not be allocated
30740 +*---------------------------------------------------------------------*/
30741 +static struct usb_request *
30742 +fsl_alloc_request(struct usb_ep *_ep, gfp_t gfp_flags)
30744 + struct fsl_req *req = NULL;
30746 + req = kzalloc(sizeof *req, gfp_flags);
30750 + req->req.dma = DMA_ADDR_INVALID;
30751 + pr_debug("udc: req=0x%p set req.dma=0x%x\n", req, req->req.dma);
30752 + INIT_LIST_HEAD(&req->queue);
30754 + return &req->req;
30757 +static void fsl_free_request(struct usb_ep *_ep, struct usb_request *_req)
30759 + struct fsl_req *req;
30761 + req = container_of(_req, struct fsl_req, req);
30762 + pr_debug("udc: req=0x%p\n", req);
30768 +/*-------------------------------------------------------------------------*/
30769 +static int fsl_queue_td(struct fsl_ep *ep, struct fsl_req *req)
30771 + int i = ep_index(ep) * 2 + ep_is_in(ep);
30772 + u32 temp, bitmask, tmp_stat;
30773 + struct ep_queue_head *dQH = &ep->udc->ep_qh[i];
30775 + pr_debug("udc: queue req=0x%p to ep index %d\n", req, i);
30777 + bitmask = ep_is_in(ep)
30778 + ? (1 << (ep_index(ep) + 16))
30779 + : (1 << (ep_index(ep)));
30781 + /* check if the pipe is empty */
30782 + if (!(list_empty(&ep->queue))) {
30783 + /* Add td to the end */
30784 + struct fsl_req *lastreq;
30785 + lastreq = list_entry(ep->queue.prev, struct fsl_req, queue);
30786 + lastreq->tail->next_td_ptr =
30787 + cpu_to_hc32(req->head->td_dma & DTD_ADDR_MASK);
30788 + /* Read prime bit, if 1 goto done */
30789 + if (fsl_readl(&dr_regs->endpointprime) & bitmask)
30793 + /* Set ATDTW bit in USBCMD */
30794 + temp = fsl_readl(&dr_regs->usbcmd);
30795 + fsl_writel(temp | USB_CMD_ATDTW, &dr_regs->usbcmd);
30797 + /* Read correct status bit */
30798 + tmp_stat = fsl_readl(&dr_regs->endptstatus) & bitmask;
30800 + } while (!(fsl_readl(&dr_regs->usbcmd) & USB_CMD_ATDTW));
30802 + /* Write ATDTW bit to 0 */
30803 + temp = fsl_readl(&dr_regs->usbcmd);
30804 + fsl_writel(temp & ~USB_CMD_ATDTW, &dr_regs->usbcmd);
30810 + /* Write dQH next pointer and terminate bit to 0 */
30811 + temp = req->head->td_dma & EP_QUEUE_HEAD_NEXT_POINTER_MASK;
30812 + dQH->next_dtd_ptr = cpu_to_hc32(temp);
30814 + /* Clear active and halt bit */
30815 + temp = cpu_to_hc32(~(EP_QUEUE_HEAD_STATUS_ACTIVE
30816 + | EP_QUEUE_HEAD_STATUS_HALT));
30817 + dQH->size_ioc_int_sts &= temp;
30819 + /* Prime endpoint by writing 1 to ENDPTPRIME */
30820 + temp = ep_is_in(ep)
30821 + ? (1 << (ep_index(ep) + 16))
30822 + : (1 << (ep_index(ep)));
30823 + fsl_writel(temp, &dr_regs->endpointprime);
30828 +/* Fill in the dTD structure
30829 + * @req: request that the transfer belongs to
30830 + * @length: return actually data length of the dTD
30831 + * @dma: return dma address of the dTD
30832 + * @is_last: return flag if it is the last dTD of the request
30833 + * return: pointer to the built dTD */
30834 +static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req, unsigned *length,
30835 + dma_addr_t *dma, int *is_last)
30838 + struct ep_td_struct *dtd;
30840 + /* how big will this transfer be? */
30841 + *length = min(req->req.length - req->req.actual,
30842 + (unsigned)EP_MAX_LENGTH_TRANSFER);
30844 + dtd = dma_pool_alloc(udc_controller->td_pool, GFP_KERNEL, dma);
30848 + dtd->td_dma = *dma;
30849 + /* Clear reserved field */
30850 + swap_temp = hc32_to_cpu(dtd->size_ioc_sts);
30851 + swap_temp &= ~DTD_RESERVED_FIELDS;
30852 + dtd->size_ioc_sts = cpu_to_hc32(swap_temp);
30854 + /* Init all of buffer page pointers */
30855 + swap_temp = (u32) (req->req.dma + req->req.actual);
30856 + dtd->buff_ptr0 = cpu_to_hc32(swap_temp);
30857 + dtd->buff_ptr1 = cpu_to_hc32(swap_temp + 0x1000);
30858 + dtd->buff_ptr2 = cpu_to_hc32(swap_temp + 0x2000);
30859 + dtd->buff_ptr3 = cpu_to_hc32(swap_temp + 0x3000);
30860 + dtd->buff_ptr4 = cpu_to_hc32(swap_temp + 0x4000);
30862 + req->req.actual += *length;
30864 + /* zlp is needed if req->req.zero is set */
30865 + if (req->req.zero) {
30866 + if (*length == 0 || (*length % req->ep->ep.maxpacket) != 0)
30870 + } else if (req->req.length == req->req.actual)
30875 + if ((*is_last) == 0)
30876 + VDBG("multi-dtd request!\n");
30877 + /* Fill in the transfer size; set active bit */
30878 + swap_temp = ((*length << DTD_LENGTH_BIT_POS) | DTD_STATUS_ACTIVE);
30880 + /* Enable interrupt for the last dtd of a request */
30881 + if (*is_last && !req->req.no_interrupt)
30882 + swap_temp |= DTD_IOC;
30884 + dtd->size_ioc_sts = cpu_to_hc32(swap_temp);
30888 + VDBG("length = %d address= 0x%x", *length, (int)*dma);
30893 +/* Generate dtd chain for a request */
30894 +static int fsl_req_to_dtd(struct fsl_req *req)
30898 + int is_first = 1;
30899 + struct ep_td_struct *last_dtd = NULL, *dtd;
30903 + dtd = fsl_build_dtd(req, &count, &dma, &is_last);
30911 + last_dtd->next_td_ptr = hc32_to_cpu(dma);
30912 + last_dtd->next_td_virt = dtd;
30916 + req->dtd_count++;
30917 + } while (!is_last);
30919 + dtd->next_td_ptr = cpu_to_hc32(DTD_NEXT_TERMINATE);
30926 +/* queues (submits) an I/O request to an endpoint */
30928 +fsl_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
30930 + struct fsl_ep *ep = container_of(_ep, struct fsl_ep, ep);
30931 + struct fsl_req *req = container_of(_req, struct fsl_req, req);
30932 + struct fsl_udc *udc;
30933 + unsigned long flags;
30936 + /* catch various bogus parameters */
30937 + if (!_req || !req->req.complete || !req->req.buf
30938 + || !list_empty(&req->queue)) {
30939 + VDBG("%s, bad params\n", __FUNCTION__);
30942 + if (!_ep || (!ep->desc && ep_index(ep))) {
30943 + VDBG("%s, bad ep\n", __FUNCTION__);
30946 + if (ep->desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
30947 + if (req->req.length > ep->ep.maxpacket)
30948 + return -EMSGSIZE;
30953 + if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN)
30954 + return -ESHUTDOWN;
30958 + /* map virtual address to hardware */
30959 + if (req->req.dma == DMA_ADDR_INVALID) {
30960 + req->req.dma = dma_map_single(ep->udc->gadget.dev.parent,
30962 + req->req.length, ep_is_in(ep)
30964 + : DMA_FROM_DEVICE);
30967 + dma_sync_single_for_device(ep->udc->gadget.dev.parent,
30968 + req->req.dma, req->req.length,
30971 + : DMA_FROM_DEVICE);
30975 + req->req.status = -EINPROGRESS;
30976 + req->req.actual = 0;
30977 + req->dtd_count = 0;
30979 + spin_lock_irqsave(&udc->lock, flags);
30981 + /* build dtds and push them to device queue */
30982 + if (!fsl_req_to_dtd(req)) {
30983 + fsl_queue_td(ep, req);
30985 + spin_unlock_irqrestore(&udc->lock, flags);
30989 + /* Update ep0 state */
30990 + if ((ep_index(ep) == 0))
30991 + udc->ep0_state = DATA_STATE_XMIT;
30993 + /* irq handler advances the queue */
30995 + list_add_tail(&req->queue, &ep->queue);
30996 + spin_unlock_irqrestore(&udc->lock, flags);
31001 +/* dequeues (cancels, unlinks) an I/O request from an endpoint */
31002 +static int fsl_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
31004 + struct fsl_ep *ep = container_of(_ep, struct fsl_ep, ep);
31005 + struct fsl_req *req;
31006 + unsigned long flags;
31007 + int ep_num, stopped, ret = 0;
31010 + if (!_ep || !_req)
31013 + spin_lock_irqsave(&ep->udc->lock, flags);
31014 + stopped = ep->stopped;
31016 + /* Stop the ep before we deal with the queue */
31018 + ep_num = ep_index(ep);
31019 + epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
31020 + if (ep_is_in(ep))
31021 + epctrl &= ~EPCTRL_TX_ENABLE;
31023 + epctrl &= ~EPCTRL_RX_ENABLE;
31024 + fsl_writel(epctrl, &dr_regs->endptctrl[ep_num]);
31026 + /* make sure it's actually queued on this endpoint */
31027 + list_for_each_entry(req, &ep->queue, queue) {
31028 + if (&req->req == _req)
31031 + if (&req->req != _req) {
31036 + /* The request is in progress, or completed but not dequeued */
31037 + if (ep->queue.next == &req->queue) {
31038 + _req->status = -ECONNRESET;
31039 + fsl_ep_fifo_flush(_ep); /* flush current transfer */
31041 + /* The request isn't the last request in this ep queue */
31042 + if (req->queue.next != &ep->queue) {
31043 + struct ep_queue_head *qh;
31044 + struct fsl_req *next_req;
31047 + next_req = list_entry(req->queue.next, struct fsl_req,
31050 + /* Point the QH to the first TD of next request */
31051 + fsl_writel((u32) next_req->head, &qh->curr_dtd_ptr);
31054 + /* The request hasn't been processed, patch up the TD chain */
31056 + struct fsl_req *prev_req;
31058 + prev_req = list_entry(req->queue.prev, struct fsl_req, queue);
31059 + fsl_writel(fsl_readl(&req->tail->next_td_ptr),
31060 + &prev_req->tail->next_td_ptr);
31064 + done(ep, req, -ECONNRESET);
31067 +out: epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]);
31068 + if (ep_is_in(ep))
31069 + epctrl |= EPCTRL_TX_ENABLE;
31071 + epctrl |= EPCTRL_RX_ENABLE;
31072 + fsl_writel(epctrl, &dr_regs->endptctrl[ep_num]);
31073 + ep->stopped = stopped;
31075 + spin_unlock_irqrestore(&ep->udc->lock, flags);
31079 +/*-------------------------------------------------------------------------*/
31081 +/*-----------------------------------------------------------------
31082 + * modify the endpoint halt feature
31083 + * @ep: the non-isochronous endpoint being stalled
31084 + * @value: 1--set halt 0--clear halt
31085 + * Returns zero, or a negative error code.
31086 +*----------------------------------------------------------------*/
31087 +static int fsl_ep_set_halt(struct usb_ep *_ep, int value)
31089 + struct fsl_ep *ep = NULL;
31090 + unsigned long flags = 0;
31091 + int status = -EOPNOTSUPP; /* operation not supported */
31092 + unsigned char ep_dir = 0, ep_num = 0;
31093 + struct fsl_udc *udc = NULL;
31095 + ep = container_of(_ep, struct fsl_ep, ep);
31097 + if (!_ep || !ep->desc) {
31098 + status = -EINVAL;
31102 + if (ep->desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
31103 + status = -EOPNOTSUPP;
31107 + /* Attempt to halt IN ep will fail if any transfer requests
31108 + * are still queue */
31109 + if (value && ep_is_in(ep) && !list_empty(&ep->queue)) {
31110 + status = -EAGAIN;
31115 + ep_dir = ep_is_in(ep) ? USB_SEND : USB_RECV;
31116 + ep_num = (unsigned char)(ep_index(ep));
31117 + spin_lock_irqsave(&ep->udc->lock, flags);
31118 + dr_ep_change_stall(ep_num, ep_dir, value);
31119 + spin_unlock_irqrestore(&ep->udc->lock, flags);
31121 + if (ep_index(ep) == 0) {
31122 + udc->ep0_state = WAIT_FOR_SETUP;
31123 + udc->ep0_dir = 0;
31126 + VDBG(" %s %s halt stat %d", ep->ep.name,
31127 + value ? "set" : "clear", status);
31132 +static void fsl_ep_fifo_flush(struct usb_ep *_ep)
31134 + struct fsl_ep *ep;
31135 + int ep_num, ep_dir;
31137 + unsigned long timeout;
31138 +#define FSL_UDC_FLUSH_TIMEOUT 1000
31143 + ep = container_of(_ep, struct fsl_ep, ep);
31147 + ep_num = ep_index(ep);
31148 + ep_dir = ep_is_in(ep) ? USB_SEND : USB_RECV;
31151 + bits = (1 << 16) | 1;
31152 + else if (ep_dir == USB_SEND)
31153 + bits = 1 << (16 + ep_num);
31155 + bits = 1 << ep_num;
31157 + timeout = jiffies + FSL_UDC_FLUSH_TIMEOUT;
31159 + fsl_writel(bits, &dr_regs->endptflush);
31161 + /* Wait until flush complete */
31162 + while (fsl_readl(&dr_regs->endptflush)) {
31163 + if (time_after(jiffies, timeout)) {
31164 + ERR("ep flush timeout\n");
31169 + /* See if we need to flush again */
31170 + } while (fsl_readl(&dr_regs->endptstatus) & bits);
31173 +static struct usb_ep_ops fsl_ep_ops = {
31174 + .enable = fsl_ep_enable,
31175 + .disable = fsl_ep_disable,
31177 + .alloc_request = fsl_alloc_request,
31178 + .free_request = fsl_free_request,
31180 + .queue = fsl_ep_queue,
31181 + .dequeue = fsl_ep_dequeue,
31183 + .set_halt = fsl_ep_set_halt,
31184 + .fifo_flush = fsl_ep_fifo_flush, /* flush fifo */
31187 +/*-------------------------------------------------------------------------
31188 + Gadget Driver Layer Operations
31189 +-------------------------------------------------------------------------*/
31191 +/*----------------------------------------------------------------------
31192 + * Get the current frame number (from DR frame_index Reg )
31193 + *----------------------------------------------------------------------*/
31194 +static int fsl_get_frame(struct usb_gadget *gadget)
31196 + return (int)(fsl_readl(&dr_regs->frindex) & USB_FRINDEX_MASKS);
31199 +/*-----------------------------------------------------------------------
31200 + * Tries to wake up the host connected to this gadget
31201 + -----------------------------------------------------------------------*/
31202 +static int fsl_wakeup(struct usb_gadget *gadget)
31204 + struct fsl_udc *udc = container_of(gadget, struct fsl_udc, gadget);
31207 + /* Remote wakeup feature not enabled by host */
31208 + if (!udc->remote_wakeup)
31209 + return -ENOTSUPP;
31211 + portsc = fsl_readl(&dr_regs->portsc1);
31212 + /* not suspended? */
31213 + if (!(portsc & PORTSCX_PORT_SUSPEND))
31215 + /* trigger force resume */
31216 + portsc |= PORTSCX_PORT_FORCE_RESUME;
31217 + fsl_writel(portsc, &dr_regs->portsc1);
31221 +static int can_pullup(struct fsl_udc *udc)
31223 + return udc->driver && udc->softconnect && udc->vbus_active;
31227 + * Notify controller that VBUS is powered, Called by whatever
31228 + * detects VBUS sessions
31229 + * @param gadger gadger pointer
31230 + * @param is_active is active?
31231 + * @return Returns zero on success , or a negative error code
31233 +static int fsl_vbus_session(struct usb_gadget *gadget, int is_active)
31235 + struct fsl_udc *udc;
31236 + unsigned long flags;
31238 + udc = container_of(gadget, struct fsl_udc, gadget);
31239 + spin_lock_irqsave(&udc->lock, flags);
31241 + pr_debug("udc: VBUS %s\n", is_active ? "on" : "off");
31242 + udc->vbus_active = (is_active != 0);
31244 + if (can_pullup(udc)) {
31245 + pullup_enable(udc);
31246 + udc_controller->usb_state = USB_STATE_ATTACHED;
31248 + pullup_disable(udc);
31249 + udc_controller->usb_state = USB_STATE_NOTATTACHED;
31251 + udc_controller->ep0_state = WAIT_FOR_SETUP;
31252 + udc_controller->ep0_dir = 0;
31254 + spin_unlock_irqrestore(&udc->lock, flags);
31258 +/* constrain controller's VBUS power usage
31259 + * This call is used by gadget drivers during SET_CONFIGURATION calls,
31260 + * reporting how much power the device may consume. For example, this
31261 + * could affect how quickly batteries are recharged.
31263 + * Returns zero on success, else negative errno.
31265 +static int fsl_vbus_draw(struct usb_gadget *gadget, unsigned mA)
31267 +#ifdef CONFIG_USB_OTG
31268 + struct fsl_udc *udc;
31270 + udc = container_of(gadget, struct fsl_udc, gadget);
31272 + if (udc->transceiver)
31273 + return otg_set_power(udc->transceiver, mA);
31275 + return -ENOTSUPP;
31279 + * Change Data+ pullup status
31280 + * this func is used by usb_gadget_connect/disconnet
31282 +static int fsl_pullup(struct usb_gadget *gadget, int is_on)
31284 + struct fsl_udc *udc;
31286 + udc = container_of(gadget, struct fsl_udc, gadget);
31287 + udc->softconnect = (is_on != 0);
31288 + if (can_pullup(udc))
31289 + fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP),
31290 + &dr_regs->usbcmd);
31292 + fsl_writel((fsl_readl(&dr_regs->usbcmd) & ~USB_CMD_RUN_STOP),
31293 + &dr_regs->usbcmd);
31298 +/* defined in usb_gadget.h */
31299 +static struct usb_gadget_ops fsl_gadget_ops = {
31300 + .get_frame = fsl_get_frame,
31301 + .wakeup = fsl_wakeup,
31302 + .vbus_session = fsl_vbus_session,
31303 + .vbus_draw = fsl_vbus_draw,
31304 + .pullup = fsl_pullup,
31307 +/* Set protocol stall on ep0, protocol stall will automatically be cleared
31308 + on new transaction */
31309 +static void ep0stall(struct fsl_udc *udc)
31313 + /* must set tx and rx to stall at the same time */
31314 + tmp = fsl_readl(&dr_regs->endptctrl[0]);
31315 + tmp |= EPCTRL_TX_EP_STALL | EPCTRL_RX_EP_STALL;
31316 + fsl_writel(tmp, &dr_regs->endptctrl[0]);
31317 + udc->ep0_state = WAIT_FOR_SETUP;
31318 + udc->ep0_dir = 0;
31321 +/* Prime a status phase for ep0 */
31322 +static int ep0_prime_status(struct fsl_udc *udc, int direction)
31324 + struct fsl_req *req = udc->status_req;
31325 + struct fsl_ep *ep;
31328 + if (direction == EP_DIR_IN)
31329 + udc->ep0_dir = USB_DIR_IN;
31331 + udc->ep0_dir = USB_DIR_OUT;
31333 + ep = &udc->eps[0];
31334 + udc->ep0_state = WAIT_FOR_OUT_STATUS;
31337 + req->req.length = 0;
31338 + req->req.status = -EINPROGRESS;
31339 + req->req.actual = 0;
31340 + req->req.complete = NULL;
31341 + req->dtd_count = 0;
31343 + if (fsl_req_to_dtd(req) == 0)
31344 + status = fsl_queue_td(ep, req);
31349 + ERR("Can't queue ep0 status request \n");
31350 + list_add_tail(&req->queue, &ep->queue);
31355 +static inline int udc_reset_ep_queue(struct fsl_udc *udc, u8 pipe)
31357 + struct fsl_ep *ep = get_ep_by_pipe(udc, pipe);
31362 + nuke(ep, -ESHUTDOWN);
31368 + * ch9 Set address
31370 +static void ch9setaddress(struct fsl_udc *udc, u16 value, u16 index, u16 length)
31372 + /* Save the new address to device struct */
31373 + udc->device_address = (u8) value;
31374 + /* Update usb state */
31375 + udc->usb_state = USB_STATE_ADDRESS;
31376 + /* Status phase */
31377 + if (ep0_prime_status(udc, EP_DIR_IN))
31384 +static void ch9getstatus(struct fsl_udc *udc, u8 request_type, u16 value,
31385 + u16 index, u16 length)
31387 + u16 tmp = 0; /* Status, cpu endian */
31389 + struct fsl_req *req;
31390 + struct fsl_ep *ep;
31393 + ep = &udc->eps[0];
31395 + if ((request_type & USB_RECIP_MASK) == USB_RECIP_DEVICE) {
31396 + /* Get device status */
31397 + tmp = 1 << USB_DEVICE_SELF_POWERED;
31398 + tmp |= udc->remote_wakeup << USB_DEVICE_REMOTE_WAKEUP;
31399 + } else if ((request_type & USB_RECIP_MASK) == USB_RECIP_INTERFACE) {
31400 + /* Get interface status */
31401 + /* We don't have interface information in udc driver */
31403 + } else if ((request_type & USB_RECIP_MASK) == USB_RECIP_ENDPOINT) {
31404 + /* Get endpoint status */
31405 + struct fsl_ep *target_ep;
31407 + target_ep = get_ep_by_pipe(udc, get_pipe_by_windex(index));
31409 + /* stall if endpoint doesn't exist */
31410 + if (!target_ep->desc)
31412 + tmp = dr_ep_get_stall(ep_index(target_ep), ep_is_in(target_ep))
31413 + << USB_ENDPOINT_HALT;
31416 + udc->ep0_dir = USB_DIR_IN;
31417 + /* Borrow the per device status_req */
31418 + req = udc->status_req;
31419 + /* Fill in the reqest structure */
31420 + *((u16 *) req->req.buf) = cpu_to_le16(tmp);
31422 + req->req.length = 2;
31423 + req->req.status = -EINPROGRESS;
31424 + req->req.actual = 0;
31425 + req->req.complete = NULL;
31426 + req->dtd_count = 0;
31428 + /* prime the data phase */
31429 + if ((fsl_req_to_dtd(req) == 0))
31430 + status = fsl_queue_td(ep, req);
31431 + else /* no mem */
31435 + ERR("Can't respond to getstatus request \n");
31438 + list_add_tail(&req->queue, &ep->queue);
31439 + udc->ep0_state = DATA_STATE_XMIT;
31445 +static void ch9setconfig(struct fsl_udc *udc, u16 value, u16 index,
31448 + pr_debug("udc: 1 calling gadget driver->setup\n");
31449 + udc->ep0_dir = USB_DIR_IN;
31450 + if (udc->driver->setup(&udc->gadget, &udc->local_setup_buff) >= 0) {
31451 + /* gadget layer deal with the status phase */
31452 + udc->usb_state = USB_STATE_CONFIGURED;
31453 + udc->ep0_state = WAIT_FOR_OUT_STATUS;
31454 + pr_debug("udc: ep0_state now WAIT_FOR_OUT_STATUS\n");
31458 +static void setup_received_irq(struct fsl_udc *udc,
31459 + struct usb_ctrlrequest *setup)
31462 + u16 ptc = 0; /* port test control */
31463 + int handled = 1; /* set to zero if we do not handle the message,
31464 + and should pass it to the gadget driver */
31467 + * gadget drivers expect the setup pkt to be in wire format,
31468 + * so leave it alone and make local copies of stuff we need.
31470 + u16 wValue = le16_to_cpu(setup->wValue);
31471 + u16 wIndex = le16_to_cpu(setup->wIndex);
31472 + u16 wLength = le16_to_cpu(setup->wLength);
31475 + pr_debug("udc: request=0x%x\n", setup->bRequest);
31477 + udc_reset_ep_queue(udc, 0);
31479 + /* We asume setup only occurs on EP0 */
31480 + if (setup->bRequestType & USB_DIR_IN)
31481 + udc->ep0_dir = USB_DIR_IN;
31483 + udc->ep0_dir = USB_DIR_OUT;
31485 + if ((setup->bRequestType & USB_TYPE_MASK) == USB_TYPE_CLASS) {
31486 + /* handle class requests */
31487 + switch (setup->bRequest) {
31489 + case USB_BULK_RESET_REQUEST:
31490 + udc->ep0_dir = USB_DIR_IN;
31491 + if (udc->driver->setup(&udc->gadget,
31492 + &udc->local_setup_buff) >= 0) {
31493 + udc->ep0_state = WAIT_FOR_SETUP;
31494 + pr_debug("udc: ep0_state now WAIT_FOR_SETUP\n");
31502 + } else if ((setup->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
31503 + /* handle standard requests */
31504 + switch (setup->bRequest) {
31506 + case USB_REQ_GET_STATUS:
31508 + bRequestType & (USB_DIR_IN | USB_TYPE_STANDARD))
31509 + != (USB_DIR_IN | USB_TYPE_STANDARD))
31511 + ch9getstatus(udc, setup->bRequestType, wValue, wIndex,
31515 + case USB_REQ_SET_ADDRESS:
31516 + if (setup->bRequestType !=
31517 + (USB_DIR_OUT | USB_TYPE_STANDARD |
31518 + USB_RECIP_DEVICE))
31520 + ch9setaddress(udc, wValue, wIndex, wLength);
31523 + case USB_REQ_SET_CONFIGURATION:
31524 + if (setup->bRequestType !=
31525 + (USB_DIR_OUT | USB_TYPE_STANDARD |
31526 + USB_RECIP_DEVICE))
31528 + /* gadget layer take over the status phase */
31529 + ch9setconfig(udc, wValue, wIndex, wLength);
31531 + case USB_REQ_SET_INTERFACE:
31532 + if (setup->bRequestType !=
31533 + (USB_DIR_OUT | USB_TYPE_STANDARD |
31534 + USB_RECIP_INTERFACE))
31536 + udc->ep0_dir = USB_DIR_IN;
31537 + if (udc->driver->setup(&udc->gadget,
31538 + &udc->local_setup_buff) >= 0)
31539 + /* gadget layer take over the status phase */
31541 + /* Requests with no data phase */
31542 + case USB_REQ_CLEAR_FEATURE:
31543 + case USB_REQ_SET_FEATURE:
31544 + { /* status transaction */
31545 + int rc = -EOPNOTSUPP;
31547 + if ((setup->bRequestType & USB_TYPE_MASK) !=
31548 + USB_TYPE_STANDARD)
31551 + /* we only support set/clear feature for
31553 + if (setup->bRequestType == USB_RECIP_ENDPOINT) {
31554 + int dir = (wIndex & 0x0080) ?
31555 + EP_DIR_IN : EP_DIR_OUT;
31556 + int num = (wIndex & 0x000f);
31557 + struct fsl_ep *ep;
31561 + || (num * 2 + dir) > udc->max_ep)
31563 + ep = &udc->eps[num * 2 + dir];
31565 + if (setup->bRequest ==
31566 + USB_REQ_SET_FEATURE) {
31567 + pr_debug("udc: udc: SET_FEATURE"
31568 + " doing set_halt\n");
31569 + rc = fsl_ep_set_halt(&ep-> ep,
31572 + pr_debug("udc: CLEAR_FEATURE"
31573 + " doing clear_halt\n");
31574 + rc = fsl_ep_set_halt(&ep-> ep,
31578 + } else if (setup->bRequestType ==
31579 + USB_RECIP_DEVICE) {
31580 + if (setup->bRequest ==
31581 + USB_REQ_SET_FEATURE) {
31582 + ptc = wIndex >> 8;
31585 + if (!udc->gadget.is_otg)
31587 + else if (setup->bRequest ==
31588 + USB_DEVICE_B_HNP_ENABLE)
31589 + udc->gadget.b_hnp_enable = 1;
31590 + else if (setup->bRequest ==
31591 + USB_DEVICE_A_HNP_SUPPORT)
31592 + udc->gadget.a_hnp_support = 1;
31593 + else if (setup->bRequest ==
31594 + USB_DEVICE_A_ALT_HNP_SUPPORT)
31595 + udc->gadget.a_alt_hnp_support =
31600 + /* send status only if
31601 + * fsl_ep_set_halt success */
31602 + if (ep0_prime_status(udc, EP_DIR_IN))
31612 + /* vendor requests */
31617 + if (udc->driver->setup(&udc->gadget, &udc->local_setup_buff)
31620 + } else if (setup->bRequestType & USB_DIR_IN) {
31621 + udc->ep0_state = DATA_STATE_XMIT;
31622 + pr_debug("udc: ep0_state now DATA_STATE_XMIT\n");
31624 + udc->ep0_state = DATA_STATE_RECV;
31625 + pr_debug("udc: ep0_state now DATA_STATE_RECV\n");
31630 + tmp =fsl_readl(&dr_regs->portsc1) | ptc << 16;
31631 + fsl_writel(tmp, &dr_regs->portsc1);
31632 + pr_debug("udc: switch to test mode.\n");
31636 +/* Process request for Data or Status phase of ep0
31637 + * prime status phase if needed */
31638 +static void ep0_req_complete(struct fsl_udc *udc, struct fsl_ep *ep0,
31639 + struct fsl_req *req)
31641 + if (udc->usb_state == USB_STATE_ADDRESS) {
31642 + /* Set the new address */
31643 + u32 new_address = (u32) udc->device_address;
31644 + fsl_writel(new_address << USB_DEVICE_ADDRESS_BIT_POS,
31645 + &dr_regs->deviceaddr);
31648 + done(ep0, req, 0);
31650 + switch (udc->ep0_state) {
31651 + case DATA_STATE_XMIT:
31652 + /* receive status phase */
31653 + if (ep0_prime_status(udc, EP_DIR_OUT))
31656 + case DATA_STATE_RECV:
31657 + /* send status phase */
31658 + if (ep0_prime_status(udc, EP_DIR_IN))
31661 + case WAIT_FOR_OUT_STATUS:
31662 + udc->ep0_state = WAIT_FOR_SETUP;
31664 + case WAIT_FOR_SETUP:
31665 + ERR("Unexpect ep0 packets \n");
31673 +/* Tripwire mechanism to ensure a setup packet payload is extracted without
31674 + * being corrupted by another incoming setup packet */
31675 +static void tripwire_handler(struct fsl_udc *udc, u8 ep_num, u8 *buffer_ptr)
31678 + struct ep_queue_head *qh;
31679 + struct fsl_usb2_platform_data *pdata = udc->pdata;
31681 + qh = &udc->ep_qh[ep_num * 2 + EP_DIR_OUT];
31683 + /* Clear bit in ENDPTSETUPSTAT */
31684 + temp = fsl_readl(&dr_regs->endptsetupstat);
31685 + fsl_writel(temp | (1 << ep_num), &dr_regs->endptsetupstat);
31687 + /* while a hazard exists when setup package arrives */
31689 + /* Set Setup Tripwire */
31690 + temp = fsl_readl(&dr_regs->usbcmd);
31691 + fsl_writel(temp | USB_CMD_SUTW, &dr_regs->usbcmd);
31693 + /* Copy the setup packet to local buffer */
31694 + if (pdata->le_setup_buf) {
31695 + u32 *p = (u32 *)buffer_ptr;
31696 + u32 *s = (u32 *)qh->setup_buffer;
31698 + /* Convert little endian setup buffer to CPU endian */
31699 + *p++ = le32_to_cpu(*s++);
31700 + *p = le32_to_cpu(*s);
31702 + memcpy(buffer_ptr, (u8 *) qh->setup_buffer, 8);
31704 + } while (!(fsl_readl(&dr_regs->usbcmd) & USB_CMD_SUTW));
31706 + /* Clear Setup Tripwire */
31707 + temp = fsl_readl(&dr_regs->usbcmd);
31708 + fsl_writel(temp & ~USB_CMD_SUTW, &dr_regs->usbcmd);
31711 +/* process-ep_req(): free the completed Tds for this req */
31712 +static int process_ep_req(struct fsl_udc *udc, int pipe,
31713 + struct fsl_req *curr_req)
31715 + struct ep_td_struct *curr_td;
31716 + int td_complete, actual, remaining_length, j, tmp;
31719 + struct ep_queue_head *curr_qh = &udc->ep_qh[pipe];
31720 + int direction = pipe % 2;
31722 + curr_td = curr_req->head;
31724 + actual = curr_req->req.length;
31726 + for (j = 0; j < curr_req->dtd_count; j++) {
31727 + remaining_length = (hc32_to_cpu(curr_td->size_ioc_sts)
31728 + & DTD_PACKET_SIZE)
31729 + >> DTD_LENGTH_BIT_POS;
31730 + actual -= remaining_length;
31732 + (errors = hc32_to_cpu(curr_td->size_ioc_sts) & DTD_ERROR_MASK);
31734 + if (errors & DTD_STATUS_HALTED) {
31735 + ERR("dTD error %08x QH=%d\n", errors, pipe);
31736 + /* Clear the errors and Halt condition */
31737 + tmp = hc32_to_cpu(curr_qh->size_ioc_int_sts);
31739 + curr_qh->size_ioc_int_sts = cpu_to_hc32(tmp);
31741 + /* FIXME: continue with next queued TD? */
31745 + if (errors & DTD_STATUS_DATA_BUFF_ERR) {
31746 + VDBG("Transfer overflow");
31747 + status = -EPROTO;
31749 + } else if (errors & DTD_STATUS_TRANSACTION_ERR) {
31750 + VDBG("ISO error");
31751 + status = -EILSEQ;
31754 + ERR("Unknown error has occured (0x%x)!\r\n",
31757 + } else if (hc32_to_cpu(curr_td->size_ioc_sts) &
31758 + DTD_STATUS_ACTIVE) {
31759 + VDBG("Request not complete");
31760 + status = REQ_UNCOMPLETE;
31762 + } else if (remaining_length) {
31764 + VDBG("Transmit dTD remaining length not zero");
31765 + status = -EPROTO;
31773 + VDBG("dTD transmitted successful ");
31776 + if (j != curr_req->dtd_count - 1)
31777 + curr_td = curr_td->next_td_virt;
31783 + curr_req->req.actual = actual;
31788 +/* Process a DTD completion interrupt */
31789 +static void dtd_complete_irq(struct fsl_udc *udc)
31792 + int i, ep_num, direction, bit_mask, status;
31793 + struct fsl_ep *curr_ep;
31794 + struct fsl_req *curr_req, *temp_req;
31796 + /* Clear the bits in the register */
31797 + bit_pos = fsl_readl(&dr_regs->endptcomplete);
31798 + fsl_writel(bit_pos, &dr_regs->endptcomplete);
31803 + for (i = 0; i < udc->max_ep * 2; i++) {
31805 + direction = i % 2;
31807 + bit_mask = 1 << (ep_num + 16 * direction);
31809 + if (!(bit_pos & bit_mask))
31812 + curr_ep = get_ep_by_pipe(udc, i);
31814 + /* If the ep is configured */
31815 + if (curr_ep->name == NULL) {
31816 + WARN("Invalid EP?");
31820 + /* process the req queue until an uncomplete request */
31821 + list_for_each_entry_safe(curr_req, temp_req, &curr_ep->queue,
31823 + status = process_ep_req(udc, i, curr_req);
31825 + VDBG("status of process_ep_req= %d, ep = %d",
31827 + if (status == REQ_UNCOMPLETE)
31829 + /* write back status to req */
31830 + curr_req->req.status = status;
31832 + if (ep_num == 0) {
31833 + ep0_req_complete(udc, curr_ep, curr_req);
31836 + done(curr_ep, curr_req, status);
31842 +/* Process a port change interrupt */
31843 +static void port_change_irq(struct fsl_udc *udc)
31847 + VDBG("portsc=0x%x", fsl_readl(&dr_regs->portsc1) );
31848 + if (udc->bus_reset)
31849 + udc->bus_reset = 0;
31851 + /* Bus resetting is finished */
31852 + if (!(fsl_readl(&dr_regs->portsc1) & PORTSCX_PORT_RESET)) {
31853 + /* Get the speed */
31854 + speed = fsl_readl(&dr_regs->portsc1) & PORTSCX_PORT_SPEED_MASK;
31856 + case PORTSCX_PORT_SPEED_HIGH:
31857 + udc->gadget.speed = USB_SPEED_HIGH;
31859 + case PORTSCX_PORT_SPEED_FULL:
31860 + udc->gadget.speed = USB_SPEED_FULL;
31862 + case PORTSCX_PORT_SPEED_LOW:
31863 + udc->gadget.speed = USB_SPEED_LOW;
31866 + udc->gadget.speed = USB_SPEED_UNKNOWN;
31871 + /* Update USB state */
31872 + if (!udc->resume_state)
31873 + udc->usb_state = USB_STATE_DEFAULT;
31876 +/* Process suspend interrupt */
31877 +static void suspend_irq(struct fsl_udc *udc)
31879 + udc->resume_state = udc->usb_state;
31880 + udc->usb_state = USB_STATE_SUSPENDED;
31882 + /* report suspend to the driver, serial.c does not support this */
31883 + if (udc->driver->suspend)
31884 + udc->driver->suspend(&udc->gadget);
31887 +static void bus_resume(struct fsl_udc *udc)
31889 + udc->usb_state = udc->resume_state;
31890 + udc->resume_state = 0;
31892 + /* report resume to the driver, serial.c does not support this */
31893 + if (udc->driver->resume)
31894 + udc->driver->resume(&udc->gadget);
31897 +/* Clear up all ep queues */
31898 +static int reset_queues(struct fsl_udc *udc)
31902 + for (pipe = 0; pipe < udc->max_pipes; pipe++)
31903 + udc_reset_ep_queue(udc, pipe);
31905 + /* report disconnect; the driver is already quiesced */
31906 + udc->driver->disconnect(&udc->gadget);
31911 +/* Process reset interrupt */
31912 +static void reset_irq(struct fsl_udc *udc)
31915 + unsigned long timeout;
31917 + /* Clear the device address */
31918 + temp = fsl_readl(&dr_regs->deviceaddr);
31919 + fsl_writel(temp & ~USB_DEVICE_ADDRESS_MASK, &dr_regs->deviceaddr);
31921 + udc->device_address = 0;
31923 + /* Clear usb state */
31924 + udc->resume_state = 0;
31925 + udc->ep0_dir = 0;
31926 + udc->ep0_state = WAIT_FOR_SETUP;
31927 + udc->remote_wakeup = 0; /* default to 0 on reset */
31928 + udc->gadget.b_hnp_enable = 0;
31929 + udc->gadget.a_hnp_support = 0;
31930 + udc->gadget.a_alt_hnp_support = 0;
31932 + /* Clear all the setup token semaphores */
31933 + temp = fsl_readl(&dr_regs->endptsetupstat);
31934 + fsl_writel(temp, &dr_regs->endptsetupstat);
31936 + /* Clear all the endpoint complete status bits */
31937 + temp = fsl_readl(&dr_regs->endptcomplete);
31938 + fsl_writel(temp, &dr_regs->endptcomplete);
31940 + timeout = jiffies + 100;
31941 + while (fsl_readl(&dr_regs->endpointprime)) {
31942 + /* Wait until all endptprime bits cleared */
31943 + if (time_after(jiffies, timeout)) {
31944 + ERR("Timeout for reset\n");
31950 + /* Write 1s to the flush register */
31951 + fsl_writel(0xffffffff, &dr_regs->endptflush);
31953 + if (fsl_readl(&dr_regs->portsc1) & PORTSCX_PORT_RESET) {
31954 + VDBG("Bus reset");
31955 + /* Bus is reseting */
31956 + udc->bus_reset = 1;
31957 + /* Reset all the queues, include XD, dTD, EP queue
31958 + * head and TR Queue */
31959 + reset_queues(udc);
31960 + udc->usb_state = USB_STATE_DEFAULT;
31962 + VDBG("Controller reset");
31963 + /* initialize usb hw reg except for regs for EP, not
31964 + * touch usbintr reg */
31965 + dr_controller_setup(udc);
31967 + /* Reset all internal used Queues */
31968 + reset_queues(udc);
31972 + /* Enable DR IRQ reg, Set Run bit, change udc state */
31973 + dr_controller_run(udc);
31974 + udc->usb_state = USB_STATE_ATTACHED;
31979 + * USB device controller interrupt handler
31981 +static irqreturn_t fsl_udc_irq(int irq, void *_udc)
31983 + struct fsl_udc *udc = _udc;
31985 + irqreturn_t status = IRQ_NONE;
31986 + unsigned long flags;
31988 + /* Disable ISR for OTG host mode */
31989 + if (udc->stopped)
31991 + spin_lock_irqsave(&udc->lock, flags);
31992 + irq_src = fsl_readl(&dr_regs->usbsts) & fsl_readl(&dr_regs->usbintr);
31993 + /* Clear notification bits */
31994 + fsl_writel(irq_src, &dr_regs->usbsts);
31996 + VDBG("irq_src [0x%8x] portsc=0x%x", irq_src,
31997 + fsl_readl(&dr_regs->portsc1));
31999 + /* Need to resume? */
32000 + if (udc->usb_state == USB_STATE_SUSPENDED)
32001 + if ((fsl_readl(&dr_regs->portsc1) & PORTSCX_PORT_SUSPEND) == 0)
32004 + /* USB Interrupt */
32005 + if (irq_src & USB_STS_INT) {
32006 + VDBG("Packet int");
32007 + /* Setup package, we only support ep0 as control ep */
32008 + if (fsl_readl(&dr_regs->endptsetupstat) & EP_SETUP_STATUS_EP0) {
32009 + tripwire_handler(udc, 0,
32010 + (u8 *) (&udc->local_setup_buff));
32011 + setup_received_irq(udc, &udc->local_setup_buff);
32012 + status = IRQ_HANDLED;
32015 + /* completion of dtd */
32016 + if (fsl_readl(&dr_regs->endptcomplete)) {
32017 + dtd_complete_irq(udc);
32018 + status = IRQ_HANDLED;
32022 + /* SOF (for ISO transfer) */
32023 + if (irq_src & USB_STS_SOF) {
32024 + status = IRQ_HANDLED;
32027 + /* Port Change */
32028 + if (irq_src & USB_STS_PORT_CHANGE) {
32029 + port_change_irq(udc);
32030 + status = IRQ_HANDLED;
32033 + /* Reset Received */
32034 + if (irq_src & USB_STS_RESET) {
32036 + status = IRQ_HANDLED;
32039 + /* Sleep Enable (Suspend) */
32040 + if (irq_src & USB_STS_SUSPEND) {
32041 + suspend_irq(udc);
32042 + status = IRQ_HANDLED;
32045 + if (irq_src & (USB_STS_ERR | USB_STS_SYS_ERR)) {
32046 + VDBG("Error IRQ %x ", irq_src);
32049 + spin_unlock_irqrestore(&udc->lock, flags);
32053 +/*----------------------------------------------------------------*
32054 + * Hook to gadget drivers
32055 + * Called by initialization code of gadget drivers
32056 +*----------------------------------------------------------------*/
32057 +int usb_gadget_register_driver(struct usb_gadget_driver *driver)
32059 + int retval = -ENODEV;
32060 + unsigned long flags = 0;
32061 + struct fsl_udc *udc = udc_controller;
32063 + pr_debug("udc: udc=0x%p\n", udc);
32068 + if (!driver || (driver->speed != USB_SPEED_FULL
32069 + && driver->speed != USB_SPEED_HIGH)
32070 + || !driver->bind || !driver->disconnect
32071 + || !driver->setup)
32077 + /* lock is needed but whether should use this lock or another */
32078 + spin_lock_irqsave(&udc->lock, flags);
32080 + driver->driver.bus = 0;
32081 + udc->softconnect = 1;
32082 + /* hook up the driver */
32083 + udc->driver = driver;
32084 + udc->gadget.dev.driver = &driver->driver;
32085 + spin_unlock_irqrestore(&udc->lock, flags);
32087 + /* bind udc driver to gadget driver */
32088 + retval = driver->bind(&udc->gadget);
32090 + pr_debug("bind to %s --> %d\n", driver->driver.name, retval);
32091 + udc->gadget.dev.driver = 0;
32096 + /* Enable DR IRQ reg and Set usbcmd reg Run bit */
32097 + if (udc->transceiver) {
32098 + /* Suspend the controller until OTG enables it */
32099 + udc_suspend(udc);
32100 + pr_debug("udc: suspend udc for OTG auto detect \n");
32102 + /* Export udc suspend/resume call to OTG */
32103 + udc->gadget.dev.parent->driver->suspend = fsl_udc_suspend;
32104 + udc->gadget.dev.parent->driver->resume = fsl_udc_resume;
32106 + retval = otg_set_peripheral(udc->transceiver, &udc->gadget);
32107 + if (retval < 0) {
32108 + printk(KERN_ERR "can't bind to transceiver\n");
32109 + driver->unbind(&udc->gadget);
32110 + udc->gadget.dev.driver = 0;
32115 + /* Enable DR IRQ reg and Set usbcmd reg Run bit */
32116 + dr_controller_run(udc);
32117 + udc->usb_state = USB_STATE_ATTACHED;
32118 + udc->ep0_state = WAIT_FOR_SETUP;
32119 + pr_debug("udc: ep0_state now WAIT_FOR_SETUP\n");
32120 + udc->ep0_dir = 0;
32123 + printk(KERN_INFO "%s: bind to driver %s \n", udc->gadget.name,
32124 + driver->driver.name);
32129 +EXPORT_SYMBOL(usb_gadget_register_driver);
32131 +/* Disconnect from gadget driver */
32132 +int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
32134 + struct fsl_ep *loop_ep;
32135 + unsigned long flags;
32137 + if (!udc_controller)
32140 + if (!driver || driver != udc_controller->driver || !driver->unbind)
32143 +#ifdef CONFIG_USB_OTG
32144 + if (udc_controller->transceiver)
32145 + (void)otg_set_peripheral(udc_controller->transceiver, 0);
32148 + /* stop DR, disable intr */
32149 + dr_controller_stop(udc_controller);
32151 + /* in fact, no needed */
32152 + udc_controller->usb_state = USB_STATE_ATTACHED;
32153 + udc_controller->ep0_state = WAIT_FOR_SETUP;
32154 + udc_controller->ep0_dir = 0;
32156 + /* stand operation */
32157 + spin_lock_irqsave(&udc_controller->lock, flags);
32158 + udc_controller->gadget.speed = USB_SPEED_UNKNOWN;
32159 + nuke(&udc_controller->eps[0], -ESHUTDOWN);
32160 + list_for_each_entry(loop_ep, &udc_controller->gadget.ep_list,
32162 + nuke(loop_ep, -ESHUTDOWN);
32163 + spin_unlock_irqrestore(&udc_controller->lock, flags);
32165 + /* unbind gadget and unhook driver. */
32166 + driver->unbind(&udc_controller->gadget);
32167 + udc_controller->gadget.dev.driver = 0;
32168 + udc_controller->driver = 0;
32170 + printk(KERN_INFO "unregistered gadget '%s'\n", driver->driver.name);
32173 +EXPORT_SYMBOL(usb_gadget_unregister_driver);
32175 +/*-------------------------------------------------------------------------
32176 + PROC File System Support
32177 +-------------------------------------------------------------------------*/
32178 +#ifdef CONFIG_USB_GADGET_DEBUG_FILES
32180 +#include <linux/seq_file.h>
32182 +static const char proc_filename[] = "driver/fsl_usb2_udc";
32184 +static int fsl_proc_read(char *page, char **start, off_t off, int count,
32185 + int *eof, void *_dev)
32187 + char *buf = page;
32188 + char *next = buf;
32189 + unsigned size = count;
32190 + unsigned long flags;
32193 + struct fsl_ep *ep = NULL;
32194 + struct fsl_req *req;
32196 + struct fsl_udc *udc = udc_controller;
32200 + spin_lock_irqsave(&udc->lock, flags);
32202 + /* ------basic driver infomation ---- */
32203 + t = scnprintf(next, size,
32205 + "%s version: %s\n"
32206 + "Gadget driver: %s\n\n",
32207 + driver_name, DRIVER_VERSION,
32208 + udc->driver ? udc->driver->driver.name : "(none)");
32212 + /* ------ DR Registers ----- */
32213 + tmp_reg = fsl_readl(&dr_regs->usbcmd);
32214 + t = scnprintf(next, size,
32215 + "USBCMD reg: 0x%08x\n"
32216 + "\tSetupTW: %d\n"
32217 + "\tRun/Stop: %s\n\n",
32219 + (tmp_reg & USB_CMD_SUTW) ? 1 : 0,
32220 + (tmp_reg & USB_CMD_RUN_STOP) ? "Run" : "Stop");
32224 + tmp_reg = fsl_readl(&dr_regs->usbsts);
32225 + t = scnprintf(next, size,
32226 + "USB Status Reg: 0x%08x\n"
32227 + "\tDr Suspend: %d Reset Received: %d "
32228 + "System Error: %s USB Error Interrupt: %s\n\n",
32230 + (tmp_reg & USB_STS_SUSPEND) ? 1 : 0,
32231 + (tmp_reg & USB_STS_RESET) ? 1 : 0,
32232 + (tmp_reg & USB_STS_SYS_ERR) ? "Err" : "Normal",
32233 + (tmp_reg & USB_STS_ERR) ? "Err detected" : "No err");
32237 + tmp_reg = fsl_readl(&dr_regs->usbintr);
32238 + t = scnprintf(next, size,
32239 + "USB Interrupt Enable Reg: 0x%08x\n"
32240 + "\tSleep Enable: %d SOF Received Enable: %d "
32241 + "Reset Enable: %d\n"
32242 + "\tSystem Error Enable: %d "
32243 + "Port Change Dectected Enable: %d\n"
32244 + "\tUSB Error Intr Enable: %d USB Intr Enable: %d\n\n",
32246 + (tmp_reg & USB_INTR_DEVICE_SUSPEND) ? 1 : 0,
32247 + (tmp_reg & USB_INTR_SOF_EN) ? 1 : 0,
32248 + (tmp_reg & USB_INTR_RESET_EN) ? 1 : 0,
32249 + (tmp_reg & USB_INTR_SYS_ERR_EN) ? 1 : 0,
32250 + (tmp_reg & USB_INTR_PTC_DETECT_EN) ? 1 : 0,
32251 + (tmp_reg & USB_INTR_ERR_INT_EN) ? 1 : 0,
32252 + (tmp_reg & USB_INTR_INT_EN) ? 1 : 0);
32256 + tmp_reg = fsl_readl(&dr_regs->frindex);
32257 + t = scnprintf(next, size,
32258 + "USB Frame Index Reg: Frame Number is 0x%x\n\n",
32259 + (tmp_reg & USB_FRINDEX_MASKS));
32263 + tmp_reg = fsl_readl(&dr_regs->deviceaddr);
32264 + t = scnprintf(next, size,
32265 + "USB Device Address Reg: Device Addr is 0x%x\n\n",
32266 + (tmp_reg & USB_DEVICE_ADDRESS_MASK));
32270 + tmp_reg = fsl_readl(&dr_regs->endpointlistaddr);
32271 + t = scnprintf(next, size,
32272 + "USB Endpoint List Address Reg:"
32273 + "Device Addr is 0x%x\n\n",
32274 + (tmp_reg & USB_EP_LIST_ADDRESS_MASK));
32278 + tmp_reg = fsl_readl(&dr_regs->portsc1);
32279 + t = scnprintf(next, size,
32280 + "USB Port Status&Control Reg:\n"
32281 + "\tPort Transceiver Type : %s" "Port Speed: %s \n"
32282 + "\tPHY Low Power Suspend: %s" "Port Reset: %s "
32283 + "Port Suspend Mode: %s \n" "\tOver-current Change: %s "
32284 + "Port Enable/Disable Change: %s\n"
32285 + "\tPort Enabled/Disabled: %s"
32286 + "Current Connect Status: %s\n\n", ( {
32288 + switch (tmp_reg & PORTSCX_PTS_FSLS) {
32289 + case PORTSCX_PTS_UTMI:
32290 + s = "UTMI"; break;
32291 + case PORTSCX_PTS_ULPI:
32292 + s = "ULPI "; break;
32293 + case PORTSCX_PTS_FSLS:
32294 + s = "FS/LS Serial"; break;
32296 + s = "None"; break;
32300 + switch (tmp_reg & PORTSCX_PORT_SPEED_UNDEF) {
32301 + case PORTSCX_PORT_SPEED_FULL:
32302 + s = "Full Speed"; break;
32303 + case PORTSCX_PORT_SPEED_LOW:
32304 + s = "Low Speed"; break;
32305 + case PORTSCX_PORT_SPEED_HIGH:
32306 + s = "High Speed"; break;
32308 + s = "Undefined"; break;
32312 + (tmp_reg & PORTSCX_PHY_LOW_POWER_SPD) ?
32313 + "Normal PHY mode" : "Low power mode",
32314 + (tmp_reg & PORTSCX_PORT_RESET) ? "In Reset" :
32316 + (tmp_reg & PORTSCX_PORT_SUSPEND) ? "In " : "Not in",
32317 + (tmp_reg & PORTSCX_OVER_CURRENT_CHG) ? "Dected" :
32319 + (tmp_reg & PORTSCX_PORT_EN_DIS_CHANGE) ? "Disable" :
32321 + (tmp_reg & PORTSCX_PORT_ENABLE) ? "Enable" :
32323 + (tmp_reg & PORTSCX_CURRENT_CONNECT_STATUS) ?
32324 + "Attached" : "Not-Att");
32328 + tmp_reg = fsl_readl(&dr_regs->usbmode);
32329 + t = scnprintf(next, size,
32330 + "USB Mode Reg:" "Controller Mode is : %s\n\n", ( {
32332 + switch (tmp_reg & USB_MODE_CTRL_MODE_HOST) {
32333 + case USB_MODE_CTRL_MODE_IDLE:
32334 + s = "Idle"; break;
32335 + case USB_MODE_CTRL_MODE_DEVICE:
32336 + s = "Device Controller"; break;
32337 + case USB_MODE_CTRL_MODE_HOST:
32338 + s = "Host Controller"; break;
32340 + s = "None"; break;
32347 + tmp_reg = fsl_readl(&dr_regs->endptsetupstat);
32348 + t = scnprintf(next, size,
32349 + "Endpoint Setup Status Reg:" "SETUP on ep 0x%x\n\n",
32350 + (tmp_reg & EP_SETUP_STATUS_MASK));
32354 + for (i = 0; i < udc->max_ep / 2; i++) {
32355 + tmp_reg = fsl_readl(&dr_regs->endptctrl[i]);
32356 + t = scnprintf(next, size, "EP Ctrl Reg [0x%x]: = [0x%x]\n",
32361 + tmp_reg = fsl_readl(&dr_regs->endpointprime);
32362 + t = scnprintf(next, size, "EP Prime Reg = [0x%x]\n", tmp_reg);
32366 +#ifdef HAVE_SYS_REGS
32367 + tmp_reg = usb_sys_regs->snoop1;
32368 + t = scnprintf(next, size, "\nSnoop1 Reg : = [0x%x]\n\n", tmp_reg);
32372 + tmp_reg = usb_sys_regs->control;
32373 + t = scnprintf(next, size, "General Control Reg : = [0x%x]\n\n",
32379 + /* ------fsl_udc, fsl_ep, fsl_request structure information ----- */
32380 + ep = &udc->eps[0];
32381 + t = scnprintf(next, size, "For %s Maxpkt is 0x%x index is 0x%x\n",
32382 + ep->ep.name, ep_maxpacket(ep), ep_index(ep));
32386 + if (list_empty(&ep->queue)) {
32387 + t = scnprintf(next, size, "its req queue is empty\n\n");
32391 + list_for_each_entry(req, &ep->queue, queue) {
32392 + t = scnprintf(next, size,
32393 + "req %p actual 0x%x length 0x%x buf %p\n",
32394 + &req->req, req->req.actual,
32395 + req->req.length, req->req.buf);
32400 + /* other gadget->eplist ep */
32401 + list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) {
32403 + t = scnprintf(next, size,
32404 + "\nFor %s Maxpkt is 0x%x "
32405 + "index is 0x%x\n",
32406 + ep->ep.name, ep_maxpacket(ep),
32411 + if (list_empty(&ep->queue)) {
32412 + t = scnprintf(next, size,
32413 + "its req queue is empty\n\n");
32417 + list_for_each_entry(req, &ep->queue, queue) {
32418 + t = scnprintf(next, size,
32419 + "req %p actual 0x%x length"
32421 + &req->req, req->req.actual,
32422 + req->req.length, req->req.buf);
32425 + } /* end for each_entry of ep req */
32426 + } /* end for else */
32427 + } /* end for if(ep->queue) */
32428 + } /* end (ep->desc) */
32430 + spin_unlock_irqrestore(&udc->lock, flags);
32433 + return count - size;
32436 +#define create_proc_file() create_proc_read_entry(proc_filename, \
32437 + 0, NULL, fsl_proc_read, NULL)
32439 +#define remove_proc_file() remove_proc_entry(proc_filename, NULL)
32441 +#else /* !CONFIG_USB_GADGET_DEBUG_FILES */
32443 +#define create_proc_file() do {} while (0)
32444 +#define remove_proc_file() do {} while (0)
32446 +#endif /* CONFIG_USB_GADGET_DEBUG_FILES */
32448 +/*-------------------------------------------------------------------------*/
32450 +/* Release udc structures */
32451 +static void fsl_udc_release(struct device *dev)
32453 + complete(udc_controller->done);
32454 + dma_free_coherent(dev, udc_controller->ep_qh_size,
32455 + udc_controller->ep_qh, udc_controller->ep_qh_dma);
32456 + kfree(udc_controller);
32459 +/******************************************************************
32460 + Internal structure setup functions
32461 +*******************************************************************/
32462 +/*------------------------------------------------------------------
32463 + * init resource for globle controller
32464 + * Return the udc handle on success or NULL on failure
32465 + ------------------------------------------------------------------*/
32466 +static struct fsl_udc *__init struct_udc_setup(struct platform_device *pdev)
32468 + struct fsl_udc *udc;
32469 + struct fsl_usb2_platform_data *pdata;
32472 + udc = kzalloc(sizeof(struct fsl_udc), GFP_KERNEL);
32473 + if (udc == NULL) {
32474 + ERR("malloc udc failed\n");
32478 + pdata = pdev->dev.platform_data;
32479 + udc->phy_mode = pdata->phy_mode; /* DDD FIXME */
32481 + /* max_ep_nr is bidirectional ep number, max_ep doubles the number */
32482 + udc->max_ep = pdata->max_ep_nr * 2;
32484 + udc->eps = kzalloc(sizeof(struct fsl_ep) * udc->max_ep, GFP_KERNEL);
32486 + ERR("malloc fsl_ep failed\n");
32490 + /* initialized QHs, take care of alignment */
32491 + size = udc->max_ep * sizeof(struct ep_queue_head);
32492 + if (size < QH_ALIGNMENT)
32493 + size = QH_ALIGNMENT;
32494 + else if ((size % QH_ALIGNMENT) != 0) {
32495 + size += QH_ALIGNMENT + 1;
32496 + size &= ~(QH_ALIGNMENT - 1);
32498 + udc->ep_qh = dma_alloc_coherent(&pdev->dev, size,
32499 + &udc->ep_qh_dma, GFP_KERNEL);
32500 + if (!udc->ep_qh) {
32501 + ERR("malloc QHs for udc failed\n");
32506 + udc->ep_qh_size = size;
32508 + /* Initialize ep0 status request structure */
32509 + udc->status_req = container_of(fsl_alloc_request(NULL, GFP_KERNEL),
32510 + struct fsl_req, req);
32511 + /* allocate a small amount of memory to get valid address */
32512 + udc->status_req->req.buf = kmalloc(8, GFP_KERNEL);
32513 + udc->status_req->req.dma = virt_to_phys(udc->status_req->req.buf);
32515 + udc->resume_state = USB_STATE_NOTATTACHED;
32516 + udc->usb_state = USB_STATE_POWERED;
32517 + udc->ep0_dir = 0;
32518 + udc->remote_wakeup = 0; /* default to 0 on reset */
32519 + spin_lock_init(&udc->lock);
32528 +/*----------------------------------------------------------------
32529 + * Setup the fsl_ep struct for eps
32530 + * Link fsl_ep->ep to gadget->ep_list
32531 + * ep0out is not used so do nothing here
32532 + * ep0in should be taken care
32533 + *--------------------------------------------------------------*/
32534 +static int __init struct_ep_setup(struct fsl_udc *udc, unsigned char index,
32535 + char *name, int link)
32537 + struct fsl_ep *ep = &udc->eps[index];
32540 + strcpy(ep->name, name);
32541 + ep->ep.name = ep->name;
32543 + ep->ep.ops = &fsl_ep_ops;
32546 + /* for ep0: maxP defined in desc
32547 + * for other eps, maxP is set by epautoconfig() called by gadget layer
32549 + ep->ep.maxpacket = (unsigned short) ~0;
32551 + /* the queue lists any req for this ep */
32552 + INIT_LIST_HEAD(&ep->queue);
32554 + /* gagdet.ep_list used for ep_autoconfig so no ep0 */
32556 + list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
32557 + ep->gadget = &udc->gadget;
32558 + ep->qh = &udc->ep_qh[index];
32563 +static int board_init(struct platform_device *pdev)
32565 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
32567 + pr_debug("udc: pdev=0x%p pdata=0x%p\n", pdev, pdata);
32570 + * do platform specific init: check the clock, grab/config pins, etc.
32572 + if (pdata->platform_init && pdata->platform_init(pdev) != 0)
32578 +/* Driver probe functions */
32580 +static int __init fsl_udc_probe(struct platform_device *pdev)
32582 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
32583 + struct fsl_udc *udc;
32585 + struct otg_transceiver *transceiver = NULL;
32586 + int status = -ENODEV;
32589 + u64 rsrc_start, rsrc_len;
32590 + int ret = -ENODEV;
32592 + pr_debug("udc: pdev=0x%p pdata=0x%p\n", pdev, pdata);
32594 + if (board_init(pdev) != 0)
32597 + /* Initialize the udc structure including QH member and other member */
32598 + udc = (struct fsl_udc *) struct_udc_setup(pdev);
32599 + udc_controller = udc;
32602 + ERR("udc is NULL \n");
32605 + dev_set_drvdata(&pdev->dev, udc);
32606 + pr_debug("udc_controller=0x%p", udc_controller);
32608 + udc->pdata = pdata;
32609 + udc->xcvr_type = pdata->xcvr_type;
32611 +#ifdef CONFIG_USB_OTG
32612 + udc->transceiver = otg_get_transceiver();
32613 + pr_debug("udc: otg_get_transceiver returns 0x%p", udc->transceiver);
32616 + if (pdev->resource[1].flags != IORESOURCE_IRQ)
32619 + rsrc_start = pdev->resource[0].start;
32620 + rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1;
32622 + pr_debug(" start=0x%ux end=0x%ux\n",
32623 + pdev->resource[0].start, pdev->resource[0].end);
32624 + pr_debug("rsrc_start=0x%llx rsrc_len=0x%llx\n", rsrc_start, rsrc_len);
32626 + dr_regs = (struct fsl_usb_device_regs *)pdata->regs;
32628 + pr_debug("udc: pdate=0x%p dr_regs=0x%p\n", pdata, dr_regs);
32629 + pr_debug("udc: hci_version=0x%x\n", dr_regs->hciversion);
32630 + pr_debug("udc: otgsc at 0x%p\n", &dr_regs->otgsc);
32632 + id = fsl_readl(&dr_regs->id);
32633 + printk(KERN_INFO "FSL2 USBOTG h/w ID=0x%x revision=0x%x\n",
32634 + id & 0x3f, id >> 16);
32636 + /* USB OTG module IRQ */
32637 + irq_number = platform_get_irq(pdev, 0);
32638 + if (irq_number > 128) {
32639 + status = request_irq(irq_number, fsl_udc_irq, IRQF_SHARED,
32640 + driver_name, udc);
32642 + ERR("can't get irq %d, err=%d\n", irq_number, status);
32646 + status = -ENODEV;
32650 + if (!udc->transceiver) {
32651 + /* initialize usb hw reg except for regs for EP,
32652 + * leave usbintr reg untouched*/
32653 + dr_controller_setup(udc);
32656 + /* here comes the stand operations for probe
32657 + * set the fsl_udc->gadget.xxx
32659 + udc->gadget.ops = &fsl_gadget_ops;
32660 + udc->gadget.is_dualspeed = 1;
32662 + /* gadget.ep0 is a pointer */
32663 + udc->gadget.ep0 = &udc->eps[0].ep;
32664 + INIT_LIST_HEAD(&udc->gadget.ep_list);
32665 + udc->gadget.speed = USB_SPEED_UNKNOWN;
32666 + udc->gadget.name = driver_name;
32668 + /* Setup gadget.dev and register with kernel */
32669 + strcpy(udc->gadget.dev.bus_id, "gadget");
32670 + udc->gadget.dev.release = fsl_udc_release;
32671 + udc->gadget.dev.parent = &pdev->dev;
32673 + ret = device_register(&udc->gadget.dev);
32677 + if (udc->transceiver)
32678 + udc->gadget.is_otg = 1;
32680 + /* setup QH and epctrl for ep0 */
32683 + /* setup udc->eps[] for ep0 */
32684 + struct_ep_setup(udc_controller, 0, "ep0", 0);
32685 + /* for ep0: the desc defined here;
32686 + * for other eps, gadget layer called ep_enable with defined desc
32688 + udc->eps[0].desc = &fsl_ep0_desc;
32689 + udc->eps[0].ep.maxpacket = USB_MAX_CTRL_PAYLOAD;
32691 + /* setup the udc->eps[] for non-control endpoints and link
32692 + * to gadget.ep_list */
32693 + for (i = 1; i < (int)(udc->max_ep / 2); i++) {
32696 + sprintf(name, "ep%dout", i);
32697 + struct_ep_setup(udc, i * 2, name, 1);
32698 + sprintf(name, "ep%din", i);
32699 + struct_ep_setup(udc, i * 2 + 1, name, 1);
32702 + /* use dma_pool for TD management */
32703 + udc_controller->td_pool = dma_pool_create("udc_td", &pdev->dev,
32704 + sizeof(struct ep_td_struct),
32705 + DTD_ALIGNMENT, UDC_DMA_BOUNDARY);
32706 + if (udc->td_pool == NULL) {
32711 + create_proc_file();
32715 + device_unregister(&udc_controller->gadget.dev);
32717 + free_irq(udc_controller->irq, udc_controller);
32721 + put_device(transceiver->dev);
32722 + release_mem_region(pdev->resource[0].start,
32723 + pdev->resource[0].end - pdev->resource[0].start + 1);
32728 +/* Driver removal functions
32730 + * Finish pending transaction
32732 +static int __exit fsl_udc_remove(struct platform_device *pdev)
32734 + struct device *dev = &pdev->dev;
32735 + struct fsl_udc *udc = (struct fsl_udc *)dev_get_drvdata(dev);
32736 + struct fsl_usb2_platform_data *pdata;
32739 + DECLARE_COMPLETION(done);
32741 + pdata = pdev->dev.platform_data;
32746 + udc->done = &done;
32748 + /* DR has been stopped in usb_gadget_unregister_driver() */
32750 + if (udc->transceiver) {
32751 + put_device(udc->transceiver->dev);
32752 + udc->transceiver = NULL;
32755 + /* remove proc */
32756 + remove_proc_file();
32759 + irq_number = udc->irq;
32760 + free_irq(pdev->resource[1].start, udc);
32763 + /* Free allocated memory */
32764 + kfree(udc->status_req->req.buf);
32765 + kfree(udc->status_req);
32766 + kfree(udc_controller->eps);
32768 + dma_pool_destroy(udc_controller->td_pool);
32769 + /* deinitlaize all ep: strcut */
32770 + /* deinitialize ep0: reg and QH */
32772 + device_unregister(&udc->gadget.dev);
32773 + /* free udc --wait for the release() finished */
32774 + wait_for_completion(&done);
32777 + * do platform specific un-initialization:
32778 + * release iomux pins, etc.
32780 + if (pdata->platform_uninit)
32781 + pdata->platform_uninit(pdev);
32786 +static int udc_suspend(struct fsl_udc *udc)
32788 + udc->stopped = 1;
32793 + * Modify Power management attributes
32794 + * Used by OTG statemachine to disable gadget temporarily
32795 + * Here we stop the DR controller and disable the irq
32796 + * @param dev device controller pointer
32797 + * @param state current state
32798 + * @return The function returns 0 on success or -1 if failed
32800 +static int fsl_udc_suspend(struct device *dev, pm_message_t state)
32802 + struct fsl_udc *udc = (struct fsl_udc *)dev_get_drvdata(dev);
32803 + pr_debug("udc: Suspend. state=%d\n", state.event);
32804 + return udc_suspend(udc);
32807 +static int udc_resume(struct fsl_udc *udc)
32809 + /*Enable DR irq reg and set controller Run */
32810 + if (udc->stopped) {
32811 + dr_controller_setup(udc);
32812 + dr_controller_run(udc);
32814 + udc->usb_state = USB_STATE_ATTACHED;
32815 + udc->ep0_state = WAIT_FOR_SETUP;
32816 + udc->ep0_dir = 0;
32821 + * Invoked on USB resume. May be called in_interrupt.
32822 + * Here we start the DR controller and enable the irq
32823 + * @param dev device controller pointer
32824 + * @return The function returns 0 on success or -1 if failed
32826 +static int fsl_udc_resume(struct device *dev)
32828 + struct fsl_udc *udc = (struct fsl_udc *)dev_get_drvdata(dev);
32829 + pr_debug("udc: Resume dev=0x%p udc=0x%p\n", dev, udc);
32831 + return udc_resume(udc);
32834 +/*-------------------------------------------------------------------------
32835 + Register entry point for the peripheral controller driver
32836 +--------------------------------------------------------------------------*/
32837 +static struct platform_driver udc_driver = {
32838 + .probe = fsl_udc_probe,
32839 + .remove = __exit_p(fsl_udc_remove),
32841 + .name = (char *)driver_name,
32842 + .owner = THIS_MODULE,
32846 +static int __init udc_init(void)
32848 + printk(KERN_INFO "%s version %s init \n", driver_desc, DRIVER_VERSION);
32849 + return platform_driver_register(&udc_driver);
32852 +module_init(udc_init);
32854 +static void __exit udc_exit(void)
32856 + platform_driver_unregister(&udc_driver);
32857 + printk(KERN_INFO "%s unregistered \n", driver_desc);
32860 +module_exit(udc_exit);
32862 +MODULE_DESCRIPTION(DRIVER_DESC);
32863 +MODULE_AUTHOR(DRIVER_AUTHOR);
32864 +MODULE_LICENSE("GPL");
32866 +++ b/drivers/usb/host/ehci-arc.c
32869 + * drivers/usb/host/ehci-arc.c
32871 + * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
32875 + * The code contained herein is licensed under the GNU General Public
32876 + * License. You may obtain a copy of the GNU General Public License
32877 + * Version 2 or later at the following locations:
32879 + * http://www.opensource.org/licenses/gpl-license.html
32880 + * http://www.gnu.org/copyleft/gpl.html
32883 +/* Note: this file is #included by ehci-hcd.c */
32885 +#include <linux/platform_device.h>
32886 +#include <linux/usb/fsl_usb2.h>
32887 +#include <linux/fsl_devices.h>
32888 +#include <linux/usb/otg.h>
32890 +#include "ehci-fsl.h"
32893 +/* FIXME: Power Managment is un-ported so temporarily disable it */
32896 +/* PCI-based HCs are common, but plenty of non-PCI HCs are used too */
32898 +/* configure so an HC device and id are always provided */
32899 +/* always called with process context; sleeping is OK */
32902 + * usb_hcd_fsl_probe - initialize FSL-based HCDs
32903 + * @drvier: Driver to be used for this HCD
32904 + * @pdev: USB Host Controller being probed
32905 + * Context: !in_interrupt()
32907 + * Allocates basic resources for this USB host controller.
32910 +static int usb_hcd_fsl_probe(const struct hc_driver *driver,
32911 + struct platform_device *pdev)
32913 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
32914 + struct usb_hcd *hcd;
32915 + struct resource *res;
32919 + pr_debug("initializing FSL-SOC USB Controller\n");
32921 + /* Need platform data for setup */
32923 + dev_err(&pdev->dev,
32924 + "No platform data for %s.\n", pdev->dev.bus_id);
32928 + retval = fsl_platform_verify(pdev);
32933 + * do platform specific init: check the clock, grab/config pins, etc.
32935 + if (pdata->platform_init && pdata->platform_init(pdev)) {
32936 + retval = -ENODEV;
32940 + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
32942 + dev_err(&pdev->dev,
32943 + "Found HC with no IRQ. Check %s setup!\n",
32944 + pdev->dev.bus_id);
32947 + irq = res->start;
32949 + fsl_platform_set_vbus_power(pdev, 1);
32951 + hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
32953 + retval = -ENOMEM;
32957 + if (pdata->regs) {
32958 + pr_debug("REGS: using pdata->regs (0x%p)\n", pdata->regs);
32959 + hcd->regs = pdata->regs;
32960 + hcd->rsrc_start = pdata->r_start;
32961 + hcd->rsrc_len = pdata->r_len;
32963 + pr_debug("REGS: NO pdata->regs\n");
32964 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
32966 + dev_err(&pdev->dev, "Found HC with no register addr. "
32967 + "Check %s setup!\n", pdev->dev.bus_id);
32968 + retval = -ENODEV;
32971 + hcd->rsrc_start = res->start;
32972 + hcd->rsrc_len = res->end - res->start + 1;
32975 + printk("DDD %s(): rsrc_start=0x%llx rsrc_len=0x%llx "
32976 + "pdata=0x%p\n", __FUNCTION__,
32977 + hcd->rsrc_start, hcd->rsrc_len, pdata);
32980 + if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
32981 + driver->description)) {
32982 + dev_dbg(&pdev->dev, "request_mem_region failed\n");
32986 + hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
32988 + if (hcd->regs == NULL) {
32989 + dev_dbg(&pdev->dev, "error mapping memory\n");
32990 + retval = -EFAULT;
32994 + hcd->power_budget = pdata->power_budget;
32997 + * the following must be done by this point, otherwise the OTG
32998 + * host port doesn't make it thru initializtion.
32999 + * ehci_halt(), called by ehci_fsl_setup() returns -ETIMEDOUT
33001 + fsl_platform_set_host_mode(hcd);
33003 + retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
33007 +#if defined(CONFIG_USB_OTG)
33008 + if (pdata->does_otg) {
33009 + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
33011 + ehci->transceiver = otg_get_transceiver();
33013 + if (ehci->transceiver) {
33014 + retval = otg_set_host(ehci->transceiver,
33015 + &ehci_to_hcd(ehci)->self);
33017 + if (ehci->transceiver)
33018 + put_device(ehci->transceiver->dev);
33022 + printk(KERN_ERR "can't find transceiver\n");
33023 + retval = -ENODEV;
33032 + /* DDD only if we did the iomap() iounmap(hcd->regs); */
33034 + /* DDD only if we did a request_
33035 + * release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
33038 + usb_put_hcd(hcd);
33040 + dev_err(&pdev->dev, "init %s fail, %d\n", pdev->dev.bus_id, retval);
33041 + if (pdata->platform_uninit)
33042 + pdata->platform_uninit(pdev);
33046 +/* may be called without controller electrically present */
33047 +/* may be called with controller, bus, and devices active */
33050 + * usb_hcd_fsl_remove - shutdown processing for FSL-based HCDs
33051 + * @dev: USB Host Controller being removed
33052 + * Context: !in_interrupt()
33054 + * Reverses the effect of usb_hcd_fsl_probe().
33057 +static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
33058 + struct platform_device *pdev)
33060 + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
33061 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
33063 + /* DDD shouldn't we turn off the power here? */
33064 + fsl_platform_set_vbus_power(pdev, 0);
33066 + usb_remove_hcd(hcd);
33068 + if (ehci->transceiver) {
33069 + (void)otg_set_host(ehci->transceiver, 0);
33070 + put_device(ehci->transceiver->dev);
33072 + usb_put_hcd(hcd);
33075 + * do platform specific un-initialization:
33076 + * release iomux pins, etc.
33078 + if (pdata->platform_uninit)
33079 + pdata->platform_uninit(pdev);
33082 +/* called after powerup, by probe or system-pm "wakeup" */
33083 +static int ehci_fsl_reinit(struct ehci_hcd *ehci)
33085 + fsl_platform_usb_setup(ehci_to_hcd(ehci));
33086 + ehci_port_power(ehci, 0);
33091 +/* called during probe() after chip reset completes */
33092 +static int ehci_fsl_setup(struct usb_hcd *hcd)
33094 + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
33096 + struct fsl_usb2_platform_data *pdata;
33097 + pdata = hcd->self.controller-> platform_data;
33099 + ehci->big_endian_desc = pdata->big_endian_desc;
33100 + ehci->big_endian_mmio = pdata->big_endian_mmio;
33102 + /* EHCI registers start at offset 0x100 */
33103 + ehci->caps = hcd->regs + 0x100;
33104 + ehci->regs = hcd->regs + 0x100 +
33105 + HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
33107 + pr_debug("%s(): ehci->caps=0x%p ehci->regs=0x%p\n", __FUNCTION__,
33108 + ehci->caps, ehci->regs);
33110 + dbg_hcs_params(ehci, "reset");
33111 + dbg_hcc_params(ehci, "reset");
33113 + /* cache this readonly data; minimize chip reads */
33114 + ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
33116 + retval = ehci_halt(ehci);
33120 + /* data structure init */
33121 + retval = ehci_init(hcd);
33125 + ehci->is_tdi_rh_tt = 1;
33127 + ehci->sbrn = 0x20;
33129 + ehci_reset(ehci);
33131 + retval = ehci_fsl_reinit(ehci);
33135 +static const struct hc_driver ehci_fsl_hc_driver = {
33136 + .description = hcd_name,
33137 + .product_desc = "Freescale On-Chip EHCI Host Controller",
33138 + .hcd_priv_size = sizeof(struct ehci_hcd),
33141 + * generic hardware linkage
33144 + .flags = FSL_PLATFORM_HC_FLAGS,
33147 + * basic lifecycle operations
33149 + .reset = ehci_fsl_setup,
33150 + .start = ehci_run,
33151 + .stop = ehci_stop,
33152 + .shutdown = ehci_shutdown,
33155 + * managing i/o requests and associated device resources
33157 + .urb_enqueue = ehci_urb_enqueue,
33158 + .urb_dequeue = ehci_urb_dequeue,
33159 + .endpoint_disable = ehci_endpoint_disable,
33162 + * scheduling support
33164 + .get_frame_number = ehci_get_frame,
33167 + * root hub support
33169 + .hub_status_data = ehci_hub_status_data,
33170 + .hub_control = ehci_hub_control,
33171 + .bus_suspend = ehci_bus_suspend,
33172 + .bus_resume = ehci_bus_resume,
33175 +#ifdef CONFIG_USB_OTG
33177 + * Holding pen for all the EHCI registers except port_status,
33178 + * which is a zero element array and hence takes no space.
33179 + * The port_status register is saved in usb_ehci_portsc.
33181 +volatile static struct ehci_regs usb_ehci_regs;
33182 +static u32 usb_ehci_portsc;
33184 +/* suspend/resume, section 4.3 */
33186 +/* These routines rely on the bus (pci, platform, etc)
33187 + * to handle powerdown and wakeup, and currently also on
33188 + * transceivers that don't need any software attention to set up
33189 + * the right sort of wakeup.
33191 + * They're also used for turning on/off the port when doing OTG.
33193 +static int ehci_fsl_drv_suspend(struct platform_device *pdev,
33194 + pm_message_t message)
33196 + struct usb_hcd *hcd = platform_get_drvdata(pdev);
33197 + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
33200 + pr_debug("%s pdev=0x%p ehci=0x%p hcd=0x%p\n",
33201 + __FUNCTION__, pdev, ehci, hcd);
33202 + pr_debug("%s ehci->regs=0x%p hcd->regs=0x%p hcd->state=%d\n",
33203 + __FUNCTION__, ehci->regs, hcd->regs, hcd->state);
33205 + hcd->state = HC_STATE_SUSPENDED;
33206 + pdev->dev.power.power_state = PMSG_SUSPEND;
33208 + if (hcd->driver->suspend)
33209 + return hcd->driver->suspend(hcd, message);
33211 + /* ignore non-host interrupts */
33212 + clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
33214 + tmp = ehci_readl(ehci, &ehci->regs->command);
33216 + ehci_writel(ehci, tmp, &ehci->regs->command);
33218 + memcpy((void *)&usb_ehci_regs, ehci->regs, sizeof(struct ehci_regs));
33219 + usb_ehci_portsc = ehci_readl(ehci, &ehci->regs->port_status[0]);
33221 + /* clear the W1C bits */
33222 + usb_ehci_portsc &= cpu_to_hc32(ehci, ~PORT_RWC_BITS);
33224 + fsl_platform_set_vbus_power(pdev, 0);
33225 + /* clear PP to cut power to the port */
33226 + tmp = ehci_readl(ehci, &ehci->regs->port_status[0]);
33227 + tmp &= ~PORT_POWER;
33228 + ehci_writel(ehci, tmp, &ehci->regs->port_status[0]);
33233 +static int ehci_fsl_drv_resume(struct platform_device *pdev)
33235 + struct usb_hcd *hcd = platform_get_drvdata(pdev);
33236 + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
33238 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
33240 + pr_debug("%s pdev=0x%p pdata=0x%p ehci=0x%p hcd=0x%p\n",
33241 + __FUNCTION__, pdev, pdata, ehci, hcd);
33243 + pr_debug("%s ehci->regs=0x%p hcd->regs=0x%p\n",
33244 + __FUNCTION__, ehci->regs, hcd->regs);
33246 + memcpy(ehci->regs, (void *)&usb_ehci_regs, sizeof(struct ehci_regs));
33248 + tmp = USBMODE_CM_HOST | (pdata->es ? USBMODE_ES : 0);
33249 + ehci_writel(ehci, tmp, hcd->regs + FSL_SOC_USB_USBMODE);
33250 + pr_debug("tmp %08x set usbmode %08x\n", tmp,
33251 + ehci_readl(ehci, hcd->regs + FSL_SOC_USB_USBMODE));
33253 + ehci_writel(ehci, usb_ehci_portsc, &ehci->regs->port_status[0]);
33254 + pr_debug("set portsc %08x %08x\n", usb_ehci_portsc,
33255 + ehci_readl(ehci, &ehci->regs->port_status[0]));
33257 + set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
33258 + hcd->state = HC_STATE_RUNNING;
33259 + pdev->dev.power.power_state = PMSG_ON;
33261 + tmp = ehci_readl(ehci, &ehci->regs->command);
33263 + ehci_writel(ehci, tmp, &ehci->regs->command);
33265 + fsl_platform_set_vbus_power(pdev, 1);
33267 + usb_hcd_resume_root_hub(hcd);
33271 +#endif /* CONFIG_USB_OTG */
33273 +static int ehci_fsl_drv_probe(struct platform_device *pdev)
33275 + if (usb_disabled())
33278 + return usb_hcd_fsl_probe(&ehci_fsl_hc_driver, pdev);
33281 +static int ehci_fsl_drv_remove(struct platform_device *pdev)
33283 + struct usb_hcd *hcd = platform_get_drvdata(pdev);
33285 + usb_hcd_fsl_remove(hcd, pdev);
33290 +MODULE_ALIAS("fsl-ehci");
33292 +static struct platform_driver ehci_fsl_driver = {
33293 + .probe = ehci_fsl_drv_probe,
33294 + .remove = ehci_fsl_drv_remove,
33295 + .shutdown = usb_hcd_platform_shutdown,
33296 +#ifdef CONFIG_USB_OTG
33297 + .suspend = ehci_fsl_drv_suspend,
33298 + .resume = ehci_fsl_drv_resume,
33301 + .name = "fsl-ehci",
33304 --- a/drivers/usb/host/ehci-fsl.h
33305 +++ b/drivers/usb/host/ehci-fsl.h
33307 #ifndef _EHCI_FSL_H
33308 #define _EHCI_FSL_H
33310 +#include <linux/usb/fsl_xcvr.h>
33312 /* offsets for the non-ehci registers in the FSL SOC USB controller */
33313 #define FSL_SOC_USB_ULPIVP 0x170
33314 #define FSL_SOC_USB_PORTSC1 0x184
33316 #define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */
33317 #define FSL_SOC_USB_SICTRL 0x410 /* NOTE: big-endian */
33318 #define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */
33319 -#define SNOOP_SIZE_2GB 0x1e
33321 +#ifdef CONFIG_MPC834x
33322 +#include <sysdev/fsl_usb.h>
33325 +#ifdef CONFIG_ARCH_MX3
33326 +#include <asm/arch/mx31_usb.h>
33329 +#ifdef CONFIG_ARCH_MX27
33330 +#include <asm/arch/mx27_usb.h>
33333 +#ifdef CONFIG_M54455
33334 +#include <asm-m68k/mcf5445x_usb.h>
33338 +static void fsl_platform_set_vbus_power(struct platform_device *pdev, int on)
33340 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
33342 + if (pdata->xcvr_ops && pdata->xcvr_ops->set_vbus_power)
33343 + pdata->xcvr_ops->set_vbus_power(pdata, on);
33345 #endif /* _EHCI_FSL_H */
33346 --- a/drivers/usb/host/ehci.h
33347 +++ b/drivers/usb/host/ehci.h
33348 @@ -122,6 +122,12 @@ struct ehci_hcd { /* one per controlle
33350 u8 sbrn; /* packed release number */
33353 + * OTG controllers and transceivers need software interaction;
33354 + * other external transceivers should be software-transparent
33356 + struct otg_transceiver *transceiver;
33358 /* irq statistics */
33360 struct ehci_stats stats;
33361 @@ -753,6 +759,22 @@ ehci_port_speed(struct ehci_hcd *ehci, u
33362 #define writel_be(val, addr) __raw_writel(val, (__force unsigned *)addr)
33365 +#if defined(CONFIG_COLDFIRE)
33367 + * Sorry, include/asm-m68k/io.h is messed up. It will give you a
33368 + * BE readl or a LE readl depending on whether or not CONFIG_PCI is set.
33369 + * how broken is that? Do the right thing here.
33374 +#define readl(addr) in_le32((__force unsigned *)(addr))
33375 +#define writel(val,addr) out_le32((__force unsigned *)(addr),(val))
33377 +#define readl_be(addr) in_be32((__force unsigned *)(addr))
33378 +#define writel_be(val, addr) out_be32((__force unsigned *)(addr), (val))
33381 static inline unsigned int ehci_readl(const struct ehci_hcd *ehci,
33382 __u32 __iomem * regs)
33384 --- a/drivers/usb/host/ehci-hcd.c
33385 +++ b/drivers/usb/host/ehci-hcd.c
33386 @@ -1043,6 +1043,11 @@ MODULE_LICENSE ("GPL");
33387 #define PLATFORM_DRIVER ixp4xx_ehci_driver
33390 +#ifdef CONFIG_M54455
33391 +#include "ehci-arc.c"
33392 +#define PLATFORM_DRIVER ehci_fsl_driver
33395 #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
33396 !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER)
33397 #error "missing bus glue for ehci-hcd"
33398 --- a/drivers/usb/host/ehci-mem.c
33399 +++ b/drivers/usb/host/ehci-mem.c
33400 @@ -40,7 +40,8 @@ static inline void ehci_qtd_init(struct
33402 memset (qtd, 0, sizeof *qtd);
33403 qtd->qtd_dma = dma;
33404 - qtd->hw_token = cpu_to_le32 (QTD_STS_HALT);
33405 + // DDD official code` has: qtd->hw_token = cpu_to_le32 (QTD_STS_HALT);
33406 + qtd->hw_token = cpu_to_hc32 (ehci, QTD_STS_HALT);
33407 qtd->hw_next = EHCI_LIST_END(ehci);
33408 qtd->hw_alt_next = EHCI_LIST_END(ehci);
33409 INIT_LIST_HEAD (&qtd->qtd_list);
33410 @@ -211,9 +212,11 @@ static int ehci_mem_init (struct ehci_hc
33413 /* Hardware periodic table */
33414 - ehci->periodic = (__le32 *)
33415 + // DDD official code has: ehci->periodic = (__le32 *)
33416 + ehci->periodic = (__hc32 *)
33417 dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller,
33418 - ehci->periodic_size * sizeof(__le32),
33419 + // DDD official: ehci->periodic_size * sizeof(__le32),
33420 + ehci->periodic_size * sizeof(__hc32),
33421 &ehci->periodic_dma, 0);
33422 if (ehci->periodic == NULL) {
33424 --- a/drivers/usb/host/Kconfig
33425 +++ b/drivers/usb/host/Kconfig
33426 @@ -32,6 +32,7 @@ config USB_EHCI_HCD
33427 config USB_EHCI_ROOT_HUB_TT
33428 bool "Root Hub Transaction Translators (EXPERIMENTAL)"
33429 depends on USB_EHCI_HCD && EXPERIMENTAL
33430 + default y if M54455
33432 Some EHCI chips have vendor-specific extensions to integrate
33433 transaction translators, so that no OHCI or UHCI companion
33434 @@ -60,12 +61,12 @@ config USB_EHCI_TT_NEWSCHED
33436 config USB_EHCI_BIG_ENDIAN_MMIO
33438 - depends on USB_EHCI_HCD && (PPC_CELLEB || PPC_PS3 || 440EPX || ARCH_IXP4XX)
33439 + depends on USB_EHCI_HCD && (PPC_CELLEB || PPC_PS3 || 440EPX || ARCH_IXP4XX || M54455)
33442 config USB_EHCI_BIG_ENDIAN_DESC
33444 - depends on USB_EHCI_HCD && (440EPX || ARCH_IXP4XX)
33445 + depends on USB_EHCI_HCD && (440EPX || ARCH_IXP4XX || M54455)
33448 config USB_EHCI_FSL
33449 @@ -260,3 +261,19 @@ config USB_R8A66597_HCD
33450 To compile this driver as a module, choose M here: the
33451 module will be called r8a66597-hcd.
33454 + prompt "Select transceiver"
33455 + depends on M54455
33456 + default USB_M5445X_ULPI
33458 +config USB_M5445X_ULPI
33459 + bool "External ULPI"
33461 + Enable support for the external HS ULPI transceiver.
33463 +config USB_M5445X_FSLS
33464 + bool "On-chip (FL/LS only)"
33466 + Enable support for the on-chip FL/LS transceiver.
33469 --- a/drivers/usb/host/Makefile
33470 +++ b/drivers/usb/host/Makefile
33471 @@ -6,7 +6,7 @@ ifeq ($(CONFIG_USB_DEBUG),y)
33472 EXTRA_CFLAGS += -DDEBUG
33475 -obj-$(CONFIG_PCI) += pci-quirks.o
33476 +#obj-$(CONFIG_PCI) += pci-quirks.o
33478 obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
33479 obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
33480 --- a/drivers/usb/Kconfig
33481 +++ b/drivers/usb/Kconfig
33482 @@ -55,6 +55,7 @@ config USB_ARCH_HAS_EHCI
33483 default y if PPC_83xx
33484 default y if SOC_AU1200
33485 default y if ARCH_IXP4XX
33486 + default y if M54455
33489 # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
33490 --- a/drivers/usb/Makefile
33491 +++ b/drivers/usb/Makefile
33492 @@ -32,3 +32,5 @@ obj-$(CONFIG_USB) += misc/
33494 obj-$(CONFIG_USB_ATM) += atm/
33495 obj-$(CONFIG_USB_SPEEDTOUCH) += atm/
33497 +obj-$(CONFIG_USB_OTG) += otg/
33499 +++ b/drivers/usb/otg/fsl_otg.c
33502 + * Copyright (c) Freescale Semiconductor, Inc. 2006-2007
33504 + * USB OTG ULPI driver
33506 + * Based on code for MPC from:
33507 + * Leo Li<LeoLi@freescale.com>
33508 + * Jerry Huang<Chang-Ming.Huang@freescale.com>
33510 + * and M5329 code from
33511 + * Yaroslav Vinogradov yaroslav.vinogradov@freescale.com
33514 + * Initialization based on code from Shlomi Gridish.
33516 + * This program is free software; you can redistribute it and/or modify
33517 + * it under the terms of the GNU General Public License as published by
33518 + * the Free Software Foundation; either version 2 of the License, or
33519 + * (at your option) any later version.
33521 + * This program is distributed in the hope that it will be useful, but
33522 + * WITHOUT ANY WARRANTY; without even the implied warranty of
33523 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
33524 + * General Public License for more details.
33526 + * You should have received a copy of the GNU General Public License along
33527 + * with this program; if not, write to the Free Software Foundation, Inc.,
33528 + * 675 Mass Ave, Cambridge, MA 02139, USA.
33529 + ***************************************************************************
33531 + * v0.3 08 August 2007 Duck
33532 + * v0.2 20 October 2006 Andrey Butok
33533 + * Issues fixing and some changes.
33534 + * v0.1 September 2006 Yaroslav Vinogradov
33535 + * Initial version.
33539 +#include <linux/module.h>
33540 +#include <linux/moduleparam.h>
33541 +#include <linux/kernel.h>
33542 +#include <linux/delay.h>
33543 +#include <linux/ioport.h>
33544 +#include <linux/sched.h>
33545 +#include <linux/slab.h>
33546 +#include <linux/smp_lock.h>
33547 +#include <linux/proc_fs.h>
33548 +#include <linux/errno.h>
33549 +#include <linux/init.h>
33550 +#include <linux/reboot.h>
33551 +#include <linux/timer.h>
33552 +#include <linux/list.h>
33553 +#include <linux/interrupt.h>
33554 +#include <linux/usb.h>
33555 +#include <linux/device.h>
33556 +#include <linux/platform_device.h>
33557 +#include <linux/usb/ch9.h>
33558 +#include <linux/usb_gadget.h>
33559 +#include <linux/workqueue.h>
33560 +#include <linux/time.h>
33561 +#include <linux/fsl_devices.h>
33562 +#include <linux/usb/fsl_usb2.h>
33564 +#include <linux/io.h>
33566 +#if defined CONFIG_M54455
33567 +#include <asm/mcfsim.h>
33570 +#define USE_WORK_QUEUES
33571 +#include "fsl_otg.h"
33573 +#define CONFIG_USB_OTG_DEBUG_FILES
33574 +#define DRIVER_VERSION "Revision: 1.56"
33575 +#define DRIVER_AUTHOR "Freescale Semiconductor Inc."
33576 +#define DRIVER_DESC "Freescale USB OTG ULPI Driver"
33577 +#define DRIVER_INFO DRIVER_VERSION " " DRIVER_DESC
33579 +MODULE_DESCRIPTION("Freescale USB OTG Controller Driver");
33581 +static const char driver_name[] = "fsl-usb2-otg";
33583 +static spinlock_t usb_dr_regs_lock;
33585 +/*#define HA_DATA_PULSE 1*/
33587 +volatile static struct fsl_usb_device_regs *usb_dr_regs;
33588 +static struct fsl_otg *fsl_otg_dev;
33589 +static int srp_wait_done;
33591 +/* Driver specific timers */
33592 +struct fsl_otg_timer *b_data_pulse_tmr, *b_vbus_pulse_tmr, *b_srp_fail_tmr,
33593 + *b_srp_wait_tmr, *a_wait_enum_tmr;
33595 +static struct list_head active_timers;
33597 +static struct fsl_otg_config fsl_otg_initdata = {
33602 +static void dump_state(const char *string, struct otg_fsm *fsm)
33604 + printk(KERN_DEBUG "%s\n\tOTG state: %s\n", string,
33605 + state_string(fsl_otg_dev->otg.state));
33606 + printk(KERN_DEBUG "\tFSM protocol=%s\n", fsm->protocol ?
33607 + (fsm->protocol == PROTO_HOST ? "Host" : "Gadget")
33611 + printk(KERN_DEBUG "\t OTGSC 0x%08x\n",
33612 + fsl_readl(&usb_dr_regs->otgsc));
33613 + printk(KERN_DEBUG "\tPORTSC1 0x%08x\n",
33614 + fsl_readl(&usb_dr_regs->portsc1));
33615 + printk(KERN_DEBUG "\tUSBMODE 0x%08x\n",
33616 + fsl_readl(&usb_dr_regs->usbmode));
33617 + printk(KERN_DEBUG "\t USBCMD 0x%08x\n",
33618 + fsl_readl(&usb_dr_regs->usbcmd));
33619 + printk(KERN_DEBUG "\t USBSTS 0x%08x\n",
33620 + fsl_readl(&usb_dr_regs->usbsts));
33622 + /* ------ State Machine Variables ----- */
33623 + printk(KERN_DEBUG "\ta_bus_req: %d\n", fsm->a_bus_req);
33624 + printk(KERN_DEBUG "\tb_bus_req: %d\n", fsm->b_bus_req);
33625 + printk(KERN_DEBUG "\ta_bus_resume: %d\n", fsm->a_bus_resume);
33626 + printk(KERN_DEBUG "\ta_bus_suspend: %d\n", fsm->a_bus_suspend);
33627 + printk(KERN_DEBUG "\ta_conn: %d\n", fsm->a_conn);
33628 + printk(KERN_DEBUG "\ta_sess_vld: %d\n", fsm->a_sess_vld);
33629 + printk(KERN_DEBUG "\ta_srp_det: %d\n", fsm->a_srp_det);
33630 + printk(KERN_DEBUG "\ta_vbus_vld: %d\n", fsm->a_vbus_vld);
33631 + printk(KERN_DEBUG "\tb_bus_resume: %d\n", fsm->b_bus_resume);
33632 + printk(KERN_DEBUG "\tb_bus_suspend: %d\n", fsm->b_bus_suspend);
33633 + printk(KERN_DEBUG "\tb_conn: %d\n", fsm->b_conn);
33634 + printk(KERN_DEBUG "\tb_se0_srp: %d\n", fsm->b_se0_srp);
33635 + printk(KERN_DEBUG "\tb_sess_end: %d\n", fsm->b_sess_end);
33636 + printk(KERN_DEBUG "\tb_sess_vld: %d\n", fsm->b_sess_vld);
33637 + printk(KERN_DEBUG "\tid: %d\n", fsm->id);
33642 +/* Routines to access transceiver ULPI registers */
33643 +u8 view_ulpi(u8 addr)
33647 + temp = 0x40000000 | (addr << 16);
33648 + fsl_writel(temp, &usb_dr_regs->ulpiview);
33652 + /* DDD timeout this loop: */
33654 + temp = fsl_readl(&usb_dr_regs->ulpiview);
33655 + } while (temp & 0x40000000);
33657 + return (temp & 0x0000ff00) >> 8;
33660 +int write_ulpi(u8 addr, u8 data)
33664 + temp = 0x60000000 | (addr << 16) | data;
33665 + fsl_writel(temp, &usb_dr_regs->ulpiview);
33669 +/* prototype declaration */
33670 +void fsl_otg_add_timer(void *timer);
33671 +void fsl_otg_del_timer(void *timer);
33673 +/* -------------------------------------------------------------*/
33674 +/* Operations that will be called from OTG Finite State Machine */
33676 +/* Charge vbus for vbus pulsing in SRP */
33677 +void fsl_otg_chrg_vbus(int on)
33681 + VDBG(" %d\n", on);
33683 + tmp = fsl_readl(&usb_dr_regs->otgsc) & ~OTGSC_INTSTS_MASK;
33686 + tmp &= ~OTGSC_CTRL_VBUS_DISCHARGE;
33687 + tmp |= OTGSC_CTRL_VBUS_CHARGE;
33689 + tmp &= ~OTGSC_CTRL_VBUS_CHARGE;
33691 + fsl_writel(tmp, &usb_dr_regs->otgsc);
33694 +/* Discharge vbus through a resistor to ground */
33695 +void fsl_otg_dischrg_vbus(int on)
33699 + VDBG(" %d\n", on);
33701 + tmp = fsl_readl(&usb_dr_regs->otgsc) & ~OTGSC_INTSTS_MASK;
33704 + tmp |= OTGSC_CTRL_VBUS_DISCHARGE;
33706 + tmp &= ~OTGSC_CTRL_VBUS_DISCHARGE;
33708 + fsl_writel(tmp, &usb_dr_regs->otgsc);
33711 +/* A-device driver vbus, controlled through PP bit in PORTSC */
33712 +void fsl_otg_drv_vbus(int on)
33716 + VDBG(" %d\n", on);
33718 + tmp = fsl_readl(&usb_dr_regs->portsc1) & ~PORTSCX_W1C_BITS;
33721 + tmp |= PORTSCX_PORT_POWER;
33723 + tmp &= ~PORTSCX_PORT_POWER;
33725 + fsl_writel(tmp, &usb_dr_regs->portsc1);
33728 +/* Pull-up D+, signalling connect by periperal. Also used in
33729 + * data-line pulsing in SRP */
33730 +void fsl_otg_loc_conn(int on)
33734 + VDBG(" %d\n", on);
33736 + tmp = fsl_readl(&usb_dr_regs->otgsc) & ~OTGSC_INTSTS_MASK;
33739 + tmp |= OTGSC_CTRL_DATA_PULSING;
33741 + tmp &= ~OTGSC_CTRL_DATA_PULSING;
33743 + fsl_writel(tmp, &usb_dr_regs->otgsc);
33746 +/* Generate SOF by host. This is controlled through suspend/resume the
33747 + * port. In host mode, controller will automatically send SOF.
33748 + * Suspend will block the data on the port.
33750 +void fsl_otg_loc_sof(int on)
33754 + VDBG(" %d\n", on);
33756 + tmp = fsl_readl(&usb_dr_regs->portsc1) & ~PORTSCX_W1C_BITS;
33759 + tmp |= PORTSCX_PORT_FORCE_RESUME;
33761 + tmp |= PORTSCX_PORT_SUSPEND;
33763 + fsl_writel(tmp, &usb_dr_regs->portsc1);
33766 +/* Start SRP pulsing by data-line pulsing, followed with v-bus pulsing. */
33767 +void fsl_otg_start_pulse(void)
33769 + u32 __attribute__ ((unused)) tmp;
33772 + srp_wait_done = 0;
33774 +#ifdef HA_DATA_PULSE
33775 + tmp = fsl_readl(&usb_dr_regs->otgsc) &= ~OTGSC_INTSTS_MASK;
33776 + tmp |= OTGSC_HA_DATA_PULSE;
33777 + fsl_writel(tmp, &usb_dr_regs->otgsc);
33779 + fsl_otg_loc_conn(1);
33782 + fsl_otg_add_timer(b_data_pulse_tmr);
33785 +void fsl_otg_pulse_vbus(void);
33787 +void b_data_pulse_end(unsigned long foo)
33789 +#ifdef HA_DATA_PULSE
33791 + fsl_otg_loc_conn(0);
33794 + /* Do VBUS pulse after data pulse */
33795 + fsl_otg_pulse_vbus();
33798 +void fsl_otg_pulse_vbus(void)
33800 + srp_wait_done = 0;
33801 + fsl_otg_chrg_vbus(1);
33802 + /* start the timer to end vbus charge */
33803 + fsl_otg_add_timer(b_vbus_pulse_tmr);
33806 +void b_vbus_pulse_end(unsigned long foo)
33808 + fsl_otg_chrg_vbus(0);
33810 + /* As USB3300 using the same a_sess_vld and b_sess_vld voltage
33811 + * we need to discharge the bus for a while to distinguish
33812 + * residual voltage of vbus pulsing and A device pull up */
33813 + fsl_otg_dischrg_vbus(1);
33814 + fsl_otg_add_timer(b_srp_wait_tmr);
33817 +void b_srp_end(unsigned long foo)
33819 + fsl_otg_dischrg_vbus(0);
33820 + srp_wait_done = 1;
33822 + if ((fsl_otg_dev->otg.state == OTG_STATE_B_SRP_INIT) &&
33823 + fsl_otg_dev->fsm.b_sess_vld)
33824 + fsl_otg_dev->fsm.b_srp_done = 1;
33827 +/* Workaround for a_host suspending too fast. When a_bus_req=0,
33828 + * a_host will start by SRP. It needs to set b_hnp_enable before
33829 + * actually suspending to start HNP
33831 +void a_wait_enum(unsigned long foo)
33833 + VDBG("a_wait_enum timeout\n");
33834 + if (!fsl_otg_dev->otg.host->b_hnp_enable)
33835 + fsl_otg_add_timer(a_wait_enum_tmr);
33837 + otg_statemachine(&fsl_otg_dev->fsm);
33840 +/* ------------------------------------------------------*/
33842 +/* The timeout callback function to set time out bit */
33843 +void set_tmout(unsigned long indicator)
33845 + *(int *)indicator = 1;
33848 +/* Initialize timers */
33849 +void fsl_otg_init_timers(struct otg_fsm *fsm)
33851 + /* FSM used timers */
33852 + fsm->a_wait_vrise_tmr = otg_timer_initializer(&set_tmout, TA_WAIT_VRISE,
33853 + (unsigned long)&fsm->a_wait_vrise_tmout);
33854 + fsm->a_wait_bcon_tmr = otg_timer_initializer(&set_tmout, TA_WAIT_BCON,
33855 + (unsigned long)&fsm->a_wait_bcon_tmout);
33856 + fsm->a_aidl_bdis_tmr = otg_timer_initializer(&set_tmout, TA_AIDL_BDIS,
33857 + (unsigned long)&fsm->a_aidl_bdis_tmout);
33858 + fsm->b_ase0_brst_tmr = otg_timer_initializer(&set_tmout, TB_ASE0_BRST,
33859 + (unsigned long)&fsm->b_ase0_brst_tmout);
33860 + fsm->b_se0_srp_tmr = otg_timer_initializer(&set_tmout, TB_SE0_SRP,
33861 + (unsigned long)&fsm->b_se0_srp);
33862 + fsm->b_srp_fail_tmr = otg_timer_initializer(&set_tmout, TB_SRP_FAIL,
33863 + (unsigned long)&fsm->b_srp_done);
33864 + fsm->a_wait_enum_tmr = otg_timer_initializer(&a_wait_enum, 10,
33865 + (unsigned long)&fsm);
33867 + /* device driver used timers */
33868 + b_srp_wait_tmr = otg_timer_initializer(&b_srp_end, TB_SRP_WAIT, 0);
33869 + b_data_pulse_tmr = otg_timer_initializer(&b_data_pulse_end,
33871 + b_vbus_pulse_tmr = otg_timer_initializer(&b_vbus_pulse_end,
33876 +/* Add timer to timer list */
33877 +void fsl_otg_add_timer(void *gtimer)
33879 + struct fsl_otg_timer *timer = (struct fsl_otg_timer *)gtimer;
33880 + struct fsl_otg_timer *tmp_timer;
33882 + /* Check if the timer is already in the active list,
33883 + * if so update timer count
33885 + list_for_each_entry(tmp_timer, &active_timers, list)
33886 + if (tmp_timer == timer) {
33887 + timer->count = timer->expires;
33890 + timer->count = timer->expires;
33891 + list_add_tail(&timer->list, &active_timers);
33894 +/* Remove timer from the timer list; clear timeout status */
33895 +void fsl_otg_del_timer(void *gtimer)
33897 + struct fsl_otg_timer *timer = (struct fsl_otg_timer *)gtimer;
33898 + struct fsl_otg_timer *tmp_timer, *del_tmp;
33900 + list_for_each_entry_safe(tmp_timer, del_tmp, &active_timers, list)
33901 + if (tmp_timer == timer)
33902 + list_del(&timer->list);
33906 + * Reduce timer count by 1, and find timeout conditions.
33907 + * Called by fsl_otg 1ms timer interrupt
33909 +int fsl_otg_tick_timer(void)
33911 + struct fsl_otg_timer *tmp_timer, *del_tmp;
33914 + list_for_each_entry_safe(tmp_timer, del_tmp, &active_timers, list) {
33915 + tmp_timer->count--;
33916 + /* check if timer expires */
33917 + if (!tmp_timer->count) {
33918 + list_del(&tmp_timer->list);
33919 + tmp_timer->function(tmp_timer->data);
33927 +/* Reset controller, not reset the bus */
33928 +void otg_reset_controller(void)
33931 + unsigned long flags;
33936 + spin_lock_irqsave(&usb_dr_regs_lock, flags);
33938 + command = fsl_readl(&usb_dr_regs->usbcmd);
33939 + command |= USB_CMD_CTRL_RESET;
33940 + fsl_writel(command, &usb_dr_regs->usbcmd);
33941 + spin_unlock_irqrestore(&usb_dr_regs_lock, flags);
33943 + /* Wait reset completed */
33945 + while (fsl_readl(&usb_dr_regs->usbcmd) & USB_CMD_CTRL_RESET)
33947 + if (timeout <= 0)
33948 + ERR("%s - USBCMD_RST never clear. Timeout is %d \n",
33949 + __FUNCTION__, timeout);
33952 +/* Call suspend/resume routines in host driver */
33953 +int fsl_otg_start_host(struct otg_fsm *fsm, int on)
33955 + struct otg_transceiver *xceiv = fsm->transceiver;
33956 + struct device *dev;
33957 + struct fsl_otg *otg_dev = container_of(xceiv, struct fsl_otg, otg);
33960 + if (!xceiv->host)
33963 + dev = xceiv->host->controller;
33966 + * Update a_vbus_vld state as a_vbus_vld int is disabled
33969 + fsm->a_vbus_vld =
33970 + !!(fsl_readl(&usb_dr_regs->otgsc) & OTGSC_STS_A_VBUS_VALID);
33972 + /* start fsl usb host controller */
33973 + if (otg_dev->host_working)
33976 + otg_reset_controller();
33977 + VDBG("host on......\n");
33978 + if (dev->driver->resume) {
33979 + retval = dev->driver->resume(dev);
33982 + fsl_otg_drv_vbus(1);
33983 + /* Workaround: b_host can't driver
33984 + * vbus, but PP in PORTSC needs to
33985 + * be 1 for host to work.
33986 + * So we set drv_vbus bit in
33987 + * transceiver to 0 thru ULPI. */
33988 + write_ulpi(0x0c, 0x20);
33992 + otg_dev->host_working = 1;
33995 + /* stop fsl usb host controller */
33996 + if (!otg_dev->host_working)
33999 + VDBG("host off......\n");
34000 + if (dev && dev->driver) {
34001 + retval = dev->driver->suspend(dev, PMSG_SUSPEND);
34004 + fsl_otg_drv_vbus(0);
34006 + otg_dev->host_working = 0;
34014 + * Call suspend and resume function in udc driver
34015 + * to stop and start udc driver.
34017 +int fsl_otg_start_gadget(struct otg_fsm *fsm, int on)
34019 + struct otg_transceiver *xceiv = fsm->transceiver;
34020 + struct device *dev;
34022 + VDBG("DDD fsm=%p xceiv=%p\n", fsm, xceiv);
34023 + if (!xceiv->gadget || !xceiv->gadget->dev.parent)
34026 + VDBG("DDD xceiv=%p xceiv->gadget=%p parent=%p\n", xceiv, xceiv->gadget,
34027 + xceiv->gadget->dev.parent);
34029 + VDBG("gadget %s\n", on ? "on" : "off");
34030 + /* DDD dump_state("starting gadget", fsm); */
34032 + dev = xceiv->gadget->dev.parent;
34035 + dev->driver->resume(dev);
34037 + dev->driver->suspend(dev, PMSG_SUSPEND);
34043 +static void fsl_otg_enable(struct otg_transceiver *otg_p)
34045 + struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg);
34046 + struct otg_fsm *fsm = &(otg_dev)->fsm;
34049 + /* DDD VDBG(""); */
34050 + /* enable OTG interrupt */
34051 + otg_sc = fsl_readl(&usb_dr_regs->otgsc);
34052 + otg_sc |= OTGSC_INTERRUPT_ENABLE_BITS_MASK;
34053 + otg_sc &= ~OTGSC_IE_1ms_TIMER;
34054 + otg_sc &= ~OTGSC_CTRL_VBUS_DISCHARGE;
34055 + otg_sc |= OTGSC_IE_USB_ID;
34056 + fsl_writel(otg_sc, &usb_dr_regs->otgsc);
34058 + fsm->id = (otg_sc & OTGSC_STS_USB_ID) ? 1 : 0;
34061 + otg_p->state = OTG_STATE_UNDEFINED;
34063 + otg_p->state = OTG_STATE_A_IDLE;
34066 + otg_p->default_a = (fsm->id == 0);
34067 + otg_p->host->is_b_host = fsm->id;
34068 + otg_p->gadget->is_a_peripheral = !fsm->id;
34070 + fsm->a_vbus_vld = 1;
34072 + fsm->b_sess_vld = (otg_sc & OTGSC_STS_B_SESSION_VALID) ? 1 : 0;
34073 + fsm->a_sess_vld = (otg_sc & OTGSC_STS_A_SESSION_VALID) ? 1 : 0;
34074 + fsm->b_sess_end = (otg_sc & OTGSC_STS_B_SESSION_END) ? 1 : 0;
34079 + * Called by initialization code of host driver. Register host controller
34080 + * to the OTG. Suspend host for OTG role detection.
34082 +static int fsl_otg_set_host(struct otg_transceiver *otg_p, struct usb_bus *host)
34084 + struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg);
34086 + if (!otg_p || otg_dev != fsl_otg_dev)
34089 + otg_p->host = host;
34091 + otg_dev->fsm.a_bus_drop = 0;
34092 + otg_dev->fsm.a_bus_req = 1;
34095 + VDBG("host off......\n");
34097 + otg_p->host->otg_port = fsl_otg_initdata.otg_port;
34098 + otg_p->host->is_b_host = otg_dev->fsm.id;
34099 + /* must leave time for khubd to finish its thing
34100 + * before yanking the host driver out from under it,
34101 + * so suspend the host after a short delay.
34103 + otg_dev->host_working = 1;
34104 + schedule_delayed_work(&otg_dev->otg_event, 100);
34106 + } else { /* host driver going away */
34108 + if (!(le32_to_cpu(otg_dev->dr_mem_map->otgsc) &
34109 + OTGSC_STS_USB_ID)) {
34110 + /* Mini-A cable connected */
34111 + struct otg_fsm *fsm = &otg_dev->fsm;
34113 + otg_p->state = OTG_STATE_UNDEFINED;
34114 + fsm->protocol = PROTO_UNDEF;
34118 + otg_dev->host_working = 0;
34120 + otg_statemachine(&otg_dev->fsm);
34125 +/* Called by initialization code of udc. Register udc to OTG.*/
34126 +static int fsl_otg_set_peripheral(struct otg_transceiver *otg_p,
34127 + struct usb_gadget *gadget)
34129 + struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg);
34133 + if (!otg_p || otg_dev != fsl_otg_dev)
34137 + if (!otg_dev->otg.default_a)
34138 + otg_p->gadget->ops->vbus_draw(otg_p->gadget, 0);
34139 + usb_gadget_vbus_disconnect(otg_dev->otg.gadget);
34140 + otg_dev->otg.gadget = 0;
34141 + otg_dev->fsm.b_bus_req = 0;
34142 + otg_statemachine(&otg_dev->fsm);
34146 + otg_p->gadget = gadget;
34147 + otg_p->gadget->is_a_peripheral = !otg_dev->fsm.id;
34149 + otg_dev->fsm.b_bus_req = 1;
34151 + /* start the gadget right away if the ID pin says Mini-B */
34152 + DBG("ID pin=%d\n", otg_dev->fsm.id);
34153 + if (otg_dev->fsm.id == 1) {
34154 + fsl_otg_start_host(&otg_dev->fsm, 0);
34155 + fsl_otg_drv_vbus(0);
34156 + fsl_otg_start_gadget(&otg_dev->fsm, 1);
34162 +/* Set OTG port power, only for B-device */
34163 +static int fsl_otg_set_power(struct otg_transceiver *otg_p, unsigned mA)
34165 + if (!fsl_otg_dev)
34167 + if (otg_p->state == OTG_STATE_B_PERIPHERAL)
34168 + printk(KERN_DEBUG "FSL OTG:Draw %d mA\n", mA);
34173 +/* Delayed pin detect interrupt processing.
34175 + * When the Mini-A cable is disconnected from the board,
34176 + * the pin-detect interrupt happens before the disconnnect
34177 + * interrupts for the connected device(s). In order to
34178 + * process the disconnect interrupt(s) prior to switching
34179 + * roles, the pin-detect interrupts are delayed, and handled
34180 + * by this routine.
34182 +static void fsl_otg_event(struct work_struct *work)
34184 + struct fsl_otg *og = container_of(work, struct fsl_otg, otg_event.work);
34185 + struct otg_fsm *fsm = &og->fsm;
34187 + VDBG("DDD fsm->id=%d\n", fsm->id);
34188 + if (fsm->id) { /* switch to gadget */
34189 + fsl_otg_start_host(fsm, 0);
34190 + fsl_otg_drv_vbus(0);
34191 + fsl_otg_start_gadget(fsm, 1);
34195 +/* B-device start SRP */
34196 +static int fsl_otg_start_srp(struct otg_transceiver *otg_p)
34198 + struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg);
34200 + if (!otg_p || otg_dev != fsl_otg_dev
34201 + || otg_p->state != OTG_STATE_B_IDLE)
34204 + otg_dev->fsm.b_bus_req = 1;
34205 + otg_statemachine(&otg_dev->fsm);
34210 +/* A_host suspend will call this function to start hnp */
34211 +static int fsl_otg_start_hnp(struct otg_transceiver *otg_p)
34213 + struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg);
34215 + if (!otg_p || otg_dev != fsl_otg_dev)
34218 + VDBG("start_hnp.............\n");
34219 + /* clear a_bus_req to enter a_suspend state */
34220 + otg_dev->fsm.a_bus_req = 0;
34221 + otg_statemachine(&otg_dev->fsm);
34227 + * Interrupt handler. OTG/host/peripheral share the same int line.
34228 + * OTG driver clears OTGSC interrupts and leaves USB interrupts
34229 + * intact. It needs to have knowledge of some USB interrupts
34230 + * such as port change.
34232 +irqreturn_t fsl_otg_isr(int irq, void *dev_id)
34234 + struct otg_fsm *fsm = &((struct fsl_otg *)dev_id)->fsm;
34235 + struct otg_transceiver *otg = &((struct fsl_otg *)dev_id)->otg;
34236 + u32 otg_int_src, otg_sc;
34238 + otg_sc = fsl_readl(&usb_dr_regs->otgsc);
34239 + otg_int_src = otg_sc & OTGSC_INTSTS_MASK & (otg_sc >> 8);
34241 + /* Only clear otg interrupts */
34242 + fsl_writel(otg_sc, &usb_dr_regs->otgsc);
34244 + /*FIXME: ID change not generate when init to 0 */
34245 + fsm->id = (otg_sc & OTGSC_STS_USB_ID) ? 1 : 0;
34246 + otg->default_a = (fsm->id == 0);
34248 + /* process OTG interrupts */
34249 + if (otg_int_src) {
34250 + VDBG("\nOTG irq 0x%08x\n", otg_int_src);
34252 + if (otg_int_src & OTGSC_INTSTS_USB_ID) {
34253 + fsm->id = (otg_sc & OTGSC_STS_USB_ID) ? 1 : 0;
34254 + otg->default_a = (fsm->id == 0);
34255 + /* clear conn information */
34262 + otg->host->is_b_host = fsm->id;
34264 + otg->gadget->is_a_peripheral = !fsm->id;
34265 + VDBG("ID int (ID is %d)\n", fsm->id);
34267 + if (fsm->id) { /* switch to gadget */
34268 + schedule_delayed_work(&((struct fsl_otg *)
34269 + dev_id)->otg_event, 25);
34270 + } else { /* switch to host */
34271 + cancel_delayed_work(&
34272 + ((struct fsl_otg *)dev_id)->
34274 + fsl_otg_start_gadget(fsm, 0);
34275 + fsl_otg_drv_vbus(1);
34276 + fsl_otg_start_host(fsm, 1);
34279 + return IRQ_HANDLED;
34287 +static struct otg_fsm_ops fsl_otg_ops = {
34288 + .chrg_vbus = fsl_otg_chrg_vbus,
34289 + .drv_vbus = fsl_otg_drv_vbus,
34290 + .loc_conn = fsl_otg_loc_conn,
34291 + .loc_sof = fsl_otg_loc_sof,
34292 + .start_pulse = fsl_otg_start_pulse,
34294 + .add_timer = fsl_otg_add_timer,
34295 + .del_timer = fsl_otg_del_timer,
34297 + .start_host = fsl_otg_start_host,
34298 + .start_gadget = fsl_otg_start_gadget,
34301 +/* Initialize the global variable fsl_otg_dev and request IRQ for OTG */
34302 +int fsl_otg_cfg(struct platform_device *pdev)
34305 + struct fsl_otg *fsl_otg_tc;
34306 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
34307 + struct resource *res;
34314 + /* allocate space to fsl otg device */
34315 + fsl_otg_tc = kzalloc(sizeof(struct fsl_otg), GFP_KERNEL);
34319 + if (pdata->regs) {
34320 + fsl_otg_tc->dr_mem_map = pdata->regs;
34322 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
34324 + dev_err(&pdev->dev, "no register addr.\n");
34329 + printk("DDD %s(): rsrc_start=0x%x rsrc_len=0x%x\n",
34330 + __FUNCTION__, res->start, res->end - res->start + 1);
34333 + if (!request_mem_region(res->start, res->end - res->start + 1,
34335 + dev_dbg(&pdev->dev, "request_mem_region failed\n");
34338 + fsl_otg_tc->dr_mem_map = ioremap(res->start,
34339 + res->end - res->start + 1);
34341 + DBG("set dr_mem_map to 0x%p\n", fsl_otg_tc->dr_mem_map);
34343 + INIT_DELAYED_WORK(&fsl_otg_tc->otg_event, fsl_otg_event);
34345 + INIT_LIST_HEAD(&active_timers);
34346 + fsl_otg_init_timers(&fsl_otg_tc->fsm);
34348 + /* Set OTG state machine operations */
34349 + fsl_otg_tc->fsm.ops = &fsl_otg_ops;
34351 + /* record initial state of ID pin */
34352 + fsl_otg_tc->fsm.id = (fsl_otg_tc->dr_mem_map->otgsc & OTGSC_STS_USB_ID)
34354 + DBG("initial ID pin=%d\n", fsl_otg_tc->fsm.id);
34356 + /* initialize the otg structure */
34357 + fsl_otg_tc->otg.label = DRIVER_DESC;
34358 + fsl_otg_tc->otg.set_host = fsl_otg_set_host;
34359 + fsl_otg_tc->otg.set_peripheral = fsl_otg_set_peripheral;
34360 + fsl_otg_tc->otg.set_power = fsl_otg_set_power;
34361 + fsl_otg_tc->otg.start_hnp = fsl_otg_start_hnp;
34362 + fsl_otg_tc->otg.start_srp = fsl_otg_start_srp;
34364 + fsl_otg_dev = fsl_otg_tc;
34366 + /* Store the otg transceiver */
34367 + status = otg_set_transceiver(&fsl_otg_tc->otg);
34369 + printk(KERN_WARNING ": unable to register OTG transceiver.\n");
34376 +/* OTG Initialization*/
34377 +int usb_otg_start(struct platform_device *pdev)
34379 + struct fsl_otg *p_otg;
34380 + struct otg_transceiver *otg_trans = otg_get_transceiver();
34381 + struct otg_fsm *fsm;
34384 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
34389 + p_otg = container_of(otg_trans, struct fsl_otg, otg);
34390 + fsm = &p_otg->fsm;
34392 + /* Initialize the state machine structure with default values */
34393 + SET_OTG_STATE(otg_trans, OTG_STATE_UNDEFINED);
34394 + fsm->transceiver = &p_otg->otg;
34396 + usb_dr_regs = p_otg->dr_mem_map;
34397 + DBG("set usb_dr_regs to 0x%p\n", usb_dr_regs);
34399 + /* request irq */
34400 + p_otg->irq = platform_get_irq(pdev, 0);
34401 + status = request_irq(p_otg->irq, fsl_otg_isr,
34402 + IRQF_SHARED, driver_name, p_otg);
34404 + dev_dbg(p_otg->otg.dev, "can't get IRQ %d, error %d\n",
34405 + p_otg->irq, status);
34411 + /* stop the controller */
34412 + temp = fsl_readl(&usb_dr_regs->usbcmd) & ~USB_CMD_RUN_STOP;
34413 + fsl_writel(temp, &usb_dr_regs->usbcmd);
34415 + /* reset the controller */
34416 + temp = fsl_readl(&usb_dr_regs->usbcmd);
34417 + temp |= USB_CMD_CTRL_RESET;
34418 + fsl_writel(temp, &usb_dr_regs->usbcmd);
34420 + /* wait reset completed */
34422 + while (timeout-- &&
34423 + fsl_readl(&usb_dr_regs->usbcmd) & USB_CMD_CTRL_RESET)
34425 + if (timeout <= 0)
34426 + ERR("%s - USBCMD_RST never clear. Timeout is %d \n",
34427 + __FUNCTION__, timeout);
34429 + /* configure the VBUSHS as IDLE(both host and device) */
34430 + temp = USB_MODE_STREAM_DISABLE | (pdata->es ? USBMODE_ES : 0);
34431 + fsl_writel(temp, &usb_dr_regs->usbmode);
34433 + /* configure PHY interface */
34434 + temp = fsl_readl(&usb_dr_regs->portsc1);
34435 + temp &= ~(PORTSCX_PHY_TYPE_SEL | PORTSCX_PTW_8BIT);
34437 + /* DDD wrong xcvr setting stuff follows */
34438 + temp |= PORTSCX_PTS_ULPI;
34439 + fsl_writel(temp, &usb_dr_regs->portsc1);
34442 + /* disable all interrupt and clear all OTGSC status */
34443 + temp = fsl_readl(&usb_dr_regs->otgsc);
34444 + temp &= ~OTGSC_INTERRUPT_ENABLE_BITS_MASK;
34445 + temp |= OTGSC_INTERRUPT_STATUS_BITS_MASK | OTGSC_CTRL_VBUS_DISCHARGE;
34446 + fsl_writel(temp, &usb_dr_regs->otgsc);
34448 + fsl_otg_drv_vbus(0);
34451 + * The identification (id) input is FALSE when a Mini-A plug is inserted
34452 + * in the devices Mini-AB receptacle. Otherwise, this input is TRUE.
34453 + * Also: record initial state of ID pin
34455 + if (fsl_readl(&usb_dr_regs->otgsc) & OTGSC_STS_USB_ID) {
34456 + p_otg->otg.state = OTG_STATE_UNDEFINED;
34457 + p_otg->fsm.id = 1;
34459 + p_otg->otg.state = OTG_STATE_A_IDLE;
34460 + p_otg->fsm.id = 0;
34463 + DBG("initial ID pin=%d\n", p_otg->fsm.id);
34465 + /* enable OTG ID pin interrupt */
34466 + temp = fsl_readl(&usb_dr_regs->otgsc);
34467 + temp |= OTGSC_IE_USB_ID;
34468 + temp &= ~(OTGSC_CTRL_VBUS_DISCHARGE | OTGSC_IE_1ms_TIMER);
34469 + fsl_writel(temp, &usb_dr_regs->otgsc);
34474 +/* Initialize board specific registers,PIB board,clock and pin multiplexing */
34475 +static int board_init(struct platform_device *pdev)
34477 + struct fsl_usb2_platform_data *pdata;
34478 + pdata = (struct fsl_usb2_platform_data *)pdev->dev.platform_data;
34481 + * do platform specific init: check the clock, grab/config pins, etc.
34483 + if (pdata->platform_init(pdev) != 0)
34489 +/*-------------------------------------------------------------------------
34490 + PROC File System Support
34491 +-------------------------------------------------------------------------*/
34492 +#ifdef CONFIG_USB_OTG_DEBUG_FILES
34494 +#include <linux/seq_file.h>
34496 +static const char proc_filename[] = "driver/fsl_usb2_otg";
34498 +static int otg_proc_read(char *page, char **start, off_t off, int count,
34499 + int *eof, void *_dev)
34501 + struct otg_fsm *fsm = &fsl_otg_dev->fsm;
34502 + char *buf = page;
34503 + char *next = buf;
34504 + unsigned size = count;
34505 + unsigned long flags;
34512 + spin_lock_irqsave(&fsm->lock, flags);
34514 + /* ------basic driver infomation ---- */
34515 + t = scnprintf(next, size,
34516 + DRIVER_DESC "\n" "fsl_usb2_otg version: %s\n\n",
34521 + /* ------ Registers ----- */
34522 + /* tmp_reg = le32_to_cpu(usb_dr_regs->otgsc); */
34523 + tmp_reg = fsl_readl(&usb_dr_regs->otgsc);
34524 + t = scnprintf(next, size, "OTGSC reg: 0x%08x\n", tmp_reg);
34528 + /* tmp_reg = le32_to_cpu(usb_dr_regs->portsc); */
34529 + tmp_reg = fsl_readl(&usb_dr_regs->portsc1);
34530 + t = scnprintf(next, size, "PORTSC reg: 0x%08x\n", tmp_reg);
34534 + /* tmp_reg = le32_to_cpu(usb_dr_regs->usbmode); */
34535 + tmp_reg = fsl_readl(&usb_dr_regs->usbmode);
34536 + t = scnprintf(next, size, "USBMODE reg: 0x%08x\n", tmp_reg);
34540 + /* tmp_reg = le32_to_cpu(usb_dr_regs->usbcmd); */
34541 + tmp_reg = fsl_readl(&usb_dr_regs->usbcmd);
34542 + t = scnprintf(next, size, "USBCMD reg: 0x%08x\n", tmp_reg);
34546 + /* tmp_reg = le32_to_cpu(usb_dr_regs->usbsts); */
34547 + tmp_reg = fsl_readl(&usb_dr_regs->usbsts);
34548 + t = scnprintf(next, size, "USBSTS reg: 0x%08x\n", tmp_reg);
34552 + /* ------ State ----- */
34553 + t = scnprintf(next, size, "FSM protocol=%d %s\n", fsm->protocol,
34555 + (fsm->protocol == PROTO_HOST ? "Host" : "Gadget")
34560 + t = scnprintf(next, size,
34561 + "OTG state: %s\n\n",
34562 + state_string(fsl_otg_dev->otg.state));
34566 + /* ------ State Machine Variables ----- */
34567 + t = scnprintf(next, size, "a_bus_req: %d\n", fsm->a_bus_req);
34571 + t = scnprintf(next, size, "b_bus_req: %d\n", fsm->b_bus_req);
34575 + t = scnprintf(next, size, "a_bus_resume: %d\n", fsm->a_bus_resume);
34579 + t = scnprintf(next, size, "a_bus_suspend: %d\n", fsm->a_bus_suspend);
34583 + t = scnprintf(next, size, "a_conn: %d\n", fsm->a_conn);
34587 + t = scnprintf(next, size, "a_sess_vld: %d\n", fsm->a_sess_vld);
34591 + t = scnprintf(next, size, "a_srp_det: %d\n", fsm->a_srp_det);
34595 + t = scnprintf(next, size, "a_vbus_vld: %d\n", fsm->a_vbus_vld);
34599 + t = scnprintf(next, size, "b_bus_resume: %d\n", fsm->b_bus_resume);
34603 + t = scnprintf(next, size, "b_bus_suspend: %d\n", fsm->b_bus_suspend);
34607 + t = scnprintf(next, size, "b_conn: %d\n", fsm->b_conn);
34611 + t = scnprintf(next, size, "b_se0_srp: %d\n", fsm->b_se0_srp);
34615 + t = scnprintf(next, size, "b_sess_end: %d\n", fsm->b_sess_end);
34619 + t = scnprintf(next, size, "b_sess_vld: %d\n", fsm->b_sess_vld);
34623 + t = scnprintf(next, size, "id: %d\n", fsm->id);
34627 + spin_unlock_irqrestore(&fsm->lock, flags);
34630 + return count - size;
34633 +#define create_proc_file() create_proc_read_entry(proc_filename, \
34634 + 0, NULL, otg_proc_read, NULL)
34636 +#define remove_proc_file() remove_proc_entry(proc_filename, NULL)
34638 +#else /* !CONFIG_USB_OTG_DEBUG_FILES */
34640 +#define create_proc_file() do {} while (0)
34641 +#define remove_proc_file() do {} while (0)
34643 +#endif /*CONFIG_USB_OTG_DEBUG_FILES */
34645 +/*----------------------------------------------------------*/
34646 +/* Char driver interface to control some OTG input */
34649 + * This function handle some ioctl command,such as get otg
34650 + * status and set host suspend
34652 +static int fsl_otg_ioctl(struct inode *inode, struct file *file,
34653 + unsigned int cmd, unsigned long arg)
34658 + case GET_OTG_STATUS:
34659 + retval = fsl_otg_dev->host_working;
34662 + case SET_A_SUSPEND_REQ:
34663 + fsl_otg_dev->fsm.a_suspend_req = arg;
34666 + case SET_A_BUS_DROP:
34667 + fsl_otg_dev->fsm.a_bus_drop = arg;
34670 + case SET_A_BUS_REQ:
34671 + fsl_otg_dev->fsm.a_bus_req = arg;
34674 + case SET_B_BUS_REQ:
34675 + fsl_otg_dev->fsm.b_bus_req = arg;
34682 + otg_statemachine(&fsl_otg_dev->fsm);
34687 +static int fsl_otg_open(struct inode *inode, struct file *file)
34693 +static int fsl_otg_release(struct inode *inode, struct file *file)
34699 +static struct file_operations otg_fops = {
34700 + .owner = THIS_MODULE,
34704 + .ioctl = fsl_otg_ioctl,
34705 + .open = fsl_otg_open,
34706 + .release = fsl_otg_release,
34709 +static int __init fsl_otg_probe(struct platform_device *pdev)
34712 + struct fsl_usb2_platform_data *pdata;
34714 + DBG("pdev=0x%p\n", pdev);
34719 + if (!pdev->dev.platform_data)
34722 + pdata = pdev->dev.platform_data;
34723 + /* Initialize the clock, multiplexing pin and PHY interface */
34724 + board_init(pdev);
34726 + /* configure the OTG */
34727 + status = fsl_otg_cfg(pdev);
34729 + printk(KERN_INFO "Couldn't init OTG module\n");
34734 + status = usb_otg_start(pdev);
34736 + if (register_chrdev(FSL_OTG_MAJOR, FSL_OTG_NAME, &otg_fops)) {
34737 + printk(KERN_WARNING FSL_OTG_NAME
34738 + ": unable to register FSL OTG device\n");
34742 + create_proc_file();
34746 +static int fsl_otg_remove(struct platform_device *pdev)
34749 + struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
34750 + unsigned long flags;
34752 + DBG("pdev=0x%p pdata=0x%p\n", pdev, pdata);
34754 + otg_set_transceiver(NULL);
34756 + /* disable and clear OTGSC interrupts */
34757 + spin_lock_irqsave(&usb_dr_regs_lock, flags);
34758 + ie = fsl_readl(&usb_dr_regs->otgsc);
34759 + ie &= ~OTGSC_INTERRUPT_ENABLE_BITS_MASK;
34760 + ie |= OTGSC_INTERRUPT_STATUS_BITS_MASK;
34761 + fsl_writel(ie, &usb_dr_regs->otgsc);
34762 + spin_unlock_irqrestore(&usb_dr_regs_lock, flags);
34764 + free_irq(fsl_otg_dev->irq, fsl_otg_dev);
34766 + kfree(fsl_otg_dev);
34768 + remove_proc_file();
34770 + unregister_chrdev(FSL_OTG_MAJOR, FSL_OTG_NAME);
34772 + if (pdata->platform_uninit)
34773 + pdata->platform_uninit(pdev);
34775 + fsl_otg_dev = NULL;
34779 +struct platform_driver fsl_otg_driver = {
34780 + .probe = fsl_otg_probe,
34781 + .remove = fsl_otg_remove,
34783 + .name = driver_name,
34784 + .owner = THIS_MODULE,
34788 +/*-------------------------------------------------------------------------*/
34790 +static int __init fsl_usb_otg_init(void)
34792 + printk(KERN_INFO DRIVER_DESC " loaded, %s\n", DRIVER_VERSION);
34793 + return platform_driver_register(&fsl_otg_driver);
34796 +static void __exit fsl_usb_otg_exit(void)
34798 + platform_driver_unregister(&fsl_otg_driver);
34801 +module_init(fsl_usb_otg_init);
34802 +module_exit(fsl_usb_otg_exit);
34804 +MODULE_DESCRIPTION(DRIVER_INFO);
34805 +MODULE_AUTHOR(DRIVER_AUTHOR);
34806 +MODULE_LICENSE("GPL");
34808 +++ b/drivers/usb/otg/fsl_otg.h
34811 + * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
34815 + * The code contained herein is licensed under the GNU General Public
34816 + * License. You may obtain a copy of the GNU General Public License
34817 + * Version 2 or later at the following locations:
34819 + * http://www.opensource.org/licenses/gpl-license.html
34820 + * http://www.gnu.org/copyleft/gpl.html
34825 +#include <linux/usb/otg.h>
34826 +#include "otg_fsm.h"
34827 +#include <linux/ioctl.h>
34829 +#define ERR(format, arg...) \
34830 +printk(KERN_ERR "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
34833 + * A-DEVICE timing constants
34836 +/* Wait for VBUS Rise */
34837 +#define TA_WAIT_VRISE (100) /* a_wait_vrise 100 ms, section: 6.6.5.1 */
34839 +/* Wait for B-Connect */
34840 +#define TA_WAIT_BCON (10000) /* a_wait_bcon > 1 sec, section: 6.6.5.2
34841 + * This is only used to get out of
34842 + * OTG_STATE_A_WAIT_BCON state if there was
34843 + * no connection for these many milliseconds
34846 +/* A-Idle to B-Disconnect */
34847 +/* It is necessary for this timer to be more than 750 ms because of a bug in OPT
34848 + * test 5.4 in which B OPT disconnects after 750 ms instead of 75ms as stated
34849 + * in the test description
34851 +#define TA_AIDL_BDIS (5000) /* a_suspend minimum 200 ms, section: 6.6.5.3 */
34853 +/* B-Idle to A-Disconnect */
34854 +#define TA_BIDL_ADIS (12) /* 3 to 200 ms */
34856 +/* B-device timing constants */
34858 +/* Data-Line Pulse Time*/
34859 +#define TB_DATA_PLS (10) /* b_srp_init,continue 5~10ms, section:5.3.3 */
34860 +#define TB_DATA_PLS_MIN (5) /* minimum 5 ms */
34861 +#define TB_DATA_PLS_MAX (10) /* maximum 10 ms */
34863 +/* SRP Initiate Time */
34864 +#define TB_SRP_INIT (100) /* b_srp_init,maximum 100 ms, section:5.3.8 */
34866 +/* SRP Fail Time */
34867 +#define TB_SRP_FAIL (7000) /* b_srp_init,Fail time 5~30s, section:6.8.2.2 */
34869 +/* SRP result wait time */
34870 +#define TB_SRP_WAIT (60)
34873 +#define TB_VBUS_PLS (30) /* time to keep vbus pulsing asserted */
34875 +/* Discharge time */
34876 +/* This time should be less than 10ms. It varies from system to system. */
34877 +#define TB_VBUS_DSCHRG (8)
34879 +/* A-SE0 to B-Reset */
34880 +#define TB_ASE0_BRST (20) /* b_wait_acon, mini 3.125 ms,section:6.8.2.4 */
34882 +/* A bus suspend timer before we can switch to b_wait_aconn */
34883 +#define TB_A_SUSPEND (7)
34884 +#define TB_BUS_RESUME (12)
34886 +/* SE0 Time Before SRP */
34887 +#define TB_SE0_SRP (2) /* b_idle,minimum 2 ms, section:5.3.2 */
34889 +#define SET_OTG_STATE(otg_ptr, newstate) ((otg_ptr)->state = newstate)
34892 +struct fsl_otg_timer {
34893 + unsigned long expires; /* Number of count increase to timeout */
34894 + unsigned long count; /* Tick counter */
34895 + void (*function) (unsigned long); /* Timeout function */
34896 + unsigned long data; /* Data passed to function */
34897 + struct list_head list;
34900 +struct fsl_otg_timer inline *otg_timer_initializer
34901 + (void (*function) (unsigned long), unsigned long expires,
34902 + unsigned long data) {
34903 + struct fsl_otg_timer *timer;
34904 + timer = kmalloc(sizeof(struct fsl_otg_timer), GFP_KERNEL);
34905 + if (timer == NULL)
34907 + timer->function = function;
34908 + timer->expires = expires;
34909 + timer->data = data;
34914 + struct otg_transceiver otg;
34915 + struct otg_fsm fsm;
34916 + struct fsl_usb_device_regs *dr_mem_map;
34917 + struct delayed_work otg_event;
34919 + /*used for usb host */
34926 +struct fsl_otg_config {
34930 +/*For SRP and HNP handle*/
34931 +#define FSL_OTG_MAJOR 66
34932 +#define FSL_OTG_NAME "fsl-otg"
34933 +/*Command to OTG driver(ioctl)*/
34934 +#define OTG_IOCTL_MAGIC FSL_OTG_MAJOR
34935 +/*if otg work as host,it should return 1,otherwise it return 0*/
34936 +#define GET_OTG_STATUS _IOR(OTG_IOCTL_MAGIC, 1, int)
34937 +#define SET_A_SUSPEND_REQ _IOW(OTG_IOCTL_MAGIC, 2, int)
34938 +#define SET_A_BUS_DROP _IOW(OTG_IOCTL_MAGIC, 3, int)
34939 +#define SET_A_BUS_REQ _IOW(OTG_IOCTL_MAGIC, 4, int)
34940 +#define SET_B_BUS_REQ _IOW(OTG_IOCTL_MAGIC, 5, int)
34941 +#define GET_A_SUSPEND_REQ _IOR(OTG_IOCTL_MAGIC, 6, int)
34942 +#define GET_A_BUS_DROP _IOR(OTG_IOCTL_MAGIC, 7, int)
34943 +#define GET_A_BUS_REQ _IOR(OTG_IOCTL_MAGIC, 8, int)
34944 +#define GET_B_BUS_REQ _IOR(OTG_IOCTL_MAGIC, 9, int)
34947 +/********************************************************************/
34950 +++ b/drivers/usb/otg/Makefile
34953 +# Makefile for USB OTG controller driver
34955 +fsl_usb2_otg-objs := fsl_otg.o otg_fsm.o
34956 +obj-y += fsl_usb2_otg.o
34958 +++ b/drivers/usb/otg/otg_fsm.c
34960 +/* OTG Finite State Machine from OTG spec
34962 + * Copyright (C) 2007 Freescale Semiconductor, Inc.
34964 + * Author: Li Yang <LeoLi@freescale.com>
34965 + * Jerry Huang <Chang-Ming.Huang@freescale.com>
34967 + * This program is free software; you can redistribute it and/or modify it
34968 + * under the terms of the GNU General Public License as published by the
34969 + * Free Software Foundation; either version 2 of the License, or (at your
34970 + * option) any later version.
34972 + * This program is distributed in the hope that it will be useful, but
34973 + * WITHOUT ANY WARRANTY; without even the implied warranty of
34974 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34975 + * General Public License for more details.
34977 + * You should have received a copy of the GNU General Public License along
34978 + * with this program; if not, write to the Free Software Foundation, Inc.,
34979 + * 675 Mass Ave, Cambridge, MA 02139, USA.
34982 +#include <linux/kernel.h>
34983 +#include <linux/types.h>
34984 +#include <linux/usb/otg.h>
34985 +#include <linux/spinlock.h>
34986 +#include <linux/delay.h>
34987 +#include <linux/usb.h>
34988 +#include <linux/usb_gadget.h>
34990 +#include "otg_fsm.h"
34993 +/* Defined by device specific driver, for different timer implementation */
34994 +extern void *a_wait_vrise_tmr, *a_wait_bcon_tmr, *a_aidl_bdis_tmr,
34995 + *b_ase0_brst_tmr, *b_se0_srp_tmr, *b_srp_fail_tmr, *a_wait_enum_tmr;
34997 +const char *state_string(enum usb_otg_state state)
35000 + case OTG_STATE_A_IDLE: return "a_idle";
35001 + case OTG_STATE_A_WAIT_VRISE: return "a_wait_vrise";
35002 + case OTG_STATE_A_WAIT_BCON: return "a_wait_bcon";
35003 + case OTG_STATE_A_HOST: return "a_host";
35004 + case OTG_STATE_A_SUSPEND: return "a_suspend";
35005 + case OTG_STATE_A_PERIPHERAL: return "a_peripheral";
35006 + case OTG_STATE_A_WAIT_VFALL: return "a_wait_vfall";
35007 + case OTG_STATE_A_VBUS_ERR: return "a_vbus_err";
35008 + case OTG_STATE_B_IDLE: return "b_idle";
35009 + case OTG_STATE_B_SRP_INIT: return "b_srp_init";
35010 + case OTG_STATE_B_PERIPHERAL: return "b_peripheral";
35011 + case OTG_STATE_B_WAIT_ACON: return "b_wait_acon";
35012 + case OTG_STATE_B_HOST: return "b_host";
35013 + default: return "UNDEFINED";
35016 +EXPORT_SYMBOL(state_string);
35018 +/* Change USB protocol when there is a protocol change */
35019 +static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
35023 + VDBG("DDD old fsm->protocol= %d; new protocol= %d\n",
35024 + fsm->protocol, protocol);
35025 + if (fsm->protocol != protocol) {
35026 + VDBG("Changing role fsm->protocol= %d; new protocol= %d\n",
35027 + fsm->protocol, protocol);
35028 + /* stop old protocol */
35029 + if (fsm->protocol == PROTO_HOST)
35030 + ret = fsm->ops->start_host(fsm, 0);
35031 + else if (fsm->protocol == PROTO_GADGET)
35032 + ret = fsm->ops->start_gadget(fsm, 0);
35036 + /* start new protocol */
35037 + if (protocol == PROTO_HOST)
35038 + ret = fsm->ops->start_host(fsm, 1);
35039 + else if (protocol == PROTO_GADGET)
35040 + ret = fsm->ops->start_gadget(fsm, 1);
35044 + fsm->protocol = protocol;
35051 +static int state_changed;
35053 +/* Called when leaving a state. Do state clean up jobs here */
35054 +static void otg_leave_state(struct otg_fsm *fsm, enum usb_otg_state old_state)
35056 + switch (old_state) {
35057 + case OTG_STATE_B_IDLE:
35058 + otg_del_timer(fsm, fsm->b_se0_srp_tmr);
35059 + fsm->b_se0_srp = 0;
35061 + case OTG_STATE_B_SRP_INIT:
35062 + fsm->b_srp_done = 0;
35064 + case OTG_STATE_B_PERIPHERAL:
35066 + case OTG_STATE_B_WAIT_ACON:
35067 + otg_del_timer(fsm, fsm->b_ase0_brst_tmr);
35068 + fsm->b_ase0_brst_tmout = 0;
35070 + case OTG_STATE_B_HOST:
35072 + case OTG_STATE_A_IDLE:
35074 + case OTG_STATE_A_WAIT_VRISE:
35075 + otg_del_timer(fsm, fsm->a_wait_vrise_tmr);
35076 + fsm->a_wait_vrise_tmout = 0;
35078 + case OTG_STATE_A_WAIT_BCON:
35079 + otg_del_timer(fsm, fsm->a_wait_bcon_tmr);
35080 + fsm->a_wait_bcon_tmout = 0;
35082 + case OTG_STATE_A_HOST:
35083 + otg_del_timer(fsm, fsm->a_wait_enum_tmr);
35085 + case OTG_STATE_A_SUSPEND:
35086 + otg_del_timer(fsm, fsm->a_aidl_bdis_tmr);
35087 + fsm->a_aidl_bdis_tmout = 0;
35088 + fsm->a_suspend_req = 0;
35089 + fsm->a_bus_req = 1; /* FIXME */
35091 + case OTG_STATE_A_PERIPHERAL:
35093 + case OTG_STATE_A_WAIT_VFALL:
35094 + otg_del_timer(fsm, fsm->a_wait_vrise_tmr);
35096 + case OTG_STATE_A_VBUS_ERR:
35103 +/* Called when entering a state */
35104 +static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
35106 + state_changed = 1;
35107 + VDBG("State: old=%s new=%s \n",
35108 + state_string(fsm->transceiver->state), state_string(new_state));
35110 + if (fsm->transceiver->state == new_state)
35113 + otg_leave_state(fsm, fsm->transceiver->state);
35114 + switch (new_state) {
35115 + case OTG_STATE_B_IDLE:
35116 + otg_drv_vbus(fsm, 0);
35117 + otg_chrg_vbus(fsm, 0);
35118 + otg_loc_conn(fsm, 0);
35119 + otg_loc_sof(fsm, 0);
35120 + otg_set_protocol(fsm, PROTO_UNDEF);
35121 + otg_add_timer(fsm, fsm->b_se0_srp_tmr);
35123 + case OTG_STATE_B_SRP_INIT:
35124 + otg_start_pulse(fsm);
35125 + otg_loc_sof(fsm, 0);
35126 + otg_set_protocol(fsm, PROTO_UNDEF);
35127 + otg_add_timer(fsm, fsm->b_srp_fail_tmr);
35129 + case OTG_STATE_B_PERIPHERAL:
35130 + otg_chrg_vbus(fsm, 0);
35131 + otg_loc_conn(fsm, 1);
35132 + otg_loc_sof(fsm, 0);
35133 + otg_set_protocol(fsm, PROTO_GADGET);
35135 + case OTG_STATE_B_WAIT_ACON:
35136 + otg_chrg_vbus(fsm, 0);
35137 + otg_loc_conn(fsm, 0);
35138 + otg_loc_sof(fsm, 0);
35139 + otg_set_protocol(fsm, PROTO_HOST);
35140 + otg_add_timer(fsm, fsm->b_ase0_brst_tmr);
35141 + fsm->a_bus_suspend = 0;
35143 + case OTG_STATE_B_HOST:
35144 + otg_chrg_vbus(fsm, 0);
35145 + otg_loc_conn(fsm, 0);
35146 + otg_loc_sof(fsm, 1);
35147 + otg_set_protocol(fsm, PROTO_HOST);
35148 + usb_bus_start_enum(fsm->transceiver->host,
35149 + fsm->transceiver->host->otg_port);
35151 + case OTG_STATE_A_IDLE:
35152 + otg_drv_vbus(fsm, 0);
35153 + otg_chrg_vbus(fsm, 0);
35154 + otg_loc_conn(fsm, 0);
35155 + otg_loc_sof(fsm, 0);
35156 + otg_set_protocol(fsm, PROTO_HOST);
35158 + case OTG_STATE_A_WAIT_VRISE:
35159 + otg_drv_vbus(fsm, 1);
35160 + otg_loc_conn(fsm, 0);
35161 + otg_loc_sof(fsm, 0);
35162 + otg_set_protocol(fsm, PROTO_HOST);
35163 + otg_add_timer(fsm, fsm->a_wait_vrise_tmr);
35165 + case OTG_STATE_A_WAIT_BCON:
35166 + otg_drv_vbus(fsm, 1);
35167 + otg_loc_conn(fsm, 0);
35168 + otg_loc_sof(fsm, 0);
35169 + otg_set_protocol(fsm, PROTO_HOST);
35170 + otg_add_timer(fsm, fsm->a_wait_bcon_tmr);
35172 + case OTG_STATE_A_HOST:
35173 + otg_drv_vbus(fsm, 1);
35174 + otg_loc_conn(fsm, 0);
35175 + otg_loc_sof(fsm, 1);
35176 + otg_set_protocol(fsm, PROTO_HOST);
35178 + * When HNP is triggered while a_bus_req = 0, a_host will
35179 + * suspend too fast to complete a_set_b_hnp_en
35181 + if (!fsm->a_bus_req || fsm->a_suspend_req)
35182 + otg_add_timer(fsm, fsm->a_wait_enum_tmr);
35184 + case OTG_STATE_A_SUSPEND:
35185 + otg_drv_vbus(fsm, 1);
35186 + otg_loc_conn(fsm, 0);
35187 + otg_loc_sof(fsm, 0);
35188 + otg_set_protocol(fsm, PROTO_HOST);
35189 + otg_add_timer(fsm, fsm->a_aidl_bdis_tmr);
35192 + case OTG_STATE_A_PERIPHERAL:
35193 + otg_loc_conn(fsm, 1);
35194 + otg_loc_sof(fsm, 0);
35195 + otg_set_protocol(fsm, PROTO_GADGET);
35196 + otg_drv_vbus(fsm, 1);
35198 + case OTG_STATE_A_WAIT_VFALL:
35199 + otg_drv_vbus(fsm, 0);
35200 + otg_loc_conn(fsm, 0);
35201 + otg_loc_sof(fsm, 0);
35202 + otg_set_protocol(fsm, PROTO_HOST);
35204 + case OTG_STATE_A_VBUS_ERR:
35205 + otg_drv_vbus(fsm, 0);
35206 + otg_loc_conn(fsm, 0);
35207 + otg_loc_sof(fsm, 0);
35208 + otg_set_protocol(fsm, PROTO_UNDEF);
35214 + fsm->transceiver->state = new_state;
35218 +/* State change judgement */
35219 +int otg_statemachine(struct otg_fsm *fsm)
35221 + enum usb_otg_state state;
35222 + unsigned long flags;
35224 + spin_lock_irqsave(&fsm->lock, flags);
35226 + state = fsm->transceiver->state;
35227 + state_changed = 0;
35228 + /* State machine state change judgement */
35230 + VDBG(" State: %s \n", state_string(state));
35233 + case OTG_STATE_UNDEFINED:
35235 + otg_set_state(fsm, OTG_STATE_B_IDLE);
35237 + otg_set_state(fsm, OTG_STATE_A_IDLE);
35239 + case OTG_STATE_B_IDLE:
35241 + otg_set_state(fsm, OTG_STATE_A_IDLE);
35242 + else if (fsm->b_sess_vld && fsm->transceiver->gadget)
35243 + otg_set_state(fsm, OTG_STATE_B_PERIPHERAL);
35244 + else if (fsm->b_bus_req && fsm->b_sess_end && fsm->b_se0_srp)
35245 + otg_set_state(fsm, OTG_STATE_B_SRP_INIT);
35247 + case OTG_STATE_B_SRP_INIT:
35248 + if (!fsm->id || fsm->b_srp_done)
35249 + otg_set_state(fsm, OTG_STATE_B_IDLE);
35251 + case OTG_STATE_B_PERIPHERAL:
35252 + if (!fsm->id || !fsm->b_sess_vld)
35253 + otg_set_state(fsm, OTG_STATE_B_IDLE);
35254 + else if (fsm->b_bus_req &&
35255 + fsm->transceiver->
35256 + gadget->b_hnp_enable && fsm->a_bus_suspend)
35257 + otg_set_state(fsm, OTG_STATE_B_WAIT_ACON);
35259 + case OTG_STATE_B_WAIT_ACON:
35261 + otg_set_state(fsm, OTG_STATE_B_HOST);
35262 + else if (!fsm->id || !fsm->b_sess_vld)
35263 + otg_set_state(fsm, OTG_STATE_B_IDLE);
35264 + else if (fsm->a_bus_resume || fsm->b_ase0_brst_tmout) {
35265 + fsm->b_ase0_brst_tmout = 0;
35266 + otg_set_state(fsm, OTG_STATE_B_PERIPHERAL);
35269 + case OTG_STATE_B_HOST:
35270 + if (!fsm->id || !fsm->b_sess_vld)
35271 + otg_set_state(fsm, OTG_STATE_B_IDLE);
35272 + else if (!fsm->b_bus_req || !fsm->a_conn)
35273 + otg_set_state(fsm, OTG_STATE_B_PERIPHERAL);
35275 + case OTG_STATE_A_IDLE:
35277 + otg_set_state(fsm, OTG_STATE_B_IDLE);
35278 + else if (!fsm->a_bus_drop && (fsm->a_bus_req || fsm->a_srp_det))
35279 + otg_set_state(fsm, OTG_STATE_A_WAIT_VRISE);
35281 + case OTG_STATE_A_WAIT_VRISE:
35282 + if (fsm->id || fsm->a_bus_drop || fsm->a_vbus_vld ||
35283 + fsm->a_wait_vrise_tmout) {
35284 + otg_set_state(fsm, OTG_STATE_A_WAIT_BCON);
35287 + case OTG_STATE_A_WAIT_BCON:
35288 + if (!fsm->a_vbus_vld)
35289 + otg_set_state(fsm, OTG_STATE_A_VBUS_ERR);
35290 + else if (fsm->id | fsm->a_bus_drop | fsm->a_wait_bcon_tmout)
35291 + otg_set_state(fsm, OTG_STATE_A_WAIT_VFALL);
35292 + else if (fsm->b_conn)
35293 + otg_set_state(fsm, OTG_STATE_A_HOST);
35295 + case OTG_STATE_A_HOST:
35296 + if ((!fsm->a_bus_req || fsm->a_suspend_req) &&
35297 + fsm->transceiver->host->b_hnp_enable)
35298 + otg_set_state(fsm, OTG_STATE_A_SUSPEND);
35299 + else if (fsm->id || !fsm->b_conn || fsm->a_bus_drop)
35300 + otg_set_state(fsm, OTG_STATE_A_WAIT_BCON);
35301 + else if (!fsm->a_vbus_vld)
35302 + otg_set_state(fsm, OTG_STATE_A_VBUS_ERR);
35304 + case OTG_STATE_A_SUSPEND:
35305 + if (!fsm->b_conn && fsm->transceiver->host->b_hnp_enable)
35306 + otg_set_state(fsm, OTG_STATE_A_PERIPHERAL);
35307 + else if (!fsm->b_conn && !fsm->transceiver->host->b_hnp_enable)
35308 + otg_set_state(fsm, OTG_STATE_A_WAIT_BCON);
35309 + else if (fsm->a_bus_req || fsm->b_bus_resume)
35310 + otg_set_state(fsm, OTG_STATE_A_HOST);
35311 + else if (fsm->id || fsm->a_bus_drop || fsm->a_aidl_bdis_tmout)
35312 + otg_set_state(fsm, OTG_STATE_A_WAIT_VFALL);
35313 + else if (!fsm->a_vbus_vld)
35314 + otg_set_state(fsm, OTG_STATE_A_VBUS_ERR);
35316 + case OTG_STATE_A_PERIPHERAL:
35317 + if (fsm->id || fsm->a_bus_drop)
35318 + otg_set_state(fsm, OTG_STATE_A_WAIT_VFALL);
35319 + else if (fsm->b_bus_suspend)
35320 + otg_set_state(fsm, OTG_STATE_A_WAIT_BCON);
35321 + else if (!fsm->a_vbus_vld)
35322 + otg_set_state(fsm, OTG_STATE_A_VBUS_ERR);
35324 + case OTG_STATE_A_WAIT_VFALL:
35325 + if (fsm->id || fsm->a_bus_req || (!fsm->a_sess_vld &&
35327 + otg_set_state(fsm, OTG_STATE_A_IDLE);
35329 + case OTG_STATE_A_VBUS_ERR:
35330 + if (fsm->id || fsm->a_bus_drop || fsm->a_clr_err)
35331 + otg_set_state(fsm, OTG_STATE_A_WAIT_VFALL);
35336 + spin_unlock_irqrestore(&fsm->lock, flags);
35338 + return state_changed;
35340 +EXPORT_SYMBOL(otg_statemachine);
35342 +++ b/drivers/usb/otg/otg_fsm.h
35344 +/* Copyright (C) 2006-2007 Freescale Semiconductor, Inc.
35346 + * This program is free software; you can redistribute it and/or modify it
35347 + * under the terms of the GNU General Public License as published by the
35348 + * Free Software Foundation; either version 2 of the License, or (at your
35349 + * option) any later version.
35351 + * This program is distributed in the hope that it will be useful, but
35352 + * WITHOUT ANY WARRANTY; without even the implied warranty of
35353 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35354 + * General Public License for more details.
35356 + * You should have received a copy of the GNU General Public License along
35357 + * with this program; if not, write to the Free Software Foundation, Inc.,
35358 + * 675 Mass Ave, Cambridge, MA 02139, USA.
35370 +#define DBG(fmt, args...) printk(KERN_DEBUG "[%s] " fmt , \
35371 + __FUNCTION__, ## args)
35373 +#define DBG(fmt, args...) do {} while (0)
35379 +#define VDBG(stuff...) do {} while (0)
35383 +#define MPC_LOC printk("Current Location [%s]:[%d]\n", __FILE__, __LINE__)
35385 +#define MPC_LOC do {} while (0)
35388 +#define PROTO_UNDEF 0
35389 +#define PROTO_HOST 1
35390 +#define PROTO_GADGET 2
35396 +/* OTG state machine according to the OTG spec */
35399 + int a_bus_resume;
35400 + int a_bus_suspend;
35405 + int b_bus_resume;
35406 + int b_bus_suspend;
35413 + /* Internal variables */
35414 + int a_set_b_hnp_en;
35416 + int b_hnp_enable;
35418 + /* Timeout indicator for timers */
35419 + int a_wait_vrise_tmout;
35420 + int a_wait_bcon_tmout;
35421 + int a_aidl_bdis_tmout;
35422 + int b_ase0_brst_tmout;
35424 + /* Informative variables */
35428 + int a_suspend_req;
35436 + struct otg_fsm_ops *ops;
35437 + struct otg_transceiver *transceiver;
35439 + void *a_wait_vrise_tmr;
35440 + void *a_wait_bcon_tmr;
35441 + void *a_aidl_bdis_tmr;
35442 + void *b_ase0_brst_tmr;
35443 + void *b_se0_srp_tmr;
35444 + void *b_srp_fail_tmr;
35445 + void *a_wait_enum_tmr;
35447 + /* Current usb protocol used: 0:undefine; 1:host; 2:client */
35449 + spinlock_t lock; /* fsm lock */
35452 +struct otg_fsm_ops {
35453 + void (*chrg_vbus)(int on);
35454 + void (*drv_vbus)(int on);
35455 + void (*loc_conn)(int on);
35456 + void (*loc_sof)(int on);
35457 + void (*start_pulse)(void);
35458 + void (*add_timer)(void *timer);
35459 + void (*del_timer)(void *timer);
35460 + int (*start_host)(struct otg_fsm *fsm, int on);
35461 + int (*start_gadget)(struct otg_fsm *fsm, int on);
35465 +static inline void otg_chrg_vbus(struct otg_fsm *fsm, int on)
35467 + fsm->ops->chrg_vbus(on);
35470 +static inline void otg_drv_vbus(struct otg_fsm *fsm, int on)
35472 + if (fsm->drv_vbus != on) {
35473 + fsm->drv_vbus = on;
35474 + fsm->ops->drv_vbus(on);
35478 +static inline void otg_loc_conn(struct otg_fsm *fsm, int on)
35480 + if (fsm->loc_conn != on) {
35481 + fsm->loc_conn = on;
35482 + fsm->ops->loc_conn(on);
35486 +static inline void otg_loc_sof(struct otg_fsm *fsm, int on)
35488 + if (fsm->loc_sof != on) {
35489 + fsm->loc_sof = on;
35490 + fsm->ops->loc_sof(on);
35494 +static inline void otg_start_pulse(struct otg_fsm *fsm)
35496 + fsm->ops->start_pulse();
35499 +static inline void otg_add_timer(struct otg_fsm *fsm, void *timer)
35501 + fsm->ops->add_timer(timer);
35504 +static inline void otg_del_timer(struct otg_fsm *fsm, void *timer)
35506 + fsm->ops->del_timer(timer);
35509 +extern int otg_statemachine(struct otg_fsm *fsm);
35511 +extern const char *state_string(enum usb_otg_state state);
35514 --- a/drivers/video/cfbimgblt.c
35515 +++ b/drivers/video/cfbimgblt.c
35516 @@ -44,12 +44,12 @@
35519 static const u32 cfb_tab8[] = {
35520 -#if defined(__BIG_ENDIAN)
35521 +#if defined(__BIG_ENDIAN) && !defined(CONFIG_COLDFIRE)
35522 0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
35523 0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
35524 0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
35525 0xffff0000,0xffff00ff,0xffffff00,0xffffffff
35526 -#elif defined(__LITTLE_ENDIAN)
35527 +#elif defined(__LITTLE_ENDIAN) || defined(CONFIG_COLDFIRE)
35528 0x00000000,0xff000000,0x00ff0000,0xffff0000,
35529 0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
35530 0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
35531 @@ -60,9 +60,9 @@ static const u32 cfb_tab8[] = {
35534 static const u32 cfb_tab16[] = {
35535 -#if defined(__BIG_ENDIAN)
35536 +#if defined(__BIG_ENDIAN) && !defined(CONFIG_COLDFIRE)
35537 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
35538 -#elif defined(__LITTLE_ENDIAN)
35539 +#elif defined(__LITTLE_ENDIAN) || defined(CONFIG_COLDFIRE)
35540 0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
35542 #error FIXME: No endianness??
35543 --- a/drivers/video/console/bitblit.c
35544 +++ b/drivers/video/console/bitblit.c
35545 @@ -78,7 +78,11 @@ static inline void bit_putcs_aligned(str
35546 u32 d_pitch, u32 s_pitch, u32 cellsize,
35547 struct fb_image *image, u8 *buf, u8 *dst)
35549 +#ifndef CONFIG_COLDFIRE
35550 u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
35552 + u32 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
35554 u32 idx = vc->vc_font.width >> 3;
35557 @@ -111,7 +115,11 @@ static inline void bit_putcs_unaligned(s
35558 struct fb_image *image, u8 *buf,
35561 +#ifndef CONFIG_COLDFIRE
35562 u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
35564 + u32 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
35566 u32 shift_low = 0, mod = vc->vc_font.width % 8;
35567 u32 shift_high = 8;
35568 u32 idx = vc->vc_font.width >> 3;
35569 @@ -238,7 +246,11 @@ static void bit_cursor(struct vc_data *v
35571 struct fb_cursor cursor;
35572 struct fbcon_ops *ops = info->fbcon_par;
35573 +#ifndef CONFIG_COLDFIRE
35574 unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
35576 + unsigned long charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
35578 int w = (vc->vc_font.width + 7) >> 3, c;
35579 int y = real_y(ops->p, vc->vc_y);
35580 int attribute, use_sw = (vc->vc_cursor_type & 0x10);
35581 --- a/drivers/video/console/fbcon.c
35582 +++ b/drivers/video/console/fbcon.c
35583 @@ -2679,8 +2679,11 @@ static int fbcon_set_palette(struct vc_d
35585 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
35586 int i, j, k, depth;
35589 +#ifndef CONFIG_COLDFIRE
35594 if (fbcon_is_inactive(vc, info))
35597 --- a/drivers/video/Kconfig
35598 +++ b/drivers/video/Kconfig
35599 @@ -201,6 +201,16 @@ config FB_TILEBLITTING
35600 comment "Frame buffer hardware drivers"
35604 + tristate "SiliconMotion Lynx support"
35605 + depends on FB && PCI
35606 + select FB_CFB_FILLRECT
35607 + select FB_CFB_COPYAREA
35608 + select FB_CFB_IMAGEBLIT
35610 + This enables support for the Silicon Motion Lynx family of graphic
35611 + chips. It has been tested on ColdFire.
35614 tristate "Cirrus Logic support"
35615 depends on FB && (ZORRO || PCI)
35616 --- a/drivers/video/Makefile
35617 +++ b/drivers/video/Makefile
35618 @@ -28,6 +28,7 @@ obj-$(CONFIG_FB_DDC) += fb_ddc
35619 obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o
35621 # Hardware specific drivers go first
35622 +obj-$(CONFIG_FB_SMI) += smifb.o
35623 obj-$(CONFIG_FB_AMIGA) += amifb.o c2p.o
35624 obj-$(CONFIG_FB_ARC) += arcfb.o
35625 obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o
35627 +++ b/drivers/video/smifb.c
35629 +/***************************************************************************
35630 + smifb.c - Silicon Motion, Inc. LynxEM+ frame buffer device
35631 + -------------------
35632 + begin : Thu Aug 9 2001
35633 + copyright : (C) 2001 by Szu-Tao Huang
35634 + email : johuang@siliconmotion.com
35635 + ***************************************************************************/
35637 +/***************************************************************************
35639 + * This program is free software; you can redistribute it and/or modify *
35640 + * it under the terms of the GNU General Public License as published by *
35641 + * the Free Software Foundation; either version 2 of the License, or *
35642 + * (at your option) any later version. *
35644 + ***************************************************************************/
35646 +#include <linux/module.h>
35647 +#include <linux/kernel.h>
35648 +#include <linux/errno.h>
35649 +#include <linux/string.h>
35650 +#include <linux/mm.h>
35651 +#include <linux/tty.h>
35652 +#include <linux/slab.h>
35653 +#include <linux/delay.h>
35654 +#include <linux/fb.h>
35655 +#include <linux/pci.h>
35656 +#include <linux/init.h>
35658 +#include <asm/io.h>
35659 +#include <asm/irq.h>
35660 +#include <asm/pgtable.h>
35661 +#include <asm/system.h>
35662 +#include <asm/uaccess.h>
35664 +#include "console/fbcon.h"
35667 +#include <video/fbcon.h>
35668 +#include <video/fbcon-cfb8.h>
35669 +#include <video/fbcon-cfb16.h>
35670 +#include <video/fbcon-cfb24.h>
35673 +#include <linux/fb.h>
35675 +static char *SMIRegs; // point to virtual Memory Map IO starting address
35676 +static char *SMILFB; // point to virtual video memory starting address
35677 +static struct par_info hw; // used to record hardware information
35679 +#include "smifb.h"
35681 +struct ModeInit VGAMode[numVGAModes] =
35684 + /* mode#0: 640 x 480 8Bpp 60Hz */
35688 + { /* Init_SR0_SR4 */
35689 + 0x03, 0x01, 0x0F, 0x00, 0x0E,
35691 + { /* Init_SR10_SR24 */
35692 + 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
35693 + 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35694 + 0xC4, 0x30, 0x02, 0x01, 0x01,
35696 + { /* Init_SR30_SR75 */
35697 + 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
35698 + 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
35699 + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
35700 + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
35701 + 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
35702 + 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
35703 + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
35704 + 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
35705 + 0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
35707 + { /* Init_SR80_SR93 */
35708 + 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
35709 + 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
35710 + 0x00, 0x00, 0x00, 0x00,
35712 + { /* Init_SRA0_SRAF */
35713 + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
35714 + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
35716 + { /* Init_GR00_GR08 */
35717 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
35720 + { /* Init_AR00_AR14 */
35721 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
35722 + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
35723 + 0x41, 0x00, 0x0F, 0x00, 0x00,
35725 + { /* Init_CR00_CR18 */
35726 + 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
35727 + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35728 + 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
35731 + { /* Init_CR30_CR4D */
35732 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
35733 + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
35734 + 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
35735 + 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
35737 + { /* Init_CR90_CRA7 */
35738 + 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
35739 + 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
35740 + 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
35744 + /* mode#1: 640 x 480 16Bpp 60Hz */
35745 + 640, 480, 16, 60,
35748 + { /* Init_SR0_SR4 */
35749 + 0x03, 0x01, 0x0F, 0x00, 0x0E,
35751 + { /* Init_SR10_SR24 */
35752 + 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
35753 + 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35754 + 0xC4, 0x30, 0x02, 0x01, 0x01,
35756 + { /* Init_SR30_SR75 */
35757 + 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
35758 + 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
35759 + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
35760 + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
35761 + 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
35762 + 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
35763 + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
35764 + 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
35765 + 0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
35767 + { /* Init_SR80_SR93 */
35768 + 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
35769 + 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
35770 + 0x00, 0x00, 0x00, 0x00,
35772 + { /* Init_SRA0_SRAF */
35773 + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
35774 + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
35776 + { /* Init_GR00_GR08 */
35777 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
35780 + { /* Init_AR00_AR14 */
35781 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
35782 + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
35783 + 0x41, 0x00, 0x0F, 0x00, 0x00,
35785 + { /* Init_CR00_CR18 */
35786 + 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
35787 + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35788 + 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
35791 + { /* Init_CR30_CR4D */
35792 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
35793 + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
35794 + 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
35795 + 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
35797 + { /* Init_CR90_CRA7 */
35798 + 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
35799 + 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
35800 + 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
35804 + /* mode#2: 640 x 480 24Bpp 60Hz */
35805 + 640, 480, 24, 60,
35808 + { /* Init_SR0_SR4 */
35809 + 0x03, 0x01, 0x0F, 0x00, 0x0E,
35811 + { /* Init_SR10_SR24 */
35812 + 0xFF, 0xBE, 0xEF, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
35813 + 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35814 + 0xC4, 0x30, 0x02, 0x01, 0x01,
35816 + { /* Init_SR30_SR75 */
35817 + 0x32, 0x03, 0xA0, 0x09, 0xC0, 0x32, 0x32, 0x32,
35818 + 0x32, 0x32, 0x32, 0x32, 0x00, 0x00, 0x03, 0xFF,
35819 + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
35820 + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x32, 0x32, 0x32,
35821 + 0x04, 0x24, 0x63, 0x4F, 0x52, 0x0B, 0xDF, 0xEA,
35822 + 0x04, 0x50, 0x19, 0x32, 0x32, 0x00, 0x00, 0x32,
35823 + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
35824 + 0x50, 0x03, 0x74, 0x14, 0x07, 0x82, 0x07, 0x04,
35825 + 0x00, 0x45, 0x30, 0x30, 0x40, 0x30,
35827 + { /* Init_SR80_SR93 */
35828 + 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x32,
35829 + 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x32, 0x32,
35830 + 0x00, 0x00, 0x00, 0x00,
35832 + { /* Init_SRA0_SRAF */
35833 + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
35834 + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xDF,
35836 + { /* Init_GR00_GR08 */
35837 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
35840 + { /* Init_AR00_AR14 */
35841 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
35842 + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
35843 + 0x41, 0x00, 0x0F, 0x00, 0x00,
35845 + { /* Init_CR00_CR18 */
35846 + 0x5F, 0x4F, 0x4F, 0x00, 0x53, 0x1F, 0x0B, 0x3E,
35847 + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35848 + 0xEA, 0x0C, 0xDF, 0x50, 0x40, 0xDF, 0x00, 0xE3,
35851 + { /* Init_CR30_CR4D */
35852 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x03, 0x20,
35853 + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xFF, 0xFD,
35854 + 0x5F, 0x4F, 0x00, 0x54, 0x00, 0x0B, 0xDF, 0x00,
35855 + 0xEA, 0x0C, 0x2E, 0x00, 0x4F, 0xDF,
35857 + { /* Init_CR90_CRA7 */
35858 + 0x56, 0xDD, 0x5E, 0xEA, 0x87, 0x44, 0x8F, 0x55,
35859 + 0x0A, 0x8F, 0x55, 0x0A, 0x00, 0x00, 0x18, 0x00,
35860 + 0x11, 0x10, 0x0B, 0x0A, 0x0A, 0x0A, 0x0A, 0x00,
35863 + {/* mode#3: 800 x 600 8Bpp 60Hz */
35865 + 0x2B, /* Init_MISC */
35866 + { /* Init_SR0_SR4 */
35867 + 0x03, 0x01, 0x0F, 0x03, 0x0E,
35869 + { /* Init_SR10_SR24 */
35870 + 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
35871 + 0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
35872 + 0xC4, 0x30, 0x02, 0x01, 0x01,
35874 + { /* Init_SR30_SR75 */
35875 + 0x24, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24,
35876 + 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF,
35877 + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC,
35878 + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24,
35879 + 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
35880 + 0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24,
35881 + 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
35882 + 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
35883 + 0x02, 0x45, 0x30, 0x35, 0x40, 0x20,
35885 + { /* Init_SR80_SR93 */
35886 + 0xFF, 0x87, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24,
35887 + 0x90, 0x01, 0x2C, 0x01, 0xFF, 0x00, 0x24, 0x24,
35888 + 0x00, 0x00, 0x00, 0x00,
35890 + { /* Init_SRA0_SRAF */
35891 + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
35892 + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
35894 + { /* Init_GR00_GR08 */
35895 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
35898 + { /* Init_AR00_AR14 */
35899 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
35900 + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
35901 + 0x41, 0x00, 0x0F, 0x00, 0x00,
35903 + { /* Init_CR00_CR18 */
35904 + 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
35905 + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35906 + 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
35909 + { /* Init_CR30_CR4D */
35910 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
35911 + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
35912 + 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
35913 + 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
35915 + { /* Init_CR90_CRA7 */
35916 + 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
35917 + 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
35918 + 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
35921 + {/* mode#4: 800 x 600 16Bpp 60Hz */
35922 + 800, 600, 16, 60,
35925 + { /* Init_SR0_SR4 */
35926 + 0x03, 0x01, 0x0F, 0x03, 0x0E,
35928 + { /* Init_SR10_SR24 */
35929 + 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
35930 + 0x99, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
35931 + 0xC4, 0x30, 0x02, 0x01, 0x01,
35933 + { /* Init_SR30_SR75 */
35934 + 0x24, 0x03, 0x20, 0x09, 0xC0, 0x24, 0x24, 0x24,
35935 + 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x03, 0xFF,
35936 + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x38, 0x00, 0xFC,
35937 + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x24, 0x24, 0x24,
35938 + 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
35939 + 0x04, 0x55, 0x59, 0x24, 0x24, 0x00, 0x00, 0x24,
35940 + 0x01, 0x80, 0x7A, 0x1A, 0x1A, 0x00, 0x00, 0x00,
35941 + 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
35942 + 0x02, 0x45, 0x30, 0x35, 0x40, 0x20,
35944 + { /* Init_SR80_SR93 */
35945 + 0x00, 0x00, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x24,
35946 + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x24, 0x24,
35947 + 0x00, 0x00, 0x00, 0x00,
35949 + { /* Init_SRA0_SRAF */
35950 + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
35951 + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
35953 + { /* Init_GR00_GR08 */
35954 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
35957 + { /* Init_AR00_AR14 */
35958 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
35959 + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
35960 + 0x41, 0x00, 0x0F, 0x00, 0x00,
35962 + { /* Init_CR00_CR18 */
35963 + 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
35964 + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35965 + 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
35968 + { /* Init_CR30_CR4D */
35969 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
35970 + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
35971 + 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
35972 + 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
35974 + { /* Init_CR90_CRA7 */
35975 + 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
35976 + 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
35977 + 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
35980 + {/* mode#5: 800 x 600 24Bpp 60Hz */
35983 + { /* Init_SR0_SR4 */
35984 + 0x03, 0x01, 0x0F, 0x03, 0x0E,
35986 + { /* Init_SR10_SR24 */
35987 + 0xFF, 0xBE, 0xEE, 0xFF, 0x00, 0x0E, 0x17, 0x2C,
35988 + 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35989 + 0xC4, 0x30, 0x02, 0x01, 0x01,
35991 + { /* Init_SR30_SR75 */
35992 + 0x36, 0x03, 0x20, 0x09, 0xC0, 0x36, 0x36, 0x36,
35993 + 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x03, 0xFF,
35994 + 0x00, 0xFC, 0x00, 0x00, 0x20, 0x18, 0x00, 0xFC,
35995 + 0x20, 0x0C, 0x44, 0x20, 0x00, 0x36, 0x36, 0x36,
35996 + 0x04, 0x48, 0x83, 0x63, 0x68, 0x72, 0x57, 0x58,
35997 + 0x04, 0x55, 0x59, 0x36, 0x36, 0x00, 0x00, 0x36,
35998 + 0x01, 0x80, 0x7E, 0x1A, 0x1A, 0x00, 0x00, 0x00,
35999 + 0x50, 0x03, 0x74, 0x14, 0x1C, 0x85, 0x35, 0x13,
36000 + 0x02, 0x45, 0x30, 0x30, 0x40, 0x20,
36002 + { /* Init_SR80_SR93 */
36003 + 0xFF, 0x07, 0x00, 0x6F, 0x7F, 0x7F, 0xFF, 0x36,
36004 + 0xF7, 0x00, 0x00, 0x00, 0xEF, 0xFF, 0x36, 0x36,
36005 + 0x00, 0x00, 0x00, 0x00,
36007 + { /* Init_SRA0_SRAF */
36008 + 0x00, 0xFF, 0xBF, 0xFF, 0xFF, 0xED, 0xED, 0xED,
36009 + 0x7B, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xBF, 0xDF,
36011 + { /* Init_GR00_GR08 */
36012 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F,
36015 + { /* Init_AR00_AR14 */
36016 + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
36017 + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
36018 + 0x41, 0x00, 0x0F, 0x00, 0x00,
36020 + { /* Init_CR00_CR18 */
36021 + 0x7F, 0x63, 0x63, 0x00, 0x68, 0x18, 0x72, 0xF0,
36022 + 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36023 + 0x58, 0x0C, 0x57, 0x64, 0x40, 0x57, 0x00, 0xE3,
36026 + { /* Init_CR30_CR4D */
36027 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x03, 0x20,
36028 + 0x00, 0x00, 0x00, 0x40, 0x00, 0xE7, 0xBF, 0xFD,
36029 + 0x7F, 0x63, 0x00, 0x69, 0x18, 0x72, 0x57, 0x00,
36030 + 0x58, 0x0C, 0xE0, 0x20, 0x63, 0x57,
36032 + { /* Init_CR90_CRA7 */
36033 + 0x56, 0x4B, 0x5E, 0x55, 0x86, 0x9D, 0x8E, 0xAA,
36034 + 0xDB, 0x2A, 0xDF, 0x33, 0x00, 0x00, 0x18, 0x00,
36035 + 0x20, 0x1F, 0x1A, 0x19, 0x0F, 0x0F, 0x0F, 0x00,
36040 +static void smi_set_timing(struct smifb_info *sfb,struct par_info *hw)
36043 + u32 m_nScreenStride;
36046 + for (j=0;j < numVGAModes;j++) {
36047 + if (VGAMode[j].mmSizeX == hw->width &&
36048 + VGAMode[j].mmSizeY == hw->height &&
36049 + VGAMode[j].bpp == sfb->fb.var.bits_per_pixel &&
36050 + VGAMode[j].hz == hw->hz)
36053 + smi_mmiowb(0x0,0x3c6);
36057 + smi_mmiowb(VGAMode[j].Init_MISC,0x3c2);
36059 + for (i=0;i<SIZE_SR00_SR04;i++) // init SEQ register SR00 - SR04
36061 + smi_seqw(i,VGAMode[j].Init_SR00_SR04[i]);
36064 + for (i=0;i<SIZE_SR10_SR24;i++) // init SEQ register SR10 - SR24
36066 + smi_seqw(i+0x10,VGAMode[j].Init_SR10_SR24[i]);
36069 + for (i=0;i<SIZE_SR30_SR75;i++) // init SEQ register SR30 - SR75
36071 + if (((i+0x30) != 0x62) && ((i+0x30) != 0x6a) && ((i+0x30) != 0x6b))
36072 + smi_seqw(i+0x30,VGAMode[j].Init_SR30_SR75[i]);
36074 + for (i=0;i<SIZE_SR80_SR93;i++) // init SEQ register SR80 - SR93
36076 + smi_seqw(i+0x80,VGAMode[j].Init_SR80_SR93[i]);
36078 + for (i=0;i<SIZE_SRA0_SRAF;i++) // init SEQ register SRA0 - SRAF
36080 + smi_seqw(i+0xa0,VGAMode[j].Init_SRA0_SRAF[i]);
36083 + for (i=0;i<SIZE_GR00_GR08;i++) // init Graphic register GR00 - GR08
36085 + smi_grphw(i,VGAMode[j].Init_GR00_GR08[i]);
36088 + for (i=0;i<SIZE_AR00_AR14;i++) // init Attribute register AR00 - AR14
36091 + smi_attrw(i,VGAMode[j].Init_AR00_AR14[i]);
36094 + for (i=0;i<SIZE_CR00_CR18;i++) // init CRTC register CR00 - CR18
36096 + smi_crtcw(i,VGAMode[j].Init_CR00_CR18[i]);
36099 + for (i=0;i<SIZE_CR30_CR4D;i++) // init CRTC register CR30 - CR4D
36101 + smi_crtcw(i+0x30,VGAMode[j].Init_CR30_CR4D[i]);
36104 + for (i=0;i<SIZE_CR90_CRA7;i++) // init CRTC register CR90 - CRA7
36106 + smi_crtcw(i+0x90,VGAMode[j].Init_CR90_CRA7[i]);
36110 + smi_mmiowb(0x67,0x3c2);
36111 + // set VPR registers
36112 + writel(0x0,hw->m_pVPR+0x0C);
36113 + writel(0x0,hw->m_pVPR+0x40);
36114 + // set data width
36115 + m_nScreenStride = (hw->width * sfb->fb.var.bits_per_pixel) / 64;
36116 + switch (sfb->fb.var.bits_per_pixel)
36119 + writel(0x0,hw->m_pVPR+0x0);
36122 + writel(0x00020000,hw->m_pVPR+0x0);
36125 + writel(0x00040000,hw->m_pVPR+0x0);
36128 + writel((u32)(((m_nScreenStride + 2) << 16) | m_nScreenStride),hw->m_pVPR+0x10);
36132 + * Set the color palette
36135 +smifb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
36136 + u_int trans, struct fb_info *info)
36139 + struct smifb_info *sfb = (struct smifbinfo *)info;
36142 + switch (sfb->fb.fix.visual) {
36143 + case FB_VISUAL_TRUECOLOR: /* RGB 5:6:5 True Colour */
36144 + pal = sfb->fb.pseudo_palette; // System has 16 default color
36148 + pal[regno] = (red & 0xf800) |
36149 + ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11);
36157 + * smifb_decode_var():
36158 + * Get the video params out of 'var'. If a value doesn't fit, round it up,
36159 + * if it's too big, return -EINVAL.
36161 + * Suggestion: Round up in the following order: bits_per_pixel, xres,
36162 + * yres, xres_virtual, yres_virtual, xoffset, yoffset, grayscale,
36163 + * bitfields, horizontal timing, vertical timing.
36165 +static int smifb_decode_var(struct fb_var_screeninfo *var, struct smifb_info *sfb, struct par_info *hw)
36167 + hw->width = var->xres;
36168 + hw->height = var->yres;
36174 +static int smifb_set_par (struct fb_info *info)
36176 + struct smifb_info *sfb = (struct smifb_info *)info;
36177 + int err, chgvar = 0;
36178 + struct fb_var_screeninfo *var = &info->var;
36179 + struct fb_cmap *cmap;
36183 + * Decode var contents into a par structure, adjusting any
36184 + * out of range values.
36186 + err = smifb_decode_var(var, sfb, &hw);
36191 + if (hw.width != var->xres)
36193 + if (hw.height != var->yres)
36196 + var->activate &= ~FB_ACTIVATE_ALL;
36198 + smi_set_timing(sfb, &hw);
36200 + sfb->palette_size = var->bits_per_pixel == 8 ? 256 : 16;
36201 + cmap = fb_default_cmap(sfb->palette_size);
36202 + fb_set_cmap(cmap, &sfb->fb);
36207 +static int smifb_check_var (struct fb_var_screeninfo *var, struct fb_info *info)
36209 + var->bits_per_pixel += 7;
36210 + var->bits_per_pixel &= ~7;
36212 + var->xres_virtual =
36213 + var->xres_virtual < var->xres ? var->xres : var->xres_virtual;
36214 + var->yres_virtual =
36215 + var->yres_virtual < var->yres ? var->yres : var->yres_virtual;
36217 + switch (var->bits_per_pixel) {
36219 + case 16: /* RGB 565 */
36226 + switch (var->bits_per_pixel) {
36228 + var->red.offset = 11;
36229 + var->red.length = 5;
36230 + var->green.offset = 5;
36231 + var->green.length = 6;
36232 + var->blue.offset = 0;
36233 + var->blue.length = 5;
36235 + info->fix.visual = FB_VISUAL_TRUECOLOR;
36236 + info->fix.line_length= var->xres * 2;
36240 + return -EINVAL; /* We don't support anything other than 16bpp for now. --NL */
36245 +// smifb_set_color_bitfields(var);
36251 + * Formal definition of the VESA spec:
36253 + * This refers to the state of the display when it is in full operation
36255 + * This defines an optional operating state of minimal power reduction with
36256 + * the shortest recovery time
36258 + * This refers to a level of power management in which substantial power
36259 + * reduction is achieved by the display. The display can have a longer
36260 + * recovery time from this state than from the Stand-by state
36262 + * This indicates that the display is consuming the lowest level of power
36263 + * and is non-operational. Recovery from this state may optionally require
36264 + * the user to manually power on the monitor
36266 + * Now, the fbdev driver adds an additional state, (blank), where they
36267 + * turn off the video (maybe by colormap tricks), but don't mess with the
36268 + * video itself: think of it semantically between on and Stand-By.
36270 + * So here's what we should do in our fbdev blank routine:
36272 + * VESA_NO_BLANKING (mode 0) Video on, front/back light on
36273 + * VESA_VSYNC_SUSPEND (mode 1) Video on, front/back light off
36274 + * VESA_HSYNC_SUSPEND (mode 2) Video on, front/back light off
36275 + * VESA_POWERDOWN (mode 3) Video off, front/back light off
36277 + * This will match the matrox implementation.
36281 + * Blank the display by setting all palette values to zero. Note, the
36282 + * 12 and 16 bpp modes don't really use the palette, so this will not
36283 + * blank the display in all modes.
36285 +static int smifb_blank(int blank, struct fb_info *info)
36287 +// struct smifb_info *sfb = (struct smifb_info *)info;
36290 + case VESA_POWERDOWN:
36291 + case VESA_VSYNC_SUSPEND:
36292 + case VESA_HSYNC_SUSPEND:
36293 + case VESA_NO_BLANKING:
36299 +static struct fb_ops smifb_ops = {
36300 + .owner = THIS_MODULE,
36301 + .fb_check_var = smifb_check_var,
36302 + .fb_set_par = smifb_set_par,
36303 + .fb_setcolreg = smifb_setcolreg,
36304 + .fb_blank = smifb_blank,
36306 + /* Accelerated functions, using softversions, per se */
36307 + .fb_fillrect = cfb_fillrect,
36308 + .fb_copyarea = cfb_copyarea,
36309 + .fb_imageblit = cfb_imageblit,
36310 + .fb_cursor = soft_cursor,
36314 + * Alloc struct smifb_info and assign the default value
36316 +static struct smifb_info * __devinit
36317 +smi_alloc_fb_info(struct pci_dev *dev, char *name)
36319 + struct smifb_info *sfb;
36321 + sfb = kmalloc(sizeof(struct smifb_info) + sizeof(u32) * 16, GFP_KERNEL);
36326 + memset(sfb, 0, sizeof(struct smifb_info));
36328 + sfb->currcon = -1;
36331 + strcpy(sfb->fb.fix.id, name);
36333 + sfb->fb.fix.type = FB_TYPE_PACKED_PIXELS;
36334 + sfb->fb.fix.type_aux = 0;
36335 + sfb->fb.fix.xpanstep = 0;
36336 + sfb->fb.fix.ypanstep = 0;
36337 + sfb->fb.fix.ywrapstep = 0;
36338 + sfb->fb.fix.accel = FB_ACCEL_NONE;
36340 + sfb->fb.var.nonstd = 0;
36341 + sfb->fb.var.activate = FB_ACTIVATE_NOW;
36342 + sfb->fb.var.height = -1;
36343 + sfb->fb.var.width = -1;
36344 + sfb->fb.var.accel_flags = 0;
36345 + sfb->fb.var.vmode = FB_VMODE_NONINTERLACED;
36347 + sfb->fb.fbops = &smifb_ops;
36348 + sfb->fb.flags = FBINFO_FLAG_DEFAULT;
36349 + sfb->fb.node = -1;
36350 + sfb->fb.pseudo_palette = (void *)(&sfb->palette_size + 1);
36356 + * Unmap in the memory mapped IO registers
36360 +static void __devinit
36361 +smi_unmap_mmio(struct smifb_info *sfb)
36363 + if (sfb && SMILFB)
36371 + * Map in the screen memory
36374 +static int __devinit
36375 +smi_map_smem(struct smifb_info *sfb, struct pci_dev *dev, u_long smem_len)
36378 + sfb->fb.fix.smem_start = pci_resource_start(dev, 0);
36379 + sfb->fb.fix.smem_len = smem_len;
36380 + printk("%s:smem %x,len %x\n",sfb->fb.fix.smem_start,sfb->fb.fix.smem_len);
36381 + sfb->fb.screen_base = SMILFB;
36383 + if (!sfb->fb.screen_base)
36385 + printk("%s: unable to map screen memory\n",sfb->fb.fix.id);
36394 + * Unmap in the screen memory
36397 +static void __devinit
36398 +smi_unmap_smem(struct smifb_info *sfb)
36400 + if (sfb && sfb->fb.screen_base)
36402 + iounmap(sfb->fb.screen_base);
36403 + sfb->fb.screen_base = NULL;
36408 + * We need to wake up the LynxEM+, and make sure its in linear memory mode.
36410 +static inline void __devinit
36413 + /* The delays prevent the ColdFire PCI host from locking up. :/ --NL */
36415 + outb(0x18, 0x3c4);
36417 + outb(0x11, 0x3c5);
36419 + printk("%s: 0x3c4 =%x 0x3c5 %x\n",__FUNCTION__,inw(0x3c4),inw(0x3c5));
36422 +static void __devinit
36423 +smi_free_fb_info(struct smifb_info *sfb)
36426 + fb_alloc_cmap(&sfb->fb.cmap, 0, 0);
36432 +u16 SMI_ChipIDs[numChipIDs] = {0x710, 0x712, 0x720};
36434 +int __init smifb_init(struct pci_dev *pdev, const struct pci_device_id *ent)
36436 + struct smifb_info *sfb;
36437 + u_long smem_size;
36441 + ulong m_pLAWPhysical;
36443 + printk("%s start\n",__FUNCTION__);
36444 + sprintf(name, "smifb");
36446 + hw.chipID = pdev->device;
36449 + sfb = smi_alloc_fb_info(pdev, name);
36456 + // Map address and memory detection
36457 + m_pLAWPhysical = pci_resource_start(pdev,0);
36458 + printk("%s:m_pLAWPhysical %x,hw.chipID %x\n",__FUNCTION__,m_pLAWPhysical,hw.chipID);
36459 + switch (hw.chipID) {
36462 + sfb->fb.fix.mmio_start = m_pLAWPhysical + 0x00700000;
36463 + sfb->fb.fix.mmio_len = 0x00100000;
36465 + hw.m_pLFB = SMILFB = ioremap(m_pLAWPhysical, 0x00800000);
36466 + printk("%s:SMILFB%x\n",__FUNCTION__,SMILFB);
36467 + hw.m_pMMIO = SMIRegs = SMILFB + 0x00700000;
36468 + hw.m_pDPR = hw.m_pLFB + 0x00408000;
36469 + hw.m_pVPR = hw.m_pLFB + 0x0040c000;
36473 + printk("%s: unable to map memory mapped IO\n",sfb->fb.fix.id);
36477 + smi_seqw(0x62,0x7A);
36478 + smi_seqw(0x6a,0x0c);
36479 + smi_seqw(0x6b,0x02);
36480 + smem_size = 0x00400000;
36482 + //LynxEM+ memory dection
36483 + *(u32 *)(SMILFB + 4) = 0xAA551133;
36484 + if (*(u32 *)(SMILFB + 4) != 0xAA551133)
36486 + smem_size = 0x00200000;
36487 + // Program the MCLK to 130 MHz
36488 + smi_seqw(0x6a,0x12);
36489 + smi_seqw(0x6b,0x02);
36490 + smi_seqw(0x62,0x3e);
36494 + sfb->fb.fix.mmio_start = m_pLAWPhysical + 0x000c0000;
36495 + sfb->fb.fix.mmio_len = 0x00040000;
36497 + m_pLAW = ioremap(m_pLAWPhysical, 0x00a00000);
36498 + hw.m_pLFB = SMILFB = m_pLAW + 0x00200000;
36499 + hw.m_pMMIO = SMIRegs = m_pLAW + 0x000c0000;
36500 + hw.m_pDPR = m_pLAW;
36501 + hw.m_pVPR = m_pLAW + 0x800;
36503 + smi_seqw(0x62,0xff);
36504 + smi_seqw(0x6a,0x0d);
36505 + smi_seqw(0x6b,0x02);
36506 + smem_size = 0x00400000;
36511 + sfb->fb.var.xres = 640;
36512 + sfb->fb.var.yres = 480;
36513 + sfb->fb.var.bits_per_pixel = 16;
36515 + sfb->fb.var.xres_virtual = sfb->fb.var.xres;
36517 + sfb->fb.var.yres_virtual = sfb->fb.var.yres;
36519 + sfb->fb.flags = FBINFO_FLAG_DEFAULT;
36521 + printk("%s:smem_size %x\n",__FUNCTION__,smem_size);
36522 + err = smi_map_smem(sfb, pdev, smem_size);
36523 + printk("%s:smi_map_smem error %x\n",__FUNCTION__,err);
36530 + fb_set_var(&sfb->fb, &sfb->fb.var);
36531 + smifb_check_var(&sfb->fb.var, &sfb->fb);
36532 + smifb_set_par(sfb);
36533 + printk("%s:register_framebuffer \n",__FUNCTION__);
36534 + err = register_framebuffer(&sfb->fb);
36539 + printk("Silicon Motion, Inc. LynxEM+ Init complete.\n");
36544 + smi_unmap_smem(sfb);
36545 + smi_unmap_mmio(sfb);
36546 + smi_free_fb_info(sfb);
36547 + printk("Silicon Motion, Inc. LynxEM+ Init FAILED.n");
36552 +struct pci_device_id smifb_pci_tbl[] = {
36553 + { 0x126f, 0x710, PCI_ANY_ID, PCI_ANY_ID },
36554 + { 0x126f, 0x712, PCI_ANY_ID, PCI_ANY_ID },
36555 + { 0x126f, 0x720, PCI_ANY_ID, PCI_ANY_ID },
36559 +MODULE_DEVICE_TABLE(pci, smifb_pci_tbl);
36561 +struct pci_driver smifb_driver = {
36563 + .id_table = smifb_pci_tbl,
36564 + .probe = smifb_init,
36567 +int __init smi_init(void)
36569 + /*return pci_module_init(&smifb_driver);*/
36570 + return pci_register_driver(&smifb_driver);
36573 +module_init(smi_init);
36574 +MODULE_LICENSE("GPL");
36579 +++ b/drivers/video/smifb.h
36581 +/***************************************************************************
36582 + smifb.h - SiliconMotion LynxEM+ frame buffer device
36583 + -------------------
36584 + begin : Thu Aug 9 2001
36585 + copyright : (C) 2001 by Szu-Tao Huang
36586 + email : johuang@siliconmotion.com
36587 + ***************************************************************************/
36589 +/***************************************************************************
36591 + * This program is free software; you can redistribute it and/or modify *
36592 + * it under the terms of the GNU General Public License as published by *
36593 + * the Free Software Foundation; either version 2 of the License, or *
36594 + * (at your option) any later version. *
36596 + ***************************************************************************/
36598 +#define smi_mmiowb(dat,reg) writeb(dat, SMIRegs + reg)
36599 +#define smi_mmioww(dat,reg) writew(dat, SMIRegs + reg)
36600 +#define smi_mmiowl(dat,reg) writel(dat, SMIRegs + reg)
36602 +#define smi_mmiorb(reg) readb(SMIRegs + reg)
36603 +#define smi_mmiorw(reg) readw(SMIRegs + reg)
36604 +#define smi_mmiorl(reg) readl(SMIRegs + reg)
36606 +#define SIZE_SR00_SR04 (0x04 - 0x00 + 1)
36607 +#define SIZE_SR10_SR24 (0x24 - 0x10 + 1)
36608 +#define SIZE_SR30_SR75 (0x75 - 0x30 + 1)
36609 +#define SIZE_SR80_SR93 (0x93 - 0x80 + 1)
36610 +#define SIZE_SRA0_SRAF (0xAF - 0xA0 + 1)
36611 +#define SIZE_GR00_GR08 (0x08 - 0x00 + 1)
36612 +#define SIZE_AR00_AR14 (0x14 - 0x00 + 1)
36613 +#define SIZE_CR00_CR18 (0x18 - 0x00 + 1)
36614 +#define SIZE_CR30_CR4D (0x4D - 0x30 + 1)
36615 +#define SIZE_CR90_CRA7 (0xA7 - 0x90 + 1)
36616 +#define SIZE_VPR (0x6C + 1)
36617 +#define SIZE_DPR (0x44 + 1)
36619 +#define numVGAModes 6
36620 +#define numChipIDs 3
36622 +#define NR_PALETTE 256
36626 + * Minimum X and Y resolutions
36628 +#define MIN_XRES 640
36629 +#define MIN_YRES 480
36631 +static inline void smi_crtcw(int reg, int val)
36633 + smi_mmiowb(reg, 0x3d4);
36634 + smi_mmiowb(val, 0x3d5);
36637 +static inline unsigned int smi_crtcr(int reg)
36639 + smi_mmiowb(reg, 0x3d4);
36640 + return smi_mmiorb(0x3d5);
36643 +static inline void smi_grphw(int reg, int val)
36645 + smi_mmiowb(reg, 0x3ce);
36646 + smi_mmiowb(val, 0x3cf);
36649 +static inline unsigned int smi_grphr(int reg)
36651 + smi_mmiowb(reg, 0x3ce);
36652 + return smi_mmiorb(0x3cf);
36655 +static inline void smi_attrw(int reg, int val)
36657 + smi_mmiorb(0x3da);
36658 + smi_mmiowb(reg, 0x3c0);
36659 + smi_mmiorb(0x3c1);
36660 + smi_mmiowb(val, 0x3c0);
36663 +static inline void smi_seqw(int reg, int val)
36665 + smi_mmiowb(reg, 0x3c4);
36666 + smi_mmiowb(val, 0x3c5);
36669 +static inline unsigned int smi_seqr(int reg)
36671 + smi_mmiowb(reg, 0x3c4);
36672 + return smi_mmiorb(0x3c5);
36675 +* Private structure
36677 +struct smifb_info {
36679 + * The following is a pointer to be passed into the
36680 + * functions below. The modules outside the main
36681 + * smifb.c driver have no knowledge as to what
36682 + * is within this structure.
36684 + struct fb_info fb;
36685 + struct display_switch *dispsw;
36686 + struct pci_dev *dev;
36687 + signed int currcon;
36690 + u8 red, green, blue;
36691 + } palette[NR_RGB];
36693 + u_int palette_size;
36711 +// The next structure holds all information relevant for a specific video mode.
36718 + unsigned char Init_MISC;
36719 + unsigned char Init_SR00_SR04[SIZE_SR00_SR04];
36720 + unsigned char Init_SR10_SR24[SIZE_SR10_SR24];
36721 + unsigned char Init_SR30_SR75[SIZE_SR30_SR75];
36722 + unsigned char Init_SR80_SR93[SIZE_SR80_SR93];
36723 + unsigned char Init_SRA0_SRAF[SIZE_SRA0_SRAF];
36724 + unsigned char Init_GR00_GR08[SIZE_GR00_GR08];
36725 + unsigned char Init_AR00_AR14[SIZE_AR00_AR14];
36726 + unsigned char Init_CR00_CR18[SIZE_CR00_CR18];
36727 + unsigned char Init_CR30_CR4D[SIZE_CR30_CR4D];
36728 + unsigned char Init_CR90_CRA7[SIZE_CR90_CRA7];
36730 --- a/drivers/watchdog/Kconfig
36731 +++ b/drivers/watchdog/Kconfig
36732 @@ -672,6 +672,15 @@ config TXX9_WDT
36734 # PARISC Architecture
36736 +# ColdFire Architecture
36738 +config COLDFIRE_WATCHDOG
36739 + tristate "ColdFire watchdog support"
36740 + depends on WATCHDOG
36742 + To compile this driver as a module, choose M here: the
36743 + module will be called softdog.
36745 # POWERPC Architecture
36748 --- a/drivers/watchdog/Makefile
36749 +++ b/drivers/watchdog/Makefile
36750 @@ -86,6 +86,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc
36751 # M32R Architecture
36753 # M68K Architecture
36754 +obj-$(CONFIG_COLDFIRE_WATCHDOG) += mcf_wdt.o
36756 # M68KNOMMU Architecture
36759 +++ b/drivers/watchdog/mcf_wdt.c
36762 + * drivers/watchdog/mcf_wdt.c
36764 + * Watchdog driver for ColdFire processors
36766 + * Adapted from the IXP4xx watchdog driver.
36767 + * The original version carries these notices:
36769 + * Author: Deepak Saxena <dsaxena@plexity.net>
36771 + * Copyright 2004 (c) MontaVista, Software, Inc.
36772 + * Based on sa1100 driver, Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
36774 + * This file is licensed under the terms of the GNU General Public
36775 + * License version 2. This program is licensed "as is" without any
36776 + * warranty of any kind, whether express or implied.
36779 +#include <linux/module.h>
36780 +#include <linux/moduleparam.h>
36781 +#include <linux/types.h>
36782 +#include <linux/kernel.h>
36783 +#include <linux/fs.h>
36784 +#include <linux/miscdevice.h>
36785 +#include <linux/watchdog.h>
36786 +#include <linux/init.h>
36787 +#include <linux/bitops.h>
36789 +#include <asm-m68k/uaccess.h>
36790 +#include <asm-m68k/coldfire.h>
36791 +#include <asm-m68k/m5485gpt.h>
36793 +static int nowayout;
36794 +static unsigned int heartbeat = 30; /* (secs) Default is 0.5 minute */
36795 +static unsigned long wdt_status;
36797 +#define WDT_IN_USE 0
36798 +#define WDT_OK_TO_CLOSE 1
36800 +static unsigned long wdt_tick_rate;
36805 + MCF_GPT_GMS0 = 0;
36806 + MCF_GPT_GCIR0 = MCF_GPT_GCIR_PRE(heartbeat*wdt_tick_rate) |
36807 + MCF_GPT_GCIR_CNT(0xffff);
36808 + MCF_GPT_GMS0 = MCF_GPT_GMS_OCPW(0xA5) | MCF_GPT_GMS_WDEN |
36809 + MCF_GPT_GMS_CE | MCF_GPT_GMS_TMS_GPIO;
36815 + MCF_GPT_GMS0 = 0;
36819 +wdt_keepalive(void)
36821 + MCF_GPT_GMS0 = MCF_GPT_GMS_OCPW(0xA5) | MCF_GPT_GMS0;
36825 +mcf_wdt_open(struct inode *inode, struct file *file)
36827 + if (test_and_set_bit(WDT_IN_USE, &wdt_status))
36830 + clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
36834 + return nonseekable_open(inode, file);
36838 +mcf_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
36844 + clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
36846 + for (i = 0; i != len; i++) {
36849 + if (get_user(c, data + i))
36852 + set_bit(WDT_OK_TO_CLOSE, &wdt_status);
36862 +static struct watchdog_info ident = {
36863 + .options = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT |
36864 + WDIOF_KEEPALIVEPING,
36865 + .identity = "Coldfire Watchdog",
36869 +mcf_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
36870 + unsigned long arg)
36872 + int ret = -ENOIOCTLCMD;
36876 + case WDIOC_GETSUPPORT:
36877 + ret = copy_to_user((struct watchdog_info *)arg, &ident,
36878 + sizeof(ident)) ? -EFAULT : 0;
36881 + case WDIOC_GETSTATUS:
36882 + ret = put_user(0, (int *)arg);
36885 + case WDIOC_GETBOOTSTATUS:
36886 + ret = put_user(0, (int *)arg);
36889 + case WDIOC_SETTIMEOUT:
36890 + ret = get_user(time, (int *)arg);
36894 + if (time <= 0 || time > 30) {
36899 + heartbeat = time;
36901 + /* Fall through */
36903 + case WDIOC_GETTIMEOUT:
36904 + ret = put_user(heartbeat, (int *)arg);
36907 + case WDIOC_KEEPALIVE:
36917 +mcf_wdt_release(struct inode *inode, struct file *file)
36919 + if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) {
36922 + printk(KERN_CRIT "WATCHDOG: Device closed unexpectdly - "
36923 + "timer will not stop\n");
36926 + clear_bit(WDT_IN_USE, &wdt_status);
36927 + clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
36933 +static struct file_operations mcf_wdt_fops = {
36934 + .owner = THIS_MODULE,
36935 + .llseek = no_llseek,
36936 + .write = mcf_wdt_write,
36937 + .ioctl = mcf_wdt_ioctl,
36938 + .open = mcf_wdt_open,
36939 + .release = mcf_wdt_release,
36942 +static struct miscdevice mcf_wdt_miscdev = {
36943 + .minor = WATCHDOG_MINOR,
36944 + .name = "watchdog",
36945 + .fops = &mcf_wdt_fops,
36948 +static int __init mcf_wdt_init(void)
36950 + wdt_tick_rate = MCF_BUSCLK/0xffff;
36951 +#ifdef CONFIG_WATCHDOG_NOWAYOUT
36956 + printk("ColdFire watchdog driver is loaded.\n");
36958 + return misc_register(&mcf_wdt_miscdev);
36961 +static void __exit mcf_wdt_exit(void)
36963 + misc_deregister(&mcf_wdt_miscdev);
36966 +module_init(mcf_wdt_init);
36967 +module_exit(mcf_wdt_exit);
36969 +MODULE_AUTHOR("Deepak Saxena");
36970 +MODULE_DESCRIPTION("ColdFire Watchdog");
36972 +module_param(heartbeat, int, 0);
36973 +MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds (default 60s)");
36975 +module_param(nowayout, int, 0);
36976 +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
36978 +MODULE_LICENSE("GPL");
36979 +MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
36981 --- a/fs/namespace.c
36982 +++ b/fs/namespace.c
36983 @@ -1364,7 +1364,11 @@ int copy_mount_options(const void __user
36984 /* copy_from_user cannot cross TASK_SIZE ! */
36985 size = TASK_SIZE - (unsigned long)data;
36986 if (size > PAGE_SIZE)
36987 +#ifndef CONFIG_COLDFIRE
36990 + size = PAGE_SIZE - ((unsigned long)data & ~PAGE_MASK);
36993 i = size - exact_copy_from_user((void *)page, data, size);
36996 +++ b/include/asm-m68k/5445x_pci.h
36999 + * asm-m68k/pci.h - m68k specific PCI declarations.
37001 + * Coldfire Implementation Copyright (c) 2007 Freescale Semiconductor, Inc.
37002 + * Kurt Mahan <kmahan@freescale.com>
37004 +#ifndef _ASM_M68K_5445X_PCI_H
37005 +#define _ASM_M68K_5445x_PCI_H
37007 +#ifndef CONFIG_PCI
37009 + * The PCI address space does equal the physical memory
37010 + * address space. The networking and block device layers use
37011 + * this boolean for bounce buffer decisions.
37013 +#define PCI_DMA_BUS_IS_PHYS (1)
37015 +#include <asm-generic/pci-dma-compat.h>
37018 + * The PCI address space does equal the physical memory
37019 + * address space. The networking and block device layers use
37020 + * this boolean for bounce buffer decisions.
37022 +#define PCI_DMA_BUS_IS_PHYS (1)
37024 +#define PCIBIOS_MIN_IO 0x00004000
37025 +#define PCIBIOS_MIN_MEM 0x02000000
37027 +#define pcibios_assign_all_busses() 0
37028 +#define pcibios_scan_all_fns(a, b) 0
37030 +static inline void
37031 +pcibios_set_master(struct pci_dev *dev)
37033 + /* no special bus mastering setup handling */
37036 +static inline void
37037 +pcibios_penalize_isa_irq(int irq, int active)
37039 + /* no dynamic PCI IRQ allocation */
37043 +static inline void
37044 +pcibios_add_platform_entries(struct pci_dev *dev)
37046 + /* no special handling */
37050 +static inline void
37051 +pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
37052 + struct resource *res)
37054 +#ifdef CONFIG_M54455
37055 + if ((res->start == 0xa0000000) || (res->start == 0xa8000000)) {
37056 + /* HACK! FIX! kludge to fix bridge mapping */
37057 + region->start = res->start & 0x0fffffff;
37058 + region->end = res->end & 0x0fffffff;
37060 + region->start = res->start;
37061 + region->end = res->end;
37064 + region->start = res->start;
37065 + region->end = res->end;
37069 +static inline void
37070 +pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
37071 + struct pci_bus_region *region)
37073 + res->start = region->start;
37074 + res->end = region->end;
37077 +static inline struct resource *
37078 +pcibios_select_root(struct pci_dev *pdev, struct resource *res)
37080 + struct resource *root = NULL;
37082 + if (res->flags & IORESOURCE_IO)
37083 + root = &ioport_resource;
37084 + if (res->flags & IORESOURCE_MEM)
37085 + root = &iomem_resource;
37090 +#endif /* CONFIG_PCI */
37091 +#endif /* _ASM_M68K_5445X_PCI_H */
37093 +++ b/include/asm-m68k/548x_pci.h
37095 +#ifndef _ASM_M68K_548X_PCI_H
37096 +#define _ASM_M68K_548X_PCI_H
37099 + * asm-m68k/pci_m68k.h - m68k specific PCI declarations.
37101 + * Written by Wout Klaren.
37103 +#include <linux/mm.h>
37104 +#include <asm/scatterlist.h>
37106 +#include <asm-generic/pci.h>
37111 + * Structure with hardware dependent information and functions of the
37115 +struct pci_bus_info
37118 + * Resources of the PCI bus.
37121 + struct resource mem_space;
37122 + struct resource io_space;
37125 + * System dependent functions.
37128 + struct pci_ops *m68k_pci_ops;
37130 + void (*fixup)(int pci_modify);
37131 + void (*conf_device)(struct pci_dev *dev);
37134 +#define pcibios_assign_all_busses() 0
37135 +#define pcibios_scan_all_fns(a, b) 0
37137 +static inline void pcibios_set_master(struct pci_dev *dev)
37139 + /* No special bus mastering setup handling */
37142 +static inline void pcibios_penalize_isa_irq(int irq)
37144 + /* We don't do dynamic PCI IRQ allocation */
37147 +#ifndef CONFIG_COLDFIRE
37148 +/* The PCI address space does equal the physical memory
37149 + * address space. The networking and block device layers use
37150 + * this boolean for bounce buffer decisions.
37152 +#define PCI_DMA_BUS_IS_PHYS (1)
37154 +#define PCIBIOS_MIN_IO 0x00004000
37155 +#define PCIBIOS_MIN_MEM 0x04000000
37157 +#else /* !CONFIG_COLDFIRE */
37158 +#include <asm-generic/pci-dma-compat.h>
37159 +#define PCI_DMA_BASE /*0x40000000*/0 /* PCI-DMA window base */
37161 +extern struct pci_bus_info *__init init_coldfire_pci(void);
37162 +extern void * pci_alloc_son(struct pci_dev *, size_t,
37163 + dma_addr_t *, int);
37165 + * The PCI address space equal the virtual memory
37166 + * address space on m547X/m548X.
37168 +#define PCI_DMA_BUS_IS_PHYS (1)
37170 +#define PCIBIOS_MIN_IO 0x00000100
37171 +#define PCIBIOS_MIN_MEM 0x02000000
37173 +struct scatterlist;
37176 +/* This is always fine. */
37177 +#define pci_dac_dma_supported(pci_dev, mask) (1)
37180 +/* These macros should be used after a pci_map_sg call has been done
37181 + * to get bus addresses of each of the SG entries and their lengths.
37182 + * You should only work with the number of sg entries pci_map_sg
37185 +#define sg_dma_address(sg) ((sg)->dma_address)
37186 +#define sg_dma_len(sg) ((sg)->length)
37188 +static inline void pcibios_align_resource(void *data, struct resource *res, unsigned long size, unsigned long align)
37192 +#endif /* !CONFIG_COLDFIRE*/
37193 +#endif /* _ASM_M68K_548X_PCI_H */
37194 --- a/include/asm-m68k/atomic.h
37195 +++ b/include/asm-m68k/atomic.h
37197 #define __ARCH_M68K_ATOMIC__
37200 -#include <asm/system.h>
37201 +#include <asm/system.h> /* local_irq_XXX() */
37204 * Atomic operations that C can't guarantee us. Useful for
37205 @@ -21,12 +21,20 @@ typedef struct { int counter; } atomic_t
37207 static inline void atomic_add(int i, atomic_t *v)
37209 +#ifndef CONFIG_COLDFIRE
37210 __asm__ __volatile__("addl %1,%0" : "+m" (*v) : "id" (i));
37212 + __asm__ __volatile__("addl %1,%0" : "=m" (*v) : "d" (i), "m" (*v));
37216 static inline void atomic_sub(int i, atomic_t *v)
37218 +#ifndef CONFIG_COLDFIRE
37219 __asm__ __volatile__("subl %1,%0" : "+m" (*v) : "id" (i));
37221 + __asm__ __volatile__("subl %1,%0" : "=m" (*v) : "d" (i), "m" (*v));
37225 static inline void atomic_inc(atomic_t *v)
37226 @@ -46,6 +54,14 @@ static inline int atomic_dec_and_test(at
37230 +static __inline__ int atomic_dec_and_test_lt(volatile atomic_t *v)
37233 + __asm__ __volatile__("subql #1,%1; slt %0" : "=d" (c), "=m" (*v)
37238 static inline int atomic_inc_and_test(atomic_t *v)
37241 @@ -156,7 +172,12 @@ static inline int atomic_sub_and_test(in
37242 static inline int atomic_add_negative(int i, atomic_t *v)
37245 +#ifndef CONFIG_COLDFIRE
37246 __asm__ __volatile__("addl %2,%1; smi %0" : "=d" (c), "+m" (*v): "g" (i));
37248 + __asm__ __volatile__("addl %2,%1; smi %0" : "=d" (c), "=m" (*v)
37249 + : "d" (i) , "m" (*v));
37254 --- a/include/asm-m68k/auxvec.h
37255 +++ b/include/asm-m68k/auxvec.h
37257 #ifndef __ASMm68k_AUXVEC_H
37258 #define __ASMm68k_AUXVEC_H
37260 + * Architecture-neutral AT_ values in 0-17, leave some room
37261 + * for more of them.
37264 +#ifdef CONFIG_VSYSCALL
37265 +/* Entry point to the vsyscall page */
37266 +#define AT_SYSINFO_EHDR 33
37270 --- a/include/asm-m68k/bitops.h
37271 +++ b/include/asm-m68k/bitops.h
37274 * They use the standard big-endian m680x0 bit ordering.
37276 +#ifndef CONFIG_COLDFIRE
37278 #define test_and_set_bit(nr,vaddr) \
37279 (__builtin_constant_p(nr) ? \
37280 @@ -457,4 +458,503 @@ static inline int ext2_find_next_bit(con
37282 #endif /* __KERNEL__ */
37284 +#else /* CONFIG_COLDFIRE */
37286 +#define test_and_set_bit(nr,vaddr) \
37287 + (__builtin_constant_p(nr) ? \
37288 + __constant_coldfire_test_and_set_bit(nr, vaddr) : \
37289 + __generic_coldfire_test_and_set_bit(nr, vaddr))
37292 +static __inline__ int __constant_coldfire_test_and_set_bit(int nr,
37293 + volatile void *vaddr)
37296 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37298 + __asm__ __volatile__ ("bset %2,%1; sne %0"
37299 + : "=d" (retval), "+QUd" (*p)
37300 + : "di" (nr & 7));
37304 +static __inline__ int __constant_coldfire_test_and_set_bit(int nr,
37305 + volatile void *vaddr)
37308 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37309 + __asm__ __volatile__ ("bset %2,(%4); sne %0"
37310 + : "=d" (retval), "=m" (*p)
37311 + : "di" (nr & 7), "m" (*p), "a" (p));
37316 +static __inline__ int __generic_coldfire_test_and_set_bit(int nr,
37317 + volatile void *vaddr)
37321 + __asm__ __volatile__ ("bset %2,%1; sne %0"
37322 + : "=d" (retval), "=m" (((volatile char *)vaddr)[(nr^31) >> 3])
37327 +#define __test_and_set_bit(nr, vaddr) test_and_set_bit(nr, vaddr)
37329 +#define set_bit(nr,vaddr) \
37330 + (__builtin_constant_p(nr) ? \
37331 + __constant_coldfire_set_bit(nr, vaddr) : \
37332 + __generic_coldfire_set_bit(nr, vaddr))
37335 +static __inline__ void __constant_coldfire_set_bit(int nr,
37336 + volatile void *vaddr)
37338 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37339 + __asm__ __volatile__ ("bset %1,%0"
37340 + : "+QUd" (*p) : "di" (nr & 7));
37343 +static __inline__ void __constant_coldfire_set_bit(int nr,
37344 + volatile void *vaddr)
37346 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37347 + __asm__ __volatile__ ("bset %1,(%3)"
37348 + : "=m" (*p) : "di" (nr & 7), "m" (*p), "a" (p));
37352 +static __inline__ void __generic_coldfire_set_bit(int nr,
37353 + volatile void *vaddr)
37355 + __asm__ __volatile__ ("bset %1,%0"
37356 + : "=m" (((volatile char *)vaddr)[(nr^31) >> 3])
37360 +#define __set_bit(nr, vaddr) set_bit(nr, vaddr)
37362 +#define test_and_clear_bit(nr, vaddr) \
37363 + (__builtin_constant_p(nr) ? \
37364 + __constant_coldfire_test_and_clear_bit(nr, vaddr) : \
37365 + __generic_coldfire_test_and_clear_bit(nr, vaddr))
37368 +static __inline__ int __constant_coldfire_test_and_clear_bit(int nr,
37369 + volatile void *vaddr)
37372 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37374 + __asm__ __volatile__ ("bclr %2,%1; sne %0"
37375 + : "=d" (retval), "+QUd" (*p)
37376 + : "id" (nr & 7));
37381 +static __inline__ int __constant_coldfire_test_and_clear_bit(int nr,
37382 + volatile void *vaddr)
37385 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37387 + __asm__ __volatile__ ("bclr %2,(%4); sne %0"
37388 + : "=d" (retval), "=m" (*p)
37389 + : "id" (nr & 7), "m" (*p), "a" (p));
37395 +static __inline__ int __generic_coldfire_test_and_clear_bit(int nr,
37396 + volatile void *vaddr)
37400 + __asm__ __volatile__ ("bclr %2,%1; sne %0"
37401 + : "=d" (retval), "=m" (((volatile char *)vaddr)[(nr^31) >> 3])
37407 +#define __test_and_clear_bit(nr, vaddr) test_and_clear_bit(nr, vaddr)
37410 + * clear_bit() doesn't provide any barrier for the compiler.
37412 +#define smp_mb__before_clear_bit() barrier()
37413 +#define smp_mb__after_clear_bit() barrier()
37415 +#define clear_bit(nr,vaddr) \
37416 + (__builtin_constant_p(nr) ? \
37417 + __constant_coldfire_clear_bit(nr, vaddr) : \
37418 + __generic_coldfire_clear_bit(nr, vaddr))
37421 +static __inline__ void __constant_coldfire_clear_bit(int nr,
37422 + volatile void *vaddr)
37424 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37425 + __asm__ __volatile__ ("bclr %1,%0"
37426 + : "+QUd" (*p) : "id" (nr & 7));
37429 +static __inline__ void __constant_coldfire_clear_bit(int nr,
37430 + volatile void *vaddr)
37432 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37433 + __asm__ __volatile__ ("bclr %1,(%3)"
37434 + : "=m" (*p) : "id" (nr & 7), "m" (*p), "a" (p));
37438 +static __inline__ void __generic_coldfire_clear_bit(int nr,
37439 + volatile void *vaddr)
37441 + __asm__ __volatile__ ("bclr %1,%0"
37442 + : "=m" (((volatile char *)vaddr)[(nr^31) >> 3])
37446 +#define __clear_bit(nr, vaddr) clear_bit(nr, vaddr)
37448 +#define test_and_change_bit(nr, vaddr) \
37449 + (__builtin_constant_p(nr) ? \
37450 + __constant_coldfire_test_and_change_bit(nr, vaddr) : \
37451 + __generic_coldfire_test_and_change_bit(nr, vaddr))
37454 +static __inline__ int __constant_coldfire_test_and_change_bit(int nr,
37455 + volatile void *vaddr)
37458 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37460 + __asm__ __volatile__ ("bchg %2,%1; sne %0"
37461 + : "=d" (retval), "+QUd" (*p)
37462 + : "id" (nr & 7));
37467 +static __inline__ int __constant_coldfire_test_and_change_bit(int nr,
37468 + volatile void *vaddr)
37471 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37473 + __asm__ __volatile__ ("bchg %2,(%4); sne %0"
37474 + : "=d" (retval), "=m" (*p)
37475 + : "id" (nr & 7), "m" (*p), "a" (p));
37481 +static __inline__ int __generic_coldfire_test_and_change_bit(int nr,
37482 + volatile void *vaddr)
37486 + __asm__ __volatile__ ("bchg %2,%1; sne %0"
37487 + : "=d" (retval), "=m" (((volatile char *)vaddr)[(nr^31) >> 3])
37493 +#define __test_and_change_bit(nr, vaddr) test_and_change_bit(nr, vaddr)
37494 +#define __change_bit(nr, vaddr) change_bit(nr, vaddr)
37496 +#define change_bit(nr,vaddr) \
37497 + (__builtin_constant_p(nr) ? \
37498 + __constant_coldfire_change_bit(nr, vaddr) : \
37499 + __generic_coldfire_change_bit(nr, vaddr))
37502 +static __inline__ void __constant_coldfire_change_bit(int nr,
37503 + volatile void *vaddr)
37505 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37506 + __asm__ __volatile__ ("bchg %1,%0"
37507 + : "+QUd" (*p) : "id" (nr & 7));
37510 +static __inline__ void __constant_coldfire_change_bit(int nr,
37511 + volatile void *vaddr)
37513 + volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
37514 + __asm__ __volatile__ ("bchg %1,(%3)"
37515 + : "=m" (*p) : "id" (nr & 7), "m" (*p), "a" (p));
37519 +static __inline__ void __generic_coldfire_change_bit(int nr,
37520 + volatile void *vaddr)
37522 + __asm__ __volatile__ ("bchg %1,%0"
37523 + : "=m" (((volatile char *)vaddr)[(nr^31) >> 3])
37528 +static inline int test_bit(int nr, const unsigned long *vaddr)
37530 + return (vaddr[nr >> 5] & (1UL << (nr & 31))) != 0;
37533 +static __inline__ unsigned long ffz(unsigned long word)
37535 + unsigned long result = 0;
37537 + while (word & 1) {
37544 +/* find_next_zero_bit() finds the first zero bit in a bit string of length
37545 + * 'size' bits, starting the search at bit 'offset'. This is largely based
37546 + * on Linus's ALPHA routines.
37548 +static __inline__ unsigned long find_next_zero_bit(void *addr,
37549 + unsigned long size, unsigned long offset)
37551 + unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
37552 + unsigned long result = offset & ~31UL;
37553 + unsigned long tmp;
37555 + if (offset >= size)
37561 + tmp |= ~0UL >> (32-offset);
37563 + goto found_first;
37565 + goto found_middle;
37569 + while (size & ~31UL) {
37572 + goto found_middle;
37581 + tmp |= ~0UL >> size;
37583 + return result + ffz(tmp);
37586 +#define find_first_zero_bit(addr, size) find_next_zero_bit(((void *)addr), \
37589 +/* Ported from included/linux/bitops.h */
37590 +static __inline__ int ffs(int x)
37596 + if (!(x & 0xffff)) {
37600 + if (!(x & 0xff)) {
37604 + if (!(x & 0xf)) {
37618 +#define __ffs(x) (ffs(x) - 1)
37620 +/* find_next_bit - find the next set bit in a memory region
37621 + * (from asm-ppc/bitops.h)
37623 +static __inline__ unsigned long find_next_bit(const unsigned long *addr,
37624 + unsigned long size, unsigned long offset)
37626 + unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
37627 + unsigned int result = offset & ~31UL;
37628 + unsigned int tmp;
37630 + if (offset >= size)
37636 + tmp &= ~0UL << offset;
37638 + goto found_first;
37640 + goto found_middle;
37644 + while (size >= 32) {
37647 + goto found_middle;
37656 + tmp &= ~0UL >> (32 - size);
37657 + if (tmp == 0UL) /* Are any bits set? */
37658 + return result + size; /* Nope. */
37660 + return result + __ffs(tmp);
37663 +#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
37667 +/* Ported from include/linux/bitops.h */
37668 +static __inline__ int fls(int x)
37674 + if (!(x & 0xffff0000u)) {
37678 + if (!(x & 0xff000000u)) {
37682 + if (!(x & 0xf0000000u)) {
37686 + if (!(x & 0xc0000000u)) {
37690 + if (!(x & 0x80000000u)) {
37697 +#include <asm-generic/bitops/fls64.h>
37698 +#include <asm-generic/bitops/sched.h>
37699 +#include <asm-generic/bitops/hweight.h>
37700 +#include <asm-generic/bitops/lock.h>
37702 +#define minix_find_first_zero_bit(addr, size) find_next_zero_bit((addr), \
37704 +#define minix_test_and_set_bit(nr, addr) test_and_set_bit((nr), \
37705 + (unsigned long *)(addr))
37706 +#define minix_set_bit(nr, addr) set_bit((nr), \
37707 + (unsigned long *)(addr))
37708 +#define minix_test_and_clear_bit(nr, addr) test_and_clear_bit((nr), \
37709 + (unsigned long *)(addr))
37711 +static inline int minix_test_bit(int nr, const volatile unsigned long *vaddr)
37713 + int *a = (int *)vaddr;
37717 + mask = 1 << (nr & 0x1f);
37718 + return ((mask & *a) != 0);
37721 +#define ext2_set_bit(nr, addr) test_and_set_bit((nr) ^ 24, \
37722 + (unsigned long *)(addr))
37723 +#define ext2_set_bit_atomic(lock, nr, addr) test_and_set_bit((nr) ^ 24, \
37724 + (unsigned long *)(addr))
37725 +#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr) ^ 24, \
37726 + (unsigned long *)(addr))
37727 +#define ext2_clear_bit_atomic(lock, nr, addr) test_and_clear_bit((nr) ^ 24, \
37728 + (unsigned long *)(addr))
37730 +static inline int ext2_test_bit(int nr, const void *vaddr)
37732 + const unsigned char *p = vaddr;
37733 + return (p[nr >> 3] & (1U << (nr & 7))) != 0;
37736 +static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size)
37738 + const unsigned long *p = vaddr, *addr = vaddr;
37744 + size = (size >> 5) + ((size & 31) > 0);
37745 + while (*p++ == ~0UL) {
37747 + return (p - addr) << 5;
37751 + for (res = 0; res < 32; res++)
37752 + if (!ext2_test_bit (res, p))
37754 + return (p - addr) * 32 + res;
37757 +static inline int ext2_find_next_zero_bit(const void *vaddr, unsigned size,
37760 + const unsigned long *addr = vaddr;
37761 + const unsigned long *p = addr + (offset >> 5);
37762 + int bit = offset & 31UL, res;
37764 + if (offset >= size)
37768 + /* Look for zero in first longword */
37769 + for (res = bit; res < 32; res++)
37770 + if (!ext2_test_bit (res, p))
37771 + return (p - addr) * 32 + res;
37774 + /* No zero yet, search remaining full bytes for a zero */
37775 + res = ext2_find_first_zero_bit(p, size - 32 * (p - addr));
37776 + return (p - addr) * 32 + res;
37779 +#endif /* KERNEL */
37781 +#endif /* CONFIG_COLDFIRE */
37783 #endif /* _M68K_BITOPS_H */
37784 --- a/include/asm-m68k/bootinfo.h
37785 +++ b/include/asm-m68k/bootinfo.h
37786 @@ -19,11 +19,59 @@
37787 ** Redesign of the boot information structure; renamed to bootinfo.h again
37788 ** 27/11/96 Geert Uytterhoeven:
37789 ** Backwards compatibility with bootinfo interface version 1.0
37790 +** 12/03/08 Kurt Mahan
37791 +** Copy the bd_info structure from uboot1.3.2/include/asm-m68k/u-boot.h
37792 +** into this file. The original author is Wolfgang Denk,
37793 +** DENX Software Engineering, wd@denx.de.
37796 #ifndef _M68K_BOOTINFO_H
37797 #define _M68K_BOOTINFO_H
37799 +#ifndef __ASSEMBLY__
37803 + * bd_info structure from uboot1.3.2/include/asm-m68k/u-boot.h
37806 + unsigned long bi_memstart; /* start of DRAM memory */
37807 + unsigned long bi_memsize; /* size of DRAM memory in bytes */
37808 + unsigned long bi_flashstart; /* start of FLASH memory */
37809 + unsigned long bi_flashsize; /* size of FLASH memory */
37810 + unsigned long bi_flashoffset; /* reserved area for startup monitor */
37811 + unsigned long bi_sramstart; /* start of SRAM memory */
37812 + unsigned long bi_sramsize; /* size of SRAM memory */
37813 + unsigned long bi_mbar_base; /* base of internal registers */
37814 + unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
37815 + unsigned long bi_boot_params; /* where this board expects params */
37816 + unsigned long bi_ip_addr; /* IP Address */
37817 + unsigned char bi_enet0addr[6]; /* Ethernet 0 mac address */
37818 + unsigned short bi_ethspeed; /* Ethernet speed in Mbps */
37819 + unsigned long bi_intfreq; /* Internal Freq, in MHz */
37820 + unsigned long bi_busfreq; /* Bus Freq, in MHz */
37822 + unsigned long bi_pcifreq; /* pci Freq in MHz */
37824 +#ifdef UBOOT_EXTRA_CLOCK
37825 + unsigned long bi_inpfreq; /* input Freq in MHz */
37826 + unsigned long bi_vcofreq; /* vco Freq in MHz */
37827 + unsigned long bi_flbfreq; /* Flexbus Freq in MHz */
37829 + unsigned long bi_baudrate; /* Console Baudrate */
37830 + unsigned char bi_enet1addr[6]; /* eth1 mac address */
37831 + unsigned char bi_enet2addr[6]; /* eth2 mac address */
37832 + unsigned char bi_enet3addr[6]; /* eth3 mac address */
37835 +struct uboot_record {
37836 + struct bd_info *bdi;
37837 + unsigned long initrd_start;
37838 + unsigned long initrd_end;
37839 + unsigned long cmd_line_start;
37840 + unsigned long cmd_line_stop;
37842 +#endif /* __ASSEMBLY__ */
37845 * Bootinfo definitions
37846 @@ -49,6 +97,8 @@ struct bi_record {
37847 #endif /* __ASSEMBLY__ */
37855 --- a/include/asm-m68k/byteorder.h
37856 +++ b/include/asm-m68k/byteorder.h
37858 #include <asm/types.h>
37859 #include <linux/compiler.h>
37863 +#if defined(__GNUC__)
37864 +#if defined(__mcfisaaplus__) || defined(__mcfisac__)
37865 +static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 val)
37867 + __asm__ ("byterev %0" : "=d" (val) : "0" (val));
37870 +#define __arch__swab32(x) ___arch__swab32(x)
37871 +#elif !defined(__mcoldfire__)
37872 static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 val)
37874 __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val));
37875 @@ -14,6 +21,7 @@ static __inline__ __attribute_const__ __
37876 #define __arch__swab32(x) ___arch__swab32(x)
37881 #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
37882 # define __BYTEORDER_HAS_U64__
37883 --- a/include/asm-m68k/cacheflush.h
37884 +++ b/include/asm-m68k/cacheflush.h
37887 #define FLUSH_I_AND_D (0x00000808)
37888 #define FLUSH_I (0x00000008)
37889 +#ifdef CONFIG_COLDFIRE
37890 +#include <asm/cf_cacheflush.h>
37891 +#else /* !CONFIG_COLDFIRE */
37894 * Cache handling functions
37895 @@ -153,4 +156,5 @@ static inline void copy_from_user_page(s
37896 memcpy(dst, src, len);
37899 +#endif /* !CONFIG_COLDFIRE */
37900 #endif /* _M68K_CACHEFLUSH_H */
37902 +++ b/include/asm-m68k/cf_5445x_cacheflush.h
37905 + * include/asm-m68k/cf_5445x_cacheflush.h - Coldfire 5445x Cache
37907 + * Based on include/asm-m68k/cacheflush.h
37909 + * Coldfire pieces by:
37910 + * Kurt Mahan kmahan@freescale.com
37912 + * Copyright Freescale Semiconductor, Inc. 2007, 2008
37914 + * This program is free software; you can redistribute it and/or modify it
37915 + * under the terms of the GNU General Public License as published by the
37916 + * Free Software Foundation; either version 2 of the License, or (at your
37917 + * option) any later version.
37919 +#ifndef M68K_CF_5445x_CACHEFLUSH_H
37920 +#define M68K_CF_5445x_CACHEFLUSH_H
37922 +#include <asm/cfcache.h>
37925 + * Coldfire Cache Model
37927 + * The Coldfire processors use a Harvard architecture cache configured
37928 + * as four-way set associative. The cache does not implement bus snooping
37929 + * so cache coherency with other masters must be maintained in software.
37931 + * The cache is managed via the CPUSHL instruction in conjunction with
37932 + * bits set in the CACR (cache control register). Currently the code
37933 + * uses the CPUSHL enhancement which adds the ability to
37934 + * invalidate/clear/push a cacheline by physical address. This feature
37935 + * is designated in the Hardware Configuration Register [D1-CPES].
37938 + * DPI[28] cpushl invalidate disable for d-cache
37939 + * IDPI[12] cpushl invalidate disable for i-cache
37940 + * SPA[14] cpushl search by physical address
37941 + * IVO[20] cpushl invalidate only
37943 + * Random Terminology:
37944 + * * invalidate = reset the cache line's valid bit
37945 + * * push = generate a line-sized store of the data if its contents are marked
37946 + * as modifed (the modified flag is cleared after the store)
37947 + * * clear = push + invalidate
37951 + * flush_icache - Flush all of the instruction cache
37953 +static inline void flush_icache(void)
37955 + asm volatile("nop\n"
37956 + "moveq%.l #0,%%d0\n"
37957 + "moveq%.l #0,%%d1\n"
37958 + "move%.l %%d0,%%a0\n"
37960 + "cpushl %%ic,(%%a0)\n"
37961 + "add%.l #0x0010,%%a0\n"
37962 + "addq%.l #1,%%d1\n"
37963 + "cmpi%.l %0,%%d1\n"
37965 + "moveq%.l #0,%%d1\n"
37966 + "addq%.l #1,%%d0\n"
37967 + "move%.l %%d0,%%a0\n"
37968 + "cmpi%.l #4,%%d0\n"
37970 + : : "i" (CACHE_SETS)
37971 + : "a0", "d0", "d1");
37975 + * flush_dcache - Flush all of the data cache
37977 +static inline void flush_dcache(void)
37979 + asm volatile("nop\n"
37980 + "moveq%.l #0,%%d0\n"
37981 + "moveq%.l #0,%%d1\n"
37982 + "move%.l %%d0,%%a0\n"
37984 + "cpushl %%dc,(%%a0)\n"
37985 + "add%.l #0x0010,%%a0\n"
37986 + "addq%.l #1,%%d1\n"
37987 + "cmpi%.l %0,%%d1\n"
37989 + "moveq%.l #0,%%d1\n"
37990 + "addq%.l #1,%%d0\n"
37991 + "move%.l %%d0,%%a0\n"
37992 + "cmpi%.l #4,%%d0\n"
37994 + : : "i" (CACHE_SETS)
37995 + : "a0", "d0", "d1");
37999 + * flush_bcache - Flush all of both caches
38001 +static inline void flush_bcache(void)
38003 + asm volatile("nop\n"
38004 + "moveq%.l #0,%%d0\n"
38005 + "moveq%.l #0,%%d1\n"
38006 + "move%.l %%d0,%%a0\n"
38008 + "cpushl %%bc,(%%a0)\n"
38009 + "add%.l #0x0010,%%a0\n"
38010 + "addq%.l #1,%%d1\n"
38011 + "cmpi%.l %0,%%d1\n"
38013 + "moveq%.l #0,%%d1\n"
38014 + "addq%.l #1,%%d0\n"
38015 + "move%.l %%d0,%%a0\n"
38016 + "cmpi%.l #4,%%d0\n"
38018 + : : "i" (CACHE_SETS)
38019 + : "a0", "d0", "d1");
38023 + * cf_cache_clear - invalidate cache
38024 + * @paddr: starting physical address
38025 + * @len: number of bytes
38027 + * Invalidate cache lines starting at paddr for len bytes.
38028 + * Those lines are not pushed.
38030 +static inline void cf_cache_clear(unsigned long paddr, int len)
38032 + /* number of lines */
38033 + len = (len + (CACHE_LINE_SIZE-1)) / CACHE_LINE_SIZE;
38037 + /* align on set boundary */
38038 + paddr &= 0xfffffff0;
38040 + asm volatile("nop\n"
38041 + "move%.l %2,%%d0\n"
38042 + "or%.l %3,%%d0\n"
38043 + "movec %%d0,%%cacr\n"
38044 + "move%.l %0,%%a0\n"
38045 + "move%.l %1,%%d0\n"
38047 + "cpushl %%bc,(%%a0)\n"
38048 + "lea 0x10(%%a0),%%a0\n"
38049 + "subq%.l #1,%%d0\n"
38051 + "movec %2,%%cacr\n"
38052 + : : "a" (paddr), "r" (len),
38053 + "r" (shadow_cacr),
38054 + "i" (CF_CACR_SPA+CF_CACR_IVO)
38059 + * cf_cache_push - Push dirty cache out with no invalidate
38060 + * @paddr: starting physical address
38061 + * @len: number of bytes
38063 + * Push the any dirty lines starting at paddr for len bytes.
38064 + * Those lines are not invalidated.
38066 +static inline void cf_cache_push(unsigned long paddr, int len)
38068 + /* number of lines */
38069 + len = (len + (CACHE_LINE_SIZE-1)) / CACHE_LINE_SIZE;
38073 + /* align on set boundary */
38074 + paddr &= 0xfffffff0;
38076 + asm volatile("nop\n"
38077 + "move%.l %2,%%d0\n"
38078 + "or%.l %3,%%d0\n"
38079 + "movec %%d0,%%cacr\n"
38080 + "move%.l %0,%%a0\n"
38081 + "move%.l %1,%%d0\n"
38083 + "cpushl %%bc,(%%a0)\n"
38084 + "lea 0x10(%%a0),%%a0\n"
38085 + "subq%.l #1,%%d0\n"
38087 + "movec %2,%%cacr\n"
38088 + : : "a" (paddr), "r" (len),
38089 + "r" (shadow_cacr),
38090 + "i" (CF_CACR_SPA+CF_CACR_DPI+CF_CACR_IDPI)
38095 + * cf_cache_flush - Push dirty cache out and invalidate
38096 + * @paddr: starting physical address
38097 + * @len: number of bytes
38099 + * Push the any dirty lines starting at paddr for len bytes and
38100 + * invalidate those lines.
38102 +static inline void cf_cache_flush(unsigned long paddr, int len)
38104 + /* number of lines */
38105 + len = (len + (CACHE_LINE_SIZE-1)) / CACHE_LINE_SIZE;
38109 + /* align on set boundary */
38110 + paddr &= 0xfffffff0;
38112 + asm volatile("nop\n"
38113 + "move%.l %2,%%d0\n"
38114 + "or%.l %3,%%d0\n"
38115 + "movec %%d0,%%cacr\n"
38116 + "move%.l %0,%%a0\n"
38117 + "move%.l %1,%%d0\n"
38119 + "cpushl %%bc,(%%a0)\n"
38120 + "lea 0x10(%%a0),%%a0\n"
38121 + "subq%.l #1,%%d0\n"
38123 + "movec %2,%%cacr\n"
38124 + : : "a" (paddr), "r" (len),
38125 + "r" (shadow_cacr),
38126 + "i" (CF_CACR_SPA)
38131 + * cf_cache_flush_range - Push dirty data/inst cache in range out and invalidate
38132 + * @vstart - starting virtual address
38133 + * @vend: ending virtual address
38135 + * Push the any dirty data/instr lines starting at paddr for len bytes and
38136 + * invalidate those lines.
38138 +static inline void cf_cache_flush_range(unsigned long vstart, unsigned long vend)
38142 + /* align on set boundary */
38143 + vstart &= 0xfffffff0;
38144 + vend = PAGE_ALIGN((vend + (CACHE_LINE_SIZE-1))) & 0xfffffff0;
38145 + len = vend - vstart;
38148 + vstart = __pa(vstart);
38149 + vend = vstart + len;
38151 + asm volatile("nop\n"
38152 + "move%.l %2,%%d0\n"
38153 + "or%.l %3,%%d0\n"
38154 + "movec %%d0,%%cacr\n"
38155 + "move%.l %0,%%a0\n"
38156 + "move%.l %1,%%a1\n"
38158 + "cpushl %%bc,(%%a0)\n"
38159 + "lea 0x10(%%a0),%%a0\n"
38160 + "cmpa%.l %%a0,%%a1\n"
38162 + "movec %2,%%cacr\n"
38163 + : /* no return */
38164 + : "a" (vstart), "a" (vend),
38165 + "r" (shadow_cacr),
38166 + "i" (CF_CACR_SPA)
38167 + : "a0", "a1", "d0");
38171 + * cf_dcache_flush_range - Push dirty data cache in range out and invalidate
38172 + * @vstart - starting virtual address
38173 + * @vend: ending virtual address
38175 + * Push the any dirty data lines starting at paddr for len bytes and
38176 + * invalidate those lines.
38178 +static inline void cf_dcache_flush_range(unsigned long vstart, unsigned long vend)
38180 + /* align on set boundary */
38181 + vstart &= 0xfffffff0;
38182 + vend = (vend + (CACHE_LINE_SIZE-1)) & 0xfffffff0;
38184 + asm volatile("nop\n"
38185 + "move%.l %2,%%d0\n"
38186 + "or%.l %3,%%d0\n"
38187 + "movec %%d0,%%cacr\n"
38188 + "move%.l %0,%%a0\n"
38189 + "move%.l %1,%%a1\n"
38191 + "cpushl %%dc,(%%a0)\n"
38192 + "lea 0x10(%%a0),%%a0\n"
38193 + "cmpa%.l %%a0,%%a1\n"
38195 + "movec %2,%%cacr\n"
38196 + : /* no return */
38197 + : "a" (__pa(vstart)), "a" (__pa(vend)),
38198 + "r" (shadow_cacr),
38199 + "i" (CF_CACR_SPA)
38200 + : "a0", "a1", "d0");
38204 + * cf_icache_flush_range - Push dirty inst cache in range out and invalidate
38205 + * @vstart - starting virtual address
38206 + * @vend: ending virtual address
38208 + * Push the any dirty instr lines starting at paddr for len bytes and
38209 + * invalidate those lines. This should just be an invalidate since you
38210 + * shouldn't be able to have dirty instruction cache.
38212 +static inline void cf_icache_flush_range(unsigned long vstart, unsigned long vend)
38214 + /* align on set boundary */
38215 + vstart &= 0xfffffff0;
38216 + vend = (vend + (CACHE_LINE_SIZE-1)) & 0xfffffff0;
38218 + asm volatile("nop\n"
38219 + "move%.l %2,%%d0\n"
38220 + "or%.l %3,%%d0\n"
38221 + "movec %%d0,%%cacr\n"
38222 + "move%.l %0,%%a0\n"
38223 + "move%.l %1,%%a1\n"
38225 + "cpushl %%ic,(%%a0)\n"
38226 + "lea 0x10(%%a0),%%a0\n"
38227 + "cmpa%.l %%a0,%%a1\n"
38229 + "movec %2,%%cacr\n"
38230 + : /* no return */
38231 + : "a" (__pa(vstart)), "a" (__pa(vend)),
38232 + "r" (shadow_cacr),
38233 + "i" (CF_CACR_SPA)
38234 + : "a0", "a1", "d0");
38238 + * flush_cache_mm - Flush an mm_struct
38239 + * @mm: mm_struct to flush
38241 +static inline void flush_cache_mm(struct mm_struct *mm)
38243 + if (mm == current->mm)
38247 +#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
38250 + * flush_cache_range - Flush a cache range
38251 + * @vma: vma struct
38252 + * @start: Starting address
38253 + * @end: Ending address
38255 + * flush_cache_range must be a macro to avoid a dependency on
38256 + * linux/mm.h which includes this file.
38258 +static inline void flush_cache_range(struct vm_area_struct *vma,
38259 + unsigned long start, unsigned long end)
38261 + if (vma->vm_mm == current->mm)
38262 + cf_cache_flush_range(start, end);
38266 + * flush_cache_page - Flush a page of the cache
38267 + * @vma: vma struct
38269 + * @pfn: page numer
38271 + * flush_cache_page must be a macro to avoid a dependency on
38272 + * linux/mm.h which includes this file.
38274 +static inline void flush_cache_page(struct vm_area_struct *vma,
38275 + unsigned long vmaddr, unsigned long pfn)
38277 + if (vma->vm_mm == current->mm)
38278 + cf_cache_flush_range(vmaddr, vmaddr+PAGE_SIZE);
38282 + * __flush_page_to_ram - Push a page out of the cache
38283 + * @vaddr: Virtual address at start of page
38285 + * Push the page at kernel virtual address *vaddr* and clear
38288 +static inline void __flush_page_to_ram(void *vaddr)
38290 + asm volatile("nop\n"
38291 + "move%.l %2,%%d0\n"
38292 + "or%.l %3,%%d0\n"
38293 + "movec %%d0,%%cacr\n"
38294 + "move%.l %0,%%d0\n"
38295 + "and%.l #0xfffffff0,%%d0\n"
38296 + "move%.l %%d0,%%a0\n"
38297 + "move%.l %1,%%d0\n"
38299 + "cpushl %%bc,(%%a0)\n"
38300 + "lea 0x10(%%a0),%%a0\n"
38301 + "subq%.l #1,%%d0\n"
38303 + "movec %2,%%cacr\n"
38304 + : : "a" (__pa(vaddr)), "i" (PAGE_SIZE / CACHE_LINE_SIZE),
38305 + "r" (shadow_cacr), "i" (CF_CACR_SPA)
38310 + * Various defines for the kernel.
38313 +extern void cache_clear(unsigned long paddr, int len);
38314 +extern void cache_push(unsigned long paddr, int len);
38315 +extern void flush_icache_range(unsigned long address, unsigned long endaddr);
38317 +#define flush_cache_all() flush_bcache()
38318 +#define flush_cache_vmap(start, end) flush_bcache()
38319 +#define flush_cache_vunmap(start, end) flush_bcache()
38321 +#define flush_dcache_range(vstart, vend) cf_dcache_flush_range(vstart, vend)
38322 +#define flush_dcache_page(page) __flush_page_to_ram(page_address(page))
38323 +#define flush_dcache_mmap_lock(mapping) do { } while (0)
38324 +#define flush_dcache_mmap_unlock(mapping) do { } while (0)
38326 +#define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page))
38329 + * copy_to_user_page - Copy memory to user page
38331 +static inline void copy_to_user_page(struct vm_area_struct *vma,
38332 + struct page *page, unsigned long vaddr,
38333 + void *dst, void *src, int len)
38335 + memcpy(dst, src, len);
38336 + cf_cache_flush(page_to_phys(page), PAGE_SIZE);
38340 + * copy_from_user_page - Copy memory from user page
38342 +static inline void copy_from_user_page(struct vm_area_struct *vma,
38343 + struct page *page, unsigned long vaddr,
38344 + void *dst, void *src, int len)
38346 + cf_cache_flush(page_to_phys(page), PAGE_SIZE);
38347 + memcpy(dst, src, len);
38350 +#endif /* M68K_CF_5445x_CACHEFLUSH_H */
38352 +++ b/include/asm-m68k/cf_548x_cacheflush.h
38355 + * include/asm-m68k/cf_548x_cacheflush.h - Coldfire 547x/548x Cache
38357 + * Based on include/asm-m68k/cacheflush.h
38359 + * Coldfire pieces by:
38360 + * Kurt Mahan kmahan@freescale.com
38362 + * Copyright Freescale Semiconductor, Inc. 2007, 2008
38364 + * This program is free software; you can redistribute it and/or modify it
38365 + * under the terms of the GNU General Public License as published by the
38366 + * Free Software Foundation; either version 2 of the License, or (at your
38367 + * option) any later version.
38369 +#ifndef M68K_CF_548x_CACHEFLUSH_H
38370 +#define M68K_CF_548x_CACHEFLUSH_H
38372 +#include <asm/cfcache.h>
38374 + * Cache handling functions
38377 +#define flush_icache() \
38379 + unsigned long set; \
38380 + unsigned long start_set; \
38381 + unsigned long end_set; \
38384 + end_set = (unsigned long)LAST_DCACHE_ADDR; \
38386 + for (set = start_set; set <= end_set; set += (0x10 - 3)) { \
38387 + asm volatile("cpushl %%ic,(%0)\n" \
38388 + "\taddq%.l #1,%0\n" \
38389 + "\tcpushl %%ic,(%0)\n" \
38390 + "\taddq%.l #1,%0\n" \
38391 + "\tcpushl %%ic,(%0)\n" \
38392 + "\taddq%.l #1,%0\n" \
38393 + "\tcpushl %%ic,(%0)" : "=a" (set) : "a" (set)); \
38397 +#define flush_dcache() \
38399 + unsigned long set; \
38400 + unsigned long start_set; \
38401 + unsigned long end_set; \
38404 + end_set = (unsigned long)LAST_DCACHE_ADDR; \
38406 + for (set = start_set; set <= end_set; set += (0x10 - 3)) { \
38407 + asm volatile("cpushl %%dc,(%0)\n" \
38408 + "\taddq%.l #1,%0\n" \
38409 + "\tcpushl %%dc,(%0)\n" \
38410 + "\taddq%.l #1,%0\n" \
38411 + "\tcpushl %%dc,(%0)\n" \
38412 + "\taddq%.l #1,%0\n" \
38413 + "\tcpushl %%dc,(%0)" : "=a" (set) : "a" (set)); \
38417 +#define flush_bcache() \
38419 + unsigned long set; \
38420 + unsigned long start_set; \
38421 + unsigned long end_set; \
38424 + end_set = (unsigned long)LAST_DCACHE_ADDR; \
38426 + for (set = start_set; set <= end_set; set += (0x10 - 3)) { \
38427 + asm volatile("cpushl %%bc,(%0)\n" \
38428 + "\taddq%.l #1,%0\n" \
38429 + "\tcpushl %%bc,(%0)\n" \
38430 + "\taddq%.l #1,%0\n" \
38431 + "\tcpushl %%bc,(%0)\n" \
38432 + "\taddq%.l #1,%0\n" \
38433 + "\tcpushl %%bc,(%0)" : "=a" (set) : "a" (set)); \
38438 + * invalidate the cache for the specified memory range.
38439 + * It starts at the physical address specified for
38440 + * the given number of bytes.
38442 +extern void cache_clear(unsigned long paddr, int len);
38444 + * push any dirty cache in the specified memory range.
38445 + * It starts at the physical address specified for
38446 + * the given number of bytes.
38448 +extern void cache_push(unsigned long paddr, int len);
38451 + * push and invalidate pages in the specified user virtual
38454 +extern void cache_push_v(unsigned long vaddr, int len);
38456 +/* This is needed whenever the virtual mapping of the current
38457 + process changes. */
38460 + * flush_cache_mm - Flush an mm_struct
38461 + * @mm: mm_struct to flush
38463 +static inline void flush_cache_mm(struct mm_struct *mm)
38465 + if (mm == current->mm)
38469 +#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
38471 +#define flush_cache_all() flush_bcache()
38474 + * flush_cache_range - Flush a cache range
38475 + * @vma: vma struct
38476 + * @start: Starting address
38477 + * @end: Ending address
38479 + * flush_cache_range must be a macro to avoid a dependency on
38480 + * linux/mm.h which includes this file.
38482 +static inline void flush_cache_range(struct vm_area_struct *vma,
38483 + unsigned long start, unsigned long end)
38485 + if (vma->vm_mm == current->mm)
38487 +// cf_cache_flush_range(start, end);
38491 + * flush_cache_page - Flush a page of the cache
38492 + * @vma: vma struct
38494 + * @pfn: page numer
38496 + * flush_cache_page must be a macro to avoid a dependency on
38497 + * linux/mm.h which includes this file.
38499 +static inline void flush_cache_page(struct vm_area_struct *vma,
38500 + unsigned long vmaddr, unsigned long pfn)
38502 + if (vma->vm_mm == current->mm)
38504 +// cf_cache_flush_range(vmaddr, vmaddr+PAGE_SIZE);
38507 +/* Push the page at kernel virtual address and clear the icache */
38508 +/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
38509 +#define flush_page_to_ram(page) __flush_page_to_ram((void *) page_address(page))
38510 +extern inline void __flush_page_to_ram(void *address)
38512 + unsigned long set;
38513 + unsigned long start_set;
38514 + unsigned long end_set;
38515 + unsigned long addr = (unsigned long) address;
38517 + addr &= ~(PAGE_SIZE - 1); /* round down to page start address */
38519 + start_set = addr & _ICACHE_SET_MASK;
38520 + end_set = (addr + PAGE_SIZE-1) & _ICACHE_SET_MASK;
38522 + if (start_set > end_set) {
38523 + /* from the begining to the lowest address */
38524 + for (set = 0; set <= end_set; set += (0x10 - 3)) {
38525 + asm volatile("cpushl %%bc,(%0)\n"
38526 + "\taddq%.l #1,%0\n"
38527 + "\tcpushl %%bc,(%0)\n"
38528 + "\taddq%.l #1,%0\n"
38529 + "\tcpushl %%bc,(%0)\n"
38530 + "\taddq%.l #1,%0\n"
38531 + "\tcpushl %%bc,(%0)" : "=a" (set) : "a" (set));
38533 + /* next loop will finish the cache ie pass the hole */
38534 + end_set = LAST_ICACHE_ADDR;
38536 + for (set = start_set; set <= end_set; set += (0x10 - 3)) {
38537 + asm volatile("cpushl %%bc,(%0)\n"
38538 + "\taddq%.l #1,%0\n"
38539 + "\tcpushl %%bc,(%0)\n"
38540 + "\taddq%.l #1,%0\n"
38541 + "\tcpushl %%bc,(%0)\n"
38542 + "\taddq%.l #1,%0\n"
38543 + "\tcpushl %%bc,(%0)" : "=a" (set) : "a" (set));
38547 +/* Use __flush_page_to_ram() for flush_dcache_page all values are same - MW */
38548 +#define flush_dcache_page(page) \
38549 + __flush_page_to_ram((void *) page_address(page))
38550 +#define flush_icache_page(vma,pg) \
38551 + __flush_page_to_ram((void *) page_address(pg))
38552 +#define flush_icache_user_range(adr,len) do { } while (0)
38554 +#define flush_icache_user_page(vma,page,addr,len) do { } while (0)
38556 +/* Push n pages at kernel virtual address and clear the icache */
38557 +/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
38558 +extern inline void flush_icache_range (unsigned long address,
38559 + unsigned long endaddr)
38561 + unsigned long set;
38562 + unsigned long start_set;
38563 + unsigned long end_set;
38565 + start_set = address & _ICACHE_SET_MASK;
38566 + end_set = endaddr & _ICACHE_SET_MASK;
38568 + if (start_set > end_set) {
38569 + /* from the begining to the lowest address */
38570 + for (set = 0; set <= end_set; set += (0x10 - 3)) {
38571 + asm volatile("cpushl %%ic,(%0)\n"
38572 + "\taddq%.l #1,%0\n"
38573 + "\tcpushl %%ic,(%0)\n"
38574 + "\taddq%.l #1,%0\n"
38575 + "\tcpushl %%ic,(%0)\n"
38576 + "\taddq%.l #1,%0\n"
38577 + "\tcpushl %%ic,(%0)" : "=a" (set) : "a" (set));
38579 + /* next loop will finish the cache ie pass the hole */
38580 + end_set = LAST_ICACHE_ADDR;
38582 + for (set = start_set; set <= end_set; set += (0x10 - 3)) {
38583 + asm volatile("cpushl %%ic,(%0)\n"
38584 + "\taddq%.l #1,%0\n"
38585 + "\tcpushl %%ic,(%0)\n"
38586 + "\taddq%.l #1,%0\n"
38587 + "\tcpushl %%ic,(%0)\n"
38588 + "\taddq%.l #1,%0\n"
38589 + "\tcpushl %%ic,(%0)" : "=a" (set) : "a" (set));
38593 +static inline void copy_to_user_page(struct vm_area_struct *vma,
38594 + struct page *page, unsigned long vaddr,
38595 + void *dst, void *src, int len)
38597 + memcpy(dst, src, len);
38598 + flush_icache_user_page(vma, page, vaddr, len);
38600 +static inline void copy_from_user_page(struct vm_area_struct *vma,
38601 + struct page *page, unsigned long vaddr,
38602 + void *dst, void *src, int len)
38604 + memcpy(dst, src, len);
38607 +#define flush_cache_vmap(start, end) flush_cache_all()
38608 +#define flush_cache_vunmap(start, end) flush_cache_all()
38609 +#define flush_dcache_mmap_lock(mapping) do { } while (0)
38610 +#define flush_dcache_mmap_unlock(mapping) do { } while (0)
38612 +#endif /* M68K_CF_548x_CACHEFLUSH_H */
38614 +++ b/include/asm-m68k/cf_cacheflush.h
38616 +#ifndef M68K_CF_CACHEFLUSH_H
38617 +#define M68K_CF_CACHEFLUSH_H
38619 +#ifdef CONFIG_M5445X
38620 +#include "cf_5445x_cacheflush.h"
38622 +#include "cf_548x_cacheflush.h"
38625 +#endif /* M68K_CF_CACHEFLUSH_H */
38627 +++ b/include/asm-m68k/cfcache.h
38630 + * include/asm-m68k/cfcache.h - Coldfire Cache Controller
38632 + * Kurt Mahan kmahan@freescale.com
38634 + * Copyright Freescale Semiconductor, Inc. 2007
38636 + * This program is free software; you can redistribute it and/or modify it
38637 + * under the terms of the GNU General Public License as published by the
38638 + * Free Software Foundation; either version 2 of the License, or (at your
38639 + * option) any later version.
38641 +#ifndef CF_CFCACHE_H
38642 +#define CF_CFCACHE_H
38645 + * CACR Cache Control Register
38647 +#define CF_CACR_DEC (0x80000000) /* Data Cache Enable */
38648 +#define CF_CACR_DW (0x40000000) /* Data default Write-protect */
38649 +#define CF_CACR_DESB (0x20000000) /* Data Enable Store Buffer */
38650 +#define CF_CACR_DPI (0x10000000) /* Data Disable CPUSHL Invalidate */
38651 +#define CF_CACR_DHLCK (0x08000000) /* 1/2 Data Cache Lock Mode */
38652 +#define CF_CACR_DDCM_00 (0x00000000) /* Cacheable writethrough imprecise */
38653 +#define CF_CACR_DDCM_01 (0x02000000) /* Cacheable copyback */
38654 +#define CF_CACR_DDCM_10 (0x04000000) /* Noncacheable precise */
38655 +#define CF_CACR_DDCM_11 (0x06000000) /* Noncacheable imprecise */
38656 +#define CF_CACR_DCINVA (0x01000000) /* Data Cache Invalidate All */
38657 +#define CF_CACR_DDSP (0x00800000) /* Data default supervisor-protect */
38658 +#define CF_CACR_IVO (0x00100000) /* Invalidate only */
38659 +#define CF_CACR_BEC (0x00080000) /* Branch Cache Enable */
38660 +#define CF_CACR_BCINVA (0x00040000) /* Branch Cache Invalidate All */
38661 +#define CF_CACR_IEC (0x00008000) /* Instruction Cache Enable */
38662 +#define CF_CACR_SPA (0x00004000) /* Search by Physical Address */
38663 +#define CF_CACR_DNFB (0x00002000) /* Default cache-inhibited fill buf */
38664 +#define CF_CACR_IDPI (0x00001000) /* Instr Disable CPUSHL Invalidate */
38665 +#define CF_CACR_IHLCK (0x00000800) /* 1/2 Instruction Cache Lock Mode */
38666 +#define CF_CACR_IDCM (0x00000400) /* Noncacheable Instr default mode */
38667 +#define CF_CACR_ICINVA (0x00000100) /* Instr Cache Invalidate All */
38668 +#define CF_CACR_IDSP (0x00000080) /* Ins default supervisor-protect */
38669 +#define CF_CACR_EUSP (0x00000020) /* Switch stacks in user mode */
38671 +#ifdef CONFIG_M5445X
38673 + * M5445x Cache Configuration
38674 + * - cache line size is 16 bytes
38675 + * - cache is 4-way set associative
38676 + * - each cache has 256 sets (64k / 16bytes / 4way)
38677 + * - I-Cache size is 16KB
38678 + * - D-Cache size is 16KB
38680 +#define ICACHE_SIZE 0x4000 /* instruction - 16k */
38681 +#define DCACHE_SIZE 0x4000 /* data - 16k */
38683 +#define CACHE_LINE_SIZE 0x0010 /* 16 bytes */
38684 +#define CACHE_SETS 0x0100 /* 256 sets */
38685 +#define CACHE_WAYS 0x0004 /* 4 way */
38687 +#define CACHE_DISABLE_MODE (CF_CACR_DCINVA+ \
38688 + CF_CACR_BCINVA+ \
38691 +#ifndef CONFIG_M5445X_DISABLE_CACHE
38692 +#define CACHE_INITIAL_MODE (CF_CACR_DEC+ \
38698 +/* cache disabled for testing */
38699 +#define CACHE_INITIAL_MODE (CF_CACR_EUSP)
38700 +#endif /* CONFIG_M5445X_DISABLE_CACHE */
38702 +#elif defined(CONFIG_M547X_8X)
38704 + * M547x/M548x Cache Configuration
38705 + * - cache line size is 16 bytes
38706 + * - cache is 4-way set associative
38707 + * - each cache has 512 sets (128k / 16bytes / 4way)
38708 + * - I-Cache size is 32KB
38709 + * - D-Cache size is 32KB
38711 +#define ICACHE_SIZE 0x8000 /* instruction - 32k */
38712 +#define DCACHE_SIZE 0x8000 /* data - 32k */
38714 +#define CACHE_LINE_SIZE 0x0010 /* 16 bytes */
38715 +#define CACHE_SETS 0x0200 /* 512 sets */
38716 +#define CACHE_WAYS 0x0004 /* 4 way */
38718 +/* in for the old cpushl caching code */
38719 +#define _DCACHE_SET_MASK ((DCACHE_SIZE/64-1)<<CACHE_WAYS)
38720 +#define _ICACHE_SET_MASK ((ICACHE_SIZE/64-1)<<CACHE_WAYS)
38721 +#define LAST_DCACHE_ADDR _DCACHE_SET_MASK
38722 +#define LAST_ICACHE_ADDR _ICACHE_SET_MASK
38724 +#define CACHE_DISABLE_MODE (CF_CACR_DCINVA+ \
38725 + CF_CACR_BCINVA+ \
38728 +#define CACHE_INITIAL_MODE (CF_CACR_DEC+ \
38733 +#endif /* CONFIG_M547X_8X */
38735 +#ifndef __ASSEMBLY__
38737 +extern unsigned long shadow_cacr;
38738 +extern void cacr_set(unsigned long x);
38740 +#endif /* !__ASSEMBLY__ */
38742 +#endif /* CF_CACHE_H */
38744 +++ b/include/asm-m68k/cf_entry.h
38746 +#ifndef __CF_M68K_ENTRY_H
38747 +#define __CF_M68K_ENTRY_H
38749 +#include <asm/setup.h>
38750 +#include <asm/page.h>
38751 +#include <asm/coldfire.h>
38752 +#include <asm/cfmmu.h>
38753 +#include <asm/asm-offsets.h>
38756 + * Stack layout in 'ret_from_exception':
38758 + * This allows access to the syscall arguments in registers d1-d5
38769 + * 24(sp) - orig_d0
38770 + * 28(sp) - stack adjustment
38773 + * 32(sp) - format & vector
38779 + * 97/05/14 Andreas: Register %a2 is now set to the current task throughout
38780 + * the whole kernel.
38783 +/* the following macro is used when enabling interrupts */
38784 +/* portable version */
38785 +#define ALLOWINT (~0x700)
38786 +#define MAX_NOINT_IPL 0
38788 +#ifdef __ASSEMBLY__
38792 +LFLUSH_I_AND_D = 0x00000808
38795 +/* process bits for task_struct.ptrace */
38796 +PT_TRACESYS_OFF = 3
38797 +PT_TRACESYS_BIT = 1
38798 +PT_PTRACED_OFF = 3
38799 +PT_PTRACED_BIT = 0
38803 +#define SAVE_ALL_INT save_all_int
38804 +#define SAVE_ALL_SYS save_all_sys
38805 +#define RESTORE_ALL restore_all
38807 + * This defines the normal kernel pt-regs layout.
38809 + * regs a3-a6 and d6-d7 are preserved by C code
38810 + * the kernel doesn't mess with usp unless it needs to
38814 + * a -1 in the orig_d0 field signifies
38815 + * that the stack frame is NOT for syscall
38817 +.macro save_all_int
38818 + movel MMUSR,%sp@-
38819 + movel MMUAR,%sp@-
38820 + clrl %sp@- | stk_adj
38821 + pea -1:w | orig d0
38822 + movel %d0,%sp@- | d0
38823 + subal #(8*4), %sp
38824 + moveml %d1-%d5/%a0-%a1/%curptr,%sp@
38827 +.macro save_all_sys
38828 + movel MMUSR,%sp@-
38829 + movel MMUAR,%sp@-
38830 + clrl %sp@- | stk_adj
38831 + movel %d0,%sp@- | orig d0
38832 + movel %d0,%sp@- | d0
38833 + subal #(8*4), %sp
38834 + moveml %d1-%d5/%a0-%a1/%curptr,%sp@
38837 +.macro restore_all
38838 + moveml %sp@,%a0-%a1/%curptr/%d1-%d5
38839 + addal #(8*4), %sp
38840 + movel %sp@+,%d0 | d0
38841 + addql #4,%sp | orig d0
38842 + addl %sp@+,%sp | stk_adj
38843 + addql #8,%sp | MMUAR & MMUSR
38847 +#define SWITCH_STACK_SIZE (6*4+4) /* includes return address */
38849 +#define SAVE_SWITCH_STACK save_switch_stack
38850 +#define RESTORE_SWITCH_STACK restore_switch_stack
38851 +#define GET_CURRENT(tmp) get_current tmp
38853 +.macro save_switch_stack
38854 + subal #(6*4), %sp
38855 + moveml %a3-%a6/%d6-%d7,%sp@
38858 +.macro restore_switch_stack
38859 + moveml %sp@,%a3-%a6/%d6-%d7
38860 + addal #(6*4), %sp
38863 +.macro get_current reg=%d0
38865 + andl #-THREAD_SIZE,\reg
38866 + movel \reg,%curptr
38867 + movel %curptr@,%curptr
38870 +#else /* C source */
38872 +#define STR(X) STR1(X)
38873 +#define STR1(X) #X
38875 +#define PT_OFF_ORIG_D0 0x24
38876 +#define PT_OFF_FORMATVEC 0x32
38877 +#define PT_OFF_SR 0x2C
38878 +#define SAVE_ALL_INT \
38879 + "clrl %%sp@-;" /* stk_adj */ \
38880 + "pea -1:w;" /* orig d0 = -1 */ \
38881 + "movel %%d0,%%sp@-;" /* d0 */ \
38882 + "subal #(8*4),%sp" \
38883 + "moveml %%d1-%%d5/%%a0-%%a2,%%sp@"
38884 +#define GET_CURRENT(tmp) \
38885 + "movel %%sp,"#tmp"\n\t" \
38886 + "andw #-"STR(THREAD_SIZE)","#tmp"\n\t" \
38887 + "movel "#tmp",%%a2\n\t"
38891 +#endif /* __CF_M68K_ENTRY_H */
38893 +++ b/include/asm-m68k/cfmmu.h
38896 + * Definitions for Coldfire V4e MMU
38898 +#include <asm/movs.h>
38900 +#ifndef __CF_MMU_H__
38901 +#define __CF_MMU_H__
38904 +#define MMU_BASE 0xE1000000
38907 +#define MMUCR (MMU_BASE+0x00)
38908 +#define MMUCR_ASMN 1
38909 +#define MMUCR_ASM (1<<MMUCR_ASMN)
38910 +#define MMUCR_ENN 0
38911 +#define MMUCR_EN (1<<MMUCR_ENN)
38913 +#define MMUOR REG16(MMU_BASE+0x04+0x02)
38914 +#define MMUOR_AAN 16
38915 +#define MMUOR_AA (0xffff<<MMUOR_AAN)
38916 +#define MMUOR_STLBN 8
38917 +#define MMUOR_STLB (1<<MMUOR_STLBN)
38918 +#define MMUOR_CAN 7
38919 +#define MMUOR_CA (1<<MMUOR_CAN)
38920 +#define MMUOR_CNLN 6
38921 +#define MMUOR_CNL (1<<MMUOR_CNLN)
38922 +#define MMUOR_CASN 5
38923 +#define MMUOR_CAS (1<<MMUOR_CASN)
38924 +#define MMUOR_ITLBN 4
38925 +#define MMUOR_ITLB (1<<MMUOR_ITLBN)
38926 +#define MMUOR_ADRN 3
38927 +#define MMUOR_ADR (1<<MMUOR_ADRN)
38928 +#define MMUOR_RWN 2
38929 +#define MMUOR_RW (1<<MMUOR_RWN)
38930 +#define MMUOR_ACCN 1
38931 +#define MMUOR_ACC (1<<MMUOR_ACCN)
38932 +#define MMUOR_UAAN 0
38933 +#define MMUOR_UAA (1<<MMUOR_UAAN)
38935 +#define MMUSR REG32(MMU_BASE+0x08)
38936 +#define MMUSR_SPFN 5
38937 +#define MMUSR_SPF (1<<MMUSR_SPFN)
38938 +#define MMUSR_RFN 4
38939 +#define MMUSR_RF (1<<MMUSR_RFN)
38940 +#define MMUSR_WFN 3
38941 +#define MMUSR_WF (1<<MMUSR_WFN)
38942 +#define MMUSR_HITN 1
38943 +#define MMUSR_HIT (1<<MMUSR_HITN)
38945 +#define MMUAR REG32(MMU_BASE+0x10)
38946 +#define MMUAR_VPN 1
38947 +#define MMUAR_VP (0xfffffffe)
38948 +#define MMUAR_SN 0
38949 +#define MMUAR_S (1<<MMUAR_SN)
38951 +#define MMUTR REG32(MMU_BASE+0x14)
38952 +#define MMUTR_VAN 10
38953 +#define MMUTR_VA (0xfffffc00)
38954 +#define MMUTR_IDN 2
38955 +#define MMUTR_ID (0xff<<MMUTR_IDN)
38956 +#define MMUTR_SGN 1
38957 +#define MMUTR_SG (1<<MMUTR_SGN)
38958 +#define MMUTR_VN 0
38959 +#define MMUTR_V (1<<MMUTR_VN)
38961 +#define MMUDR REG32(MMU_BASE+0x18)
38962 +#define MMUDR_PAN 10
38963 +#define MMUDR_PA (0xfffffc00)
38964 +#define MMUDR_SZN 8
38965 +#define MMUDR_SZ_MASK (0x2<<MMUDR_SZN)
38966 +#define MMUDR_SZ1M (0<<MMUDR_SZN)
38967 +#define MMUDR_SZ4K (1<<MMUDR_SZN)
38968 +#define MMUDR_SZ8K (2<<MMUDR_SZN)
38969 +#define MMUDR_SZ16M (3<<MMUDR_SZN)
38970 +#define MMUDR_CMN 6
38971 +#define MMUDR_INC (2<<MMUDR_CMN)
38972 +#define MMUDR_IC (0<<MMUDR_CMN)
38973 +#define MMUDR_DWT (0<<MMUDR_CMN)
38974 +#define MMUDR_DCB (1<<MMUDR_CMN)
38975 +#define MMUDR_DNCP (2<<MMUDR_CMN)
38976 +#define MMUDR_DNCIP (3<<MMUDR_CMN)
38977 +#define MMUDR_SPN 5
38978 +#define MMUDR_SP (1<<MMUDR_SPN)
38979 +#define MMUDR_RN 4
38980 +#define MMUDR_R (1<<MMUDR_RN)
38981 +#define MMUDR_WN 3
38982 +#define MMUDR_W (1<<MMUDR_WN)
38983 +#define MMUDR_XN 2
38984 +#define MMUDR_X (1<<MMUDR_XN)
38985 +#define MMUDR_LKN 1
38986 +#define MMUDR_LK (1<<MMUDR_LKN)
38989 +#ifndef __ASSEMBLY__
38990 +#define CF_PMEGS_NUM 256
38991 +#define CF_INVALID_CONTEXT 255
38992 +#define CF_PAGE_PGNUM_MASK (PAGE_MASK)
38994 +extern int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb,
38995 + int extension_word);
38996 +#endif /* __ASSEMBLY__*/
38998 +#endif /* !__CF_MMU_H__ */
39000 +++ b/include/asm-m68k/cf_pgalloc.h
39002 +#ifndef M68K_CF_PGALLOC_H
39003 +#define M68K_CF_PGALLOC_H
39005 +#include <asm/coldfire.h>
39006 +#include <asm/page.h>
39007 +#include <asm/cf_tlbflush.h>
39008 +#include <asm/cf_cacheflush.h>
39010 +extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
39012 + free_page((unsigned long) pte);
39015 +extern const char bad_pmd_string[];
39017 +extern inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
39018 + unsigned long address)
39020 + unsigned long page = __get_free_page(GFP_DMA|__GFP_REPEAT);
39025 + memset((void *)page, 0, PAGE_SIZE);
39026 + return (pte_t *) (page);
39029 +extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
39031 + return (pmd_t *) pgd;
39034 +#define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); })
39035 +#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
39037 +#define pte_alloc_one_fast(mm, addr) pte_alloc_one(mm, addr)
39039 +#define pmd_populate(mm, pmd, page) (pmd_val(*pmd) = \
39040 + (unsigned long)(page_address(page)))
39042 +#define pmd_populate_kernel(mm, pmd, pte) (pmd_val(*pmd) = (unsigned long)(pte))
39044 +#define pmd_pgtable(pmd) pmd_page(pmd)
39046 +static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *page)
39048 + __free_page(page);
39051 +#define __pmd_free_tlb(tlb, pmd) do { } while (0)
39053 +static inline struct page *pte_alloc_one(struct mm_struct *mm,
39054 + unsigned long address)
39056 + struct page *page = alloc_pages(GFP_DMA|__GFP_REPEAT, 0);
39062 + pte = kmap(page);
39065 + __flush_page_to_ram(pte);
39066 + flush_tlb_kernel_page(pte);
39067 + nocache_page(pte);
39074 +extern inline void pte_free(struct mm_struct *mm, struct page *page)
39076 + __free_page(page);
39080 + * In our implementation, each pgd entry contains 1 pmd that is never allocated
39081 + * or freed. pgd_present is always 1, so this should never be called. -NL
39083 +#define pmd_free(mm, pmd) BUG()
39085 +extern inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
39087 + free_page((unsigned long) pgd);
39090 +extern inline pgd_t *pgd_alloc(struct mm_struct *mm)
39094 + new_pgd = (pgd_t *)__get_free_page(GFP_DMA | __GFP_NOWARN);
39097 + memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE);
39098 + memset(new_pgd, 0, PAGE_OFFSET >> PGDIR_SHIFT);
39102 +#define pgd_populate(mm, pmd, pte) BUG()
39104 +#endif /* M68K_CF_PGALLOC_H */
39106 +++ b/include/asm-m68k/cf_pgtable.h
39108 +#ifndef _CF_PGTABLE_H
39109 +#define _CF_PGTABLE_H
39111 +#include <asm/cfmmu.h>
39112 +#include <asm/page.h>
39114 +#ifndef __ASSEMBLY__
39115 +#include <asm/virtconvert.h>
39116 +#include <linux/linkage.h>
39118 +/* For virtual address to physical address conversion */
39119 +#define VTOP(addr) __pa(addr)
39120 +#define PTOV(addr) __va(addr)
39123 +#endif /* !__ASSEMBLY__ */
39125 +/* Page protection values within PTE. */
39127 +/* MMUDR bits, in proper place. */
39128 +#define CF_PAGE_LOCKED (0x00000002)
39129 +#define CF_PAGE_EXEC (0x00000004)
39130 +#define CF_PAGE_WRITABLE (0x00000008)
39131 +#define CF_PAGE_READABLE (0x00000010)
39132 +#define CF_PAGE_SYSTEM (0x00000020)
39133 +#define CF_PAGE_COPYBACK (0x00000040)
39134 +#define CF_PAGE_NOCACHE (0x00000080)
39136 +#define CF_CACHEMASK (~0x00000040)
39137 +#define CF_PAGE_MMUDR_MASK (0x000000fe)
39139 +#define _PAGE_NOCACHE030 (CF_PAGE_NOCACHE)
39141 +/* MMUTR bits, need shifting down. */
39142 +#define CF_PAGE_VALID (0x00000400)
39143 +#define CF_PAGE_SHARED (0x00000800)
39145 +#define CF_PAGE_MMUTR_MASK (0x00000c00)
39146 +#define CF_PAGE_MMUTR_SHIFT (10)
39147 +#define CF_ASID_MMU_SHIFT (2)
39149 +/* Fake bits, not implemented in CF, will get masked out before
39150 + hitting hardware, and might go away altogether once this port is
39152 +#if PAGE_SHIFT < 13
39153 +#error COLDFIRE Error: Pages must be at least 8k in size
39155 +#define CF_PAGE_ACCESSED (0x00001000)
39156 +#define CF_PAGE_FILE (0x00000200)
39157 +#define CF_PAGE_DIRTY (0x00000001)
39159 +#define _PAGE_CACHE040 0x020 /* 68040 cache mode, cachable, copyback */
39160 +#define _PAGE_NOCACHE_S 0x040 /* 68040 no-cache mode, serialized */
39161 +#define _PAGE_NOCACHE 0x060 /* 68040 cache mode, non-serialized */
39162 +#define _PAGE_CACHE040W 0x000 /* 68040 cache mode, cachable, write-through */
39163 +#define _DESCTYPE_MASK 0x003
39164 +#define _CACHEMASK040 (~0x060)
39165 +#define _PAGE_GLOBAL040 0x400 /* 68040 global bit, used for kva descs */
39168 +/* Externally used page protection values. */
39169 +#define _PAGE_PRESENT (CF_PAGE_VALID)
39170 +#define _PAGE_ACCESSED (CF_PAGE_ACCESSED)
39171 +#define _PAGE_DIRTY (CF_PAGE_DIRTY)
39172 +#define _PAGE_READWRITE (CF_PAGE_WRITABLE \
39173 + | CF_PAGE_READABLE \
39174 + | CF_PAGE_SYSTEM \
39175 + | CF_PAGE_SHARED)
39177 +/* Compound page protection values. */
39178 +#define PAGE_NONE __pgprot(CF_PAGE_VALID \
39179 + | CF_PAGE_ACCESSED)
39181 +#define PAGE_SHARED __pgprot(CF_PAGE_VALID \
39182 + | CF_PAGE_ACCESSED \
39183 + | CF_PAGE_SHARED)
39185 +#define PAGE_INIT __pgprot(CF_PAGE_VALID \
39186 + | CF_PAGE_WRITABLE \
39187 + | CF_PAGE_READABLE \
39189 + | CF_PAGE_SYSTEM \
39190 + | CF_PAGE_SHARED)
39192 +#define PAGE_KERNEL __pgprot(CF_PAGE_VALID \
39193 + | CF_PAGE_WRITABLE \
39194 + | CF_PAGE_READABLE \
39196 + | CF_PAGE_SYSTEM \
39197 + | CF_PAGE_SHARED \
39198 + | CF_PAGE_ACCESSED)
39200 +#define PAGE_COPY __pgprot(CF_PAGE_VALID \
39201 + | CF_PAGE_ACCESSED \
39202 + | CF_PAGE_READABLE \
39205 + * Page protections for initialising protection_map. See mm/mmap.c
39206 + * for use. In general, the bit positions are xwr, and P-items are
39207 + * private, the S-items are shared.
39210 +#define __P000 PAGE_NONE
39211 +#define __P100 __pgprot(CF_PAGE_VALID \
39212 + | CF_PAGE_ACCESSED \
39214 +#define __P010 __pgprot(CF_PAGE_VALID \
39215 + | CF_PAGE_WRITABLE \
39216 + | CF_PAGE_ACCESSED)
39217 +#define __P110 __pgprot(CF_PAGE_VALID \
39218 + | CF_PAGE_ACCESSED \
39219 + | CF_PAGE_WRITABLE \
39221 +#define __P001 __pgprot(CF_PAGE_VALID \
39222 + | CF_PAGE_ACCESSED \
39223 + | CF_PAGE_READABLE)
39224 +#define __P101 __pgprot(CF_PAGE_VALID \
39225 + | CF_PAGE_ACCESSED \
39226 + | CF_PAGE_READABLE \
39228 +#define __P011 __pgprot(CF_PAGE_VALID \
39229 + | CF_PAGE_READABLE \
39230 + | CF_PAGE_WRITABLE \
39231 + | CF_PAGE_ACCESSED)
39232 +#define __P111 __pgprot(CF_PAGE_VALID \
39233 + | CF_PAGE_ACCESSED \
39234 + | CF_PAGE_WRITABLE \
39235 + | CF_PAGE_READABLE \
39238 +#define __S000 PAGE_NONE
39239 +#define __S100 __pgprot(CF_PAGE_VALID \
39240 + | CF_PAGE_ACCESSED \
39241 + | CF_PAGE_SHARED \
39243 +#define __S010 PAGE_SHARED
39244 +#define __S110 __pgprot(CF_PAGE_VALID \
39245 + | CF_PAGE_ACCESSED \
39246 + | CF_PAGE_SHARED \
39248 +#define __S001 __pgprot(CF_PAGE_VALID \
39249 + | CF_PAGE_ACCESSED \
39250 + | CF_PAGE_SHARED \
39251 + | CF_PAGE_READABLE)
39252 +#define __S101 __pgprot(CF_PAGE_VALID \
39253 + | CF_PAGE_ACCESSED \
39254 + | CF_PAGE_SHARED \
39255 + | CF_PAGE_READABLE \
39257 +#define __S011 __pgprot(CF_PAGE_VALID \
39258 + | CF_PAGE_ACCESSED \
39259 + | CF_PAGE_SHARED \
39260 + | CF_PAGE_READABLE)
39261 +#define __S111 __pgprot(CF_PAGE_VALID \
39262 + | CF_PAGE_ACCESSED \
39263 + | CF_PAGE_SHARED \
39264 + | CF_PAGE_READABLE \
39267 +#define PTE_MASK PAGE_MASK
39268 +#define CF_PAGE_CHG_MASK (PTE_MASK | CF_PAGE_ACCESSED | CF_PAGE_DIRTY)
39270 +#ifndef __ASSEMBLY__
39273 + * Conversion functions: convert a page and protection to a page entry,
39274 + * and a page entry and page directory to the page they refer to.
39276 +#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
39278 +extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
39280 + pte_val(pte) = (pte_val(pte) & CF_PAGE_CHG_MASK) | pgprot_val(newprot);
39284 +#define pmd_set(pmdp, ptep) do {} while (0)
39286 +extern inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
39288 + pgd_val(*pgdp) = virt_to_phys(pmdp);
39291 +#define __pte_page(pte) \
39292 + ((unsigned long) ((pte_val(pte) & CF_PAGE_PGNUM_MASK) + PAGE_OFFSET))
39293 +#define __pmd_page(pmd) ((unsigned long) (pmd_val(pmd)))
39295 +extern inline int pte_none(pte_t pte)
39297 + return !pte_val(pte);
39299 +extern inline int pte_present(pte_t pte)
39301 + return pte_val(pte) & CF_PAGE_VALID;
39303 +extern inline void pte_clear(struct mm_struct *mm, unsigned long addr,
39306 + pte_val(*ptep) = 0;
39309 +#define pte_pagenr(pte) ((__pte_page(pte) - PAGE_OFFSET) >> PAGE_SHIFT)
39310 +#define pte_page(pte) virt_to_page(__pte_page(pte))
39312 +extern inline int pmd_none2(pmd_t *pmd) { return !pmd_val(*pmd); }
39313 +#define pmd_none(pmd) pmd_none2(&(pmd))
39314 +extern inline int pmd_bad2(pmd_t *pmd) { return 0; }
39315 +#define pmd_bad(pmd) pmd_bad2(&(pmd))
39316 +#define pmd_present(pmd) (!pmd_none2(&(pmd)))
39317 +extern inline void pmd_clear(pmd_t *pmdp) { pmd_val(*pmdp) = 0; }
39319 +extern inline int pgd_none(pgd_t pgd) { return 0; }
39320 +extern inline int pgd_bad(pgd_t pgd) { return 0; }
39321 +extern inline int pgd_present(pgd_t pgd) { return 1; }
39322 +extern inline void pgd_clear(pgd_t *pgdp) {}
39325 +#define pte_ERROR(e) \
39326 + printk(KERN_ERR "%s:%d: bad pte %08lx.\n", \
39327 + __FILE__, __LINE__, pte_val(e))
39328 +#define pmd_ERROR(e) \
39329 + printk(KERN_ERR "%s:%d: bad pmd %08lx.\n", \
39330 + __FILE__, __LINE__, pmd_val(e))
39331 +#define pgd_ERROR(e) \
39332 + printk(KERN_ERR "%s:%d: bad pgd %08lx.\n", \
39333 + __FILE__, __LINE__, pgd_val(e))
39337 + * The following only work if pte_present() is true.
39338 + * Undefined behaviour if not...
39339 + * [we have the full set here even if they don't change from m68k]
39341 +extern inline int pte_read(pte_t pte) \
39342 + { return pte_val(pte) & CF_PAGE_READABLE; }
39343 +extern inline int pte_write(pte_t pte) \
39344 + { return pte_val(pte) & CF_PAGE_WRITABLE; }
39345 +extern inline int pte_exec(pte_t pte) \
39346 + { return pte_val(pte) & CF_PAGE_EXEC; }
39347 +extern inline int pte_dirty(pte_t pte) \
39348 + { return pte_val(pte) & CF_PAGE_DIRTY; }
39349 +extern inline int pte_young(pte_t pte) \
39350 + { return pte_val(pte) & CF_PAGE_ACCESSED; }
39351 +extern inline int pte_file(pte_t pte) \
39352 + { return pte_val(pte) & CF_PAGE_FILE; }
39354 +extern inline pte_t pte_wrprotect(pte_t pte) \
39355 + { pte_val(pte) &= ~CF_PAGE_WRITABLE; return pte; }
39356 +extern inline pte_t pte_rdprotect(pte_t pte) \
39357 + { pte_val(pte) &= ~CF_PAGE_READABLE; return pte; }
39358 +extern inline pte_t pte_exprotect(pte_t pte) \
39359 + { pte_val(pte) &= ~CF_PAGE_EXEC; return pte; }
39360 +extern inline pte_t pte_mkclean(pte_t pte) \
39361 + { pte_val(pte) &= ~CF_PAGE_DIRTY; return pte; }
39362 +extern inline pte_t pte_mkold(pte_t pte) \
39363 + { pte_val(pte) &= ~CF_PAGE_ACCESSED; return pte; }
39364 +extern inline pte_t pte_mkwrite(pte_t pte) \
39365 + { pte_val(pte) |= CF_PAGE_WRITABLE; return pte; }
39366 +extern inline pte_t pte_mkread(pte_t pte) \
39367 + { pte_val(pte) |= CF_PAGE_READABLE; return pte; }
39368 +extern inline pte_t pte_mkexec(pte_t pte) \
39369 + { pte_val(pte) |= CF_PAGE_EXEC; return pte; }
39370 +extern inline pte_t pte_mkdirty(pte_t pte) \
39371 + { pte_val(pte) |= CF_PAGE_DIRTY; return pte; }
39372 +extern inline pte_t pte_mkyoung(pte_t pte) \
39373 + { pte_val(pte) |= CF_PAGE_ACCESSED; return pte; }
39374 +extern inline pte_t pte_mknocache(pte_t pte) \
39375 + { pte_val(pte) |= 0x80 | (pte_val(pte) & ~0x40); return pte; }
39376 +extern inline pte_t pte_mkcache(pte_t pte) \
39377 + { pte_val(pte) &= ~CF_PAGE_NOCACHE; return pte; }
39379 +#define swapper_pg_dir kernel_pg_dir
39380 +extern pgd_t kernel_pg_dir[PTRS_PER_PGD];
39382 +/* Find an entry in a pagetable directory. */
39383 +#define pgd_index(address) ((address) >> PGDIR_SHIFT)
39385 +#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
39387 +/* Find an entry in a kernel pagetable directory. */
39388 +#define pgd_offset_k(address) pgd_offset(&init_mm, address)
39390 +/* Find an entry in the second-level pagetable. */
39391 +extern inline pmd_t *pmd_offset(pgd_t *pgd, unsigned long address)
39393 + return (pmd_t *) pgd;
39396 +/* Find an entry in the third-level pagetable. */
39397 +#define __pte_offset(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
39398 +#define pte_offset_kernel(dir, address) ((pte_t *) __pmd_page(*(dir)) + \
39399 + __pte_offset(address))
39401 +/* Disable caching for page at given kernel virtual address. */
39402 +static inline void nocache_page(void *vaddr)
39407 + unsigned long addr = (unsigned long)vaddr;
39409 + dir = pgd_offset_k(addr);
39410 + pmdp = pmd_offset(dir, addr);
39411 + ptep = pte_offset_kernel(pmdp, addr);
39412 + *ptep = pte_mknocache(*ptep);
39415 +/* Enable caching for page at given kernel virtual address. */
39416 +static inline void cache_page(void *vaddr)
39421 + unsigned long addr = (unsigned long)vaddr;
39423 + dir = pgd_offset_k(addr);
39424 + pmdp = pmd_offset(dir, addr);
39425 + ptep = pte_offset_kernel(pmdp, addr);
39426 + *ptep = pte_mkcache(*ptep);
39429 +#define PTE_FILE_MAX_BITS 21
39430 +#define PTE_FILE_SHIFT 11
39432 +static inline unsigned long pte_to_pgoff(pte_t pte)
39434 + return pte_val(pte) >> PTE_FILE_SHIFT;
39437 +static inline pte_t pgoff_to_pte(unsigned pgoff)
39439 + pte_t pte = __pte((pgoff << PTE_FILE_SHIFT) + CF_PAGE_FILE);
39443 +/* Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) */
39444 +#define __swp_entry(type, offset) ((swp_entry_t) { (type) | \
39445 + (offset << PTE_FILE_SHIFT) })
39446 +#define __swp_type(x) ((x).val & 0xFF)
39447 +#define __swp_offset(x) ((x).val >> PTE_FILE_SHIFT)
39448 +#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
39449 +#define __swp_entry_to_pte(x) (__pte((x).val))
39451 +#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
39453 +#define pte_offset_map(pmdp, address) ((pte_t *)__pmd_page(*pmdp) + \
39454 + __pte_offset(address))
39455 +#define pte_offset_map_nested(pmdp, address) pte_offset_map(pmdp, address)
39456 +#define pte_unmap(pte) kunmap(pte)
39457 +#define pte_unmap_nested(pte) kunmap(pte)
39459 +#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
39460 +#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
39463 +#endif /* !__ASSEMBLY__ */
39464 +#endif /* !_CF_PGTABLE_H */
39466 +++ b/include/asm-m68k/cf_tlbflush.h
39468 +#ifndef M68K_CF_TLBFLUSH_H
39469 +#define M68K_CF_TLBFLUSH_H
39471 +#include <asm/coldfire.h>
39473 +/* Flush all userspace mappings. */
39474 +static inline void flush_tlb_all(void)
39476 + preempt_disable();
39477 + *MMUOR = MMUOR_CNL;
39478 + preempt_enable();
39481 +/* Clear user TLB entries within the context named in mm */
39482 +static inline void flush_tlb_mm(struct mm_struct *mm)
39484 + preempt_disable();
39485 + *MMUOR = MMUOR_CNL;
39486 + preempt_enable();
39489 +/* Flush a single TLB page. */
39490 +static inline void flush_tlb_page(struct vm_area_struct *vma,
39491 + unsigned long addr)
39493 + preempt_disable();
39494 + *MMUOR = MMUOR_CNL;
39495 + preempt_enable();
39497 +/* Flush a range of pages from TLB. */
39499 +static inline void flush_tlb_range(struct mm_struct *mm,
39500 + unsigned long start, unsigned long end)
39502 + preempt_disable();
39503 + *MMUOR = MMUOR_CNL;
39504 + preempt_enable();
39507 +/* Flush kernel page from TLB. */
39508 +static inline void flush_tlb_kernel_page(void *addr)
39510 + preempt_disable();
39511 + *MMUOR = MMUOR_CNL;
39512 + preempt_enable();
39515 +static inline void flush_tlb_kernel_range(unsigned long start,
39516 + unsigned long end)
39521 +extern inline void flush_tlb_pgtables(struct mm_struct *mm,
39522 + unsigned long start, unsigned long end)
39526 +#endif /* M68K_CF_TLBFLUSH_H */
39528 +++ b/include/asm-m68k/cf_uaccess.h
39530 +#ifndef __M68K_CF_UACCESS_H
39531 +#define __M68K_CF_UACCESS_H
39534 + * User space memory access functions
39537 +/* The "moves" command is not available in the CF instruction set. */
39538 +#include <linux/compiler.h>
39539 +#include <linux/errno.h>
39540 +#include <linux/types.h>
39541 +#include <linux/sched.h>
39542 +#include <asm/segment.h>
39544 +#define VERIFY_READ 0
39545 +#define VERIFY_WRITE 1
39547 +/* We let the MMU do all checking */
39548 +#define access_ok(type, addr, size) 1
39551 + * The exception table consists of pairs of addresses: the first is the
39552 + * address of an instruction that is allowed to fault, and the second is
39553 + * the address at which the program should continue. No registers are
39554 + * modified, so it is entirely up to the continuation code to figure out
39557 + * All the routines below use bits of fixup code that are out of line
39558 + * with the main instruction path. This means when everything is well,
39559 + * we don't even have to jump over them. Further, they do not intrude
39560 + * on our cache or tlb entries.
39563 +struct exception_table_entry
39565 + unsigned long insn, fixup;
39568 +extern int __put_user_bad(void);
39569 +extern int __get_user_bad(void);
39571 +#define __put_user_asm(res, x, ptr, bwl, reg, err) \
39572 +asm volatile ("\n" \
39573 + "1: move."#bwl" %2,%1\n" \
39575 + " .section .fixup,\"ax\"\n" \
39577 + "10: moveq.l %3,%0\n" \
39581 + " .section __ex_table,\"a\"\n" \
39583 + " .long 1b,10b\n" \
39584 + " .long 2b,10b\n" \
39586 + : "+d" (res), "=m" (*(ptr)) \
39587 + : #reg (x), "i" (err))
39590 + * These are the main single-value transfer routines. They automatically
39591 + * use the right size if we just have the right pointer type.
39594 +#define __put_user(x, ptr) \
39596 + typeof(*(ptr)) __pu_val = (x); \
39597 + int __pu_err = 0; \
39598 + __chk_user_ptr(ptr); \
39599 + switch (sizeof (*(ptr))) { \
39601 + __put_user_asm(__pu_err, __pu_val, ptr, b, d, -EFAULT); \
39604 + __put_user_asm(__pu_err, __pu_val, ptr, w, d, -EFAULT); \
39607 + __put_user_asm(__pu_err, __pu_val, ptr, l, r, -EFAULT); \
39611 + const void __user *__pu_ptr = (ptr); \
39612 + asm volatile ("\n" \
39613 + "1: move.l %2,(%1)+\n" \
39614 + "2: move.l %R2,(%1)\n" \
39616 + " .section .fixup,\"ax\"\n" \
39618 + "10: movel %3,%0\n" \
39622 + " .section __ex_table,\"a\"\n" \
39624 + " .long 1b,10b\n" \
39625 + " .long 2b,10b\n" \
39626 + " .long 3b,10b\n" \
39628 + : "+d" (__pu_err), "+a" (__pu_ptr) \
39629 + : "r" (__pu_val), "i" (-EFAULT) \
39634 + __pu_err = __put_user_bad(); \
39639 +#define put_user(x, ptr) __put_user(x, ptr)
39642 +#define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({ \
39644 + asm volatile ("\n" \
39645 + "1: move."#bwl" %2,%1\n" \
39647 + " .section .fixup,\"ax\"\n" \
39649 + "10: move.l %3,%0\n" \
39650 + " subl %1,%1\n" \
39654 + " .section __ex_table,\"a\"\n" \
39656 + " .long 1b,10b\n" \
39658 + : "+d" (res), "=&" #reg (__gu_val) \
39659 + : "m" (*(ptr)), "i" (err)); \
39660 + (x) = (typeof(*(ptr)))(unsigned long)__gu_val; \
39663 +#define __get_user(x, ptr) \
39665 + int __gu_err = 0; \
39666 + __chk_user_ptr(ptr); \
39667 + switch (sizeof(*(ptr))) { \
39669 + __get_user_asm(__gu_err, x, ptr, u8, b, d, -EFAULT); \
39672 + __get_user_asm(__gu_err, x, ptr, u16, w, d, -EFAULT); \
39675 + __get_user_asm(__gu_err, x, ptr, u32, l, r, -EFAULT); \
39677 +/* case 8: disabled because gcc-4.1 has a broken typeof \
39679 + const void *__gu_ptr = (ptr); \
39681 + asm volatile ("\n" \
39682 + "1: move.l (%2)+,%1\n" \
39683 + "2: move.l (%2),%R1\n" \
39685 + " .section .fixup,\"ax\"\n" \
39687 + "10: move.l %3,%0\n" \
39688 + " subl %1,%1\n" \
39689 + " subl %R1,%R1\n" \
39693 + " .section __ex_table,\"a\"\n" \
39695 + " .long 1b,10b\n" \
39696 + " .long 2b,10b\n" \
39698 + : "+d" (__gu_err), "=&r" (__gu_val), \
39699 + "+a" (__gu_ptr) \
39700 + : "i" (-EFAULT) \
39702 + (x) = (typeof(*(ptr)))__gu_val; \
39706 + __gu_err = __get_user_bad(); \
39711 +#define get_user(x, ptr) __get_user(x, ptr)
39713 +unsigned long __generic_copy_from_user(void *to, const void __user *from,
39714 + unsigned long n);
39715 +unsigned long __generic_copy_to_user(void __user *to, const void *from,
39716 + unsigned long n);
39718 +#define __constant_copy_from_user_asm(res, to, from, tmp, n, s1, s2, s3)\
39719 + asm volatile ("\n" \
39720 + "1: move."#s1" (%2)+,%3\n" \
39721 + " move."#s1" %3,(%1)+\n" \
39722 + "2: move."#s2" (%2)+,%3\n" \
39723 + " move."#s2" %3,(%1)+\n" \
39724 + " .ifnc \""#s3"\",\"\"\n" \
39725 + "3: move."#s3" (%2)+,%3\n" \
39726 + " move."#s3" %3,(%1)+\n" \
39729 + " .section __ex_table,\"a\"\n" \
39731 + " .long 1b,10f\n" \
39732 + " .long 2b,20f\n" \
39733 + " .ifnc \""#s3"\",\"\"\n" \
39734 + " .long 3b,30f\n" \
39738 + " .section .fixup,\"ax\"\n" \
39740 + "10: clr."#s1" (%1)+\n" \
39741 + "20: clr."#s2" (%1)+\n" \
39742 + " .ifnc \""#s3"\",\"\"\n" \
39743 + "30: clr."#s3" (%1)+\n" \
39745 + " moveq.l #"#n",%0\n" \
39748 + : "+d" (res), "+&a" (to), "+a" (from), "=&d" (tmp) \
39751 +static __always_inline unsigned long
39752 +__constant_copy_from_user(void *to, const void __user *from, unsigned long n)
39754 + unsigned long res = 0, tmp;
39758 + __get_user_asm(res, *(u8 *)to, (u8 __user *)from, u8, b, d, 1);
39761 + __get_user_asm(res, *(u16 *)to, (u16 __user *)from, u16, w,
39765 + __constant_copy_from_user_asm(res, to, from, tmp, 3, w, b,);
39768 + __get_user_asm(res, *(u32 *)to, (u32 __user *)from, u32, l,
39772 + __constant_copy_from_user_asm(res, to, from, tmp, 5, l, b,);
39775 + __constant_copy_from_user_asm(res, to, from, tmp, 6, l, w,);
39778 + __constant_copy_from_user_asm(res, to, from, tmp, 7, l, w, b);
39781 + __constant_copy_from_user_asm(res, to, from, tmp, 8, l, l,);
39784 + __constant_copy_from_user_asm(res, to, from, tmp, 9, l, l, b);
39787 + __constant_copy_from_user_asm(res, to, from, tmp, 10, l, l, w);
39790 + __constant_copy_from_user_asm(res, to, from, tmp, 12, l, l, l);
39793 + /* we limit the inlined version to 3 moves */
39794 + return __generic_copy_from_user(to, from, n);
39800 +#define __constant_copy_to_user_asm(res, to, from, tmp, n, s1, s2, s3) \
39801 + asm volatile ("\n" \
39802 + " move."#s1" (%2)+,%3\n" \
39803 + "11: move."#s1" %3,(%1)+\n" \
39804 + "12: move."#s2" (%2)+,%3\n" \
39805 + "21: move."#s2" %3,(%1)+\n" \
39807 + " .ifnc \""#s3"\",\"\"\n" \
39808 + " move."#s3" (%2)+,%3\n" \
39809 + "31: move."#s3" %3,(%1)+\n" \
39814 + " .section __ex_table,\"a\"\n" \
39816 + " .long 11b,5f\n" \
39817 + " .long 12b,5f\n" \
39818 + " .long 21b,5f\n" \
39819 + " .long 22b,5f\n" \
39820 + " .ifnc \""#s3"\",\"\"\n" \
39821 + " .long 31b,5f\n" \
39822 + " .long 32b,5f\n" \
39826 + " .section .fixup,\"ax\"\n" \
39828 + "5: moveq.l #"#n",%0\n" \
39831 + : "+d" (res), "+a" (to), "+a" (from), "=&d" (tmp) \
39834 +static __always_inline unsigned long
39835 +__constant_copy_to_user(void __user *to, const void *from, unsigned long n)
39837 + unsigned long res = 0, tmp;
39841 + __put_user_asm(res, *(u8 *)from, (u8 __user *)to, b, d, 1);
39844 + __put_user_asm(res, *(u16 *)from, (u16 __user *)to, w, d, 2);
39847 + __constant_copy_to_user_asm(res, to, from, tmp, 3, w, b,);
39850 + __put_user_asm(res, *(u32 *)from, (u32 __user *)to, l, r, 4);
39853 + __constant_copy_to_user_asm(res, to, from, tmp, 5, l, b,);
39856 + __constant_copy_to_user_asm(res, to, from, tmp, 6, l, w,);
39859 + __constant_copy_to_user_asm(res, to, from, tmp, 7, l, w, b);
39862 + __constant_copy_to_user_asm(res, to, from, tmp, 8, l, l,);
39865 + __constant_copy_to_user_asm(res, to, from, tmp, 9, l, l, b);
39868 + __constant_copy_to_user_asm(res, to, from, tmp, 10, l, l, w);
39871 + __constant_copy_to_user_asm(res, to, from, tmp, 12, l, l, l);
39874 + /* limit the inlined version to 3 moves */
39875 + return __generic_copy_to_user(to, from, n);
39881 +#define __copy_from_user(to, from, n) \
39882 +(__builtin_constant_p(n) ? \
39883 + __constant_copy_from_user(to, from, n) : \
39884 + __generic_copy_from_user(to, from, n))
39886 +#define __copy_to_user(to, from, n) \
39887 +(__builtin_constant_p(n) ? \
39888 + __constant_copy_to_user(to, from, n) : \
39889 + __generic_copy_to_user(to, from, n))
39891 +#define __copy_to_user_inatomic __copy_to_user
39892 +#define __copy_from_user_inatomic __copy_from_user
39894 +#define copy_from_user(to, from, n) __copy_from_user(to, from, n)
39895 +#define copy_to_user(to, from, n) __copy_to_user(to, from, n)
39897 +long strncpy_from_user(char *dst, const char __user *src, long count);
39898 +long strnlen_user(const char __user *src, long n);
39899 +unsigned long __clear_user(void __user *to, unsigned long n);
39901 +#define clear_user __clear_user
39903 +#define strlen_user(str) strnlen_user(str, 32767)
39905 +#endif /* _M68K_CF_UACCESS_H */
39906 --- a/include/asm-m68k/checksum.h
39907 +++ b/include/asm-m68k/checksum.h
39908 @@ -34,6 +34,7 @@ extern __wsum csum_partial_copy_nocheck(
39909 void *dst, int len,
39912 +#ifndef CONFIG_COLDFIRE /* CF has own copy in arch/m68k/lib/checksum.c */
39914 * This is a version of ip_compute_csum() optimized for IP headers,
39915 * which always checksum on 4 octet boundaries.
39916 @@ -59,6 +60,9 @@ static inline __sum16 ip_fast_csum(const
39918 return (__force __sum16)~sum;
39921 +extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
39925 * Fold a partial checksum
39926 @@ -67,6 +71,11 @@ static inline __sum16 ip_fast_csum(const
39927 static inline __sum16 csum_fold(__wsum sum)
39929 unsigned int tmp = (__force u32)sum;
39930 +#ifdef CONFIG_COLDFIRE
39931 + tmp = (tmp & 0xffff) + (tmp >> 16);
39932 + tmp = (tmp & 0xffff) + (tmp >> 16);
39933 + return (__force __sum16) ~tmp;
39935 __asm__("swap %1\n\t"
39938 @@ -74,6 +83,7 @@ static inline __sum16 csum_fold(__wsum s
39939 : "=&d" (sum), "=&d" (tmp)
39940 : "0" (sum), "1" (tmp));
39941 return (__force __sum16)~sum;
39947 +++ b/include/asm-m68k/coldfire_edma.h
39950 + * coldfire_edma.h - eDMA driver for Coldfire MCF5445x
39952 + * Yaroslav Vinogradov yaroslav.vinogradov@freescale.com
39954 + * Copyright Freescale Semiconductor, Inc. 2007
39956 + * This program is free software; you can redistribute it and/or modify it
39957 + * under the terms of the GNU General Public License as published by the
39958 + * Free Software Foundation; either version 2 of the License, or (at your
39959 + * option) any later version.
39962 +#ifndef _LINUX_COLDFIRE_DMA_H
39963 +#define _LINUX_COLDFIRE_DMA_H
39965 +#include <linux/interrupt.h>
39966 +#include <asm/mcf5445x_edma.h>
39968 +#define EDMA_DRIVER_NAME "ColdFire-eDMA"
39969 +#define DMA_DEV_MINOR 1
39971 +#ifdef CONFIG_M5445X
39972 +#define EDMA_INT_CHANNEL_BASE 8
39973 +#define EDMA_INT_CONTROLLER_BASE 64
39974 +#define EDMA_INT_BASE (EDMA_INT_CHANNEL_BASE + \
39975 + EDMA_INT_CONTROLLER_BASE)
39976 +#define EDMA_CHANNELS 16
39977 +#define EDMA_INT_ERR 16 /* edma error interrupt */
39978 +#endif /* CONFIG_M5445X */
39980 +typedef irqreturn_t (*edma_irq_handler)(int, void *);
39981 +typedef void (*edma_error_handler)(int, void *);
39983 +/* Setup transfer control descriptor (TCD)
39984 + * channel - descriptor number
39985 + * source - source address
39986 + * dest - destination address
39987 + * attr - attributes
39988 + * soff - source offset
39989 + * nbytes - number of bytes to be transfered in minor loop
39990 + * slast - last source address adjustment
39991 + * citer - major loop count
39992 + * biter - begining minor loop count
39993 + * doff - destination offset
39994 + * dlast_sga - last destination address adjustment
39995 + * major_int - generate interrupt after each major loop
39996 + * disable_req - disable DMA request after major loop
39998 +void set_edma_params(int channel, u32 source, u32 dest,
39999 + u32 attr, u32 soff, u32 nbytes, u32 slast,
40000 + u32 citer, u32 biter, u32 doff, u32 dlast_sga,
40001 + int major_int, int disable_req);
40003 +/* Starts eDMA transfer on specified channel
40004 + * channel - eDMA TCD number
40006 +static inline void start_edma_transfer(int channel)
40008 + MCF_EDMA_SERQ = channel;
40009 + MCF_EDMA_SSRT = channel;
40012 +/* Stops eDMA transfer
40013 + * channel - eDMA TCD number
40015 +static inline void stop_edma_transfer(int channel)
40017 + MCF_EDMA_CINT = channel;
40018 + MCF_EDMA_CERQ = channel;
40022 +/* Confirm that interrupt has been handled
40023 + * channel - eDMA TCD number
40025 +static inline void confirm_edma_interrupt_handled(int channel)
40027 + MCF_EDMA_CINT = channel;
40030 +/* Initialize eDMA controller */
40031 +void init_edma(void);
40033 +/* Request eDMA channel:
40034 + * channel - eDMA TCD number
40035 + * handler - channel IRQ callback
40036 + * error_handler - error interrupt handler callback for channel
40038 + * lock - spinlock to be locked (can be NULL)
40039 + * device_id - device driver name for proc file system output
40041 +int request_edma_channel(int channel,
40042 + edma_irq_handler handler,
40043 + edma_error_handler error_handler,
40045 + spinlock_t *lock,
40046 + const char *device_id);
40049 + * set_edma_callback - Update the channel callback/arg
40050 + * @channel: channel number
40051 + * @handler: dma handler
40052 + * @error_handler: dma error handler
40053 + * @arg: argument to pass back
40055 + * Returns 0 if success or a negative value if failure
40057 +int set_edma_callback(int channel,
40058 + edma_irq_handler handler,
40059 + edma_error_handler error_handler,
40062 +/* Free eDMA channel
40063 + * channel - eDMA TCD number
40066 +int free_edma_channel(int channel, void *dev);
40071 +#define DMA_MODE_READ 0
40072 +#define DMA_MODE_WRITE 1
40075 +++ b/include/asm-m68k/coldfire.h
40077 +#ifndef _COLDFIRE_H_
40078 +#define _COLDFIRE_H_
40080 +#if defined(CONFIG_M5445X)
40081 +#define MCF_MBAR 0x0
40083 + * Even though RAMBAR1 should be in the 0x8xxxxxxx range there
40084 + * is a problem that needs to be resolved. Currently head.S
40085 + * disables SRAM/RAMBAR1.
40087 +#define MCF_RAMBAR1 0x40000000
40088 +#define MCF_SRAM 0x40000000
40089 +#elif defined(CONFIG_M547X_8X)
40090 +#define MCF_MBAR 0xF0000000
40091 +#define MCF_MMUBAR 0xF1000000
40092 +#define MCF_RAMBAR0 0xF3000000
40093 +#define MCF_RAMBAR1 0xF3001000
40096 +#define MCF_CLK CONFIG_MCFCLK
40097 +#define MCF_BUSCLK (CONFIG_MCFCLK/2)
40099 +#ifdef __ASSEMBLY__
40103 +#else /* __ASSEMBLY__ */
40104 +#define REG32(x) ((volatile unsigned long *)(x))
40105 +#define REG16(x) ((volatile unsigned short *)(x))
40106 +#define REG08(x) ((volatile unsigned char *)(x))
40108 +#define MCF_REG32(x) *(volatile unsigned long *)(MCF_MBAR+(x))
40109 +#define MCF_REG16(x) *(volatile unsigned short *)(MCF_MBAR+(x))
40110 +#define MCF_REG08(x) *(volatile unsigned char *)(MCF_MBAR+(x))
40112 +void cacr_set(unsigned long);
40113 +unsigned long cacr_get(void);
40115 +#define coldfire_enable_irq0(irq) MCF_INTC0_CIMR = (irq);
40117 +#define coldfire_enable_irq1(irq) MCF_INTC1_CIMR = (irq);
40119 +#define coldfire_disable_irq0(irq) MCF_INTC0_SIMR = (irq);
40121 +#define coldfire_disable_irq1(irq) MCF_INTC1_SIMR = (irq);
40123 +#define getiprh() MCF_INTC0_IPRH
40125 +#endif /* __ASSEMBLY__ */
40127 +#endif /* _COLDFIRE_H_ */
40128 --- a/include/asm-m68k/delay.h
40129 +++ b/include/asm-m68k/delay.h
40132 static inline void __delay(unsigned long loops)
40134 +#if defined(CONFIG_COLDFIRE)
40135 + /* The coldfire runs this loop at significantly different speeds
40136 + * depending upon long word alignment or not. We'll pad it to
40137 + * long word alignment which is the faster version.
40138 + * The 0x4a8e is of course a 'tstl %fp' instruction. This is better
40139 + * than using a NOP (0x4e71) instruction because it executes in one
40140 + * cycle not three and doesn't allow for an arbitary delay waiting
40141 + * for bus cycles to finish. Also fp/a6 isn't likely to cause a
40142 + * stall waiting for the register to become valid if such is added
40143 + * to the coldfire at some stage.
40145 + __asm__ __volatile__ (".balignw 4, 0x4a8e\n\t"
40146 + "1: subql #1, %0\n\t"
40148 + : "=d" (loops) : "0" (loops));
40150 __asm__ __volatile__ ("1: subql #1,%0; jcc 1b"
40151 : "=d" (loops) : "0" (loops));
40155 extern void __bad_udelay(void);
40156 @@ -26,12 +43,17 @@ extern void __bad_udelay(void);
40158 static inline void __const_udelay(unsigned long xloops)
40160 +#if defined(CONFIG_COLDFIRE)
40162 + __delay(((((unsigned long long) xloops * loops_per_jiffy))>>32)*HZ);
40166 __asm__ ("mulul %2,%0:%1"
40167 : "=d" (xloops), "=d" (tmp)
40168 : "d" (xloops), "1" (loops_per_jiffy));
40169 __delay(xloops * HZ);
40173 static inline void __udelay(unsigned long usecs)
40174 @@ -46,12 +68,16 @@ static inline void __udelay(unsigned lon
40175 static inline unsigned long muldiv(unsigned long a, unsigned long b,
40178 +#if defined(CONFIG_COLDFIRE)
40179 + return (long)(((unsigned long long)a * b)/c);
40183 __asm__ ("mulul %2,%0:%1; divul %3,%0:%1"
40184 : "=d" (tmp), "=d" (a)
40185 : "d" (b), "d" (c), "1" (a));
40190 #endif /* defined(_M68K_DELAY_H) */
40191 --- a/include/asm-m68k/div64.h
40192 +++ b/include/asm-m68k/div64.h
40195 /* n = n / base; return rem; */
40197 +#ifndef CONFIG_COLDFIRE
40198 #define do_div(n, base) ({ \
40200 unsigned long n32[2]; \
40206 +# include <asm-generic/div64.h>
40209 extern uint64_t div64_64(uint64_t dividend, uint64_t divisor);
40210 #endif /* _M68K_DIV64_H */
40211 --- a/include/asm-m68k/dma.h
40212 +++ b/include/asm-m68k/dma.h
40214 #ifndef _M68K_DMA_H
40215 #define _M68K_DMA_H 1
40218 /* it's useless on the m68k, but unfortunately needed by the new
40219 bootmem allocator (but this should do it for this) */
40220 #define MAX_DMA_ADDRESS PAGE_OFFSET
40222 +#ifndef CONFIG_COLDFIRE
40223 #define MAX_DMA_CHANNELS 8
40225 extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
40226 extern void free_dma(unsigned int dmanr); /* release it again */
40228 +#else /* not (defined(CONFIG_MCF5474) || defined(CONFIG_MCF5484) || defined(CONFIG_MCF5475) || defined(CONFIG_MCF5485)) */
40230 +/************************************************
40231 + * Multichannel DMA definitions *
40232 + ************************************************/
40233 +#ifdef CONFIG_MCD_DMA
40234 +#include <asm/MCD_dma.h>
40235 +#include <asm/m5485dma.h>
40237 +struct scatterlist;
40239 +#define MAX_DMA_CHANNELS NCHANNELS
40241 + * identifiers for each initiator/requestor
40243 +#define DMA_ALWAYS (0)
40244 +#define DMA_DSPI_RX (1)
40245 +#define DMA_DSPI_TX (2)
40246 +#define DMA_DREQ0 (3)
40247 +#define DMA_PSC0_RX (4)
40248 +#define DMA_PSC0_TX (5)
40249 +#define DMA_USBEP0 (6)
40250 +#define DMA_USBEP1 (7)
40251 +#define DMA_USBEP2 (8)
40252 +#define DMA_USBEP3 (9)
40253 +#define DMA_PCI_TX (10)
40254 +#define DMA_PCI_RX (11)
40255 +#define DMA_PSC1_RX (12)
40256 +#define DMA_PSC1_TX (13)
40257 +#define DMA_I2C_RX (14)
40258 +#define DMA_I2C_TX (15)
40259 +#define DMA_FEC0_RX (16)
40260 +#define DMA_FEC0_TX (17)
40261 +#define DMA_FEC1_RX (18)
40262 +#define DMA_FEC1_TX (19)
40263 +#define DMA_DREQ1 (20)
40264 +#define DMA_CTM0 (21)
40265 +#define DMA_CTM1 (22)
40266 +#define DMA_CTM2 (23)
40267 +#define DMA_CTM3 (24)
40268 +#define DMA_CTM4 (25)
40269 +#define DMA_CTM5 (26)
40270 +#define DMA_CTM6 (27)
40271 +#define DMA_CTM7 (28)
40272 +#define DMA_USBEP4 (29)
40273 +#define DMA_USBEP5 (30)
40274 +#define DMA_USBEP6 (31)
40275 +#define DMA_PSC2_RX (32)
40276 +#define DMA_PSC2_TX (33)
40277 +#define DMA_PSC3_RX (34)
40278 +#define DMA_PSC3_TX (35)
40279 +#define DMA_FEC_RX(x) ((x == 0) ? DMA_FEC0_RX : DMA_FEC1_RX)
40280 +#define DMA_FEC_TX(x) ((x == 0) ? DMA_FEC0_TX : DMA_FEC1_TX)
40282 +int dma_set_initiator(int);
40283 +unsigned int dma_get_initiator(int);
40284 +void dma_remove_initiator(int);
40285 +int dma_set_channel(int);
40286 +int dma_get_channel(int);
40287 +void dma_remove_channel(int);
40288 +int dma_set_channel_fec(int requestor);
40289 +int dma_connect(int channel, int address);
40290 +int dma_disconnect(int channel);
40291 +void dma_remove_channel_by_number(int channel);
40292 +int dma_init(void);
40294 +#endif /* CONFIG_MCD_DMA */
40296 +extern spinlock_t dma_spin_lock;
40298 +static __inline__ unsigned long claim_dma_lock(void)
40300 + unsigned long flags;
40301 + spin_lock_irqsave(&dma_spin_lock, flags);
40305 +static __inline__ void release_dma_lock(unsigned long flags)
40307 + spin_unlock_irqrestore(&dma_spin_lock, flags);
40312 + * Linux standard DMA stuff
40315 +int request_dma(unsigned int channel, const char * device_id);
40316 +void free_dma(unsigned int channel);
40317 +void enable_dma(unsigned int channel);
40318 +void disable_dma(unsigned int channel);
40319 +int dma_channel_active(unsigned int channel);
40320 +void set_dma_sg(unsigned int channel, struct scatterlist *sg, int nr_sg);
40321 +void set_dma_page(unsigned int channel, char pagenr);
40322 +void set_dma_addr(unsigned int channel, unsigned long physaddr);
40323 +void set_dma_count(unsigned int channel, unsigned long count);
40324 +void set_dma_mode(unsigned int channel, unsigned int mode);
40325 +void set_dma_speed(unsigned int channel, int cycle_ns);
40326 +int get_dma_residue(unsigned int channel);
40328 +#define clear_dma_ff(channel)
40330 +#endif /* not (defined(CONFIG_MCF5474) || defined(CONFIG_MCF5484) || defined(CONFIG_MCF5475) || defined(CONFIG_MCF5485)) */
40333 extern int isa_dma_bridge_buggy;
40335 --- a/include/asm-m68k/elf.h
40336 +++ b/include/asm-m68k/elf.h
40338 #define R_68K_GLOB_DAT 20
40339 #define R_68K_JMP_SLOT 21
40340 #define R_68K_RELATIVE 22
40341 +/* TLS static relocations */
40342 +#define R_68K_TLS_GD32 25
40343 +#define R_68K_TLS_GD16 26
40344 +#define R_68K_TLS_GD8 27
40345 +#define R_68K_TLS_LDM32 28
40346 +#define R_68K_TLS_LDM16 29
40347 +#define R_68K_TLS_LDM8 30
40348 +#define R_68K_TLS_LDO32 31
40349 +#define R_68K_TLS_LDO16 32
40350 +#define R_68K_TLS_LDO8 33
40351 +#define R_68K_TLS_IE32 34
40352 +#define R_68K_TLS_IE16 35
40353 +#define R_68K_TLS_IE8 36
40354 +#define R_68K_TLS_LE32 37
40355 +#define R_68K_TLS_LE16 38
40356 +#define R_68K_TLS_LE8 39
40357 +/* TLS dynamic relocations */
40358 +#define R_68K_TLS_DTPMOD32 40
40359 +#define R_68K_TLS_DTPREL32 41
40360 +#define R_68K_TLS_TPREL32 42
40362 typedef unsigned long elf_greg_t;
40364 @@ -60,7 +80,7 @@ typedef struct user_m68kfp_struct elf_fp
40365 #define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0
40367 #define USE_ELF_CORE_DUMP
40368 -#ifndef CONFIG_SUN3
40369 +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
40370 #define ELF_EXEC_PAGESIZE 4096
40372 #define ELF_EXEC_PAGESIZE 8192
40373 @@ -116,4 +136,35 @@ typedef struct user_m68kfp_struct elf_fp
40375 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
40380 +#ifdef CONFIG_VSYSCALL
40381 +extern unsigned int vdso_enabled;
40383 +#define VDSO_BASE ((unsigned long)current->mm->context.vdso)
40384 +#define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x))
40386 +#define VSYSCALL_AUX_ENT \
40387 + if (vdso_enabled) \
40388 + NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE);
40390 +/* additional pages */
40391 +#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
40393 +struct linux_binprm;
40394 +extern int arch_setup_additional_pages(struct linux_binprm *bprm,
40395 + int executable_stack);
40398 +/* no VSYSCALL_AUX_ENT */
40399 +#define VSYSCALL_AUX_ENT
40402 +#define ARCH_DLINFO \
40404 + /* vsyscall entry */ \
40405 + VSYSCALL_AUX_ENT; \
40409 --- a/include/asm-m68k/fpu.h
40410 +++ b/include/asm-m68k/fpu.h
40412 #define FPSTATESIZE (96/sizeof(unsigned char))
40413 #elif defined(CONFIG_M68KFPU_EMU)
40414 #define FPSTATESIZE (28/sizeof(unsigned char))
40415 +#elif defined(CONFIG_CFV4E)
40416 +#define FPSTATESIZE (16/sizeof(unsigned char))
40417 #elif defined(CONFIG_M68060)
40418 #define FPSTATESIZE (12/sizeof(unsigned char))
40420 --- a/include/asm-m68k/io.h
40421 +++ b/include/asm-m68k/io.h
40422 @@ -204,6 +204,12 @@ static inline u16 __iomem *isa_mtw(unsig
40423 #define isa_outw(val,port) (ISA_SEX ? out_be16(isa_itw(port),(val)) : out_le16(isa_itw(port),(val)))
40424 #define isa_outl(val,port) (ISA_SEX ? out_be32(isa_itl(port),(val)) : out_le32(isa_itl(port),(val)))
40426 +#ifndef CONFIG_COLDFIRE
40427 +#define isa_readb(p) in_8(isa_mtb(p))
40428 +#define isa_readw(p) (ISA_SEX ? in_be16(isa_mtw(p)) : in_le16(isa_mtw(p)))
40429 +#define isa_writeb(val,p) out_8(isa_mtb(p),(val))
40430 +#define isa_writew(val,p) (ISA_SEX ? out_be16(isa_mtw(p),(val)) : out_le16(isa_mtw(p),(val)))
40432 #define isa_readb(p) in_8(isa_mtb((unsigned long)(p)))
40433 #define isa_readw(p) \
40434 (ISA_SEX ? in_be16(isa_mtw((unsigned long)(p))) \
40435 @@ -212,7 +218,7 @@ static inline u16 __iomem *isa_mtw(unsig
40436 #define isa_writew(val,p) \
40437 (ISA_SEX ? out_be16(isa_mtw((unsigned long)(p)),(val)) \
40438 : out_le16(isa_mtw((unsigned long)(p)),(val)))
40441 static inline void isa_delay(void)
40444 @@ -285,6 +291,29 @@ static inline void isa_delay(void)
40445 #endif /* CONFIG_ISA */
40447 #if defined(CONFIG_PCI)
40448 +#ifdef CONFIG_COLDFIRE
40452 +#define outb_p outb
40453 +#define outw_p outw
40454 +#define outl_p outl
40456 +unsigned char pci_inb(long addr);
40457 +unsigned short pci_inw(long addr);
40458 +unsigned long pci_inl(long addr);
40459 +void pci_outb(unsigned char val, long addr);
40460 +void pci_outw(unsigned short val, long addr);
40461 +void pci_outl(unsigned long val, long addr);
40463 +void pci_insb(volatile unsigned char* addr, unsigned char* buf, int len);
40464 +void pci_insw(volatile unsigned short* addr, unsigned short* buf, int len);
40465 +void pci_insl(volatile unsigned long* addr, unsigned long* buf, int len);
40467 +void pci_outsb(volatile unsigned char* addr, const unsigned char* buf, int len);
40468 +void pci_outsw(volatile unsigned short* addr, const unsigned short* buf, int len);
40469 +void pci_outsl(volatile unsigned long* addr, const unsigned long* buf, int len);
40472 #define readl(addr) in_le32(addr)
40473 #define writel(val,addr) out_le32((addr),(val))
40474 @@ -300,12 +329,48 @@ static inline void isa_delay(void)
40475 #define readl_relaxed(addr) readl(addr)
40478 +#ifndef CONFIG_COLDFIRE
40479 #define inb(port) in_8(port)
40480 #define outb(val,port) out_8((port),(val))
40481 #define inw(port) in_le16(port)
40482 #define outw(val,port) out_le16((port),(val))
40483 #define inl(port) in_le32(port)
40484 #define outl(val,port) out_le32((port),(val))
40485 +#define insb(port, buf, nr) \
40486 + raw_insb((u8 *)(port), (u8 *)(buf), (nr))
40487 +#define outsb(port, buf, nr) \
40488 + raw_outsb((u8 *)(port), (u8 *)(buf), (nr))
40489 +#define insw(port, buf, nr) \
40490 + raw_insw_swapw((u16 *)(port), (u16 *)(buf), (nr))
40491 +#define outsw(port, buf, nr) \
40492 + raw_outsw_swapw((u16 *)(port), (u16 *)(buf), (nr))
40493 +#define insl(port, buf, nr) \
40494 + raw_insw_swapw((u16 *)(port), (u16 *)(buf), (nr)<<1)
40495 +#define outsl(port, buf, nr) \
40496 + raw_outsw_swapw((u16 *)(port), (u16 *)(buf), (nr)<<1)
40498 +#define inb(port) pci_inb(port)
40499 +#define outb(val,port) pci_outb((val),(port))
40500 +#define inw(port) pci_inw(port)
40501 +#define outw(val,port) pci_outw((val),(port))
40502 +#define insb(a,b,c) pci_insb((volatile unsigned char*)a,(unsigned char*)b,c)
40503 +#define insw(a,b,c) pci_insw((volatile unsigned short*)a,(const unsigned short*)b,c)
40504 +#define insl(a,b,c) pci_insl((volatile unsigned long*)a,(const unsigned long*)b,c)
40505 +#define outsb(a,b,c) pci_outsb((volatile unsigned char*)a,(const unsigned char*)b,c)
40506 +#define outsw(a,b,c) pci_outsw((volatile unsigned short*)a,(const unsigned short*)b,c)
40507 +#define outsl(a,b,c) pci_outsl((volatile unsigned long*)a,(const unsigned long*)b,c)
40508 +#define inl(port) pci_inl(port)
40509 +#define outl(val,port) pci_outl((val),(port))
40512 +#ifndef CONFIG_COLDFIRE
40513 +#define __raw_readb readb
40514 +#define __raw_readw readw
40515 +#define __raw_readl readl
40516 +#define __raw_writeb writeb
40517 +#define __raw_writew writew
40518 +#define __raw_writel writel
40523 @@ -397,10 +462,12 @@ static inline void memcpy_toio(volatile
40524 __builtin_memcpy((void __force *) dst, src, count);
40527 -#ifndef CONFIG_SUN3
40528 -#define IO_SPACE_LIMIT 0xffff
40530 +#if defined(CONFIG_SUN3)
40531 #define IO_SPACE_LIMIT 0x0fffffff
40532 +#elif defined(CONFIG_COLDFIRE)
40533 +#define IO_SPACE_LIMIT 0xffffffff
40535 +#define IO_SPACE_LIMIT 0xffff
40538 #endif /* __KERNEL__ */
40539 @@ -418,4 +485,31 @@ static inline void memcpy_toio(volatile
40541 #define xlate_dev_kmem_ptr(p) p
40543 +#ifdef CONFIG_COLDFIRE
40544 +#define __raw_readb(addr) \
40545 + ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
40546 +#define __raw_readw(addr) \
40547 + ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
40548 +#define __raw_readl(addr) \
40549 + ({ unsigned long __v = (*(volatile unsigned long *) (addr)); __v; })
40550 +#define __raw_writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b))
40551 +#define __raw_writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
40552 +#define __raw_writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
40554 +#define memset_io(a, b, c) memset((void *)(a), (b), (c))
40555 +#define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c))
40556 +#define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c))
40557 +#if !defined(readb)
40558 +#define readb(addr) \
40559 + ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
40560 +#define readw(addr) \
40561 + ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
40562 +#define readl(addr) \
40563 + ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
40564 +#define writeb(b, addr) (void)((*(volatile unsigned char *) (addr)) = (b))
40565 +#define writew(b, addr) (void)((*(volatile unsigned short *) (addr)) = (b))
40566 +#define writel(b, addr) (void)((*(volatile unsigned int *) (addr)) = (b))
40567 +#endif /* readb */
40568 +#endif /* CONFIG_COLDFIRE */
40571 --- a/include/asm-m68k/irq.h
40572 +++ b/include/asm-m68k/irq.h
40574 * Currently the Atari has 72 and the Amiga 24, but if both are
40575 * supported in the kernel it is better to make room for 72.
40577 -#if defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
40578 +#if defined(CONFIG_COLDFIRE)
40579 +#define SYS_IRQS 256
40580 +#define NR_IRQS SYS_IRQS
40581 +#elif defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
40582 #define NR_IRQS 200
40583 #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC)
40586 +++ b/include/asm-m68k/m5485dma.h
40589 + * m5485dma.h -- ColdFire 547x/548x DMA controller support.
40591 +#ifndef __MCF548X_DMA_H__
40592 +#define __MCF548X_DMA_H__
40595 +/* Register read/write macros */
40596 +#define MCF_DMA_DIPR (*(volatile u32*)(void*)(MCF_MBAR+0x008014))
40597 +#define MCF_DMA_DIMR (*(volatile u32*)(void*)(MCF_MBAR+0x008018))
40598 +#define MCF_DMA_IMCR (*(volatile u32*)(void*)(MCF_MBAR+0x00805C))
40600 +/* Bit definitions and macros for MCF_DMA_DIPR */
40601 +#define MCF_DMA_DIPR_TASK0 (0x00000001)
40602 +#define MCF_DMA_DIPR_TASK1 (0x00000002)
40603 +#define MCF_DMA_DIPR_TASK2 (0x00000004)
40604 +#define MCF_DMA_DIPR_TASK3 (0x00000008)
40605 +#define MCF_DMA_DIPR_TASK4 (0x00000010)
40606 +#define MCF_DMA_DIPR_TASK5 (0x00000020)
40607 +#define MCF_DMA_DIPR_TASK6 (0x00000040)
40608 +#define MCF_DMA_DIPR_TASK7 (0x00000080)
40609 +#define MCF_DMA_DIPR_TASK8 (0x00000100)
40610 +#define MCF_DMA_DIPR_TASK9 (0x00000200)
40611 +#define MCF_DMA_DIPR_TASK10 (0x00000400)
40612 +#define MCF_DMA_DIPR_TASK11 (0x00000800)
40613 +#define MCF_DMA_DIPR_TASK12 (0x00001000)
40614 +#define MCF_DMA_DIPR_TASK13 (0x00002000)
40615 +#define MCF_DMA_DIPR_TASK14 (0x00004000)
40616 +#define MCF_DMA_DIPR_TASK15 (0x00008000)
40618 +/* Bit definitions and macros for MCF_DMA_DIMR */
40619 +#define MCF_DMA_DIMR_TASK0 (0x00000001)
40620 +#define MCF_DMA_DIMR_TASK1 (0x00000002)
40621 +#define MCF_DMA_DIMR_TASK2 (0x00000004)
40622 +#define MCF_DMA_DIMR_TASK3 (0x00000008)
40623 +#define MCF_DMA_DIMR_TASK4 (0x00000010)
40624 +#define MCF_DMA_DIMR_TASK5 (0x00000020)
40625 +#define MCF_DMA_DIMR_TASK6 (0x00000040)
40626 +#define MCF_DMA_DIMR_TASK7 (0x00000080)
40627 +#define MCF_DMA_DIMR_TASK8 (0x00000100)
40628 +#define MCF_DMA_DIMR_TASK9 (0x00000200)
40629 +#define MCF_DMA_DIMR_TASK10 (0x00000400)
40630 +#define MCF_DMA_DIMR_TASK11 (0x00000800)
40631 +#define MCF_DMA_DIMR_TASK12 (0x00001000)
40632 +#define MCF_DMA_DIMR_TASK13 (0x00002000)
40633 +#define MCF_DMA_DIMR_TASK14 (0x00004000)
40634 +#define MCF_DMA_DIMR_TASK15 (0x00008000)
40636 +/* Bit definitions and macros for MCF_DMA_IMCR */
40637 +#define MCF_DMA_IMCR_SRC16(x) (((x)&0x00000003)<<0)
40638 +#define MCF_DMA_IMCR_SRC17(x) (((x)&0x00000003)<<2)
40639 +#define MCF_DMA_IMCR_SRC18(x) (((x)&0x00000003)<<4)
40640 +#define MCF_DMA_IMCR_SRC19(x) (((x)&0x00000003)<<6)
40641 +#define MCF_DMA_IMCR_SRC20(x) (((x)&0x00000003)<<8)
40642 +#define MCF_DMA_IMCR_SRC21(x) (((x)&0x00000003)<<10)
40643 +#define MCF_DMA_IMCR_SRC22(x) (((x)&0x00000003)<<12)
40644 +#define MCF_DMA_IMCR_SRC23(x) (((x)&0x00000003)<<14)
40645 +#define MCF_DMA_IMCR_SRC24(x) (((x)&0x00000003)<<16)
40646 +#define MCF_DMA_IMCR_SRC25(x) (((x)&0x00000003)<<18)
40647 +#define MCF_DMA_IMCR_SRC26(x) (((x)&0x00000003)<<20)
40648 +#define MCF_DMA_IMCR_SRC27(x) (((x)&0x00000003)<<22)
40649 +#define MCF_DMA_IMCR_SRC28(x) (((x)&0x00000003)<<24)
40650 +#define MCF_DMA_IMCR_SRC29(x) (((x)&0x00000003)<<26)
40651 +#define MCF_DMA_IMCR_SRC30(x) (((x)&0x00000003)<<28)
40652 +#define MCF_DMA_IMCR_SRC31(x) (((x)&0x00000003)<<30)
40653 +#define MCF_DMA_IMCR_SRC16_FEC0RX (0x00000000)
40654 +#define MCF_DMA_IMCR_SRC17_FEC0TX (0x00000000)
40655 +#define MCF_DMA_IMCR_SRC18_FEC0RX (0x00000020)
40656 +#define MCF_DMA_IMCR_SRC19_FEC0TX (0x00000080)
40657 +#define MCF_DMA_IMCR_SRC20_FEC1RX (0x00000100)
40658 +#define MCF_DMA_IMCR_SRC21_DREQ1 (0x00000000)
40659 +#define MCF_DMA_IMCR_SRC21_FEC1TX (0x00000400)
40660 +#define MCF_DMA_IMCR_SRC22_FEC0RX (0x00001000)
40661 +#define MCF_DMA_IMCR_SRC23_FEC0TX (0x00004000)
40662 +#define MCF_DMA_IMCR_SRC24_CTM0 (0x00010000)
40663 +#define MCF_DMA_IMCR_SRC24_FEC1RX (0x00020000)
40664 +#define MCF_DMA_IMCR_SRC25_CTM1 (0x00040000)
40665 +#define MCF_DMA_IMCR_SRC25_FEC1TX (0x00080000)
40666 +#define MCF_DMA_IMCR_SRC26_USBEP4 (0x00000000)
40667 +#define MCF_DMA_IMCR_SRC26_CTM2 (0x00200000)
40668 +#define MCF_DMA_IMCR_SRC27_USBEP5 (0x00000000)
40669 +#define MCF_DMA_IMCR_SRC27_CTM3 (0x00800000)
40670 +#define MCF_DMA_IMCR_SRC28_USBEP6 (0x00000000)
40671 +#define MCF_DMA_IMCR_SRC28_CTM4 (0x01000000)
40672 +#define MCF_DMA_IMCR_SRC28_DREQ1 (0x02000000)
40673 +#define MCF_DMA_IMCR_SRC28_PSC2RX (0x03000000)
40674 +#define MCF_DMA_IMCR_SRC29_DREQ1 (0x04000000)
40675 +#define MCF_DMA_IMCR_SRC29_CTM5 (0x08000000)
40676 +#define MCF_DMA_IMCR_SRC29_PSC2TX (0x0C000000)
40677 +#define MCF_DMA_IMCR_SRC30_FEC1RX (0x00000000)
40678 +#define MCF_DMA_IMCR_SRC30_CTM6 (0x10000000)
40679 +#define MCF_DMA_IMCR_SRC30_PSC3RX (0x30000000)
40680 +#define MCF_DMA_IMCR_SRC31_FEC1TX (0x00000000)
40681 +#define MCF_DMA_IMCR_SRC31_CTM7 (0x80000000)
40682 +#define MCF_DMA_IMCR_SRC31_PSC3TX (0xC0000000)
40684 +#endif /* __MCF548X_DMA_H__ */
40686 +++ b/include/asm-m68k/m5485dspi.h
40689 + * File: mcf548x_dspi.h
40690 + * Purpose: Register and bit definitions for the MCF548X
40696 +#ifndef _M5485DSPI_H_
40697 +#define _M5485DSPI_H_
40701 + * DMA Serial Peripheral Interface (DSPI)
40705 +/* Register read/write macros */
40706 +#define MCF_DSPI_DMCR MCF_REG32(0x008A00)
40707 +#define MCF_DSPI_DTCR MCF_REG32(0x008A08)
40708 +#define MCF_DSPI_DCTAR0 MCF_REG32(0x008A0C)
40709 +#define MCF_DSPI_DCTAR1 MCF_REG32(0x008A10)
40710 +#define MCF_DSPI_DCTAR2 MCF_REG32(0x008A14)
40711 +#define MCF_DSPI_DCTAR3 MCF_REG32(0x008A18)
40712 +#define MCF_DSPI_DCTAR4 MCF_REG32(0x008A1C)
40713 +#define MCF_DSPI_DCTAR5 MCF_REG32(0x008A20)
40714 +#define MCF_DSPI_DCTAR6 MCF_REG32(0x008A24)
40715 +#define MCF_DSPI_DCTAR7 MCF_REG32(0x008A28)
40716 +#define MCF_DSPI_DCTARn(x) MCF_REG32(0x008A0C+(x*4))
40717 +#define MCF_DSPI_DSR MCF_REG32(0x008A2C)
40718 +#define MCF_DSPI_DRSER MCF_REG32(0x008A30)
40719 +#define MCF_DSPI_DTFR MCF_REG32(0x008A34)
40720 +#define MCF_DSPI_DRFR MCF_REG32(0x008A38)
40721 +#define MCF_DSPI_DTFDR0 MCF_REG32(0x008A3C)
40722 +#define MCF_DSPI_DTFDR1 MCF_REG32(0x008A40)
40723 +#define MCF_DSPI_DTFDR2 MCF_REG32(0x008A44)
40724 +#define MCF_DSPI_DTFDR3 MCF_REG32(0x008A48)
40725 +#define MCF_DSPI_DTFDRn(x) MCF_REG32(0x008A3C+(x*4))
40726 +#define MCF_DSPI_DRFDR0 MCF_REG32(0x008A7C)
40727 +#define MCF_DSPI_DRFDR1 MCF_REG32(0x008A80)
40728 +#define MCF_DSPI_DRFDR2 MCF_REG32(0x008A84)
40729 +#define MCF_DSPI_DRFDR3 MCF_REG32(0x008A88)
40730 +#define MCF_DSPI_DRFDRn(x) MCF_REG32(0x008A7C+(x*4))
40732 +/* Bit definitions and macros for MCF_DSPI_DMCR */
40733 +#define MCF_DSPI_DMCR_HALT (0x00000001)
40734 +#define MCF_DSPI_DMCR_SMPL_PT(x) (((x)&0x00000003)<<8)
40735 +#define MCF_DSPI_DMCR_CRXF (0x00000400)
40736 +#define MCF_DSPI_DMCR_CTXF (0x00000800)
40737 +#define MCF_DSPI_DMCR_DRXF (0x00001000)
40738 +#define MCF_DSPI_DMCR_DTXF (0x00002000)
40739 +#define MCF_DSPI_DMCR_CSIS0 (0x00010000)
40740 +#define MCF_DSPI_DMCR_CSIS2 (0x00040000)
40741 +#define MCF_DSPI_DMCR_CSIS3 (0x00080000)
40742 +#define MCF_DSPI_DMCR_CSIS5 (0x00200000)
40743 +#define MCF_DSPI_DMCR_ROOE (0x01000000)
40744 +#define MCF_DSPI_DMCR_PCSSE (0x02000000)
40745 +#define MCF_DSPI_DMCR_MTFE (0x04000000)
40746 +#define MCF_DSPI_DMCR_FRZ (0x08000000)
40747 +#define MCF_DSPI_DMCR_DCONF(x) (((x)&0x00000003)<<28)
40748 +#define MCF_DSPI_DMCR_CSCK (0x40000000)
40749 +#define MCF_DSPI_DMCR_MSTR (0x80000000)
40751 +/* Bit definitions and macros for MCF_DSPI_DTCR */
40752 +#define MCF_DSPI_DTCR_SPI_TCNT(x) (((x)&0x0000FFFF)<<16)
40754 +/* Bit definitions and macros for MCF_DSPI_DCTARn */
40755 +#define MCF_DSPI_DCTAR_BR(x) (((x)&0x0000000F)<<0)
40756 +#define MCF_DSPI_DCTAR_DT(x) (((x)&0x0000000F)<<4)
40757 +#define MCF_DSPI_DCTAR_ASC(x) (((x)&0x0000000F)<<8)
40758 +#define MCF_DSPI_DCTAR_CSSCK(x) (((x)&0x0000000F)<<12)
40759 +#define MCF_DSPI_DCTAR_PBR(x) (((x)&0x00000003)<<16)
40760 +#define MCF_DSPI_DCTAR_PDT(x) (((x)&0x00000003)<<18)
40761 +#define MCF_DSPI_DCTAR_PASC(x) (((x)&0x00000003)<<20)
40762 +#define MCF_DSPI_DCTAR_PCSSCK(x) (((x)&0x00000003)<<22)
40763 +#define MCF_DSPI_DCTAR_LSBFE (0x01000000)
40764 +#define MCF_DSPI_DCTAR_CPHA (0x02000000)
40765 +#define MCF_DSPI_DCTAR_CPOL (0x04000000)
40766 +/* #define MCF_DSPI_DCTAR_TRSZ(x) (((x)&0x0000000F)<<27) */
40767 +#define MCF_DSPI_DCTAR_FMSZ(x) (((x)&0x0000000F)<<27)
40768 +#define MCF_DSPI_DCTAR_PCSSCK_1CLK (0x00000000)
40769 +#define MCF_DSPI_DCTAR_PCSSCK_3CLK (0x00400000)
40770 +#define MCF_DSPI_DCTAR_PCSSCK_5CLK (0x00800000)
40771 +#define MCF_DSPI_DCTAR_PCSSCK_7CLK (0x00A00000)
40772 +#define MCF_DSPI_DCTAR_PASC_1CLK (0x00000000)
40773 +#define MCF_DSPI_DCTAR_PASC_3CLK (0x00100000)
40774 +#define MCF_DSPI_DCTAR_PASC_5CLK (0x00200000)
40775 +#define MCF_DSPI_DCTAR_PASC_7CLK (0x00300000)
40776 +#define MCF_DSPI_DCTAR_PDT_1CLK (0x00000000)
40777 +#define MCF_DSPI_DCTAR_PDT_3CLK (0x00040000)
40778 +#define MCF_DSPI_DCTAR_PDT_5CLK (0x00080000)
40779 +#define MCF_DSPI_DCTAR_PDT_7CLK (0x000A0000)
40780 +#define MCF_DSPI_DCTAR_PBR_1CLK (0x00000000)
40781 +#define MCF_DSPI_DCTAR_PBR_3CLK (0x00010000)
40782 +#define MCF_DSPI_DCTAR_PBR_5CLK (0x00020000)
40783 +#define MCF_DSPI_DCTAR_PBR_7CLK (0x00030000)
40785 +/* Bit definitions and macros for MCF_DSPI_DSR */
40786 +#define MCF_DSPI_DSR_RXPTR(x) (((x)&0x0000000F)<<0)
40787 +#define MCF_DSPI_DSR_RXCTR(x) (((x)&0x0000000F)<<4)
40788 +#define MCF_DSPI_DSR_TXPTR(x) (((x)&0x0000000F)<<8)
40789 +#define MCF_DSPI_DSR_TXCTR(x) (((x)&0x0000000F)<<12)
40790 +#define MCF_DSPI_DSR_RFDF (0x00020000)
40791 +#define MCF_DSPI_DSR_RFOF (0x00080000)
40792 +#define MCF_DSPI_DSR_TFFF (0x02000000)
40793 +#define MCF_DSPI_DSR_TFUF (0x08000000)
40794 +#define MCF_DSPI_DSR_EOQF (0x10000000)
40795 +#define MCF_DSPI_DSR_TXRXS (0x40000000)
40796 +#define MCF_DSPI_DSR_TCF (0x80000000)
40798 +/* Bit definitions and macros for MCF_DSPI_DRSER */
40799 +#define MCF_DSPI_DRSER_RFDFS (0x00010000)
40800 +#define MCF_DSPI_DRSER_RFDFE (0x00020000)
40801 +#define MCF_DSPI_DRSER_RFOFE (0x00080000)
40802 +#define MCF_DSPI_DRSER_TFFFS (0x01000000)
40803 +#define MCF_DSPI_DRSER_TFFFE (0x02000000)
40804 +#define MCF_DSPI_DRSER_TFUFE (0x08000000)
40805 +#define MCF_DSPI_DRSER_EOQFE (0x10000000)
40806 +#define MCF_DSPI_DRSER_TCFE (0x80000000)
40808 +/* Bit definitions and macros for MCF_DSPI_DTFR */
40809 +#define MCF_DSPI_DTFR_TXDATA(x) (((x)&0x0000FFFF)<<0)
40810 +#define MCF_DSPI_DTFR_CS0 (0x00010000)
40811 +#define MCF_DSPI_DTFR_CS2 (0x00040000)
40812 +#define MCF_DSPI_DTFR_CS3 (0x00080000)
40813 +#define MCF_DSPI_DTFR_CS5 (0x00200000)
40814 +#define MCF_DSPI_DTFR_CTCNT (0x04000000)
40815 +#define MCF_DSPI_DTFR_EOQ (0x08000000)
40816 +#define MCF_DSPI_DTFR_CTAS(x) (((x)&0x00000007)<<28)
40817 +#define MCF_DSPI_DTFR_CONT (0x80000000)
40819 +/* Bit definitions and macros for MCF_DSPI_DRFR */
40820 +#define MCF_DSPI_DRFR_RXDATA(x) (((x)&0x0000FFFF)<<0)
40822 +/* Bit definitions and macros for MCF_DSPI_DTFDRn */
40823 +#define MCF_DSPI_DTFDRn_TXDATA(x) (((x)&0x0000FFFF)<<0)
40824 +#define MCF_DSPI_DTFDRn_TXCMD(x) (((x)&0x0000FFFF)<<16)
40826 +/* Bit definitions and macros for MCF_DSPI_DRFDRn */
40827 +#define MCF_DSPI_DRFDRn_RXDATA(x) (((x)&0x0000FFFF)<<0)
40829 +/********************************************************************/
40831 +#endif /* _M5485DSPI_H_ */
40833 +++ b/include/asm-m68k/m5485gpio.h
40836 + * File: mcf548x_gpio.h
40837 + * Purpose: Register and bit definitions for the MCF548X
40843 +#ifndef _M5485GPIO_H_
40844 +#define _M5485GPIO_H_
40846 +/*********************************************************************
40848 +* General Purpose I/O (GPIO)
40850 +*********************************************************************/
40852 +/* Register read/write macros */
40853 +#define MCF_GPIO_PODR_FBCTL MCF_REG08(0x000A00)
40854 +#define MCF_GPIO_PODR_FBCS MCF_REG08(0x000A01)
40855 +#define MCF_GPIO_PODR_DMA MCF_REG08(0x000A02)
40856 +#define MCF_GPIO_PODR_FEC0H MCF_REG08(0x000A04)
40857 +#define MCF_GPIO_PODR_FEC0L MCF_REG08(0x000A05)
40858 +#define MCF_GPIO_PODR_FEC1H MCF_REG08(0x000A06)
40859 +#define MCF_GPIO_PODR_FEC1L MCF_REG08(0x000A07)
40860 +#define MCF_GPIO_PODR_FECI2C MCF_REG08(0x000A08)
40861 +#define MCF_GPIO_PODR_PCIBG MCF_REG08(0x000A09)
40862 +#define MCF_GPIO_PODR_PCIBR MCF_REG08(0x000A0A)
40863 +#define MCF_GPIO_PODR_PSC3PSC2 MCF_REG08(0x000A0C)
40864 +#define MCF_GPIO_PODR_PSC1PSC0 MCF_REG08(0x000A0D)
40865 +#define MCF_GPIO_PODR_DSPI MCF_REG08(0x000A0E)
40866 +#define MCF_GPIO_PDDR_FBCTL MCF_REG08(0x000A10)
40867 +#define MCF_GPIO_PDDR_FBCS MCF_REG08(0x000A11)
40868 +#define MCF_GPIO_PDDR_DMA MCF_REG08(0x000A12)
40869 +#define MCF_GPIO_PDDR_FEC0H MCF_REG08(0x000A14)
40870 +#define MCF_GPIO_PDDR_FEC0L MCF_REG08(0x000A15)
40871 +#define MCF_GPIO_PDDR_FEC1H MCF_REG08(0x000A16)
40872 +#define MCF_GPIO_PDDR_FEC1L MCF_REG08(0x000A17)
40873 +#define MCF_GPIO_PDDR_FECI2C MCF_REG08(0x000A18)
40874 +#define MCF_GPIO_PDDR_PCIBG MCF_REG08(0x000A19)
40875 +#define MCF_GPIO_PDDR_PCIBR MCF_REG08(0x000A1A)
40876 +#define MCF_GPIO_PDDR_PSC3PSC2 MCF_REG08(0x000A1C)
40877 +#define MCF_GPIO_PDDR_PSC1PSC0 MCF_REG08(0x000A1D)
40878 +#define MCF_GPIO_PDDR_DSPI MCF_REG08(0x000A1E)
40879 +#define MCF_GPIO_PPDSDR_FBCTL MCF_REG08(0x000A20)
40880 +#define MCF_GPIO_PPDSDR_FBCS MCF_REG08(0x000A21)
40881 +#define MCF_GPIO_PPDSDR_DMA MCF_REG08(0x000A22)
40882 +#define MCF_GPIO_PPDSDR_FEC0H MCF_REG08(0x000A24)
40883 +#define MCF_GPIO_PPDSDR_FEC0L MCF_REG08(0x000A25)
40884 +#define MCF_GPIO_PPDSDR_FEC1H MCF_REG08(0x000A26)
40885 +#define MCF_GPIO_PPDSDR_FEC1L MCF_REG08(0x000A27)
40886 +#define MCF_GPIO_PPDSDR_FECI2C MCF_REG08(0x000A28)
40887 +#define MCF_GPIO_PPDSDR_PCIBG MCF_REG08(0x000A29)
40888 +#define MCF_GPIO_PPDSDR_PCIBR MCF_REG08(0x000A2A)
40889 +#define MCF_GPIO_PPDSDR_PSC3PSC2 MCF_REG08(0x000A2C)
40890 +#define MCF_GPIO_PPDSDR_PSC1PSC0 MCF_REG08(0x000A2D)
40891 +#define MCF_GPIO_PPDSDR_DSPI MCF_REG08(0x000A2E)
40892 +#define MCF_GPIO_PCLRR_FBCTL MCF_REG08(0x000A30)
40893 +#define MCF_GPIO_PCLRR_FBCS MCF_REG08(0x000A31)
40894 +#define MCF_GPIO_PCLRR_DMA MCF_REG08(0x000A32)
40895 +#define MCF_GPIO_PCLRR_FEC0H MCF_REG08(0x000A34)
40896 +#define MCF_GPIO_PCLRR_FEC0L MCF_REG08(0x000A35)
40897 +#define MCF_GPIO_PCLRR_FEC1H MCF_REG08(0x000A36)
40898 +#define MCF_GPIO_PCLRR_FEC1L MCF_REG08(0x000A37)
40899 +#define MCF_GPIO_PCLRR_FECI2C MCF_REG08(0x000A38)
40900 +#define MCF_GPIO_PCLRR_PCIBG MCF_REG08(0x000A39)
40901 +#define MCF_GPIO_PCLRR_PCIBR MCF_REG08(0x000A3A)
40902 +#define MCF_GPIO_PCLRR_PSC3PSC2 MCF_REG08(0x000A3C)
40903 +#define MCF_GPIO_PCLRR_PSC1PSC0 MCF_REG08(0x000A3D)
40904 +#define MCF_GPIO_PCLRR_DSPI MCF_REG08(0x000A3E)
40905 +#define MCF_GPIO_PAR_FBCTL MCF_REG16(0x000A40)
40906 +#define MCF_GPIO_PAR_FBCS MCF_REG08(0x000A42)
40907 +#define MCF_GPIO_PAR_DMA MCF_REG08(0x000A43)
40908 +#define MCF_GPIO_PAR_FECI2CIRQ MCF_REG16(0x000A44)
40909 +#define MCF_GPIO_PAR_PCIBG MCF_REG16(0x000A48)
40910 +#define MCF_GPIO_PAR_PCIBR MCF_REG16(0x000A4A)
40911 +#define MCF_GPIO_PAR_PSC3 MCF_REG08(0x000A4C)
40912 +#define MCF_GPIO_PAR_PSC2 MCF_REG08(0x000A4D)
40913 +#define MCF_GPIO_PAR_PSC1 MCF_REG08(0x000A4E)
40914 +#define MCF_GPIO_PAR_PSC0 MCF_REG08(0x000A4F)
40915 +#define MCF_GPIO_PAR_DSPI MCF_REG16(0x000A50)
40916 +#define MCF_GPIO_PAR_TIMER MCF_REG08(0x000A52)
40918 +/* Bit definitions and macros for MCF_GPIO_PODR_FBCTL */
40919 +#define MCF_GPIO_PODR_FBCTL_PODRFBCTL0 (0x01)
40920 +#define MCF_GPIO_PODR_FBCTL_PODRFBCTL1 (0x02)
40921 +#define MCF_GPIO_PODR_FBCTL_PODRFBCTL2 (0x04)
40922 +#define MCF_GPIO_PODR_FBCTL_PODRFBCTL3 (0x08)
40923 +#define MCF_GPIO_PODR_FBCTL_PODRFBCTL4 (0x10)
40924 +#define MCF_GPIO_PODR_FBCTL_PODRFBCTL5 (0x20)
40925 +#define MCF_GPIO_PODR_FBCTL_PODRFBCTL6 (0x40)
40926 +#define MCF_GPIO_PODR_FBCTL_PODRFBCTL7 (0x80)
40928 +/* Bit definitions and macros for MCF_GPIO_PODR_FBCS */
40929 +#define MCF_GPIO_PODR_FBCS_PODRFBCS1 (0x02)
40930 +#define MCF_GPIO_PODR_FBCS_PODRFBCS2 (0x04)
40931 +#define MCF_GPIO_PODR_FBCS_PODRFBCS3 (0x08)
40932 +#define MCF_GPIO_PODR_FBCS_PODRFBCS4 (0x10)
40933 +#define MCF_GPIO_PODR_FBCS_PODRFBCS5 (0x20)
40935 +/* Bit definitions and macros for MCF_GPIO_PODR_DMA */
40936 +#define MCF_GPIO_PODR_DMA_PODRDMA0 (0x01)
40937 +#define MCF_GPIO_PODR_DMA_PODRDMA1 (0x02)
40938 +#define MCF_GPIO_PODR_DMA_PODRDMA2 (0x04)
40939 +#define MCF_GPIO_PODR_DMA_PODRDMA3 (0x08)
40941 +/* Bit definitions and macros for MCF_GPIO_PODR_FEC0H */
40942 +#define MCF_GPIO_PODR_FEC0H_PODRFEC0H0 (0x01)
40943 +#define MCF_GPIO_PODR_FEC0H_PODRFEC0H1 (0x02)
40944 +#define MCF_GPIO_PODR_FEC0H_PODRFEC0H2 (0x04)
40945 +#define MCF_GPIO_PODR_FEC0H_PODRFEC0H3 (0x08)
40946 +#define MCF_GPIO_PODR_FEC0H_PODRFEC0H4 (0x10)
40947 +#define MCF_GPIO_PODR_FEC0H_PODRFEC0H5 (0x20)
40948 +#define MCF_GPIO_PODR_FEC0H_PODRFEC0H6 (0x40)
40949 +#define MCF_GPIO_PODR_FEC0H_PODRFEC0H7 (0x80)
40951 +/* Bit definitions and macros for MCF_GPIO_PODR_FEC0L */
40952 +#define MCF_GPIO_PODR_FEC0L_PODRFEC0L0 (0x01)
40953 +#define MCF_GPIO_PODR_FEC0L_PODRFEC0L1 (0x02)
40954 +#define MCF_GPIO_PODR_FEC0L_PODRFEC0L2 (0x04)
40955 +#define MCF_GPIO_PODR_FEC0L_PODRFEC0L3 (0x08)
40956 +#define MCF_GPIO_PODR_FEC0L_PODRFEC0L4 (0x10)
40957 +#define MCF_GPIO_PODR_FEC0L_PODRFEC0L5 (0x20)
40958 +#define MCF_GPIO_PODR_FEC0L_PODRFEC0L6 (0x40)
40959 +#define MCF_GPIO_PODR_FEC0L_PODRFEC0L7 (0x80)
40961 +/* Bit definitions and macros for MCF_GPIO_PODR_FEC1H */
40962 +#define MCF_GPIO_PODR_FEC1H_PODRFEC1H0 (0x01)
40963 +#define MCF_GPIO_PODR_FEC1H_PODRFEC1H1 (0x02)
40964 +#define MCF_GPIO_PODR_FEC1H_PODRFEC1H2 (0x04)
40965 +#define MCF_GPIO_PODR_FEC1H_PODRFEC1H3 (0x08)
40966 +#define MCF_GPIO_PODR_FEC1H_PODRFEC1H4 (0x10)
40967 +#define MCF_GPIO_PODR_FEC1H_PODRFEC1H5 (0x20)
40968 +#define MCF_GPIO_PODR_FEC1H_PODRFEC1H6 (0x40)
40969 +#define MCF_GPIO_PODR_FEC1H_PODRFEC1H7 (0x80)
40971 +/* Bit definitions and macros for MCF_GPIO_PODR_FEC1L */
40972 +#define MCF_GPIO_PODR_FEC1L_PODRFEC1L0 (0x01)
40973 +#define MCF_GPIO_PODR_FEC1L_PODRFEC1L1 (0x02)
40974 +#define MCF_GPIO_PODR_FEC1L_PODRFEC1L2 (0x04)
40975 +#define MCF_GPIO_PODR_FEC1L_PODRFEC1L3 (0x08)
40976 +#define MCF_GPIO_PODR_FEC1L_PODRFEC1L4 (0x10)
40977 +#define MCF_GPIO_PODR_FEC1L_PODRFEC1L5 (0x20)
40978 +#define MCF_GPIO_PODR_FEC1L_PODRFEC1L6 (0x40)
40979 +#define MCF_GPIO_PODR_FEC1L_PODRFEC1L7 (0x80)
40981 +/* Bit definitions and macros for MCF_GPIO_PODR_FECI2C */
40982 +#define MCF_GPIO_PODR_FECI2C_PODRFECI2C0 (0x01)
40983 +#define MCF_GPIO_PODR_FECI2C_PODRFECI2C1 (0x02)
40984 +#define MCF_GPIO_PODR_FECI2C_PODRFECI2C2 (0x04)
40985 +#define MCF_GPIO_PODR_FECI2C_PODRFECI2C3 (0x08)
40987 +/* Bit definitions and macros for MCF_GPIO_PODR_PCIBG */
40988 +#define MCF_GPIO_PODR_PCIBG_PODRPCIBG0 (0x01)
40989 +#define MCF_GPIO_PODR_PCIBG_PODRPCIBG1 (0x02)
40990 +#define MCF_GPIO_PODR_PCIBG_PODRPCIBG2 (0x04)
40991 +#define MCF_GPIO_PODR_PCIBG_PODRPCIBG3 (0x08)
40992 +#define MCF_GPIO_PODR_PCIBG_PODRPCIBG4 (0x10)
40994 +/* Bit definitions and macros for MCF_GPIO_PODR_PCIBR */
40995 +#define MCF_GPIO_PODR_PCIBR_PODRPCIBR0 (0x01)
40996 +#define MCF_GPIO_PODR_PCIBR_PODRPCIBR1 (0x02)
40997 +#define MCF_GPIO_PODR_PCIBR_PODRPCIBR2 (0x04)
40998 +#define MCF_GPIO_PODR_PCIBR_PODRPCIBR3 (0x08)
40999 +#define MCF_GPIO_PODR_PCIBR_PODRPCIBR4 (0x10)
41001 +/* Bit definitions and macros for MCF_GPIO_PODR_PSC3PSC2 */
41002 +#define MCF_GPIO_PODR_PSC3PSC2_PODRPSC3PSC20 (0x01)
41003 +#define MCF_GPIO_PODR_PSC3PSC2_PODRPSC3PSC21 (0x02)
41004 +#define MCF_GPIO_PODR_PSC3PSC2_PODRPSC3PSC22 (0x04)
41005 +#define MCF_GPIO_PODR_PSC3PSC2_PODRPSC3PSC23 (0x08)
41006 +#define MCF_GPIO_PODR_PSC3PSC2_PODRPSC3PSC24 (0x10)
41007 +#define MCF_GPIO_PODR_PSC3PSC2_PODRPSC3PSC25 (0x20)
41008 +#define MCF_GPIO_PODR_PSC3PSC2_PODRPSC3PSC26 (0x40)
41009 +#define MCF_GPIO_PODR_PSC3PSC2_PODRPSC3PSC27 (0x80)
41011 +/* Bit definitions and macros for MCF_GPIO_PODR_PSC1PSC0 */
41012 +#define MCF_GPIO_PODR_PSC1PSC0_PODRPSC1PSC00 (0x01)
41013 +#define MCF_GPIO_PODR_PSC1PSC0_PODRPSC1PSC01 (0x02)
41014 +#define MCF_GPIO_PODR_PSC1PSC0_PODRPSC1PSC02 (0x04)
41015 +#define MCF_GPIO_PODR_PSC1PSC0_PODRPSC1PSC03 (0x08)
41016 +#define MCF_GPIO_PODR_PSC1PSC0_PODRPSC1PSC04 (0x10)
41017 +#define MCF_GPIO_PODR_PSC1PSC0_PODRPSC1PSC05 (0x20)
41018 +#define MCF_GPIO_PODR_PSC1PSC0_PODRPSC1PSC06 (0x40)
41019 +#define MCF_GPIO_PODR_PSC1PSC0_PODRPSC1PSC07 (0x80)
41021 +/* Bit definitions and macros for MCF_GPIO_PODR_DSPI */
41022 +#define MCF_GPIO_PODR_DSPI_PODRDSPI0 (0x01)
41023 +#define MCF_GPIO_PODR_DSPI_PODRDSPI1 (0x02)
41024 +#define MCF_GPIO_PODR_DSPI_PODRDSPI2 (0x04)
41025 +#define MCF_GPIO_PODR_DSPI_PODRDSPI3 (0x08)
41026 +#define MCF_GPIO_PODR_DSPI_PODRDSPI4 (0x10)
41027 +#define MCF_GPIO_PODR_DSPI_PODRDSPI5 (0x20)
41028 +#define MCF_GPIO_PODR_DSPI_PODRDSPI6 (0x40)
41030 +/* Bit definitions and macros for MCF_GPIO_PDDR_FBCTL */
41031 +#define MCF_GPIO_PDDR_FBCTL_PDDRFBCTL0 (0x01)
41032 +#define MCF_GPIO_PDDR_FBCTL_PDDRFBCTL1 (0x02)
41033 +#define MCF_GPIO_PDDR_FBCTL_PDDRFBCTL2 (0x04)
41034 +#define MCF_GPIO_PDDR_FBCTL_PDDRFBCTL3 (0x08)
41035 +#define MCF_GPIO_PDDR_FBCTL_PDDRFBCTL4 (0x10)
41036 +#define MCF_GPIO_PDDR_FBCTL_PDDRFBCTL5 (0x20)
41037 +#define MCF_GPIO_PDDR_FBCTL_PDDRFBCTL6 (0x40)
41038 +#define MCF_GPIO_PDDR_FBCTL_PDDRFBCTL7 (0x80)
41040 +/* Bit definitions and macros for MCF_GPIO_PDDR_FBCS */
41041 +#define MCF_GPIO_PDDR_FBCS_PDDRFBCS1 (0x02)
41042 +#define MCF_GPIO_PDDR_FBCS_PDDRFBCS2 (0x04)
41043 +#define MCF_GPIO_PDDR_FBCS_PDDRFBCS3 (0x08)
41044 +#define MCF_GPIO_PDDR_FBCS_PDDRFBCS4 (0x10)
41045 +#define MCF_GPIO_PDDR_FBCS_PDDRFBCS5 (0x20)
41047 +/* Bit definitions and macros for MCF_GPIO_PDDR_DMA */
41048 +#define MCF_GPIO_PDDR_DMA_PDDRDMA0 (0x01)
41049 +#define MCF_GPIO_PDDR_DMA_PDDRDMA1 (0x02)
41050 +#define MCF_GPIO_PDDR_DMA_PDDRDMA2 (0x04)
41051 +#define MCF_GPIO_PDDR_DMA_PDDRDMA3 (0x08)
41053 +/* Bit definitions and macros for MCF_GPIO_PDDR_FEC0H */
41054 +#define MCF_GPIO_PDDR_FEC0H_PDDRFEC0H0 (0x01)
41055 +#define MCF_GPIO_PDDR_FEC0H_PDDRFEC0H1 (0x02)
41056 +#define MCF_GPIO_PDDR_FEC0H_PDDRFEC0H2 (0x04)
41057 +#define MCF_GPIO_PDDR_FEC0H_PDDRFEC0H3 (0x08)
41058 +#define MCF_GPIO_PDDR_FEC0H_PDDRFEC0H4 (0x10)
41059 +#define MCF_GPIO_PDDR_FEC0H_PDDRFEC0H5 (0x20)
41060 +#define MCF_GPIO_PDDR_FEC0H_PDDRFEC0H6 (0x40)
41061 +#define MCF_GPIO_PDDR_FEC0H_PDDRFEC0H7 (0x80)
41063 +/* Bit definitions and macros for MCF_GPIO_PDDR_FEC0L */
41064 +#define MCF_GPIO_PDDR_FEC0L_PDDRFEC0L0 (0x01)
41065 +#define MCF_GPIO_PDDR_FEC0L_PDDRFEC0L1 (0x02)
41066 +#define MCF_GPIO_PDDR_FEC0L_PDDRFEC0L2 (0x04)
41067 +#define MCF_GPIO_PDDR_FEC0L_PDDRFEC0L3 (0x08)
41068 +#define MCF_GPIO_PDDR_FEC0L_PDDRFEC0L4 (0x10)
41069 +#define MCF_GPIO_PDDR_FEC0L_PDDRFEC0L5 (0x20)
41070 +#define MCF_GPIO_PDDR_FEC0L_PDDRFEC0L6 (0x40)
41071 +#define MCF_GPIO_PDDR_FEC0L_PDDRFEC0L7 (0x80)
41073 +/* Bit definitions and macros for MCF_GPIO_PDDR_FEC1H */
41074 +#define MCF_GPIO_PDDR_FEC1H_PDDRFEC1H0 (0x01)
41075 +#define MCF_GPIO_PDDR_FEC1H_PDDRFEC1H1 (0x02)
41076 +#define MCF_GPIO_PDDR_FEC1H_PDDRFEC1H2 (0x04)
41077 +#define MCF_GPIO_PDDR_FEC1H_PDDRFEC1H3 (0x08)
41078 +#define MCF_GPIO_PDDR_FEC1H_PDDRFEC1H4 (0x10)
41079 +#define MCF_GPIO_PDDR_FEC1H_PDDRFEC1H5 (0x20)
41080 +#define MCF_GPIO_PDDR_FEC1H_PDDRFEC1H6 (0x40)
41081 +#define MCF_GPIO_PDDR_FEC1H_PDDRFEC1H7 (0x80)
41083 +/* Bit definitions and macros for MCF_GPIO_PDDR_FEC1L */
41084 +#define MCF_GPIO_PDDR_FEC1L_PDDRFEC1L0 (0x01)
41085 +#define MCF_GPIO_PDDR_FEC1L_PDDRFEC1L1 (0x02)
41086 +#define MCF_GPIO_PDDR_FEC1L_PDDRFEC1L2 (0x04)
41087 +#define MCF_GPIO_PDDR_FEC1L_PDDRFEC1L3 (0x08)
41088 +#define MCF_GPIO_PDDR_FEC1L_PDDRFEC1L4 (0x10)
41089 +#define MCF_GPIO_PDDR_FEC1L_PDDRFEC1L5 (0x20)
41090 +#define MCF_GPIO_PDDR_FEC1L_PDDRFEC1L6 (0x40)
41091 +#define MCF_GPIO_PDDR_FEC1L_PDDRFEC1L7 (0x80)
41093 +/* Bit definitions and macros for MCF_GPIO_PDDR_FECI2C */
41094 +#define MCF_GPIO_PDDR_FECI2C_PDDRFECI2C0 (0x01)
41095 +#define MCF_GPIO_PDDR_FECI2C_PDDRFECI2C1 (0x02)
41096 +#define MCF_GPIO_PDDR_FECI2C_PDDRFECI2C2 (0x04)
41097 +#define MCF_GPIO_PDDR_FECI2C_PDDRFECI2C3 (0x08)
41099 +/* Bit definitions and macros for MCF_GPIO_PDDR_PCIBG */
41100 +#define MCF_GPIO_PDDR_PCIBG_PDDRPCIBG0 (0x01)
41101 +#define MCF_GPIO_PDDR_PCIBG_PDDRPCIBG1 (0x02)
41102 +#define MCF_GPIO_PDDR_PCIBG_PDDRPCIBG2 (0x04)
41103 +#define MCF_GPIO_PDDR_PCIBG_PDDRPCIBG3 (0x08)
41104 +#define MCF_GPIO_PDDR_PCIBG_PDDRPCIBG4 (0x10)
41106 +/* Bit definitions and macros for MCF_GPIO_PDDR_PCIBR */
41107 +#define MCF_GPIO_PDDR_PCIBR_PDDRPCIBR0 (0x01)
41108 +#define MCF_GPIO_PDDR_PCIBR_PDDRPCIBR1 (0x02)
41109 +#define MCF_GPIO_PDDR_PCIBR_PDDRPCIBR2 (0x04)
41110 +#define MCF_GPIO_PDDR_PCIBR_PDDRPCIBR3 (0x08)
41111 +#define MCF_GPIO_PDDR_PCIBR_PDDRPCIBR4 (0x10)
41113 +/* Bit definitions and macros for MCF_GPIO_PDDR_PSC3PSC2 */
41114 +#define MCF_GPIO_PDDR_PSC3PSC2_PDDRPSC3PSC20 (0x01)
41115 +#define MCF_GPIO_PDDR_PSC3PSC2_PDDRPSC3PSC21 (0x02)
41116 +#define MCF_GPIO_PDDR_PSC3PSC2_PDDRPSC3PSC22 (0x04)
41117 +#define MCF_GPIO_PDDR_PSC3PSC2_PDDRPSC3PSC23 (0x08)
41118 +#define MCF_GPIO_PDDR_PSC3PSC2_PDDRPSC3PSC24 (0x10)
41119 +#define MCF_GPIO_PDDR_PSC3PSC2_PDDRPSC3PSC25 (0x20)
41120 +#define MCF_GPIO_PDDR_PSC3PSC2_PDDRPSC3PSC26 (0x40)
41121 +#define MCF_GPIO_PDDR_PSC3PSC2_PDDRPSC3PSC27 (0x80)
41123 +/* Bit definitions and macros for MCF_GPIO_PDDR_PSC1PSC0 */
41124 +#define MCF_GPIO_PDDR_PSC1PSC0_PDDRPSC1PSC00 (0x01)
41125 +#define MCF_GPIO_PDDR_PSC1PSC0_PDDRPSC1PSC01 (0x02)
41126 +#define MCF_GPIO_PDDR_PSC1PSC0_PDDRPSC1PSC02 (0x04)
41127 +#define MCF_GPIO_PDDR_PSC1PSC0_PDDRPSC1PSC03 (0x08)
41128 +#define MCF_GPIO_PDDR_PSC1PSC0_PDDRPSC1PSC04 (0x10)
41129 +#define MCF_GPIO_PDDR_PSC1PSC0_PDDRPSC1PSC05 (0x20)
41130 +#define MCF_GPIO_PDDR_PSC1PSC0_PDDRPSC1PSC06 (0x40)
41131 +#define MCF_GPIO_PDDR_PSC1PSC0_PDDRPSC1PSC07 (0x80)
41133 +/* Bit definitions and macros for MCF_GPIO_PDDR_DSPI */
41134 +#define MCF_GPIO_PDDR_DSPI_PDDRDSPI0 (0x01)
41135 +#define MCF_GPIO_PDDR_DSPI_PDDRDSPI1 (0x02)
41136 +#define MCF_GPIO_PDDR_DSPI_PDDRDSPI2 (0x04)
41137 +#define MCF_GPIO_PDDR_DSPI_PDDRDSPI3 (0x08)
41138 +#define MCF_GPIO_PDDR_DSPI_PDDRDSPI4 (0x10)
41139 +#define MCF_GPIO_PDDR_DSPI_PDDRDSPI5 (0x20)
41140 +#define MCF_GPIO_PDDR_DSPI_PDDRDSPI6 (0x40)
41142 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FBCTL */
41143 +#define MCF_GPIO_PPDSDR_FBCTL_PPDSDRFBCTL0 (0x01)
41144 +#define MCF_GPIO_PPDSDR_FBCTL_PPDSDRFBCTL1 (0x02)
41145 +#define MCF_GPIO_PPDSDR_FBCTL_PPDSDRFBCTL2 (0x04)
41146 +#define MCF_GPIO_PPDSDR_FBCTL_PPDSDRFBCTL3 (0x08)
41147 +#define MCF_GPIO_PPDSDR_FBCTL_PPDSDRFBCTL4 (0x10)
41148 +#define MCF_GPIO_PPDSDR_FBCTL_PPDSDRFBCTL5 (0x20)
41149 +#define MCF_GPIO_PPDSDR_FBCTL_PPDSDRFBCTL6 (0x40)
41150 +#define MCF_GPIO_PPDSDR_FBCTL_PPDSDRFBCTL7 (0x80)
41152 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FBCS */
41153 +#define MCF_GPIO_PPDSDR_FBCS_PPDSDRFBCS1 (0x02)
41154 +#define MCF_GPIO_PPDSDR_FBCS_PPDSDRFBCS2 (0x04)
41155 +#define MCF_GPIO_PPDSDR_FBCS_PPDSDRFBCS3 (0x08)
41156 +#define MCF_GPIO_PPDSDR_FBCS_PPDSDRFBCS4 (0x10)
41157 +#define MCF_GPIO_PPDSDR_FBCS_PPDSDRFBCS5 (0x20)
41159 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_DMA */
41160 +#define MCF_GPIO_PPDSDR_DMA_PPDSDRDMA0 (0x01)
41161 +#define MCF_GPIO_PPDSDR_DMA_PPDSDRDMA1 (0x02)
41162 +#define MCF_GPIO_PPDSDR_DMA_PPDSDRDMA2 (0x04)
41163 +#define MCF_GPIO_PPDSDR_DMA_PPDSDRDMA3 (0x08)
41165 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FEC0H */
41166 +#define MCF_GPIO_PPDSDR_FEC0H_PPDSDRFEC0H0 (0x01)
41167 +#define MCF_GPIO_PPDSDR_FEC0H_PPDSDRFEC0H1 (0x02)
41168 +#define MCF_GPIO_PPDSDR_FEC0H_PPDSDRFEC0H2 (0x04)
41169 +#define MCF_GPIO_PPDSDR_FEC0H_PPDSDRFEC0H3 (0x08)
41170 +#define MCF_GPIO_PPDSDR_FEC0H_PPDSDRFEC0H4 (0x10)
41171 +#define MCF_GPIO_PPDSDR_FEC0H_PPDSDRFEC0H5 (0x20)
41172 +#define MCF_GPIO_PPDSDR_FEC0H_PPDSDRFEC0H6 (0x40)
41173 +#define MCF_GPIO_PPDSDR_FEC0H_PPDSDRFEC0H7 (0x80)
41175 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FEC0L */
41176 +#define MCF_GPIO_PPDSDR_FEC0L_PPDSDRFEC0L0 (0x01)
41177 +#define MCF_GPIO_PPDSDR_FEC0L_PPDSDRFEC0L1 (0x02)
41178 +#define MCF_GPIO_PPDSDR_FEC0L_PPDSDRFEC0L2 (0x04)
41179 +#define MCF_GPIO_PPDSDR_FEC0L_PPDSDRFEC0L3 (0x08)
41180 +#define MCF_GPIO_PPDSDR_FEC0L_PPDSDRFEC0L4 (0x10)
41181 +#define MCF_GPIO_PPDSDR_FEC0L_PPDSDRFEC0L5 (0x20)
41182 +#define MCF_GPIO_PPDSDR_FEC0L_PPDSDRFEC0L6 (0x40)
41183 +#define MCF_GPIO_PPDSDR_FEC0L_PPDSDRFEC0L7 (0x80)
41185 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FEC1H */
41186 +#define MCF_GPIO_PPDSDR_FEC1H_PPDSDRFEC1H0 (0x01)
41187 +#define MCF_GPIO_PPDSDR_FEC1H_PPDSDRFEC1H1 (0x02)
41188 +#define MCF_GPIO_PPDSDR_FEC1H_PPDSDRFEC1H2 (0x04)
41189 +#define MCF_GPIO_PPDSDR_FEC1H_PPDSDRFEC1H3 (0x08)
41190 +#define MCF_GPIO_PPDSDR_FEC1H_PPDSDRFEC1H4 (0x10)
41191 +#define MCF_GPIO_PPDSDR_FEC1H_PPDSDRFEC1H5 (0x20)
41192 +#define MCF_GPIO_PPDSDR_FEC1H_PPDSDRFEC1H6 (0x40)
41193 +#define MCF_GPIO_PPDSDR_FEC1H_PPDSDRFEC1H7 (0x80)
41195 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FEC1L */
41196 +#define MCF_GPIO_PPDSDR_FEC1L_PPDSDRFEC1L0 (0x01)
41197 +#define MCF_GPIO_PPDSDR_FEC1L_PPDSDRFEC1L1 (0x02)
41198 +#define MCF_GPIO_PPDSDR_FEC1L_PPDSDRFEC1L2 (0x04)
41199 +#define MCF_GPIO_PPDSDR_FEC1L_PPDSDRFEC1L3 (0x08)
41200 +#define MCF_GPIO_PPDSDR_FEC1L_PPDSDRFEC1L4 (0x10)
41201 +#define MCF_GPIO_PPDSDR_FEC1L_PPDSDRFEC1L5 (0x20)
41202 +#define MCF_GPIO_PPDSDR_FEC1L_PPDSDRFEC1L6 (0x40)
41203 +#define MCF_GPIO_PPDSDR_FEC1L_PPDSDRFEC1L7 (0x80)
41205 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FECI2C */
41206 +#define MCF_GPIO_PPDSDR_FECI2C_PPDSDRFECI2C0 (0x01)
41207 +#define MCF_GPIO_PPDSDR_FECI2C_PPDSDRFECI2C1 (0x02)
41208 +#define MCF_GPIO_PPDSDR_FECI2C_PPDSDRFECI2C2 (0x04)
41209 +#define MCF_GPIO_PPDSDR_FECI2C_PPDSDRFECI2C3 (0x08)
41211 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_PCIBG */
41212 +#define MCF_GPIO_PPDSDR_PCIBG_PPDSDRPCIBG0 (0x01)
41213 +#define MCF_GPIO_PPDSDR_PCIBG_PPDSDRPCIBG1 (0x02)
41214 +#define MCF_GPIO_PPDSDR_PCIBG_PPDSDRPCIBG2 (0x04)
41215 +#define MCF_GPIO_PPDSDR_PCIBG_PPDSDRPCIBG3 (0x08)
41216 +#define MCF_GPIO_PPDSDR_PCIBG_PPDSDRPCIBG4 (0x10)
41218 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_PCIBR */
41219 +#define MCF_GPIO_PPDSDR_PCIBR_PPDSDRPCIBR0 (0x01)
41220 +#define MCF_GPIO_PPDSDR_PCIBR_PPDSDRPCIBR1 (0x02)
41221 +#define MCF_GPIO_PPDSDR_PCIBR_PPDSDRPCIBR2 (0x04)
41222 +#define MCF_GPIO_PPDSDR_PCIBR_PPDSDRPCIBR3 (0x08)
41223 +#define MCF_GPIO_PPDSDR_PCIBR_PPDSDRPCIBR4 (0x10)
41225 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_PSC3PSC2 */
41226 +#define MCF_GPIO_PPDSDR_PSC3PSC2_PPDSDRPSC3PSC20 (0x01)
41227 +#define MCF_GPIO_PPDSDR_PSC3PSC2_PPDSDRPSC3PSC21 (0x02)
41228 +#define MCF_GPIO_PPDSDR_PSC3PSC2_PPDSDRPSC3PSC22 (0x04)
41229 +#define MCF_GPIO_PPDSDR_PSC3PSC2_PPDSDRPSC3PSC23 (0x08)
41230 +#define MCF_GPIO_PPDSDR_PSC3PSC2_PDDRPSC3PSC24 (0x10)
41231 +#define MCF_GPIO_PPDSDR_PSC3PSC2_PDDRPSC3PSC25 (0x20)
41232 +#define MCF_GPIO_PPDSDR_PSC3PSC2_PPDSDRPSC3PSC26 (0x40)
41233 +#define MCF_GPIO_PPDSDR_PSC3PSC2_PPDSDRPSC3PSC27 (0x80)
41235 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_PSC1PSC0 */
41236 +#define MCF_GPIO_PPDSDR_PSC1PSC0_PPDSDRPSC1PSC00 (0x01)
41237 +#define MCF_GPIO_PPDSDR_PSC1PSC0_PDDRPSC1PSC01 (0x02)
41238 +#define MCF_GPIO_PPDSDR_PSC1PSC0_PPDSDRPSC1PSC02 (0x04)
41239 +#define MCF_GPIO_PPDSDR_PSC1PSC0_PDDRPSC1PSC03 (0x08)
41240 +#define MCF_GPIO_PPDSDR_PSC1PSC0_PPDSDRPSC1PSC04 (0x10)
41241 +#define MCF_GPIO_PPDSDR_PSC1PSC0_PPDSDRPSC1PSC05 (0x20)
41242 +#define MCF_GPIO_PPDSDR_PSC1PSC0_PPDSDRPSC1PSC06 (0x40)
41243 +#define MCF_GPIO_PPDSDR_PSC1PSC0_PPDSDRPSC1PSC07 (0x80)
41245 +/* Bit definitions and macros for MCF_GPIO_PPDSDR_DSPI */
41246 +#define MCF_GPIO_PPDSDR_DSPI_PPDSDRDSPI0 (0x01)
41247 +#define MCF_GPIO_PPDSDR_DSPI_PPDSDRDSPI1 (0x02)
41248 +#define MCF_GPIO_PPDSDR_DSPI_PPDSDRDSPI2 (0x04)
41249 +#define MCF_GPIO_PPDSDR_DSPI_PPDSDRDSPI3 (0x08)
41250 +#define MCF_GPIO_PPDSDR_DSPI_PDDRDSPI4 (0x10)
41251 +#define MCF_GPIO_PPDSDR_DSPI_PPDSDRDSPI5 (0x20)
41252 +#define MCF_GPIO_PPDSDR_DSPI_PPDSDRDSPI6 (0x40)
41254 +/* Bit definitions and macros for MCF_GPIO_PCLRR_FBCTL */
41255 +#define MCF_GPIO_PCLRR_FBCTL_PCLRRFBCTL0 (0x01)
41256 +#define MCF_GPIO_PCLRR_FBCTL_PCLRRFBCTL1 (0x02)
41257 +#define MCF_GPIO_PCLRR_FBCTL_PCLRRFBCTL2 (0x04)
41258 +#define MCF_GPIO_PCLRR_FBCTL_PCLRRFBCTL3 (0x08)
41259 +#define MCF_GPIO_PCLRR_FBCTL_PCLRRFBCTL4 (0x10)
41260 +#define MCF_GPIO_PCLRR_FBCTL_PCLRRFBCTL5 (0x20)
41261 +#define MCF_GPIO_PCLRR_FBCTL_PCLRRFBCTL6 (0x40)
41262 +#define MCF_GPIO_PCLRR_FBCTL_PCLRRFBCTL7 (0x80)
41264 +/* Bit definitions and macros for MCF_GPIO_PCLRR_FBCS */
41265 +#define MCF_GPIO_PCLRR_FBCS_PCLRRFBCS1 (0x02)
41266 +#define MCF_GPIO_PCLRR_FBCS_PCLRRFBCS2 (0x04)
41267 +#define MCF_GPIO_PCLRR_FBCS_PCLRRFBCS3 (0x08)
41268 +#define MCF_GPIO_PCLRR_FBCS_PCLRRFBCS4 (0x10)
41269 +#define MCF_GPIO_PCLRR_FBCS_PCLRRFBCS5 (0x20)
41271 +/* Bit definitions and macros for MCF_GPIO_PCLRR_DMA */
41272 +#define MCF_GPIO_PCLRR_DMA_PCLRRDMA0 (0x01)
41273 +#define MCF_GPIO_PCLRR_DMA_PCLRRDMA1 (0x02)
41274 +#define MCF_GPIO_PCLRR_DMA_PCLRRDMA2 (0x04)
41275 +#define MCF_GPIO_PCLRR_DMA_PCLRRDMA3 (0x08)
41277 +/* Bit definitions and macros for MCF_GPIO_PCLRR_FEC0H */
41278 +#define MCF_GPIO_PCLRR_FEC0H_PCLRRFEC0H0 (0x01)
41279 +#define MCF_GPIO_PCLRR_FEC0H_PCLRRFEC0H1 (0x02)
41280 +#define MCF_GPIO_PCLRR_FEC0H_PCLRRFEC0H2 (0x04)
41281 +#define MCF_GPIO_PCLRR_FEC0H_PCLRRFEC0H3 (0x08)
41282 +#define MCF_GPIO_PCLRR_FEC0H_PCLRRFEC0H4 (0x10)
41283 +#define MCF_GPIO_PCLRR_FEC0H_PCLRRFEC0H5 (0x20)
41284 +#define MCF_GPIO_PCLRR_FEC0H_PCLRRFEC0H6 (0x40)
41285 +#define MCF_GPIO_PCLRR_FEC0H_PCLRRFEC0H7 (0x80)
41287 +/* Bit definitions and macros for MCF_GPIO_PCLRR_FEC0L */
41288 +#define MCF_GPIO_PCLRR_FEC0L_PCLRRFEC0L0 (0x01)
41289 +#define MCF_GPIO_PCLRR_FEC0L_PODRFEC0L1 (0x02)
41290 +#define MCF_GPIO_PCLRR_FEC0L_PCLRRFEC0L2 (0x04)
41291 +#define MCF_GPIO_PCLRR_FEC0L_PCLRRFEC0L3 (0x08)
41292 +#define MCF_GPIO_PCLRR_FEC0L_PODRFEC0L4 (0x10)
41293 +#define MCF_GPIO_PCLRR_FEC0L_PODRFEC0L5 (0x20)
41294 +#define MCF_GPIO_PCLRR_FEC0L_PODRFEC0L6 (0x40)
41295 +#define MCF_GPIO_PCLRR_FEC0L_PCLRRFEC0L7 (0x80)
41297 +/* Bit definitions and macros for MCF_GPIO_PCLRR_FEC1H */
41298 +#define MCF_GPIO_PCLRR_FEC1H_PCLRRFEC1H0 (0x01)
41299 +#define MCF_GPIO_PCLRR_FEC1H_PCLRRFEC1H1 (0x02)
41300 +#define MCF_GPIO_PCLRR_FEC1H_PCLRRFEC1H2 (0x04)
41301 +#define MCF_GPIO_PCLRR_FEC1H_PODRFEC1H3 (0x08)
41302 +#define MCF_GPIO_PCLRR_FEC1H_PODRFEC1H4 (0x10)
41303 +#define MCF_GPIO_PCLRR_FEC1H_PCLRRFEC1H5 (0x20)
41304 +#define MCF_GPIO_PCLRR_FEC1H_PCLRRFEC1H6 (0x40)
41305 +#define MCF_GPIO_PCLRR_FEC1H_PCLRRFEC1H7 (0x80)
41307 +/* Bit definitions and macros for MCF_GPIO_PCLRR_FEC1L */
41308 +#define MCF_GPIO_PCLRR_FEC1L_PCLRRFEC1L0 (0x01)
41309 +#define MCF_GPIO_PCLRR_FEC1L_PCLRRFEC1L1 (0x02)
41310 +#define MCF_GPIO_PCLRR_FEC1L_PCLRRFEC1L2 (0x04)
41311 +#define MCF_GPIO_PCLRR_FEC1L_PCLRRFEC1L3 (0x08)
41312 +#define MCF_GPIO_PCLRR_FEC1L_PODRFEC1L4 (0x10)
41313 +#define MCF_GPIO_PCLRR_FEC1L_PCLRRFEC1L5 (0x20)
41314 +#define MCF_GPIO_PCLRR_FEC1L_PCLRRFEC1L6 (0x40)
41315 +#define MCF_GPIO_PCLRR_FEC1L_PCLRRFEC1L7 (0x80)
41317 +/* Bit definitions and macros for MCF_GPIO_PCLRR_FECI2C */
41318 +#define MCF_GPIO_PCLRR_FECI2C_PCLRRFECI2C0 (0x01)
41319 +#define MCF_GPIO_PCLRR_FECI2C_PCLRRFECI2C1 (0x02)
41320 +#define MCF_GPIO_PCLRR_FECI2C_PODRFECI2C2 (0x04)
41321 +#define MCF_GPIO_PCLRR_FECI2C_PCLRRFECI2C3 (0x08)
41323 +/* Bit definitions and macros for MCF_GPIO_PCLRR_PCIBG */
41324 +#define MCF_GPIO_PCLRR_PCIBG_PODRPCIBG0 (0x01)
41325 +#define MCF_GPIO_PCLRR_PCIBG_PODRPCIBG1 (0x02)
41326 +#define MCF_GPIO_PCLRR_PCIBG_PODRPCIBG2 (0x04)
41327 +#define MCF_GPIO_PCLRR_PCIBG_PCLRRPCIBG3 (0x08)
41328 +#define MCF_GPIO_PCLRR_PCIBG_PCLRRPCIBG4 (0x10)
41330 +/* Bit definitions and macros for MCF_GPIO_PCLRR_PCIBR */
41331 +#define MCF_GPIO_PCLRR_PCIBR_PCLRRPCIBR0 (0x01)
41332 +#define MCF_GPIO_PCLRR_PCIBR_PCLRRPCIBR1 (0x02)
41333 +#define MCF_GPIO_PCLRR_PCIBR_PCLRRPCIBR2 (0x04)
41334 +#define MCF_GPIO_PCLRR_PCIBR_PODRPCIBR3 (0x08)
41335 +#define MCF_GPIO_PCLRR_PCIBR_PODRPCIBR4 (0x10)
41337 +/* Bit definitions and macros for MCF_GPIO_PCLRR_PSC3PSC2 */
41338 +#define MCF_GPIO_PCLRR_PSC3PSC2_PODRPSC3PSC20 (0x01)
41339 +#define MCF_GPIO_PCLRR_PSC3PSC2_PODRPSC3PSC21 (0x02)
41340 +#define MCF_GPIO_PCLRR_PSC3PSC2_PCLRRPSC3PSC22 (0x04)
41341 +#define MCF_GPIO_PCLRR_PSC3PSC2_PCLRRPSC3PSC23 (0x08)
41342 +#define MCF_GPIO_PCLRR_PSC3PSC2_PCLRRPSC3PSC24 (0x10)
41343 +#define MCF_GPIO_PCLRR_PSC3PSC2_PODRPSC3PSC25 (0x20)
41344 +#define MCF_GPIO_PCLRR_PSC3PSC2_PODRPSC3PSC26 (0x40)
41345 +#define MCF_GPIO_PCLRR_PSC3PSC2_PCLRRPSC3PSC27 (0x80)
41347 +/* Bit definitions and macros for MCF_GPIO_PCLRR_PSC1PSC0 */
41348 +#define MCF_GPIO_PCLRR_PSC1PSC0_PCLRRPSC1PSC00 (0x01)
41349 +#define MCF_GPIO_PCLRR_PSC1PSC0_PCLRRPSC1PSC01 (0x02)
41350 +#define MCF_GPIO_PCLRR_PSC1PSC0_PCLRRPSC1PSC02 (0x04)
41351 +#define MCF_GPIO_PCLRR_PSC1PSC0_PCLRRPSC1PSC03 (0x08)
41352 +#define MCF_GPIO_PCLRR_PSC1PSC0_PCLRRPSC1PSC04 (0x10)
41353 +#define MCF_GPIO_PCLRR_PSC1PSC0_PCLRRPSC1PSC05 (0x20)
41354 +#define MCF_GPIO_PCLRR_PSC1PSC0_PODRPSC1PSC06 (0x40)
41355 +#define MCF_GPIO_PCLRR_PSC1PSC0_PCLRRPSC1PSC07 (0x80)
41357 +/* Bit definitions and macros for MCF_GPIO_PCLRR_DSPI */
41358 +#define MCF_GPIO_PCLRR_DSPI_PCLRRDSPI0 (0x01)
41359 +#define MCF_GPIO_PCLRR_DSPI_PCLRRDSPI1 (0x02)
41360 +#define MCF_GPIO_PCLRR_DSPI_PCLRRDSPI2 (0x04)
41361 +#define MCF_GPIO_PCLRR_DSPI_PCLRRDSPI3 (0x08)
41362 +#define MCF_GPIO_PCLRR_DSPI_PCLRRDSPI4 (0x10)
41363 +#define MCF_GPIO_PCLRR_DSPI_PCLRRDSPI5 (0x20)
41364 +#define MCF_GPIO_PCLRR_DSPI_PCLRRDSPI6 (0x40)
41366 +/* Bit definitions and macros for MCF_GPIO_PAR_FBCTL */
41367 +#define MCF_GPIO_PAR_FBCTL_PAR_TS(x) (((x)&0x0003)<<0)
41368 +#define MCF_GPIO_PAR_FBCTL_PAR_TA (0x0004)
41369 +#define MCF_GPIO_PAR_FBCTL_PAR_RWB (0x0010)
41370 +#define MCF_GPIO_PAR_FBCTL_PAR_OE (0x0040)
41371 +#define MCF_GPIO_PAR_FBCTL_PAR_BWE0 (0x0100)
41372 +#define MCF_GPIO_PAR_FBCTL_PAR_BWE1 (0x0400)
41373 +#define MCF_GPIO_PAR_FBCTL_PAR_BWE2 (0x1000)
41374 +#define MCF_GPIO_PAR_FBCTL_PAR_BWE3 (0x4000)
41375 +#define MCF_GPIO_PAR_FBCTL_PAR_TS_GPIO (0)
41376 +#define MCF_GPIO_PAR_FBCTL_PAR_TS_TBST (2)
41377 +#define MCF_GPIO_PAR_FBCTL_PAR_TS_TS (3)
41379 +/* Bit definitions and macros for MCF_GPIO_PAR_FBCS */
41380 +#define MCF_GPIO_PAR_FBCS_PAR_CS1 (0x02)
41381 +#define MCF_GPIO_PAR_FBCS_PAR_CS2 (0x04)
41382 +#define MCF_GPIO_PAR_FBCS_PAR_CS3 (0x08)
41383 +#define MCF_GPIO_PAR_FBCS_PAR_CS4 (0x10)
41384 +#define MCF_GPIO_PAR_FBCS_PAR_CS5 (0x20)
41386 +/* Bit definitions and macros for MCF_GPIO_PAR_DMA */
41387 +#define MCF_GPIO_PAR_DMA_PAR_DREQ0(x) (((x)&0x03)<<0)
41388 +#define MCF_GPIO_PAR_DMA_PAR_DREQ1(x) (((x)&0x03)<<2)
41389 +#define MCF_GPIO_PAR_DMA_PAR_DACK0(x) (((x)&0x03)<<4)
41390 +#define MCF_GPIO_PAR_DMA_PAR_DACK1(x) (((x)&0x03)<<6)
41391 +#define MCF_GPIO_PAR_DMA_PAR_DACKx_GPIO (0)
41392 +#define MCF_GPIO_PAR_DMA_PAR_DACKx_TOUT (2)
41393 +#define MCF_GPIO_PAR_DMA_PAR_DACKx_DACK (3)
41394 +#define MCF_GPIO_PAR_DMA_PAR_DREQx_GPIO (0)
41395 +#define MCF_GPIO_PAR_DMA_PAR_DREQx_TIN (2)
41396 +#define MCF_GPIO_PAR_DMA_PAR_DREQx_DREQ (3)
41398 +/* Bit definitions and macros for MCF_GPIO_PAR_FECI2CIRQ */
41399 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_IRQ5 (0x0001)
41400 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_IRQ6 (0x0002)
41401 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_SCL (0x0004)
41402 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_SDA (0x0008)
41403 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E1MDC(x) (((x)&0x0003)<<6)
41404 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E1MDIO(x) (((x)&0x0003)<<8)
41405 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E1MII (0x0400)
41406 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E17 (0x0800)
41407 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E0MDC (0x1000)
41408 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E0MDIO (0x2000)
41409 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E0MII (0x4000)
41410 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E07 (0x8000)
41411 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E1MDIO_CANRX (0x0000)
41412 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E1MDIO_SDA (0x0200)
41413 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E1MDIO_EMDIO (0x0300)
41414 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E1MDC_CANTX (0x0000)
41415 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E1MDC_SCL (0x0080)
41416 +#define MCF_GPIO_PAR_FECI2CIRQ_PAR_E1MDC_EMDC (0x00C0)
41418 +/* Bit definitions and macros for MCF_GPIO_PAR_PCIBG */
41419 +#define MCF_GPIO_PAR_PCIBG_PAR_PCIBG0(x) (((x)&0x0003)<<0)
41420 +#define MCF_GPIO_PAR_PCIBG_PAR_PCIBG1(x) (((x)&0x0003)<<2)
41421 +#define MCF_GPIO_PAR_PCIBG_PAR_PCIBG2(x) (((x)&0x0003)<<4)
41422 +#define MCF_GPIO_PAR_PCIBG_PAR_PCIBG3(x) (((x)&0x0003)<<6)
41423 +#define MCF_GPIO_PAR_PCIBG_PAR_PCIBG4(x) (((x)&0x0003)<<8)
41425 +/* Bit definitions and macros for MCF_GPIO_PAR_PCIBR */
41426 +#define MCF_GPIO_PAR_PCIBR_PAR_PCIBG0(x) (((x)&0x0003)<<0)
41427 +#define MCF_GPIO_PAR_PCIBR_PAR_PCIBG1(x) (((x)&0x0003)<<2)
41428 +#define MCF_GPIO_PAR_PCIBR_PAR_PCIBG2(x) (((x)&0x0003)<<4)
41429 +#define MCF_GPIO_PAR_PCIBR_PAR_PCIBG3(x) (((x)&0x0003)<<6)
41430 +#define MCF_GPIO_PAR_PCIBR_PAR_PCIBR4(x) (((x)&0x0003)<<8)
41432 +/* Bit definitions and macros for MCF_GPIO_PAR_PSC3 */
41433 +#define MCF_GPIO_PAR_PSC3_PAR_TXD3 (0x04)
41434 +#define MCF_GPIO_PAR_PSC3_PAR_RXD3 (0x08)
41435 +#define MCF_GPIO_PAR_PSC3_PAR_RTS3(x) (((x)&0x03)<<4)
41436 +#define MCF_GPIO_PAR_PSC3_PAR_CTS3(x) (((x)&0x03)<<6)
41437 +#define MCF_GPIO_PAR_PSC3_PAR_CTS3_GPIO (0x00)
41438 +#define MCF_GPIO_PAR_PSC3_PAR_CTS3_BCLK (0x80)
41439 +#define MCF_GPIO_PAR_PSC3_PAR_CTS3_CTS (0xC0)
41440 +#define MCF_GPIO_PAR_PSC3_PAR_RTS3_GPIO (0x00)
41441 +#define MCF_GPIO_PAR_PSC3_PAR_RTS3_FSYNC (0x20)
41442 +#define MCF_GPIO_PAR_PSC3_PAR_RTS3_RTS (0x30)
41443 +#define MCF_GPIO_PAR_PSC3_PAR_CTS2_CANRX (0x40)
41445 +/* Bit definitions and macros for MCF_GPIO_PAR_PSC2 */
41446 +#define MCF_GPIO_PAR_PSC2_PAR_TXD2 (0x04)
41447 +#define MCF_GPIO_PAR_PSC2_PAR_RXD2 (0x08)
41448 +#define MCF_GPIO_PAR_PSC2_PAR_RTS2(x) (((x)&0x03)<<4)
41449 +#define MCF_GPIO_PAR_PSC2_PAR_CTS2(x) (((x)&0x03)<<6)
41450 +#define MCF_GPIO_PAR_PSC2_PAR_CTS2_GPIO (0x00)
41451 +#define MCF_GPIO_PAR_PSC2_PAR_CTS2_BCLK (0x80)
41452 +#define MCF_GPIO_PAR_PSC2_PAR_CTS2_CTS (0xC0)
41453 +#define MCF_GPIO_PAR_PSC2_PAR_RTS2_GPIO (0x00)
41454 +#define MCF_GPIO_PAR_PSC2_PAR_RTS2_CANTX (0x10)
41455 +#define MCF_GPIO_PAR_PSC2_PAR_RTS2_FSYNC (0x20)
41456 +#define MCF_GPIO_PAR_PSC2_PAR_RTS2_RTS (0x30)
41457 +#define MCF_GPIO_PAR_PSC2_PAR_RTS2_CANRX (0x40)
41459 +/* Bit definitions and macros for MCF_GPIO_PAR_PSC1 */
41460 +#define MCF_GPIO_PAR_PSC1_PAR_TXD1 (0x04)
41461 +#define MCF_GPIO_PAR_PSC1_PAR_RXD1 (0x08)
41462 +#define MCF_GPIO_PAR_PSC1_PAR_RTS1(x) (((x)&0x03)<<4)
41463 +#define MCF_GPIO_PAR_PSC1_PAR_CTS1(x) (((x)&0x03)<<6)
41464 +#define MCF_GPIO_PAR_PSC1_PAR_CTS1_GPIO (0x00)
41465 +#define MCF_GPIO_PAR_PSC1_PAR_CTS1_BCLK (0x80)
41466 +#define MCF_GPIO_PAR_PSC1_PAR_CTS1_CTS (0xC0)
41467 +#define MCF_GPIO_PAR_PSC1_PAR_RTS1_GPIO (0x00)
41468 +#define MCF_GPIO_PAR_PSC1_PAR_RTS1_FSYNC (0x20)
41469 +#define MCF_GPIO_PAR_PSC1_PAR_RTS1_RTS (0x30)
41471 +/* Bit definitions and macros for MCF_GPIO_PAR_PSC0 */
41472 +#define MCF_GPIO_PAR_PSC0_PAR_TXD0 (0x04)
41473 +#define MCF_GPIO_PAR_PSC0_PAR_RXD0 (0x08)
41474 +#define MCF_GPIO_PAR_PSC0_PAR_RTS0(x) (((x)&0x03)<<4)
41475 +#define MCF_GPIO_PAR_PSC0_PAR_CTS0(x) (((x)&0x03)<<6)
41476 +#define MCF_GPIO_PAR_PSC0_PAR_CTS0_GPIO (0x00)
41477 +#define MCF_GPIO_PAR_PSC0_PAR_CTS0_BCLK (0x80)
41478 +#define MCF_GPIO_PAR_PSC0_PAR_CTS0_CTS (0xC0)
41479 +#define MCF_GPIO_PAR_PSC0_PAR_RTS0_GPIO (0x00)
41480 +#define MCF_GPIO_PAR_PSC0_PAR_RTS0_FSYNC (0x20)
41481 +#define MCF_GPIO_PAR_PSC0_PAR_RTS0_RTS (0x30)
41483 +/* Bit definitions and macros for MCF_GPIO_PAR_DSPI */
41484 +#define MCF_GPIO_PAR_DSPI_PAR_SOUT(x) (((x)&0x0003)<<0)
41485 +#define MCF_GPIO_PAR_DSPI_PAR_SIN(x) (((x)&0x0003)<<2)
41486 +#define MCF_GPIO_PAR_DSPI_PAR_SCK(x) (((x)&0x0003)<<4)
41487 +#define MCF_GPIO_PAR_DSPI_PAR_CS0(x) (((x)&0x0003)<<6)
41488 +#define MCF_GPIO_PAR_DSPI_PAR_CS2(x) (((x)&0x0003)<<8)
41489 +#define MCF_GPIO_PAR_DSPI_PAR_CS3(x) (((x)&0x0003)<<10)
41490 +#define MCF_GPIO_PAR_DSPI_PAR_CS5 (0x1000)
41491 +#define MCF_GPIO_PAR_DSPI_PAR_CS3_GPIO (0x0000)
41492 +#define MCF_GPIO_PAR_DSPI_PAR_CS3_CANTX (0x0400)
41493 +#define MCF_GPIO_PAR_DSPI_PAR_CS3_TOUT (0x0800)
41494 +#define MCF_GPIO_PAR_DSPI_PAR_CS3_DSPICS (0x0C00)
41495 +#define MCF_GPIO_PAR_DSPI_PAR_CS2_GPIO (0x0000)
41496 +#define MCF_GPIO_PAR_DSPI_PAR_CS2_CANTX (0x0100)
41497 +#define MCF_GPIO_PAR_DSPI_PAR_CS2_TOUT (0x0200)
41498 +#define MCF_GPIO_PAR_DSPI_PAR_CS2_DSPICS (0x0300)
41499 +#define MCF_GPIO_PAR_DSPI_PAR_CS0_GPIO (0x0000)
41500 +#define MCF_GPIO_PAR_DSPI_PAR_CS0_FSYNC (0x0040)
41501 +#define MCF_GPIO_PAR_DSPI_PAR_CS0_RTS (0x0080)
41502 +#define MCF_GPIO_PAR_DSPI_PAR_CS0_DSPICS (0x00C0)
41503 +#define MCF_GPIO_PAR_DSPI_PAR_SCK_GPIO (0x0000)
41504 +#define MCF_GPIO_PAR_DSPI_PAR_SCK_BCLK (0x0010)
41505 +#define MCF_GPIO_PAR_DSPI_PAR_SCK_CTS (0x0020)
41506 +#define MCF_GPIO_PAR_DSPI_PAR_SCK_SCK (0x0030)
41507 +#define MCF_GPIO_PAR_DSPI_PAR_SIN_GPIO (0x0000)
41508 +#define MCF_GPIO_PAR_DSPI_PAR_SIN_RXD (0x0008)
41509 +#define MCF_GPIO_PAR_DSPI_PAR_SIN_SIN (0x000C)
41510 +#define MCF_GPIO_PAR_DSPI_PAR_SOUT_GPIO (0x0000)
41511 +#define MCF_GPIO_PAR_DSPI_PAR_SOUT_TXD (0x0002)
41512 +#define MCF_GPIO_PAR_DSPI_PAR_SOUT_SOUT (0x0003)
41514 +/* Bit definitions and macros for MCF_GPIO_PAR_TIMER */
41515 +#define MCF_GPIO_PAR_TIMER_PAR_TOUT2 (0x01)
41516 +#define MCF_GPIO_PAR_TIMER_PAR_TIN2(x) (((x)&0x03)<<1)
41517 +#define MCF_GPIO_PAR_TIMER_PAR_TOUT3 (0x08)
41518 +#define MCF_GPIO_PAR_TIMER_PAR_TIN3(x) (((x)&0x03)<<4)
41519 +#define MCF_GPIO_PAR_TIMER_PAR_TIN3_CANRX (0x00)
41520 +#define MCF_GPIO_PAR_TIMER_PAR_TIN3_IRQ (0x20)
41521 +#define MCF_GPIO_PAR_TIMER_PAR_TIN3_TIN (0x30)
41522 +#define MCF_GPIO_PAR_TIMER_PAR_TIN2_CANRX (0x00)
41523 +#define MCF_GPIO_PAR_TIMER_PAR_TIN2_IRQ (0x04)
41524 +#define MCF_GPIO_PAR_TIMER_PAR_TIN2_TIN (0x06)
41526 +/********************************************************************/
41528 +#endif /* _M5485GPIO_H_ */
41530 +++ b/include/asm-m68k/m5485gpt.h
41533 + * File: mcf548x_gpt.h
41534 + * Purpose: Register and bit definitions for the MCF548X
41540 +#ifndef __MCF548X_GPT_H__
41541 +#define __MCF548X_GPT_H__
41543 +/*********************************************************************
41545 +* General Purpose Timers (GPT)
41547 +*********************************************************************/
41549 +/* Register read/write macros */
41550 +#define MCF_GPT_GMS0 MCF_REG32(0x000800)
41551 +#define MCF_GPT_GCIR0 MCF_REG32(0x000804)
41552 +#define MCF_GPT_GPWM0 MCF_REG32(0x000808)
41553 +#define MCF_GPT_GSR0 MCF_REG32(0x00080C)
41554 +#define MCF_GPT_GMS1 MCF_REG32(0x000810)
41555 +#define MCF_GPT_GCIR1 MCF_REG32(0x000814)
41556 +#define MCF_GPT_GPWM1 MCF_REG32(0x000818)
41557 +#define MCF_GPT_GSR1 MCF_REG32(0x00081C)
41558 +#define MCF_GPT_GMS2 MCF_REG32(0x000820)
41559 +#define MCF_GPT_GCIR2 MCF_REG32(0x000824)
41560 +#define MCF_GPT_GPWM2 MCF_REG32(0x000828)
41561 +#define MCF_GPT_GSR2 MCF_REG32(0x00082C)
41562 +#define MCF_GPT_GMS3 MCF_REG32(0x000830)
41563 +#define MCF_GPT_GCIR3 MCF_REG32(0x000834)
41564 +#define MCF_GPT_GPWM3 MCF_REG32(0x000838)
41565 +#define MCF_GPT_GSR3 MCF_REG32(0x00083C)
41566 +#define MCF_GPT_GMS(x) MCF_REG32(0x000800+((x)*0x010))
41567 +#define MCF_GPT_GCIR(x) MCF_REG32(0x000804+((x)*0x010))
41568 +#define MCF_GPT_GPWM(x) MCF_REG32(0x000808+((x)*0x010))
41569 +#define MCF_GPT_GSR(x) MCF_REG32(0x00080C+((x)*0x010))
41571 +/* Bit definitions and macros for MCF_GPT_GMS */
41572 +#define MCF_GPT_GMS_TMS(x) (((x)&0x00000007)<<0)
41573 +#define MCF_GPT_GMS_GPIO(x) (((x)&0x00000003)<<4)
41574 +#define MCF_GPT_GMS_IEN (0x00000100)
41575 +#define MCF_GPT_GMS_OD (0x00000200)
41576 +#define MCF_GPT_GMS_SC (0x00000400)
41577 +#define MCF_GPT_GMS_CE (0x00001000)
41578 +#define MCF_GPT_GMS_WDEN (0x00008000)
41579 +#define MCF_GPT_GMS_ICT(x) (((x)&0x00000003)<<16)
41580 +#define MCF_GPT_GMS_OCT(x) (((x)&0x00000003)<<20)
41581 +#define MCF_GPT_GMS_OCPW(x) (((x)&0x000000FF)<<24)
41582 +#define MCF_GPT_GMS_OCT_FRCLOW (0x00000000)
41583 +#define MCF_GPT_GMS_OCT_PULSEHI (0x00100000)
41584 +#define MCF_GPT_GMS_OCT_PULSELO (0x00200000)
41585 +#define MCF_GPT_GMS_OCT_TOGGLE (0x00300000)
41586 +#define MCF_GPT_GMS_ICT_ANY (0x00000000)
41587 +#define MCF_GPT_GMS_ICT_RISE (0x00010000)
41588 +#define MCF_GPT_GMS_ICT_FALL (0x00020000)
41589 +#define MCF_GPT_GMS_ICT_PULSE (0x00030000)
41590 +#define MCF_GPT_GMS_GPIO_INPUT (0x00000000)
41591 +#define MCF_GPT_GMS_GPIO_OUTLO (0x00000020)
41592 +#define MCF_GPT_GMS_GPIO_OUTHI (0x00000030)
41593 +#define MCF_GPT_GMS_TMS_DISABLE (0x00000000)
41594 +#define MCF_GPT_GMS_TMS_INCAPT (0x00000001)
41595 +#define MCF_GPT_GMS_TMS_OUTCAPT (0x00000002)
41596 +#define MCF_GPT_GMS_TMS_PWM (0x00000003)
41597 +#define MCF_GPT_GMS_TMS_GPIO (0x00000004)
41599 +/* Bit definitions and macros for MCF_GPT_GCIR */
41600 +#define MCF_GPT_GCIR_CNT(x) (((x)&0x0000FFFF)<<0)
41601 +#define MCF_GPT_GCIR_PRE(x) (((x)&0x0000FFFF)<<16)
41603 +/* Bit definitions and macros for MCF_GPT_GPWM */
41604 +#define MCF_GPT_GPWM_LOAD (0x00000001)
41605 +#define MCF_GPT_GPWM_PWMOP (0x00000100)
41606 +#define MCF_GPT_GPWM_WIDTH(x) (((x)&0x0000FFFF)<<16)
41608 +/* Bit definitions and macros for MCF_GPT_GSR */
41609 +#define MCF_GPT_GSR_CAPT (0x00000001)
41610 +#define MCF_GPT_GSR_COMP (0x00000002)
41611 +#define MCF_GPT_GSR_PWMP (0x00000004)
41612 +#define MCF_GPT_GSR_TEXP (0x00000008)
41613 +#define MCF_GPT_GSR_PIN (0x00000100)
41614 +#define MCF_GPT_GSR_OVF(x) (((x)&0x00000007)<<12)
41615 +#define MCF_GPT_GSR_CAPTURE(x) (((x)&0x0000FFFF)<<16)
41617 +/********************************************************************/
41619 +#endif /* __MCF548X_GPT_H__ */
41621 +++ b/include/asm-m68k/m5485i2c.h
41624 + * m5485i2c.h -- ColdFire 547x/548x i2c controller support.
41626 +#ifndef M548X_I2C_H
41627 +#define M548X_I2C_H
41629 +/* Register read/write macros */
41630 +#define MCF_I2AR MCF_REG08(0x008F00) /* I2C Address */
41631 +#define MCF_I2FDR MCF_REG08(0x008F04) /* I2C Frequency Divider */
41632 +#define MCF_I2CR MCF_REG08(0x008F08) /* I2C Control */
41633 +#define MCF_I2SR MCF_REG08(0x008F0C) /* I2C Status */
41634 +#define MCF_I2DR MCF_REG08(0x008F10) /* I2C Data I/O */
41635 +#define MCF_I2ICR MCF_REG08(0x008F20) /* I2C Interrupt Control */
41637 +/* Bit definitions and macros for MCF_I2C_I2AR */
41638 +#define MCF_I2AR_ADR(x) (((x)&0x7F)<<1)
41640 +/* Bit definitions and macros for MCF_I2C_I2FDR */
41641 +#define MCF_I2FDR_IC(x) (((x)&0x3F)<<0)
41643 +/* Bit definitions and macros for MCF_I2C_I2CR */
41644 +#define MCF_I2CR_RSTA (0x04)
41645 +#define MCF_I2CR_TXAK (0x08)
41646 +#define MCF_I2CR_MTX (0x10)
41647 +#define MCF_I2CR_MSTA (0x20)
41648 +#define MCF_I2CR_IIEN (0x40)
41649 +#define MCF_I2CR_IEN (0x80)
41651 +/* Bit definitions and macros for MCF_I2C_I2SR */
41652 +#define MCF_I2SR_RXAK (0x01)
41653 +#define MCF_I2SR_IIF (0x02)
41654 +#define MCF_I2SR_SRW (0x04)
41655 +#define MCF_I2SR_IAL (0x10)
41656 +#define MCF_I2SR_IBB (0x20)
41657 +#define MCF_I2SR_IAAS (0x40)
41658 +#define MCF_I2SR_ICF (0x80)
41660 +/* Bit definitions and macros for MCF_I2C_I2ICR */
41661 +#define MCF_I2ICR_IE (0x01)
41662 +#define MCF_I2ICR_RE (0x02)
41663 +#define MCF_I2ICR_TE (0x04)
41664 +#define MCF_I2ICR_BNBE (0x08)
41666 +/********************************************************************/
41669 +++ b/include/asm-m68k/m5485pci.h
41672 + * m5485pci.h -- ColdFire 547x/548x PCI controller support.
41674 +#ifndef __MCF548X_PCI_H__
41675 +#define __MCF548X_PCI_H__
41678 +/* PCI Type 0 Configuration Registers */
41679 +#define MCF_PCIIDR MCF_REG32(0x000B00) /* PCI Device ID/Vendor ID */
41680 +#define MCF_PCISCR MCF_REG32(0x000B04) /* PCI Status/Command */
41681 +#define MCF_PCICCRIR MCF_REG32(0x000B08) /* PCI Class Code / Revision ID */
41682 +#define MCF_PCICR1 MCF_REG32(0x000B0C) /* PCI Configuration 1 Register */
41683 +#define MCF_PCIBAR0 MCF_REG32(0x000B10) /* PCI Base Address Register 0 */
41684 +#define MCF_PCIBAR1 MCF_REG32(0x000B14) /* PCI Base Address Register 1 */
41685 +#define MCF_PCICCPR MCF_REG32(0x000B28) /* PCI Cardbus CIS Pointer */
41686 +#define MCF_PCISID MCF_REG32(0x000B2C) /* Subsystem ID/Subsystem Vendor ID*/
41687 +#define MCF_PCIERBAR MCF_REG32(0x000B30) /* PCI Expansion ROM */
41688 +#define MCF_PCICPR MCF_REG32(0x000B30) /* PCI Capabilities Pointer */
41689 +#define MCF_PCICR2 MCF_REG32(0x000B3C) /* PCI Configuration Register 2 */
41691 +/* General Control/Status Registers */
41692 +#define MCF_PCIGSCR MCF_REG32(0x000B60) /* Global Status/Control Register */
41693 +#define MCF_PCITBATR0 MCF_REG32(0x000B64) /* Target Base Address Translation 0*/
41694 +#define MCF_PCITBATR1 MCF_REG32(0x000B68) /* Target Base Address Translation 1*/
41695 +#define MCF_PCITCR MCF_REG32(0x000B6C) /* Target Control Register */
41696 +#define MCF_PCIIW0BTAR MCF_REG32(0x000B70) /* Initiator Window 0 Base Address */
41697 +#define MCF_PCIIW1BTAR MCF_REG32(0x000B74) /* Initiator Window 1 Base Address */
41698 +#define MCF_PCIIW2BTAR MCF_REG32(0x000B78) /* Initiator Window 2 Base Address */
41699 +#define MCF_PCIIWCR MCF_REG32(0x000B80) /* Initiator Window Configuration */
41700 +#define MCF_PCIICR MCF_REG32(0x000B84) /* Initiator Control Register */
41701 +#define MCF_PCIISR MCF_REG32(0x000B88) /* Initiator Status Register */
41702 +#define MCF_PCICAR MCF_REG32(0x000BF8) /* Configuration Address Register */
41704 +/* CommBus FIFO Transmit Interface Registers */
41705 +#define MCF_PCITPSR MCF_REG32(0x008400) /* Tx Packet Size Register */
41706 +#define MCF_PCITSAR MCF_REG32(0x008404) /* Tx Start Address Register */
41707 +#define MCF_PCITTCR MCF_REG32(0x008408) /* Tx Transaction Control Register */
41708 +#define MCF_PCITER MCF_REG32(0x00840C) /* Tx Enables Register */
41709 +#define MCF_PCITNAR MCF_REG32(0x008410) /* Tx Next Address Register */
41710 +#define MCF_PCITLWR MCF_REG32(0x008414) /* Tx Last Word Register */
41711 +#define MCF_PCITDCR MCF_REG32(0x008418) /* Tx Done Counts Register */
41712 +#define MCF_PCITSR MCF_REG32(0x00841C) /* Tx Status Register */
41713 +#define MCF_PCITFDR MCF_REG32(0x008440) /* Tx FIFO Data Register */
41714 +#define MCF_PCITFSR MCF_REG32(0x008444) /* Tx FIFO Status Register */
41715 +#define MCF_PCITFCR MCF_REG32(0x008448) /* Tx FIFO Control Register */
41716 +#define MCF_PCITFAR MCF_REG32(0x00844C) /* Tx FIFO Alarm Register */
41717 +#define MCF_PCITFRPR MCF_REG32(0x008450) /* Tx FIFO Read Pointer Register */
41718 +#define MCF_PCITFWPR MCF_REG32(0x008454) /* Tx FIFO Write Pointer Register */
41720 +/* CommBus FIFO Receive Interface Registers */
41721 +#define MCF_PCIRPSR MCF_REG32(0x008480) /* Tx Packet Size Register */
41722 +#define MCF_PCIRSAR MCF_REG32(0x008484) /* Tx Start Address Register */
41723 +#define MCF_PCIRTCR MCF_REG32(0x008488) /* Tx Transaction Control Register */
41724 +#define MCF_PCIRER MCF_REG32(0x00848C) /* Tx Enables Register */
41725 +#define MCF_PCIRNAR MCF_REG32(0x008490) /* Tx Next Address Register */
41726 +#define MCF_PCIRDCR MCF_REG32(0x008498) /* Tx Done Counts Register */
41727 +#define MCF_PCIRSR MCF_REG32(0x00849C) /* Tx Status Register */
41728 +#define MCF_PCIRFDR MCF_REG32(0x0084C0) /* Tx FIFO Data Register */
41729 +#define MCF_PCIRFSR MCF_REG32(0x0084C4) /* Tx FIFO Status Register */
41730 +#define MCF_PCIRFCR MCF_REG32(0x0084C8) /* Tx FIFO Control Register */
41731 +#define MCF_PCIRFAR MCF_REG32(0x0084CC) /* Tx FIFO Alarm Register */
41732 +#define MCF_PCIRFRPR MCF_REG32(0x0084D0) /* Tx FIFO Read Pointer Register */
41733 +#define MCF_PCIRFWPR MCF_REG32(0x0084D4) /* Tx FIFO Write Pointer Register */
41735 +/* PCI Arbiter Registers */
41736 +#define MCF_PCIARB_PACR MCF_REG32(0x000C00)
41737 +#define MCF_PCIARB_PASR MCF_REG32(0x000C04)
41740 +/* Bit definitions and macros for MCF_PCIIDR */
41741 +#define MCF_PCIIDR_VENDORID(x) (((x)&0x0000FFFF)<<0)
41742 +#define MCF_PCIIDR_DEVICEID(x) (((x)&0x0000FFFF)<<16)
41744 +/* Bit definitions and macros for MCF_PCISCR */
41745 +#define MCF_PCISCR_M (0x00000002)
41746 +#define MCF_PCISCR_B (0x00000004)
41747 +#define MCF_PCISCR_SP (0x00000008)
41748 +#define MCF_PCISCR_MW (0x00000010)
41749 +#define MCF_PCISCR_PER (0x00000040)
41750 +#define MCF_PCISCR_S (0x00000100)
41751 +#define MCF_PCISCR_F (0x00000200)
41752 +#define MCF_PCISCR_C (0x00100000)
41753 +#define MCF_PCISCR_66M (0x00200000)
41754 +#define MCF_PCISCR_R (0x00400000)
41755 +#define MCF_PCISCR_FC (0x00800000)
41756 +#define MCF_PCISCR_DP (0x01000000)
41757 +#define MCF_PCISCR_DT(x) (((x)&0x00000003)<<25)
41758 +#define MCF_PCISCR_TS (0x08000000)
41759 +#define MCF_PCISCR_TR (0x10000000)
41760 +#define MCF_PCISCR_MA (0x20000000)
41761 +#define MCF_PCISCR_SE (0x40000000)
41762 +#define MCF_PCISCR_PE (0x80000000)
41764 +/* Bit definitions and macros for MCF_PCICCRIR */
41765 +#define MCF_PCICCRIR_REVID(x) (((x)&0x000000FF)<<0)
41766 +#define MCF_PCICCRIR_CLASSCODE(x) (((x)&0x00FFFFFF)<<8)
41768 +/* Bit definitions and macros for MCF_PCICR1 */
41769 +#define MCF_PCICR1_CACHELINESIZE(x) (((x)&0x0000000F)<<0)
41770 +#define MCF_PCICR1_LATTIMER(x) (((x)&0x000000FF)<<8)
41771 +#define MCF_PCICR1_HEADERTYPE(x) (((x)&0x000000FF)<<16)
41772 +#define MCF_PCICR1_BIST(x) (((x)&0x000000FF)<<24)
41774 +/* Bit definitions and macros for MCF_PCIBAR# */
41775 +#define MCF_PCIBAR0_ADDR(x) (((x)&0x00003FFF)<<18)
41776 +#define MCF_PCIBAR1_ADDR(x) (((x)&0x00000003)<<30)
41778 +/* Bit definitions and macros for MCF_PCICR2 */
41779 +#define MCF_PCICR2_INTLINE(x) (((x)&0x000000FF)<<0)
41780 +#define MCF_PCICR2_INTPIN(x) (((x)&0x000000FF)<<8)
41781 +#define MCF_PCICR2_MINGNT(x) (((x)&0x000000FF)<<16)
41782 +#define MCF_PCICR2_MAXLAT(x) (((x)&0x000000FF)<<24)
41784 +/* Bit definitions and macros for MCF_PCIGSCR */
41785 +#define MCF_PCIGSCR_PR (0x00000001)
41786 +#define MCF_PCIGSCR_SEE (0x00001000)
41787 +#define MCF_PCIGSCR_PEE (0x00002000)
41788 +#define MCF_PCIGSCR_SE (0x10000000)
41789 +#define MCF_PCIGSCR_PE (0x20000000)
41791 +/* Bit definitions and macros for MCF_PCITBATR0 */
41792 +#define MCF_PCITBATR0_EN (0x00000001)
41793 +#define MCF_PCITBATR0_BAT0(x) (((x)&0x00003FFF)<<18)
41795 +/* Bit definitions and macros for MCF_PCITBATR1 */
41796 +#define MCF_PCITBATR1_EN (0x00000001)
41797 +#define MCF_PCITBATR1_BAT1(x) (((x)&0x00000003)<<30)
41799 +/* Bit definitions and macros for MCF_PCITCR */
41800 +#define MCF_PCITCR_P (0x00010000)
41801 +#define MCF_PCITCR_LD (0x01000000)
41803 +/* Bit definitions and macros for MCF_PCIIW0BTAR */
41804 +#define MCF_PCIIW0BTAR_WTA0(x) (((x)&0x000000FF)<<8)
41805 +#define MCF_PCIIW0BTAR_WAM0(x) (((x)&0x000000FF)<<16)
41806 +#define MCF_PCIIW0BTAR_WBA0(x) (((x)&0x000000FF)<<24)
41808 +/* Bit definitions and macros for MCF_PCIIW1BTAR */
41809 +#define MCF_PCIIW1BTAR_WTA1(x) (((x)&0x000000FF)<<8)
41810 +#define MCF_PCIIW1BTAR_WAM1(x) (((x)&0x000000FF)<<16)
41811 +#define MCF_PCIIW1BTAR_WBA1(x) (((x)&0x000000FF)<<24)
41813 +/* Bit definitions and macros for MCF_PCIIW2BTAR */
41814 +#define MCF_PCIIW2BTAR_WTA2(x) (((x)&0x000000FF)<<8)
41815 +#define MCF_PCIIW2BTAR_WAM2(x) (((x)&0x000000FF)<<16)
41816 +#define MCF_PCIIW2BTAR_WBA2(x) (((x)&0x000000FF)<<24)
41818 +/* Bit definitions and macros for MCF_PCIIWCR */
41819 +#define MCF_PCIIWCR_WINCTRL2(x) (((x)&0x0000000F)<<8)
41820 +#define MCF_PCIIWCR_WINCTRL1(x) (((x)&0x0000000F)<<16)
41821 +#define MCF_PCIIWCR_WINCTRL0(x) (((x)&0x0000000F)<<24)
41822 +#define MCF_PCIIWCR_WINCTRL0_MEMREAD (0x01000000)
41823 +#define MCF_PCIIWCR_WINCTRL0_MEMRDLINE (0x03000000)
41824 +#define MCF_PCIIWCR_WINCTRL0_MEMRDMUL (0x05000000)
41825 +#define MCF_PCIIWCR_WINCTRL0_IO (0x09000000)
41826 +#define MCF_PCIIWCR_WINCTRL0_E (0x01000000)
41827 +#define MCF_PCIIWCR_WINCTRL1_MEMREAD (0x00010000)
41828 +#define MCF_PCIIWCR_WINCTRL1_MEMRDLINE (0x00030000)
41829 +#define MCF_PCIIWCR_WINCTRL1_MEMRDMUL (0x00050000)
41830 +#define MCF_PCIIWCR_WINCTRL1_IO (0x00090000)
41831 +#define MCF_PCIIWCR_WINCTRL1_E (0x00010000)
41832 +#define MCF_PCIIWCR_WINCTRL2_MEMREAD (0x00000100)
41833 +#define MCF_PCIIWCR_WINCTRL2_MEMRDLINE (0x00000300)
41834 +#define MCF_PCIIWCR_WINCTRL2_MEMRDMUL (0x00000500)
41835 +#define MCF_PCIIWCR_WINCTRL2_IO (0x00000900)
41836 +#define MCF_PCIIWCR_WINCTRL2_E (0x00000100)
41839 +/* Bit definitions and macros for MCF_PCIICR */
41840 +#define MCF_PCIICR_MAXRETRY(x) (((x)&0x000000FF)<<0)
41841 +#define MCF_PCIICR_TAE (0x01000000)
41842 +#define MCF_PCIICR_IAE (0x02000000)
41843 +#define MCF_PCIICR_REE (0x04000000)
41845 +/* Bit definitions and macros for MCF_PCIISR */
41846 +#define MCF_PCIISR_TA (0x01000000)
41847 +#define MCF_PCIISR_IA (0x02000000)
41848 +#define MCF_PCIISR_RE (0x04000000)
41850 +/* Bit definitions and macros for MCF_PCICAR */
41851 +#define MCF_PCICAR_DWORD(x) (((x)&0x0000003F)<<2)
41852 +#define MCF_PCICAR_FUNCNUM(x) (((x)&0x00000007)<<8)
41853 +#define MCF_PCICAR_DEVNUM(x) (((x)&0x0000001F)<<11)
41854 +#define MCF_PCICAR_BUSNUM(x) (((x)&0x000000FF)<<16)
41855 +#define MCF_PCICAR_E (0x80000000)
41857 +/* Bit definitions and macros for MCF_PCITPSR */
41858 +#define MCF_PCITPSR_PKTSIZE(x) (((x)&0x0000FFFF)<<16)
41860 +/* Bit definitions and macros for MCF_PCITTCR */
41861 +#define MCF_PCITTCR_DI (0x00000001)
41862 +#define MCF_PCITTCR_W (0x00000010)
41863 +#define MCF_PCITTCR_MAXBEATS(x) (((x)&0x00000007)<<8)
41864 +#define MCF_PCITTCR_MAXRETRY(x) (((x)&0x000000FF)<<16)
41865 +#define MCF_PCITTCR_PCICMD(x) (((x)&0x0000000F)<<24)
41867 +/* Bit definitions and macros for MCF_PCITER */
41868 +#define MCF_PCITER_NE (0x00010000)
41869 +#define MCF_PCITER_IAE (0x00020000)
41870 +#define MCF_PCITER_TAE (0x00040000)
41871 +#define MCF_PCITER_RE (0x00080000)
41872 +#define MCF_PCITER_SE (0x00100000)
41873 +#define MCF_PCITER_FEE (0x00200000)
41874 +#define MCF_PCITER_ME (0x01000000)
41875 +#define MCF_PCITER_BE (0x08000000)
41876 +#define MCF_PCITER_CM (0x10000000)
41877 +#define MCF_PCITER_RF (0x40000000)
41878 +#define MCF_PCITER_RC (0x80000000)
41880 +/* Bit definitions and macros for MCF_PCITDCR */
41881 +#define MCF_PCITDCR_PKTSDONE(x) (((x)&0x0000FFFF)<<0)
41882 +#define MCF_PCITDCR_BYTESDONE(x) (((x)&0x0000FFFF)<<16)
41884 +/* Bit definitions and macros for MCF_PCITSR */
41885 +#define MCF_PCITSR_IA (0x00010000)
41886 +#define MCF_PCITSR_TA (0x00020000)
41887 +#define MCF_PCITSR_RE (0x00040000)
41888 +#define MCF_PCITSR_SE (0x00080000)
41889 +#define MCF_PCITSR_FE (0x00100000)
41890 +#define MCF_PCITSR_BE1 (0x00200000)
41891 +#define MCF_PCITSR_BE2 (0x00400000)
41892 +#define MCF_PCITSR_BE3 (0x00800000)
41893 +#define MCF_PCITSR_NT (0x01000000)
41895 +/* Bit definitions and macros for MCF_PCITFSR */
41896 +#define MCF_PCITFSR_EMT (0x00010000)
41897 +#define MCF_PCITFSR_ALARM (0x00020000)
41898 +#define MCF_PCITFSR_FU (0x00040000)
41899 +#define MCF_PCITFSR_FR (0x00080000)
41900 +#define MCF_PCITFSR_OF (0x00100000)
41901 +#define MCF_PCITFSR_UF (0x00200000)
41902 +#define MCF_PCITFSR_RXW (0x00400000)
41904 +/* Bit definitions and macros for MCF_PCITFCR */
41905 +#define MCF_PCITFCR_OF_MSK (0x00080000)
41906 +#define MCF_PCITFCR_UF_MSK (0x00100000)
41907 +#define MCF_PCITFCR_RXW_MSK (0x00200000)
41908 +#define MCF_PCITFCR_FAE_MSK (0x00400000)
41909 +#define MCF_PCITFCR_IP_MSK (0x00800000)
41910 +#define MCF_PCITFCR_GR(x) (((x)&0x00000007)<<24)
41912 +/* Bit definitions and macros for MCF_PCITFAR */
41913 +#define MCF_PCITFAR_ALARM(x) (((x)&0x0000007F)<<0)
41915 +/* Bit definitions and macros for MCF_PCITFRPR */
41916 +#define MCF_PCITFRPR_READ(x) (((x)&0x00000FFF)<<0)
41918 +/* Bit definitions and macros for MCF_PCITFWPR */
41919 +#define MCF_PCITFWPR_WRITE(x) (((x)&0x00000FFF)<<0)
41921 +/* Bit definitions and macros for MCF_PCIRPSR */
41922 +#define MCF_PCIRPSR_PKTSIZE(x) (((x)&0x0000FFFF)<<16)
41924 +/* Bit definitions and macros for MCF_PCIRTCR */
41925 +#define MCF_PCIRTCR_DI (0x00000001)
41926 +#define MCF_PCIRTCR_W (0x00000010)
41927 +#define MCF_PCIRTCR_MAXBEATS(x) (((x)&0x00000007)<<8)
41928 +#define MCF_PCIRTCR_FB (0x00001000)
41929 +#define MCF_PCIRTCR_MAXRETRY(x) (((x)&0x000000FF)<<16)
41930 +#define MCF_PCIRTCR_PCICMD(x) (((x)&0x0000000F)<<24)
41932 +/* Bit definitions and macros for MCF_PCIRER */
41933 +#define MCF_PCIRER_NE (0x00010000)
41934 +#define MCF_PCIRER_IAE (0x00020000)
41935 +#define MCF_PCIRER_TAE (0x00040000)
41936 +#define MCF_PCIRER_RE (0x00080000)
41937 +#define MCF_PCIRER_SE (0x00100000)
41938 +#define MCF_PCIRER_FEE (0x00200000)
41939 +#define MCF_PCIRER_ME (0x01000000)
41940 +#define MCF_PCIRER_BE (0x08000000)
41941 +#define MCF_PCIRER_CM (0x10000000)
41942 +#define MCF_PCIRER_FE (0x20000000)
41943 +#define MCF_PCIRER_RF (0x40000000)
41944 +#define MCF_PCIRER_RC (0x80000000)
41946 +/* Bit definitions and macros for MCF_PCIRDCR */
41947 +#define MCF_PCIRDCR_PKTSDONE(x) (((x)&0x0000FFFF)<<0)
41948 +#define MCF_PCIRDCR_BYTESDONE(x) (((x)&0x0000FFFF)<<16)
41950 +/* Bit definitions and macros for MCF_PCIRSR */
41951 +#define MCF_PCIRSR_IA (0x00010000)
41952 +#define MCF_PCIRSR_TA (0x00020000)
41953 +#define MCF_PCIRSR_RE (0x00040000)
41954 +#define MCF_PCIRSR_SE (0x00080000)
41955 +#define MCF_PCIRSR_FE (0x00100000)
41956 +#define MCF_PCIRSR_BE1 (0x00200000)
41957 +#define MCF_PCIRSR_BE2 (0x00400000)
41958 +#define MCF_PCIRSR_BE3 (0x00800000)
41959 +#define MCF_PCIRSR_NT (0x01000000)
41961 +/* Bit definitions and macros for MCF_PCIRFSR */
41962 +#define MCF_PCIRFSR_EMT (0x00010000)
41963 +#define MCF_PCIRFSR_ALARM (0x00020000)
41964 +#define MCF_PCIRFSR_FU (0x00040000)
41965 +#define MCF_PCIRFSR_FR (0x00080000)
41966 +#define MCF_PCIRFSR_OF (0x00100000)
41967 +#define MCF_PCIRFSR_UF (0x00200000)
41968 +#define MCF_PCIRFSR_RXW (0x00400000)
41970 +/* Bit definitions and macros for MCF_PCIRFCR */
41971 +#define MCF_PCIRFCR_OF_MSK (0x00080000)
41972 +#define MCF_PCIRFCR_UF_MSK (0x00100000)
41973 +#define MCF_PCIRFCR_RXW_MSK (0x00200000)
41974 +#define MCF_PCIRFCR_FAE_MSK (0x00400000)
41975 +#define MCF_PCIRFCR_IP_MSK (0x00800000)
41976 +#define MCF_PCIRFCR_GR(x) (((x)&0x00000007)<<24)
41978 +/* Bit definitions and macros for MCF_PCIRFAR */
41979 +#define MCF_PCIRFAR_ALARM(x) (((x)&0x0000007F)<<0)
41981 +/* Bit definitions and macros for MCF_PCIRFRPR */
41982 +#define MCF_PCIRFRPR_READ(x) (((x)&0x00000FFF)<<0)
41984 +/* Bit definitions and macros for MCF_PCIRFWPR */
41985 +#define MCF_PCIRFWPR_WRITE(x) (((x)&0x00000FFF)<<0)
41988 +/* Bit definitions and macros for MCF_PCIARB_PACR */
41989 +#define MCF_PCIARB_PACR_INTMPRI (0x00000001)
41990 +#define MCF_PCIARB_PACR_EXTMPRI(x) (((x)&0x0000001F)<<1)
41991 +#define MCF_PCIARB_PACR_INTMINTEN (0x00010000)
41992 +#define MCF_PCIARB_PACR_EXTMINTEN(x) (((x)&0x0000001F)<<17)
41993 +#define MCF_PCIARB_PACR_PKMD (0x40000000)
41994 +#define MCF_PCIARB_PACR_DS (0x80000000)
41996 +/* Bit definitions and macros for MCF_PCIARB_PASR */
41997 +#define MCF_PCIARB_PASR_ITLMBK (0x00010000)
41998 +#define MCF_PCIARB_PASR_EXTMBK(x) (((x)&0x0000001F)<<17)
42000 +#endif /* __MCF548X_PCI_H__ */
42002 +++ b/include/asm-m68k/m5485psc.h
42005 + * File: mcf548x_psc.h
42006 + * Purpose: Register and bit definitions for the MCF548X
42012 +#ifndef __MCF548X_PSC_H__
42013 +#define __MCF548X_PSC_H__
42015 +/*********************************************************************
42017 +* Programmable Serial Controller (PSC)
42019 +*********************************************************************/
42021 +/* Register read/write macros */
42022 +#define MCF_PSC_MR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008600))
42023 +#define MCF_PSC_SR0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008604))
42024 +#define MCF_PSC_CSR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008604))
42025 +#define MCF_PSC_CR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008608))
42026 +#define MCF_PSC_RB0 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C))
42027 +#define MCF_PSC_TB0 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C))
42028 +#define MCF_PSC_TB_8BIT0 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C))
42029 +#define MCF_PSC_TB_16BIT0 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C))
42030 +#define MCF_PSC_TB_AC970 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C))
42031 +#define MCF_PSC_IPCR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008610))
42032 +#define MCF_PSC_ACR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008610))
42033 +#define MCF_PSC_ISR0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008614))
42034 +#define MCF_PSC_IMR0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008614))
42035 +#define MCF_PSC_CTUR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008618))
42036 +#define MCF_PSC_CTLR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00861C))
42037 +#define MCF_PSC_IP0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008634))
42038 +#define MCF_PSC_OPSET0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008638))
42039 +#define MCF_PSC_OPRESET0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00863C))
42040 +#define MCF_PSC_SICR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008640))
42041 +#define MCF_PSC_IRCR10 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008644))
42042 +#define MCF_PSC_IRCR20 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008648))
42043 +#define MCF_PSC_IRSDR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00864C))
42044 +#define MCF_PSC_IRMDR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008650))
42045 +#define MCF_PSC_IRFDR0 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008654))
42046 +#define MCF_PSC_RFCNT0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008658))
42047 +#define MCF_PSC_TFCNT0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00865C))
42048 +#define MCF_PSC_RFSR0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008664))
42049 +#define MCF_PSC_TFSR0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008684))
42050 +#define MCF_PSC_RFCR0 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008668))
42051 +#define MCF_PSC_TFCR0 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008688))
42052 +#define MCF_PSC_RFAR0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00866E))
42053 +#define MCF_PSC_TFAR0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00868E))
42054 +#define MCF_PSC_RFRP0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008672))
42055 +#define MCF_PSC_TFRP0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008692))
42056 +#define MCF_PSC_RFWP0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008676))
42057 +#define MCF_PSC_TFWP0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008696))
42058 +#define MCF_PSC_RLRFP0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00867A))
42059 +#define MCF_PSC_TLRFP0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00869A))
42060 +#define MCF_PSC_RLWFP0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00867E))
42061 +#define MCF_PSC_TLWFP0 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00869E))
42062 +#define MCF_PSC_MR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008700))
42063 +#define MCF_PSC_SR1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008704))
42064 +#define MCF_PSC_CSR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008704))
42065 +#define MCF_PSC_CR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008708))
42066 +#define MCF_PSC_RB1 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00870C))
42067 +#define MCF_PSC_TB1 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00870C))
42068 +#define MCF_PSC_TB_8BIT1 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00870C))
42069 +#define MCF_PSC_TB_16BIT1 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00870C))
42070 +#define MCF_PSC_TB_AC971 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00870C))
42071 +#define MCF_PSC_IPCR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008710))
42072 +#define MCF_PSC_ACR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008710))
42073 +#define MCF_PSC_ISR1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008714))
42074 +#define MCF_PSC_IMR1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008714))
42075 +#define MCF_PSC_CTUR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008718))
42076 +#define MCF_PSC_CTLR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00871C))
42077 +#define MCF_PSC_IP1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008734))
42078 +#define MCF_PSC_OPSET1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008738))
42079 +#define MCF_PSC_OPRESET1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00873C))
42080 +#define MCF_PSC_SICR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008740))
42081 +#define MCF_PSC_IRCR11 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008744))
42082 +#define MCF_PSC_IRCR21 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008748))
42083 +#define MCF_PSC_IRSDR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00874C))
42084 +#define MCF_PSC_IRMDR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008750))
42085 +#define MCF_PSC_IRFDR1 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008754))
42086 +#define MCF_PSC_RFCNT1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008758))
42087 +#define MCF_PSC_TFCNT1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00875C))
42088 +#define MCF_PSC_RFSR1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008764))
42089 +#define MCF_PSC_TFSR1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008784))
42090 +#define MCF_PSC_RFCR1 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008768))
42091 +#define MCF_PSC_TFCR1 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008788))
42092 +#define MCF_PSC_RFAR1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00876E))
42093 +#define MCF_PSC_TFAR1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00878E))
42094 +#define MCF_PSC_RFRP1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008772))
42095 +#define MCF_PSC_TFRP1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008792))
42096 +#define MCF_PSC_RFWP1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008776))
42097 +#define MCF_PSC_TFWP1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008796))
42098 +#define MCF_PSC_RLRFP1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00877A))
42099 +#define MCF_PSC_TLRFP1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00879A))
42100 +#define MCF_PSC_RLWFP1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00877E))
42101 +#define MCF_PSC_TLWFP1 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00879E))
42102 +#define MCF_PSC_MR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008800))
42103 +#define MCF_PSC_SR2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008804))
42104 +#define MCF_PSC_CSR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008804))
42105 +#define MCF_PSC_CR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008808))
42106 +#define MCF_PSC_RB2 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00880C))
42107 +#define MCF_PSC_TB2 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00880C))
42108 +#define MCF_PSC_TB_8BIT2 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00880C))
42109 +#define MCF_PSC_TB_16BIT2 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00880C))
42110 +#define MCF_PSC_TB_AC972 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00880C))
42111 +#define MCF_PSC_IPCR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008810))
42112 +#define MCF_PSC_ACR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008810))
42113 +#define MCF_PSC_ISR2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008814))
42114 +#define MCF_PSC_IMR2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008814))
42115 +#define MCF_PSC_CTUR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008818))
42116 +#define MCF_PSC_CTLR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00881C))
42117 +#define MCF_PSC_IP2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008834))
42118 +#define MCF_PSC_OPSET2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008838))
42119 +#define MCF_PSC_OPRESET2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00883C))
42120 +#define MCF_PSC_SICR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008840))
42121 +#define MCF_PSC_IRCR12 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008844))
42122 +#define MCF_PSC_IRCR22 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008848))
42123 +#define MCF_PSC_IRSDR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00884C))
42124 +#define MCF_PSC_IRMDR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008850))
42125 +#define MCF_PSC_IRFDR2 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008854))
42126 +#define MCF_PSC_RFCNT2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008858))
42127 +#define MCF_PSC_TFCNT2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00885C))
42128 +#define MCF_PSC_RFSR2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008864))
42129 +#define MCF_PSC_TFSR2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008884))
42130 +#define MCF_PSC_RFCR2 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008868))
42131 +#define MCF_PSC_TFCR2 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008888))
42132 +#define MCF_PSC_RFAR2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00886E))
42133 +#define MCF_PSC_TFAR2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00888E))
42134 +#define MCF_PSC_RFRP2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008872))
42135 +#define MCF_PSC_TFRP2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008892))
42136 +#define MCF_PSC_RFWP2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008876))
42137 +#define MCF_PSC_TFWP2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008896))
42138 +#define MCF_PSC_RLRFP2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00887A))
42139 +#define MCF_PSC_TLRFP2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00889A))
42140 +#define MCF_PSC_RLWFP2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00887E))
42141 +#define MCF_PSC_TLWFP2 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00889E))
42142 +#define MCF_PSC_MR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008900))
42143 +#define MCF_PSC_SR3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008904))
42144 +#define MCF_PSC_CSR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008904))
42145 +#define MCF_PSC_CR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008908))
42146 +#define MCF_PSC_RB3 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00890C))
42147 +#define MCF_PSC_TB3 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00890C))
42148 +#define MCF_PSC_TB_8BIT3 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00890C))
42149 +#define MCF_PSC_TB_16BIT3 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00890C))
42150 +#define MCF_PSC_TB_AC973 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00890C))
42151 +#define MCF_PSC_IPCR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008910))
42152 +#define MCF_PSC_ACR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008910))
42153 +#define MCF_PSC_ISR3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008914))
42154 +#define MCF_PSC_IMR3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008914))
42155 +#define MCF_PSC_CTUR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008918))
42156 +#define MCF_PSC_CTLR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00891C))
42157 +#define MCF_PSC_IP3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008934))
42158 +#define MCF_PSC_OPSET3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008938))
42159 +#define MCF_PSC_OPRESET3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00893C))
42160 +#define MCF_PSC_SICR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008940))
42161 +#define MCF_PSC_IRCR13 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008944))
42162 +#define MCF_PSC_IRCR23 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008948))
42163 +#define MCF_PSC_IRSDR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00894C))
42164 +#define MCF_PSC_IRMDR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008950))
42165 +#define MCF_PSC_IRFDR3 (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008954))
42166 +#define MCF_PSC_RFCNT3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008958))
42167 +#define MCF_PSC_TFCNT3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00895C))
42168 +#define MCF_PSC_RFSR3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008964))
42169 +#define MCF_PSC_TFSR3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008984))
42170 +#define MCF_PSC_RFCR3 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008968))
42171 +#define MCF_PSC_TFCR3 (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008988))
42172 +#define MCF_PSC_RFAR3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00896E))
42173 +#define MCF_PSC_TFAR3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00898E))
42174 +#define MCF_PSC_RFRP3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008972))
42175 +#define MCF_PSC_TFRP3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008992))
42176 +#define MCF_PSC_RFWP3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008976))
42177 +#define MCF_PSC_TFWP3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008996))
42178 +#define MCF_PSC_RLRFP3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00897A))
42179 +#define MCF_PSC_TLRFP3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00899A))
42180 +#define MCF_PSC_RLWFP3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00897E))
42181 +#define MCF_PSC_TLWFP3 (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00899E))
42182 +#define MCF_PSC_MR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008600+((x)*0x100)))
42183 +#define MCF_PSC_SR(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008604+((x)*0x100)))
42184 +#define MCF_PSC_CSR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008604+((x)*0x100)))
42185 +#define MCF_PSC_CR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008608+((x)*0x100)))
42186 +#define MCF_PSC_RB(x) (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C+((x)*0x100)))
42187 +#define MCF_PSC_TB(x) (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C+((x)*0x100)))
42188 +#define MCF_PSC_TB_8BIT(x) (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C+((x)*0x100)))
42189 +#define MCF_PSC_TB_16BIT(x) (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C+((x)*0x100)))
42190 +#define MCF_PSC_TB_AC97(x) (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x00860C+((x)*0x100)))
42191 +#define MCF_PSC_IPCR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008610+((x)*0x100)))
42192 +#define MCF_PSC_ACR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008610+((x)*0x100)))
42193 +#define MCF_PSC_ISR(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008614+((x)*0x100)))
42194 +#define MCF_PSC_IMR(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008614+((x)*0x100)))
42195 +#define MCF_PSC_CTUR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008618+((x)*0x100)))
42196 +#define MCF_PSC_CTLR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00861C+((x)*0x100)))
42197 +#define MCF_PSC_IP(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008634+((x)*0x100)))
42198 +#define MCF_PSC_OPSET(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008638+((x)*0x100)))
42199 +#define MCF_PSC_OPRESET(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00863C+((x)*0x100)))
42200 +#define MCF_PSC_SICR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008640+((x)*0x100)))
42201 +#define MCF_PSC_IRCR1(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008644+((x)*0x100)))
42202 +#define MCF_PSC_IRCR2(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008648+((x)*0x100)))
42203 +#define MCF_PSC_IRSDR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x00864C+((x)*0x100)))
42204 +#define MCF_PSC_IRMDR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008650+((x)*0x100)))
42205 +#define MCF_PSC_IRFDR(x) (*(volatile uint8_t *)(void*)(MCF_MBAR + 0x008654+((x)*0x100)))
42206 +#define MCF_PSC_RFCNT(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008658+((x)*0x100)))
42207 +#define MCF_PSC_TFCNT(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00865C+((x)*0x100)))
42208 +#define MCF_PSC_RFSR(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008664+((x)*0x100)))
42209 +#define MCF_PSC_TFSR(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008684+((x)*0x100)))
42210 +#define MCF_PSC_RFCR(x) (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008668+((x)*0x100)))
42211 +#define MCF_PSC_TFCR(x) (*(volatile uint32_t*)(void*)(MCF_MBAR + 0x008688+((x)*0x100)))
42212 +#define MCF_PSC_RFAR(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + (0x00866E)+((x)*0x100)))
42213 +#define MCF_PSC_TFAR(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + (0x00868E)+((x)*0x100)))
42214 +#define MCF_PSC_RFRP(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008672+((x)*0x100)))
42215 +#define MCF_PSC_TFRP(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008692+((x)*0x100)))
42216 +#define MCF_PSC_RFWP(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008676+((x)*0x100)))
42217 +#define MCF_PSC_TFWP(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x008696+((x)*0x100)))
42218 +#define MCF_PSC_RLRFP(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00867A+((x)*0x100)))
42219 +#define MCF_PSC_TLRFP(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00869A+((x)*0x100)))
42220 +#define MCF_PSC_RLWFP(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00867E+((x)*0x100)))
42221 +#define MCF_PSC_TLWFP(x) (*(volatile uint16_t*)(void*)(MCF_MBAR + 0x00869E+((x)*0x100)))
42223 +/* Bit definitions and macros for MCF_PSC_MR */
42224 +#define MCF_PSC_MR_BC(x) (((x)&0x03)<<0)
42225 +#define MCF_PSC_MR_PT (0x04)
42226 +#define MCF_PSC_MR_PM(x) (((x)&0x03)<<3)
42227 +#define MCF_PSC_MR_ERR (0x20)
42228 +#define MCF_PSC_MR_RXIRQ (0x40)
42229 +#define MCF_PSC_MR_RXRTS (0x80)
42230 +#define MCF_PSC_MR_SB(x) (((x)&0x0F)<<0)
42231 +#define MCF_PSC_MR_TXCTS (0x10)
42232 +#define MCF_PSC_MR_TXRTS (0x20)
42233 +#define MCF_PSC_MR_CM(x) (((x)&0x03)<<6)
42234 +#define MCF_PSC_MR_PM_MULTI_ADDR (0x1C)
42235 +#define MCF_PSC_MR_PM_MULTI_DATA (0x18)
42236 +#define MCF_PSC_MR_PM_NONE (0x10)
42237 +#define MCF_PSC_MR_PM_FORCE_HI (0x0C)
42238 +#define MCF_PSC_MR_PM_FORCE_LO (0x08)
42239 +#define MCF_PSC_MR_PM_ODD (0x04)
42240 +#define MCF_PSC_MR_PM_EVEN (0x00)
42241 +#define MCF_PSC_MR_BC_5 (0x00)
42242 +#define MCF_PSC_MR_BC_6 (0x01)
42243 +#define MCF_PSC_MR_BC_7 (0x02)
42244 +#define MCF_PSC_MR_BC_8 (0x03)
42245 +#define MCF_PSC_MR_CM_NORMAL (0x00)
42246 +#define MCF_PSC_MR_CM_ECHO (0x40)
42247 +#define MCF_PSC_MR_CM_LOCAL_LOOP (0x80)
42248 +#define MCF_PSC_MR_CM_REMOTE_LOOP (0xC0)
42249 +#define MCF_PSC_MR_SB_STOP_BITS_1 (0x07)
42250 +#define MCF_PSC_MR_SB_STOP_BITS_15 (0x08)
42251 +#define MCF_PSC_MR_SB_STOP_BITS_2 (0x0F)
42253 +/* Bit definitions and macros for MCF_PSC_SR */
42254 +#define MCF_PSC_SR_ERR (0x0040)
42255 +#define MCF_PSC_SR_CDE_DEOF (0x0080)
42256 +#define MCF_PSC_SR_RXRDY (0x0100)
42257 +#define MCF_PSC_SR_FU (0x0200)
42258 +#define MCF_PSC_SR_TXRDY (0x0400)
42259 +#define MCF_PSC_SR_TXEMP_URERR (0x0800)
42260 +#define MCF_PSC_SR_OE (0x1000)
42261 +#define MCF_PSC_SR_PE_CRCERR (0x2000)
42262 +#define MCF_PSC_SR_FE_PHYERR (0x4000)
42263 +#define MCF_PSC_SR_RB_NEOF (0x8000)
42265 +/* Bit definitions and macros for MCF_PSC_CSR */
42266 +#define MCF_PSC_CSR_TCSEL(x) (((x)&0x0F)<<0)
42267 +#define MCF_PSC_CSR_RCSEL(x) (((x)&0x0F)<<4)
42268 +#define MCF_PSC_CSR_RCSEL_SYS_CLK (0xD0)
42269 +#define MCF_PSC_CSR_RCSEL_CTM16 (0xE0)
42270 +#define MCF_PSC_CSR_RCSEL_CTM (0xF0)
42271 +#define MCF_PSC_CSR_TCSEL_SYS_CLK (0x0D)
42272 +#define MCF_PSC_CSR_TCSEL_CTM16 (0x0E)
42273 +#define MCF_PSC_CSR_TCSEL_CTM (0x0F)
42275 +/* Bit definitions and macros for MCF_PSC_CR */
42276 +#define MCF_PSC_CR_RXC(x) (((x)&0x03)<<0)
42277 +#define MCF_PSC_CR_TXC(x) (((x)&0x03)<<2)
42278 +#define MCF_PSC_CR_MISC(x) (((x)&0x07)<<4)
42279 +#define MCF_PSC_CR_NONE (0x00)
42280 +#define MCF_PSC_CR_STOP_BREAK (0x70)
42281 +#define MCF_PSC_CR_START_BREAK (0x60)
42282 +#define MCF_PSC_CR_BKCHGINT (0x50)
42283 +#define MCF_PSC_CR_RESET_ERROR (0x40)
42284 +#define MCF_PSC_CR_RESET_TX (0x30)
42285 +#define MCF_PSC_CR_RESET_RX (0x20)
42286 +#define MCF_PSC_CR_RESET_MR (0x10)
42287 +#define MCF_PSC_CR_TX_DISABLED (0x08)
42288 +#define MCF_PSC_CR_TX_ENABLED (0x04)
42289 +#define MCF_PSC_CR_RX_DISABLED (0x02)
42290 +#define MCF_PSC_CR_RX_ENABLED (0x01)
42292 +/* Bit definitions and macros for MCF_PSC_TB_8BIT */
42293 +#define MCF_PSC_TB_8BIT_TB3(x) (((x)&0x000000FF)<<0)
42294 +#define MCF_PSC_TB_8BIT_TB2(x) (((x)&0x000000FF)<<8)
42295 +#define MCF_PSC_TB_8BIT_TB1(x) (((x)&0x000000FF)<<16)
42296 +#define MCF_PSC_TB_8BIT_TB0(x) (((x)&0x000000FF)<<24)
42298 +/* Bit definitions and macros for MCF_PSC_TB_16BIT */
42299 +#define MCF_PSC_TB_16BIT_TB1(x) (((x)&0x0000FFFF)<<0)
42300 +#define MCF_PSC_TB_16BIT_TB0(x) (((x)&0x0000FFFF)<<16)
42302 +/* Bit definitions and macros for MCF_PSC_TB_AC97 */
42303 +#define MCF_PSC_TB_AC97_SOF (0x00000800)
42304 +#define MCF_PSC_TB_AC97_TB(x) (((x)&0x000FFFFF)<<12)
42306 +/* Bit definitions and macros for MCF_PSC_IPCR */
42307 +#define MCF_PSC_IPCR_RESERVED (0x0C)
42308 +#define MCF_PSC_IPCR_CTS (0x0D)
42309 +#define MCF_PSC_IPCR_D_CTS (0x1C)
42310 +#define MCF_PSC_IPCR_SYNC (0x8C)
42312 +/* Bit definitions and macros for MCF_PSC_ACR */
42313 +#define MCF_PSC_ACR_IEC0 (0x01)
42314 +#define MCF_PSC_ACR_CTMS(x) (((x)&0x07)<<4)
42315 +#define MCF_PSC_ACR_BRG (0x80)
42317 +/* Bit definitions and macros for MCF_PSC_ISR */
42318 +#define MCF_PSC_ISR_ERR (0x0040)
42319 +#define MCF_PSC_ISR_DEOF (0x0080)
42320 +#define MCF_PSC_ISR_TXRDY (0x0100)
42321 +#define MCF_PSC_ISR_RXRDY_FU (0x0200)
42322 +#define MCF_PSC_ISR_DB (0x0400)
42323 +#define MCF_PSC_ISR_IPC (0x8000)
42325 +/* Bit definitions and macros for MCF_PSC_IMR */
42326 +#define MCF_PSC_IMR_ERR (0x0040)
42327 +#define MCF_PSC_IMR_DEOF (0x0080)
42328 +#define MCF_PSC_IMR_TXRDY (0x0100)
42329 +#define MCF_PSC_IMR_RXRDY_FU (0x0200)
42330 +#define MCF_PSC_IMR_DB (0x0400)
42331 +#define MCF_PSC_IMR_IPC (0x8000)
42333 +/* Bit definitions and macros for MCF_PSC_IP */
42334 +#define MCF_PSC_IP_CTS (0x01)
42335 +#define MCF_PSC_IP_TGL (0x40)
42336 +#define MCF_PSC_IP_LWPR_B (0x80)
42338 +/* Bit definitions and macros for MCF_PSC_OPSET */
42339 +#define MCF_PSC_OPSET_RTS (0x01)
42341 +/* Bit definitions and macros for MCF_PSC_OPRESET */
42342 +#define MCF_PSC_OPRESET_RTS (0x01)
42344 +/* Bit definitions and macros for MCF_PSC_SICR */
42345 +#define MCF_PSC_SICR_SIM(x) (((x)&0x07)<<0)
42346 +#define MCF_PSC_SICR_SHDIR (0x10)
42347 +#define MCF_PSC_SICR_DTS (0x20)
42348 +#define MCF_PSC_SICR_AWR (0x40)
42349 +#define MCF_PSC_SICR_ACRB (0x80)
42350 +#define MCF_PSC_SICR_SIM_UART (0x00)
42351 +#define MCF_PSC_SICR_SIM_MODEM8 (0x01)
42352 +#define MCF_PSC_SICR_SIM_MODEM16 (0x02)
42353 +#define MCF_PSC_SICR_SIM_AC97 (0x03)
42354 +#define MCF_PSC_SICR_SIM_SIR (0x04)
42355 +#define MCF_PSC_SICR_SIM_MIR (0x05)
42356 +#define MCF_PSC_SICR_SIM_FIR (0x06)
42358 +/* Bit definitions and macros for MCF_PSC_IRCR1 */
42359 +#define MCF_PSC_IRCR1_SPUL (0x01)
42360 +#define MCF_PSC_IRCR1_SIPEN (0x02)
42361 +#define MCF_PSC_IRCR1_FD (0x04)
42363 +/* Bit definitions and macros for MCF_PSC_IRCR2 */
42364 +#define MCF_PSC_IRCR2_NXTEOF (0x01)
42365 +#define MCF_PSC_IRCR2_ABORT (0x02)
42366 +#define MCF_PSC_IRCR2_SIPREQ (0x04)
42368 +/* Bit definitions and macros for MCF_PSC_IRMDR */
42369 +#define MCF_PSC_IRMDR_M_FDIV(x) (((x)&0x7F)<<0)
42370 +#define MCF_PSC_IRMDR_FREQ (0x80)
42372 +/* Bit definitions and macros for MCF_PSC_IRFDR */
42373 +#define MCF_PSC_IRFDR_F_FDIV(x) (((x)&0x0F)<<0)
42375 +/* Bit definitions and macros for MCF_PSC_RFCNT */
42376 +#define MCF_PSC_RFCNT_CNT(x) (((x)&0x01FF)<<0)
42378 +/* Bit definitions and macros for MCF_PSC_TFCNT */
42379 +#define MCF_PSC_TFCNT_CNT(x) (((x)&0x01FF)<<0)
42381 +/* Bit definitions and macros for MCF_PSC_RFSR */
42382 +#define MCF_PSC_RFSR_EMT (0x0001)
42383 +#define MCF_PSC_RFSR_ALARM (0x0002)
42384 +#define MCF_PSC_RFSR_FU (0x0004)
42385 +#define MCF_PSC_RFSR_FRMRY (0x0008)
42386 +#define MCF_PSC_RFSR_OF (0x0010)
42387 +#define MCF_PSC_RFSR_UF (0x0020)
42388 +#define MCF_PSC_RFSR_RXW (0x0040)
42389 +#define MCF_PSC_RFSR_FAE (0x0080)
42390 +#define MCF_PSC_RFSR_FRM(x) (((x)&0x000F)<<8)
42391 +#define MCF_PSC_RFSR_TAG (0x1000)
42392 +#define MCF_PSC_RFSR_TXW (0x4000)
42393 +#define MCF_PSC_RFSR_IP (0x8000)
42394 +#define MCF_PSC_RFSR_FRM_BYTE0 (0x0800)
42395 +#define MCF_PSC_RFSR_FRM_BYTE1 (0x0400)
42396 +#define MCF_PSC_RFSR_FRM_BYTE2 (0x0200)
42397 +#define MCF_PSC_RFSR_FRM_BYTE3 (0x0100)
42399 +/* Bit definitions and macros for MCF_PSC_TFSR */
42400 +#define MCF_PSC_TFSR_EMT (0x0001)
42401 +#define MCF_PSC_TFSR_ALARM (0x0002)
42402 +#define MCF_PSC_TFSR_FU (0x0004)
42403 +#define MCF_PSC_TFSR_FRMRY (0x0008)
42404 +#define MCF_PSC_TFSR_OF (0x0010)
42405 +#define MCF_PSC_TFSR_UF (0x0020)
42406 +#define MCF_PSC_TFSR_RXW (0x0040)
42407 +#define MCF_PSC_TFSR_FAE (0x0080)
42408 +#define MCF_PSC_TFSR_FRM(x) (((x)&0x000F)<<8)
42409 +#define MCF_PSC_TFSR_TAG (0x1000)
42410 +#define MCF_PSC_TFSR_TXW (0x4000)
42411 +#define MCF_PSC_TFSR_IP (0x8000)
42412 +#define MCF_PSC_TFSR_FRM_BYTE0 (0x0800)
42413 +#define MCF_PSC_TFSR_FRM_BYTE1 (0x0400)
42414 +#define MCF_PSC_TFSR_FRM_BYTE2 (0x0200)
42415 +#define MCF_PSC_TFSR_FRM_BYTE3 (0x0100)
42417 +/* Bit definitions and macros for MCF_PSC_RFCR */
42418 +#define MCF_PSC_RFCR_CNTR(x) (((x)&0x0000FFFF)<<0)
42419 +#define MCF_PSC_RFCR_TXW_MSK (0x00040000)
42420 +#define MCF_PSC_RFCR_OF_MSK (0x00080000)
42421 +#define MCF_PSC_RFCR_UF_MSK (0x00100000)
42422 +#define MCF_PSC_RFCR_RXW_MSK (0x00200000)
42423 +#define MCF_PSC_RFCR_FAE_MSK (0x00400000)
42424 +#define MCF_PSC_RFCR_IP_MSK (0x00800000)
42425 +#define MCF_PSC_RFCR_GR(x) (((x)&0x00000007)<<24)
42426 +#define MCF_PSC_RFCR_FRMEN (0x08000000)
42427 +#define MCF_PSC_RFCR_TIMER (0x10000000)
42428 +#define MCF_PSC_RFCR_WRITETAG (0x20000000)
42429 +#define MCF_PSC_RFCR_SHADOW (0x80000000)
42431 +/* Bit definitions and macros for MCF_PSC_TFCR */
42432 +#define MCF_PSC_TFCR_CNTR(x) (((x)&0x0000FFFF)<<0)
42433 +#define MCF_PSC_TFCR_TXW_MSK (0x00040000)
42434 +#define MCF_PSC_TFCR_OF_MSK (0x00080000)
42435 +#define MCF_PSC_TFCR_UF_MSK (0x00100000)
42436 +#define MCF_PSC_TFCR_RXW_MSK (0x00200000)
42437 +#define MCF_PSC_TFCR_FAE_MSK (0x00400000)
42438 +#define MCF_PSC_TFCR_IP_MSK (0x00800000)
42439 +#define MCF_PSC_TFCR_GR(x) (((x)&0x00000007)<<24)
42440 +#define MCF_PSC_TFCR_FRMEN (0x08000000)
42441 +#define MCF_PSC_TFCR_TIMER (0x10000000)
42442 +#define MCF_PSC_TFCR_WRITETAG (0x20000000)
42443 +#define MCF_PSC_TFCR_SHADOW (0x80000000)
42445 +/* Bit definitions and macros for MCF_PSC_RFAR */
42446 +#define MCF_PSC_RFAR_ALARM(x) (((x)&0x01FF)<<0)
42448 +/* Bit definitions and macros for MCF_PSC_TFAR */
42449 +#define MCF_PSC_TFAR_ALARM(x) (((x)&0x01FF)<<0)
42451 +/* Bit definitions and macros for MCF_PSC_RFRP */
42452 +#define MCF_PSC_RFRP_READ(x) (((x)&0x01FF)<<0)
42454 +/* Bit definitions and macros for MCF_PSC_TFRP */
42455 +#define MCF_PSC_TFRP_READ(x) (((x)&0x01FF)<<0)
42457 +/* Bit definitions and macros for MCF_PSC_RFWP */
42458 +#define MCF_PSC_RFWP_WRITE(x) (((x)&0x01FF)<<0)
42460 +/* Bit definitions and macros for MCF_PSC_TFWP */
42461 +#define MCF_PSC_TFWP_WRITE(x) (((x)&0x01FF)<<0)
42463 +/* Bit definitions and macros for MCF_PSC_RLRFP */
42464 +#define MCF_PSC_RLRFP_LFP(x) (((x)&0x01FF)<<0)
42466 +/* Bit definitions and macros for MCF_PSC_TLRFP */
42467 +#define MCF_PSC_TLRFP_LFP(x) (((x)&0x01FF)<<0)
42469 +/* Bit definitions and macros for MCF_PSC_RLWFP */
42470 +#define MCF_PSC_RLWFP_LFP(x) (((x)&0x01FF)<<0)
42472 +/* Bit definitions and macros for MCF_PSC_TLWFP */
42473 +#define MCF_PSC_TLWFP_LFP(x) (((x)&0x01FF)<<0)
42475 +/********************************************************************/
42477 +#endif /* __MCF548X_PSC_H__ */
42479 +++ b/include/asm-m68k/m5485sim.h
42482 + * m5485sim.h -- ColdFire 547x/548x System Integration Unit support.
42485 +#ifndef m5485sim_h
42486 +#define m5485sim_h
42490 + * System Integration Unit Registers
42492 +#define MCF_SDRAMDS MCF_REG32(0x000004) /* SDRAM Drive Strength */
42493 +#define MCF_SBCR MCF_REG32(0x000010) /* System Breakpoint Control */
42494 +#define MCF_CSnCFG(x) MCF_REG32(0x000020+(x*4))/* SDRAM Chip Select X */
42495 +#define MCF_SECSACR MCF_REG32(0x000038) /* Sequential Access Control */
42496 +#define MCF_RSR MCF_REG32(0x000044) /* Reset Status */
42497 +#define MCF_JTAGID MCF_REG32(0x000050) /* JTAG Device Identification */
42500 + * FlexBus Chip Selects Registers
42502 +#define MCF_CSARn(x) MCF_REG32(0x000500+(x*0xC))
42503 +#define MCF_CSMRn(x) MCF_REG32(0x000504+(x*0xC))
42504 +#define MCF_CSCRn(x) MCF_REG32(0x000508+(x*0xC))
42507 + * Interrupt Controller Registers
42509 +#define MCF_IPRH MCF_REG32(0x000700)
42510 +#define MCF_IPRL MCF_REG32(0x000704)
42511 +#define MCF_IMRH MCF_REG32(0x000708)
42512 +#define MCF_IMRL MCF_REG32(0x00070C)
42513 +#define MCF_INTFRCH MCF_REG32(0x000710)
42514 +#define MCF_INTFRCL MCF_REG32(0x000714)
42515 +#define MCF_IRLR MCF_REG08(0x000718)
42516 +#define MCF_IACKLPR MCF_REG08(0x000719)
42517 +#define MCF_SWIACK MCF_REG08(0x0007E0)
42518 +#define MCF_LnIACK(x) MCF_REG08(0x0007E4+((x)*0x004))
42519 +#define MCF_ICR(x) MCF_REG08(0x000740+((x)*0x001))
42522 + * Slice Timers Registers
42524 +#define MCF_SLTCNT(x) MCF_REG32(0x000900+((x)*0x010))
42525 +#define MCF_SCR(x) MCF_REG32(0x000904+((x)*0x010))
42526 +#define MCF_SCNT(x) MCF_REG32(0x000908+((x)*0x010))
42527 +#define MCF_SSR(x) MCF_REG32(0x00090C+((x)*0x010))
42530 + * Interrupt sources
42532 +#define ISC_EPORT_Fn(x) (x) /* EPORT Interrupts */
42533 +#define ISC_USB_EPn(x) (15+(x)) /* USB Endopint */
42534 +#define ISC_USB_ISR (22) /* USB General source */
42535 +#define ISC_USB_AISR (22) /* USB core source */
42536 +#define ISC_DSPI_OVRFW (25) /* DSPI overflow */
42537 +#define ISC_DSPI_RFOF (26)
42538 +#define ISC_DSPI_RFDF (27)
42539 +#define ISC_DSPI_TFUF (28)
42540 +#define ISC_DSPI_TCF (29)
42541 +#define ISC_DSPI_TFFF (30)
42542 +#define ISC_DSPI_EOQF (31)
42543 +#define ISC_PSCn(x) (35-(x))
42544 +#define ISC_COMM_TIM (36)
42545 +#define ISC_SEC (37)
42546 +#define ISC_FEC1 (38)
42547 +#define ISC_FEC0 (39)
42548 +#define ISC_I2C (40)
42549 +#define ISC_PCI_ARB (41)
42550 +#define ISC_PCI_CB (42)
42551 +#define ISC_PCI_XLB (43)
42552 +#define ISC_DMA (48)
42553 +#define ISC_CANn_ERR(x) (49+(6*(x)))
42554 +#define ISC_CANn_BUSOFF(x) (50+(6*(x)))
42555 +#define ISC_CANn_MBOR(x) (51+(6*(x)))
42556 +#define ISC_CAN0_WAKEIN (52)
42557 +#define ISC_SLTn(x) (54-(x))
42558 +#define ISC_GPTn(x) (62-(x))
42561 + * Interrupt level and priorities
42563 +#define ILP_TOP (MCF_ICR_IL(5) | MCF_ICR_IP(3))
42564 +#define ILP_SLT0 (MCF_ICR_IL(5) | MCF_ICR_IP(2))
42565 +#define ILP_SLT1 (MCF_ICR_IL(5) | MCF_ICR_IP(1))
42566 +#define ILP_DMA (MCF_ICR_IL(5) | MCF_ICR_IP(0))
42567 +#define ILP_SEC (MCF_ICR_IL(4) | MCF_ICR_IP(7))
42568 +#define ILP_FEC0 (MCF_ICR_IL(4) | MCF_ICR_IP(6))
42569 +#define ILP_FEC1 (MCF_ICR_IL(4) | MCF_ICR_IP(5))
42570 +#define ILP_PCI_XLB (MCF_ICR_IL(4) | MCF_ICR_IP(4))
42571 +#define ILP_PCI_ARB (MCF_ICR_IL(4) | MCF_ICR_IP(3))
42572 +#define ILP_PCI_CB (MCF_ICR_IL(4) | MCF_ICR_IP(2))
42573 +#define ILP_I2C (MCF_ICR_IL(4) | MCF_ICR_IP(1))
42575 +#define ILP_USB_EPn(x) (MCF_ICR_IL(3) | MCF_ICR_IP(7-(x)))
42576 +#define ILP_USB_EP0 (MCF_ICR_IL(3) | MCF_ICR_IP(7))
42577 +#define ILP_USB_EP1 (MCF_ICR_IL(3) | MCF_ICR_IP(6))
42578 +#define ILP_USB_EP2 (MCF_ICR_IL(3) | MCF_ICR_IP(5))
42579 +#define ILP_USB_EP3 (MCF_ICR_IL(3) | MCF_ICR_IP(4))
42580 +#define ILP_USB_EP4 (MCF_ICR_IL(3) | MCF_ICR_IP(3))
42581 +#define ILP_USB_EP5 (MCF_ICR_IL(3) | MCF_ICR_IP(2))
42582 +#define ILP_USB_EP6 (MCF_ICR_IL(3) | MCF_ICR_IP(1))
42583 +#define ILP_USB_ISR (MCF_ICR_IL(3) | MCF_ICR_IP(0))
42585 +#define ILP_USB_AISR (MCF_ICR_IL(2) | MCF_ICR_IP(7))
42586 +#define ILP_DSPI_OVRFW (MCF_ICR_IL(2) | MCF_ICR_IP(6))
42587 +#define ILP_DSPI_RFOF (MCF_ICR_IL(2) | MCF_ICR_IP(5))
42588 +#define ILP_DSPI_RFDF (MCF_ICR_IL(2) | MCF_ICR_IP(4))
42589 +#define ILP_DSPI_TFUF (MCF_ICR_IL(2) | MCF_ICR_IP(3))
42590 +#define ILP_DSPI_TCF (MCF_ICR_IL(2) | MCF_ICR_IP(2))
42591 +#define ILP_DSPI_TFFF (MCF_ICR_IL(2) | MCF_ICR_IP(1))
42592 +#define ILP_DSPI_EOQF (MCF_ICR_IL(2) | MCF_ICR_IP(0))
42594 +#define ILP_COMM_TIM (MCF_ICR_IL(1) | MCF_ICR_IP(7))
42595 +#define ILP_PSCn(x) (MCF_ICR_IL(1) | MCF_ICR_IP(3-((x)&3)))
42596 +#define ILP_PSC0 (MCF_ICR_IL(1) | MCF_ICR_IP(3))
42597 +#define ILP_PSC1 (MCF_ICR_IL(1) | MCF_ICR_IP(2))
42598 +#define ILP_PSC2 (MCF_ICR_IL(1) | MCF_ICR_IP(1))
42599 +#define ILP_PSC3 (MCF_ICR_IL(1) | MCF_ICR_IP(0))
42605 +/********************************************************************/
42608 + * System Integration Unit Bitfields
42612 +#define MCF_SBCR_PIN2DSPI (0x08000000)
42613 +#define MCF_SBCR_DMA2CPU (0x10000000)
42614 +#define MCF_SBCR_CPU2DMA (0x20000000)
42615 +#define MCF_SBCR_PIN2DMA (0x40000000)
42616 +#define MCF_SBCR_PIN2CPU (0x80000000)
42619 +#define MCF_SECSACR_SEQEN (0x00000001)
42622 +#define MCF_RSR_RST (0x00000001)
42623 +#define MCF_RSR_RSTWD (0x00000002)
42624 +#define MCF_RSR_RSTJTG (0x00000008)
42627 +#define MCF_JTAGID_REV (0xF0000000)
42628 +#define MCF_JTAGID_PROCESSOR (0x0FFFFFFF)
42629 +#define MCF_JTAGID_MCF5485 (0x0800C01D)
42630 +#define MCF_JTAGID_MCF5484 (0x0800D01D)
42631 +#define MCF_JTAGID_MCF5483 (0x0800E01D)
42632 +#define MCF_JTAGID_MCF5482 (0x0800F01D)
42633 +#define MCF_JTAGID_MCF5481 (0x0801001D)
42634 +#define MCF_JTAGID_MCF5480 (0x0801101D)
42635 +#define MCF_JTAGID_MCF5475 (0x0801201D)
42636 +#define MCF_JTAGID_MCF5474 (0x0801301D)
42637 +#define MCF_JTAGID_MCF5473 (0x0801401D)
42638 +#define MCF_JTAGID_MCF5472 (0x0801501D)
42639 +#define MCF_JTAGID_MCF5471 (0x0801601D)
42640 +#define MCF_JTAGID_MCF5470 (0x0801701D)
42644 + * Interrupt Controller Bitfields
42646 +#define MCF_IRLR_IRQ(x) (((x)&0x7F)<<1)
42647 +#define MCF_IACKLPR_PRI(x) (((x)&0x0F)<<0)
42648 +#define MCF_IACKLPR_LEVEL(x) (((x)&0x07)<<4)
42649 +#define MCF_ICR_IP(x) (((x)&0x07)<<0)
42650 +#define MCF_ICR_IL(x) (((x)&0x07)<<3)
42653 + * Slice Timers Bitfields
42655 +#define MCF_SCR_TEN (0x01000000)
42656 +#define MCF_SCR_IEN (0x02000000)
42657 +#define MCF_SCR_RUN (0x04000000)
42658 +#define MCF_SSR_ST (0x01000000)
42659 +#define MCF_SSR_BE (0x02000000)
42663 + * Some needed coldfire registers
42665 +#define MCF_PAR_PCIBG MCF_REG16(0x000A48)
42666 +#define MCF_PAR_PCIBR MCF_REG16(0x000A4A)
42667 +#define MCF_PAR_PSCn(x) MCF_REG08(0x000A4F-((x)&0x3))
42668 +#define MCF_PAR_FECI2CIRQ MCF_REG16(0x000A44)
42669 +#define MCF_PAR_DSPI MCF_REG16(0x000A50)
42670 +#define MCF_PAR_TIMER MCF_REG08(0X000A52)
42671 +#define MCF_EPPAR MCF_REG16(0x000F00)
42672 +#define MCF_EPIER MCF_REG08(0x000F05)
42673 +#define MCF_EPFR MCF_REG08(0x000F0C)
42676 + * Some GPIO bitfields
42678 +#define MCF_PAR_SDA (0x0008)
42679 +#define MCF_PAR_SCL (0x0004)
42680 +#define MCF_PAR_PSC_TXD (0x04)
42681 +#define MCF_PAR_PSC_RXD (0x08)
42682 +#define MCF_PAR_PSC_RTS(x) (((x)&0x03)<<4)
42683 +#define MCF_PAR_PSC_CTS(x) (((x)&0x03)<<6)
42684 +#define MCF_PAR_PSC_CTS_GPIO (0x00)
42685 +#define MCF_PAR_PSC_CTS_BCLK (0x80)
42686 +#define MCF_PAR_PSC_CTS_CTS (0xC0)
42687 +#define MCF_PAR_PSC_RTS_GPIO (0x00)
42688 +#define MCF_PAR_PSC_RTS_FSYNC (0x20)
42689 +#define MCF_PAR_PSC_RTS_RTS (0x30)
42690 +#define MCF_PAR_PSC_CANRX (0x40)
42694 + * Some used coldfire values
42696 +#define MCF_EPIER_EPIE(x) (0x01 << (x))
42697 +#define MCF_EPPAR_EPPAx_FALLING (2)
42698 +#define MCF_EPPAR_EPPA(n,x) (((x)&0x0003) << (2*n))
42701 +#endif /* m5485sim_h */
42703 +++ b/include/asm-m68k/m5485sram.h
42705 +#ifndef SYS_SRAM_H
42706 +#define SYS_SRAM_H
42709 +#define SYS_SRAM_DMA_START MCF_MBAR + 0x10000
42710 +#define SYS_SRAM_DMA_SIZE 8192
42711 +#define SYS_SRAM_FEC_START SYS_SRAM_DMA_START + SYS_SRAM_DMA_SIZE
42712 +#define SYS_SRAM_FEC_SIZE 2048
42713 +#define SYS_SRAM_SEC_START SYS_SRAM_FEC_START + SYS_SRAM_FEC_SIZE
42714 +#define SYS_SRAM_SEC_SIZE 1280
42716 +#endif /* SYS_SRAM_H */
42717 --- a/include/asm-m68k/machdep.h
42718 +++ b/include/asm-m68k/machdep.h
42719 @@ -32,4 +32,11 @@ extern void (*mach_heartbeat) (int);
42720 extern void (*mach_l2_flush) (int);
42721 extern void (*mach_beep) (unsigned int, unsigned int);
42723 +#ifdef CONFIG_COLDFIRE
42724 +extern void __init config_coldfire(void);
42725 +extern void __init mmu_context_init(void);
42726 +extern irq_handler_t mach_default_handler;
42727 +extern void (*mach_tick)(void);
42730 #endif /* _M68K_MACHDEP_H */
42732 +++ b/include/asm-m68k/MCD_dma.h
42734 +/*********************************************************************
42736 + * Copyright (C) 2004 Motorola, Inc.
42737 + * MOTOROLA, INC. All Rights Reserved.
42738 + * You are hereby granted a copyright license to use
42739 + * the SOFTWARE so long as this entire notice is
42740 + * retained without alteration in any modified and/or redistributed
42741 + * versions, and that such modified versions are clearly identified
42742 + * as such. No licenses are granted by implication, estoppel or
42743 + * otherwise under any patents or trademarks of Motorola, Inc. This
42744 + * software is provided on an "AS IS" basis and without warranty.
42746 + * To the maximum extent permitted by applicable law, MOTOROLA
42747 + * DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING
42748 + * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
42749 + * PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH REGARD TO THE
42750 + * SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) AND ANY
42751 + * ACCOMPANYING WRITTEN MATERIALS.
42753 + * To the maximum extent permitted by applicable law, IN NO EVENT
42754 + * SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING
42755 + * WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
42756 + * INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY
42757 + * LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
42759 + * Motorola assumes no responsibility for the maintenance and support
42760 + * of this software
42761 + ********************************************************************/
42764 + * File: MCD_dma.h
42765 + * Purpose: Main header file for multi-channel DMA API.
42771 +#ifndef _MCD_API_H
42772 +#define _MCD_API_H
42774 +#include <asm/types.h>
42777 + * Turn Execution Unit tasks ON (#define) or OFF (#undef)
42779 +#undef MCD_INCLUDE_EU
42782 + * Number of DMA channels
42784 +#define NCHANNELS 16
42787 + * Total number of variants
42789 +#ifdef MCD_INCLUDE_EU
42790 +#define NUMOFVARIANTS 6
42792 +#define NUMOFVARIANTS 4
42796 + * Define sizes of the various tables
42798 +#define TASK_TABLE_SIZE (NCHANNELS*32)
42799 +#define VAR_TAB_SIZE (128)
42800 +#define CONTEXT_SAVE_SIZE (128)
42801 +#define FUNCDESC_TAB_SIZE (256)
42803 +#ifdef MCD_INCLUDE_EU
42804 +#define FUNCDESC_TAB_NUM 16
42806 +#define FUNCDESC_TAB_NUM 1
42810 +#ifndef DEFINESONLY
42813 + * Portability typedefs
42820 +typedef unsigned int u32;
42823 +typedef short s16;
42826 +typedef unsigned short u16;
42832 +typedef unsigned char u8;
42836 + * These structures represent the internal registers of the
42837 + * multi-channel DMA
42839 +struct dmaRegs_s {
42840 + u32 taskbar; /* task table base address register */
42845 + u16 ptdControl; /* ptd control */
42846 + u32 intPending; /* interrupt pending register */
42847 + u32 intMask; /* interrupt mask register */
42848 + u16 taskControl[16]; /* task control registers */
42849 + u8 priority[32]; /* priority registers */
42850 + u32 initiatorMux; /* initiator mux control */
42851 + u32 taskSize0; /* task size control register 0. */
42852 + u32 taskSize1; /* task size control register 1. */
42853 + u32 dma_rsvd1; /* reserved */
42854 + u32 dma_rsvd2; /* reserved */
42855 + u32 debugComp1; /* debug comparator 1 */
42856 + u32 debugComp2; /* debug comparator 2 */
42857 + u32 debugControl; /* debug control */
42858 + u32 debugStatus; /* debug status */
42859 + u32 ptdDebug; /* priority task decode debug */
42860 + u32 dma_rsvd3[31]; /* reserved */
42862 +typedef volatile struct dmaRegs_s dmaRegs;
42867 + * PTD contrl reg bits
42869 +#define PTD_CTL_TSK_PRI 0x8000
42870 +#define PTD_CTL_COMM_PREFETCH 0x0001
42873 + * Task Control reg bits and field masks
42875 +#define TASK_CTL_EN 0x8000
42876 +#define TASK_CTL_VALID 0x4000
42877 +#define TASK_CTL_ALWAYS 0x2000
42878 +#define TASK_CTL_INIT_MASK 0x1f00
42879 +#define TASK_CTL_ASTRT 0x0080
42880 +#define TASK_CTL_HIPRITSKEN 0x0040
42881 +#define TASK_CTL_HLDINITNUM 0x0020
42882 +#define TASK_CTL_ASTSKNUM_MASK 0x000f
42885 + * Priority reg bits and field masks
42887 +#define PRIORITY_HLD 0x80
42888 +#define PRIORITY_PRI_MASK 0x07
42891 + * Debug Control reg bits and field masks
42893 +#define DBG_CTL_BLOCK_TASKS_MASK 0xffff0000
42894 +#define DBG_CTL_AUTO_ARM 0x00008000
42895 +#define DBG_CTL_BREAK 0x00004000
42896 +#define DBG_CTL_COMP1_TYP_MASK 0x00003800
42897 +#define DBG_CTL_COMP2_TYP_MASK 0x00000070
42898 +#define DBG_CTL_EXT_BREAK 0x00000004
42899 +#define DBG_CTL_INT_BREAK 0x00000002
42902 + * PTD Debug reg selector addresses
42903 + * This reg must be written with a value to show the contents of
42904 + * one of the desired internal register.
42906 +#define PTD_DBG_REQ 0x00 /* shows the state of 31 initiators */
42907 +#define PTD_DBG_TSK_VLD_INIT 0x01 /* shows which 16 tasks are valid and
42908 + have initiators asserted */
42912 + * General return values
42915 +#define MCD_ERROR -1
42916 +#define MCD_TABLE_UNALIGNED -2
42917 +#define MCD_CHANNEL_INVALID -3
42920 + * MCD_initDma input flags
42922 +#define MCD_RELOC_TASKS 0x00000001
42923 +#define MCD_NO_RELOC_TASKS 0x00000000
42924 +#define MCD_COMM_PREFETCH_EN 0x00000002 /* Commbus Prefetching - MCF547x/548x ONLY */
42927 + * MCD_dmaStatus Status Values for each channel
42929 +#define MCD_NO_DMA 1 /* No DMA has been requested since reset */
42930 +#define MCD_IDLE 2 /* DMA active, but the initiator is currently inactive */
42931 +#define MCD_RUNNING 3 /* DMA active, and the initiator is currently active */
42932 +#define MCD_PAUSED 4 /* DMA active but it is currently paused */
42933 +#define MCD_HALTED 5 /* the most recent DMA has been killed with MCD_killTask() */
42934 +#define MCD_DONE 6 /* the most recent DMA has completed. */
42938 + * MCD_startDma parameter defines
42942 + * Constants for the funcDesc parameter
42944 +/* Byte swapping: */
42945 +#define MCD_NO_BYTE_SWAP 0x00045670 /* to disable byte swapping. */
42946 +#define MCD_BYTE_REVERSE 0x00076540 /* to reverse the bytes of each u32 of the DMAed data. */
42947 +#define MCD_U16_REVERSE 0x00067450 /* to reverse the 16-bit halves of
42948 + each 32-bit data value being DMAed.*/
42949 +#define MCD_U16_BYTE_REVERSE 0x00054760 /* to reverse the byte halves of each
42950 + 16-bit half of each 32-bit data value DMAed */
42951 +#define MCD_NO_BIT_REV 0x00000000 /* do not reverse the bits of each byte DMAed. */
42952 +#define MCD_BIT_REV 0x00088880 /* reverse the bits of each byte DMAed */
42954 +#define MCD_CRC16 0xc0100000 /* to perform CRC-16 on DMAed data. */
42955 +#define MCD_CRCCCITT 0xc0200000 /* to perform CRC-CCITT on DMAed data. */
42956 +#define MCD_CRC32 0xc0300000 /* to perform CRC-32 on DMAed data. */
42957 +#define MCD_CSUMINET 0xc0400000 /* to perform internet checksums on DMAed data.*/
42958 +#define MCD_NO_CSUM 0xa0000000 /* to perform no checksumming. */
42960 +#define MCD_FUNC_NOEU1 (MCD_NO_BYTE_SWAP | MCD_NO_BIT_REV | MCD_NO_CSUM)
42961 +#define MCD_FUNC_NOEU2 (MCD_NO_BYTE_SWAP | MCD_NO_CSUM)
42964 + * Constants for the flags parameter
42966 +#define MCD_TT_FLAGS_RL 0x00000001 /* Read line */
42967 +#define MCD_TT_FLAGS_CW 0x00000002 /* Combine Writes */
42968 +#define MCD_TT_FLAGS_SP 0x00000004 /* Speculative prefetch(XLB) MCF547x/548x ONLY */
42969 +#define MCD_TT_FLAGS_MASK 0x000000ff
42970 +#define MCD_TT_FLAGS_DEF (MCD_TT_FLAGS_RL | MCD_TT_FLAGS_CW)
42972 +#define MCD_SINGLE_DMA 0x00000100 /* Unchained DMA */
42973 +#define MCD_CHAIN_DMA /* TBD */
42974 +#define MCD_EU_DMA /* TBD */
42975 +#define MCD_FECTX_DMA 0x00001000 /* FEC TX ring DMA */
42976 +#define MCD_FECRX_DMA 0x00002000 /* FEC RX ring DMA */
42979 +/* these flags are valid for MCD_startDma and the chained buffer descriptors */
42980 +#define MCD_BUF_READY 0x80000000 /* indicates that this buffer is now under the DMA's control */
42981 +#define MCD_WRAP 0x20000000 /* to tell the FEC Dmas to wrap to the first BD */
42982 +#define MCD_INTERRUPT 0x10000000 /* to generate an interrupt after completion of the DMA. */
42983 +#define MCD_END_FRAME 0x08000000 /* tell the DMA to end the frame when transferring
42984 + last byte of data in buffer */
42985 +#define MCD_CRC_RESTART 0x40000000 /* to empty out the accumulated checksum
42986 + prior to performing the DMA. */
42988 +/* Defines for the FEC buffer descriptor control/status word*/
42989 +#define MCD_FEC_BUF_READY 0x8000
42990 +#define MCD_FEC_WRAP 0x2000
42991 +#define MCD_FEC_INTERRUPT 0x1000
42992 +#define MCD_FEC_END_FRAME 0x0800
42996 + * Defines for general intuitiveness
42999 +#define MCD_TRUE 1
43000 +#define MCD_FALSE 0
43003 + * Three different cases for destination and source.
43009 +#ifndef DEFINESONLY
43011 +/* Task Table Entry struct*/
43013 + u32 TDTstart; /* task descriptor table start */
43014 + u32 TDTend; /* task descriptor table end */
43015 + u32 varTab; /* variable table start */
43016 + u32 FDTandFlags; /* function descriptor table start and flags */
43017 + volatile u32 descAddrAndStatus;
43018 + volatile u32 modifiedVarTab;
43019 + u32 contextSaveSpace; /* context save space start */
43020 + u32 literalBases;
43024 +/* Chained buffer descriptor */
43025 +typedef volatile struct MCD_bufDesc_struct MCD_bufDesc;
43026 +struct MCD_bufDesc_struct {
43027 + u32 flags; /* flags describing the DMA */
43028 + u32 csumResult; /* checksum from checksumming performed since last checksum reset */
43029 + s8 *srcAddr; /* the address to move data from */
43030 + s8 *destAddr; /* the address to move data to */
43031 + s8 *lastDestAddr; /* the last address written to */
43032 + u32 dmaSize; /* the number of bytes to transfer independent of the transfer size */
43033 + MCD_bufDesc *next; /* next buffer descriptor in chain */
43034 + u32 info; /* private information about this descriptor; DMA does not affect it */
43037 +/* Progress Query struct */
43038 +typedef volatile struct MCD_XferProg_struct {
43039 + s8 *lastSrcAddr; /* the most-recent or last, post-increment source address */
43040 + s8 *lastDestAddr; /* the most-recent or last, post-increment destination address */
43041 + u32 dmaSize; /* the amount of data transferred for the current buffer */
43042 + MCD_bufDesc *currBufDesc;/* pointer to the current buffer descriptor being DMAed */
43046 +/* FEC buffer descriptor */
43047 +typedef volatile struct MCD_bufDescFec_struct {
43054 +/*************************************************************************/
43056 + * API function Prototypes - see MCD_dmaApi.c for further notes
43060 + * MCD_startDma starts a particular kind of DMA .
43062 +int MCD_startDma (
43063 + int channel, /* the channel on which to run the DMA */
43064 + s8 *srcAddr, /* the address to move data from, or buffer-descriptor address */
43065 + s16 srcIncr, /* the amount to increment the source address per transfer */
43066 + s8 *destAddr, /* the address to move data to */
43067 + s16 destIncr, /* the amount to increment the destination address per transfer */
43068 + u32 dmaSize, /* the number of bytes to transfer independent of the transfer size */
43069 + u32 xferSize, /* the number bytes in of each data movement (1, 2, or 4) */
43070 + u32 initiator, /* what device initiates the DMA */
43071 + int priority, /* priority of the DMA */
43072 + u32 flags, /* flags describing the DMA */
43073 + u32 funcDesc /* a description of byte swapping, bit swapping, and CRC actions */
43077 + * MCD_initDma() initializes the DMA API by setting up a pointer to the DMA
43078 + * registers, relocating and creating the appropriate task structures, and
43079 + * setting up some global settings
43081 +int MCD_initDma (dmaRegs *sDmaBarAddr, void *taskTableDest, u32 flags);
43084 + * MCD_dmaStatus() returns the status of the DMA on the requested channel.
43086 +int MCD_dmaStatus (int channel);
43089 + * MCD_XferProgrQuery() returns progress of DMA on requested channel
43091 +int MCD_XferProgrQuery (int channel, MCD_XferProg *progRep);
43094 + * MCD_killDma() halts the DMA on the requested channel, without any
43095 + * intention of resuming the DMA.
43097 +int MCD_killDma (int channel);
43100 + * MCD_continDma() continues a DMA which as stopped due to encountering an
43101 + * unready buffer descriptor.
43103 +int MCD_continDma (int channel);
43106 + * MCD_pauseDma() pauses the DMA on the given channel ( if any DMA is
43107 + * running on that channel).
43109 +int MCD_pauseDma (int channel);
43112 + * MCD_resumeDma() resumes the DMA on a given channel (if any DMA is
43113 + * running on that channel).
43115 +int MCD_resumeDma (int channel);
43118 + * MCD_csumQuery provides the checksum/CRC after performing a non-chained DMA
43120 +int MCD_csumQuery (int channel, u32 *csum);
43123 + * MCD_getCodeSize provides the packed size required by the microcoded task
43124 + * and structures.
43126 +int MCD_getCodeSize(void);
43129 + * MCD_getVersion provides a pointer to a version string and returns a
43130 + * version number.
43132 +int MCD_getVersion(char **longVersion);
43134 +/* macro for setting a location in the variable table */
43135 +#define MCD_SET_VAR(taskTab,idx,value) ((u32 *)(taskTab)->varTab)[idx] = value
43136 + /* Note that MCD_SET_VAR() is invoked many times in firing up a DMA function,
43137 + so I'm avoiding surrounding it with "do {} while(0)" */
43139 +#endif /* DEFINESONLY */
43141 +#endif /* _MCD_API_H */
43143 +++ b/include/asm-m68k/mcf5445x_ccm.h
43146 + * Matt Waddel Matt.Waddel@freescale.com
43148 + * Copyright Freescale Semiconductor, Inc. 2007
43150 + * This program is free software; you can redistribute it and/or modify it
43151 + * under the terms of the GNU General Public License as published by the
43152 + * Free Software Foundation; either version 2 of the License, or (at your
43153 + * option) any later version.
43156 +#ifndef __MCF5445X_CCM_H__
43157 +#define __MCF5445X_CCM_H__
43159 +/*********************************************************************
43161 +* Chip Configuration Module (CCM)
43163 +*********************************************************************/
43165 +/* Register read/write macros */
43166 +#define MCF_CCM_CCR MCF_REG16(0xFC0A0004) /* Chip Configuration Register (Read-only) (256 or 360 TEPBGA) */
43167 +#define MCF_CCM_RCON MCF_REG16(0xFC0A0008) /* Reset Configuration (Read-only) (256 or 360 TEPBGA) */
43168 +#define MCF_CCM_CIR MCF_REG16(0xFC0A000A) /* Chip Identification Register (Read-only) */
43169 +#define MCF_CCM_MISCCR MCF_REG16(0xFC0A0010) /* Miscellaneous Control Register */
43170 +#define MCF_CCM_CDR MCF_REG16(0xFC0A0012) /* Clock Divider Register */
43171 +#define MCF_CCM_UOCSR MCF_REG16(0xFC0A0014) /* USB On-the-Go Controller Status Register */
43172 +#define MCF_CCM_SBFSR MCF_REG16(0xFC0A0018) /* Serial Boot Facility Status Register (Read Only) */
43173 +#define MCF_CCM_SBFCR MCF_REG16(0xFC0A0020) /* Serial Boot Facility Control Register */
43175 +/* Bit definitions and macros for CCR_360 */
43176 +#define MCF_CCM_CCR_360_PLLMULT2(x) (((x) & 0x0003)) /* 2-Bit PLL clock mode */
43177 +#define MCF_CCM_CCR_360_PCISLEW (0x0004) /* PCI pad slew rate mode */
43178 +#define MCF_CCM_CCR_360_PCIMODE (0x0008) /* PCI host/agent mode */
43179 +#define MCF_CCM_CCR_360_PLLMODE (0x0010) /* PLL Mode */
43180 +#define MCF_CCM_CCR_360_FBCONFIG(x) (((x) & 0x0007) << 5) /* Flexbus/PCI port size configuration */
43181 +#define MCF_CCM_CCR_360_PLLMULT3(x) (((x) & 0x0007)) /* 3-Bit PLL Clock Mode */
43182 +#define MCF_CCM_CCR_360_OSCMODE (0x0008) /* Oscillator Clock Mode */
43183 +#define MCF_CCM_CCR_360_FBCONFIG_MASK (0x00E0)
43184 +#define MCF_CCM_CCR_360_PLLMULT2_MASK (0x0003)
43185 +#define MCF_CCM_CCR_360_PLLMULT3_MASK (0x0007)
43186 +#define MCF_CCM_CCR_360_FBCONFIG_NM_NP_32 (0x0000)
43187 +#define MCF_CCM_CCR_360_FBCONFIG_NM_NP_8 (0x0020)
43188 +#define MCF_CCM_CCR_360_FBCONFIG_NM_NP_16 (0x0040)
43189 +#define MCF_CCM_CCR_360_FBCONFIG_M_P_16 (0x0060)
43190 +#define MCF_CCM_CCR_360_FBCONFIG_M_NP_32 (0x0080)
43191 +#define MCF_CCM_CCR_360_FBCONFIG_M_NP_8 (0x00A0)
43192 +#define MCF_CCM_CCR_360_FBCONFIG_M_NP_16 (0x00C0)
43193 +#define MCF_CCM_CCR_360_FBCONFIG_M_P_8 (0x00E0)
43194 +#define MCF_CCM_CCR_360_PLLMULT2_12X (0x0000)
43195 +#define MCF_CCM_CCR_360_PLLMULT2_6X (0x0001)
43196 +#define MCF_CCM_CCR_360_PLLMULT2_16X (0x0002)
43197 +#define MCF_CCM_CCR_360_PLLMULT2_8X (0x0003)
43198 +#define MCF_CCM_CCR_360_PLLMULT3_20X (0x0000)
43199 +#define MCF_CCM_CCR_360_PLLMULT3_10X (0x0001)
43200 +#define MCF_CCM_CCR_360_PLLMULT3_24X (0x0002)
43201 +#define MCF_CCM_CCR_360_PLLMULT3_18X (0x0003)
43202 +#define MCF_CCM_CCR_360_PLLMULT3_12X (0x0004)
43203 +#define MCF_CCM_CCR_360_PLLMULT3_6X (0x0005)
43204 +#define MCF_CCM_CCR_360_PLLMULT3_16X (0x0006)
43205 +#define MCF_CCM_CCR_360_PLLMULT3_8X (0x0007)
43207 +/* Bit definitions and macros for CCR_256 */
43208 +#define MCF_CCM_CCR_256_PLLMULT3(x) (((x) & 0x0007)) /* 3-Bit PLL clock mode */
43209 +#define MCF_CCM_CCR_256_OSCMODE (0x0008) /* Oscillator clock mode */
43210 +#define MCF_CCM_CCR_256_PLLMODE (0x0010) /* PLL Mode */
43211 +#define MCF_CCM_CCR_256_FBCONFIG(x) (((x) & 0x0007) << 5) /* Flexbus/PCI port size configuration */
43212 +#define MCF_CCM_CCR_256_FBCONFIG_MASK (0x00E0)
43213 +#define MCF_CCM_CCR_256_FBCONFIG_NM_32 (0x0000)
43214 +#define MCF_CCM_CCR_256_FBCONFIG_NM_8 (0x0020)
43215 +#define MCF_CCM_CCR_256_FBCONFIG_NM_16 (0x0040)
43216 +#define MCF_CCM_CCR_256_FBCONFIG_M_32 (0x0080)
43217 +#define MCF_CCM_CCR_256_FBCONFIG_M_8 (0x00A0)
43218 +#define MCF_CCM_CCR_256_FBCONFIG_M_16 (0x00C0)
43219 +#define MCF_CCM_CCR_256_PLLMULT3_MASK (0x0007)
43220 +#define MCF_CCM_CCR_256_PLLMULT3_20X (0x0000)
43221 +#define MCF_CCM_CCR_256_PLLMULT3_10X (0x0001)
43222 +#define MCF_CCM_CCR_256_PLLMULT3_24X (0x0002)
43223 +#define MCF_CCM_CCR_256_PLLMULT3_18X (0x0003)
43224 +#define MCF_CCM_CCR_256_PLLMULT3_12X (0x0004)
43225 +#define MCF_CCM_CCR_256_PLLMULT3_6X (0x0005)
43226 +#define MCF_CCM_CCR_256_PLLMULT3_16X (0x0006)
43227 +#define MCF_CCM_CCR_256_PLLMULT3_8X (0x0007)
43229 +/* Bit definitions and macros for RCON_360 */
43230 +#define MCF_CCM_RCON_360_PLLMULT(x) (((x)&0x0003)) /* PLL clock mode */
43231 +#define MCF_CCM_RCON_360_PCISLEW (0x0004) /* PCI pad slew rate mode */
43232 +#define MCF_CCM_RCON_360_PCIMODE (0x0008) /* PCI host/agent mode */
43233 +#define MCF_CCM_RCON_360_PLLMODE (0x0010) /* PLL Mode */
43234 +#define MCF_CCM_RCON_360_FBCONFIG(x) (((x) & 0x0007) << 5) /* Flexbus/PCI port size configuration */
43236 +/* Bit definitions and macros for RCON_256 */
43237 +#define MCF_CCM_RCON_256_PLLMULT(x) (((x) & 0x0007)) /* PLL clock mode */
43238 +#define MCF_CCM_RCON_256_OSCMODE (0x0008) /* Oscillator clock mode */
43239 +#define MCF_CCM_RCON_256_PLLMODE (0x0010) /* PLL Mode */
43240 +#define MCF_CCM_RCON_256_FBCONFIG(x) (((x) & 0x0007) << 5) /* Flexbus/PCI port size configuration */
43242 +/* Bit definitions and macros for CIR */
43243 +#define MCF_CCM_CIR_PRN(x) (((x) & 0x003F)) /* Part revision number */
43244 +#define MCF_CCM_CIR_PIN(x) (((x) & 0x03FF) << 6) /* Part identification number */
43245 +#define MCF_CCM_CIR_PIN_MASK (0xFFC0)
43246 +#define MCF_CCM_CIR_PRN_MASK (0x003F)
43247 +#define MCF_CCM_CIR_PIN_MCF54450 (0x4F << 6)
43248 +#define MCF_CCM_CIR_PIN_MCF54451 (0x4D << 6)
43249 +#define MCF_CCM_CIR_PIN_MCF54452 (0x4B << 6)
43250 +#define MCF_CCM_CIR_PIN_MCF54453 (0x49 << 6)
43251 +#define MCF_CCM_CIR_PIN_MCF54454 (0x4A << 6)
43252 +#define MCF_CCM_CIR_PIN_MCF54455 (0x48 << 6)
43254 +/* Bit definitions and macros for MISCCR */
43255 +#define MCF_CCM_MISCCR_USBSRC (0x0001) /* USB clock source */
43256 +#define MCF_CCM_MISCCR_USBOC (0x0002) /* USB VBUS over-current sense polarity */
43257 +#define MCF_CCM_MISCCR_USBPUE (0x0004) /* USB transceiver pull-up enable */
43258 +#define MCF_CCM_MISCCR_SSISRC (0x0010) /* SSI clock source */
43259 +#define MCF_CCM_MISCCR_TIMDMA (0x0020) /* Timer DMA mux selection */
43260 +#define MCF_CCM_MISCCR_SSIPUS (0x0040) /* SSI RXD/TXD pull select */
43261 +#define MCF_CCM_MISCCR_SSIPUE (0x0080) /* SSI RXD/TXD pull enable */
43262 +#define MCF_CCM_MISCCR_BMT(x) (((x) & 0x0007) << 8) /* Bus monitor timing field */
43263 +#define MCF_CCM_MISCCR_BME (0x0800) /* Bus monitor external enable bit */
43264 +#define MCF_CCM_MISCCR_LIMP (0x1000) /* Limp mode enable */
43265 +#define MCF_CCM_MISCCR_BMT_65536 (0 << 8)
43266 +#define MCF_CCM_MISCCR_BMT_32768 (1 << 8)
43267 +#define MCF_CCM_MISCCR_BMT_16384 (2 << 8)
43268 +#define MCF_CCM_MISCCR_BMT_8192 (3 << 8)
43269 +#define MCF_CCM_MISCCR_BMT_4096 (4 << 8)
43270 +#define MCF_CCM_MISCCR_BMT_2048 (5 << 8)
43271 +#define MCF_CCM_MISCCR_BMT_1024 (6 << 8)
43272 +#define MCF_CCM_MISCCR_BMT_512 (7 << 8)
43273 +#define MCF_CCM_MISCCR_SSIPUE_UP (1 << 7)
43274 +#define MCF_CCM_MISCCR_SSIPUE_DOWN (0 << 7)
43275 +#define MCF_CCM_MISCCR_SSIPUS_UP (1 << 6)
43276 +#define MCF_CCM_MISCCR_SSIPUS_DOWN (0 << 6)
43277 +#define MCF_CCM_MISCCR_TIMDMA_TIM (1 << 5)
43278 +#define MCF_CCM_MISCCR_TIMDMA_SSI (0 << 5)
43279 +#define MCF_CCM_MISCCR_SSISRC_CLKIN (0 << 4)
43280 +#define MCF_CCM_MISCCR_SSISRC_PLL (1 << 4)
43281 +#define MCF_CCM_MISCCR_USBOC_ACTHI (0 << 1)
43282 +#define MCF_CCM_MISCCR_USBOC_ACTLO (1 << 1)
43283 +#define MCF_CCM_MISCCR_USBSRC_CLKIN (0)
43284 +#define MCF_CCM_MISCCR_USBSRC_PLL (1)
43286 +/* Bit definitions and macros for CDR */
43287 +#define MCF_CCM_CDR_SSIDIV(x) (((x) & 0x00FF)) /* SSI oversampling clock divider */
43288 +#define MCF_CCM_CDR_LPDIV(x) (((x) & 0x000F) << 8) /* Low power clock divider */
43290 +/* Bit definitions and macros for UOCSR */
43291 +#define MCF_CCM_UOCSR_XPDE (0x0001) /* On-chip transceiver pull-down enable */
43292 +#define MCF_CCM_UOCSR_UOMIE (0x0002) /* USB OTG misc interrupt enable */
43293 +#define MCF_CCM_UOCSR_WKUP (0x0004) /* USB OTG controller wake-up event */
43294 +#define MCF_CCM_UOCSR_PWRFLT (0x0008) /* VBUS power fault */
43295 +#define MCF_CCM_UOCSR_SEND (0x0010) /* Session end */
43296 +#define MCF_CCM_UOCSR_VVLD (0x0020) /* VBUS valid indicator */
43297 +#define MCF_CCM_UOCSR_BVLD (0x0040) /* B-peripheral valid indicator */
43298 +#define MCF_CCM_UOCSR_AVLD (0x0080) /* A-peripheral valid indicator */
43299 +#define MCF_CCM_UOCSR_DPPU (0x0100) /* D+ pull-up for FS enabled (read-only) */
43300 +#define MCF_CCM_UOCSR_DCR_VBUS (0x0200) /* VBUS discharge resistor enabled (read-only) */
43301 +#define MCF_CCM_UOCSR_CRG_VBUS (0x0400) /* VBUS charge resistor enabled (read-only) */
43302 +#define MCF_CCM_UOCSR_DMPD (0x1000) /* D- 15Kohm pull-down (read-only) */
43303 +#define MCF_CCM_UOCSR_DPPD (0x2000) /* D+ 15Kohm pull-down (read-only) */
43305 +/********************************************************************/
43307 +#endif /* __MCF5445X_CCM_H__ */
43309 +++ b/include/asm-m68k/mcf5445x_dspi.h
43312 + * Yaroslav Vinogradov yaroslav.vinogradov@freescale.com
43314 + * Copyright Freescale Semiconductor, Inc. 2007
43316 + * This program is free software; you can redistribute it and/or modify it
43317 + * under the terms of the GNU General Public License as published by the
43318 + * Free Software Foundation; either version 2 of the License, or (at your
43319 + * option) any later version.
43322 +#ifndef __MCF5445X_DSPI_H__
43323 +#define __MCF5445X_DSPI_H__
43325 +/*********************************************************************
43327 +* DMA Serial Peripheral Interface (DSPI)
43329 +*********************************************************************/
43331 +/* Register read/write macros */
43332 +#define MCF_DSPI_DMCR MCF_REG32(0xFC05C000) /* DSPI Module Configuration Register */
43333 +#define MCF_DSPI_DTCR MCF_REG32(0xFC05C008) /* DSPI Transfer Count Register */
43334 +#define MCF_DSPI_DCTAR0 MCF_REG32(0xFC05C00C) /* DSPI Clock and Transfer Attributes Register */
43335 +#define MCF_DSPI_DCTAR1 MCF_REG32(0xFC05C010) /* DSPI Clock and Transfer Attributes Register */
43336 +#define MCF_DSPI_DCTAR2 MCF_REG32(0xFC05C014) /* DSPI Clock and Transfer Attributes Register */
43337 +#define MCF_DSPI_DCTAR3 MCF_REG32(0xFC05C018) /* DSPI Clock and Transfer Attributes Register */
43338 +#define MCF_DSPI_DCTAR4 MCF_REG32(0xFC05C01C) /* DSPI Clock and Transfer Attributes Register */
43339 +#define MCF_DSPI_DCTAR5 MCF_REG32(0xFC05C020) /* DSPI Clock and Transfer Attributes Register */
43340 +#define MCF_DSPI_DCTAR6 MCF_REG32(0xFC05C024) /* DSPI Clock and Transfer Attributes Register */
43341 +#define MCF_DSPI_DCTAR7 MCF_REG32(0xFC05C028) /* DSPI Clock and Transfer Attributes Register */
43342 +#define MCF_DSPI_DSR MCF_REG32(0xFC05C02C) /* DSPI Status Register */
43343 +#define MCF_DSPI_DRSER MCF_REG32(0xFC05C030) /* DSPI DMA/Interrupt Request Select and Enable Register */
43344 +#define MCF_DSPI_DTFR MCF_REG32(0xFC05C034) /* DSPI Transmit FIFO Register */
43345 +#define MCF_DSPI_DRFR MCF_REG32(0xFC05C038) /* DSPI Receive FIFO Register */
43346 +#define MCF_DSPI_DTFDR0 MCF_REG32(0xFC05C03C) /* DSPI Transmit FIFO Debugging Registers */
43347 +#define MCF_DSPI_DTFDR1 MCF_REG32(0xFC05C040) /* DSPI Transmit FIFO Debugging Registers */
43348 +#define MCF_DSPI_DTFDR2 MCF_REG32(0xFC05C044) /* DSPI Transmit FIFO Debugging Registers */
43349 +#define MCF_DSPI_DTFDR3 MCF_REG32(0xFC05C048) /* DSPI Transmit FIFO Debugging Registers */
43350 +#define MCF_DSPI_DRFDR0 MCF_REG32(0xFC05C07C) /* DSPI Receive FIFO Debugging Registers */
43351 +#define MCF_DSPI_DRFDR1 MCF_REG32(0xFC05C080) /* DSPI Receive FIFO Debugging Registers */
43352 +#define MCF_DSPI_DRFDR2 MCF_REG32(0xFC05C084) /* DSPI Receive FIFO Debugging Registers */
43353 +#define MCF_DSPI_DRFDR3 MCF_REG32(0xFC05C088) /* DSPI Receive FIFO Debugging Registers */
43355 +/* Parameterized register read/write macros for multiple registers */
43356 +#define MCF_DSPI_DCTAR(x) MCF_REG32(0xFC05C00C+((x)*0x004)) /* DSPI Clock and Transfer Attributes Register */
43357 +#define MCF_DSPI_DTFDR(x) MCF_REG32(0xFC05C03C+((x)*0x004)) /* DSPI Transmit FIFO Debugging Registers */
43358 +#define MCF_DSPI_DRFDR(x) MCF_REG32(0xFC05C07C+((x)*0x004)) /* DSPI Receive FIFO Debugging Registers */
43360 +/* Bit definitions and macros for DMCR */
43361 +#define MCF_DSPI_DMCR_HALT (0x00000001) /* Halt -- stops and starts DSPI transfers */
43362 +#define MCF_DSPI_DMCR_SMPLPT(x) (((x)&0x00000003)<<8) /* Sample point selection */
43363 +#define MCF_DSPI_DMCR_CLRRXF (0x00000400) /* Clear receive FIFO */
43364 +#define MCF_DSPI_DMCR_CLRTXF (0x00000800) /* Clear transmit FIFO */
43365 +#define MCF_DSPI_DMCR_DISRXF (0x00001000) /* Disable receive FIFO */
43366 +#define MCF_DSPI_DMCR_DISTXF (0x00002000) /* Disable transmit FIFO */
43367 +#define MCF_DSPI_DMCR_MDIS (0x00004000) /* Module Disable */
43368 +#define MCF_DSPI_DMCR_PCSIS0 (0x00010000) /* Peripheral chip-select 0 inactive state */
43369 +#define MCF_DSPI_DMCR_PCSIS1 (0x00020000) /* Peripheral chip-select 1 inactive state */
43370 +#define MCF_DSPI_DMCR_PCSIS2 (0x00040000) /* Peripheral chip-select 2 inactive state */
43371 +#define MCF_DSPI_DMCR_PCSIS3 (0x00080000) /* Peripheral chip-select 3 inactive state */
43372 +#define MCF_DSPI_DMCR_PCSIS4 (0x00100000) /* Peripheral chip-select 4 inactive state */
43373 +#define MCF_DSPI_DMCR_PCSIS5 (0x00200000) /* Peripheral chip-select 5 inactive state */
43374 +#define MCF_DSPI_DMCR_PCSIS6 (0x00400000) /* Peripheral chip-select 6 inactive state */
43375 +#define MCF_DSPI_DMCR_PCSIS7 (0x00800000) /* Peripheral chip-select 7 inactive state */
43376 +#define MCF_DSPI_DMCR_ROOE (0x01000000) /* Receive FIFO overflow overwrite enable */
43377 +#define MCF_DSPI_DMCR_PCSSE (0x02000000) /* Peripheral chip select strobe enable */
43378 +#define MCF_DSPI_DMCR_MTFE (0x04000000) /* Modified timing format enable */
43379 +#define MCF_DSPI_DMCR_FRZ (0x08000000) /* Freeze */
43380 +#define MCF_DSPI_DMCR_DCONF(x) (((x)&0x00000003)<<28) /* DSPI configuration */
43381 +#define MCF_DSPI_DMCR_CONT_SCKE (0x40000000) /* Continuous SCK enable */
43382 +#define MCF_DSPI_DMCR_MSTR (0x80000000) /* Master/Slave mode select */
43383 +#define MCF_DSPI_DMCR_DCONF_SPI (0x00000000)
43384 +#define MCF_DSPI_DMCR_PCSIS7_LOW (0x00000000)
43385 +#define MCF_DSPI_DMCR_PCSIS7_HIGH (0x00800000)
43386 +#define MCF_DSPI_DMCR_PCSIS6_LOW (0x00000000)
43387 +#define MCF_DSPI_DMCR_PCSIS6_HIGH (0x00400000)
43388 +#define MCF_DSPI_DMCR_PCSIS5_LOW (0x00000000)
43389 +#define MCF_DSPI_DMCR_PCSIS5_HIGH (0x00200000)
43390 +#define MCF_DSPI_DMCR_PCSIS4_LOW (0x00000000)
43391 +#define MCF_DSPI_DMCR_PCSIS4_HIGH (0x00100000)
43392 +#define MCF_DSPI_DMCR_PCSIS3_LOW (0x00000000)
43393 +#define MCF_DSPI_DMCR_PCSIS3_HIGH (0x00080000)
43394 +#define MCF_DSPI_DMCR_PCSIS2_LOW (0x00000000)
43395 +#define MCF_DSPI_DMCR_PCSIS2_HIGH (0x00040000)
43396 +#define MCF_DSPI_DMCR_PCSIS1_LOW (0x00000000)
43397 +#define MCF_DSPI_DMCR_PCSIS1_HIGH (0x00020000)
43398 +#define MCF_DSPI_DMCR_PCSIS0_LOW (0x00000000)
43399 +#define MCF_DSPI_DMCR_PCSIS0_HIGH (0x00010000)
43401 +/* Bit definitions and macros for DTCR */
43402 +#define MCF_DSPI_DTCR_SPI_TCNT(x) (((x)&0x0000FFFF)<<16) /* SPI transfer count */
43404 +/* Bit definitions and macros for DCTAR group */
43405 +#define MCF_DSPI_DCTAR_BR(x) (((x)&0x0000000F)) /* Baud rate scaler */
43406 +#define MCF_DSPI_DCTAR_DT(x) (((x)&0x0000000F)<<4) /* Delay after transfer scaler */
43407 +#define MCF_DSPI_DCTAR_ASC(x) (((x)&0x0000000F)<<8) /* After SCK delay scaler */
43408 +#define MCF_DSPI_DCTAR_CSSCK(x) (((x)&0x0000000F)<<12) /* PCS to SCK delay scaler */
43409 +#define MCF_DSPI_DCTAR_PBR(x) (((x)&0x00000003)<<16) /* Baud rate prescaler */
43410 +#define MCF_DSPI_DCTAR_PDT(x) (((x)&0x00000003)<<18) /* Delay after transfer prescaler */
43411 +#define MCF_DSPI_DCTAR_PASC(x) (((x)&0x00000003)<<20) /* After SCK delay prescaler */
43412 +#define MCF_DSPI_DCTAR_PCSSCK(x) (((x)&0x00000003)<<22) /* PCS to SCK delay prescaler */
43413 +#define MCF_DSPI_DCTAR_LSBFE (0x01000000) /* LSB first enable */
43414 +#define MCF_DSPI_DCTAR_CPHA (0x02000000) /* Clock phase */
43415 +#define MCF_DSPI_DCTAR_CPOL (0x04000000) /* Clock polarity */
43416 +#define MCF_DSPI_DCTAR_FMSZ(x) (((x)&0x0000000F)<<27) /* Frame size */
43417 +#define MCF_DSPI_DCTAR_DBR (0x80000000) /* Double baud rate */
43418 +#define MCF_DSPI_DCTAR_CPOL_LOW (0x00000000)
43419 +#define MCF_DSPI_DCTAR_CPOL_HIGH (0x04000000)
43420 +#define MCF_DSPI_DCTAR_CPHA_LATCH_RISING (0x00000000)
43421 +#define MCF_DSPI_DCTAR_CPHA_LATCH_FALLING (0x02000000)
43422 +#define MCF_DSPI_DCTAR_PCSSCK_1CLK (0x00000000)
43423 +#define MCF_DSPI_DCTAR_PCSSCK_3CLK (0x00400000)
43424 +#define MCF_DSPI_DCTAR_PCSSCK_5CLK (0x00800000)
43425 +#define MCF_DSPI_DCTAR_PCSSCK_7CLK (0x00C00000)
43426 +#define MCF_DSPI_DCTAR_PASC_1CLK (0x00000000)
43427 +#define MCF_DSPI_DCTAR_PASC_3CLK (0x00100000)
43428 +#define MCF_DSPI_DCTAR_PASC_5CLK (0x00200000)
43429 +#define MCF_DSPI_DCTAR_PASC_7CLK (0x00300000)
43430 +#define MCF_DSPI_DCTAR_PDT_1CLK (0x00000000)
43431 +#define MCF_DSPI_DCTAR_PDT_3CLK (0x00040000)
43432 +#define MCF_DSPI_DCTAR_PDT_5CLK (0x00080000)
43433 +#define MCF_DSPI_DCTAR_PDT_7CLK (0x000C0000)
43434 +#define MCF_DSPI_DCTAR_PBR_2CLK (0x00000000)
43435 +#define MCF_DSPI_DCTAR_PBR_3CLK (0x00010000)
43436 +#define MCF_DSPI_DCTAR_PBR_5CLK (0x00020000)
43437 +#define MCF_DSPI_DCTAR_PBR_7CLK (0x00030000)
43439 +/* Bit definitions and macros for DCTAR0 */
43440 +#define MCF_DSPI_DCTAR0_BR(x) (((x)&0x0000000F)) /* Baud rate scaler */
43441 +#define MCF_DSPI_DCTAR0_DT(x) (((x)&0x0000000F)<<4) /* Delay after transfer scaler */
43442 +#define MCF_DSPI_DCTAR0_ASC(x) (((x)&0x0000000F)<<8) /* After SCK delay scaler */
43443 +#define MCF_DSPI_DCTAR0_CSSCK(x) (((x)&0x0000000F)<<12) /* PCS to SCK delay scaler */
43444 +#define MCF_DSPI_DCTAR0_PBR(x) (((x)&0x00000003)<<16) /* Baud rate prescaler */
43445 +#define MCF_DSPI_DCTAR0_PDT(x) (((x)&0x00000003)<<18) /* Delay after transfer prescaler */
43446 +#define MCF_DSPI_DCTAR0_PASC(x) (((x)&0x00000003)<<20) /* After SCK delay prescaler */
43447 +#define MCF_DSPI_DCTAR0_PCSSCK(x) (((x)&0x00000003)<<22) /* PCS to SCK delay prescaler */
43448 +#define MCF_DSPI_DCTAR0_LSBFE (0x01000000) /* LSB first enable */
43449 +#define MCF_DSPI_DCTAR0_CPHA (0x02000000) /* Clock phase */
43450 +#define MCF_DSPI_DCTAR0_CPOL (0x04000000) /* Clock polarity */
43451 +#define MCF_DSPI_DCTAR0_FMSZ(x) (((x)&0x0000000F)<<27) /* Frame size */
43452 +#define MCF_DSPI_DCTAR0_DBR (0x80000000) /* Double baud rate */
43453 +#define MCF_DSPI_DCTAR0_CPOL_LOW (0x00000000)
43454 +#define MCF_DSPI_DCTAR0_CPOL_HIGH (0x04000000)
43455 +#define MCF_DSPI_DCTAR0_CPHA_LATCH_RISING (0x00000000)
43456 +#define MCF_DSPI_DCTAR0_CPHA_LATCH_FALLING (0x02000000)
43457 +#define MCF_DSPI_DCTAR0_PCSSCK_1CLK (0x00000000)
43458 +#define MCF_DSPI_DCTAR0_PCSSCK_3CLK (0x00400000)
43459 +#define MCF_DSPI_DCTAR0_PCSSCK_5CLK (0x00800000)
43460 +#define MCF_DSPI_DCTAR0_PCSSCK_7CLK (0x00C00000)
43461 +#define MCF_DSPI_DCTAR0_PASC_1CLK (0x00000000)
43462 +#define MCF_DSPI_DCTAR0_PASC_3CLK (0x00100000)
43463 +#define MCF_DSPI_DCTAR0_PASC_5CLK (0x00200000)
43464 +#define MCF_DSPI_DCTAR0_PASC_7CLK (0x00300000)
43465 +#define MCF_DSPI_DCTAR0_PDT_1CLK (0x00000000)
43466 +#define MCF_DSPI_DCTAR0_PDT_3CLK (0x00040000)
43467 +#define MCF_DSPI_DCTAR0_PDT_5CLK (0x00080000)
43468 +#define MCF_DSPI_DCTAR0_PDT_7CLK (0x000C0000)
43469 +#define MCF_DSPI_DCTAR0_PBR_2CLK (0x00000000)
43470 +#define MCF_DSPI_DCTAR0_PBR_3CLK (0x00010000)
43471 +#define MCF_DSPI_DCTAR0_PBR_5CLK (0x00020000)
43472 +#define MCF_DSPI_DCTAR0_PBR_7CLK (0x00030000)
43474 +/* Bit definitions and macros for DCTAR1 */
43475 +#define MCF_DSPI_DCTAR1_BR(x) (((x)&0x0000000F)) /* Baud rate scaler */
43476 +#define MCF_DSPI_DCTAR1_DT(x) (((x)&0x0000000F)<<4) /* Delay after transfer scaler */
43477 +#define MCF_DSPI_DCTAR1_ASC(x) (((x)&0x0000000F)<<8) /* After SCK delay scaler */
43478 +#define MCF_DSPI_DCTAR1_CSSCK(x) (((x)&0x0000000F)<<12) /* PCS to SCK delay scaler */
43479 +#define MCF_DSPI_DCTAR1_PBR(x) (((x)&0x00000003)<<16) /* Baud rate prescaler */
43480 +#define MCF_DSPI_DCTAR1_PDT(x) (((x)&0x00000003)<<18) /* Delay after transfer prescaler */
43481 +#define MCF_DSPI_DCTAR1_PASC(x) (((x)&0x00000003)<<20) /* After SCK delay prescaler */
43482 +#define MCF_DSPI_DCTAR1_PCSSCK(x) (((x)&0x00000003)<<22) /* PCS to SCK delay prescaler */
43483 +#define MCF_DSPI_DCTAR1_LSBFE (0x01000000) /* LSB first enable */
43484 +#define MCF_DSPI_DCTAR1_CPHA (0x02000000) /* Clock phase */
43485 +#define MCF_DSPI_DCTAR1_CPOL (0x04000000) /* Clock polarity */
43486 +#define MCF_DSPI_DCTAR1_FMSZ(x) (((x)&0x0000000F)<<27) /* Frame size */
43487 +#define MCF_DSPI_DCTAR1_DBR (0x80000000) /* Double baud rate */
43489 +/* Bit definitions and macros for DCTAR2 */
43490 +#define MCF_DSPI_DCTAR2_BR(x) (((x)&0x0000000F)) /* Baud rate scaler */
43491 +#define MCF_DSPI_DCTAR2_DT(x) (((x)&0x0000000F)<<4) /* Delay after transfer scaler */
43492 +#define MCF_DSPI_DCTAR2_ASC(x) (((x)&0x0000000F)<<8) /* After SCK delay scaler */
43493 +#define MCF_DSPI_DCTAR2_CSSCK(x) (((x)&0x0000000F)<<12) /* PCS to SCK delay scaler */
43494 +#define MCF_DSPI_DCTAR2_PBR(x) (((x)&0x00000003)<<16) /* Baud rate prescaler */
43495 +#define MCF_DSPI_DCTAR2_PDT(x) (((x)&0x00000003)<<18) /* Delay after transfer prescaler */
43496 +#define MCF_DSPI_DCTAR2_PASC(x) (((x)&0x00000003)<<20) /* After SCK delay prescaler */
43497 +#define MCF_DSPI_DCTAR2_PCSSCK(x) (((x)&0x00000003)<<22) /* PCS to SCK delay prescaler */
43498 +#define MCF_DSPI_DCTAR2_LSBFE (0x01000000) /* LSB first enable */
43499 +#define MCF_DSPI_DCTAR2_CPHA (0x02000000) /* Clock phase */
43500 +#define MCF_DSPI_DCTAR2_CPOL (0x04000000) /* Clock polarity */
43501 +#define MCF_DSPI_DCTAR2_FMSZ(x) (((x)&0x0000000F)<<27) /* Frame size */
43502 +#define MCF_DSPI_DCTAR2_DBR (0x80000000) /* Double baud rate */
43504 +/* Bit definitions and macros for DCTAR3 */
43505 +#define MCF_DSPI_DCTAR3_BR(x) (((x)&0x0000000F)) /* Baud rate scaler */
43506 +#define MCF_DSPI_DCTAR3_DT(x) (((x)&0x0000000F)<<4) /* Delay after transfer scaler */
43507 +#define MCF_DSPI_DCTAR3_ASC(x) (((x)&0x0000000F)<<8) /* After SCK delay scaler */
43508 +#define MCF_DSPI_DCTAR3_CSSCK(x) (((x)&0x0000000F)<<12) /* PCS to SCK delay scaler */
43509 +#define MCF_DSPI_DCTAR3_PBR(x) (((x)&0x00000003)<<16) /* Baud rate prescaler */
43510 +#define MCF_DSPI_DCTAR3_PDT(x) (((x)&0x00000003)<<18) /* Delay after transfer prescaler */
43511 +#define MCF_DSPI_DCTAR3_PASC(x) (((x)&0x00000003)<<20) /* After SCK delay prescaler */
43512 +#define MCF_DSPI_DCTAR3_PCSSCK(x) (((x)&0x00000003)<<22) /* PCS to SCK delay prescaler */
43513 +#define MCF_DSPI_DCTAR3_LSBFE (0x01000000) /* LSB first enable */
43514 +#define MCF_DSPI_DCTAR3_CPHA (0x02000000) /* Clock phase */
43515 +#define MCF_DSPI_DCTAR3_CPOL (0x04000000) /* Clock polarity */
43516 +#define MCF_DSPI_DCTAR3_FMSZ(x) (((x)&0x0000000F)<<27) /* Frame size */
43517 +#define MCF_DSPI_DCTAR3_DBR (0x80000000) /* Double baud rate */
43519 +/* Bit definitions and macros for DCTAR4 */
43520 +#define MCF_DSPI_DCTAR4_BR(x) (((x)&0x0000000F)) /* Baud rate scaler */
43521 +#define MCF_DSPI_DCTAR4_DT(x) (((x)&0x0000000F)<<4) /* Delay after transfer scaler */
43522 +#define MCF_DSPI_DCTAR4_ASC(x) (((x)&0x0000000F)<<8) /* After SCK delay scaler */
43523 +#define MCF_DSPI_DCTAR4_CSSCK(x) (((x)&0x0000000F)<<12) /* PCS to SCK delay scaler */
43524 +#define MCF_DSPI_DCTAR4_PBR(x) (((x)&0x00000003)<<16) /* Baud rate prescaler */
43525 +#define MCF_DSPI_DCTAR4_PDT(x) (((x)&0x00000003)<<18) /* Delay after transfer prescaler */
43526 +#define MCF_DSPI_DCTAR4_PASC(x) (((x)&0x00000003)<<20) /* After SCK delay prescaler */
43527 +#define MCF_DSPI_DCTAR4_PCSSCK(x) (((x)&0x00000003)<<22) /* PCS to SCK delay prescaler */
43528 +#define MCF_DSPI_DCTAR4_LSBFE (0x01000000) /* LSB first enable */
43529 +#define MCF_DSPI_DCTAR4_CPHA (0x02000000) /* Clock phase */
43530 +#define MCF_DSPI_DCTAR4_CPOL (0x04000000) /* Clock polarity */
43531 +#define MCF_DSPI_DCTAR4_FMSZ(x) (((x)&0x0000000F)<<27) /* Frame size */
43532 +#define MCF_DSPI_DCTAR4_DBR (0x80000000) /* Double baud rate */
43534 +/* Bit definitions and macros for DCTAR5 */
43535 +#define MCF_DSPI_DCTAR5_BR(x) (((x)&0x0000000F)) /* Baud rate scaler */
43536 +#define MCF_DSPI_DCTAR5_DT(x) (((x)&0x0000000F)<<4) /* Delay after transfer scaler */
43537 +#define MCF_DSPI_DCTAR5_ASC(x) (((x)&0x0000000F)<<8) /* After SCK delay scaler */
43538 +#define MCF_DSPI_DCTAR5_CSSCK(x) (((x)&0x0000000F)<<12) /* PCS to SCK delay scaler */
43539 +#define MCF_DSPI_DCTAR5_PBR(x) (((x)&0x00000003)<<16) /* Baud rate prescaler */
43540 +#define MCF_DSPI_DCTAR5_PDT(x) (((x)&0x00000003)<<18) /* Delay after transfer prescaler */
43541 +#define MCF_DSPI_DCTAR5_PASC(x) (((x)&0x00000003)<<20) /* After SCK delay prescaler */
43542 +#define MCF_DSPI_DCTAR5_PCSSCK(x) (((x)&0x00000003)<<22) /* PCS to SCK delay prescaler */
43543 +#define MCF_DSPI_DCTAR5_LSBFE (0x01000000) /* LSB first enable */
43544 +#define MCF_DSPI_DCTAR5_CPHA (0x02000000) /* Clock phase */
43545 +#define MCF_DSPI_DCTAR5_CPOL (0x04000000) /* Clock polarity */
43546 +#define MCF_DSPI_DCTAR5_FMSZ(x) (((x)&0x0000000F)<<27) /* Frame size */
43547 +#define MCF_DSPI_DCTAR5_DBR (0x80000000) /* Double baud rate */
43549 +/* Bit definitions and macros for DCTAR6 */
43550 +#define MCF_DSPI_DCTAR6_BR(x) (((x)&0x0000000F)) /* Baud rate scaler */
43551 +#define MCF_DSPI_DCTAR6_DT(x) (((x)&0x0000000F)<<4) /* Delay after transfer scaler */
43552 +#define MCF_DSPI_DCTAR6_ASC(x) (((x)&0x0000000F)<<8) /* After SCK delay scaler */
43553 +#define MCF_DSPI_DCTAR6_CSSCK(x) (((x)&0x0000000F)<<12) /* PCS to SCK delay scaler */
43554 +#define MCF_DSPI_DCTAR6_PBR(x) (((x)&0x00000003)<<16) /* Baud rate prescaler */
43555 +#define MCF_DSPI_DCTAR6_PDT(x) (((x)&0x00000003)<<18) /* Delay after transfer prescaler */
43556 +#define MCF_DSPI_DCTAR6_PASC(x) (((x)&0x00000003)<<20) /* After SCK delay prescaler */
43557 +#define MCF_DSPI_DCTAR6_PCSSCK(x) (((x)&0x00000003)<<22) /* PCS to SCK delay prescaler */
43558 +#define MCF_DSPI_DCTAR6_LSBFE (0x01000000) /* LSB first enable */
43559 +#define MCF_DSPI_DCTAR6_CPHA (0x02000000) /* Clock phase */
43560 +#define MCF_DSPI_DCTAR6_CPOL (0x04000000) /* Clock polarity */
43561 +#define MCF_DSPI_DCTAR6_FMSZ(x) (((x)&0x0000000F)<<27) /* Frame size */
43562 +#define MCF_DSPI_DCTAR6_DBR (0x80000000) /* Double baud rate */
43564 +/* Bit definitions and macros for DCTAR7 */
43565 +#define MCF_DSPI_DCTAR7_BR(x) (((x)&0x0000000F)) /* Baud rate scaler */
43566 +#define MCF_DSPI_DCTAR7_DT(x) (((x)&0x0000000F)<<4) /* Delay after transfer scaler */
43567 +#define MCF_DSPI_DCTAR7_ASC(x) (((x)&0x0000000F)<<8) /* After SCK delay scaler */
43568 +#define MCF_DSPI_DCTAR7_CSSCK(x) (((x)&0x0000000F)<<12) /* PCS to SCK delay scaler */
43569 +#define MCF_DSPI_DCTAR7_PBR(x) (((x)&0x00000003)<<16) /* Baud rate prescaler */
43570 +#define MCF_DSPI_DCTAR7_PDT(x) (((x)&0x00000003)<<18) /* Delay after transfer prescaler */
43571 +#define MCF_DSPI_DCTAR7_PASC(x) (((x)&0x00000003)<<20) /* After SCK delay prescaler */
43572 +#define MCF_DSPI_DCTAR7_PCSSCK(x) (((x)&0x00000003)<<22) /* PCS to SCK delay prescaler */
43573 +#define MCF_DSPI_DCTAR7_LSBFE (0x01000000) /* LSB first enable */
43574 +#define MCF_DSPI_DCTAR7_CPHA (0x02000000) /* Clock phase */
43575 +#define MCF_DSPI_DCTAR7_CPOL (0x04000000) /* Clock polarity */
43576 +#define MCF_DSPI_DCTAR7_FMSZ(x) (((x)&0x0000000F)<<27) /* Frame size */
43577 +#define MCF_DSPI_DCTAR7_DBR (0x80000000) /* Double baud rate */
43579 +/* Bit definitions and macros for DSR */
43580 +#define MCF_DSPI_DSR_RXPTR(x) (((x)&0x0000000F)) /* Receive next pointer */
43581 +#define MCF_DSPI_DSR_RXCTR(x) (((x)&0x0000000F)<<4) /* Receive FIFO counter */
43582 +#define MCF_DSPI_DSR_TXPTR(x) (((x)&0x0000000F)<<8) /* Transmit next pointer */
43583 +#define MCF_DSPI_DSR_TXCTR(x) (((x)&0x0000000F)<<12) /* Transmit FIFO counter */
43584 +#define MCF_DSPI_DSR_RFDF (0x00020000) /* Receive FIFO drain flag */
43585 +#define MCF_DSPI_DSR_RFOF (0x00080000) /* Receive FIFO overflow flag */
43586 +#define MCF_DSPI_DSR_TFFF (0x02000000) /* Transmit FIFO fill flag */
43587 +#define MCF_DSPI_DSR_TFUF (0x08000000) /* Transmit FIFO underflow flag */
43588 +#define MCF_DSPI_DSR_EOQF (0x10000000) /* End of queue flag */
43589 +#define MCF_DSPI_DSR_TXRXS (0x40000000) /* Tx and Rx status (enabled | disabled) */
43590 +#define MCF_DSPI_DSR_TCF (0x80000000) /* Transfer complete flag */
43592 +/* Bit definitions and macros for DRSER */
43593 +#define MCF_DSPI_DRSER_RFDFS (0x00010000) /* Receive FIFO drain DMA or interrupt select */
43594 +#define MCF_DSPI_DRSER_RFDFE (0x00020000) /* Receive FIFO drain request enable */
43595 +#define MCF_DSPI_DRSER_RFOFE (0x00080000) /* Receive FIFO overflow request enable */
43596 +#define MCF_DSPI_DRSER_TFFFS (0x01000000) /* Transmit FIFO fill DMA or interrupt select */
43597 +#define MCF_DSPI_DRSER_TFFFE (0x02000000) /* Transmit FIFO fill request enable */
43598 +#define MCF_DSPI_DRSER_TFUFE (0x08000000) /* Transmit FIFO underflow request enable */
43599 +#define MCF_DSPI_DRSER_EOQFE (0x10000000) /* DSPI finished request enable */
43600 +#define MCF_DSPI_DRSER_TCFE (0x80000000) /* Transmission complete request enable */
43602 +/* Bit definitions and macros for DTFR */
43603 +#define MCF_DSPI_DTFR_TXDATA(x) (((x)&0x0000FFFF)) /* Transmit data */
43604 +#define MCF_DSPI_DTFR_PCS0 (0x00010000) /* Peripheral chip select 0 */
43605 +#define MCF_DSPI_DTFR_PCS1 (0x00020000) /* Peripheral chip select 1 */
43606 +#define MCF_DSPI_DTFR_PCS2 (0x00040000) /* Peripheral chip select 2 */
43607 +#define MCF_DSPI_DTFR_PCS3 (0x00080000) /* Peripheral chip select 3 */
43608 +#define MCF_DSPI_DTFR_PCS4 (0x00100000) /* Peripheral chip select 4 */
43609 +#define MCF_DSPI_DTFR_PCS5 (0x00200000) /* Peripheral chip select 5 */
43610 +#define MCF_DSPI_DTFR_PCS6 (0x00400000) /* Peripheral chip select 6 */
43611 +#define MCF_DSPI_DTFR_PCS7 (0x00800000) /* Peripheral chip select 7 */
43612 +#define MCF_DSPI_DTFR_CTCNT (0x04000000) /* Clear SPI transfer counter */
43613 +#define MCF_DSPI_DTFR_EOQ (0x08000000) /* End of queue */
43614 +#define MCF_DSPI_DTFR_CTAS(x) (((x)&0x00000007)<<28) /* Clock and transfer attributes select */
43615 +#define MCF_DSPI_DTFR_CONT (0x80000000) /* Continuous peripheral chip-select enable */
43617 +/* Bit definitions and macros for DRFR */
43618 +#define MCF_DSPI_DRFR_RXDATA(x) (((x)&0x0000FFFF)) /* Receive data */
43620 +/* Bit definitions and macros for DTFDR group */
43621 +#define MCF_DSPI_DTFDR_TXDATA(x) (((x)&0x0000FFFF)) /* Transmit data */
43622 +#define MCF_DSPI_DTFDR_PCS0 (0x00010000) /* Peripheral chip select 0 */
43623 +#define MCF_DSPI_DTFDR_PCS1 (0x00020000) /* Peripheral chip select 1 */
43624 +#define MCF_DSPI_DTFDR_PCS2 (0x00040000) /* Peripheral chip select 2 */
43625 +#define MCF_DSPI_DTFDR_PCS3 (0x00080000) /* Peripheral chip select 3 */
43626 +#define MCF_DSPI_DTFDR_PCS4 (0x00100000) /* Peripheral chip select 4 */
43627 +#define MCF_DSPI_DTFDR_PCS5 (0x00200000) /* Peripheral chip select 5 */
43628 +#define MCF_DSPI_DTFDR_PCS6 (0x00400000) /* Peripheral chip select 6 */
43629 +#define MCF_DSPI_DTFDR_PCS7 (0x00800000) /* Peripheral chip select 7 */
43630 +#define MCF_DSPI_DTFDR_CTCNT (0x04000000) /* Clear SPI transfer counter */
43631 +#define MCF_DSPI_DTFDR_EOQ (0x08000000) /* End of queue */
43632 +#define MCF_DSPI_DTFDR_CTAS(x) (((x)&0x00000007)<<28) /* Clock and transfer attributes select */
43633 +#define MCF_DSPI_DTFDR_CONT (0x80000000) /* Continuous peripheral chip-select enable */
43635 +/* Bit definitions and macros for DTFDR0 */
43636 +#define MCF_DSPI_DTFDR0_TXDATA(x) (((x)&0x0000FFFF)) /* Transmit data */
43637 +#define MCF_DSPI_DTFDR0_PCS0 (0x00010000) /* Peripheral chip select 0 */
43638 +#define MCF_DSPI_DTFDR0_PCS1 (0x00020000) /* Peripheral chip select 1 */
43639 +#define MCF_DSPI_DTFDR0_PCS2 (0x00040000) /* Peripheral chip select 2 */
43640 +#define MCF_DSPI_DTFDR0_PCS3 (0x00080000) /* Peripheral chip select 3 */
43641 +#define MCF_DSPI_DTFDR0_PCS4 (0x00100000) /* Peripheral chip select 4 */
43642 +#define MCF_DSPI_DTFDR0_PCS5 (0x00200000) /* Peripheral chip select 5 */
43643 +#define MCF_DSPI_DTFDR0_PCS6 (0x00400000) /* Peripheral chip select 6 */
43644 +#define MCF_DSPI_DTFDR0_PCS7 (0x00800000) /* Peripheral chip select 7 */
43645 +#define MCF_DSPI_DTFDR0_CTCNT (0x04000000) /* Clear SPI transfer counter */
43646 +#define MCF_DSPI_DTFDR0_EOQ (0x08000000) /* End of queue */
43647 +#define MCF_DSPI_DTFDR0_CTAS(x) (((x)&0x00000007)<<28) /* Clock and transfer attributes select */
43648 +#define MCF_DSPI_DTFDR0_CONT (0x80000000) /* Continuous peripheral chip-select enable */
43650 +/* Bit definitions and macros for DTFDR1 */
43651 +#define MCF_DSPI_DTFDR1_TXDATA(x) (((x)&0x0000FFFF)) /* Transmit data */
43652 +#define MCF_DSPI_DTFDR1_PCS0 (0x00010000) /* Peripheral chip select 0 */
43653 +#define MCF_DSPI_DTFDR1_PCS1 (0x00020000) /* Peripheral chip select 1 */
43654 +#define MCF_DSPI_DTFDR1_PCS2 (0x00040000) /* Peripheral chip select 2 */
43655 +#define MCF_DSPI_DTFDR1_PCS3 (0x00080000) /* Peripheral chip select 3 */
43656 +#define MCF_DSPI_DTFDR1_PCS4 (0x00100000) /* Peripheral chip select 4 */
43657 +#define MCF_DSPI_DTFDR1_PCS5 (0x00200000) /* Peripheral chip select 5 */
43658 +#define MCF_DSPI_DTFDR1_PCS6 (0x00400000) /* Peripheral chip select 6 */
43659 +#define MCF_DSPI_DTFDR1_PCS7 (0x00800000) /* Peripheral chip select 7 */
43660 +#define MCF_DSPI_DTFDR1_CTCNT (0x04000000) /* Clear SPI transfer counter */
43661 +#define MCF_DSPI_DTFDR1_EOQ (0x08000000) /* End of queue */
43662 +#define MCF_DSPI_DTFDR1_CTAS(x) (((x)&0x00000007)<<28) /* Clock and transfer attributes select */
43663 +#define MCF_DSPI_DTFDR1_CONT (0x80000000) /* Continuous peripheral chip-select enable */
43665 +/* Bit definitions and macros for DTFDR2 */
43666 +#define MCF_DSPI_DTFDR2_TXDATA(x) (((x)&0x0000FFFF)) /* Transmit data */
43667 +#define MCF_DSPI_DTFDR2_PCS0 (0x00010000) /* Peripheral chip select 0 */
43668 +#define MCF_DSPI_DTFDR2_PCS1 (0x00020000) /* Peripheral chip select 1 */
43669 +#define MCF_DSPI_DTFDR2_PCS2 (0x00040000) /* Peripheral chip select 2 */
43670 +#define MCF_DSPI_DTFDR2_PCS3 (0x00080000) /* Peripheral chip select 3 */
43671 +#define MCF_DSPI_DTFDR2_PCS4 (0x00100000) /* Peripheral chip select 4 */
43672 +#define MCF_DSPI_DTFDR2_PCS5 (0x00200000) /* Peripheral chip select 5 */
43673 +#define MCF_DSPI_DTFDR2_PCS6 (0x00400000) /* Peripheral chip select 6 */
43674 +#define MCF_DSPI_DTFDR2_PCS7 (0x00800000) /* Peripheral chip select 7 */
43675 +#define MCF_DSPI_DTFDR2_CTCNT (0x04000000) /* Clear SPI transfer counter */
43676 +#define MCF_DSPI_DTFDR2_EOQ (0x08000000) /* End of queue */
43677 +#define MCF_DSPI_DTFDR2_CTAS(x) (((x)&0x00000007)<<28) /* Clock and transfer attributes select */
43678 +#define MCF_DSPI_DTFDR2_CONT (0x80000000) /* Continuous peripheral chip-select enable */
43680 +/* Bit definitions and macros for DTFDR3 */
43681 +#define MCF_DSPI_DTFDR3_TXDATA(x) (((x)&0x0000FFFF)) /* Transmit data */
43682 +#define MCF_DSPI_DTFDR3_PCS0 (0x00010000) /* Peripheral chip select 0 */
43683 +#define MCF_DSPI_DTFDR3_PCS1 (0x00020000) /* Peripheral chip select 1 */
43684 +#define MCF_DSPI_DTFDR3_PCS2 (0x00040000) /* Peripheral chip select 2 */
43685 +#define MCF_DSPI_DTFDR3_PCS3 (0x00080000) /* Peripheral chip select 3 */
43686 +#define MCF_DSPI_DTFDR3_PCS4 (0x00100000) /* Peripheral chip select 4 */
43687 +#define MCF_DSPI_DTFDR3_PCS5 (0x00200000) /* Peripheral chip select 5 */
43688 +#define MCF_DSPI_DTFDR3_PCS6 (0x00400000) /* Peripheral chip select 6 */
43689 +#define MCF_DSPI_DTFDR3_PCS7 (0x00800000) /* Peripheral chip select 7 */
43690 +#define MCF_DSPI_DTFDR3_CTCNT (0x04000000) /* Clear SPI transfer counter */
43691 +#define MCF_DSPI_DTFDR3_EOQ (0x08000000) /* End of queue */
43692 +#define MCF_DSPI_DTFDR3_CTAS(x) (((x)&0x00000007)<<28) /* Clock and transfer attributes select */
43693 +#define MCF_DSPI_DTFDR3_CONT (0x80000000) /* Continuous peripheral chip-select enable */
43695 +/* Bit definitions and macros for DRFDR group */
43696 +#define MCF_DSPI_DRFDR_RXDATA(x) (((x)&0x0000FFFF)) /* Receive data */
43698 +/* Bit definitions and macros for DRFDR0 */
43699 +#define MCF_DSPI_DRFDR0_RXDATA(x) (((x)&0x0000FFFF)) /* Receive data */
43701 +/* Bit definitions and macros for DRFDR1 */
43702 +#define MCF_DSPI_DRFDR1_RXDATA(x) (((x)&0x0000FFFF)) /* Receive data */
43704 +/* Bit definitions and macros for DRFDR2 */
43705 +#define MCF_DSPI_DRFDR2_RXDATA(x) (((x)&0x0000FFFF)) /* Receive data */
43707 +/* Bit definitions and macros for DRFDR3 */
43708 +#define MCF_DSPI_DRFDR3_RXDATA(x) (((x)&0x0000FFFF)) /* Receive data */
43710 +/********************************************************************/
43712 +#endif /* __MCF5445X_DSPI_H__ */
43714 +++ b/include/asm-m68k/mcf5445x_dtim.h
43717 + * Matt Waddel Matt.Waddel@freescale.com
43719 + * Copyright Freescale Semiconductor, Inc. 2007
43721 + * This program is free software; you can redistribute it and/or modify it
43722 + * under the terms of the GNU General Public License as published by the
43723 + * Free Software Foundation; either version 2 of the License, or (at your
43724 + * option) any later version.
43727 +#ifndef __MCF5445X_DTIM_H__
43728 +#define __MCF5445X_DTIM_H__
43730 +/*********************************************************************
43732 +* DMA Timers (DTIM)
43734 +*********************************************************************/
43735 +/* Register read/write macros */
43736 +#define MCF_DTIM0_DTMR 0xFC070000 /* DMA Timer Mode Register */
43737 +#define MCF_DTIM0_DTXMR 0xFC070002 /* DMA Timer Extended Mode Register */
43738 +#define MCF_DTIM0_DTER 0xFC070003 /* DMA Timer Event Register */
43739 +#define MCF_DTIM0_DTRR 0xFC070004 /* DMA Timer Reference Register */
43740 +#define MCF_DTIM0_DTCR 0xFC070008 /* DMA Timer Capture Register */
43741 +#define MCF_DTIM0_DTCN 0xFC07000C /* DMA Timer Counter Register */
43742 +#define MCF_DTIM1_DTMR 0xFC074000 /* DMA Timer Mode Register */
43743 +#define MCF_DTIM1_DTXMR 0xFC074002 /* DMA Timer Extended Mode Register */
43744 +#define MCF_DTIM1_DTER 0xFC074003 /* DMA Timer Event Register */
43745 +#define MCF_DTIM1_DTRR 0xFC074004 /* DMA Timer Reference Register */
43746 +#define MCF_DTIM1_DTCR 0xFC074008 /* DMA Timer Capture Register */
43747 +#define MCF_DTIM1_DTCN 0xFC07400C /* DMA Timer Counter Register */
43748 +#define MCF_DTIM2_DTMR 0xFC078000 /* DMA Timer Mode Register */
43749 +#define MCF_DTIM2_DTXMR 0xFC078002 /* DMA Timer Extended Mode Register */
43750 +#define MCF_DTIM2_DTER 0xFC078003 /* DMA Timer Event Register */
43751 +#define MCF_DTIM2_DTRR 0xFC078004 /* DMA Timer Reference Register */
43752 +#define MCF_DTIM2_DTCR 0xFC078008 /* DMA Timer Capture Register */
43753 +#define MCF_DTIM2_DTCN 0xFC07800C /* DMA Timer Counter Register */
43754 +#define MCF_DTIM3_DTMR 0xFC07C000 /* DMA Timer Mode Register */
43755 +#define MCF_DTIM3_DTXMR 0xFC07C002 /* DMA Timer Extended Mode Register */
43756 +#define MCF_DTIM3_DTER 0xFC07C003 /* DMA Timer Event Register */
43757 +#define MCF_DTIM3_DTRR 0xFC07C004 /* DMA Timer Reference Register */
43758 +#define MCF_DTIM3_DTCR 0xFC07C008 /* DMA Timer Capture Register */
43759 +#define MCF_DTIM3_DTCN 0xFC07C00C /* DMA Timer Counter Register */
43761 +/* Parameterized register read/write macros for multiple modules */
43762 +#define MCF_DTIM_DTMR(x) 0xFC070000+((x)*0x4000) /* DMA Timer Mode Register */
43763 +#define MCF_DTIM_DTXMR(x) 0xFC070002+((x)*0x4000) /* DMA Timer Extended Mode Register */
43764 +#define MCF_DTIM_DTER(x) 0xFC070003+((x)*0x4000) /* DMA Timer Event Register */
43765 +#define MCF_DTIM_DTRR(x) 0xFC070004+((x)*0x4000) /* DMA Timer Reference Register */
43766 +#define MCF_DTIM_DTCR(x) 0xFC070008+((x)*0x4000) /* DMA Timer Capture Register */
43767 +#define MCF_DTIM_DTCN(x) 0xFC07000C+((x)*0x4000) /* DMA Timer Counter Register */
43769 +/* Bit definitions and macros for DTMR */
43770 +#define MCF_DTIM_DTMR_RST (0x0001) /* Reset */
43771 +#define MCF_DTIM_DTMR_CLK(x) (((x)&0x0003)<<1) /* Input clock source */
43772 +#define MCF_DTIM_DTMR_FRR (0x0008) /* Free run/restart */
43773 +#define MCF_DTIM_DTMR_ORRI (0x0010) /* Output reference request/interrupt enable */
43774 +#define MCF_DTIM_DTMR_OM (0x0020) /* Output Mode */
43775 +#define MCF_DTIM_DTMR_CE(x) (((x)&0x0003)<<6) /* Capture Edge */
43776 +#define MCF_DTIM_DTMR_PS(x) (((x)&0x00FF)<<8) /* Prescaler value */
43777 +#define MCF_DTIM_DTMR_RST_EN (0x0001)
43778 +#define MCF_DTIM_DTMR_RST_RST (0x0000)
43779 +#define MCF_DTIM_DTMR_CE_ANY (0x00C0)
43780 +#define MCF_DTIM_DTMR_CE_FALL (0x0080)
43781 +#define MCF_DTIM_DTMR_CE_RISE (0x0040)
43782 +#define MCF_DTIM_DTMR_CE_NONE (0x0000)
43783 +#define MCF_DTIM_DTMR_CLK_DTIN (0x0006)
43784 +#define MCF_DTIM_DTMR_CLK_DIV16 (0x0004)
43785 +#define MCF_DTIM_DTMR_CLK_DIV1 (0x0002)
43786 +#define MCF_DTIM_DTMR_CLK_STOP (0x0000)
43788 +/* Bit definitions and macros for DTXMR */
43789 +#define MCF_DTIM_DTXMR_MODE16 (0x01) /* Increment Mode */
43790 +#define MCF_DTIM_DTXMR_DMAEN (0x80) /* DMA request */
43792 +/* Bit definitions and macros for DTER */
43793 +#define MCF_DTIM_DTER_CAP (0x01) /* Capture event */
43794 +#define MCF_DTIM_DTER_REF (0x02) /* Output reference event */
43796 +/* Interrupts used for system timers */
43797 +#define MCFSIM_ICR_TIMER1 (0xFC048040+32)
43798 +#define MCFSIM_ICR_TIMER2 (0xFC048040+33)
43800 +/********************************************************************/
43802 +#endif /* __MCF5445X_DTIM_H__ */
43804 +++ b/include/asm-m68k/mcf5445x_edma.h
43807 + * Yaroslav Vinogradov yaroslav.vinogradov@freescale.com
43809 + * Copyright Freescale Semiconductor, Inc. 2007
43811 + * This program is free software; you can redistribute it and/or modify it
43812 + * under the terms of the GNU General Public License as published by the
43813 + * Free Software Foundation; either version 2 of the License, or (at your
43814 + * option) any later version.
43816 +#ifndef __MCF5445X_EDMA_H__
43817 +#define __MCF5445X_EDMA_H__
43820 + * Enhanced DMA (EDMA)
43824 +#define MCF_EDMA_CHAN_DREQ0 0 /* External DMA request 0 */
43825 +#define MCF_EDMA_CHAN_DREQ1 1 /* External DMA request 1 */
43826 +#define MCF_EDMA_CHAN_UART0_RX 2 /* UART0 Receive */
43827 +#define MCF_EDMA_CHAN_UART0_TX 3 /* UART0 Transmit */
43828 +#define MCF_EDMA_CHAN_UART1_RX 4 /* UART1 Receive */
43829 +#define MCF_EDMA_CHAN_UART1_TX 5 /* UART1 Transmit */
43830 +#define MCF_EDMA_CHAN_UART2_RX 6 /* UART2 Receive */
43831 +#define MCF_EDMA_CHAN_UART2_TX 7 /* UART2 Transmit */
43832 +#define MCF_EDMA_CHAN_TIMER0 8 /* Timer 0 / SSI0 Rx */
43833 +#define MCF_EDMA_CHAN_TIMER1 9 /* Timer 1 / SSI1 Rx */
43834 +#define MCF_EDMA_CHAN_TIMER2 10 /* Timer 2 / SSI0 Tx */
43835 +#define MCF_EDMA_CHAN_TIMER3 11 /* Timer 3 / SSI1 Tx */
43836 +#define MCF_EDMA_CHAN_DSPI_RX 12 /* DSPI Receive */
43837 +#define MCF_EDMA_CHAN_DSPI_TX 13 /* DSPI Transmit */
43838 +#define MCF_EDMA_CHAN_ATA_RX 14 /* ATA Receive */
43839 +#define MCF_EDMA_CHAN_ATA_TX 15 /* ATA Transmit */
43841 +/* Register read/write macros */
43842 +#define MCF_EDMA_CR MCF_REG32(0xFC044000)
43843 +#define MCF_EDMA_ES MCF_REG32(0xFC044004)
43844 +#define MCF_EDMA_ERQ MCF_REG16(0xFC04400E)
43845 +#define MCF_EDMA_EEI MCF_REG16(0xFC044016)
43846 +#define MCF_EDMA_SERQ MCF_REG08(0xFC044018)
43847 +#define MCF_EDMA_CERQ MCF_REG08(0xFC044019)
43848 +#define MCF_EDMA_SEEI MCF_REG08(0xFC04401A)
43849 +#define MCF_EDMA_CEEI MCF_REG08(0xFC04401B)
43850 +#define MCF_EDMA_CINT MCF_REG08(0xFC04401C)
43851 +#define MCF_EDMA_CERR MCF_REG08(0xFC04401D)
43852 +#define MCF_EDMA_SSRT MCF_REG08(0xFC04401E)
43853 +#define MCF_EDMA_CDNE MCF_REG08(0xFC04401F)
43854 +#define MCF_EDMA_INTR MCF_REG16(0xFC044026)
43855 +#define MCF_EDMA_ERR MCF_REG16(0xFC04402E)
43856 +#define MCF_EDMA_DCHPRI0 MCF_REG08(0xFC044100)
43857 +#define MCF_EDMA_DCHPRI1 MCF_REG08(0xFC044101)
43858 +#define MCF_EDMA_DCHPRI2 MCF_REG08(0xFC044102)
43859 +#define MCF_EDMA_DCHPRI3 MCF_REG08(0xFC044103)
43860 +#define MCF_EDMA_DCHPRI4 MCF_REG08(0xFC044104)
43861 +#define MCF_EDMA_DCHPRI5 MCF_REG08(0xFC044105)
43862 +#define MCF_EDMA_DCHPRI6 MCF_REG08(0xFC044106)
43863 +#define MCF_EDMA_DCHPRI7 MCF_REG08(0xFC044107)
43864 +#define MCF_EDMA_DCHPRI8 MCF_REG08(0xFC044108)
43865 +#define MCF_EDMA_DCHPRI9 MCF_REG08(0xFC044109)
43866 +#define MCF_EDMA_DCHPRI10 MCF_REG08(0xFC04410A)
43867 +#define MCF_EDMA_DCHPRI11 MCF_REG08(0xFC04410B)
43868 +#define MCF_EDMA_DCHPRI12 MCF_REG08(0xFC04410C)
43869 +#define MCF_EDMA_DCHPRI13 MCF_REG08(0xFC04410D)
43870 +#define MCF_EDMA_DCHPRI14 MCF_REG08(0xFC04410E)
43871 +#define MCF_EDMA_DCHPRI15 MCF_REG08(0xFC04410F)
43872 +#define MCF_EDMA_TCD0_SADDR MCF_REG32(0xFC045000)
43873 +#define MCF_EDMA_TCD0_ATTR MCF_REG16(0xFC045004)
43874 +#define MCF_EDMA_TCD0_SOFF MCF_REG16(0xFC045006)
43875 +#define MCF_EDMA_TCD0_NBYTES MCF_REG32(0xFC045008)
43876 +#define MCF_EDMA_TCD0_SLAST MCF_REG32(0xFC04500C)
43877 +#define MCF_EDMA_TCD0_DADDR MCF_REG32(0xFC045010)
43878 +#define MCF_EDMA_TCD0_CITER_ELINK MCF_REG16(0xFC045014)
43879 +#define MCF_EDMA_TCD0_CITER MCF_REG16(0xFC045014)
43880 +#define MCF_EDMA_TCD0_DOFF MCF_REG16(0xFC045016)
43881 +#define MCF_EDMA_TCD0_DLAST_SGA MCF_REG32(0xFC045018)
43882 +#define MCF_EDMA_TCD0_BITER_ELINK MCF_REG16(0xFC04501C)
43883 +#define MCF_EDMA_TCD0_BITER MCF_REG16(0xFC04501C)
43884 +#define MCF_EDMA_TCD0_CSR MCF_REG16(0xFC04501E)
43885 +#define MCF_EDMA_TCD1_SADDR MCF_REG32(0xFC045020)
43886 +#define MCF_EDMA_TCD1_ATTR MCF_REG16(0xFC045024)
43887 +#define MCF_EDMA_TCD1_SOFF MCF_REG16(0xFC045026)
43888 +#define MCF_EDMA_TCD1_NBYTES MCF_REG32(0xFC045028)
43889 +#define MCF_EDMA_TCD1_SLAST MCF_REG32(0xFC04502C)
43890 +#define MCF_EDMA_TCD1_DADDR MCF_REG32(0xFC045030)
43891 +#define MCF_EDMA_TCD1_CITER_ELINK MCF_REG16(0xFC045034)
43892 +#define MCF_EDMA_TCD1_CITER MCF_REG16(0xFC045034)
43893 +#define MCF_EDMA_TCD1_DOFF MCF_REG16(0xFC045036)
43894 +#define MCF_EDMA_TCD1_DLAST_SGA MCF_REG32(0xFC045038)
43895 +#define MCF_EDMA_TCD1_BITER MCF_REG16(0xFC04503C)
43896 +#define MCF_EDMA_TCD1_BITER_ELINK MCF_REG16(0xFC04503C)
43897 +#define MCF_EDMA_TCD1_CSR MCF_REG16(0xFC04503E)
43898 +#define MCF_EDMA_TCD2_SADDR MCF_REG32(0xFC045040)
43899 +#define MCF_EDMA_TCD2_ATTR MCF_REG16(0xFC045044)
43900 +#define MCF_EDMA_TCD2_SOFF MCF_REG16(0xFC045046)
43901 +#define MCF_EDMA_TCD2_NBYTES MCF_REG32(0xFC045048)
43902 +#define MCF_EDMA_TCD2_SLAST MCF_REG32(0xFC04504C)
43903 +#define MCF_EDMA_TCD2_DADDR MCF_REG32(0xFC045050)
43904 +#define MCF_EDMA_TCD2_CITER MCF_REG16(0xFC045054)
43905 +#define MCF_EDMA_TCD2_CITER_ELINK MCF_REG16(0xFC045054)
43906 +#define MCF_EDMA_TCD2_DOFF MCF_REG16(0xFC045056)
43907 +#define MCF_EDMA_TCD2_DLAST_SGA MCF_REG32(0xFC045058)
43908 +#define MCF_EDMA_TCD2_BITER_ELINK MCF_REG16(0xFC04505C)
43909 +#define MCF_EDMA_TCD2_BITER MCF_REG16(0xFC04505C)
43910 +#define MCF_EDMA_TCD2_CSR MCF_REG16(0xFC04505E)
43911 +#define MCF_EDMA_TCD3_SADDR MCF_REG32(0xFC045060)
43912 +#define MCF_EDMA_TCD3_ATTR MCF_REG16(0xFC045064)
43913 +#define MCF_EDMA_TCD3_SOFF MCF_REG16(0xFC045066)
43914 +#define MCF_EDMA_TCD3_NBYTES MCF_REG32(0xFC045068)
43915 +#define MCF_EDMA_TCD3_SLAST MCF_REG32(0xFC04506C)
43916 +#define MCF_EDMA_TCD3_DADDR MCF_REG32(0xFC045070)
43917 +#define MCF_EDMA_TCD3_CITER MCF_REG16(0xFC045074)
43918 +#define MCF_EDMA_TCD3_CITER_ELINK MCF_REG16(0xFC045074)
43919 +#define MCF_EDMA_TCD3_DOFF MCF_REG16(0xFC045076)
43920 +#define MCF_EDMA_TCD3_DLAST_SGA MCF_REG32(0xFC045078)
43921 +#define MCF_EDMA_TCD3_BITER_ELINK MCF_REG16(0xFC04507C)
43922 +#define MCF_EDMA_TCD3_BITER MCF_REG16(0xFC04507C)
43923 +#define MCF_EDMA_TCD3_CSR MCF_REG16(0xFC04507E)
43924 +#define MCF_EDMA_TCD4_SADDR MCF_REG32(0xFC045080)
43925 +#define MCF_EDMA_TCD4_ATTR MCF_REG16(0xFC045084)
43926 +#define MCF_EDMA_TCD4_SOFF MCF_REG16(0xFC045086)
43927 +#define MCF_EDMA_TCD4_NBYTES MCF_REG32(0xFC045088)
43928 +#define MCF_EDMA_TCD4_SLAST MCF_REG32(0xFC04508C)
43929 +#define MCF_EDMA_TCD4_DADDR MCF_REG32(0xFC045090)
43930 +#define MCF_EDMA_TCD4_CITER MCF_REG16(0xFC045094)
43931 +#define MCF_EDMA_TCD4_CITER_ELINK MCF_REG16(0xFC045094)
43932 +#define MCF_EDMA_TCD4_DOFF MCF_REG16(0xFC045096)
43933 +#define MCF_EDMA_TCD4_DLAST_SGA MCF_REG32(0xFC045098)
43934 +#define MCF_EDMA_TCD4_BITER MCF_REG16(0xFC04509C)
43935 +#define MCF_EDMA_TCD4_BITER_ELINK MCF_REG16(0xFC04509C)
43936 +#define MCF_EDMA_TCD4_CSR MCF_REG16(0xFC04509E)
43937 +#define MCF_EDMA_TCD5_SADDR MCF_REG32(0xFC0450A0)
43938 +#define MCF_EDMA_TCD5_ATTR MCF_REG16(0xFC0450A4)
43939 +#define MCF_EDMA_TCD5_SOFF MCF_REG16(0xFC0450A6)
43940 +#define MCF_EDMA_TCD5_NBYTES MCF_REG32(0xFC0450A8)
43941 +#define MCF_EDMA_TCD5_SLAST MCF_REG32(0xFC0450AC)
43942 +#define MCF_EDMA_TCD5_DADDR MCF_REG32(0xFC0450B0)
43943 +#define MCF_EDMA_TCD5_CITER MCF_REG16(0xFC0450B4)
43944 +#define MCF_EDMA_TCD5_CITER_ELINK MCF_REG16(0xFC0450B4)
43945 +#define MCF_EDMA_TCD5_DOFF MCF_REG16(0xFC0450B6)
43946 +#define MCF_EDMA_TCD5_DLAST_SGA MCF_REG32(0xFC0450B8)
43947 +#define MCF_EDMA_TCD5_BITER_ELINK MCF_REG16(0xFC0450BC)
43948 +#define MCF_EDMA_TCD5_BITER MCF_REG16(0xFC0450BC)
43949 +#define MCF_EDMA_TCD5_CSR MCF_REG16(0xFC0450BE)
43950 +#define MCF_EDMA_TCD6_SADDR MCF_REG32(0xFC0450C0)
43951 +#define MCF_EDMA_TCD6_ATTR MCF_REG16(0xFC0450C4)
43952 +#define MCF_EDMA_TCD6_SOFF MCF_REG16(0xFC0450C6)
43953 +#define MCF_EDMA_TCD6_NBYTES MCF_REG32(0xFC0450C8)
43954 +#define MCF_EDMA_TCD6_SLAST MCF_REG32(0xFC0450CC)
43955 +#define MCF_EDMA_TCD6_DADDR MCF_REG32(0xFC0450D0)
43956 +#define MCF_EDMA_TCD6_CITER MCF_REG16(0xFC0450D4)
43957 +#define MCF_EDMA_TCD6_CITER_ELINK MCF_REG16(0xFC0450D4)
43958 +#define MCF_EDMA_TCD6_DOFF MCF_REG16(0xFC0450D6)
43959 +#define MCF_EDMA_TCD6_DLAST_SGA MCF_REG32(0xFC0450D8)
43960 +#define MCF_EDMA_TCD6_BITER_ELINK MCF_REG16(0xFC0450DC)
43961 +#define MCF_EDMA_TCD6_BITER MCF_REG16(0xFC0450DC)
43962 +#define MCF_EDMA_TCD6_CSR MCF_REG16(0xFC0450DE)
43963 +#define MCF_EDMA_TCD7_SADDR MCF_REG32(0xFC0450E0)
43964 +#define MCF_EDMA_TCD7_ATTR MCF_REG16(0xFC0450E4)
43965 +#define MCF_EDMA_TCD7_SOFF MCF_REG16(0xFC0450E6)
43966 +#define MCF_EDMA_TCD7_NBYTES MCF_REG32(0xFC0450E8)
43967 +#define MCF_EDMA_TCD7_SLAST MCF_REG32(0xFC0450EC)
43968 +#define MCF_EDMA_TCD7_DADDR MCF_REG32(0xFC0450F0)
43969 +#define MCF_EDMA_TCD7_CITER MCF_REG16(0xFC0450F4)
43970 +#define MCF_EDMA_TCD7_CITER_ELINK MCF_REG16(0xFC0450F4)
43971 +#define MCF_EDMA_TCD7_DOFF MCF_REG16(0xFC0450F6)
43972 +#define MCF_EDMA_TCD7_DLAST_SGA MCF_REG32(0xFC0450F8)
43973 +#define MCF_EDMA_TCD7_BITER_ELINK MCF_REG16(0xFC0450FC)
43974 +#define MCF_EDMA_TCD7_BITER MCF_REG16(0xFC0450FC)
43975 +#define MCF_EDMA_TCD7_CSR MCF_REG16(0xFC0450FE)
43976 +#define MCF_EDMA_TCD8_SADDR MCF_REG32(0xFC045100)
43977 +#define MCF_EDMA_TCD8_ATTR MCF_REG16(0xFC045104)
43978 +#define MCF_EDMA_TCD8_SOFF MCF_REG16(0xFC045106)
43979 +#define MCF_EDMA_TCD8_NBYTES MCF_REG32(0xFC045108)
43980 +#define MCF_EDMA_TCD8_SLAST MCF_REG32(0xFC04510C)
43981 +#define MCF_EDMA_TCD8_DADDR MCF_REG32(0xFC045110)
43982 +#define MCF_EDMA_TCD8_CITER MCF_REG16(0xFC045114)
43983 +#define MCF_EDMA_TCD8_CITER_ELINK MCF_REG16(0xFC045114)
43984 +#define MCF_EDMA_TCD8_DOFF MCF_REG16(0xFC045116)
43985 +#define MCF_EDMA_TCD8_DLAST_SGA MCF_REG32(0xFC045118)
43986 +#define MCF_EDMA_TCD8_BITER_ELINK MCF_REG16(0xFC04511C)
43987 +#define MCF_EDMA_TCD8_BITER MCF_REG16(0xFC04511C)
43988 +#define MCF_EDMA_TCD8_CSR MCF_REG16(0xFC04511E)
43989 +#define MCF_EDMA_TCD9_SADDR MCF_REG32(0xFC045120)
43990 +#define MCF_EDMA_TCD9_ATTR MCF_REG16(0xFC045124)
43991 +#define MCF_EDMA_TCD9_SOFF MCF_REG16(0xFC045126)
43992 +#define MCF_EDMA_TCD9_NBYTES MCF_REG32(0xFC045128)
43993 +#define MCF_EDMA_TCD9_SLAST MCF_REG32(0xFC04512C)
43994 +#define MCF_EDMA_TCD9_DADDR MCF_REG32(0xFC045130)
43995 +#define MCF_EDMA_TCD9_CITER_ELINK MCF_REG16(0xFC045134)
43996 +#define MCF_EDMA_TCD9_CITER MCF_REG16(0xFC045134)
43997 +#define MCF_EDMA_TCD9_DOFF MCF_REG16(0xFC045136)
43998 +#define MCF_EDMA_TCD9_DLAST_SGA MCF_REG32(0xFC045138)
43999 +#define MCF_EDMA_TCD9_BITER_ELINK MCF_REG16(0xFC04513C)
44000 +#define MCF_EDMA_TCD9_BITER MCF_REG16(0xFC04513C)
44001 +#define MCF_EDMA_TCD9_CSR MCF_REG16(0xFC04513E)
44002 +#define MCF_EDMA_TCD10_SADDR MCF_REG32(0xFC045140)
44003 +#define MCF_EDMA_TCD10_ATTR MCF_REG16(0xFC045144)
44004 +#define MCF_EDMA_TCD10_SOFF MCF_REG16(0xFC045146)
44005 +#define MCF_EDMA_TCD10_NBYTES MCF_REG32(0xFC045148)
44006 +#define MCF_EDMA_TCD10_SLAST MCF_REG32(0xFC04514C)
44007 +#define MCF_EDMA_TCD10_DADDR MCF_REG32(0xFC045150)
44008 +#define MCF_EDMA_TCD10_CITER_ELINK MCF_REG16(0xFC045154)
44009 +#define MCF_EDMA_TCD10_CITER MCF_REG16(0xFC045154)
44010 +#define MCF_EDMA_TCD10_DOFF MCF_REG16(0xFC045156)
44011 +#define MCF_EDMA_TCD10_DLAST_SGA MCF_REG32(0xFC045158)
44012 +#define MCF_EDMA_TCD10_BITER MCF_REG16(0xFC04515C)
44013 +#define MCF_EDMA_TCD10_BITER_ELINK MCF_REG16(0xFC04515C)
44014 +#define MCF_EDMA_TCD10_CSR MCF_REG16(0xFC04515E)
44015 +#define MCF_EDMA_TCD11_SADDR MCF_REG32(0xFC045160)
44016 +#define MCF_EDMA_TCD11_ATTR MCF_REG16(0xFC045164)
44017 +#define MCF_EDMA_TCD11_SOFF MCF_REG16(0xFC045166)
44018 +#define MCF_EDMA_TCD11_NBYTES MCF_REG32(0xFC045168)
44019 +#define MCF_EDMA_TCD11_SLAST MCF_REG32(0xFC04516C)
44020 +#define MCF_EDMA_TCD11_DADDR MCF_REG32(0xFC045170)
44021 +#define MCF_EDMA_TCD11_CITER MCF_REG16(0xFC045174)
44022 +#define MCF_EDMA_TCD11_CITER_ELINK MCF_REG16(0xFC045174)
44023 +#define MCF_EDMA_TCD11_DOFF MCF_REG16(0xFC045176)
44024 +#define MCF_EDMA_TCD11_DLAST_SGA MCF_REG32(0xFC045178)
44025 +#define MCF_EDMA_TCD11_BITER MCF_REG16(0xFC04517C)
44026 +#define MCF_EDMA_TCD11_BITER_ELINK MCF_REG16(0xFC04517C)
44027 +#define MCF_EDMA_TCD11_CSR MCF_REG16(0xFC04517E)
44028 +#define MCF_EDMA_TCD12_SADDR MCF_REG32(0xFC045180)
44029 +#define MCF_EDMA_TCD12_ATTR MCF_REG16(0xFC045184)
44030 +#define MCF_EDMA_TCD12_SOFF MCF_REG16(0xFC045186)
44031 +#define MCF_EDMA_TCD12_NBYTES MCF_REG32(0xFC045188)
44032 +#define MCF_EDMA_TCD12_SLAST MCF_REG32(0xFC04518C)
44033 +#define MCF_EDMA_TCD12_DADDR MCF_REG32(0xFC045190)
44034 +#define MCF_EDMA_TCD12_CITER MCF_REG16(0xFC045194)
44035 +#define MCF_EDMA_TCD12_CITER_ELINK MCF_REG16(0xFC045194)
44036 +#define MCF_EDMA_TCD12_DOFF MCF_REG16(0xFC045196)
44037 +#define MCF_EDMA_TCD12_DLAST_SGA MCF_REG32(0xFC045198)
44038 +#define MCF_EDMA_TCD12_BITER MCF_REG16(0xFC04519C)
44039 +#define MCF_EDMA_TCD12_BITER_ELINK MCF_REG16(0xFC04519C)
44040 +#define MCF_EDMA_TCD12_CSR MCF_REG16(0xFC04519E)
44041 +#define MCF_EDMA_TCD13_SADDR MCF_REG32(0xFC0451A0)
44042 +#define MCF_EDMA_TCD13_ATTR MCF_REG16(0xFC0451A4)
44043 +#define MCF_EDMA_TCD13_SOFF MCF_REG16(0xFC0451A6)
44044 +#define MCF_EDMA_TCD13_NBYTES MCF_REG32(0xFC0451A8)
44045 +#define MCF_EDMA_TCD13_SLAST MCF_REG32(0xFC0451AC)
44046 +#define MCF_EDMA_TCD13_DADDR MCF_REG32(0xFC0451B0)
44047 +#define MCF_EDMA_TCD13_CITER_ELINK MCF_REG16(0xFC0451B4)
44048 +#define MCF_EDMA_TCD13_CITER MCF_REG16(0xFC0451B4)
44049 +#define MCF_EDMA_TCD13_DOFF MCF_REG16(0xFC0451B6)
44050 +#define MCF_EDMA_TCD13_DLAST_SGA MCF_REG32(0xFC0451B8)
44051 +#define MCF_EDMA_TCD13_BITER_ELINK MCF_REG16(0xFC0451BC)
44052 +#define MCF_EDMA_TCD13_BITER MCF_REG16(0xFC0451BC)
44053 +#define MCF_EDMA_TCD13_CSR MCF_REG16(0xFC0451BE)
44054 +#define MCF_EDMA_TCD14_SADDR MCF_REG32(0xFC0451C0)
44055 +#define MCF_EDMA_TCD14_ATTR MCF_REG16(0xFC0451C4)
44056 +#define MCF_EDMA_TCD14_SOFF MCF_REG16(0xFC0451C6)
44057 +#define MCF_EDMA_TCD14_NBYTES MCF_REG32(0xFC0451C8)
44058 +#define MCF_EDMA_TCD14_SLAST MCF_REG32(0xFC0451CC)
44059 +#define MCF_EDMA_TCD14_DADDR MCF_REG32(0xFC0451D0)
44060 +#define MCF_EDMA_TCD14_CITER MCF_REG16(0xFC0451D4)
44061 +#define MCF_EDMA_TCD14_CITER_ELINK MCF_REG16(0xFC0451D4)
44062 +#define MCF_EDMA_TCD14_DOFF MCF_REG16(0xFC0451D6)
44063 +#define MCF_EDMA_TCD14_DLAST_SGA MCF_REG32(0xFC0451D8)
44064 +#define MCF_EDMA_TCD14_BITER_ELINK MCF_REG16(0xFC0451DC)
44065 +#define MCF_EDMA_TCD14_BITER MCF_REG16(0xFC0451DC)
44066 +#define MCF_EDMA_TCD14_CSR MCF_REG16(0xFC0451DE)
44067 +#define MCF_EDMA_TCD15_SADDR MCF_REG32(0xFC0451E0)
44068 +#define MCF_EDMA_TCD15_ATTR MCF_REG16(0xFC0451E4)
44069 +#define MCF_EDMA_TCD15_SOFF MCF_REG16(0xFC0451E6)
44070 +#define MCF_EDMA_TCD15_NBYTES MCF_REG32(0xFC0451E8)
44071 +#define MCF_EDMA_TCD15_SLAST MCF_REG32(0xFC0451EC)
44072 +#define MCF_EDMA_TCD15_DADDR MCF_REG32(0xFC0451F0)
44073 +#define MCF_EDMA_TCD15_CITER_ELINK MCF_REG16(0xFC0451F4)
44074 +#define MCF_EDMA_TCD15_CITER MCF_REG16(0xFC0451F4)
44075 +#define MCF_EDMA_TCD15_DOFF MCF_REG16(0xFC0451F6)
44076 +#define MCF_EDMA_TCD15_DLAST_SGA MCF_REG32(0xFC0451F8)
44077 +#define MCF_EDMA_TCD15_BITER MCF_REG16(0xFC0451FC)
44078 +#define MCF_EDMA_TCD15_BITER_ELINK MCF_REG16(0xFC0451FC)
44079 +#define MCF_EDMA_TCD15_CSR MCF_REG16(0xFC0451FE)
44081 +/* Parameterized register read/write macros for multiple registers */
44082 +#define MCF_EDMA_DCHPRI(x) MCF_REG08(0xFC044100+((x)*0x001))
44083 +#define MCF_EDMA_TCD_SADDR(x) MCF_REG32(0xFC045000+((x)*0x020))
44084 +#define MCF_EDMA_TCD_ATTR(x) MCF_REG16(0xFC045004+((x)*0x020))
44085 +#define MCF_EDMA_TCD_SOFF(x) MCF_REG16(0xFC045006+((x)*0x020))
44086 +#define MCF_EDMA_TCD_NBYTES(x) MCF_REG32(0xFC045008+((x)*0x020))
44087 +#define MCF_EDMA_TCD_SLAST(x) MCF_REG32(0xFC04500C+((x)*0x020))
44088 +#define MCF_EDMA_TCD_DADDR(x) MCF_REG32(0xFC045010+((x)*0x020))
44089 +#define MCF_EDMA_TCD_CITER_ELINK(x) MCF_REG16(0xFC045014+((x)*0x020))
44090 +#define MCF_EDMA_TCD_CITER(x) MCF_REG16(0xFC045014+((x)*0x020))
44091 +#define MCF_EDMA_TCD_DOFF(x) MCF_REG16(0xFC045016+((x)*0x020))
44092 +#define MCF_EDMA_TCD_DLAST_SGA(x) MCF_REG32(0xFC045018+((x)*0x020))
44093 +#define MCF_EDMA_TCD_BITER_ELINK(x) MCF_REG16(0xFC04501C+((x)*0x020))
44094 +#define MCF_EDMA_TCD_BITER(x) MCF_REG16(0xFC04501C+((x)*0x020))
44095 +#define MCF_EDMA_TCD_CSR(x) MCF_REG16(0xFC04501e +((x)*0x020))
44097 +/* Bit definitions and macros for CR */
44098 +#define MCF_EDMA_CR_EDBG (0x00000002)
44099 +#define MCF_EDMA_CR_ERCA (0x00000004)
44101 +/* Bit definitions and macros for ES */
44102 +#define MCF_EDMA_ES_DBE (0x00000001)
44103 +#define MCF_EDMA_ES_SBE (0x00000002)
44104 +#define MCF_EDMA_ES_SGE (0x00000004)
44105 +#define MCF_EDMA_ES_NCE (0x00000008)
44106 +#define MCF_EDMA_ES_DOE (0x00000010)
44107 +#define MCF_EDMA_ES_DAE (0x00000020)
44108 +#define MCF_EDMA_ES_SOE (0x00000040)
44109 +#define MCF_EDMA_ES_SAE (0x00000080)
44110 +#define MCF_EDMA_ES_ERRCHN(x) (((x)&0x0000000F)<<8)
44111 +#define MCF_EDMA_ES_CPE (0x00004000)
44112 +#define MCF_EDMA_ES_VLD (0x80000000)
44114 +/* Bit definitions and macros for ERQ */
44115 +#define MCF_EDMA_ERQ_ERQ0 (0x0001)
44116 +#define MCF_EDMA_ERQ_ERQ1 (0x0002)
44117 +#define MCF_EDMA_ERQ_ERQ2 (0x0004)
44118 +#define MCF_EDMA_ERQ_ERQ3 (0x0008)
44119 +#define MCF_EDMA_ERQ_ERQ4 (0x0010)
44120 +#define MCF_EDMA_ERQ_ERQ5 (0x0020)
44121 +#define MCF_EDMA_ERQ_ERQ6 (0x0040)
44122 +#define MCF_EDMA_ERQ_ERQ7 (0x0080)
44123 +#define MCF_EDMA_ERQ_ERQ8 (0x0100)
44124 +#define MCF_EDMA_ERQ_ERQ9 (0x0200)
44125 +#define MCF_EDMA_ERQ_ERQ10 (0x0400)
44126 +#define MCF_EDMA_ERQ_ERQ11 (0x0800)
44127 +#define MCF_EDMA_ERQ_ERQ12 (0x1000)
44128 +#define MCF_EDMA_ERQ_ERQ13 (0x2000)
44129 +#define MCF_EDMA_ERQ_ERQ14 (0x4000)
44130 +#define MCF_EDMA_ERQ_ERQ15 (0x8000)
44132 +/* Bit definitions and macros for EEI */
44133 +#define MCF_EDMA_EEI_EEI0 (0x0001)
44134 +#define MCF_EDMA_EEI_EEI1 (0x0002)
44135 +#define MCF_EDMA_EEI_EEI2 (0x0004)
44136 +#define MCF_EDMA_EEI_EEI3 (0x0008)
44137 +#define MCF_EDMA_EEI_EEI4 (0x0010)
44138 +#define MCF_EDMA_EEI_EEI5 (0x0020)
44139 +#define MCF_EDMA_EEI_EEI6 (0x0040)
44140 +#define MCF_EDMA_EEI_EEI7 (0x0080)
44141 +#define MCF_EDMA_EEI_EEI8 (0x0100)
44142 +#define MCF_EDMA_EEI_EEI9 (0x0200)
44143 +#define MCF_EDMA_EEI_EEI10 (0x0400)
44144 +#define MCF_EDMA_EEI_EEI11 (0x0800)
44145 +#define MCF_EDMA_EEI_EEI12 (0x1000)
44146 +#define MCF_EDMA_EEI_EEI13 (0x2000)
44147 +#define MCF_EDMA_EEI_EEI14 (0x4000)
44148 +#define MCF_EDMA_EEI_EEI15 (0x8000)
44150 +/* Bit definitions and macros for SERQ */
44151 +#define MCF_EDMA_SERQ_SERQ(x) (((x)&0x0F))
44152 +#define MCF_EDMA_SERQ_SAER (0x40)
44154 +/* Bit definitions and macros for CERQ */
44155 +#define MCF_EDMA_CERQ_CERQ(x) (((x)&0x0F))
44156 +#define MCF_EDMA_CERQ_CAER (0x40)
44158 +/* Bit definitions and macros for SEEI */
44159 +#define MCF_EDMA_SEEI_SEEI(x) (((x)&0x0F))
44160 +#define MCF_EDMA_SEEI_SAEE (0x40)
44162 +/* Bit definitions and macros for CEEI */
44163 +#define MCF_EDMA_CEEI_CEEI(x) (((x)&0x0F))
44164 +#define MCF_EDMA_CEEI_CAEE (0x40)
44166 +/* Bit definitions and macros for CINT */
44167 +#define MCF_EDMA_CINT_CINT(x) (((x)&0x0F))
44168 +#define MCF_EDMA_CINT_CAIR (0x40)
44170 +/* Bit definitions and macros for CERR */
44171 +#define MCF_EDMA_CERR_CERR(x) (((x)&0x0F))
44172 +#define MCF_EDMA_CERR_CAER (0x40)
44174 +/* Bit definitions and macros for SSRT */
44175 +#define MCF_EDMA_SSRT_SSRT(x) (((x)&0x0F))
44176 +#define MCF_EDMA_SSRT_SAST (0x40)
44178 +/* Bit definitions and macros for CDNE */
44179 +#define MCF_EDMA_CDNE_CDNE(x) (((x)&0x0F))
44180 +#define MCF_EDMA_CDNE_CADN (0x40)
44182 +/* Bit definitions and macros for INTR */
44183 +#define MCF_EDMA_INTR_INT0 (0x0001)
44184 +#define MCF_EDMA_INTR_INT1 (0x0002)
44185 +#define MCF_EDMA_INTR_INT2 (0x0004)
44186 +#define MCF_EDMA_INTR_INT3 (0x0008)
44187 +#define MCF_EDMA_INTR_INT4 (0x0010)
44188 +#define MCF_EDMA_INTR_INT5 (0x0020)
44189 +#define MCF_EDMA_INTR_INT6 (0x0040)
44190 +#define MCF_EDMA_INTR_INT7 (0x0080)
44191 +#define MCF_EDMA_INTR_INT8 (0x0100)
44192 +#define MCF_EDMA_INTR_INT9 (0x0200)
44193 +#define MCF_EDMA_INTR_INT10 (0x0400)
44194 +#define MCF_EDMA_INTR_INT11 (0x0800)
44195 +#define MCF_EDMA_INTR_INT12 (0x1000)
44196 +#define MCF_EDMA_INTR_INT13 (0x2000)
44197 +#define MCF_EDMA_INTR_INT14 (0x4000)
44198 +#define MCF_EDMA_INTR_INT15 (0x8000)
44200 +/* Bit definitions and macros for ERR */
44201 +#define MCF_EDMA_ERR_ERR0 (0x0001)
44202 +#define MCF_EDMA_ERR_ERR1 (0x0002)
44203 +#define MCF_EDMA_ERR_ERR2 (0x0004)
44204 +#define MCF_EDMA_ERR_ERR3 (0x0008)
44205 +#define MCF_EDMA_ERR_ERR4 (0x0010)
44206 +#define MCF_EDMA_ERR_ERR5 (0x0020)
44207 +#define MCF_EDMA_ERR_ERR6 (0x0040)
44208 +#define MCF_EDMA_ERR_ERR7 (0x0080)
44209 +#define MCF_EDMA_ERR_ERR8 (0x0100)
44210 +#define MCF_EDMA_ERR_ERR9 (0x0200)
44211 +#define MCF_EDMA_ERR_ERR10 (0x0400)
44212 +#define MCF_EDMA_ERR_ERR11 (0x0800)
44213 +#define MCF_EDMA_ERR_ERR12 (0x1000)
44214 +#define MCF_EDMA_ERR_ERR13 (0x2000)
44215 +#define MCF_EDMA_ERR_ERR14 (0x4000)
44216 +#define MCF_EDMA_ERR_ERR15 (0x8000)
44218 +/* Bit definitions and macros for DCHPRI group */
44219 +#define MCF_EDMA_DCHPRI_CHPRI(x) (((x)&0x0F))
44220 +#define MCF_EDMA_DCHPRI_ECP (0x80)
44222 +/* Bit definitions and macros for DCHPRI0 */
44223 +#define MCF_EDMA_DCHPRI0_CHPRI(x) (((x)&0x0F))
44224 +#define MCF_EDMA_DCHPRI0_ECP (0x80)
44226 +/* Bit definitions and macros for DCHPRI1 */
44227 +#define MCF_EDMA_DCHPRI1_CHPRI(x) (((x)&0x0F))
44228 +#define MCF_EDMA_DCHPRI1_ECP (0x80)
44230 +/* Bit definitions and macros for DCHPRI2 */
44231 +#define MCF_EDMA_DCHPRI2_CHPRI(x) (((x)&0x0F))
44232 +#define MCF_EDMA_DCHPRI2_ECP (0x80)
44234 +/* Bit definitions and macros for DCHPRI3 */
44235 +#define MCF_EDMA_DCHPRI3_CHPRI(x) (((x)&0x0F))
44236 +#define MCF_EDMA_DCHPRI3_ECP (0x80)
44238 +/* Bit definitions and macros for DCHPRI4 */
44239 +#define MCF_EDMA_DCHPRI4_CHPRI(x) (((x)&0x0F))
44240 +#define MCF_EDMA_DCHPRI4_ECP (0x80)
44242 +/* Bit definitions and macros for DCHPRI5 */
44243 +#define MCF_EDMA_DCHPRI5_CHPRI(x) (((x)&0x0F))
44244 +#define MCF_EDMA_DCHPRI5_ECP (0x80)
44246 +/* Bit definitions and macros for DCHPRI6 */
44247 +#define MCF_EDMA_DCHPRI6_CHPRI(x) (((x)&0x0F))
44248 +#define MCF_EDMA_DCHPRI6_ECP (0x80)
44250 +/* Bit definitions and macros for DCHPRI7 */
44251 +#define MCF_EDMA_DCHPRI7_CHPRI(x) (((x)&0x0F))
44252 +#define MCF_EDMA_DCHPRI7_ECP (0x80)
44254 +/* Bit definitions and macros for DCHPRI8 */
44255 +#define MCF_EDMA_DCHPRI8_CHPRI(x) (((x)&0x0F))
44256 +#define MCF_EDMA_DCHPRI8_ECP (0x80)
44258 +/* Bit definitions and macros for DCHPRI9 */
44259 +#define MCF_EDMA_DCHPRI9_CHPRI(x) (((x)&0x0F))
44260 +#define MCF_EDMA_DCHPRI9_ECP (0x80)
44262 +/* Bit definitions and macros for DCHPRI10 */
44263 +#define MCF_EDMA_DCHPRI10_CHPRI(x) (((x)&0x0F))
44264 +#define MCF_EDMA_DCHPRI10_ECP (0x80)
44266 +/* Bit definitions and macros for DCHPRI11 */
44267 +#define MCF_EDMA_DCHPRI11_CHPRI(x) (((x)&0x0F))
44268 +#define MCF_EDMA_DCHPRI11_ECP (0x80)
44270 +/* Bit definitions and macros for DCHPRI12 */
44271 +#define MCF_EDMA_DCHPRI12_CHPRI(x) (((x)&0x0F))
44272 +#define MCF_EDMA_DCHPRI12_ECP (0x80)
44274 +/* Bit definitions and macros for DCHPRI13 */
44275 +#define MCF_EDMA_DCHPRI13_CHPRI(x) (((x)&0x0F))
44276 +#define MCF_EDMA_DCHPRI13_ECP (0x80)
44278 +/* Bit definitions and macros for DCHPRI14 */
44279 +#define MCF_EDMA_DCHPRI14_CHPRI(x) (((x)&0x0F))
44280 +#define MCF_EDMA_DCHPRI14_ECP (0x80)
44282 +/* Bit definitions and macros for DCHPRI15 */
44283 +#define MCF_EDMA_DCHPRI15_CHPRI(x) (((x)&0x0F))
44284 +#define MCF_EDMA_DCHPRI15_ECP (0x80)
44286 +/* Bit definitions and macros for TCD_SADDR group */
44287 +#define MCF_EDMA_TCD_SADDR_SADDR(x) (x)
44289 +/* Bit definitions and macros for TCD0_SADDR */
44290 +#define MCF_EDMA_TCD0_SADDR_SADDR(x) (x)
44292 +/* Bit definitions and macros for TCD_ATTR group */
44293 +#define MCF_EDMA_TCD_ATTR_DSIZE(x) (((x)&0x0007))
44294 +#define MCF_EDMA_TCD_ATTR_DMOD(x) (((x)&0x001F)<<3)
44295 +#define MCF_EDMA_TCD_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44296 +#define MCF_EDMA_TCD_ATTR_SMOD(x) (((x)&0x001F)<<11)
44297 +#define MCF_EDMA_TCD_ATTR_SSIZE_8BIT (0x0000)
44298 +#define MCF_EDMA_TCD_ATTR_SSIZE_16BIT (0x0100)
44299 +#define MCF_EDMA_TCD_ATTR_SSIZE_32BIT (0x0200)
44300 +#define MCF_EDMA_TCD_ATTR_SSIZE_16BYTE (0x0400)
44301 +#define MCF_EDMA_TCD_ATTR_DSIZE_8BIT (0x0000)
44302 +#define MCF_EDMA_TCD_ATTR_DSIZE_16BIT (0x0001)
44303 +#define MCF_EDMA_TCD_ATTR_DSIZE_32BIT (0x0002)
44304 +#define MCF_EDMA_TCD_ATTR_DSIZE_16BYTE (0x0004)
44306 +/* Bit definitions and macros for TCD0_ATTR */
44307 +#define MCF_EDMA_TCD0_ATTR_DSIZE(x) (((x)&0x0007))
44308 +#define MCF_EDMA_TCD0_ATTR_DMOD(x) (((x)&0x001F)<<3)
44309 +#define MCF_EDMA_TCD0_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44310 +#define MCF_EDMA_TCD0_ATTR_SMOD(x) (((x)&0x001F)<<11)
44311 +#define MCF_EDMA_TCD0_ATTR_SSIZE_8BIT (0x0000)
44312 +#define MCF_EDMA_TCD0_ATTR_SSIZE_16BIT (0x0100)
44313 +#define MCF_EDMA_TCD0_ATTR_SSIZE_32BIT (0x0200)
44314 +#define MCF_EDMA_TCD0_ATTR_SSIZE_16BYTE (0x0400)
44315 +#define MCF_EDMA_TCD0_ATTR_DSIZE_8BIT (0x0000)
44316 +#define MCF_EDMA_TCD0_ATTR_DSIZE_16BIT (0x0001)
44317 +#define MCF_EDMA_TCD0_ATTR_DSIZE_32BIT (0x0002)
44318 +#define MCF_EDMA_TCD0_ATTR_DSIZE_16BYTE (0x0004)
44320 +/* Bit definitions and macros for TCD_SOFF group */
44321 +#define MCF_EDMA_TCD_SOFF_SOFF(x) (x)
44323 +/* Bit definitions and macros for TCD0_SOFF */
44324 +#define MCF_EDMA_TCD0_SOFF_SOFF(x) (x)
44326 +/* Bit definitions and macros for TCD_NBYTES group */
44327 +#define MCF_EDMA_TCD_NBYTES_NBYTES(x) (x)
44329 +/* Bit definitions and macros for TCD0_NBYTES */
44330 +#define MCF_EDMA_TCD0_NBYTES_NBYTES(x) (x)
44332 +/* Bit definitions and macros for TCD_SLAST group */
44333 +#define MCF_EDMA_TCD_SLAST_SLAST(x) (x)
44335 +/* Bit definitions and macros for TCD0_SLAST */
44336 +#define MCF_EDMA_TCD0_SLAST_SLAST(x) (x)
44338 +/* Bit definitions and macros for TCD_DADDR group */
44339 +#define MCF_EDMA_TCD_DADDR_DADDR(x) (x)
44341 +/* Bit definitions and macros for TCD0_DADDR */
44342 +#define MCF_EDMA_TCD0_DADDR_DADDR(x) (x)
44344 +/* Bit definitions and macros for TCD_CITER_ELINK group */
44345 +#define MCF_EDMA_TCD_CITER_ELINK_CITER(x) (((x)&0x01FF))
44346 +#define MCF_EDMA_TCD_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44347 +#define MCF_EDMA_TCD_CITER_ELINK_E_LINK (0x8000)
44349 +/* Bit definitions and macros for TCD0_CITER_ELINK */
44350 +#define MCF_EDMA_TCD0_CITER_ELINK_CITER(x) (((x)&0x01FF))
44351 +#define MCF_EDMA_TCD0_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44352 +#define MCF_EDMA_TCD0_CITER_ELINK_E_LINK (0x8000)
44354 +/* Bit definitions and macros for TCD_CITER group */
44355 +#define MCF_EDMA_TCD_CITER_CITER(x) (((x)&0x7FFF))
44356 +#define MCF_EDMA_TCD_CITER_E_LINK (0x8000)
44358 +/* Bit definitions and macros for TCD0_CITER */
44359 +#define MCF_EDMA_TCD0_CITER_CITER(x) (((x)&0x7FFF))
44360 +#define MCF_EDMA_TCD0_CITER_E_LINK (0x8000)
44362 +/* Bit definitions and macros for TCD_DOFF group */
44363 +#define MCF_EDMA_TCD_DOFF_DOFF(x) (x)
44365 +/* Bit definitions and macros for TCD0_DOFF */
44366 +#define MCF_EDMA_TCD0_DOFF_DOFF(x) (x)
44368 +/* Bit definitions and macros for TCD_DLAST_SGA group */
44369 +#define MCF_EDMA_TCD_DLAST_SGA_DLAST_SGA(x) (x)
44371 +/* Bit definitions and macros for TCD0_DLAST_SGA */
44372 +#define MCF_EDMA_TCD0_DLAST_SGA_DLAST_SGA(x) (x)
44374 +/* Bit definitions and macros for TCD_BITER_ELINK group */
44375 +#define MCF_EDMA_TCD_BITER_ELINK_BITER(x) (((x)&0x01FF))
44376 +#define MCF_EDMA_TCD_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44377 +#define MCF_EDMA_TCD_BITER_ELINK_E_LINK (0x8000)
44379 +/* Bit definitions and macros for TCD0_BITER_ELINK */
44380 +#define MCF_EDMA_TCD0_BITER_ELINK_BITER(x) (((x)&0x01FF))
44381 +#define MCF_EDMA_TCD0_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44382 +#define MCF_EDMA_TCD0_BITER_ELINK_E_LINK (0x8000)
44384 +/* Bit definitions and macros for TCD_BITER group */
44385 +#define MCF_EDMA_TCD_BITER_BITER(x) (((x)&0x7FFF))
44386 +#define MCF_EDMA_TCD_BITER_E_LINK (0x8000)
44388 +/* Bit definitions and macros for TCD0_BITER */
44389 +#define MCF_EDMA_TCD0_BITER_BITER(x) (((x)&0x7FFF))
44390 +#define MCF_EDMA_TCD0_BITER_E_LINK (0x8000)
44392 +/* Bit definitions and macros for TCD_CSR group */
44393 +#define MCF_EDMA_TCD_CSR_START (0x0001)
44394 +#define MCF_EDMA_TCD_CSR_INT_MAJOR (0x0002)
44395 +#define MCF_EDMA_TCD_CSR_INT_HALF (0x0004)
44396 +#define MCF_EDMA_TCD_CSR_D_REQ (0x0008)
44397 +#define MCF_EDMA_TCD_CSR_E_SG (0x0010)
44398 +#define MCF_EDMA_TCD_CSR_E_LINK (0x0020)
44399 +#define MCF_EDMA_TCD_CSR_ACTIVE (0x0040)
44400 +#define MCF_EDMA_TCD_CSR_DONE (0x0080)
44401 +#define MCF_EDMA_TCD_CSR_LINKCH(x) (((x)&0x003F)<<8)
44402 +#define MCF_EDMA_TCD_CSR_BWC(x) (((x)&0x0003)<<14)
44403 +#define MCF_EDMA_TCD_CSR_BWC_NO_STALL (0x0000)
44404 +#define MCF_EDMA_TCD_CSR_BWC_4CYC_STALL (0x8000)
44405 +#define MCF_EDMA_TCD_CSR_BWC_8CYC_STALL (0xC000)
44407 +/* Bit definitions and macros for TCD0_CSR */
44408 +#define MCF_EDMA_TCD0_CSR_START (0x0001)
44409 +#define MCF_EDMA_TCD0_CSR_INT_MAJOR (0x0002)
44410 +#define MCF_EDMA_TCD0_CSR_INT_HALF (0x0004)
44411 +#define MCF_EDMA_TCD0_CSR_D_REQ (0x0008)
44412 +#define MCF_EDMA_TCD0_CSR_E_SG (0x0010)
44413 +#define MCF_EDMA_TCD0_CSR_E_LINK (0x0020)
44414 +#define MCF_EDMA_TCD0_CSR_ACTIVE (0x0040)
44415 +#define MCF_EDMA_TCD0_CSR_DONE (0x0080)
44416 +#define MCF_EDMA_TCD0_CSR_LINKCH(x) (((x)&0x003F)<<8)
44417 +#define MCF_EDMA_TCD0_CSR_BWC(x) (((x)&0x0003)<<14)
44418 +#define MCF_EDMA_TCD0_CSR_BWC_NO_STALL (0x0000)
44419 +#define MCF_EDMA_TCD0_CSR_BWC_4CYC_STALL (0x8000)
44420 +#define MCF_EDMA_TCD0_CSR_BWC_8CYC_STALL (0xC000)
44422 +/* Bit definitions and macros for TCD1_SADDR */
44423 +#define MCF_EDMA_TCD1_SADDR_SADDR(x) (x)
44425 +/* Bit definitions and macros for TCD1_ATTR */
44426 +#define MCF_EDMA_TCD1_ATTR_DSIZE(x) (((x)&0x0007))
44427 +#define MCF_EDMA_TCD1_ATTR_DMOD(x) (((x)&0x001F)<<3)
44428 +#define MCF_EDMA_TCD1_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44429 +#define MCF_EDMA_TCD1_ATTR_SMOD(x) (((x)&0x001F)<<11)
44431 +/* Bit definitions and macros for TCD1_SOFF */
44432 +#define MCF_EDMA_TCD1_SOFF_SOFF(x) (x)
44434 +/* Bit definitions and macros for TCD1_NBYTES */
44435 +#define MCF_EDMA_TCD1_NBYTES_NBYTES(x) (x)
44437 +/* Bit definitions and macros for TCD1_SLAST */
44438 +#define MCF_EDMA_TCD1_SLAST_SLAST(x) (x)
44440 +/* Bit definitions and macros for TCD1_DADDR */
44441 +#define MCF_EDMA_TCD1_DADDR_DADDR(x) (x)
44443 +/* Bit definitions and macros for TCD1_CITER_ELINK */
44444 +#define MCF_EDMA_TCD1_CITER_ELINK_CITER(x) (((x)&0x01FF))
44445 +#define MCF_EDMA_TCD1_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44446 +#define MCF_EDMA_TCD1_CITER_ELINK_E_LINK (0x8000)
44448 +/* Bit definitions and macros for TCD1_CITER */
44449 +#define MCF_EDMA_TCD1_CITER_CITER(x) (((x)&0x7FFF))
44450 +#define MCF_EDMA_TCD1_CITER_E_LINK (0x8000)
44452 +/* Bit definitions and macros for TCD1_DOFF */
44453 +#define MCF_EDMA_TCD1_DOFF_DOFF(x) (x)
44455 +/* Bit definitions and macros for TCD1_DLAST_SGA */
44456 +#define MCF_EDMA_TCD1_DLAST_SGA_DLAST_SGA(x) (x)
44458 +/* Bit definitions and macros for TCD1_BITER */
44459 +#define MCF_EDMA_TCD1_BITER_BITER(x) (((x)&0x7FFF))
44460 +#define MCF_EDMA_TCD1_BITER_E_LINK (0x8000)
44462 +/* Bit definitions and macros for TCD1_BITER_ELINK */
44463 +#define MCF_EDMA_TCD1_BITER_ELINK_BITER(x) (((x)&0x01FF))
44464 +#define MCF_EDMA_TCD1_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44465 +#define MCF_EDMA_TCD1_BITER_ELINK_E_LINK (0x8000)
44467 +/* Bit definitions and macros for TCD1_CSR */
44468 +#define MCF_EDMA_TCD1_CSR_START (0x0001)
44469 +#define MCF_EDMA_TCD1_CSR_INT_MAJOR (0x0002)
44470 +#define MCF_EDMA_TCD1_CSR_INT_HALF (0x0004)
44471 +#define MCF_EDMA_TCD1_CSR_D_REQ (0x0008)
44472 +#define MCF_EDMA_TCD1_CSR_E_SG (0x0010)
44473 +#define MCF_EDMA_TCD1_CSR_E_LINK (0x0020)
44474 +#define MCF_EDMA_TCD1_CSR_ACTIVE (0x0040)
44475 +#define MCF_EDMA_TCD1_CSR_DONE (0x0080)
44476 +#define MCF_EDMA_TCD1_CSR_LINKCH(x) (((x)&0x003F)<<8)
44477 +#define MCF_EDMA_TCD1_CSR_BWC(x) (((x)&0x0003)<<14)
44479 +/* Bit definitions and macros for TCD2_SADDR */
44480 +#define MCF_EDMA_TCD2_SADDR_SADDR(x) (x)
44482 +/* Bit definitions and macros for TCD2_ATTR */
44483 +#define MCF_EDMA_TCD2_ATTR_DSIZE(x) (((x)&0x0007))
44484 +#define MCF_EDMA_TCD2_ATTR_DMOD(x) (((x)&0x001F)<<3)
44485 +#define MCF_EDMA_TCD2_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44486 +#define MCF_EDMA_TCD2_ATTR_SMOD(x) (((x)&0x001F)<<11)
44488 +/* Bit definitions and macros for TCD2_SOFF */
44489 +#define MCF_EDMA_TCD2_SOFF_SOFF(x) (x)
44491 +/* Bit definitions and macros for TCD2_NBYTES */
44492 +#define MCF_EDMA_TCD2_NBYTES_NBYTES(x) (x)
44494 +/* Bit definitions and macros for TCD2_SLAST */
44495 +#define MCF_EDMA_TCD2_SLAST_SLAST(x) (x)
44497 +/* Bit definitions and macros for TCD2_DADDR */
44498 +#define MCF_EDMA_TCD2_DADDR_DADDR(x) (x)
44500 +/* Bit definitions and macros for TCD2_CITER */
44501 +#define MCF_EDMA_TCD2_CITER_CITER(x) (((x)&0x7FFF))
44502 +#define MCF_EDMA_TCD2_CITER_E_LINK (0x8000)
44504 +/* Bit definitions and macros for TCD2_CITER_ELINK */
44505 +#define MCF_EDMA_TCD2_CITER_ELINK_CITER(x) (((x)&0x01FF))
44506 +#define MCF_EDMA_TCD2_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44507 +#define MCF_EDMA_TCD2_CITER_ELINK_E_LINK (0x8000)
44509 +/* Bit definitions and macros for TCD2_DOFF */
44510 +#define MCF_EDMA_TCD2_DOFF_DOFF(x) (x)
44512 +/* Bit definitions and macros for TCD2_DLAST_SGA */
44513 +#define MCF_EDMA_TCD2_DLAST_SGA_DLAST_SGA(x) (x)
44515 +/* Bit definitions and macros for TCD2_BITER_ELINK */
44516 +#define MCF_EDMA_TCD2_BITER_ELINK_BITER(x) (((x)&0x01FF))
44517 +#define MCF_EDMA_TCD2_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44518 +#define MCF_EDMA_TCD2_BITER_ELINK_E_LINK (0x8000)
44520 +/* Bit definitions and macros for TCD2_BITER */
44521 +#define MCF_EDMA_TCD2_BITER_BITER(x) (((x)&0x7FFF))
44522 +#define MCF_EDMA_TCD2_BITER_E_LINK (0x8000)
44524 +/* Bit definitions and macros for TCD2_CSR */
44525 +#define MCF_EDMA_TCD2_CSR_START (0x0001)
44526 +#define MCF_EDMA_TCD2_CSR_INT_MAJOR (0x0002)
44527 +#define MCF_EDMA_TCD2_CSR_INT_HALF (0x0004)
44528 +#define MCF_EDMA_TCD2_CSR_D_REQ (0x0008)
44529 +#define MCF_EDMA_TCD2_CSR_E_SG (0x0010)
44530 +#define MCF_EDMA_TCD2_CSR_E_LINK (0x0020)
44531 +#define MCF_EDMA_TCD2_CSR_ACTIVE (0x0040)
44532 +#define MCF_EDMA_TCD2_CSR_DONE (0x0080)
44533 +#define MCF_EDMA_TCD2_CSR_LINKCH(x) (((x)&0x003F)<<8)
44534 +#define MCF_EDMA_TCD2_CSR_BWC(x) (((x)&0x0003)<<14)
44536 +/* Bit definitions and macros for TCD3_SADDR */
44537 +#define MCF_EDMA_TCD3_SADDR_SADDR(x) (x)
44539 +/* Bit definitions and macros for TCD3_ATTR */
44540 +#define MCF_EDMA_TCD3_ATTR_DSIZE(x) (((x)&0x0007))
44541 +#define MCF_EDMA_TCD3_ATTR_DMOD(x) (((x)&0x001F)<<3)
44542 +#define MCF_EDMA_TCD3_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44543 +#define MCF_EDMA_TCD3_ATTR_SMOD(x) (((x)&0x001F)<<11)
44545 +/* Bit definitions and macros for TCD3_SOFF */
44546 +#define MCF_EDMA_TCD3_SOFF_SOFF(x) (x)
44548 +/* Bit definitions and macros for TCD3_NBYTES */
44549 +#define MCF_EDMA_TCD3_NBYTES_NBYTES(x) (x)
44551 +/* Bit definitions and macros for TCD3_SLAST */
44552 +#define MCF_EDMA_TCD3_SLAST_SLAST(x) (x)
44554 +/* Bit definitions and macros for TCD3_DADDR */
44555 +#define MCF_EDMA_TCD3_DADDR_DADDR(x) (x)
44557 +/* Bit definitions and macros for TCD3_CITER */
44558 +#define MCF_EDMA_TCD3_CITER_CITER(x) (((x)&0x7FFF))
44559 +#define MCF_EDMA_TCD3_CITER_E_LINK (0x8000)
44561 +/* Bit definitions and macros for TCD3_CITER_ELINK */
44562 +#define MCF_EDMA_TCD3_CITER_ELINK_CITER(x) (((x)&0x01FF))
44563 +#define MCF_EDMA_TCD3_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44564 +#define MCF_EDMA_TCD3_CITER_ELINK_E_LINK (0x8000)
44566 +/* Bit definitions and macros for TCD3_DOFF */
44567 +#define MCF_EDMA_TCD3_DOFF_DOFF(x) (x)
44569 +/* Bit definitions and macros for TCD3_DLAST_SGA */
44570 +#define MCF_EDMA_TCD3_DLAST_SGA_DLAST_SGA(x) (x)
44572 +/* Bit definitions and macros for TCD3_BITER_ELINK */
44573 +#define MCF_EDMA_TCD3_BITER_ELINK_BITER(x) (((x)&0x01FF))
44574 +#define MCF_EDMA_TCD3_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44575 +#define MCF_EDMA_TCD3_BITER_ELINK_E_LINK (0x8000)
44577 +/* Bit definitions and macros for TCD3_BITER */
44578 +#define MCF_EDMA_TCD3_BITER_BITER(x) (((x)&0x7FFF))
44579 +#define MCF_EDMA_TCD3_BITER_E_LINK (0x8000)
44581 +/* Bit definitions and macros for TCD3_CSR */
44582 +#define MCF_EDMA_TCD3_CSR_START (0x0001)
44583 +#define MCF_EDMA_TCD3_CSR_INT_MAJOR (0x0002)
44584 +#define MCF_EDMA_TCD3_CSR_INT_HALF (0x0004)
44585 +#define MCF_EDMA_TCD3_CSR_D_REQ (0x0008)
44586 +#define MCF_EDMA_TCD3_CSR_E_SG (0x0010)
44587 +#define MCF_EDMA_TCD3_CSR_E_LINK (0x0020)
44588 +#define MCF_EDMA_TCD3_CSR_ACTIVE (0x0040)
44589 +#define MCF_EDMA_TCD3_CSR_DONE (0x0080)
44590 +#define MCF_EDMA_TCD3_CSR_LINKCH(x) (((x)&0x003F)<<8)
44591 +#define MCF_EDMA_TCD3_CSR_BWC(x) (((x)&0x0003)<<14)
44593 +/* Bit definitions and macros for TCD4_SADDR */
44594 +#define MCF_EDMA_TCD4_SADDR_SADDR(x) (x)
44596 +/* Bit definitions and macros for TCD4_ATTR */
44597 +#define MCF_EDMA_TCD4_ATTR_DSIZE(x) (((x)&0x0007))
44598 +#define MCF_EDMA_TCD4_ATTR_DMOD(x) (((x)&0x001F)<<3)
44599 +#define MCF_EDMA_TCD4_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44600 +#define MCF_EDMA_TCD4_ATTR_SMOD(x) (((x)&0x001F)<<11)
44602 +/* Bit definitions and macros for TCD4_SOFF */
44603 +#define MCF_EDMA_TCD4_SOFF_SOFF(x) (x)
44605 +/* Bit definitions and macros for TCD4_NBYTES */
44606 +#define MCF_EDMA_TCD4_NBYTES_NBYTES(x) (x)
44608 +/* Bit definitions and macros for TCD4_SLAST */
44609 +#define MCF_EDMA_TCD4_SLAST_SLAST(x) (x)
44611 +/* Bit definitions and macros for TCD4_DADDR */
44612 +#define MCF_EDMA_TCD4_DADDR_DADDR(x) (x)
44614 +/* Bit definitions and macros for TCD4_CITER */
44615 +#define MCF_EDMA_TCD4_CITER_CITER(x) (((x)&0x7FFF))
44616 +#define MCF_EDMA_TCD4_CITER_E_LINK (0x8000)
44618 +/* Bit definitions and macros for TCD4_CITER_ELINK */
44619 +#define MCF_EDMA_TCD4_CITER_ELINK_CITER(x) (((x)&0x01FF))
44620 +#define MCF_EDMA_TCD4_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44621 +#define MCF_EDMA_TCD4_CITER_ELINK_E_LINK (0x8000)
44623 +/* Bit definitions and macros for TCD4_DOFF */
44624 +#define MCF_EDMA_TCD4_DOFF_DOFF(x) (x)
44626 +/* Bit definitions and macros for TCD4_DLAST_SGA */
44627 +#define MCF_EDMA_TCD4_DLAST_SGA_DLAST_SGA(x) (x)
44629 +/* Bit definitions and macros for TCD4_BITER */
44630 +#define MCF_EDMA_TCD4_BITER_BITER(x) (((x)&0x7FFF))
44631 +#define MCF_EDMA_TCD4_BITER_E_LINK (0x8000)
44633 +/* Bit definitions and macros for TCD4_BITER_ELINK */
44634 +#define MCF_EDMA_TCD4_BITER_ELINK_BITER(x) (((x)&0x01FF))
44635 +#define MCF_EDMA_TCD4_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44636 +#define MCF_EDMA_TCD4_BITER_ELINK_E_LINK (0x8000)
44638 +/* Bit definitions and macros for TCD4_CSR */
44639 +#define MCF_EDMA_TCD4_CSR_START (0x0001)
44640 +#define MCF_EDMA_TCD4_CSR_INT_MAJOR (0x0002)
44641 +#define MCF_EDMA_TCD4_CSR_INT_HALF (0x0004)
44642 +#define MCF_EDMA_TCD4_CSR_D_REQ (0x0008)
44643 +#define MCF_EDMA_TCD4_CSR_E_SG (0x0010)
44644 +#define MCF_EDMA_TCD4_CSR_E_LINK (0x0020)
44645 +#define MCF_EDMA_TCD4_CSR_ACTIVE (0x0040)
44646 +#define MCF_EDMA_TCD4_CSR_DONE (0x0080)
44647 +#define MCF_EDMA_TCD4_CSR_LINKCH(x) (((x)&0x003F)<<8)
44648 +#define MCF_EDMA_TCD4_CSR_BWC(x) (((x)&0x0003)<<14)
44650 +/* Bit definitions and macros for TCD5_SADDR */
44651 +#define MCF_EDMA_TCD5_SADDR_SADDR(x) (x)
44653 +/* Bit definitions and macros for TCD5_ATTR */
44654 +#define MCF_EDMA_TCD5_ATTR_DSIZE(x) (((x)&0x0007))
44655 +#define MCF_EDMA_TCD5_ATTR_DMOD(x) (((x)&0x001F)<<3)
44656 +#define MCF_EDMA_TCD5_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44657 +#define MCF_EDMA_TCD5_ATTR_SMOD(x) (((x)&0x001F)<<11)
44659 +/* Bit definitions and macros for TCD5_SOFF */
44660 +#define MCF_EDMA_TCD5_SOFF_SOFF(x) (x)
44662 +/* Bit definitions and macros for TCD5_NBYTES */
44663 +#define MCF_EDMA_TCD5_NBYTES_NBYTES(x) (x)
44665 +/* Bit definitions and macros for TCD5_SLAST */
44666 +#define MCF_EDMA_TCD5_SLAST_SLAST(x) (x)
44668 +/* Bit definitions and macros for TCD5_DADDR */
44669 +#define MCF_EDMA_TCD5_DADDR_DADDR(x) (x)
44671 +/* Bit definitions and macros for TCD5_CITER */
44672 +#define MCF_EDMA_TCD5_CITER_CITER(x) (((x)&0x7FFF))
44673 +#define MCF_EDMA_TCD5_CITER_E_LINK (0x8000)
44675 +/* Bit definitions and macros for TCD5_CITER_ELINK */
44676 +#define MCF_EDMA_TCD5_CITER_ELINK_CITER(x) (((x)&0x01FF))
44677 +#define MCF_EDMA_TCD5_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44678 +#define MCF_EDMA_TCD5_CITER_ELINK_E_LINK (0x8000)
44680 +/* Bit definitions and macros for TCD5_DOFF */
44681 +#define MCF_EDMA_TCD5_DOFF_DOFF(x) (x)
44683 +/* Bit definitions and macros for TCD5_DLAST_SGA */
44684 +#define MCF_EDMA_TCD5_DLAST_SGA_DLAST_SGA(x) (x)
44686 +/* Bit definitions and macros for TCD5_BITER_ELINK */
44687 +#define MCF_EDMA_TCD5_BITER_ELINK_BITER(x) (((x)&0x01FF))
44688 +#define MCF_EDMA_TCD5_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44689 +#define MCF_EDMA_TCD5_BITER_ELINK_E_LINK (0x8000)
44691 +/* Bit definitions and macros for TCD5_BITER */
44692 +#define MCF_EDMA_TCD5_BITER_BITER(x) (((x)&0x7FFF))
44693 +#define MCF_EDMA_TCD5_BITER_E_LINK (0x8000)
44695 +/* Bit definitions and macros for TCD5_CSR */
44696 +#define MCF_EDMA_TCD5_CSR_START (0x0001)
44697 +#define MCF_EDMA_TCD5_CSR_INT_MAJOR (0x0002)
44698 +#define MCF_EDMA_TCD5_CSR_INT_HALF (0x0004)
44699 +#define MCF_EDMA_TCD5_CSR_D_REQ (0x0008)
44700 +#define MCF_EDMA_TCD5_CSR_E_SG (0x0010)
44701 +#define MCF_EDMA_TCD5_CSR_E_LINK (0x0020)
44702 +#define MCF_EDMA_TCD5_CSR_ACTIVE (0x0040)
44703 +#define MCF_EDMA_TCD5_CSR_DONE (0x0080)
44704 +#define MCF_EDMA_TCD5_CSR_LINKCH(x) (((x)&0x003F)<<8)
44705 +#define MCF_EDMA_TCD5_CSR_BWC(x) (((x)&0x0003)<<14)
44707 +/* Bit definitions and macros for TCD6_SADDR */
44708 +#define MCF_EDMA_TCD6_SADDR_SADDR(x) (x)
44710 +/* Bit definitions and macros for TCD6_ATTR */
44711 +#define MCF_EDMA_TCD6_ATTR_DSIZE(x) (((x)&0x0007))
44712 +#define MCF_EDMA_TCD6_ATTR_DMOD(x) (((x)&0x001F)<<3)
44713 +#define MCF_EDMA_TCD6_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44714 +#define MCF_EDMA_TCD6_ATTR_SMOD(x) (((x)&0x001F)<<11)
44716 +/* Bit definitions and macros for TCD6_SOFF */
44717 +#define MCF_EDMA_TCD6_SOFF_SOFF(x) (x)
44719 +/* Bit definitions and macros for TCD6_NBYTES */
44720 +#define MCF_EDMA_TCD6_NBYTES_NBYTES(x) (x)
44722 +/* Bit definitions and macros for TCD6_SLAST */
44723 +#define MCF_EDMA_TCD6_SLAST_SLAST(x) (x)
44725 +/* Bit definitions and macros for TCD6_DADDR */
44726 +#define MCF_EDMA_TCD6_DADDR_DADDR(x) (x)
44728 +/* Bit definitions and macros for TCD6_CITER */
44729 +#define MCF_EDMA_TCD6_CITER_CITER(x) (((x)&0x7FFF))
44730 +#define MCF_EDMA_TCD6_CITER_E_LINK (0x8000)
44732 +/* Bit definitions and macros for TCD6_CITER_ELINK */
44733 +#define MCF_EDMA_TCD6_CITER_ELINK_CITER(x) (((x)&0x01FF))
44734 +#define MCF_EDMA_TCD6_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44735 +#define MCF_EDMA_TCD6_CITER_ELINK_E_LINK (0x8000)
44737 +/* Bit definitions and macros for TCD6_DOFF */
44738 +#define MCF_EDMA_TCD6_DOFF_DOFF(x) (x)
44740 +/* Bit definitions and macros for TCD6_DLAST_SGA */
44741 +#define MCF_EDMA_TCD6_DLAST_SGA_DLAST_SGA(x) (x)
44743 +/* Bit definitions and macros for TCD6_BITER_ELINK */
44744 +#define MCF_EDMA_TCD6_BITER_ELINK_BITER(x) (((x)&0x01FF))
44745 +#define MCF_EDMA_TCD6_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44746 +#define MCF_EDMA_TCD6_BITER_ELINK_E_LINK (0x8000)
44748 +/* Bit definitions and macros for TCD6_BITER */
44749 +#define MCF_EDMA_TCD6_BITER_BITER(x) (((x)&0x7FFF))
44750 +#define MCF_EDMA_TCD6_BITER_E_LINK (0x8000)
44752 +/* Bit definitions and macros for TCD6_CSR */
44753 +#define MCF_EDMA_TCD6_CSR_START (0x0001)
44754 +#define MCF_EDMA_TCD6_CSR_INT_MAJOR (0x0002)
44755 +#define MCF_EDMA_TCD6_CSR_INT_HALF (0x0004)
44756 +#define MCF_EDMA_TCD6_CSR_D_REQ (0x0008)
44757 +#define MCF_EDMA_TCD6_CSR_E_SG (0x0010)
44758 +#define MCF_EDMA_TCD6_CSR_E_LINK (0x0020)
44759 +#define MCF_EDMA_TCD6_CSR_ACTIVE (0x0040)
44760 +#define MCF_EDMA_TCD6_CSR_DONE (0x0080)
44761 +#define MCF_EDMA_TCD6_CSR_LINKCH(x) (((x)&0x003F)<<8)
44762 +#define MCF_EDMA_TCD6_CSR_BWC(x) (((x)&0x0003)<<14)
44764 +/* Bit definitions and macros for TCD7_SADDR */
44765 +#define MCF_EDMA_TCD7_SADDR_SADDR(x) (x)
44767 +/* Bit definitions and macros for TCD7_ATTR */
44768 +#define MCF_EDMA_TCD7_ATTR_DSIZE(x) (((x)&0x0007))
44769 +#define MCF_EDMA_TCD7_ATTR_DMOD(x) (((x)&0x001F)<<3)
44770 +#define MCF_EDMA_TCD7_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44771 +#define MCF_EDMA_TCD7_ATTR_SMOD(x) (((x)&0x001F)<<11)
44773 +/* Bit definitions and macros for TCD7_SOFF */
44774 +#define MCF_EDMA_TCD7_SOFF_SOFF(x) (x)
44776 +/* Bit definitions and macros for TCD7_NBYTES */
44777 +#define MCF_EDMA_TCD7_NBYTES_NBYTES(x) (x)
44779 +/* Bit definitions and macros for TCD7_SLAST */
44780 +#define MCF_EDMA_TCD7_SLAST_SLAST(x) (x)
44782 +/* Bit definitions and macros for TCD7_DADDR */
44783 +#define MCF_EDMA_TCD7_DADDR_DADDR(x) (x)
44785 +/* Bit definitions and macros for TCD7_CITER */
44786 +#define MCF_EDMA_TCD7_CITER_CITER(x) (((x)&0x7FFF))
44787 +#define MCF_EDMA_TCD7_CITER_E_LINK (0x8000)
44789 +/* Bit definitions and macros for TCD7_CITER_ELINK */
44790 +#define MCF_EDMA_TCD7_CITER_ELINK_CITER(x) (((x)&0x01FF))
44791 +#define MCF_EDMA_TCD7_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44792 +#define MCF_EDMA_TCD7_CITER_ELINK_E_LINK (0x8000)
44794 +/* Bit definitions and macros for TCD7_DOFF */
44795 +#define MCF_EDMA_TCD7_DOFF_DOFF(x) (x)
44797 +/* Bit definitions and macros for TCD7_DLAST_SGA */
44798 +#define MCF_EDMA_TCD7_DLAST_SGA_DLAST_SGA(x) (x)
44800 +/* Bit definitions and macros for TCD7_BITER_ELINK */
44801 +#define MCF_EDMA_TCD7_BITER_ELINK_BITER(x) (((x)&0x01FF))
44802 +#define MCF_EDMA_TCD7_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44803 +#define MCF_EDMA_TCD7_BITER_ELINK_E_LINK (0x8000)
44805 +/* Bit definitions and macros for TCD7_BITER */
44806 +#define MCF_EDMA_TCD7_BITER_BITER(x) (((x)&0x7FFF))
44807 +#define MCF_EDMA_TCD7_BITER_E_LINK (0x8000)
44809 +/* Bit definitions and macros for TCD7_CSR */
44810 +#define MCF_EDMA_TCD7_CSR_START (0x0001)
44811 +#define MCF_EDMA_TCD7_CSR_INT_MAJOR (0x0002)
44812 +#define MCF_EDMA_TCD7_CSR_INT_HALF (0x0004)
44813 +#define MCF_EDMA_TCD7_CSR_D_REQ (0x0008)
44814 +#define MCF_EDMA_TCD7_CSR_E_SG (0x0010)
44815 +#define MCF_EDMA_TCD7_CSR_E_LINK (0x0020)
44816 +#define MCF_EDMA_TCD7_CSR_ACTIVE (0x0040)
44817 +#define MCF_EDMA_TCD7_CSR_DONE (0x0080)
44818 +#define MCF_EDMA_TCD7_CSR_LINKCH(x) (((x)&0x003F)<<8)
44819 +#define MCF_EDMA_TCD7_CSR_BWC(x) (((x)&0x0003)<<14)
44821 +/* Bit definitions and macros for TCD8_SADDR */
44822 +#define MCF_EDMA_TCD8_SADDR_SADDR(x) (x)
44824 +/* Bit definitions and macros for TCD8_ATTR */
44825 +#define MCF_EDMA_TCD8_ATTR_DSIZE(x) (((x)&0x0007))
44826 +#define MCF_EDMA_TCD8_ATTR_DMOD(x) (((x)&0x001F)<<3)
44827 +#define MCF_EDMA_TCD8_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44828 +#define MCF_EDMA_TCD8_ATTR_SMOD(x) (((x)&0x001F)<<11)
44830 +/* Bit definitions and macros for TCD8_SOFF */
44831 +#define MCF_EDMA_TCD8_SOFF_SOFF(x) (x)
44833 +/* Bit definitions and macros for TCD8_NBYTES */
44834 +#define MCF_EDMA_TCD8_NBYTES_NBYTES(x) (x)
44836 +/* Bit definitions and macros for TCD8_SLAST */
44837 +#define MCF_EDMA_TCD8_SLAST_SLAST(x) (x)
44839 +/* Bit definitions and macros for TCD8_DADDR */
44840 +#define MCF_EDMA_TCD8_DADDR_DADDR(x) (x)
44842 +/* Bit definitions and macros for TCD8_CITER */
44843 +#define MCF_EDMA_TCD8_CITER_CITER(x) (((x)&0x7FFF))
44844 +#define MCF_EDMA_TCD8_CITER_E_LINK (0x8000)
44846 +/* Bit definitions and macros for TCD8_CITER_ELINK */
44847 +#define MCF_EDMA_TCD8_CITER_ELINK_CITER(x) (((x)&0x01FF))
44848 +#define MCF_EDMA_TCD8_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44849 +#define MCF_EDMA_TCD8_CITER_ELINK_E_LINK (0x8000)
44851 +/* Bit definitions and macros for TCD8_DOFF */
44852 +#define MCF_EDMA_TCD8_DOFF_DOFF(x) (x)
44854 +/* Bit definitions and macros for TCD8_DLAST_SGA */
44855 +#define MCF_EDMA_TCD8_DLAST_SGA_DLAST_SGA(x) (x)
44857 +/* Bit definitions and macros for TCD8_BITER_ELINK */
44858 +#define MCF_EDMA_TCD8_BITER_ELINK_BITER(x) (((x)&0x01FF))
44859 +#define MCF_EDMA_TCD8_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44860 +#define MCF_EDMA_TCD8_BITER_ELINK_E_LINK (0x8000)
44862 +/* Bit definitions and macros for TCD8_BITER */
44863 +#define MCF_EDMA_TCD8_BITER_BITER(x) (((x)&0x7FFF))
44864 +#define MCF_EDMA_TCD8_BITER_E_LINK (0x8000)
44866 +/* Bit definitions and macros for TCD8_CSR */
44867 +#define MCF_EDMA_TCD8_CSR_START (0x0001)
44868 +#define MCF_EDMA_TCD8_CSR_INT_MAJOR (0x0002)
44869 +#define MCF_EDMA_TCD8_CSR_INT_HALF (0x0004)
44870 +#define MCF_EDMA_TCD8_CSR_D_REQ (0x0008)
44871 +#define MCF_EDMA_TCD8_CSR_E_SG (0x0010)
44872 +#define MCF_EDMA_TCD8_CSR_E_LINK (0x0020)
44873 +#define MCF_EDMA_TCD8_CSR_ACTIVE (0x0040)
44874 +#define MCF_EDMA_TCD8_CSR_DONE (0x0080)
44875 +#define MCF_EDMA_TCD8_CSR_LINKCH(x) (((x)&0x003F)<<8)
44876 +#define MCF_EDMA_TCD8_CSR_BWC(x) (((x)&0x0003)<<14)
44878 +/* Bit definitions and macros for TCD9_SADDR */
44879 +#define MCF_EDMA_TCD9_SADDR_SADDR(x) (x)
44881 +/* Bit definitions and macros for TCD9_ATTR */
44882 +#define MCF_EDMA_TCD9_ATTR_DSIZE(x) (((x)&0x0007))
44883 +#define MCF_EDMA_TCD9_ATTR_DMOD(x) (((x)&0x001F)<<3)
44884 +#define MCF_EDMA_TCD9_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44885 +#define MCF_EDMA_TCD9_ATTR_SMOD(x) (((x)&0x001F)<<11)
44887 +/* Bit definitions and macros for TCD9_SOFF */
44888 +#define MCF_EDMA_TCD9_SOFF_SOFF(x) (x)
44890 +/* Bit definitions and macros for TCD9_NBYTES */
44891 +#define MCF_EDMA_TCD9_NBYTES_NBYTES(x) (x)
44893 +/* Bit definitions and macros for TCD9_SLAST */
44894 +#define MCF_EDMA_TCD9_SLAST_SLAST(x) (x)
44896 +/* Bit definitions and macros for TCD9_DADDR */
44897 +#define MCF_EDMA_TCD9_DADDR_DADDR(x) (x)
44899 +/* Bit definitions and macros for TCD9_CITER_ELINK */
44900 +#define MCF_EDMA_TCD9_CITER_ELINK_CITER(x) (((x)&0x01FF))
44901 +#define MCF_EDMA_TCD9_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44902 +#define MCF_EDMA_TCD9_CITER_ELINK_E_LINK (0x8000)
44904 +/* Bit definitions and macros for TCD9_CITER */
44905 +#define MCF_EDMA_TCD9_CITER_CITER(x) (((x)&0x7FFF))
44906 +#define MCF_EDMA_TCD9_CITER_E_LINK (0x8000)
44908 +/* Bit definitions and macros for TCD9_DOFF */
44909 +#define MCF_EDMA_TCD9_DOFF_DOFF(x) (x)
44911 +/* Bit definitions and macros for TCD9_DLAST_SGA */
44912 +#define MCF_EDMA_TCD9_DLAST_SGA_DLAST_SGA(x) (x)
44914 +/* Bit definitions and macros for TCD9_BITER_ELINK */
44915 +#define MCF_EDMA_TCD9_BITER_ELINK_BITER(x) (((x)&0x01FF))
44916 +#define MCF_EDMA_TCD9_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44917 +#define MCF_EDMA_TCD9_BITER_ELINK_E_LINK (0x8000)
44919 +/* Bit definitions and macros for TCD9_BITER */
44920 +#define MCF_EDMA_TCD9_BITER_BITER(x) (((x)&0x7FFF))
44921 +#define MCF_EDMA_TCD9_BITER_E_LINK (0x8000)
44923 +/* Bit definitions and macros for TCD9_CSR */
44924 +#define MCF_EDMA_TCD9_CSR_START (0x0001)
44925 +#define MCF_EDMA_TCD9_CSR_INT_MAJOR (0x0002)
44926 +#define MCF_EDMA_TCD9_CSR_INT_HALF (0x0004)
44927 +#define MCF_EDMA_TCD9_CSR_D_REQ (0x0008)
44928 +#define MCF_EDMA_TCD9_CSR_E_SG (0x0010)
44929 +#define MCF_EDMA_TCD9_CSR_E_LINK (0x0020)
44930 +#define MCF_EDMA_TCD9_CSR_ACTIVE (0x0040)
44931 +#define MCF_EDMA_TCD9_CSR_DONE (0x0080)
44932 +#define MCF_EDMA_TCD9_CSR_LINKCH(x) (((x)&0x003F)<<8)
44933 +#define MCF_EDMA_TCD9_CSR_BWC(x) (((x)&0x0003)<<14)
44935 +/* Bit definitions and macros for TCD10_SADDR */
44936 +#define MCF_EDMA_TCD10_SADDR_SADDR(x) (x)
44938 +/* Bit definitions and macros for TCD10_ATTR */
44939 +#define MCF_EDMA_TCD10_ATTR_DSIZE(x) (((x)&0x0007))
44940 +#define MCF_EDMA_TCD10_ATTR_DMOD(x) (((x)&0x001F)<<3)
44941 +#define MCF_EDMA_TCD10_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44942 +#define MCF_EDMA_TCD10_ATTR_SMOD(x) (((x)&0x001F)<<11)
44944 +/* Bit definitions and macros for TCD10_SOFF */
44945 +#define MCF_EDMA_TCD10_SOFF_SOFF(x) (x)
44947 +/* Bit definitions and macros for TCD10_NBYTES */
44948 +#define MCF_EDMA_TCD10_NBYTES_NBYTES(x) (x)
44950 +/* Bit definitions and macros for TCD10_SLAST */
44951 +#define MCF_EDMA_TCD10_SLAST_SLAST(x) (x)
44953 +/* Bit definitions and macros for TCD10_DADDR */
44954 +#define MCF_EDMA_TCD10_DADDR_DADDR(x) (x)
44956 +/* Bit definitions and macros for TCD10_CITER_ELINK */
44957 +#define MCF_EDMA_TCD10_CITER_ELINK_CITER(x) (((x)&0x01FF))
44958 +#define MCF_EDMA_TCD10_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44959 +#define MCF_EDMA_TCD10_CITER_ELINK_E_LINK (0x8000)
44961 +/* Bit definitions and macros for TCD10_CITER */
44962 +#define MCF_EDMA_TCD10_CITER_CITER(x) (((x)&0x7FFF))
44963 +#define MCF_EDMA_TCD10_CITER_E_LINK (0x8000)
44965 +/* Bit definitions and macros for TCD10_DOFF */
44966 +#define MCF_EDMA_TCD10_DOFF_DOFF(x) (x)
44968 +/* Bit definitions and macros for TCD10_DLAST_SGA */
44969 +#define MCF_EDMA_TCD10_DLAST_SGA_DLAST_SGA(x) (x)
44971 +/* Bit definitions and macros for TCD10_BITER */
44972 +#define MCF_EDMA_TCD10_BITER_BITER(x) (((x)&0x7FFF))
44973 +#define MCF_EDMA_TCD10_BITER_E_LINK (0x8000)
44975 +/* Bit definitions and macros for TCD10_BITER_ELINK */
44976 +#define MCF_EDMA_TCD10_BITER_ELINK_BITER(x) (((x)&0x01FF))
44977 +#define MCF_EDMA_TCD10_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
44978 +#define MCF_EDMA_TCD10_BITER_ELINK_E_LINK (0x8000)
44980 +/* Bit definitions and macros for TCD10_CSR */
44981 +#define MCF_EDMA_TCD10_CSR_START (0x0001)
44982 +#define MCF_EDMA_TCD10_CSR_INT_MAJOR (0x0002)
44983 +#define MCF_EDMA_TCD10_CSR_INT_HALF (0x0004)
44984 +#define MCF_EDMA_TCD10_CSR_D_REQ (0x0008)
44985 +#define MCF_EDMA_TCD10_CSR_E_SG (0x0010)
44986 +#define MCF_EDMA_TCD10_CSR_E_LINK (0x0020)
44987 +#define MCF_EDMA_TCD10_CSR_ACTIVE (0x0040)
44988 +#define MCF_EDMA_TCD10_CSR_DONE (0x0080)
44989 +#define MCF_EDMA_TCD10_CSR_LINKCH(x) (((x)&0x003F)<<8)
44990 +#define MCF_EDMA_TCD10_CSR_BWC(x) (((x)&0x0003)<<14)
44992 +/* Bit definitions and macros for TCD11_SADDR */
44993 +#define MCF_EDMA_TCD11_SADDR_SADDR(x) (x)
44995 +/* Bit definitions and macros for TCD11_ATTR */
44996 +#define MCF_EDMA_TCD11_ATTR_DSIZE(x) (((x)&0x0007))
44997 +#define MCF_EDMA_TCD11_ATTR_DMOD(x) (((x)&0x001F)<<3)
44998 +#define MCF_EDMA_TCD11_ATTR_SSIZE(x) (((x)&0x0007)<<8)
44999 +#define MCF_EDMA_TCD11_ATTR_SMOD(x) (((x)&0x001F)<<11)
45001 +/* Bit definitions and macros for TCD11_SOFF */
45002 +#define MCF_EDMA_TCD11_SOFF_SOFF(x) (x)
45004 +/* Bit definitions and macros for TCD11_NBYTES */
45005 +#define MCF_EDMA_TCD11_NBYTES_NBYTES(x) (x)
45007 +/* Bit definitions and macros for TCD11_SLAST */
45008 +#define MCF_EDMA_TCD11_SLAST_SLAST(x) (x)
45010 +/* Bit definitions and macros for TCD11_DADDR */
45011 +#define MCF_EDMA_TCD11_DADDR_DADDR(x) (x)
45013 +/* Bit definitions and macros for TCD11_CITER */
45014 +#define MCF_EDMA_TCD11_CITER_CITER(x) (((x)&0x7FFF))
45015 +#define MCF_EDMA_TCD11_CITER_E_LINK (0x8000)
45017 +/* Bit definitions and macros for TCD11_CITER_ELINK */
45018 +#define MCF_EDMA_TCD11_CITER_ELINK_CITER(x) (((x)&0x01FF))
45019 +#define MCF_EDMA_TCD11_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45020 +#define MCF_EDMA_TCD11_CITER_ELINK_E_LINK (0x8000)
45022 +/* Bit definitions and macros for TCD11_DOFF */
45023 +#define MCF_EDMA_TCD11_DOFF_DOFF(x) (x)
45025 +/* Bit definitions and macros for TCD11_DLAST_SGA */
45026 +#define MCF_EDMA_TCD11_DLAST_SGA_DLAST_SGA(x) (x)
45028 +/* Bit definitions and macros for TCD11_BITER */
45029 +#define MCF_EDMA_TCD11_BITER_BITER(x) (((x)&0x7FFF))
45030 +#define MCF_EDMA_TCD11_BITER_E_LINK (0x8000)
45032 +/* Bit definitions and macros for TCD11_BITER_ELINK */
45033 +#define MCF_EDMA_TCD11_BITER_ELINK_BITER(x) (((x)&0x01FF))
45034 +#define MCF_EDMA_TCD11_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45035 +#define MCF_EDMA_TCD11_BITER_ELINK_E_LINK (0x8000)
45037 +/* Bit definitions and macros for TCD11_CSR */
45038 +#define MCF_EDMA_TCD11_CSR_START (0x0001)
45039 +#define MCF_EDMA_TCD11_CSR_INT_MAJOR (0x0002)
45040 +#define MCF_EDMA_TCD11_CSR_INT_HALF (0x0004)
45041 +#define MCF_EDMA_TCD11_CSR_D_REQ (0x0008)
45042 +#define MCF_EDMA_TCD11_CSR_E_SG (0x0010)
45043 +#define MCF_EDMA_TCD11_CSR_E_LINK (0x0020)
45044 +#define MCF_EDMA_TCD11_CSR_ACTIVE (0x0040)
45045 +#define MCF_EDMA_TCD11_CSR_DONE (0x0080)
45046 +#define MCF_EDMA_TCD11_CSR_LINKCH(x) (((x)&0x003F)<<8)
45047 +#define MCF_EDMA_TCD11_CSR_BWC(x) (((x)&0x0003)<<14)
45049 +/* Bit definitions and macros for TCD12_SADDR */
45050 +#define MCF_EDMA_TCD12_SADDR_SADDR(x) (x)
45052 +/* Bit definitions and macros for TCD12_ATTR */
45053 +#define MCF_EDMA_TCD12_ATTR_DSIZE(x) (((x)&0x0007))
45054 +#define MCF_EDMA_TCD12_ATTR_DMOD(x) (((x)&0x001F)<<3)
45055 +#define MCF_EDMA_TCD12_ATTR_SSIZE(x) (((x)&0x0007)<<8)
45056 +#define MCF_EDMA_TCD12_ATTR_SMOD(x) (((x)&0x001F)<<11)
45058 +/* Bit definitions and macros for TCD12_SOFF */
45059 +#define MCF_EDMA_TCD12_SOFF_SOFF(x) (x)
45061 +/* Bit definitions and macros for TCD12_NBYTES */
45062 +#define MCF_EDMA_TCD12_NBYTES_NBYTES(x) (x)
45064 +/* Bit definitions and macros for TCD12_SLAST */
45065 +#define MCF_EDMA_TCD12_SLAST_SLAST(x) (x)
45067 +/* Bit definitions and macros for TCD12_DADDR */
45068 +#define MCF_EDMA_TCD12_DADDR_DADDR(x) (x)
45070 +/* Bit definitions and macros for TCD12_CITER */
45071 +#define MCF_EDMA_TCD12_CITER_CITER(x) (((x)&0x7FFF))
45072 +#define MCF_EDMA_TCD12_CITER_E_LINK (0x8000)
45074 +/* Bit definitions and macros for TCD12_CITER_ELINK */
45075 +#define MCF_EDMA_TCD12_CITER_ELINK_CITER(x) (((x)&0x01FF))
45076 +#define MCF_EDMA_TCD12_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45077 +#define MCF_EDMA_TCD12_CITER_ELINK_E_LINK (0x8000)
45079 +/* Bit definitions and macros for TCD12_DOFF */
45080 +#define MCF_EDMA_TCD12_DOFF_DOFF(x) (x)
45082 +/* Bit definitions and macros for TCD12_DLAST_SGA */
45083 +#define MCF_EDMA_TCD12_DLAST_SGA_DLAST_SGA(x) (x)
45085 +/* Bit definitions and macros for TCD12_BITER */
45086 +#define MCF_EDMA_TCD12_BITER_BITER(x) (((x)&0x7FFF))
45087 +#define MCF_EDMA_TCD12_BITER_E_LINK (0x8000)
45089 +/* Bit definitions and macros for TCD12_BITER_ELINK */
45090 +#define MCF_EDMA_TCD12_BITER_ELINK_BITER(x) (((x)&0x01FF))
45091 +#define MCF_EDMA_TCD12_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45092 +#define MCF_EDMA_TCD12_BITER_ELINK_E_LINK (0x8000)
45094 +/* Bit definitions and macros for TCD12_CSR */
45095 +#define MCF_EDMA_TCD12_CSR_START (0x0001)
45096 +#define MCF_EDMA_TCD12_CSR_INT_MAJOR (0x0002)
45097 +#define MCF_EDMA_TCD12_CSR_INT_HALF (0x0004)
45098 +#define MCF_EDMA_TCD12_CSR_D_REQ (0x0008)
45099 +#define MCF_EDMA_TCD12_CSR_E_SG (0x0010)
45100 +#define MCF_EDMA_TCD12_CSR_E_LINK (0x0020)
45101 +#define MCF_EDMA_TCD12_CSR_ACTIVE (0x0040)
45102 +#define MCF_EDMA_TCD12_CSR_DONE (0x0080)
45103 +#define MCF_EDMA_TCD12_CSR_LINKCH(x) (((x)&0x003F)<<8)
45104 +#define MCF_EDMA_TCD12_CSR_BWC(x) (((x)&0x0003)<<14)
45106 +/* Bit definitions and macros for TCD13_SADDR */
45107 +#define MCF_EDMA_TCD13_SADDR_SADDR(x) (x)
45109 +/* Bit definitions and macros for TCD13_ATTR */
45110 +#define MCF_EDMA_TCD13_ATTR_DSIZE(x) (((x)&0x0007))
45111 +#define MCF_EDMA_TCD13_ATTR_DMOD(x) (((x)&0x001F)<<3)
45112 +#define MCF_EDMA_TCD13_ATTR_SSIZE(x) (((x)&0x0007)<<8)
45113 +#define MCF_EDMA_TCD13_ATTR_SMOD(x) (((x)&0x001F)<<11)
45115 +/* Bit definitions and macros for TCD13_SOFF */
45116 +#define MCF_EDMA_TCD13_SOFF_SOFF(x) (x)
45118 +/* Bit definitions and macros for TCD13_NBYTES */
45119 +#define MCF_EDMA_TCD13_NBYTES_NBYTES(x) (x)
45121 +/* Bit definitions and macros for TCD13_SLAST */
45122 +#define MCF_EDMA_TCD13_SLAST_SLAST(x) (x)
45124 +/* Bit definitions and macros for TCD13_DADDR */
45125 +#define MCF_EDMA_TCD13_DADDR_DADDR(x) (x)
45127 +/* Bit definitions and macros for TCD13_CITER_ELINK */
45128 +#define MCF_EDMA_TCD13_CITER_ELINK_CITER(x) (((x)&0x01FF))
45129 +#define MCF_EDMA_TCD13_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45130 +#define MCF_EDMA_TCD13_CITER_ELINK_E_LINK (0x8000)
45132 +/* Bit definitions and macros for TCD13_CITER */
45133 +#define MCF_EDMA_TCD13_CITER_CITER(x) (((x)&0x7FFF))
45134 +#define MCF_EDMA_TCD13_CITER_E_LINK (0x8000)
45136 +/* Bit definitions and macros for TCD13_DOFF */
45137 +#define MCF_EDMA_TCD13_DOFF_DOFF(x) (x)
45139 +/* Bit definitions and macros for TCD13_DLAST_SGA */
45140 +#define MCF_EDMA_TCD13_DLAST_SGA_DLAST_SGA(x) (x)
45142 +/* Bit definitions and macros for TCD13_BITER_ELINK */
45143 +#define MCF_EDMA_TCD13_BITER_ELINK_BITER(x) (((x)&0x01FF))
45144 +#define MCF_EDMA_TCD13_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45145 +#define MCF_EDMA_TCD13_BITER_ELINK_E_LINK (0x8000)
45147 +/* Bit definitions and macros for TCD13_BITER */
45148 +#define MCF_EDMA_TCD13_BITER_BITER(x) (((x)&0x7FFF))
45149 +#define MCF_EDMA_TCD13_BITER_E_LINK (0x8000)
45151 +/* Bit definitions and macros for TCD13_CSR */
45152 +#define MCF_EDMA_TCD13_CSR_START (0x0001)
45153 +#define MCF_EDMA_TCD13_CSR_INT_MAJOR (0x0002)
45154 +#define MCF_EDMA_TCD13_CSR_INT_HALF (0x0004)
45155 +#define MCF_EDMA_TCD13_CSR_D_REQ (0x0008)
45156 +#define MCF_EDMA_TCD13_CSR_E_SG (0x0010)
45157 +#define MCF_EDMA_TCD13_CSR_E_LINK (0x0020)
45158 +#define MCF_EDMA_TCD13_CSR_ACTIVE (0x0040)
45159 +#define MCF_EDMA_TCD13_CSR_DONE (0x0080)
45160 +#define MCF_EDMA_TCD13_CSR_LINKCH(x) (((x)&0x003F)<<8)
45161 +#define MCF_EDMA_TCD13_CSR_BWC(x) (((x)&0x0003)<<14)
45163 +/* Bit definitions and macros for TCD14_SADDR */
45164 +#define MCF_EDMA_TCD14_SADDR_SADDR(x) (x)
45166 +/* Bit definitions and macros for TCD14_ATTR */
45167 +#define MCF_EDMA_TCD14_ATTR_DSIZE(x) (((x)&0x0007))
45168 +#define MCF_EDMA_TCD14_ATTR_DMOD(x) (((x)&0x001F)<<3)
45169 +#define MCF_EDMA_TCD14_ATTR_SSIZE(x) (((x)&0x0007)<<8)
45170 +#define MCF_EDMA_TCD14_ATTR_SMOD(x) (((x)&0x001F)<<11)
45172 +/* Bit definitions and macros for TCD14_SOFF */
45173 +#define MCF_EDMA_TCD14_SOFF_SOFF(x) (x)
45175 +/* Bit definitions and macros for TCD14_NBYTES */
45176 +#define MCF_EDMA_TCD14_NBYTES_NBYTES(x) (x)
45178 +/* Bit definitions and macros for TCD14_SLAST */
45179 +#define MCF_EDMA_TCD14_SLAST_SLAST(x) (x)
45181 +/* Bit definitions and macros for TCD14_DADDR */
45182 +#define MCF_EDMA_TCD14_DADDR_DADDR(x) (x)
45184 +/* Bit definitions and macros for TCD14_CITER */
45185 +#define MCF_EDMA_TCD14_CITER_CITER(x) (((x)&0x7FFF))
45186 +#define MCF_EDMA_TCD14_CITER_E_LINK (0x8000)
45188 +/* Bit definitions and macros for TCD14_CITER_ELINK */
45189 +#define MCF_EDMA_TCD14_CITER_ELINK_CITER(x) (((x)&0x01FF))
45190 +#define MCF_EDMA_TCD14_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45191 +#define MCF_EDMA_TCD14_CITER_ELINK_E_LINK (0x8000)
45193 +/* Bit definitions and macros for TCD14_DOFF */
45194 +#define MCF_EDMA_TCD14_DOFF_DOFF(x) (x)
45196 +/* Bit definitions and macros for TCD14_DLAST_SGA */
45197 +#define MCF_EDMA_TCD14_DLAST_SGA_DLAST_SGA(x) (x)
45199 +/* Bit definitions and macros for TCD14_BITER_ELINK */
45200 +#define MCF_EDMA_TCD14_BITER_ELINK_BITER(x) (((x)&0x01FF))
45201 +#define MCF_EDMA_TCD14_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45202 +#define MCF_EDMA_TCD14_BITER_ELINK_E_LINK (0x8000)
45204 +/* Bit definitions and macros for TCD14_BITER */
45205 +#define MCF_EDMA_TCD14_BITER_BITER(x) (((x)&0x7FFF))
45206 +#define MCF_EDMA_TCD14_BITER_E_LINK (0x8000)
45208 +/* Bit definitions and macros for TCD14_CSR */
45209 +#define MCF_EDMA_TCD14_CSR_START (0x0001)
45210 +#define MCF_EDMA_TCD14_CSR_INT_MAJOR (0x0002)
45211 +#define MCF_EDMA_TCD14_CSR_INT_HALF (0x0004)
45212 +#define MCF_EDMA_TCD14_CSR_D_REQ (0x0008)
45213 +#define MCF_EDMA_TCD14_CSR_E_SG (0x0010)
45214 +#define MCF_EDMA_TCD14_CSR_E_LINK (0x0020)
45215 +#define MCF_EDMA_TCD14_CSR_ACTIVE (0x0040)
45216 +#define MCF_EDMA_TCD14_CSR_DONE (0x0080)
45217 +#define MCF_EDMA_TCD14_CSR_LINKCH(x) (((x)&0x003F)<<8)
45218 +#define MCF_EDMA_TCD14_CSR_BWC(x) (((x)&0x0003)<<14)
45220 +/* Bit definitions and macros for TCD15_SADDR */
45221 +#define MCF_EDMA_TCD15_SADDR_SADDR(x) (x)
45223 +/* Bit definitions and macros for TCD15_ATTR */
45224 +#define MCF_EDMA_TCD15_ATTR_DSIZE(x) (((x)&0x0007))
45225 +#define MCF_EDMA_TCD15_ATTR_DMOD(x) (((x)&0x001F)<<3)
45226 +#define MCF_EDMA_TCD15_ATTR_SSIZE(x) (((x)&0x0007)<<8)
45227 +#define MCF_EDMA_TCD15_ATTR_SMOD(x) (((x)&0x001F)<<11)
45229 +/* Bit definitions and macros for TCD15_SOFF */
45230 +#define MCF_EDMA_TCD15_SOFF_SOFF(x) (x)
45232 +/* Bit definitions and macros for TCD15_NBYTES */
45233 +#define MCF_EDMA_TCD15_NBYTES_NBYTES(x) (x)
45235 +/* Bit definitions and macros for TCD15_SLAST */
45236 +#define MCF_EDMA_TCD15_SLAST_SLAST(x) (x)
45238 +/* Bit definitions and macros for TCD15_DADDR */
45239 +#define MCF_EDMA_TCD15_DADDR_DADDR(x) (x)
45241 +/* Bit definitions and macros for TCD15_CITER_ELINK */
45242 +#define MCF_EDMA_TCD15_CITER_ELINK_CITER(x) (((x)&0x01FF))
45243 +#define MCF_EDMA_TCD15_CITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45244 +#define MCF_EDMA_TCD15_CITER_ELINK_E_LINK (0x8000)
45246 +/* Bit definitions and macros for TCD15_CITER */
45247 +#define MCF_EDMA_TCD15_CITER_CITER(x) (((x)&0x7FFF))
45248 +#define MCF_EDMA_TCD15_CITER_E_LINK (0x8000)
45250 +/* Bit definitions and macros for TCD15_DOFF */
45251 +#define MCF_EDMA_TCD15_DOFF_DOFF(x) (x)
45253 +/* Bit definitions and macros for TCD15_DLAST_SGA */
45254 +#define MCF_EDMA_TCD15_DLAST_SGA_DLAST_SGA(x) (x)
45256 +/* Bit definitions and macros for TCD15_BITER */
45257 +#define MCF_EDMA_TCD15_BITER_BITER(x) (((x)&0x7FFF))
45258 +#define MCF_EDMA_TCD15_BITER_E_LINK (0x8000)
45260 +/* Bit definitions and macros for TCD15_BITER_ELINK */
45261 +#define MCF_EDMA_TCD15_BITER_ELINK_BITER(x) (((x)&0x01FF))
45262 +#define MCF_EDMA_TCD15_BITER_ELINK_LINKCH(x) (((x)&0x003F)<<9)
45263 +#define MCF_EDMA_TCD15_BITER_ELINK_E_LINK (0x8000)
45265 +/* Bit definitions and macros for TCD15_CSR */
45266 +#define MCF_EDMA_TCD15_CSR_START (0x0001)
45267 +#define MCF_EDMA_TCD15_CSR_INT_MAJOR (0x0002)
45268 +#define MCF_EDMA_TCD15_CSR_INT_HALF (0x0004)
45269 +#define MCF_EDMA_TCD15_CSR_D_REQ (0x0008)
45270 +#define MCF_EDMA_TCD15_CSR_E_SG (0x0010)
45271 +#define MCF_EDMA_TCD15_CSR_E_LINK (0x0020)
45272 +#define MCF_EDMA_TCD15_CSR_ACTIVE (0x0040)
45273 +#define MCF_EDMA_TCD15_CSR_DONE (0x0080)
45274 +#define MCF_EDMA_TCD15_CSR_LINKCH(x) (((x)&0x003F)<<8)
45275 +#define MCF_EDMA_TCD15_CSR_BWC(x) (((x)&0x0003)<<14)
45277 +#endif /* __MCF5445X_EDMA_H__ */
45279 +++ b/include/asm-m68k/mcf5445x_eport.h
45282 + * Kurt Mahan kmahan@freescale.com
45284 + * Copyright Freescale Semiconductor, Inc. 2007
45286 + * This program is free software; you can redistribute it and/or modify it
45287 + * under the terms of the GNU General Public License as published by the
45288 + * Free Software Foundation; either version 2 of the License, or (at your
45289 + * option) any later version.
45292 +#ifndef __MCF5445X_EPORT_H__
45293 +#define __MCF5445X_EPORT_H__
45295 +/*********************************************************************
45297 +* Edge Port Module (EPORT)
45299 +*********************************************************************/
45301 +/* Register read/write macros */
45302 +#define MCF_EPORT_EPPAR MCF_REG16(0xFC094000)
45303 +#define MCF_EPORT_EPDDR MCF_REG08(0xFC094002)
45304 +#define MCF_EPORT_EPIER MCF_REG08(0xFC094003)
45305 +#define MCF_EPORT_EPDR MCF_REG08(0xFC094004)
45306 +#define MCF_EPORT_EPPDR MCF_REG08(0xFC094005)
45307 +#define MCF_EPORT_EPFR MCF_REG08(0xFC094006)
45309 +/* Bit definitions and macros for EPPAR */
45310 +#define MCF_EPORT_EPPAR_EPPA1(x) (((x)&0x0003)<<2)
45311 +#define MCF_EPORT_EPPAR_EPPA2(x) (((x)&0x0003)<<4)
45312 +#define MCF_EPORT_EPPAR_EPPA3(x) (((x)&0x0003)<<6)
45313 +#define MCF_EPORT_EPPAR_EPPA4(x) (((x)&0x0003)<<8)
45314 +#define MCF_EPORT_EPPAR_EPPA5(x) (((x)&0x0003)<<10)
45315 +#define MCF_EPORT_EPPAR_EPPA6(x) (((x)&0x0003)<<12)
45316 +#define MCF_EPORT_EPPAR_EPPA7(x) (((x)&0x0003)<<14)
45317 +#define MCF_EPORT_EPPAR_LEVEL (0)
45318 +#define MCF_EPORT_EPPAR_RISING (1)
45319 +#define MCF_EPORT_EPPAR_FALLING (2)
45320 +#define MCF_EPORT_EPPAR_BOTH (3)
45321 +#define MCF_EPORT_EPPAR_EPPA7_LEVEL (0x0000)
45322 +#define MCF_EPORT_EPPAR_EPPA7_RISING (0x4000)
45323 +#define MCF_EPORT_EPPAR_EPPA7_FALLING (0x8000)
45324 +#define MCF_EPORT_EPPAR_EPPA7_BOTH (0xC000)
45325 +#define MCF_EPORT_EPPAR_EPPA6_LEVEL (0x0000)
45326 +#define MCF_EPORT_EPPAR_EPPA6_RISING (0x1000)
45327 +#define MCF_EPORT_EPPAR_EPPA6_FALLING (0x2000)
45328 +#define MCF_EPORT_EPPAR_EPPA6_BOTH (0x3000)
45329 +#define MCF_EPORT_EPPAR_EPPA5_LEVEL (0x0000)
45330 +#define MCF_EPORT_EPPAR_EPPA5_RISING (0x0400)
45331 +#define MCF_EPORT_EPPAR_EPPA5_FALLING (0x0800)
45332 +#define MCF_EPORT_EPPAR_EPPA5_BOTH (0x0C00)
45333 +#define MCF_EPORT_EPPAR_EPPA4_LEVEL (0x0000)
45334 +#define MCF_EPORT_EPPAR_EPPA4_RISING (0x0100)
45335 +#define MCF_EPORT_EPPAR_EPPA4_FALLING (0x0200)
45336 +#define MCF_EPORT_EPPAR_EPPA4_BOTH (0x0300)
45337 +#define MCF_EPORT_EPPAR_EPPA3_LEVEL (0x0000)
45338 +#define MCF_EPORT_EPPAR_EPPA3_RISING (0x0040)
45339 +#define MCF_EPORT_EPPAR_EPPA3_FALLING (0x0080)
45340 +#define MCF_EPORT_EPPAR_EPPA3_BOTH (0x00C0)
45341 +#define MCF_EPORT_EPPAR_EPPA2_LEVEL (0x0000)
45342 +#define MCF_EPORT_EPPAR_EPPA2_RISING (0x0010)
45343 +#define MCF_EPORT_EPPAR_EPPA2_FALLING (0x0020)
45344 +#define MCF_EPORT_EPPAR_EPPA2_BOTH (0x0030)
45345 +#define MCF_EPORT_EPPAR_EPPA1_LEVEL (0x0000)
45346 +#define MCF_EPORT_EPPAR_EPPA1_RISING (0x0004)
45347 +#define MCF_EPORT_EPPAR_EPPA1_FALLING (0x0008)
45348 +#define MCF_EPORT_EPPAR_EPPA1_BOTH (0x000C)
45350 +/* Bit definitions and macros for EPDDR */
45351 +#define MCF_EPORT_EPDDR_EPDD1 (0x02)
45352 +#define MCF_EPORT_EPDDR_EPDD2 (0x04)
45353 +#define MCF_EPORT_EPDDR_EPDD3 (0x08)
45354 +#define MCF_EPORT_EPDDR_EPDD4 (0x10)
45355 +#define MCF_EPORT_EPDDR_EPDD5 (0x20)
45356 +#define MCF_EPORT_EPDDR_EPDD6 (0x40)
45357 +#define MCF_EPORT_EPDDR_EPDD7 (0x80)
45359 +/* Bit definitions and macros for EPIER */
45360 +#define MCF_EPORT_EPIER_EPIE1 (0x02)
45361 +#define MCF_EPORT_EPIER_EPIE2 (0x04)
45362 +#define MCF_EPORT_EPIER_EPIE3 (0x08)
45363 +#define MCF_EPORT_EPIER_EPIE4 (0x10)
45364 +#define MCF_EPORT_EPIER_EPIE5 (0x20)
45365 +#define MCF_EPORT_EPIER_EPIE6 (0x40)
45366 +#define MCF_EPORT_EPIER_EPIE7 (0x80)
45368 +/* Bit definitions and macros for EPDR */
45369 +#define MCF_EPORT_EPDR_EPD1 (0x02)
45370 +#define MCF_EPORT_EPDR_EPD2 (0x04)
45371 +#define MCF_EPORT_EPDR_EPD3 (0x08)
45372 +#define MCF_EPORT_EPDR_EPD4 (0x10)
45373 +#define MCF_EPORT_EPDR_EPD5 (0x20)
45374 +#define MCF_EPORT_EPDR_EPD6 (0x40)
45375 +#define MCF_EPORT_EPDR_EPD7 (0x80)
45377 +/* Bit definitions and macros for EPPDR */
45378 +#define MCF_EPORT_EPPDR_EPPD1 (0x02)
45379 +#define MCF_EPORT_EPPDR_EPPD2 (0x04)
45380 +#define MCF_EPORT_EPPDR_EPPD3 (0x08)
45381 +#define MCF_EPORT_EPPDR_EPPD4 (0x10)
45382 +#define MCF_EPORT_EPPDR_EPPD5 (0x20)
45383 +#define MCF_EPORT_EPPDR_EPPD6 (0x40)
45384 +#define MCF_EPORT_EPPDR_EPPD7 (0x80)
45386 +/* Bit definitions and macros for EPFR */
45387 +#define MCF_EPORT_EPFR_EPF1 (0x02)
45388 +#define MCF_EPORT_EPFR_EPF2 (0x04)
45389 +#define MCF_EPORT_EPFR_EPF3 (0x08)
45390 +#define MCF_EPORT_EPFR_EPF4 (0x10)
45391 +#define MCF_EPORT_EPFR_EPF5 (0x20)
45392 +#define MCF_EPORT_EPFR_EPF6 (0x40)
45393 +#define MCF_EPORT_EPFR_EPF7 (0x80)
45395 +/********************************************************************/
45397 +#endif /* __MCF5445X_EPORT_H__ */
45399 +++ b/include/asm-m68k/mcf5445x_fbcs.h
45402 + * Matt Waddel Matt.Waddel@freescale.com
45404 + * Copyright Freescale Semiconductor, Inc. 2007
45406 + * This program is free software; you can redistribute it and/or modify it
45407 + * under the terms of the GNU General Public License as published by the
45408 + * Free Software Foundation; either version 2 of the License, or (at your
45409 + * option) any later version.
45412 +#ifndef __MCF5445X_FBCS_H__
45413 +#define __MCF5445X_FBCS_H__
45415 +/*********************************************************************
45417 +* FlexBus Chip Selects (FBCS)
45419 +*********************************************************************/
45421 +/* Register read/write macros */
45422 +#define MCF_FBCS_CSAR0 MCF_REG32(0xFC008000) /* Chip-select Addr Register */
45423 +#define MCF_FBCS_CSMR0 MCF_REG32(0xFC008004) /* Chip-select Mask Register */
45424 +#define MCF_FBCS_CSCR0 MCF_REG32(0xFC008008) /* Chip-select Cntl Register */
45425 +#define MCF_FBCS_CSAR1 MCF_REG32(0xFC00800C) /* Chip-select Addr Register */
45426 +#define MCF_FBCS_CSMR1 MCF_REG32(0xFC008010) /* Chip-select Mask Register */
45427 +#define MCF_FBCS_CSCR1 MCF_REG32(0xFC008014) /* Chip-select Cntl Register */
45428 +#define MCF_FBCS_CSAR2 MCF_REG32(0xFC008018) /* Chip-select Addr Register */
45429 +#define MCF_FBCS_CSMR2 MCF_REG32(0xFC00801C) /* Chip-select Mask Register */
45430 +#define MCF_FBCS_CSCR2 MCF_REG32(0xFC008020) /* Chip-select Cntl Register */
45431 +#define MCF_FBCS_CSAR3 MCF_REG32(0xFC008024) /* Chip-select Addr Register */
45432 +#define MCF_FBCS_CSMR3 MCF_REG32(0xFC008028) /* Chip-select Mask Register */
45433 +#define MCF_FBCS_CSCR3 MCF_REG32(0xFC00802C) /* Chip-select Cntl Register */
45435 +/* Parameterized register read/write macros for multiple registers */
45436 +#define MCF_FBCS_CSAR(x) MCF_REG32(0xFC008000+((x)*0x00C)) /* Chip-select Addr Register */
45437 +#define MCF_FBCS_CSMR(x) MCF_REG32(0xFC008004+((x)*0x00C)) /* Chip-select Mask Register */
45438 +#define MCF_FBCS_CSCR(x) MCF_REG32(0xFC008008+((x)*0x00C)) /* Chip-select Cntl Register */
45440 +/* Bit definitions and macros for CSAR group */
45441 +#define MCF_FBCS_CSAR_BA(x) ((x)&0xFFFF0000)
45443 +/* Bit definitions and macros for CSAR0 */
45444 +#define MCF_FBCS_CSAR0_BA(x) ((x)&0xFFFF0000)
45446 +/* Bit definitions and macros for CSMR group */
45447 +#define MCF_FBCS_CSMR_V (0x00000001) /* Valid bit */
45448 +#define MCF_FBCS_CSMR_WP (0x00000100) /* Write protect */
45449 +#define MCF_FBCS_CSMR_BAM(x) (((x)&0x0000FFFF)<<16) /* Base addr mask */
45450 +#define MCF_FBCS_CSMR_BAM_4G (0xFFFF0000)
45451 +#define MCF_FBCS_CSMR_BAM_2G (0x7FFF0000)
45452 +#define MCF_FBCS_CSMR_BAM_1G (0x3FFF0000)
45453 +#define MCF_FBCS_CSMR_BAM_1024M (0x3FFF0000)
45454 +#define MCF_FBCS_CSMR_BAM_512M (0x1FFF0000)
45455 +#define MCF_FBCS_CSMR_BAM_256M (0x0FFF0000)
45456 +#define MCF_FBCS_CSMR_BAM_128M (0x07FF0000)
45457 +#define MCF_FBCS_CSMR_BAM_64M (0x03FF0000)
45458 +#define MCF_FBCS_CSMR_BAM_32M (0x01FF0000)
45459 +#define MCF_FBCS_CSMR_BAM_16M (0x00FF0000)
45460 +#define MCF_FBCS_CSMR_BAM_8M (0x007F0000)
45461 +#define MCF_FBCS_CSMR_BAM_4M (0x003F0000)
45462 +#define MCF_FBCS_CSMR_BAM_2M (0x001F0000)
45463 +#define MCF_FBCS_CSMR_BAM_1M (0x000F0000)
45464 +#define MCF_FBCS_CSMR_BAM_1024K (0x000F0000)
45465 +#define MCF_FBCS_CSMR_BAM_512K (0x00070000)
45466 +#define MCF_FBCS_CSMR_BAM_256K (0x00030000)
45467 +#define MCF_FBCS_CSMR_BAM_128K (0x00010000)
45468 +#define MCF_FBCS_CSMR_BAM_64K (0x00000000)
45470 +/* Bit definitions and macros for CSMR0 */
45471 +#define MCF_FBCS_CSMR0_V (0x00000001) /* Valid bit */
45472 +#define MCF_FBCS_CSMR0_WP (0x00000100) /* Write protect */
45473 +#define MCF_FBCS_CSMR0_BAM(x) (((x)&0x0000FFFF)<<16) /* Base addr mask */
45474 +#define MCF_FBCS_CSMR0_BAM_4G (0xFFFF0000)
45475 +#define MCF_FBCS_CSMR0_BAM_2G (0x7FFF0000)
45476 +#define MCF_FBCS_CSMR0_BAM_1G (0x3FFF0000)
45477 +#define MCF_FBCS_CSMR0_BAM_1024M (0x3FFF0000)
45478 +#define MCF_FBCS_CSMR0_BAM_512M (0x1FFF0000)
45479 +#define MCF_FBCS_CSMR0_BAM_256M (0x0FFF0000)
45480 +#define MCF_FBCS_CSMR0_BAM_128M (0x07FF0000)
45481 +#define MCF_FBCS_CSMR0_BAM_64M (0x03FF0000)
45482 +#define MCF_FBCS_CSMR0_BAM_32M (0x01FF0000)
45483 +#define MCF_FBCS_CSMR0_BAM_16M (0x00FF0000)
45484 +#define MCF_FBCS_CSMR0_BAM_8M (0x007F0000)
45485 +#define MCF_FBCS_CSMR0_BAM_4M (0x003F0000)
45486 +#define MCF_FBCS_CSMR0_BAM_2M (0x001F0000)
45487 +#define MCF_FBCS_CSMR0_BAM_1M (0x000F0000)
45488 +#define MCF_FBCS_CSMR0_BAM_1024K (0x000F0000)
45489 +#define MCF_FBCS_CSMR0_BAM_512K (0x00070000)
45490 +#define MCF_FBCS_CSMR0_BAM_256K (0x00030000)
45491 +#define MCF_FBCS_CSMR0_BAM_128K (0x00010000)
45492 +#define MCF_FBCS_CSMR0_BAM_64K (0x00000000)
45494 +/* Bit definitions and macros for CSCR group */
45495 +#define MCF_FBCS_CSCR_BSTW (0x00000008) /* Burst-write enable */
45496 +#define MCF_FBCS_CSCR_BSTR (0x00000010) /* Burst-read enable */
45497 +#define MCF_FBCS_CSCR_BEM (0x00000020) /* Byte-enable mode */
45498 +#define MCF_FBCS_CSCR_PS(x) (((x)&0x00000003)<<6) /* Port size */
45499 +#define MCF_FBCS_CSCR_AA (0x00000100) /* Auto-acknowledge */
45500 +#define MCF_FBCS_CSCR_WS(x) (((x)&0x0000003F)<<10) /* Wait states */
45501 +#define MCF_FBCS_CSCR_WRAH(x) (((x)&0x00000003)<<16) /* Write address hold or deselect */
45502 +#define MCF_FBCS_CSCR_RDAH(x) (((x)&0x00000003)<<18) /* Read address hold or deselect */
45503 +#define MCF_FBCS_CSCR_ASET(x) (((x)&0x00000003)<<20) /* Address setup */
45504 +#define MCF_FBCS_CSCR_SWSEN (0x00800000) /* Secondary wait state enable */
45505 +#define MCF_FBCS_CSCR_SWS(x) (((x)&0x0000003F)<<26) /* Secondary wait states */
45506 +#define MCF_FBCS_CSCR_PS_8 (0x00000040)
45507 +#define MCF_FBCS_CSCR_PS_16 (0x00000080)
45508 +#define MCF_FBCS_CSCR_PS_32 (0x00000000)
45510 +/* Bit definitions and macros for CSCR0 */
45511 +#define MCF_FBCS_CSCR0_BSTW (0x00000008) /* Burst-write enable */
45512 +#define MCF_FBCS_CSCR0_BSTR (0x00000010) /* Burst-read enable */
45513 +#define MCF_FBCS_CSCR0_BEM (0x00000020) /* Byte-enable mode */
45514 +#define MCF_FBCS_CSCR0_PS(x) (((x)&0x00000003)<<6) /* Port size */
45515 +#define MCF_FBCS_CSCR0_AA (0x00000100) /* Auto-acknowledge */
45516 +#define MCF_FBCS_CSCR0_WS(x) (((x)&0x0000003F)<<10) /* Wait states */
45517 +#define MCF_FBCS_CSCR0_WRAH(x) (((x)&0x00000003)<<16) /* Write address hold or deselect */
45518 +#define MCF_FBCS_CSCR0_RDAH(x) (((x)&0x00000003)<<18) /* Read address hold or deselect */
45519 +#define MCF_FBCS_CSCR0_ASET(x) (((x)&0x00000003)<<20) /* Address setup */
45520 +#define MCF_FBCS_CSCR0_SWSEN (0x00800000) /* Secondary wait state enable */
45521 +#define MCF_FBCS_CSCR0_SWS(x) (((x)&0x0000003F)<<26) /* Secondary wait states */
45522 +#define MCF_FBCS_CSCR0_PS_8 (0x00000040)
45523 +#define MCF_FBCS_CSCR0_PS_16 (0x00000080)
45524 +#define MCF_FBCS_CSCR0_PS_32 (0x00000000)
45526 +/* Bit definitions and macros for CSMR1 */
45527 +#define MCF_FBCS_CSMR1_V (0x00000001) /* Valid bit */
45528 +#define MCF_FBCS_CSMR1_WP (0x00000100) /* Write protect */
45529 +#define MCF_FBCS_CSMR1_BAM(x) (((x)&0x0000FFFF)<<16) /* Base address mask */
45531 +/* Bit definitions and macros for CSCR1 */
45532 +#define MCF_FBCS_CSCR1_BSTW (0x00000008) /* Burst-write enable */
45533 +#define MCF_FBCS_CSCR1_BSTR (0x00000010) /* Burst-read enable */
45534 +#define MCF_FBCS_CSCR1_BEM (0x00000020) /* Byte-enable mode */
45535 +#define MCF_FBCS_CSCR1_PS(x) (((x)&0x00000003)<<6) /* Port size */
45536 +#define MCF_FBCS_CSCR1_AA (0x00000100) /* Auto-acknowledge */
45537 +#define MCF_FBCS_CSCR1_WS(x) (((x)&0x0000003F)<<10) /* Wait states */
45538 +#define MCF_FBCS_CSCR1_WRAH(x) (((x)&0x00000003)<<16) /* Write address hold or deselect */
45539 +#define MCF_FBCS_CSCR1_RDAH(x) (((x)&0x00000003)<<18) /* Read address hold or deselect */
45540 +#define MCF_FBCS_CSCR1_ASET(x) (((x)&0x00000003)<<20) /* Address setup */
45541 +#define MCF_FBCS_CSCR1_SWSEN (0x00800000) /* Secondary wait state enable */
45542 +#define MCF_FBCS_CSCR1_SWS(x) (((x)&0x0000003F)<<26) /* Secondary wait states */
45544 +/* Bit definitions and macros for CSMR2 */
45545 +#define MCF_FBCS_CSMR2_V (0x00000001) /* Valid bit */
45546 +#define MCF_FBCS_CSMR2_WP (0x00000100) /* Write protect */
45547 +#define MCF_FBCS_CSMR2_BAM(x) (((x)&0x0000FFFF)<<16) /* Base address mask */
45549 +/* Bit definitions and macros for CSCR2 */
45550 +#define MCF_FBCS_CSCR2_BSTW (0x00000008) /* Burst-write enable */
45551 +#define MCF_FBCS_CSCR2_BSTR (0x00000010) /* Burst-read enable */
45552 +#define MCF_FBCS_CSCR2_BEM (0x00000020) /* Byte-enable mode */
45553 +#define MCF_FBCS_CSCR2_PS(x) (((x)&0x00000003)<<6) /* Port size */
45554 +#define MCF_FBCS_CSCR2_AA (0x00000100) /* Auto-acknowledge */
45555 +#define MCF_FBCS_CSCR2_WS(x) (((x)&0x0000003F)<<10) /* Wait states */
45556 +#define MCF_FBCS_CSCR2_WRAH(x) (((x)&0x00000003)<<16) /* Write address hold or deselect */
45557 +#define MCF_FBCS_CSCR2_RDAH(x) (((x)&0x00000003)<<18) /* Read address hold or deselect */
45558 +#define MCF_FBCS_CSCR2_ASET(x) (((x)&0x00000003)<<20) /* Address setup */
45559 +#define MCF_FBCS_CSCR2_SWSEN (0x00800000) /* Secondary wait state enable */
45560 +#define MCF_FBCS_CSCR2_SWS(x) (((x)&0x0000003F)<<26) /* Secondary wait states */
45562 +/* Bit definitions and macros for CSMR3 */
45563 +#define MCF_FBCS_CSMR3_V (0x00000001) /* Valid bit */
45564 +#define MCF_FBCS_CSMR3_WP (0x00000100) /* Write protect */
45565 +#define MCF_FBCS_CSMR3_BAM(x) (((x)&0x0000FFFF)<<16) /* Base address mask */
45567 +/* Bit definitions and macros for CSCR3 */
45568 +#define MCF_FBCS_CSCR3_BSTW (0x00000008) /* Burst-write enable */
45569 +#define MCF_FBCS_CSCR3_BSTR (0x00000010) /* Burst-read enable */
45570 +#define MCF_FBCS_CSCR3_BEM (0x00000020) /* Byte-enable mode */
45571 +#define MCF_FBCS_CSCR3_PS(x) (((x)&0x00000003)<<6) /* Port size */
45572 +#define MCF_FBCS_CSCR3_AA (0x00000100) /* Auto-acknowledge */
45573 +#define MCF_FBCS_CSCR3_WS(x) (((x)&0x0000003F)<<10) /* Wait states */
45574 +#define MCF_FBCS_CSCR3_WRAH(x) (((x)&0x00000003)<<16) /* Write address hold or deselect */
45575 +#define MCF_FBCS_CSCR3_RDAH(x) (((x)&0x00000003)<<18) /* Read address hold or deselect */
45576 +#define MCF_FBCS_CSCR3_ASET(x) (((x)&0x00000003)<<20) /* Address setup */
45577 +#define MCF_FBCS_CSCR3_SWSEN (0x00800000) /* Secondary wait state enable */
45578 +#define MCF_FBCS_CSCR3_SWS(x) (((x)&0x0000003F)<<26) /* Secondary wait states */
45580 +/********************************************************************/
45582 +#endif /* __MCF5445X_FBCS_H__ */
45584 +++ b/include/asm-m68k/mcf5445x_gpio.h
45587 + * Matt Waddel Matt.Waddel@freescale.com
45589 + * Copyright Freescale Semiconductor, Inc. 2007
45591 + * This program is free software; you can redistribute it and/or modify it
45592 + * under the terms of the GNU General Public License as published by the
45593 + * Free Software Foundation; either version 2 of the License, or (at your
45594 + * option) any later version.
45597 +#ifndef __MCF5445X_GPIO_H__
45598 +#define __MCF5445X_GPIO_H__
45600 +/*********************************************************************
45602 +* General Purpose I/O Module (GPIO)
45604 +*********************************************************************/
45606 +/* Register read/write macros */
45607 +#define MCF_GPIO_PODR_FEC0H MCF_REG08(0xFC0A4000) /* FEC0 High Port Output Data Register */
45608 +#define MCF_GPIO_PODR_FEC0L MCF_REG08(0xFC0A4001) /* FEC0 Low Port Output Data Register */
45609 +#define MCF_GPIO_PODR_SSI MCF_REG08(0xFC0A4002) /* SSI Port Output Data Register */
45610 +#define MCF_GPIO_PODR_FBCTL MCF_REG08(0xFC0A4003) /* Flexbus Control Port Output Data Register */
45611 +#define MCF_GPIO_PODR_BE MCF_REG08(0xFC0A4004) /* Flexbus Byte Enable Port Output Data Register */
45612 +#define MCF_GPIO_PODR_CS MCF_REG08(0xFC0A4005) /* Flexbus Chip-Select Port Output Data Register */
45613 +#define MCF_GPIO_PODR_DMA MCF_REG08(0xFC0A4006) /* DMA Port Output Data Register */
45614 +#define MCF_GPIO_PODR_FECI2C MCF_REG08(0xFC0A4007) /* FEC1 / I2C Port Output Data Register */
45615 +#define MCF_GPIO_PODR_UART MCF_REG08(0xFC0A4009) /* UART Port Output Data Register */
45616 +#define MCF_GPIO_PODR_DSPI MCF_REG08(0xFC0A400A) /* DSPI Port Output Data Register */
45617 +#define MCF_GPIO_PODR_TIMER MCF_REG08(0xFC0A400B) /* Timer Port Output Data Register */
45618 +#define MCF_GPIO_PODR_PCI MCF_REG08(0xFC0A400C) /* PCI Port Output Data Register */
45619 +#define MCF_GPIO_PODR_USB MCF_REG08(0xFC0A400D) /* USB Port Output Data Register */
45620 +#define MCF_GPIO_PODR_ATAH MCF_REG08(0xFC0A400E) /* ATA High Port Output Data Register */
45621 +#define MCF_GPIO_PODR_ATAL MCF_REG08(0xFC0A400F) /* ATA Low Port Output Data Register */
45622 +#define MCF_GPIO_PODR_FEC1H MCF_REG08(0xFC0A4010) /* FEC1 High Port Output Data Register */
45623 +#define MCF_GPIO_PODR_FEC1L MCF_REG08(0xFC0A4011) /* FEC1 Low Port Output Data Register */
45624 +#define MCF_GPIO_PODR_FBADH MCF_REG08(0xFC0A4014) /* Flexbus AD High Port Output Data Register */
45625 +#define MCF_GPIO_PODR_FBADMH MCF_REG08(0xFC0A4015) /* Flexbus AD Med-High Port Output Data Register */
45626 +#define MCF_GPIO_PODR_FBADML MCF_REG08(0xFC0A4016) /* Flexbus AD Med-Low Port Output Data Register */
45627 +#define MCF_GPIO_PODR_FBADL MCF_REG08(0xFC0A4017) /* Flexbus AD Low Port Output Data Register */
45628 +#define MCF_GPIO_PDDR_FEC0H MCF_REG08(0xFC0A4018) /* FEC0 High Port Data Direction Register */
45629 +#define MCF_GPIO_PDDR_FEC0L MCF_REG08(0xFC0A4019) /* FEC0 Low Port Data Direction Register */
45630 +#define MCF_GPIO_PDDR_SSI MCF_REG08(0xFC0A401A) /* SSI Port Data Direction Register */
45631 +#define MCF_GPIO_PDDR_FBCTL MCF_REG08(0xFC0A401B) /* Flexbus Control Port Data Direction Register */
45632 +#define MCF_GPIO_PDDR_BE MCF_REG08(0xFC0A401C) /* Flexbus Byte Enable Port Data Direction Register */
45633 +#define MCF_GPIO_PDDR_CS MCF_REG08(0xFC0A401D) /* Flexbus Chip-Select Port Data Direction Register */
45634 +#define MCF_GPIO_PDDR_DMA MCF_REG08(0xFC0A401E) /* DMA Port Data Direction Register */
45635 +#define MCF_GPIO_PDDR_FECI2C MCF_REG08(0xFC0A401F) /* FEC1 / I2C Port Data Direction Register */
45636 +#define MCF_GPIO_PDDR_UART MCF_REG08(0xFC0A4021) /* UART Port Data Direction Register */
45637 +#define MCF_GPIO_PDDR_DSPI MCF_REG08(0xFC0A4022) /* DSPI Port Data Direction Register */
45638 +#define MCF_GPIO_PDDR_TIMER MCF_REG08(0xFC0A4023) /* Timer Port Data Direction Register */
45639 +#define MCF_GPIO_PDDR_PCI MCF_REG08(0xFC0A4024) /* PCI Port Data Direction Register */
45640 +#define MCF_GPIO_PDDR_USB MCF_REG08(0xFC0A4025) /* USB Port Data Direction Register */
45641 +#define MCF_GPIO_PDDR_ATAH MCF_REG08(0xFC0A4026) /* ATA High Port Data Direction Register */
45642 +#define MCF_GPIO_PDDR_ATAL MCF_REG08(0xFC0A4027) /* ATA Low Port Data Direction Register */
45643 +#define MCF_GPIO_PDDR_FEC1H MCF_REG08(0xFC0A4028) /* FEC1 High Port Data Direction Register */
45644 +#define MCF_GPIO_PDDR_FEC1L MCF_REG08(0xFC0A4029) /* FEC1 Low Port Data Direction Register */
45645 +#define MCF_GPIO_PDDR_FBADH MCF_REG08(0xFC0A402C) /* Flexbus AD High Port Data Direction Register */
45646 +#define MCF_GPIO_PDDR_FBADMH MCF_REG08(0xFC0A402D) /* Flexbus AD Med-High Port Data Direction Register */
45647 +#define MCF_GPIO_PDDR_FBADML MCF_REG08(0xFC0A402E) /* Flexbus AD Med-Low Port Data Direction Register */
45648 +#define MCF_GPIO_PDDR_FBADL MCF_REG08(0xFC0A402F) /* Flexbus AD Low Port Data Direction Register */
45649 +#define MCF_GPIO_PPDSDR_FEC0H MCF_REG08(0xFC0A4030) /* FEC0 High Port Pin Data/Set Data Register */
45650 +#define MCF_GPIO_PPDSDR_FEC0L MCF_REG08(0xFC0A4031) /* FEC0 Low Port Clear Output Data Register */
45651 +#define MCF_GPIO_PPDSDR_SSI MCF_REG08(0xFC0A4032) /* SSI Port Pin Data/Set Data Register */
45652 +#define MCF_GPIO_PPDSDR_FBCTL MCF_REG08(0xFC0A4033) /* Flexbus Control Port Pin Data/Set Data Register */
45653 +#define MCF_GPIO_PPDSDR_BE MCF_REG08(0xFC0A4034) /* Flexbus Byte Enable Port Pin Data/Set Data Register */
45654 +#define MCF_GPIO_PPDSDR_CS MCF_REG08(0xFC0A4035) /* Flexbus Chip-Select Port Pin Data/Set Data Register */
45655 +#define MCF_GPIO_PPDSDR_DMA MCF_REG08(0xFC0A4036) /* DMA Port Pin Data/Set Data Register */
45656 +#define MCF_GPIO_PPDSDR_FECI2C MCF_REG08(0xFC0A4037) /* FEC1 / I2C Port Pin Data/Set Data Register */
45657 +#define MCF_GPIO_PPDSDR_UART MCF_REG08(0xFC0A4039) /* UART Port Pin Data/Set Data Register */
45658 +#define MCF_GPIO_PPDSDR_DSPI MCF_REG08(0xFC0A403A) /* DSPI Port Pin Data/Set Data Register */
45659 +#define MCF_GPIO_PPDSDR_TIMER MCF_REG08(0xFC0A403B) /* FTimer Port Pin Data/Set Data Register */
45660 +#define MCF_GPIO_PPDSDR_PCI MCF_REG08(0xFC0A403C) /* PCI Port Pin Data/Set Data Register */
45661 +#define MCF_GPIO_PPDSDR_USB MCF_REG08(0xFC0A403D) /* USB Port Pin Data/Set Data Register */
45662 +#define MCF_GPIO_PPDSDR_ATAH MCF_REG08(0xFC0A403E) /* ATA High Port Pin Data/Set Data Register */
45663 +#define MCF_GPIO_PPDSDR_ATAL MCF_REG08(0xFC0A403F) /* ATA Low Port Pin Data/Set Data Register */
45664 +#define MCF_GPIO_PPDSDR_FEC1H MCF_REG08(0xFC0A4040) /* FEC1 High Port Pin Data/Set Data Register */
45665 +#define MCF_GPIO_PPDSDR_FEC1L MCF_REG08(0xFC0A4041) /* FEC1 Low Port Pin Data/Set Data Register */
45666 +#define MCF_GPIO_PPDSDR_FBADH MCF_REG08(0xFC0A4044) /* Flexbus AD High Port Pin Data/Set Data Register */
45667 +#define MCF_GPIO_PPDSDR_FBADMH MCF_REG08(0xFC0A4045) /* Flexbus AD Med-High Port Pin Data/Set Data Register */
45668 +#define MCF_GPIO_PPDSDR_FBADML MCF_REG08(0xFC0A4046) /* Flexbus AD Med-Low Port Pin Data/Set Data Register */
45669 +#define MCF_GPIO_PPDSDR_FBADL MCF_REG08(0xFC0A4047) /* Flexbus AD Low Port Pin Data/Set Data Register */
45670 +#define MCF_GPIO_PCLRR_FEC0H MCF_REG08(0xFC0A4048) /* FEC0 High Port Clear Output Data Register */
45671 +#define MCF_GPIO_PCLRR_FEC0L MCF_REG08(0xFC0A4049) /* FEC0 Low Port Pin Data/Set Data Register */
45672 +#define MCF_GPIO_PCLRR_SSI MCF_REG08(0xFC0A404A) /* SSI Port Clear Output Data Register */
45673 +#define MCF_GPIO_PCLRR_FBCTL MCF_REG08(0xFC0A404B) /* Flexbus Control Port Clear Output Data Register */
45674 +#define MCF_GPIO_PCLRR_BE MCF_REG08(0xFC0A404C) /* Flexbus Byte Enable Port Clear Output Data Register */
45675 +#define MCF_GPIO_PCLRR_CS MCF_REG08(0xFC0A404D) /* Flexbus Chip-Select Port Clear Output Data Register */
45676 +#define MCF_GPIO_PCLRR_DMA MCF_REG08(0xFC0A404E) /* DMA Port Clear Output Data Register */
45677 +#define MCF_GPIO_PCLRR_FECI2C MCF_REG08(0xFC0A404F) /* FEC1 / I2C Port Clear Output Data Register */
45678 +#define MCF_GPIO_PCLRR_UART MCF_REG08(0xFC0A4051) /* UART Port Clear Output Data Register */
45679 +#define MCF_GPIO_PCLRR_DSPI MCF_REG08(0xFC0A4052) /* DSPI Port Clear Output Data Register */
45680 +#define MCF_GPIO_PCLRR_TIMER MCF_REG08(0xFC0A4053) /* Timer Port Clear Output Data Register */
45681 +#define MCF_GPIO_PCLRR_PCI MCF_REG08(0xFC0A4054) /* PCI Port Clear Output Data Register */
45682 +#define MCF_GPIO_PCLRR_USB MCF_REG08(0xFC0A4055) /* USB Port Clear Output Data Register */
45683 +#define MCF_GPIO_PCLRR_ATAH MCF_REG08(0xFC0A4056) /* ATA High Port Clear Output Data Register */
45684 +#define MCF_GPIO_PCLRR_ATAL MCF_REG08(0xFC0A4057) /* ATA Low Port Clear Output Data Register */
45685 +#define MCF_GPIO_PCLRR_FEC1H MCF_REG08(0xFC0A4058) /* FEC1 High Port Clear Output Data Register */
45686 +#define MCF_GPIO_PCLRR_FEC1L MCF_REG08(0xFC0A4059) /* FEC1 Low Port Clear Output Data Register */
45687 +#define MCF_GPIO_PCLRR_FBADH MCF_REG08(0xFC0A405C) /* Flexbus AD High Port Clear Output Data Register */
45688 +#define MCF_GPIO_PCLRR_FBADMH MCF_REG08(0xFC0A405D) /* Flexbus AD Med-High Port Clear Output Data Register */
45689 +#define MCF_GPIO_PCLRR_FBADML MCF_REG08(0xFC0A405E) /* Flexbus AD Med-Low Port Clear Output Data Register */
45690 +#define MCF_GPIO_PCLRR_FBADL MCF_REG08(0xFC0A405F) /* Flexbus AD Low Port Clear Output Data Register */
45691 +#define MCF_GPIO_PAR_FEC MCF_REG08(0xFC0A4060) /* FEC Pin Assignment Register */
45692 +#define MCF_GPIO_PAR_DMA MCF_REG08(0xFC0A4061) /* DMA Pin Assignment Register */
45693 +#define MCF_GPIO_PAR_FBCTL MCF_REG08(0xFC0A4062) /* Flexbus Control Pin Assignment Register */
45694 +#define MCF_GPIO_PAR_DSPI MCF_REG08(0xFC0A4063) /* DSPI Pin Assignment Register */
45695 +#define MCF_GPIO_PAR_BE MCF_REG08(0xFC0A4064) /* Flexbus Byte-Enable Pin Assignment Register */
45696 +#define MCF_GPIO_PAR_CS MCF_REG08(0xFC0A4065) /* Flexbus Chip-Select Pin Assignment Register */
45697 +#define MCF_GPIO_PAR_TIMER MCF_REG08(0xFC0A4066) /* Time Pin Assignment Register */
45698 +#define MCF_GPIO_PAR_USB MCF_REG08(0xFC0A4067) /* USB Pin Assignment Register */
45699 +#define MCF_GPIO_PAR_UART MCF_REG08(0xFC0A4069) /* UART Pin Assignment Register */
45700 +#define MCF_GPIO_PAR_FECI2C MCF_REG16(0xFC0A406A) /* FEC / I2C Pin Assignment Register */
45701 +#define MCF_GPIO_PAR_SSI MCF_REG16(0xFC0A406C) /* SSI Pin Assignment Register */
45702 +#define MCF_GPIO_PAR_ATA MCF_REG16(0xFC0A406E) /* ATA Pin Assignment Register */
45703 +#define MCF_GPIO_PAR_IRQ MCF_REG08(0xFC0A4070) /* IRQ Pin Assignment Register */
45704 +#define MCF_GPIO_PAR_PCI MCF_REG16(0xFC0A4072) /* PCI Pin Assignment Register */
45705 +#define MCF_GPIO_MSCR_SDRAM MCF_REG08(0xFC0A4074) /* SDRAM Mode Select Control Register */
45706 +#define MCF_GPIO_MSCR_PCI MCF_REG08(0xFC0A4075) /* PCI Mode Select Control Register */
45707 +#define MCF_GPIO_DSCR_I2C MCF_REG08(0xFC0A4078) /* I2C Drive Strength Control Register */
45708 +#define MCF_GPIO_DSCR_FLEXBUS MCF_REG08(0xFC0A4079) /* FLEXBUS Drive Strength Control Register */
45709 +#define MCF_GPIO_DSCR_FEC MCF_REG08(0xFC0A407A) /* FEC Drive Strength Control Register */
45710 +#define MCF_GPIO_DSCR_UART MCF_REG08(0xFC0A407B) /* UART Drive Strength Control Register */
45711 +#define MCF_GPIO_DSCR_DSPI MCF_REG08(0xFC0A407C) /* DSPI Drive Strength Control Register */
45712 +#define MCF_GPIO_DSCR_TIMER MCF_REG08(0xFC0A407D) /* TIMER Drive Strength Control Register */
45713 +#define MCF_GPIO_DSCR_SSI MCF_REG08(0xFC0A407E) /* SSI Drive Strength Control Register */
45714 +#define MCF_GPIO_DSCR_DMA MCF_REG08(0xFC0A407F) /* DMA Drive Strength Control Register */
45715 +#define MCF_GPIO_DSCR_DEBUG MCF_REG08(0xFC0A4080) /* DEBUG Drive Strength Control Register */
45716 +#define MCF_GPIO_DSCR_RESET MCF_REG08(0xFC0A4081) /* RESET Drive Strength Control Register */
45717 +#define MCF_GPIO_DSCR_IRQ MCF_REG08(0xFC0A4082) /* IRQ Drive Strength Control Register */
45718 +#define MCF_GPIO_DSCR_USB MCF_REG08(0xFC0A4083) /* USB Drive Strength Control Register */
45719 +#define MCF_GPIO_DSCR_ATA MCF_REG08(0xFC0A4084) /* ATA Drive Strength Control Register */
45721 +/* Bit definitions and macros for PODR_FEC0H */
45722 +#define MCF_GPIO_PODR_FEC0H_PODR0 (0x01) /* FEC0_CRS / ULPI_DATA6 */
45723 +#define MCF_GPIO_PODR_FEC0H_PODR1 (0x02) /* FEC0_RXD0 / FEC0_RMII_RXD0 */
45724 +#define MCF_GPIO_PODR_FEC0H_PODR2 (0x04) /* FEC0_RXDV/FEC0_RMII_CRS_DV */
45725 +#define MCF_GPIO_PODR_FEC0H_PODR3 (0x08) /* FEC0_RXCLK / ULPI_DATA1 */
45726 +#define MCF_GPIO_PODR_FEC0H_PODR4 (0x10) /* FEC0_COL / ULPI_DATA7 */
45727 +#define MCF_GPIO_PODR_FEC0H_PODR5 (0x20) /* FEC0_TXD0 / FEC0_RMII_TXD0 */
45728 +#define MCF_GPIO_PODR_FEC0H_PODR6 (0x40) /* FEC0_TXEN / FEC0_RMII_TXEN */
45729 +#define MCF_GPIO_PODR_FEC0H_PODR7 (0x80) /* FEC0_TXCLK / FEC0_RMII_REF_CLK */
45731 +/* Bit definitions and macros for PODR_FEC0L */
45732 +#define MCF_GPIO_PODR_FEC0L_PODR0 (0x01) /* FEC0_RXER / FEC0_RMII_RXER */
45733 +#define MCF_GPIO_PODR_FEC0L_PODR1 (0x02) /* FEC0_RXD1 / FEC0_RMII_RXD1 */
45734 +#define MCF_GPIO_PODR_FEC0L_PODR2 (0x04) /* FEC0_RXD2 / ULPI_DATA4 */
45735 +#define MCF_GPIO_PODR_FEC0L_PODR3 (0x08) /* FEC0_RXD3 / ULPI_DATA5 */
45736 +#define MCF_GPIO_PODR_FEC0L_PODR4 (0x10) /* FEC0_TXER / ULPI_DATA0 */
45737 +#define MCF_GPIO_PODR_FEC0L_PODR5 (0x20) /* FEC0_TXD1 / FEC0_RMII_TXD1 */
45738 +#define MCF_GPIO_PODR_FEC0L_PODR6 (0x40) /* FEC0_TXD2 / ULPI_DATA2 */
45739 +#define MCF_GPIO_PODR_FEC0L_PODR7 (0x80) /* FEC0_TXD3 / ULPI_DATA3 */
45741 +/* Bit definitions and macros for PODR_SSI */
45742 +#define MCF_GPIO_PODR_SSI_PODR0 (0x01) /* SSI_TXD / U1TXD */
45743 +#define MCF_GPIO_PODR_SSI_PODR1 (0x02) /* SSI_RXD / U1RXD */
45744 +#define MCF_GPIO_PODR_SSI_PODR2 (0x04) /* SSI_FS / U1RTS */
45745 +#define MCF_GPIO_PODR_SSI_PODR3 (0x08) /* SSI_BCLK / U1CTS */
45746 +#define MCF_GPIO_PODR_SSI_PODR4 (0x10) /* SSI_MCLK */
45748 +/* Bit definitions and macros for PODR_FBCTL */
45749 +#define MCF_GPIO_PODR_FBCTL_PODR0 (0x01) /* FB_TS / FB_ALE / FB_TBST */
45750 +#define MCF_GPIO_PODR_FBCTL_PODR1 (0x02) /* FB_RW */
45751 +#define MCF_GPIO_PODR_FBCTL_PODR2 (0x04) /* FB_TA */
45752 +#define MCF_GPIO_PODR_FBCTL_PODR3 (0x08) /* FB_OE */
45754 +/* Bit definitions and macros for PODR_BE */
45755 +#define MCF_GPIO_PODR_BE_PODR0 (0x01) /* FB_BE/BWE0 / FB_SIZ0 */
45756 +#define MCF_GPIO_PODR_BE_PODR1 (0x02) /* FB_BE/BWE1 / FB_SIZ1 */
45757 +#define MCF_GPIO_PODR_BE_PODR2 (0x04) /* FB_BE/BWE2 / FB_SIZ2 */
45758 +#define MCF_GPIO_PODR_BE_PODR3 (0x08) /* FB_BE/BWE3 / FB_SIZ3 */
45760 +/* Bit definitions and macros for PODR_CS */
45761 +#define MCF_GPIO_PODR_CS_PODR1 (0x02) /* FB_CS1 */
45762 +#define MCF_GPIO_PODR_CS_PODR2 (0x04) /* FB_CS2 */
45763 +#define MCF_GPIO_PODR_CS_PODR3 (0x08) /* FB_CS3 */
45765 +/* Bit definitions and macros for PODR_DMA */
45766 +#define MCF_GPIO_PODR_DMA_PODR0 (0x01) /* DREQ0 */
45767 +#define MCF_GPIO_PODR_DMA_PODR1 (0x02) /* DACK0 / DSPI_PCS3 */
45768 +#define MCF_GPIO_PODR_DMA_PODR2 (0x04) /* DREQ1 / USB_CLKIN */
45769 +#define MCF_GPIO_PODR_DMA_PODR3 (0x08) /* DACK1 / ULPI_DIR */
45771 +/* Bit definitions and macros for PODR_FECI2C */
45772 +#define MCF_GPIO_PODR_FECI2C_PODR0 (0x01) /* I2C_SDA / U2RXD */
45773 +#define MCF_GPIO_PODR_FECI2C_PODR1 (0x02) /* I2C_SCL / U2TXD */
45774 +#define MCF_GPIO_PODR_FECI2C_PODR2 (0x04) /* FEC0_MDIO */
45775 +#define MCF_GPIO_PODR_FECI2C_PODR3 (0x08) /* FEC0_MDC */
45776 +#define MCF_GPIO_PODR_FECI2C_PODR4 (0x10) /* FEC1_MDIO / ATA_DIOW */
45777 +#define MCF_GPIO_PODR_FECI2C_PODR5 (0x20) /* FEC1_MDC / ATA_DIOR */
45779 +/* Bit definitions and macros for PODR_UART */
45780 +#define MCF_GPIO_PODR_UART_PODR0 (0x01) /* U1TXD */
45781 +#define MCF_GPIO_PODR_UART_PODR1 (0x02) /* U1RXD */
45782 +#define MCF_GPIO_PODR_UART_PODR2 (0x04) /* U1RTS */
45783 +#define MCF_GPIO_PODR_UART_PODR3 (0x08) /* U0CTS */
45784 +#define MCF_GPIO_PODR_UART_PODR4 (0x10) /* U1TXD */
45785 +#define MCF_GPIO_PODR_UART_PODR5 (0x20) /* U1RXD */
45786 +#define MCF_GPIO_PODR_UART_PODR6 (0x40) /* U1RTS */
45787 +#define MCF_GPIO_PODR_UART_PODR7 (0x80) /* U1CTS */
45789 +/* Bit definitions and macros for PODR_DSPI */
45790 +#define MCF_GPIO_PODR_DSPI_PODR0 (0x01) /* DSPI_SOUT / SBF_DO */
45791 +#define MCF_GPIO_PODR_DSPI_PODR1 (0x02) /* DSPI_SIN / SBF_DI */
45792 +#define MCF_GPIO_PODR_DSPI_PODR2 (0x04) /* DSPI_SCK / SBF_CK */
45793 +#define MCF_GPIO_PODR_DSPI_PODR3 (0x08) /* DSPI_PCS0/SS */
45794 +#define MCF_GPIO_PODR_DSPI_PODR4 (0x10) /* DSPI_PCS1 / SBF_CS */
45795 +#define MCF_GPIO_PODR_DSPI_PODR5 (0x20) /* DSPI_PCS2 */
45796 +#define MCF_GPIO_PODR_DSPI_PODR6 (0x40) /* DSPI_PCS5/SS */
45798 +/* Bit definitions and macros for PODR_TIMER */
45799 +#define MCF_GPIO_PODR_TIMER_PODR0 (0x01) /* T0IN / T0OUT / U2RTS */
45800 +#define MCF_GPIO_PODR_TIMER_PODR1 (0x02) /* T1IN / T1OUT / U2CTS */
45801 +#define MCF_GPIO_PODR_TIMER_PODR2 (0x04) /* T2IN / T2OUT / U2TXD */
45802 +#define MCF_GPIO_PODR_TIMER_PODR3 (0x08) /* T3IN / T3OUT / U2RXD */
45804 +/* Bit definitions and macros for PODR_PCI */
45805 +#define MCF_GPIO_PODR_PCI_PODR0 (0x01) /* PCI_REQ0/PCI_EXTGNT */
45806 +#define MCF_GPIO_PODR_PCI_PODR1 (0x02) /* PCI_REQ1 */
45807 +#define MCF_GPIO_PODR_PCI_PODR2 (0x04) /* PCI_REQ2 */
45808 +#define MCF_GPIO_PODR_PCI_PODR3 (0x08) /* PCI_REQ3 / ATA_INTR */
45809 +#define MCF_GPIO_PODR_PCI_PODR4 (0x10) /* PCI_GNT0/PCI_EXTREQ */
45810 +#define MCF_GPIO_PODR_PCI_PODR5 (0x20) /* PCI_GNT1 / */
45811 +#define MCF_GPIO_PODR_PCI_PODR6 (0x40) /* PCI_GNT2 / */
45812 +#define MCF_GPIO_PODR_PCI_PODR7 (0x80) /* PCI_GNT3 / ATA_DMACK */
45814 +/* Bit definitions and macros for PODR_USB */
45815 +#define MCF_GPIO_PODR_USB_PODR0 (0x01) /* USB_VBUS_OC / ULPI_STP */
45816 +#define MCF_GPIO_PODR_USB_PODR1 (0x02) /* USB_VBUS_EN / USB_PULLUP / ULPI_NXT */
45818 +/* Bit definitions and macros for PODR_ATAH */
45819 +#define MCF_GPIO_PODR_ATAH_PODR0 (0x01) /* ATA_DA0 */
45820 +#define MCF_GPIO_PODR_ATAH_PODR1 (0x02) /* ATA_DA1 */
45821 +#define MCF_GPIO_PODR_ATAH_PODR2 (0x04) /* ATA_DA2 */
45822 +#define MCF_GPIO_PODR_ATAH_PODR3 (0x08) /* ATA_CS0 */
45823 +#define MCF_GPIO_PODR_ATAH_PODR4 (0x10) /* ATA_CS1 */
45824 +#define MCF_GPIO_PODR_ATAH_PODR5 (0x20) /* ATA_BUFFER_EN */
45826 +/* Bit definitions and macros for PODR_ATAL */
45827 +#define MCF_GPIO_PODR_ATAL_PODR0 (0x01) /* ATA_IORDY */
45828 +#define MCF_GPIO_PODR_ATAL_PODR1 (0x02) /* ATA_DMARQ */
45829 +#define MCF_GPIO_PODR_ATAL_PODR2 (0x04) /* ATA_RESET */
45831 +/* Bit definitions and macros for PODR_FEC1H */
45832 +#define MCF_GPIO_PODR_FEC1H_PODR0 (0x01) /* FEC1_CRS / ATA_DATA6 */
45833 +#define MCF_GPIO_PODR_FEC1H_PODR1 (0x02) /* FEC1_RXD0 / FEC1_RMII_RXD0 / ATA_DATA13 */
45834 +#define MCF_GPIO_PODR_FEC1H_PODR2 (0x04) /* FEC1_RXDV / FEC1_RMII_CRS_DV / ATA_DATA15 */
45835 +#define MCF_GPIO_PODR_FEC1H_PODR3 (0x08) /* FEC1_RXCLK / ATA_DATA5 */
45836 +#define MCF_GPIO_PODR_FEC1H_PODR4 (0x10) /* FEC1_COL / ATA_DATA7 */
45837 +#define MCF_GPIO_PODR_FEC1H_PODR5 (0x20) /* FEC1_TXD0 / FEC1_RMII_TXD0 / ATA_DATA9 */
45838 +#define MCF_GPIO_PODR_FEC1H_PODR6 (0x40) /* FEC1_TXEN / FEC1_RMII_TXEN / ATA_DATA8 */
45839 +#define MCF_GPIO_PODR_FEC1H_PODR7 (0x80) /* FEC1_TXCLK / FEC1_RMII_REF_CLK / ATA_DATA11 */
45841 +/* Bit definitions and macros for PODR_FEC1L */
45842 +#define MCF_GPIO_PODR_FEC1L_PODR0 (0x01) /* FEC1_RXER / FEC1_RMII_RXER / ATA_DATA12 */
45843 +#define MCF_GPIO_PODR_FEC1L_PODR1 (0x02) /* FEC1_RXD1 / FEC1_RMII_RXD1 / ATA_DATA14 */
45844 +#define MCF_GPIO_PODR_FEC1L_PODR2 (0x04) /* FEC1_RXD2 / ATA_DATA3 */
45845 +#define MCF_GPIO_PODR_FEC1L_PODR3 (0x08) /* FEC1_RXD3 / ATA_DATA4 */
45846 +#define MCF_GPIO_PODR_FEC1L_PODR4 (0x10) /* FEC1_TXER / ATA_DATA0 */
45847 +#define MCF_GPIO_PODR_FEC1L_PODR5 (0x20) /* FEC1_TXD1 / FEC1_RMII_TXD1 / ATA_DATA10 */
45848 +#define MCF_GPIO_PODR_FEC1L_PODR6 (0x40) /* FEC1_TXD2 / ATA_DATA1 */
45849 +#define MCF_GPIO_PODR_FEC1L_PODR7 (0x80) /* FEC1_TXD3 / ATA_DATA2 */
45851 +/* Bit definitions and macros for PODR_FBADH */
45852 +#define MCF_GPIO_PODR_FBADH_PODR0 (0x01) /* FB_AD24 */
45853 +#define MCF_GPIO_PODR_FBADH_PODR1 (0x02) /* FB_AD25 */
45854 +#define MCF_GPIO_PODR_FBADH_PODR2 (0x04) /* FB_AD26 */
45855 +#define MCF_GPIO_PODR_FBADH_PODR3 (0x08) /* FB_AD27 */
45856 +#define MCF_GPIO_PODR_FBADH_PODR4 (0x10) /* FB_AD28 */
45857 +#define MCF_GPIO_PODR_FBADH_PODR5 (0x20) /* FB_AD29 */
45858 +#define MCF_GPIO_PODR_FBADH_PODR6 (0x40) /* FB_AD30 */
45859 +#define MCF_GPIO_PODR_FBADH_PODR7 (0x80) /* FB_AD31 */
45861 +/* Bit definitions and macros for PODR_FBADMH */
45862 +#define MCF_GPIO_PODR_FBADMH_PODR0 (0x01) /* FB_AD16 */
45863 +#define MCF_GPIO_PODR_FBADMH_PODR1 (0x02) /* FB_AD17 */
45864 +#define MCF_GPIO_PODR_FBADMH_PODR2 (0x04) /* FB_AD18 */
45865 +#define MCF_GPIO_PODR_FBADMH_PODR3 (0x08) /* FB_AD19 */
45866 +#define MCF_GPIO_PODR_FBADMH_PODR4 (0x10) /* FB_AD20 */
45867 +#define MCF_GPIO_PODR_FBADMH_PODR5 (0x20) /* FB_AD21 */
45868 +#define MCF_GPIO_PODR_FBADMH_PODR6 (0x40) /* FB_AD22 */
45869 +#define MCF_GPIO_PODR_FBADMH_PODR7 (0x80) /* FB_AD23 */
45871 +/* Bit definitions and macros for PODR_FBADML */
45872 +#define MCF_GPIO_PODR_FBADML_PODR0 (0x01) /* FB_AD8 */
45873 +#define MCF_GPIO_PODR_FBADML_PODR1 (0x02) /* FB_AD9 */
45874 +#define MCF_GPIO_PODR_FBADML_PODR2 (0x04) /* FB_AD10 */
45875 +#define MCF_GPIO_PODR_FBADML_PODR3 (0x08) /* FB_AD11 */
45876 +#define MCF_GPIO_PODR_FBADML_PODR4 (0x10) /* FB_AD12 */
45877 +#define MCF_GPIO_PODR_FBADML_PODR5 (0x20) /* FB_AD13 */
45878 +#define MCF_GPIO_PODR_FBADML_PODR6 (0x40) /* FB_AD14 */
45879 +#define MCF_GPIO_PODR_FBADML_PODR7 (0x80) /* FB_AD15 */
45881 +/* Bit definitions and macros for PODR_FBADL */
45882 +#define MCF_GPIO_PODR_FBADL_PODR0 (0x01) /* FB_AD0 */
45883 +#define MCF_GPIO_PODR_FBADL_PODR1 (0x02) /* FB_AD1 */
45884 +#define MCF_GPIO_PODR_FBADL_PODR2 (0x04) /* FB_AD2 */
45885 +#define MCF_GPIO_PODR_FBADL_PODR3 (0x08) /* FB_AD3 */
45886 +#define MCF_GPIO_PODR_FBADL_PODR4 (0x10) /* FB_AD4 */
45887 +#define MCF_GPIO_PODR_FBADL_PODR5 (0x20) /* FB_AD5 */
45888 +#define MCF_GPIO_PODR_FBADL_PODR6 (0x40) /* FB_AD6 */
45889 +#define MCF_GPIO_PODR_FBADL_PODR7 (0x80) /* FB_AD7 */
45891 +/* Bit definitions and macros for PDDR_FEC0H */
45892 +#define MCF_GPIO_PDDR_FEC0H_PDDR0 (0x01) /* FEC0_CRS / ULPI_DATA6 */
45893 +#define MCF_GPIO_PDDR_FEC0H_PDDR1 (0x02) /* FEC0_RXD0 / FEC0_RMII_RXD0 */
45894 +#define MCF_GPIO_PDDR_FEC0H_PDDR2 (0x04) /* FEC0_RXDV/FEC0_RMII_CRS_DV */
45895 +#define MCF_GPIO_PDDR_FEC0H_PDDR3 (0x08) /* FEC0_RXCLK / ULPI_DATA1 */
45896 +#define MCF_GPIO_PDDR_FEC0H_PDDR4 (0x10) /* FEC0_COL / ULPI_DATA7 */
45897 +#define MCF_GPIO_PDDR_FEC0H_PDDR5 (0x20) /* FEC0_TXD0 / FEC0_RMII_TXD0 */
45898 +#define MCF_GPIO_PDDR_FEC0H_PDDR6 (0x40) /* FEC0_TXEN / FEC0_RMII_TXEN */
45899 +#define MCF_GPIO_PDDR_FEC0H_PDDR7 (0x80) /* FEC0_TXCLK / FEC0_RMII_REF_CLK */
45901 +/* Bit definitions and macros for PDDR_FEC0L */
45902 +#define MCF_GPIO_PDDR_FEC0L_PDDR0 (0x01) /* FEC0_RXER / FEC0_RMII_RXER */
45903 +#define MCF_GPIO_PDDR_FEC0L_PDDR1 (0x02) /* FEC0_RXD1 / FEC0_RMII_RXD1 */
45904 +#define MCF_GPIO_PDDR_FEC0L_PDDR2 (0x04) /* FEC0_RXD2 / ULPI_DATA4 */
45905 +#define MCF_GPIO_PDDR_FEC0L_PDDR3 (0x08) /* FEC0_RXD3 / ULPI_DATA5 */
45906 +#define MCF_GPIO_PDDR_FEC0L_PDDR4 (0x10) /* FEC0_TXER / ULPI_DATA0 */
45907 +#define MCF_GPIO_PDDR_FEC0L_PDDR5 (0x20) /* FEC0_TXD1 / FEC0_RMII_TXD1 */
45908 +#define MCF_GPIO_PDDR_FEC0L_PDDR6 (0x40) /* FEC0_TXD2 / ULPI_DATA2 */
45909 +#define MCF_GPIO_PDDR_FEC0L_PDDR7 (0x80) /* FEC0_TXD3 / ULPI_DATA3 */
45911 +/* Bit definitions and macros for PDDR_SSI */
45912 +#define MCF_GPIO_PDDR_SSI_PDDR0 (0x01) /* SSI_TXD / U1TXD */
45913 +#define MCF_GPIO_PDDR_SSI_PDDR1 (0x02) /* SSI_RXD / U1RXD */
45914 +#define MCF_GPIO_PDDR_SSI_PDDR2 (0x04) /* SSI_FS / U1RTS */
45915 +#define MCF_GPIO_PDDR_SSI_PDDR3 (0x08) /* SSI_BCLK / U1CTS */
45916 +#define MCF_GPIO_PDDR_SSI_PDDR4 (0x10) /* SSI_MCLK */
45918 +/* Bit definitions and macros for PDDR_FBCTL */
45919 +#define MCF_GPIO_PDDR_FBCTL_PDDR0 (0x01) /* FB_TS / FB_ALE / FB_TBST */
45920 +#define MCF_GPIO_PDDR_FBCTL_PDDR1 (0x02) /* FB_RW */
45921 +#define MCF_GPIO_PDDR_FBCTL_PDDR2 (0x04) /* FB_TA */
45922 +#define MCF_GPIO_PDDR_FBCTL_PDDR3 (0x08) /* FB_OE */
45924 +/* Bit definitions and macros for PDDR_BE */
45925 +#define MCF_GPIO_PDDR_BE_PDDR0 (0x01) /* FB_BE/BWE0 / FB_SIZ0 */
45926 +#define MCF_GPIO_PDDR_BE_PDDR1 (0x02) /* FB_BE/BWE1 / FB_SIZ1 */
45927 +#define MCF_GPIO_PDDR_BE_PDDR2 (0x04) /* FB_BE/BWE2 / FB_SIZ2 */
45928 +#define MCF_GPIO_PDDR_BE_PDDR3 (0x08) /* FB_BE/BWE3 / FB_SIZ3 */
45930 +/* Bit definitions and macros for PDDR_CS */
45931 +#define MCF_GPIO_PDDR_CS_PDDR1 (0x02) /* FB_CS1 */
45932 +#define MCF_GPIO_PDDR_CS_PDDR2 (0x04) /* FB_CS2 */
45933 +#define MCF_GPIO_PDDR_CS_PDDR3 (0x08) /* FB_CS3 */
45935 +/* Bit definitions and macros for PDDR_DMA */
45936 +#define MCF_GPIO_PDDR_DMA_PDDR0 (0x01) /* DREQ0 */
45937 +#define MCF_GPIO_PDDR_DMA_PDDR1 (0x02) /* DACK0 / DSPI_PCS3 */
45938 +#define MCF_GPIO_PDDR_DMA_PDDR2 (0x04) /* DREQ1 / USB_CLKIN */
45939 +#define MCF_GPIO_PDDR_DMA_PDDR3 (0x08) /* DACK1 / ULPI_DIR */
45941 +/* Bit definitions and macros for PDDR_FECI2C */
45942 +#define MCF_GPIO_PDDR_FECI2C_PDDR0 (0x01) /* I2C_SDA / U2RXD */
45943 +#define MCF_GPIO_PDDR_FECI2C_PDDR1 (0x02) /* I2C_SCL / U2TXD */
45944 +#define MCF_GPIO_PDDR_FECI2C_PDDR2 (0x04) /* FEC0_MDIO */
45945 +#define MCF_GPIO_PDDR_FECI2C_PDDR3 (0x08) /* FEC0_MDC */
45946 +#define MCF_GPIO_PDDR_FECI2C_PDDR4 (0x10) /* FEC1_MDIO / ATA_DIOW */
45947 +#define MCF_GPIO_PDDR_FECI2C_PDDR5 (0x20) /* FEC1_MDC / ATA_DIOR */
45949 +/* Bit definitions and macros for PDDR_UART */
45950 +#define MCF_GPIO_PDDR_UART_PDDR0 (0x01) /* U1TXD */
45951 +#define MCF_GPIO_PDDR_UART_PDDR1 (0x02) /* U1RXD */
45952 +#define MCF_GPIO_PDDR_UART_PDDR2 (0x04) /* U1RTS */
45953 +#define MCF_GPIO_PDDR_UART_PDDR3 (0x08) /* U0CTS */
45954 +#define MCF_GPIO_PDDR_UART_PDDR4 (0x10) /* U1TXD */
45955 +#define MCF_GPIO_PDDR_UART_PDDR5 (0x20) /* U1RXD */
45956 +#define MCF_GPIO_PDDR_UART_PDDR6 (0x40) /* U1RTS */
45957 +#define MCF_GPIO_PDDR_UART_PDDR7 (0x80) /* U1CTS */
45959 +/* Bit definitions and macros for PDDR_DSPI */
45960 +#define MCF_GPIO_PDDR_DSPI_PDDR0 (0x01) /* DSPI_SOUT / SBF_DO */
45961 +#define MCF_GPIO_PDDR_DSPI_PDDR1 (0x02) /* DSPI_SIN / SBF_DI */
45962 +#define MCF_GPIO_PDDR_DSPI_PDDR2 (0x04) /* DSPI_SCK / SBF_CK */
45963 +#define MCF_GPIO_PDDR_DSPI_PDDR3 (0x08) /* DSPI_PCS0/SS */
45964 +#define MCF_GPIO_PDDR_DSPI_PDDR4 (0x10) /* DSPI_PCS1 / SBF_CS */
45965 +#define MCF_GPIO_PDDR_DSPI_PDDR5 (0x20) /* DSPI_PCS2 */
45966 +#define MCF_GPIO_PDDR_DSPI_PDDR6 (0x40) /* DSPI_PCS5/SS */
45968 +/* Bit definitions and macros for PDDR_TIMER */
45969 +#define MCF_GPIO_PDDR_TIMER_PDDR0 (0x01) /* T0IN / T0OUT / U2RTS */
45970 +#define MCF_GPIO_PDDR_TIMER_PDDR1 (0x02) /* T1IN / T1OUT / U2CTS */
45971 +#define MCF_GPIO_PDDR_TIMER_PDDR2 (0x04) /* T2IN / T2OUT / U2TXD */
45972 +#define MCF_GPIO_PDDR_TIMER_PDDR3 (0x08) /* T3IN / T3OUT / U2RXD */
45974 +/* Bit definitions and macros for PDDR_PCI */
45975 +#define MCF_GPIO_PDDR_PCI_PDDR0 (0x01) /* PCI_REQ0/PCI_EXTGNT */
45976 +#define MCF_GPIO_PDDR_PCI_PDDR1 (0x02) /* PCI_REQ1 */
45977 +#define MCF_GPIO_PDDR_PCI_PDDR2 (0x04) /* PCI_REQ2 */
45978 +#define MCF_GPIO_PDDR_PCI_PDDR3 (0x08) /* PCI_REQ3 / ATA_INTR */
45979 +#define MCF_GPIO_PDDR_PCI_PDDR4 (0x10) /* PCI_GNT0/PCI_EXTREQ */
45980 +#define MCF_GPIO_PDDR_PCI_PDDR5 (0x20) /* PCI_GNT1 / */
45981 +#define MCF_GPIO_PDDR_PCI_PDDR6 (0x40) /* PCI_GNT2 / */
45982 +#define MCF_GPIO_PDDR_PCI_PDDR7 (0x80) /* PCI_GNT3 / ATA_DMACK */
45984 +/* Bit definitions and macros for PDDR_USB */
45985 +#define MCF_GPIO_PDDR_USB_PDDR0 (0x01) /* USB_VBUS_OC / ULPI_STP */
45986 +#define MCF_GPIO_PDDR_USB_PDDR1 (0x02) /* USB_VBUS_EN / USB_PULLUP / ULPI_NXT */
45988 +/* Bit definitions and macros for PDDR_ATAH */
45989 +#define MCF_GPIO_PDDR_ATAH_PDDR0 (0x01) /* ATA_DA0 */
45990 +#define MCF_GPIO_PDDR_ATAH_PDDR1 (0x02) /* ATA_DA1 */
45991 +#define MCF_GPIO_PDDR_ATAH_PDDR2 (0x04) /* ATA_DA2 */
45992 +#define MCF_GPIO_PDDR_ATAH_PDDR3 (0x08) /* ATA_CS0 */
45993 +#define MCF_GPIO_PDDR_ATAH_PDDR4 (0x10) /* ATA_CS1 */
45994 +#define MCF_GPIO_PDDR_ATAH_PDDR5 (0x20) /* ATA_BUFFER_EN */
45996 +/* Bit definitions and macros for PDDR_ATAL */
45997 +#define MCF_GPIO_PDDR_ATAL_PDDR0 (0x01) /* ATA_IORDY */
45998 +#define MCF_GPIO_PDDR_ATAL_PDDR1 (0x02) /* ATA_DMARQ */
45999 +#define MCF_GPIO_PDDR_ATAL_PDDR2 (0x04) /* ATA_RESET */
46001 +/* Bit definitions and macros for PDDR_FEC1H */
46002 +#define MCF_GPIO_PDDR_FEC1H_PDDR0 (0x01) /* FEC1_CRS / ATA_DATA6 */
46003 +#define MCF_GPIO_PDDR_FEC1H_PDDR1 (0x02) /* FEC1_RXD0 / FEC1_RMII_RXD0 / ATA_DATA13 */
46004 +#define MCF_GPIO_PDDR_FEC1H_PDDR2 (0x04) /* FEC1_RXDV / FEC1_RMII_CRS_DV / ATA_DATA15 */
46005 +#define MCF_GPIO_PDDR_FEC1H_PDDR3 (0x08) /* FEC1_RXCLK / ATA_DATA5 */
46006 +#define MCF_GPIO_PDDR_FEC1H_PDDR4 (0x10) /* FEC1_COL / ATA_DATA7 */
46007 +#define MCF_GPIO_PDDR_FEC1H_PDDR5 (0x20) /* FEC1_TXD0 / FEC1_RMII_TXD0 / ATA_DATA9 */
46008 +#define MCF_GPIO_PDDR_FEC1H_PDDR6 (0x40) /* FEC1_TXEN / FEC1_RMII_TXEN / ATA_DATA8 */
46009 +#define MCF_GPIO_PDDR_FEC1H_PDDR7 (0x80) /* FEC1_TXCLK / FEC1_RMII_REF_CLK / ATA_DATA11 */
46011 +/* Bit definitions and macros for PDDR_FEC1L */
46012 +#define MCF_GPIO_PDDR_FEC1L_PDDR0 (0x01) /* FEC1_RXER / FEC1_RMII_RXER / ATA_DATA12 */
46013 +#define MCF_GPIO_PDDR_FEC1L_PDDR1 (0x02) /* FEC1_RXD1 / FEC1_RMII_RXD1 / ATA_DATA14 */
46014 +#define MCF_GPIO_PDDR_FEC1L_PDDR2 (0x04) /* FEC1_RXD2 / ATA_DATA3 */
46015 +#define MCF_GPIO_PDDR_FEC1L_PDDR3 (0x08) /* FEC1_RXD3 / ATA_DATA4 */
46016 +#define MCF_GPIO_PDDR_FEC1L_PDDR4 (0x10) /* FEC1_TXER / ATA_DATA0 */
46017 +#define MCF_GPIO_PDDR_FEC1L_PDDR5 (0x20) /* FEC1_TXD1 / FEC1_RMII_TXD1 / ATA_DATA10 */
46018 +#define MCF_GPIO_PDDR_FEC1L_PDDR6 (0x40) /* FEC1_TXD2 / ATA_DATA1 */
46019 +#define MCF_GPIO_PDDR_FEC1L_PDDR7 (0x80) /* FEC1_TXD3 / ATA_DATA2 */
46021 +/* Bit definitions and macros for PDDR_FBADH */
46022 +#define MCF_GPIO_PDDR_FBADH_PDDR0 (0x01) /* FB_AD24 */
46023 +#define MCF_GPIO_PDDR_FBADH_PDDR1 (0x02) /* FB_AD25 */
46024 +#define MCF_GPIO_PDDR_FBADH_PDDR2 (0x04) /* FB_AD26 */
46025 +#define MCF_GPIO_PDDR_FBADH_PDDR3 (0x08) /* FB_AD27 */
46026 +#define MCF_GPIO_PDDR_FBADH_PDDR4 (0x10) /* FB_AD28 */
46027 +#define MCF_GPIO_PDDR_FBADH_PDDR5 (0x20) /* FB_AD29 */
46028 +#define MCF_GPIO_PDDR_FBADH_PDDR6 (0x40) /* FB_AD30 */
46029 +#define MCF_GPIO_PDDR_FBADH_PDDR7 (0x80) /* FB_AD31 */
46031 +/* Bit definitions and macros for PDDR_FBADMH */
46032 +#define MCF_GPIO_PDDR_FBADMH_PDDR0 (0x01) /* FB_AD16 */
46033 +#define MCF_GPIO_PDDR_FBADMH_PDDR1 (0x02) /* FB_AD17 */
46034 +#define MCF_GPIO_PDDR_FBADMH_PDDR2 (0x04) /* FB_AD18 */
46035 +#define MCF_GPIO_PDDR_FBADMH_PDDR3 (0x08) /* FB_AD19 */
46036 +#define MCF_GPIO_PDDR_FBADMH_PDDR4 (0x10) /* FB_AD20 */
46037 +#define MCF_GPIO_PDDR_FBADMH_PDDR5 (0x20) /* FB_AD21 */
46038 +#define MCF_GPIO_PDDR_FBADMH_PDDR6 (0x40) /* FB_AD22 */
46039 +#define MCF_GPIO_PDDR_FBADMH_PDDR7 (0x80) /* FB_AD23 */
46041 +/* Bit definitions and macros for PDDR_FBADML */
46042 +#define MCF_GPIO_PDDR_FBADML_PDDR0 (0x01) /* FB_AD8 */
46043 +#define MCF_GPIO_PDDR_FBADML_PDDR1 (0x02) /* FB_AD9 */
46044 +#define MCF_GPIO_PDDR_FBADML_PDDR2 (0x04) /* FB_AD10 */
46045 +#define MCF_GPIO_PDDR_FBADML_PDDR3 (0x08) /* FB_AD11 */
46046 +#define MCF_GPIO_PDDR_FBADML_PDDR4 (0x10) /* FB_AD12 */
46047 +#define MCF_GPIO_PDDR_FBADML_PDDR5 (0x20) /* FB_AD13 */
46048 +#define MCF_GPIO_PDDR_FBADML_PDDR6 (0x40) /* FB_AD14 */
46049 +#define MCF_GPIO_PDDR_FBADML_PDDR7 (0x80) /* FB_AD15 */
46051 +/* Bit definitions and macros for PDDR_FBADL */
46052 +#define MCF_GPIO_PDDR_FBADL_PDDR0 (0x01) /* FB_AD0 */
46053 +#define MCF_GPIO_PDDR_FBADL_PDDR1 (0x02) /* FB_AD1 */
46054 +#define MCF_GPIO_PDDR_FBADL_PDDR2 (0x04) /* FB_AD2 */
46055 +#define MCF_GPIO_PDDR_FBADL_PDDR3 (0x08) /* FB_AD3 */
46056 +#define MCF_GPIO_PDDR_FBADL_PDDR4 (0x10) /* FB_AD4 */
46057 +#define MCF_GPIO_PDDR_FBADL_PDDR5 (0x20) /* FB_AD5 */
46058 +#define MCF_GPIO_PDDR_FBADL_PDDR6 (0x40) /* FB_AD6 */
46059 +#define MCF_GPIO_PDDR_FBADL_PDDR7 (0x80) /* FB_AD7 */
46061 +/* Bit definitions and macros for PPDSDR_FEC0H */
46062 +#define MCF_GPIO_PPDSDR_FEC0H_PPDR0 (0x01) /* FEC0_CRS / ULPI_DATA6 */
46063 +#define MCF_GPIO_PPDSDR_FEC0H_PPDR1 (0x02) /* FEC0_RXD0 / FEC0_RMII_RXD0 */
46064 +#define MCF_GPIO_PPDSDR_FEC0H_PPDR2 (0x04) /* FEC0_RXDV / FEC0_RMII_CRS_DV */
46065 +#define MCF_GPIO_PPDSDR_FEC0H_PPDR3 (0x08) /* FEC0_RXCLK / ULPI_DATA1 */
46066 +#define MCF_GPIO_PPDSDR_FEC0H_PPDR4 (0x10) /* FEC0_COL / ULPI_DATA7 */
46067 +#define MCF_GPIO_PPDSDR_FEC0H_PPDR5 (0x20) /* FEC0_TXD0 / FEC0_RMII_TXD0 */
46068 +#define MCF_GPIO_PPDSDR_FEC0H_PPDR6 (0x40) /* FEC0_TXEN / FEC0_RMII_TXEN */
46069 +#define MCF_GPIO_PPDSDR_FEC0H_PPDR7 (0x80) /* FEC0_TXCLK / FEC0_RMII_REF_CLK */
46071 +/* Bit definitions and macros for PPDSDR_FEC0L */
46072 +#define MCF_GPIO_PPDSDR_FEC0L_PCLRR0 (0x01) /* FEC0_RXER / FEC0_RMII_RXER */
46073 +#define MCF_GPIO_PPDSDR_FEC0L_PCLRR1 (0x02) /* FEC0_RXD1 / FEC0_RMII_RXD1 */
46074 +#define MCF_GPIO_PPDSDR_FEC0L_PCLRR2 (0x04) /* FEC0_RXD2 / ULPI_DATA4 */
46075 +#define MCF_GPIO_PPDSDR_FEC0L_PCLRR3 (0x08) /* FEC0_RXD3 / ULPI_DATA5 */
46076 +#define MCF_GPIO_PPDSDR_FEC0L_PCLRR4 (0x10) /* FEC0_TXER / ULPI_DATA0 */
46077 +#define MCF_GPIO_PPDSDR_FEC0L_PCLRR5 (0x20) /* FEC0_TXD1 / FEC0_RMII_TXD1 */
46078 +#define MCF_GPIO_PPDSDR_FEC0L_PCLRR6 (0x40) /* FEC0_TXD2 / ULPI_DATA2 */
46079 +#define MCF_GPIO_PPDSDR_FEC0L_PCLRR7 (0x80) /* FEC0_TXD3 / ULPI_DATA3 */
46081 +/* Bit definitions and macros for PPDSDR_SSI */
46082 +#define MCF_GPIO_PPDSDR_SSI_PPDR0 (0x01) /* SSI_TXD / U1TXD */
46083 +#define MCF_GPIO_PPDSDR_SSI_PPDR1 (0x02) /* SSI_RXD / U1RXD */
46084 +#define MCF_GPIO_PPDSDR_SSI_PPDR2 (0x04) /* SSI_FS / U1RTS */
46085 +#define MCF_GPIO_PPDSDR_SSI_PPDR3 (0x08) /* SSI_BCLK / U1CTS */
46086 +#define MCF_GPIO_PPDSDR_SSI_PPDR4 (0x10) /* SSI_MCLK */
46088 +/* Bit definitions and macros for PPDSDR_FBCTL */
46089 +#define MCF_GPIO_PPDSDR_FBCTL_PPDR0 (0x01) /* FB_TS / FB_ALE / FB_TBST */
46090 +#define MCF_GPIO_PPDSDR_FBCTL_PPDR1 (0x02) /* FB_RW */
46091 +#define MCF_GPIO_PPDSDR_FBCTL_PPDR2 (0x04) /* FB_TA */
46092 +#define MCF_GPIO_PPDSDR_FBCTL_PPDR3 (0x08) /* FB_OE */
46094 +/* Bit definitions and macros for PPDSDR_BE */
46095 +#define MCF_GPIO_PPDSDR_BE_PPDR0 (0x01) /* FB_BE/BWE0 / FB_SIZ0 */
46096 +#define MCF_GPIO_PPDSDR_BE_PPDR1 (0x02) /* FB_BE/BWE1 / FB_SIZ1 */
46097 +#define MCF_GPIO_PPDSDR_BE_PPDR2 (0x04) /* FB_BE/BWE2 / FB_SIZ2 */
46098 +#define MCF_GPIO_PPDSDR_BE_PPDR3 (0x08) /* FB_BE/BWE3 / FB_SIZ3 */
46100 +/* Bit definitions and macros for PPDSDR_CS */
46101 +#define MCF_GPIO_PPDSDR_CS_PPDR1 (0x02) /* FB_CS1 */
46102 +#define MCF_GPIO_PPDSDR_CS_PPDR2 (0x04) /* FB_CS2 */
46103 +#define MCF_GPIO_PPDSDR_CS_PPDR3 (0x08) /* FB_CS3 */
46105 +/* Bit definitions and macros for PPDSDR_DMA */
46106 +#define MCF_GPIO_PPDSDR_DMA_PPDR0 (0x01) /* DREQ0 */
46107 +#define MCF_GPIO_PPDSDR_DMA_PPDR1 (0x02) /* DACK0 / DSPI_PCS3 */
46108 +#define MCF_GPIO_PPDSDR_DMA_PPDR2 (0x04) /* DREQ1 / USB_CLKIN */
46109 +#define MCF_GPIO_PPDSDR_DMA_PPDR3 (0x08) /* DACK1 / ULPI_DIR */
46111 +/* Bit definitions and macros for PPDSDR_FECI2C */
46112 +#define MCF_GPIO_PPDSDR_FECI2C_PPDR0 (0x01) /* I2C_SDA / U2RXD */
46113 +#define MCF_GPIO_PPDSDR_FECI2C_PPDR1 (0x02) /* I2C_SCL / U2TXD */
46114 +#define MCF_GPIO_PPDSDR_FECI2C_PPDR2 (0x04) /* FEC0_MDIO */
46115 +#define MCF_GPIO_PPDSDR_FECI2C_PPDR3 (0x08) /* FEC0_MDC */
46116 +#define MCF_GPIO_PPDSDR_FECI2C_PPDR4 (0x10) /* FEC1_MDIO / ATA_DIOW */
46117 +#define MCF_GPIO_PPDSDR_FECI2C_PPDR5 (0x20) /* FEC1_MDC / ATA_DIOR */
46119 +/* Bit definitions and macros for PPDSDR_UART */
46120 +#define MCF_GPIO_PPDSDR_UART_PPDR0 (0x01) /* U1TXD */
46121 +#define MCF_GPIO_PPDSDR_UART_PPDR1 (0x02) /* U1RXD */
46122 +#define MCF_GPIO_PPDSDR_UART_PPDR2 (0x04) /* U1RTS */
46123 +#define MCF_GPIO_PPDSDR_UART_PPDR3 (0x08) /* U0CTS */
46124 +#define MCF_GPIO_PPDSDR_UART_PPDR4 (0x10) /* U1TXD */
46125 +#define MCF_GPIO_PPDSDR_UART_PPDR5 (0x20) /* U1RXD */
46126 +#define MCF_GPIO_PPDSDR_UART_PPDR6 (0x40) /* U1RTS */
46127 +#define MCF_GPIO_PPDSDR_UART_PPDR7 (0x80) /* U1CTS */
46129 +/* Bit definitions and macros for PPDSDR_DSPI */
46130 +#define MCF_GPIO_PPDSDR_DSPI_PPDR0 (0x01) /* DSPI_SOUT / SBF_DO */
46131 +#define MCF_GPIO_PPDSDR_DSPI_PPDR1 (0x02) /* DSPI_SIN / SBF_DI */
46132 +#define MCF_GPIO_PPDSDR_DSPI_PPDR2 (0x04) /* DSPI_SCK / SBF_CK */
46133 +#define MCF_GPIO_PPDSDR_DSPI_PPDR3 (0x08) /* DSPI_PCS0/SS */
46134 +#define MCF_GPIO_PPDSDR_DSPI_PPDR4 (0x10) /* DSPI_PCS1 / SBF_CS */
46135 +#define MCF_GPIO_PPDSDR_DSPI_PPDR5 (0x20) /* DSPI_PCS2 */
46136 +#define MCF_GPIO_PPDSDR_DSPI_PPDR6 (0x40) /* DSPI_PCS5/SS */
46138 +/* Bit definitions and macros for PPDSDR_TIMER */
46139 +#define MCF_GPIO_PPDSDR_TIMER_PPDR0 (0x01) /* T0IN / T0OUT / U2RTS */
46140 +#define MCF_GPIO_PPDSDR_TIMER_PPDR1 (0x02) /* T1IN / T1OUT / U2CTS */
46141 +#define MCF_GPIO_PPDSDR_TIMER_PPDR2 (0x04) /* T2IN / T2OUT / U2TXD */
46142 +#define MCF_GPIO_PPDSDR_TIMER_PPDR3 (0x08) /* T3IN / T3OUT / U2RXD */
46144 +/* Bit definitions and macros for PPDSDR_PCI */
46145 +#define MCF_GPIO_PPDSDR_PCI_PPDR0 (0x01) /* PCI_REQ0/PCI_EXTGNT */
46146 +#define MCF_GPIO_PPDSDR_PCI_PPDR1 (0x02) /* PCI_REQ1 */
46147 +#define MCF_GPIO_PPDSDR_PCI_PPDR2 (0x04) /* PCI_REQ2 */
46148 +#define MCF_GPIO_PPDSDR_PCI_PPDR3 (0x08) /* PCI_REQ3 / ATA_INTR */
46149 +#define MCF_GPIO_PPDSDR_PCI_PPDR4 (0x10) /* PCI_GNT0/PCI_EXTREQ */
46150 +#define MCF_GPIO_PPDSDR_PCI_PPDR5 (0x20) /* PCI_GNT1 / */
46151 +#define MCF_GPIO_PPDSDR_PCI_PPDR6 (0x40) /* PCI_GNT2 / */
46152 +#define MCF_GPIO_PPDSDR_PCI_PPDR7 (0x80) /* PCI_GNT3 / ATA_DMACK */
46154 +/* Bit definitions and macros for PPDSDR_USB */
46155 +#define MCF_GPIO_PPDSDR_USB_PPDR0 (0x01) /* USB_VBUS_OC / ULPI_STP */
46156 +#define MCF_GPIO_PPDSDR_USB_PPDR1 (0x02) /* USB_VBUS_EN / USB_PULLUP / ULPI_NXT */
46158 +/* Bit definitions and macros for PPDSDR_ATAH */
46159 +#define MCF_GPIO_PPDSDR_ATAH_PPDR0 (0x01) /* ATA_DA0 */
46160 +#define MCF_GPIO_PPDSDR_ATAH_PPDR1 (0x02) /* ATA_DA1 */
46161 +#define MCF_GPIO_PPDSDR_ATAH_PPDR2 (0x04) /* ATA_DA2 */
46162 +#define MCF_GPIO_PPDSDR_ATAH_PPDR3 (0x08) /* ATA_CS0 */
46163 +#define MCF_GPIO_PPDSDR_ATAH_PPDR4 (0x10) /* ATA_CS1 */
46164 +#define MCF_GPIO_PPDSDR_ATAH_PPDR5 (0x20) /* ATA_BUFFER_EN */
46166 +/* Bit definitions and macros for PPDSDR_ATAL */
46167 +#define MCF_GPIO_PPDSDR_ATAL_PPDR0 (0x01) /* ATA_IORDY */
46168 +#define MCF_GPIO_PPDSDR_ATAL_PPDR1 (0x02) /* ATA_DMARQ */
46169 +#define MCF_GPIO_PPDSDR_ATAL_PPDR2 (0x04) /* ATA_RESET */
46171 +/* Bit definitions and macros for PPDSDR_FEC1H */
46172 +#define MCF_GPIO_PPDSDR_FEC1H_PPDR0 (0x01) /* FEC1_CRS / ATA_DATA6 */
46173 +#define MCF_GPIO_PPDSDR_FEC1H_PPDR1 (0x02) /* FEC1_RXD0 / FEC1_RMII_RXD0 / ATA_DATA13 */
46174 +#define MCF_GPIO_PPDSDR_FEC1H_PPDR2 (0x04) /* FEC1_RXDV / FEC1_RMII_CRS_DV / ATA_DATA15 */
46175 +#define MCF_GPIO_PPDSDR_FEC1H_PPDR3 (0x08) /* FEC1_RXCLK / ATA_DATA5 */
46176 +#define MCF_GPIO_PPDSDR_FEC1H_PPDR4 (0x10) /* FEC1_COL / ATA_DATA7 */
46177 +#define MCF_GPIO_PPDSDR_FEC1H_PPDR5 (0x20) /* FEC1_TXD0 / FEC1_RMII_TXD0 / ATA_DATA9 */
46178 +#define MCF_GPIO_PPDSDR_FEC1H_PPDR6 (0x40) /* FEC1_TXEN / FEC1_RMII_TXEN / ATA_DATA8 */
46179 +#define MCF_GPIO_PPDSDR_FEC1H_PPDR7 (0x80) /* FEC1_TXCLK / FEC1_RMII_REF_CLK / ATA_DATA11 */
46181 +/* Bit definitions and macros for PPDSDR_FEC1L */
46182 +#define MCF_GPIO_PPDSDR_FEC1L_PPDR0 (0x01) /* FEC1_RXER / FEC1_RMII_RXER / ATA_DATA12 */
46183 +#define MCF_GPIO_PPDSDR_FEC1L_PPDR1 (0x02) /* FEC1_RXD1 / FEC1_RMII_RXD1 / ATA_DATA14 */
46184 +#define MCF_GPIO_PPDSDR_FEC1L_PPDR2 (0x04) /* FEC1_RXD2 / ATA_DATA3 */
46185 +#define MCF_GPIO_PPDSDR_FEC1L_PPDR3 (0x08) /* FEC1_RXD3 / ATA_DATA4 */
46186 +#define MCF_GPIO_PPDSDR_FEC1L_PPDR4 (0x10) /* FEC1_TXER / ATA_DATA0 */
46187 +#define MCF_GPIO_PPDSDR_FEC1L_PPDR5 (0x20) /* FEC1_TXD1 / FEC1_RMII_TXD1 / ATA_DATA10 */
46188 +#define MCF_GPIO_PPDSDR_FEC1L_PPDR6 (0x40) /* FEC1_TXD2 / ATA_DATA1 */
46189 +#define MCF_GPIO_PPDSDR_FEC1L_PPDR7 (0x80) /* FEC1_TXD3 / ATA_DATA2 */
46191 +/* Bit definitions and macros for PPDSDR_FBADH */
46192 +#define MCF_GPIO_PPDSDR_FBADH_PPDR0 (0x01) /* FB_AD24 */
46193 +#define MCF_GPIO_PPDSDR_FBADH_PPDR1 (0x02) /* FB_AD25 */
46194 +#define MCF_GPIO_PPDSDR_FBADH_PPDR2 (0x04) /* FB_AD26 */
46195 +#define MCF_GPIO_PPDSDR_FBADH_PPDR3 (0x08) /* FB_AD27 */
46196 +#define MCF_GPIO_PPDSDR_FBADH_PPDR4 (0x10) /* FB_AD28 */
46197 +#define MCF_GPIO_PPDSDR_FBADH_PPDR5 (0x20) /* FB_AD29 */
46198 +#define MCF_GPIO_PPDSDR_FBADH_PPDR6 (0x40) /* FB_AD30 */
46199 +#define MCF_GPIO_PPDSDR_FBADH_PPDR7 (0x80) /* FB_AD31 */
46201 +/* Bit definitions and macros for PPDSDR_FBADMH */
46202 +#define MCF_GPIO_PPDSDR_FBADMH_PPDR0 (0x01) /* FB_AD16 */
46203 +#define MCF_GPIO_PPDSDR_FBADMH_PPDR1 (0x02) /* FB_AD17 */
46204 +#define MCF_GPIO_PPDSDR_FBADMH_PPDR2 (0x04) /* FB_AD18 */
46205 +#define MCF_GPIO_PPDSDR_FBADMH_PPDR3 (0x08) /* FB_AD19 */
46206 +#define MCF_GPIO_PPDSDR_FBADMH_PPDR4 (0x10) /* FB_AD20 */
46207 +#define MCF_GPIO_PPDSDR_FBADMH_PPDR5 (0x20) /* FB_AD21 */
46208 +#define MCF_GPIO_PPDSDR_FBADMH_PPDR6 (0x40) /* FB_AD22 */
46209 +#define MCF_GPIO_PPDSDR_FBADMH_PPDR7 (0x80) /* FB_AD23 */
46211 +/* Bit definitions and macros for PPDSDR_FBADML */
46212 +#define MCF_GPIO_PPDSDR_FBADML_PPDR0 (0x01) /* FB_AD8 */
46213 +#define MCF_GPIO_PPDSDR_FBADML_PPDR1 (0x02) /* FB_AD9 */
46214 +#define MCF_GPIO_PPDSDR_FBADML_PPDR2 (0x04) /* FB_AD10 */
46215 +#define MCF_GPIO_PPDSDR_FBADML_PPDR3 (0x08) /* FB_AD11 */
46216 +#define MCF_GPIO_PPDSDR_FBADML_PPDR4 (0x10) /* FB_AD12 */
46217 +#define MCF_GPIO_PPDSDR_FBADML_PPDR5 (0x20) /* FB_AD13 */
46218 +#define MCF_GPIO_PPDSDR_FBADML_PPDR6 (0x40) /* FB_AD14 */
46219 +#define MCF_GPIO_PPDSDR_FBADML_PPDR7 (0x80) /* FB_AD15 */
46221 +/* Bit definitions and macros for PPDSDR_FBADL */
46222 +#define MCF_GPIO_PPDSDR_FBADL_PPDR0 (0x01) /* FB_AD0 */
46223 +#define MCF_GPIO_PPDSDR_FBADL_PPDR1 (0x02) /* FB_AD1 */
46224 +#define MCF_GPIO_PPDSDR_FBADL_PPDR2 (0x04) /* FB_AD2 */
46225 +#define MCF_GPIO_PPDSDR_FBADL_PPDR3 (0x08) /* FB_AD3 */
46226 +#define MCF_GPIO_PPDSDR_FBADL_PPDR4 (0x10) /* FB_AD4 */
46227 +#define MCF_GPIO_PPDSDR_FBADL_PPDR5 (0x20) /* FB_AD5 */
46228 +#define MCF_GPIO_PPDSDR_FBADL_PPDR6 (0x40) /* FB_AD6 */
46229 +#define MCF_GPIO_PPDSDR_FBADL_PPDR7 (0x80) /* FB_AD7 */
46231 +/* Bit definitions and macros for PCLRR_FEC0H */
46232 +#define MCF_GPIO_PCLRR_FEC0H_PCLRR0 (0x01) /* FEC0_CRS / ULPI_DATA6 */
46233 +#define MCF_GPIO_PCLRR_FEC0H_PCLRR1 (0x02) /* FEC0_RXD0 / FEC0_RMII_RXD0 */
46234 +#define MCF_GPIO_PCLRR_FEC0H_PCLRR2 (0x04) /* FEC0_RXDV/FEC0_RMII_CRS_DV */
46235 +#define MCF_GPIO_PCLRR_FEC0H_PCLRR3 (0x08) /* FEC0_RXCLK / ULPI_DATA1 */
46236 +#define MCF_GPIO_PCLRR_FEC0H_PCLRR4 (0x10) /* FEC0_COL / ULPI_DATA7 */
46237 +#define MCF_GPIO_PCLRR_FEC0H_PCLRR5 (0x20) /* FEC0_TXD0 / FEC0_RMII_TXD0 */
46238 +#define MCF_GPIO_PCLRR_FEC0H_PCLRR6 (0x40) /* FEC0_TXEN / FEC0_RMII_TXEN */
46239 +#define MCF_GPIO_PCLRR_FEC0H_PCLRR7 (0x80) /* FEC0_TXCLK / FEC0_RMII_REF_CLK */
46241 +/* Bit definitions and macros for PCLRR_FEC0L */
46242 +#define MCF_GPIO_PCLRR_FEC0L_PPDR0 (0x01) /* FEC0_RXER / FEC0_RMII_RXER */
46243 +#define MCF_GPIO_PCLRR_FEC0L_PPDR1 (0x02) /* FEC0_RXD1 / FEC0_RMII_RXD1 */
46244 +#define MCF_GPIO_PCLRR_FEC0L_PPDR2 (0x04) /* FEC0_RXD2 / ULPI_DATA4 */
46245 +#define MCF_GPIO_PCLRR_FEC0L_PPDR3 (0x08) /* FEC0_RXD3 / ULPI_DATA5 */
46246 +#define MCF_GPIO_PCLRR_FEC0L_PPDR4 (0x10) /* FEC0_TXER / ULPI_DATA0 */
46247 +#define MCF_GPIO_PCLRR_FEC0L_PPDR5 (0x20) /* FEC0_TXD1 / FEC0_RMII_TXD1 */
46248 +#define MCF_GPIO_PCLRR_FEC0L_PPDR6 (0x40) /* FEC0_TXD2 / ULPI_DATA2 */
46249 +#define MCF_GPIO_PCLRR_FEC0L_PPDR7 (0x80) /* FEC0_TXD3 / ULPI_DATA3 */
46251 +/* Bit definitions and macros for PCLRR_SSI */
46252 +#define MCF_GPIO_PCLRR_SSI_PCLRR0 (0x01) /* SSI_TXD / U1TXD */
46253 +#define MCF_GPIO_PCLRR_SSI_PCLRR1 (0x02) /* SSI_RXD / U1RXD */
46254 +#define MCF_GPIO_PCLRR_SSI_PCLRR2 (0x04) /* SSI_FS / U1RTS */
46255 +#define MCF_GPIO_PCLRR_SSI_PCLRR3 (0x08) /* SSI_BCLK / U1CTS */
46256 +#define MCF_GPIO_PCLRR_SSI_PCLRR4 (0x10) /* SSI_MCLK */
46258 +/* Bit definitions and macros for PCLRR_FBCTL */
46259 +#define MCF_GPIO_PCLRR_FBCTL_PCLRR0 (0x01) /* FB_TS / FB_ALE / FB_TBST */
46260 +#define MCF_GPIO_PCLRR_FBCTL_PCLRR1 (0x02) /* FB_RW */
46261 +#define MCF_GPIO_PCLRR_FBCTL_PCLRR2 (0x04) /* FB_TA */
46262 +#define MCF_GPIO_PCLRR_FBCTL_PCLRR3 (0x08) /* FB_OE */
46264 +/* Bit definitions and macros for PCLRR_BE */
46265 +#define MCF_GPIO_PCLRR_BE_PCLRR0 (0x01) /* FB_BE/BWE0 / FB_SIZ0 */
46266 +#define MCF_GPIO_PCLRR_BE_PCLRR1 (0x02) /* FB_BE/BWE1 / FB_SIZ1 */
46267 +#define MCF_GPIO_PCLRR_BE_PCLRR2 (0x04) /* FB_BE/BWE2 / FB_SIZ2 */
46268 +#define MCF_GPIO_PCLRR_BE_PCLRR3 (0x08) /* FB_BE/BWE3 / FB_SIZ3 */
46270 +/* Bit definitions and macros for PCLRR_CS */
46271 +#define MCF_GPIO_PCLRR_CS_PCLRR1 (0x02) /* FB_CS1 */
46272 +#define MCF_GPIO_PCLRR_CS_PCLRR2 (0x04) /* FB_CS2 */
46273 +#define MCF_GPIO_PCLRR_CS_PCLRR3 (0x08) /* FB_CS3 */
46275 +/* Bit definitions and macros for PCLRR_DMA */
46276 +#define MCF_GPIO_PCLRR_DMA_PCLRR0 (0x01) /* DREQ0 */
46277 +#define MCF_GPIO_PCLRR_DMA_PCLRR1 (0x02) /* DACK0 / DSPI_PCS3 */
46278 +#define MCF_GPIO_PCLRR_DMA_PCLRR2 (0x04) /* DREQ1 / USB_CLKIN */
46279 +#define MCF_GPIO_PCLRR_DMA_PCLRR3 (0x08) /* DACK1 / ULPI_DIR */
46281 +/* Bit definitions and macros for PCLRR_FECI2C */
46282 +#define MCF_GPIO_PCLRR_FECI2C_PCLRR0 (0x01) /* I2C_SDA / U2RXD */
46283 +#define MCF_GPIO_PCLRR_FECI2C_PCLRR1 (0x02) /* I2C_SCL / U2TXD */
46284 +#define MCF_GPIO_PCLRR_FECI2C_PCLRR2 (0x04) /* FEC0_MDIO */
46285 +#define MCF_GPIO_PCLRR_FECI2C_PCLRR3 (0x08) /* FEC0_MDC */
46286 +#define MCF_GPIO_PCLRR_FECI2C_PCLRR4 (0x10) /* FEC1_MDIO / ATA_DIOW */
46287 +#define MCF_GPIO_PCLRR_FECI2C_PCLRR5 (0x20) /* FEC1_MDC / ATA_DIOR */
46289 +/* Bit definitions and macros for PCLRR_UART */
46290 +#define MCF_GPIO_PCLRR_UART_PCLRR0 (0x01) /* U1TXD */
46291 +#define MCF_GPIO_PCLRR_UART_PCLRR1 (0x02) /* U1RXD */
46292 +#define MCF_GPIO_PCLRR_UART_PCLRR2 (0x04) /* U1RTS */
46293 +#define MCF_GPIO_PCLRR_UART_PCLRR3 (0x08) /* U0CTS */
46294 +#define MCF_GPIO_PCLRR_UART_PCLRR4 (0x10) /* U1TXD */
46295 +#define MCF_GPIO_PCLRR_UART_PCLRR5 (0x20) /* U1RXD */
46296 +#define MCF_GPIO_PCLRR_UART_PCLRR6 (0x40) /* U1RTS */
46297 +#define MCF_GPIO_PCLRR_UART_PCLRR7 (0x80) /* U1CTS */
46299 +/* Bit definitions and macros for PCLRR_DSPI */
46300 +#define MCF_GPIO_PCLRR_DSPI_PCLRR0 (0x01) /* DSPI_SOUT / SBF_DO */
46301 +#define MCF_GPIO_PCLRR_DSPI_PCLRR1 (0x02) /* DSPI_SIN / SBF_DI */
46302 +#define MCF_GPIO_PCLRR_DSPI_PCLRR2 (0x04) /* DSPI_SCK / SBF_CK */
46303 +#define MCF_GPIO_PCLRR_DSPI_PCLRR3 (0x08) /* DSPI_PCS0/SS */
46304 +#define MCF_GPIO_PCLRR_DSPI_PCLRR4 (0x10) /* DSPI_PCS1 / SBF_CS */
46305 +#define MCF_GPIO_PCLRR_DSPI_PCLRR5 (0x20) /* DSPI_PCS2 */
46306 +#define MCF_GPIO_PCLRR_DSPI_PCLRR6 (0x40) /* DSPI_PCS5/SS */
46308 +/* Bit definitions and macros for PCLRR_TIMER */
46309 +#define MCF_GPIO_PCLRR_TIMER_PCLRR0 (0x01) /* T0IN / T0OUT / U2RTS */
46310 +#define MCF_GPIO_PCLRR_TIMER_PCLRR1 (0x02) /* T1IN / T1OUT / U2CTS */
46311 +#define MCF_GPIO_PCLRR_TIMER_PCLRR2 (0x04) /* T2IN / T2OUT / U2TXD */
46312 +#define MCF_GPIO_PCLRR_TIMER_PCLRR3 (0x08) /* T3IN / T3OUT / U2RXD */
46314 +/* Bit definitions and macros for PCLRR_PCI */
46315 +#define MCF_GPIO_PCLRR_PCI_PCLRR0 (0x01) /* PCI_REQ0/PCI_EXTGNT */
46316 +#define MCF_GPIO_PCLRR_PCI_PCLRR1 (0x02) /* PCI_REQ1 */
46317 +#define MCF_GPIO_PCLRR_PCI_PCLRR2 (0x04) /* PCI_REQ2 */
46318 +#define MCF_GPIO_PCLRR_PCI_PCLRR3 (0x08) /* PCI_REQ3 / ATA_INTR */
46319 +#define MCF_GPIO_PCLRR_PCI_PCLRR4 (0x10) /* PCI_GNT0/PCI_EXTREQ */
46320 +#define MCF_GPIO_PCLRR_PCI_PCLRR5 (0x20) /* PCI_GNT1 / */
46321 +#define MCF_GPIO_PCLRR_PCI_PCLRR6 (0x40) /* PCI_GNT2 / */
46322 +#define MCF_GPIO_PCLRR_PCI_PCLRR7 (0x80) /* PCI_GNT3 / ATA_DMACK */
46324 +/* Bit definitions and macros for PCLRR_USB */
46325 +#define MCF_GPIO_PCLRR_USB_PCLRR0 (0x01) /* USB_VBUS_OC / ULPI_STP */
46326 +#define MCF_GPIO_PCLRR_USB_PCLRR1 (0x02) /* USB_VBUS_EN / USB_PULLUP / ULPI_NXT */
46328 +/* Bit definitions and macros for PCLRR_ATAH */
46329 +#define MCF_GPIO_PCLRR_ATAH_PCLRR0 (0x01) /* ATA_DA0 */
46330 +#define MCF_GPIO_PCLRR_ATAH_PCLRR1 (0x02) /* ATA_DA1 */
46331 +#define MCF_GPIO_PCLRR_ATAH_PCLRR2 (0x04) /* ATA_DA2 */
46332 +#define MCF_GPIO_PCLRR_ATAH_PCLRR3 (0x08) /* ATA_CS0 */
46333 +#define MCF_GPIO_PCLRR_ATAH_PCLRR4 (0x10) /* ATA_CS1 */
46334 +#define MCF_GPIO_PCLRR_ATAH_PCLRR5 (0x20) /* ATA_BUFFER_EN */
46336 +/* Bit definitions and macros for PCLRR_ATAL */
46337 +#define MCF_GPIO_PCLRR_ATAL_PCLRR0 (0x01) /* ATA_IORDY */
46338 +#define MCF_GPIO_PCLRR_ATAL_PCLRR1 (0x02) /* ATA_DMARQ */
46339 +#define MCF_GPIO_PCLRR_ATAL_PCLRR2 (0x04) /* ATA_RESET */
46341 +/* Bit definitions and macros for PCLRR_FEC1H */
46342 +#define MCF_GPIO_PCLRR_FEC1H_PCLRR0 (0x01) /* FEC1_CRS / ATA_DATA6 */
46343 +#define MCF_GPIO_PCLRR_FEC1H_PCLRR1 (0x02) /* FEC1_RXD0 / FEC1_RMII_RXD0 / ATA_DATA13 */
46344 +#define MCF_GPIO_PCLRR_FEC1H_PCLRR2 (0x04) /* FEC1_RXDV / FEC1_RMII_CRS_DV / ATA_DATA15 */
46345 +#define MCF_GPIO_PCLRR_FEC1H_PCLRR3 (0x08) /* FEC1_RXCLK / ATA_DATA5 */
46346 +#define MCF_GPIO_PCLRR_FEC1H_PCLRR4 (0x10) /* FEC1_COL / ATA_DATA7 */
46347 +#define MCF_GPIO_PCLRR_FEC1H_PCLRR5 (0x20) /* FEC1_TXD0 / FEC1_RMII_TXD0 / ATA_DATA9 */
46348 +#define MCF_GPIO_PCLRR_FEC1H_PCLRR6 (0x40) /* FEC1_TXEN / FEC1_RMII_TXEN / ATA_DATA8 */
46349 +#define MCF_GPIO_PCLRR_FEC1H_PCLRR7 (0x80) /* FEC1_TXCLK / FEC1_RMII_REF_CLK / ATA_DATA11 */
46351 +/* Bit definitions and macros for PCLRR_FEC1L */
46352 +#define MCF_GPIO_PCLRR_FEC1L_PCLRR0 (0x01) /* FEC1_RXER / FEC1_RMII_RXER / ATA_DATA12 */
46353 +#define MCF_GPIO_PCLRR_FEC1L_PCLRR1 (0x02) /* FEC1_RXD1 / FEC1_RMII_RXD1 / ATA_DATA14 */
46354 +#define MCF_GPIO_PCLRR_FEC1L_PCLRR2 (0x04) /* FEC1_RXD2 / ATA_DATA3 */
46355 +#define MCF_GPIO_PCLRR_FEC1L_PCLRR3 (0x08) /* FEC1_RXD3 / ATA_DATA4 */
46356 +#define MCF_GPIO_PCLRR_FEC1L_PCLRR4 (0x10) /* FEC1_TXER / ATA_DATA0 */
46357 +#define MCF_GPIO_PCLRR_FEC1L_PCLRR5 (0x20) /* FEC1_TXD1 / FEC1_RMII_TXD1 / ATA_DATA10 */
46358 +#define MCF_GPIO_PCLRR_FEC1L_PCLRR6 (0x40) /* FEC1_TXD2 / ATA_DATA1 */
46359 +#define MCF_GPIO_PCLRR_FEC1L_PCLRR7 (0x80) /* FEC1_TXD3 / ATA_DATA2 */
46361 +/* Bit definitions and macros for PCLRR_FBADH */
46362 +#define MCF_GPIO_PCLRR_FBADH_PCLRR0 (0x01) /* FB_AD24 */
46363 +#define MCF_GPIO_PCLRR_FBADH_PCLRR1 (0x02) /* FB_AD25 */
46364 +#define MCF_GPIO_PCLRR_FBADH_PCLRR2 (0x04) /* FB_AD26 */
46365 +#define MCF_GPIO_PCLRR_FBADH_PCLRR3 (0x08) /* FB_AD27 */
46366 +#define MCF_GPIO_PCLRR_FBADH_PCLRR4 (0x10) /* FB_AD28 */
46367 +#define MCF_GPIO_PCLRR_FBADH_PCLRR5 (0x20) /* FB_AD29 */
46368 +#define MCF_GPIO_PCLRR_FBADH_PCLRR6 (0x40) /* FB_AD30 */
46369 +#define MCF_GPIO_PCLRR_FBADH_PCLRR7 (0x80) /* FB_AD31 */
46371 +/* Bit definitions and macros for PCLRR_FBADMH */
46372 +#define MCF_GPIO_PCLRR_FBADMH_PCLRR0 (0x01) /* FB_AD16 */
46373 +#define MCF_GPIO_PCLRR_FBADMH_PCLRR1 (0x02) /* FB_AD17 */
46374 +#define MCF_GPIO_PCLRR_FBADMH_PCLRR2 (0x04) /* FB_AD18 */
46375 +#define MCF_GPIO_PCLRR_FBADMH_PCLRR3 (0x08) /* FB_AD19 */
46376 +#define MCF_GPIO_PCLRR_FBADMH_PCLRR4 (0x10) /* FB_AD20 */
46377 +#define MCF_GPIO_PCLRR_FBADMH_PCLRR5 (0x20) /* FB_AD21 */
46378 +#define MCF_GPIO_PCLRR_FBADMH_PCLRR6 (0x40) /* FB_AD22 */
46379 +#define MCF_GPIO_PCLRR_FBADMH_PCLRR7 (0x80) /* FB_AD23 */
46381 +/* Bit definitions and macros for PCLRR_FBADML */
46382 +#define MCF_GPIO_PCLRR_FBADML_PCLRR0 (0x01) /* FB_AD8 */
46383 +#define MCF_GPIO_PCLRR_FBADML_PCLRR1 (0x02) /* FB_AD9 */
46384 +#define MCF_GPIO_PCLRR_FBADML_PCLRR2 (0x04) /* FB_AD10 */
46385 +#define MCF_GPIO_PCLRR_FBADML_PCLRR3 (0x08) /* FB_AD11 */
46386 +#define MCF_GPIO_PCLRR_FBADML_PCLRR4 (0x10) /* FB_AD12 */
46387 +#define MCF_GPIO_PCLRR_FBADML_PCLRR5 (0x20) /* FB_AD13 */
46388 +#define MCF_GPIO_PCLRR_FBADML_PCLRR6 (0x40) /* FB_AD14 */
46389 +#define MCF_GPIO_PCLRR_FBADML_PCLRR7 (0x80) /* FB_AD15 */
46391 +/* Bit definitions and macros for PCLRR_FBADL */
46392 +#define MCF_GPIO_PCLRR_FBADL_PCLRR0 (0x01) /* FB_AD0 */
46393 +#define MCF_GPIO_PCLRR_FBADL_PCLRR1 (0x02) /* FB_AD1 */
46394 +#define MCF_GPIO_PCLRR_FBADL_PCLRR2 (0x04) /* FB_AD2 */
46395 +#define MCF_GPIO_PCLRR_FBADL_PCLRR3 (0x08) /* FB_AD3 */
46396 +#define MCF_GPIO_PCLRR_FBADL_PCLRR4 (0x10) /* FB_AD4 */
46397 +#define MCF_GPIO_PCLRR_FBADL_PCLRR5 (0x20) /* FB_AD5 */
46398 +#define MCF_GPIO_PCLRR_FBADL_PCLRR6 (0x40) /* FB_AD6 */
46399 +#define MCF_GPIO_PCLRR_FBADL_PCLRR7 (0x80) /* FB_AD7 */
46401 +/* Bit definitions and macros for PAR_FEC */
46402 +#define MCF_GPIO_PAR_FEC_FEC0(x) (((x)&0x07))
46403 +#define MCF_GPIO_PAR_FEC_FEC1(x) (((x)&0x07)<<4)
46404 +#define MCF_GPIO_PAR_FEC_FEC1_MASK (0x8F)
46405 +#define MCF_GPIO_PAR_FEC_FEC1_MII (0x70)
46406 +#define MCF_GPIO_PAR_FEC_FEC1_RMII_GPIO (0x30)
46407 +#define MCF_GPIO_PAR_FEC_FEC1_RMII_ATA (0x20)
46408 +#define MCF_GPIO_PAR_FEC_FEC1_ATA (0x10)
46409 +#define MCF_GPIO_PAR_FEC_FEC1_GPIO (0x00)
46410 +#define MCF_GPIO_PAR_FEC_FEC0_MASK (0xF8)
46411 +#define MCF_GPIO_PAR_FEC_FEC0_MII (0x07)
46412 +#define MCF_GPIO_PAR_FEC_FEC0_RMII_GPIO (0x03)
46413 +#define MCF_GPIO_PAR_FEC_FEC0_RMII_ULPI (0x02)
46414 +#define MCF_GPIO_PAR_FEC_FEC0_ULPI (0x01)
46415 +#define MCF_GPIO_PAR_FEC_FEC0_GPIO (0x00)
46417 +/* Bit definitions and macros for PAR_DMA */
46418 +#define MCF_GPIO_PAR_DMA_DREQ0 (0x01)
46419 +#define MCF_GPIO_PAR_DMA_DACK0(x) (((x)&0x03)<<2)
46420 +#define MCF_GPIO_PAR_DMA_DREQ1(x) (((x)&0x03)<<4)
46421 +#define MCF_GPIO_PAR_DMA_DACK1(x) (((x)&0x03)<<6)
46422 +#define MCF_GPIO_PAR_DMA_DACK1_MASK (0x3F)
46423 +#define MCF_GPIO_PAR_DMA_DACK1_DACK1 (0xC0)
46424 +#define MCF_GPIO_PAR_DMA_DACK1_ULPI_DIR (0x40)
46425 +#define MCF_GPIO_PAR_DMA_DACK1_GPIO (0x00)
46426 +#define MCF_GPIO_PAR_DMA_DREQ1_MASK (0xCF)
46427 +#define MCF_GPIO_PAR_DMA_DREQ1_DREQ1 (0x30)
46428 +#define MCF_GPIO_PAR_DMA_DREQ1_USB_CLKIN (0x10)
46429 +#define MCF_GPIO_PAR_DMA_DREQ1_GPIO (0x00)
46430 +#define MCF_GPIO_PAR_DMA_DACK0_MASK (0xF3)
46431 +#define MCF_GPIO_PAR_DMA_DACK0_DACK1 (0x0C)
46432 +#define MCF_GPIO_PAR_DMA_DACK0_ULPI_DIR (0x04)
46433 +#define MCF_GPIO_PAR_DMA_DACK0_GPIO (0x00)
46434 +#define MCF_GPIO_PAR_DMA_DREQ0_DREQ0 (0x01)
46435 +#define MCF_GPIO_PAR_DMA_DREQ0_GPIO (0x00)
46437 +/* Bit definitions and macros for PAR_FBCTL */
46438 +#define MCF_GPIO_PAR_FBCTL_TS(x) (((x)&0x03)<<3)
46439 +#define MCF_GPIO_PAR_FBCTL_RW (0x20)
46440 +#define MCF_GPIO_PAR_FBCTL_TA (0x40)
46441 +#define MCF_GPIO_PAR_FBCTL_OE (0x80)
46442 +#define MCF_GPIO_PAR_FBCTL_OE_OE (0x80)
46443 +#define MCF_GPIO_PAR_FBCTL_OE_GPIO (0x00)
46444 +#define MCF_GPIO_PAR_FBCTL_TA_TA (0x40)
46445 +#define MCF_GPIO_PAR_FBCTL_TA_GPIO (0x00)
46446 +#define MCF_GPIO_PAR_FBCTL_RW_RW (0x20)
46447 +#define MCF_GPIO_PAR_FBCTL_RW_GPIO (0x00)
46448 +#define MCF_GPIO_PAR_FBCTL_TS_MASK (0xE7)
46449 +#define MCF_GPIO_PAR_FBCTL_TS_TS (0x18)
46450 +#define MCF_GPIO_PAR_FBCTL_TS_ALE (0x10)
46451 +#define MCF_GPIO_PAR_FBCTL_TS_TBST (0x08)
46452 +#define MCF_GPIO_PAR_FBCTL_TS_GPIO (0x80)
46454 +/* Bit definitions and macros for PAR_DSPI */
46455 +#define MCF_GPIO_PAR_DSPI_SCK (0x01)
46456 +#define MCF_GPIO_PAR_DSPI_SOUT (0x02)
46457 +#define MCF_GPIO_PAR_DSPI_SIN (0x04)
46458 +#define MCF_GPIO_PAR_DSPI_PCS0 (0x08)
46459 +#define MCF_GPIO_PAR_DSPI_PCS1 (0x10)
46460 +#define MCF_GPIO_PAR_DSPI_PCS2 (0x20)
46461 +#define MCF_GPIO_PAR_DSPI_PCS5 (0x40)
46462 +#define MCF_GPIO_PAR_DSPI_PCS5_PCS5 (0x40)
46463 +#define MCF_GPIO_PAR_DSPI_PCS5_GPIO (0x00)
46464 +#define MCF_GPIO_PAR_DSPI_PCS2_PCS2 (0x20)
46465 +#define MCF_GPIO_PAR_DSPI_PCS2_GPIO (0x00)
46466 +#define MCF_GPIO_PAR_DSPI_PCS1_PCS1 (0x10)
46467 +#define MCF_GPIO_PAR_DSPI_PCS1_GPIO (0x00)
46468 +#define MCF_GPIO_PAR_DSPI_PCS0_PCS0 (0x08)
46469 +#define MCF_GPIO_PAR_DSPI_PCS0_GPIO (0x00)
46470 +#define MCF_GPIO_PAR_DSPI_SIN_SIN (0x04)
46471 +#define MCF_GPIO_PAR_DSPI_SIN_GPIO (0x00)
46472 +#define MCF_GPIO_PAR_DSPI_SOUT_SOUT (0x02)
46473 +#define MCF_GPIO_PAR_DSPI_SOUT_GPIO (0x00)
46474 +#define MCF_GPIO_PAR_DSPI_SCK_SCK (0x01)
46475 +#define MCF_GPIO_PAR_DSPI_SCK_GPIO (0x00)
46477 +/* Bit definitions and macros for PAR_BE */
46478 +#define MCF_GPIO_PAR_BE_BE0 (0x01)
46479 +#define MCF_GPIO_PAR_BE_BE1 (0x04)
46480 +#define MCF_GPIO_PAR_BE_BE2(x) (((x)&0x03)<<4)
46481 +#define MCF_GPIO_PAR_BE_BE3(x) (((x)&0x03)<<6)
46482 +#define MCF_GPIO_PAR_BE_BE3_MASK (0x3F)
46483 +#define MCF_GPIO_PAR_BE_BE3_BE3 (0xC0)
46484 +#define MCF_GPIO_PAR_BE_BE3_TSIZ1 (0x80)
46485 +#define MCF_GPIO_PAR_BE_BE3_GPIO (0x00)
46486 +#define MCF_GPIO_PAR_BE_BE2_MASK (0xCF)
46487 +#define MCF_GPIO_PAR_BE_BE2_BE2 (0x30)
46488 +#define MCF_GPIO_PAR_BE_BE2_TSIZ0 (0x20)
46489 +#define MCF_GPIO_PAR_BE_BE2_GPIO (0x00)
46490 +#define MCF_GPIO_PAR_BE_BE1_BE1 (0x04)
46491 +#define MCF_GPIO_PAR_BE_BE1_GPIO (0x00)
46492 +#define MCF_GPIO_PAR_BE_BE0_BE0 (0x01)
46493 +#define MCF_GPIO_PAR_BE_BE0_GPIO (0x00)
46495 +/* Bit definitions and macros for PAR_CS */
46496 +#define MCF_GPIO_PAR_CS_CS1 (0x02)
46497 +#define MCF_GPIO_PAR_CS_CS2 (0x04)
46498 +#define MCF_GPIO_PAR_CS_CS3 (0x08)
46499 +#define MCF_GPIO_PAR_CS_CS3_CS3 (0x08)
46500 +#define MCF_GPIO_PAR_CS_CS3_GPIO (0x00)
46501 +#define MCF_GPIO_PAR_CS_CS2_CS2 (0x04)
46502 +#define MCF_GPIO_PAR_CS_CS2_GPIO (0x00)
46503 +#define MCF_GPIO_PAR_CS_CS1_CS1 (0x02)
46504 +#define MCF_GPIO_PAR_CS_CS1_GPIO (0x00)
46506 +/* Bit definitions and macros for PAR_TIMER */
46507 +#define MCF_GPIO_PAR_TIMER_T0IN(x) (((x)&0x03))
46508 +#define MCF_GPIO_PAR_TIMER_T1IN(x) (((x)&0x03)<<2)
46509 +#define MCF_GPIO_PAR_TIMER_T2IN(x) (((x)&0x03)<<4)
46510 +#define MCF_GPIO_PAR_TIMER_T3IN(x) (((x)&0x03)<<6)
46511 +#define MCF_GPIO_PAR_TIMER_T3IN_MASK (0x3F)
46512 +#define MCF_GPIO_PAR_TIMER_T3IN_T3IN (0xC0)
46513 +#define MCF_GPIO_PAR_TIMER_T3IN_T3OUT (0x80)
46514 +#define MCF_GPIO_PAR_TIMER_T3IN_U2RXD (0x40)
46515 +#define MCF_GPIO_PAR_TIMER_T3IN_GPIO (0x00)
46516 +#define MCF_GPIO_PAR_TIMER_T2IN_MASK (0xCF)
46517 +#define MCF_GPIO_PAR_TIMER_T2IN_T2IN (0x30)
46518 +#define MCF_GPIO_PAR_TIMER_T2IN_T2OUT (0x20)
46519 +#define MCF_GPIO_PAR_TIMER_T2IN_U2TXD (0x10)
46520 +#define MCF_GPIO_PAR_TIMER_T2IN_GPIO (0x00)
46521 +#define MCF_GPIO_PAR_TIMER_T1IN_MASK (0xF3)
46522 +#define MCF_GPIO_PAR_TIMER_T1IN_T1IN (0x0C)
46523 +#define MCF_GPIO_PAR_TIMER_T1IN_T1OUT (0x08)
46524 +#define MCF_GPIO_PAR_TIMER_T1IN_U2CTS (0x04)
46525 +#define MCF_GPIO_PAR_TIMER_T1IN_GPIO (0x00)
46526 +#define MCF_GPIO_PAR_TIMER_T0IN_MASK (0xFC)
46527 +#define MCF_GPIO_PAR_TIMER_T0IN_T0IN (0x03)
46528 +#define MCF_GPIO_PAR_TIMER_T0IN_T0OUT (0x02)
46529 +#define MCF_GPIO_PAR_TIMER_T0IN_U2RTS (0x01)
46530 +#define MCF_GPIO_PAR_TIMER_T0IN_GPIO (0x00)
46532 +/* Bit definitions and macros for PAR_USB */
46533 +#define MCF_GPIO_PAR_USB_VBUSOC(x) (((x)&0x03))
46534 +#define MCF_GPIO_PAR_USB_VBUSEN(x) (((x)&0x03)<<2)
46535 +#define MCF_GPIO_PAR_USB_VBUSEN_MASK (0xF3)
46536 +#define MCF_GPIO_PAR_USB_VBUSEN_VBUSEN (0x0C)
46537 +#define MCF_GPIO_PAR_USB_VBUSEN_USBPULLUP (0x08)
46538 +#define MCF_GPIO_PAR_USB_VBUSEN_ULPI_NXT (0x04)
46539 +#define MCF_GPIO_PAR_USB_VBUSEN_GPIO (0x00)
46540 +#define MCF_GPIO_PAR_USB_VBUSOC_MASK (0xFC)
46541 +#define MCF_GPIO_PAR_USB_VBUSOC_VBUSOC (0x03)
46542 +#define MCF_GPIO_PAR_USB_VBUSOC_ULPI_STP (0x01)
46543 +#define MCF_GPIO_PAR_USB_VBUSOC_GPIO (0x00)
46545 +/* Bit definitions and macros for PAR_UART */
46546 +#define MCF_GPIO_PAR_UART_U0TXD (0x01)
46547 +#define MCF_GPIO_PAR_UART_U0RXD (0x02)
46548 +#define MCF_GPIO_PAR_UART_U0RTS (0x04)
46549 +#define MCF_GPIO_PAR_UART_U0CTS (0x08)
46550 +#define MCF_GPIO_PAR_UART_U1TXD (0x10)
46551 +#define MCF_GPIO_PAR_UART_U1RXD (0x20)
46552 +#define MCF_GPIO_PAR_UART_U1RTS (0x40)
46553 +#define MCF_GPIO_PAR_UART_U1CTS (0x80)
46554 +#define MCF_GPIO_PAR_UART_U1CTS_U1CTS (0x80)
46555 +#define MCF_GPIO_PAR_UART_U1CTS_GPIO (0x00)
46556 +#define MCF_GPIO_PAR_UART_U1RTS_U1RTS (0x40)
46557 +#define MCF_GPIO_PAR_UART_U1RTS_GPIO (0x00)
46558 +#define MCF_GPIO_PAR_UART_U1RXD_U1RXD (0x20)
46559 +#define MCF_GPIO_PAR_UART_U1RXD_GPIO (0x00)
46560 +#define MCF_GPIO_PAR_UART_U1TXD_U1TXD (0x10)
46561 +#define MCF_GPIO_PAR_UART_U1TXD_GPIO (0x00)
46562 +#define MCF_GPIO_PAR_UART_U0CTS_U0CTS (0x08)
46563 +#define MCF_GPIO_PAR_UART_U0CTS_GPIO (0x00)
46564 +#define MCF_GPIO_PAR_UART_U0RTS_U0RTS (0x04)
46565 +#define MCF_GPIO_PAR_UART_U0RTS_GPIO (0x00)
46566 +#define MCF_GPIO_PAR_UART_U0RXD_U0RXD (0x02)
46567 +#define MCF_GPIO_PAR_UART_U0RXD_GPIO (0x00)
46568 +#define MCF_GPIO_PAR_UART_U0TXD_U0TXD (0x01)
46569 +#define MCF_GPIO_PAR_UART_U0TXD_GPIO (0x00)
46571 +/* Bit definitions and macros for PAR_FECI2C */
46572 +#define MCF_GPIO_PAR_FECI2C_SDA(x) (((x)&0x0003))
46573 +#define MCF_GPIO_PAR_FECI2C_SCL(x) (((x)&0x0003)<<2)
46574 +#define MCF_GPIO_PAR_FECI2C_PAR_SDA(x) (((x)&0x0003))
46575 +#define MCF_GPIO_PAR_FECI2C_PAR_SCL(x) (((x)&0x0003)<<2)
46576 +#define MCF_GPIO_PAR_FECI2C_MDIO0 (0x0010)
46577 +#define MCF_GPIO_PAR_FECI2C_MDC0 (0x0040)
46578 +#define MCF_GPIO_PAR_FECI2C_MDIO1(x) (((x)&0x0003)<<8)
46579 +#define MCF_GPIO_PAR_FECI2C_MDC1(x) (((x)&0x0003)<<10)
46580 +#define MCF_GPIO_PAR_FECI2C_MDC1_MASK (0xF3FF)
46581 +#define MCF_GPIO_PAR_FECI2C_MDC1_MDC1 (0x0C00)
46582 +#define MCF_GPIO_PAR_FECI2C_MDC1_ATA_DIOR (0x0800)
46583 +#define MCF_GPIO_PAR_FECI2C_MDC1_GPIO (0x0000)
46584 +#define MCF_GPIO_PAR_FECI2C_MDIO1_MASK (0xFCFF)
46585 +#define MCF_GPIO_PAR_FECI2C_MDIO1_MDIO1 (0x0300)
46586 +#define MCF_GPIO_PAR_FECI2C_MDIO1_ATA_DIOW (0x0200)
46587 +#define MCF_GPIO_PAR_FECI2C_MDIO1_GPIO (0x0000)
46588 +#define MCF_GPIO_PAR_FECI2C_MDC0_MDC0 (0x0040)
46589 +#define MCF_GPIO_PAR_FECI2C_MDC0_GPIO (0x0000)
46590 +#define MCF_GPIO_PAR_FECI2C_MDIO0_MDIO0 (0x0010)
46591 +#define MCF_GPIO_PAR_FECI2C_MDIO0_GPIO (0x0000)
46592 +#define MCF_GPIO_PAR_FECI2C_SCL_MASK (0xFFF3)
46593 +#define MCF_GPIO_PAR_FECI2C_SCL_SCL (0x000C)
46594 +#define MCF_GPIO_PAR_FECI2C_SCL_U2TXD (0x0004)
46595 +#define MCF_GPIO_PAR_FECI2C_SCL_GPIO (0x0000)
46596 +#define MCF_GPIO_PAR_FECI2C_SDA_MASK (0xFFFC)
46597 +#define MCF_GPIO_PAR_FECI2C_SDA_SDA (0x0003)
46598 +#define MCF_GPIO_PAR_FECI2C_SDA_U2RXD (0x0001)
46599 +#define MCF_GPIO_PAR_FECI2C_SDA_GPIO (0x0000)
46601 +/* Bit definitions and macros for PAR_SSI */
46602 +#define MCF_GPIO_PAR_SSI_MCLK (0x0001)
46603 +#define MCF_GPIO_PAR_SSI_STXD(x) (((x)&0x0003)<<2)
46604 +#define MCF_GPIO_PAR_SSI_SRXD(x) (((x)&0x0003)<<4)
46605 +#define MCF_GPIO_PAR_SSI_FS(x) (((x)&0x0003)<<6)
46606 +#define MCF_GPIO_PAR_SSI_BCLK(x) (((x)&0x0003)<<8)
46607 +#define MCF_GPIO_PAR_SSI_BCLK_MASK (0xFCFF)
46608 +#define MCF_GPIO_PAR_SSI_BCLK_BCLK (0x0300)
46609 +#define MCF_GPIO_PAR_SSI_BCLK_U1CTS (0x0200)
46610 +#define MCF_GPIO_PAR_SSI_BCLK_GPIO (0x0000)
46611 +#define MCF_GPIO_PAR_SSI_FS_MASK (0xFF3F)
46612 +#define MCF_GPIO_PAR_SSI_FS_FS (0x00C0)
46613 +#define MCF_GPIO_PAR_SSI_FS_U1RTS (0x0080)
46614 +#define MCF_GPIO_PAR_SSI_FS_GPIO (0x0000)
46615 +#define MCF_GPIO_PAR_SSI_SRXD_MASK (0xFFCF)
46616 +#define MCF_GPIO_PAR_SSI_SRXD_SRXD (0x0030)
46617 +#define MCF_GPIO_PAR_SSI_SRXD_U1RXD (0x0020)
46618 +#define MCF_GPIO_PAR_SSI_SRXD_GPIO (0x0000)
46619 +#define MCF_GPIO_PAR_SSI_STXD_MASK (0xFFF3)
46620 +#define MCF_GPIO_PAR_SSI_STXD_STXD (0x000C)
46621 +#define MCF_GPIO_PAR_SSI_STXD_U1TXD (0x0008)
46622 +#define MCF_GPIO_PAR_SSI_STXD_GPIO (0x0000)
46623 +#define MCF_GPIO_PAR_SSI_MCLK_MCLK (0x0001)
46624 +#define MCF_GPIO_PAR_SSI_MCLK_GPIO (0x0000)
46626 +/* Bit definitions and macros for PAR_ATA */
46627 +#define MCF_GPIO_PAR_ATA_IORDY (0x0001)
46628 +#define MCF_GPIO_PAR_ATA_DMARQ (0x0002)
46629 +#define MCF_GPIO_PAR_ATA_RESET (0x0004)
46630 +#define MCF_GPIO_PAR_ATA_DA0 (0x0020)
46631 +#define MCF_GPIO_PAR_ATA_DA1 (0x0040)
46632 +#define MCF_GPIO_PAR_ATA_DA2 (0x0080)
46633 +#define MCF_GPIO_PAR_ATA_CS0 (0x0100)
46634 +#define MCF_GPIO_PAR_ATA_CS1 (0x0200)
46635 +#define MCF_GPIO_PAR_ATA_BUFEN (0x0400)
46636 +#define MCF_GPIO_PAR_ATA_BUFEN_BUFEN (0x0400)
46637 +#define MCF_GPIO_PAR_ATA_BUFEN_GPIO (0x0000)
46638 +#define MCF_GPIO_PAR_ATA_CS1_CS1 (0x0200)
46639 +#define MCF_GPIO_PAR_ATA_CS1_GPIO (0x0000)
46640 +#define MCF_GPIO_PAR_ATA_CS0_CS0 (0x0100)
46641 +#define MCF_GPIO_PAR_ATA_CS0_GPIO (0x0000)
46642 +#define MCF_GPIO_PAR_ATA_DA2_DA2 (0x0080)
46643 +#define MCF_GPIO_PAR_ATA_DA2_GPIO (0x0000)
46644 +#define MCF_GPIO_PAR_ATA_DA1_DA1 (0x0040)
46645 +#define MCF_GPIO_PAR_ATA_DA1_GPIO (0x0000)
46646 +#define MCF_GPIO_PAR_ATA_DA0_DA0 (0x0020)
46647 +#define MCF_GPIO_PAR_ATA_DA0_GPIO (0x0000)
46648 +#define MCF_GPIO_PAR_ATA_RESET_RESET (0x0004)
46649 +#define MCF_GPIO_PAR_ATA_RESET_GPIO (0x0000)
46650 +#define MCF_GPIO_PAR_ATA_DMARQ_DMARQ (0x0002)
46651 +#define MCF_GPIO_PAR_ATA_DMARQ_GPIO (0x0000)
46652 +#define MCF_GPIO_PAR_ATA_IORDY_IORDY (0x0001)
46653 +#define MCF_GPIO_PAR_ATA_IORDY_GPIO (0x0000)
46655 +/* Bit definitions and macros for PAR_IRQ */
46656 +#define MCF_GPIO_PAR_IRQ_IRQ1 (0x02)
46657 +#define MCF_GPIO_PAR_IRQ_IRQ4 (0x10)
46658 +#define MCF_GPIO_PAR_IRQ_IRQ4_IRQ4 (0x10)
46659 +#define MCF_GPIO_PAR_IRQ_IRQ4_GPIO (0x00)
46660 +#define MCF_GPIO_PAR_IRQ_IRQ1_IRQ1 (0x02)
46661 +#define MCF_GPIO_PAR_IRQ_IRQ1_GPIO (0x00)
46663 +/* Bit definitions and macros for PAR_PCI */
46664 +#define MCF_GPIO_PAR_PCI_REQ0 (0x0001)
46665 +#define MCF_GPIO_PAR_PCI_REQ1 (0x0004)
46666 +#define MCF_GPIO_PAR_PCI_REQ2 (0x0010)
46667 +#define MCF_GPIO_PAR_PCI_REQ3(x) (((x)&0x0003)<<6)
46668 +#define MCF_GPIO_PAR_PCI_GNT0 (0x0100)
46669 +#define MCF_GPIO_PAR_PCI_GNT1 (0x0400)
46670 +#define MCF_GPIO_PAR_PCI_GNT2 (0x1000)
46671 +#define MCF_GPIO_PAR_PCI_GNT3(x) (((x)&0x0003)<<14)
46672 +#define MCF_GPIO_PAR_PCI_GNT3_MASK (0x3FFF)
46673 +#define MCF_GPIO_PAR_PCI_GNT3_GNT3 (0xC000)
46674 +#define MCF_GPIO_PAR_PCI_GNT3_ATA_DMACK (0x8000)
46675 +#define MCF_GPIO_PAR_PCI_GNT3_GPIO (0x0000)
46676 +#define MCF_GPIO_PAR_PCI_GNT2_GNT2 (0x1000)
46677 +#define MCF_GPIO_PAR_PCI_GNT2_GPIO (0x0000)
46678 +#define MCF_GPIO_PAR_PCI_GNT1_GNT1 (0x0400)
46679 +#define MCF_GPIO_PAR_PCI_GNT1_GPIO (0x0000)
46680 +#define MCF_GPIO_PAR_PCI_GNT0_GNT0 (0x0100)
46681 +#define MCF_GPIO_PAR_PCI_GNT0_GPIO (0x0000)
46682 +#define MCF_GPIO_PAR_PCI_REQ3_MASK (0xFF3F)
46683 +#define MCF_GPIO_PAR_PCI_REQ3_REQ3 (0x00C0)
46684 +#define MCF_GPIO_PAR_PCI_REQ3_ATA_INTRQ (0x0080)
46685 +#define MCF_GPIO_PAR_PCI_REQ3_GPIO (0x0000)
46686 +#define MCF_GPIO_PAR_PCI_REQ2_REQ2 (0x0010)
46687 +#define MCF_GPIO_PAR_PCI_REQ2_GPIO (0x0000)
46688 +#define MCF_GPIO_PAR_PCI_REQ1_REQ1 (0x0040)
46689 +#define MCF_GPIO_PAR_PCI_REQ1_GPIO (0x0000)
46690 +#define MCF_GPIO_PAR_PCI_REQ0_REQ0 (0x0001)
46691 +#define MCF_GPIO_PAR_PCI_REQ0_GPIO (0x0000)
46693 +/* Bit definitions and macros for MSCR_SDRAM */
46694 +#define MCF_GPIO_MSCR_SDRAM_SDCTL(x) (((x)&0x03))
46695 +#define MCF_GPIO_MSCR_SDRAM_SDCLK(x) (((x)&0x03)<<2)
46696 +#define MCF_GPIO_MSCR_SDRAM_SDDQS(x) (((x)&0x03)<<4)
46697 +#define MCF_GPIO_MSCR_SDRAM_SDDATA(x) (((x)&0x03)<<6)
46698 +#define MCF_GPIO_MSCR_SDRAM_SDDATA_MASK (0x3F)
46699 +#define MCF_GPIO_MSCR_SDRAM_SDDATA_DDR1 (0xC0)
46700 +#define MCF_GPIO_MSCR_SDRAM_SDDATA_DDR2 (0x80)
46701 +#define MCF_GPIO_MSCR_SDRAM_SDDATA_FS_LPDDR (0x40)
46702 +#define MCF_GPIO_MSCR_SDRAM_SDDATA_HS_LPDDR (0x00)
46703 +#define MCF_GPIO_MSCR_SDRAM_SDDQS_MASK (0xCF)
46704 +#define MCF_GPIO_MSCR_SDRAM_SDDQS_DDR1 (0x30)
46705 +#define MCF_GPIO_MSCR_SDRAM_SDDQS_DDR2 (0x20)
46706 +#define MCF_GPIO_MSCR_SDRAM_SDDQS_FS_LPDDR (0x10)
46707 +#define MCF_GPIO_MSCR_SDRAM_SDDQS_HS_LPDDR (0x00)
46708 +#define MCF_GPIO_MSCR_SDRAM_SDCLK_MASK (0xF3)
46709 +#define MCF_GPIO_MSCR_SDRAM_SDCLK_DDR1 (0x0C)
46710 +#define MCF_GPIO_MSCR_SDRAM_SDCLK_DDR2 (0x08)
46711 +#define MCF_GPIO_MSCR_SDRAM_SDCLK_FS_LPDDR (0x04)
46712 +#define MCF_GPIO_MSCR_SDRAM_SDCLK_HS_LPDDR (0x00)
46713 +#define MCF_GPIO_MSCR_SDRAM_SDCTL_MASK (0xFC)
46714 +#define MCF_GPIO_MSCR_SDRAM_SDCTL_DDR1 (0x03)
46715 +#define MCF_GPIO_MSCR_SDRAM_SDCTL_DDR2 (0x02)
46716 +#define MCF_GPIO_MSCR_SDRAM_SDCTL_FS_LPDDR (0x01)
46717 +#define MCF_GPIO_MSCR_SDRAM_SDCTL_HS_LPDDR (0x00)
46719 +/* Bit definitions and macros for MSCR_PCI */
46720 +#define MCF_GPIO_MSCR_PCI_PCI (0x01)
46721 +#define MCF_GPIO_MSCR_PCI_PCI_HI_66MHZ (0x01)
46722 +#define MCF_GPIO_MSCR_PCI_PCI_LO_33MHZ (0x00)
46724 +/* Bit definitions and macros for DSCR_I2C */
46725 +#define MCF_GPIO_DSCR_I2C_I2C(x) (((x)&0x03))
46726 +#define MCF_GPIO_DSCR_I2C_I2C_LOAD_50PF (0x03)
46727 +#define MCF_GPIO_DSCR_I2C_I2C_LOAD_30PF (0x02)
46728 +#define MCF_GPIO_DSCR_I2C_I2C_LOAD_20PF (0x01)
46729 +#define MCF_GPIO_DSCR_I2C_I2C_LOAD_10PF (0x00)
46731 +/* Bit definitions and macros for DSCR_FLEXBUS */
46732 +#define MCF_GPIO_DSCR_FLEXBUS_FBADL(x) (((x)&0x03))
46733 +#define MCF_GPIO_DSCR_FLEXBUS_FBADH(x) (((x)&0x03)<<2)
46734 +#define MCF_GPIO_DSCR_FLEXBUS_FBCTL(x) (((x)&0x03)<<4)
46735 +#define MCF_GPIO_DSCR_FLEXBUS_FBCLK(x) (((x)&0x03)<<6)
46736 +#define MCF_GPIO_DSCR_FLEXBUS_FBCLK_LOAD_50PF (0xC0)
46737 +#define MCF_GPIO_DSCR_FLEXBUS_FBCLK_LOAD_30P (0x80)
46738 +#define MCF_GPIO_DSCR_FLEXBUS_FBCLK_LOAD_20PF (0x40)
46739 +#define MCF_GPIO_DSCR_FLEXBUS_FBCLK_LOAD_10PF (0x00)
46740 +#define MCF_GPIO_DSCR_FLEXBUS_FBCTL_LOAD_50PF (0x30)
46741 +#define MCF_GPIO_DSCR_FLEXBUS_FBCTL_LOAD_30PF (0x20)
46742 +#define MCF_GPIO_DSCR_FLEXBUS_FBCTL_LOAD_20PF (0x10)
46743 +#define MCF_GPIO_DSCR_FLEXBUS_FBCTL_LOAD_10PF (0x00)
46744 +#define MCF_GPIO_DSCR_FLEXBUS_FBADH_LOAD_50PF (0x0C)
46745 +#define MCF_GPIO_DSCR_FLEXBUS_FBADH_LOAD_30PF (0x08)
46746 +#define MCF_GPIO_DSCR_FLEXBUS_FBADH_LOAD_20PF (0x04)
46747 +#define MCF_GPIO_DSCR_FLEXBUS_FBADH_LOAD_10PF (0x00)
46748 +#define MCF_GPIO_DSCR_FLEXBUS_FBADL_LOAD_50PF (0x03)
46749 +#define MCF_GPIO_DSCR_FLEXBUS_FBADL_LOAD_30PF (0x02)
46750 +#define MCF_GPIO_DSCR_FLEXBUS_FBADL_LOAD_20PF (0x01)
46751 +#define MCF_GPIO_DSCR_FLEXBUS_FBADL_LOAD_10PF (0x00)
46753 +/* Bit definitions and macros for DSCR_FEC */
46754 +#define MCF_GPIO_DSCR_FEC_FEC0(x) (((x)&0x03))
46755 +#define MCF_GPIO_DSCR_FEC_FEC1(x) (((x)&0x03)<<2)
46756 +#define MCF_GPIO_DSCR_FEC_FEC1_LOAD_50PF (0x0C)
46757 +#define MCF_GPIO_DSCR_FEC_FEC1_LOAD_30PF (0x08)
46758 +#define MCF_GPIO_DSCR_FEC_FEC1_LOAD_20PF (0x04)
46759 +#define MCF_GPIO_DSCR_FEC_FEC1_LOAD_10PF (0x00)
46760 +#define MCF_GPIO_DSCR_FEC_FEC0_LOAD_50PF (0x03)
46761 +#define MCF_GPIO_DSCR_FEC_FEC0_LOAD_30PF (0x02)
46762 +#define MCF_GPIO_DSCR_FEC_FEC0_LOAD_20PF (0x01)
46763 +#define MCF_GPIO_DSCR_FEC_FEC0_LOAD_10PF (0x00)
46765 +/* Bit definitions and macros for DSCR_UART */
46766 +#define MCF_GPIO_DSCR_UART_UART0(x) (((x)&0x03))
46767 +#define MCF_GPIO_DSCR_UART_UART1(x) (((x)&0x03)<<2)
46768 +#define MCF_GPIO_DSCR_UART_UART1_LOAD_50PF (0x0C)
46769 +#define MCF_GPIO_DSCR_UART_UART1_LOAD_30PF (0x08)
46770 +#define MCF_GPIO_DSCR_UART_UART1_LOAD_20PF (0x04)
46771 +#define MCF_GPIO_DSCR_UART_UART1_LOAD_10PF (0x00)
46772 +#define MCF_GPIO_DSCR_UART_UART0_LOAD_50PF (0x03)
46773 +#define MCF_GPIO_DSCR_UART_UART0_LOAD_30PF (0x02)
46774 +#define MCF_GPIO_DSCR_UART_UART0_LOAD_20PF (0x01)
46775 +#define MCF_GPIO_DSCR_UART_UART0_LOAD_10PF (0x00)
46777 +/* Bit definitions and macros for DSCR_DSPI */
46778 +#define MCF_GPIO_DSCR_DSPI_DSPI(x) (((x)&0x03))
46779 +#define MCF_GPIO_DSCR_DSPI_DSPI_LOAD_50PF (0x03)
46780 +#define MCF_GPIO_DSCR_DSPI_DSPI_LOAD_30PF (0x02)
46781 +#define MCF_GPIO_DSCR_DSPI_DSPI_LOAD_20PF (0x01)
46782 +#define MCF_GPIO_DSCR_DSPI_DSPI_LOAD_10PF (0x00)
46784 +/* Bit definitions and macros for DSCR_TIMER */
46785 +#define MCF_GPIO_DSCR_TIMER_TIMER(x) (((x)&0x03))
46786 +#define MCF_GPIO_DSCR_TIMER_TIMER_LOAD_50PF (0x03)
46787 +#define MCF_GPIO_DSCR_TIMER_TIMER_LOAD_30PF (0x02)
46788 +#define MCF_GPIO_DSCR_TIMER_TIMER_LOAD_20PF (0x01)
46789 +#define MCF_GPIO_DSCR_TIMER_TIMER_LOAD_10PF (0x00)
46791 +/* Bit definitions and macros for DSCR_SSI */
46792 +#define MCF_GPIO_DSCR_SSI_SSI(x) (((x)&0x03))
46793 +#define MCF_GPIO_DSCR_SSI_SSI_LOAD_50PF (0x03)
46794 +#define MCF_GPIO_DSCR_SSI_SSI_LOAD_30PF (0x02)
46795 +#define MCF_GPIO_DSCR_SSI_SSI_LOAD_20PF (0x01)
46796 +#define MCF_GPIO_DSCR_SSI_SSI_LOAD_10PF (0x00)
46798 +/* Bit definitions and macros for DSCR_DMA */
46799 +#define MCF_GPIO_DSCR_DMA_DMA(x) (((x)&0x03))
46800 +#define MCF_GPIO_DSCR_DMA_DMA_LOAD_50PF (0x03)
46801 +#define MCF_GPIO_DSCR_DMA_DMA_LOAD_30PF (0x02)
46802 +#define MCF_GPIO_DSCR_DMA_DMA_LOAD_20PF (0x01)
46803 +#define MCF_GPIO_DSCR_DMA_DMA_LOAD_10PF (0x00)
46805 +/* Bit definitions and macros for DSCR_DEBUG */
46806 +#define MCF_GPIO_DSCR_DEBUG_DEBUG(x) (((x)&0x03))
46807 +#define MCF_GPIO_DSCR_DEBUG_DEBUG_LOAD_50PF (0x03)
46808 +#define MCF_GPIO_DSCR_DEBUG_DEBUG_LOAD_30PF (0x02)
46809 +#define MCF_GPIO_DSCR_DEBUG_DEBUG_LOAD_20PF (0x01)
46810 +#define MCF_GPIO_DSCR_DEBUG_DEBUG_LOAD_10PF (0x00)
46812 +/* Bit definitions and macros for DSCR_RESET */
46813 +#define MCF_GPIO_DSCR_RESET_RESET(x) (((x)&0x03))
46814 +#define MCF_GPIO_DSCR_RESET_RESET_LOAD_50PF (0x03)
46815 +#define MCF_GPIO_DSCR_RESET_RESET_LOAD_30PF (0x02)
46816 +#define MCF_GPIO_DSCR_RESET_RESET_LOAD_20PF (0x01)
46817 +#define MCF_GPIO_DSCR_RESET_RESET_LOAD_10PF (0x00)
46819 +/* Bit definitions and macros for DSCR_IRQ */
46820 +#define MCF_GPIO_DSCR_IRQ_IRQ(x) (((x)&0x03))
46821 +#define MCF_GPIO_DSCR_IRQ_IRQ_LOAD_50PF (0x03)
46822 +#define MCF_GPIO_DSCR_IRQ_IRQ_LOAD_30PF (0x02)
46823 +#define MCF_GPIO_DSCR_IRQ_IRQ_LOAD_20PF (0x01)
46824 +#define MCF_GPIO_DSCR_IRQ_IRQ_LOAD_10PF (0x00)
46826 +/* Bit definitions and macros for DSCR_USB */
46827 +#define MCF_GPIO_DSCR_USB_USB(x) (((x)&0x03))
46828 +#define MCF_GPIO_DSCR_USB_USB_LOAD_50PF (0x03)
46829 +#define MCF_GPIO_DSCR_USB_USB_LOAD_30PF (0x02)
46830 +#define MCF_GPIO_DSCR_USB_USB_LOAD_20PF (0x01)
46831 +#define MCF_GPIO_DSCR_USB_USB_LOAD_10PF (0x00)
46833 +/* Bit definitions and macros for DSCR_ATA */
46834 +#define MCF_GPIO_DSCR_ATA_ATA(x) (((x)&0x03))
46835 +#define MCF_GPIO_DSCR_ATA_ATA_LOAD_50PF (0x03)
46836 +#define MCF_GPIO_DSCR_ATA_ATA_LOAD_30PF (0x02)
46837 +#define MCF_GPIO_DSCR_ATA_ATA_LOAD_20PF (0x01)
46838 +#define MCF_GPIO_DSCR_ATA_ATA_LOAD_10PF (0x00)
46840 +/********************************************************************/
46842 +#endif /* __MCF5445X_GPIO_H__ */
46844 +++ b/include/asm-m68k/mcf5445x_i2c.h
46847 + * Matt Waddel Matt.Waddel@freescale.com
46849 + * Copyright Freescale Semiconductor, Inc. 2007
46851 + * This program is free software; you can redistribute it and/or modify it
46852 + * under the terms of the GNU General Public License as published by the
46853 + * Free Software Foundation; either version 2 of the License, or (at your
46854 + * option) any later version.
46857 +#ifndef __MCF5445X_I2C_H__
46858 +#define __MCF5445X_I2C_H__
46860 +/*********************************************************************
46862 +* I2C Module (I2C)
46864 +*********************************************************************/
46866 +/* Register read/write macros */
46867 +#define MCF_I2C_I2ADR (volatile u8 *)(0xFC058000)
46868 +#define MCF_I2C_I2FDR (volatile u8 *)(0xFC058004)
46869 +#define MCF_I2C_I2CR (volatile u8 *)(0xFC058008)
46870 +#define MCF_I2C_I2SR (volatile u8 *)(0xFC05800C)
46871 +#define MCF_I2C_I2DR (volatile u8 *)(0xFC058010)
46873 +/* Bit definitions and macros for I2AR */
46874 +#define MCF_I2C_I2AR_ADR(x) (((x)&0x7F)<<1)
46876 +/* Bit definitions and macros for I2FDR */
46877 +#define MCF_I2C_I2FDR_IC(x) (((x)&0x3F))
46879 +/* Bit definitions and macros for I2DR */
46880 +#define MCF_I2C_I2DR_DATA(x) (x)
46882 +/********************************************************************/
46884 +#endif /* __MCF5445X_I2C_H__ */
46886 +++ b/include/asm-m68k/mcf5445x_intc.h
46889 + * Matt Waddel Matt.Waddel@freescale.com
46891 + * Copyright Freescale Semiconductor, Inc. 2007
46893 + * This program is free software; you can redistribute it and/or modify it
46894 + * under the terms of the GNU General Public License as published by the
46895 + * Free Software Foundation; either version 2 of the License, or (at your
46896 + * option) any later version.
46899 +#ifndef __MCF5445X_INTC_H__
46900 +#define __MCF5445X_INTC_H__
46902 +/*********************************************************************
46904 +* Interrupt Controller (INTC)
46906 +*********************************************************************/
46908 +/* Register read/write macros */
46909 +#define MCF_INTC0_IPRH MCF_REG32(0xFC048000)
46910 +#define MCF_INTC0_IPRL MCF_REG32(0xFC048004)
46911 +#define MCF_INTC0_IMRH MCF_REG32(0xFC048008)
46912 +#define MCF_INTC0_IMRL MCF_REG32(0xFC04800C)
46913 +#define MCF_INTC0_INTFRCH MCF_REG32(0xFC048010)
46914 +#define MCF_INTC0_INTFRCL MCF_REG32(0xFC048014)
46915 +#define MCF_INTC0_ICONFIG MCF_REG16(0xFC04801A)
46916 +#define MCF_INTC0_SIMR MCF_REG08(0xFC04801C)
46917 +#define MCF_INTC0_CIMR MCF_REG08(0xFC04801D)
46918 +#define MCF_INTC0_CLMASK MCF_REG08(0xFC04801E)
46919 +#define MCF_INTC0_SLMASK MCF_REG08(0xFC04801F)
46920 +#define MCF_INTC0_ICR1 MCF_REG08(0xFC048041)
46921 +#define MCF_INTC0_ICR2 MCF_REG08(0xFC048042)
46922 +#define MCF_INTC0_ICR3 MCF_REG08(0xFC048043)
46923 +#define MCF_INTC0_ICR4 MCF_REG08(0xFC048044)
46924 +#define MCF_INTC0_ICR5 MCF_REG08(0xFC048045)
46925 +#define MCF_INTC0_ICR6 MCF_REG08(0xFC048046)
46926 +#define MCF_INTC0_ICR7 MCF_REG08(0xFC048047)
46927 +#define MCF_INTC0_ICR8 MCF_REG08(0xFC048048)
46928 +#define MCF_INTC0_ICR9 MCF_REG08(0xFC048049)
46929 +#define MCF_INTC0_ICR10 MCF_REG08(0xFC04804A)
46930 +#define MCF_INTC0_ICR11 MCF_REG08(0xFC04804B)
46931 +#define MCF_INTC0_ICR12 MCF_REG08(0xFC04804C)
46932 +#define MCF_INTC0_ICR13 MCF_REG08(0xFC04804D)
46933 +#define MCF_INTC0_ICR14 MCF_REG08(0xFC04804E)
46934 +#define MCF_INTC0_ICR15 MCF_REG08(0xFC04804F)
46935 +#define MCF_INTC0_ICR16 MCF_REG08(0xFC048050)
46936 +#define MCF_INTC0_ICR17 MCF_REG08(0xFC048051)
46937 +#define MCF_INTC0_ICR18 MCF_REG08(0xFC048052)
46938 +#define MCF_INTC0_ICR19 MCF_REG08(0xFC048053)
46939 +#define MCF_INTC0_ICR20 MCF_REG08(0xFC048054)
46940 +#define MCF_INTC0_ICR21 MCF_REG08(0xFC048055)
46941 +#define MCF_INTC0_ICR22 MCF_REG08(0xFC048056)
46942 +#define MCF_INTC0_ICR23 MCF_REG08(0xFC048057)
46943 +#define MCF_INTC0_ICR24 MCF_REG08(0xFC048058)
46944 +#define MCF_INTC0_ICR25 MCF_REG08(0xFC048059)
46945 +#define MCF_INTC0_ICR26 MCF_REG08(0xFC04805A)
46946 +#define MCF_INTC0_ICR27 MCF_REG08(0xFC04805B)
46947 +#define MCF_INTC0_ICR28 MCF_REG08(0xFC04805C)
46948 +#define MCF_INTC0_ICR29 MCF_REG08(0xFC04805D)
46949 +#define MCF_INTC0_ICR30 MCF_REG08(0xFC04805E)
46950 +#define MCF_INTC0_ICR31 MCF_REG08(0xFC04805F)
46951 +#define MCF_INTC0_ICR32 MCF_REG08(0xFC048060)
46952 +#define MCF_INTC0_ICR33 MCF_REG08(0xFC048061)
46953 +#define MCF_INTC0_ICR34 MCF_REG08(0xFC048062)
46954 +#define MCF_INTC0_ICR35 MCF_REG08(0xFC048063)
46955 +#define MCF_INTC0_ICR36 MCF_REG08(0xFC048064)
46956 +#define MCF_INTC0_ICR37 MCF_REG08(0xFC048065)
46957 +#define MCF_INTC0_ICR38 MCF_REG08(0xFC048066)
46958 +#define MCF_INTC0_ICR39 MCF_REG08(0xFC048067)
46959 +#define MCF_INTC0_ICR40 MCF_REG08(0xFC048068)
46960 +#define MCF_INTC0_ICR41 MCF_REG08(0xFC048069)
46961 +#define MCF_INTC0_ICR42 MCF_REG08(0xFC04806A)
46962 +#define MCF_INTC0_ICR43 MCF_REG08(0xFC04806B)
46963 +#define MCF_INTC0_ICR44 MCF_REG08(0xFC04806C)
46964 +#define MCF_INTC0_ICR45 MCF_REG08(0xFC04806D)
46965 +#define MCF_INTC0_ICR46 MCF_REG08(0xFC04806E)
46966 +#define MCF_INTC0_ICR47 MCF_REG08(0xFC04806F)
46967 +#define MCF_INTC0_ICR48 MCF_REG08(0xFC048070)
46968 +#define MCF_INTC0_ICR49 MCF_REG08(0xFC048071)
46969 +#define MCF_INTC0_ICR50 MCF_REG08(0xFC048072)
46970 +#define MCF_INTC0_ICR51 MCF_REG08(0xFC048073)
46971 +#define MCF_INTC0_ICR52 MCF_REG08(0xFC048074)
46972 +#define MCF_INTC0_ICR53 MCF_REG08(0xFC048075)
46973 +#define MCF_INTC0_ICR54 MCF_REG08(0xFC048076)
46974 +#define MCF_INTC0_ICR55 MCF_REG08(0xFC048077)
46975 +#define MCF_INTC0_ICR56 MCF_REG08(0xFC048078)
46976 +#define MCF_INTC0_ICR57 MCF_REG08(0xFC048079)
46977 +#define MCF_INTC0_ICR58 MCF_REG08(0xFC04807A)
46978 +#define MCF_INTC0_ICR59 MCF_REG08(0xFC04807B)
46979 +#define MCF_INTC0_ICR60 MCF_REG08(0xFC04807C)
46980 +#define MCF_INTC0_ICR61 MCF_REG08(0xFC04807D)
46981 +#define MCF_INTC0_ICR62 MCF_REG08(0xFC04807E)
46982 +#define MCF_INTC0_ICR63 MCF_REG08(0xFC04807F)
46983 +#define MCF_INTC0_SWIACK MCF_REG08(0xFC0480E0)
46984 +#define MCF_INTC0_L1IACK MCF_REG08(0xFC0480E4)
46985 +#define MCF_INTC0_L2IACK MCF_REG08(0xFC0480E8)
46986 +#define MCF_INTC0_L3IACK MCF_REG08(0xFC0480EC)
46987 +#define MCF_INTC0_L4IACK MCF_REG08(0xFC0480F0)
46988 +#define MCF_INTC0_L5IACK MCF_REG08(0xFC0480F4)
46989 +#define MCF_INTC0_L6IACK MCF_REG08(0xFC0480F8)
46990 +#define MCF_INTC0_L7IACK MCF_REG08(0xFC0480FC)
46991 +#define MCF_INTC1_IPRH MCF_REG32(0xFC04C000)
46992 +#define MCF_INTC1_IPRL MCF_REG32(0xFC04C004)
46993 +#define MCF_INTC1_IMRH MCF_REG32(0xFC04C008)
46994 +#define MCF_INTC1_IMRL MCF_REG32(0xFC04C00C)
46995 +#define MCF_INTC1_INTFRCH MCF_REG32(0xFC04C010)
46996 +#define MCF_INTC1_INTFRCL MCF_REG32(0xFC04C014)
46997 +#define MCF_INTC1_ICONFIG MCF_REG16(0xFC04C01A)
46998 +#define MCF_INTC1_SIMR MCF_REG08(0xFC04C01C)
46999 +#define MCF_INTC1_CIMR MCF_REG08(0xFC04C01D)
47000 +#define MCF_INTC1_CLMASK MCF_REG08(0xFC04C01E)
47001 +#define MCF_INTC1_SLMASK MCF_REG08(0xFC04C01F)
47002 +#define MCF_INTC1_ICR1 MCF_REG08(0xFC04C041)
47003 +#define MCF_INTC1_ICR2 MCF_REG08(0xFC04C042)
47004 +#define MCF_INTC1_ICR3 MCF_REG08(0xFC04C043)
47005 +#define MCF_INTC1_ICR4 MCF_REG08(0xFC04C044)
47006 +#define MCF_INTC1_ICR5 MCF_REG08(0xFC04C045)
47007 +#define MCF_INTC1_ICR6 MCF_REG08(0xFC04C046)
47008 +#define MCF_INTC1_ICR7 MCF_REG08(0xFC04C047)
47009 +#define MCF_INTC1_ICR8 MCF_REG08(0xFC04C048)
47010 +#define MCF_INTC1_ICR9 MCF_REG08(0xFC04C049)
47011 +#define MCF_INTC1_ICR10 MCF_REG08(0xFC04C04A)
47012 +#define MCF_INTC1_ICR11 MCF_REG08(0xFC04C04B)
47013 +#define MCF_INTC1_ICR12 MCF_REG08(0xFC04C04C)
47014 +#define MCF_INTC1_ICR13 MCF_REG08(0xFC04C04D)
47015 +#define MCF_INTC1_ICR14 MCF_REG08(0xFC04C04E)
47016 +#define MCF_INTC1_ICR15 MCF_REG08(0xFC04C04F)
47017 +#define MCF_INTC1_ICR16 MCF_REG08(0xFC04C050)
47018 +#define MCF_INTC1_ICR17 MCF_REG08(0xFC04C051)
47019 +#define MCF_INTC1_ICR18 MCF_REG08(0xFC04C052)
47020 +#define MCF_INTC1_ICR19 MCF_REG08(0xFC04C053)
47021 +#define MCF_INTC1_ICR20 MCF_REG08(0xFC04C054)
47022 +#define MCF_INTC1_ICR21 MCF_REG08(0xFC04C055)
47023 +#define MCF_INTC1_ICR22 MCF_REG08(0xFC04C056)
47024 +#define MCF_INTC1_ICR23 MCF_REG08(0xFC04C057)
47025 +#define MCF_INTC1_ICR24 MCF_REG08(0xFC04C058)
47026 +#define MCF_INTC1_ICR25 MCF_REG08(0xFC04C059)
47027 +#define MCF_INTC1_ICR26 MCF_REG08(0xFC04C05A)
47028 +#define MCF_INTC1_ICR27 MCF_REG08(0xFC04C05B)
47029 +#define MCF_INTC1_ICR28 MCF_REG08(0xFC04C05C)
47030 +#define MCF_INTC1_ICR29 MCF_REG08(0xFC04C05D)
47031 +#define MCF_INTC1_ICR30 MCF_REG08(0xFC04C05E)
47032 +#define MCF_INTC1_ICR31 MCF_REG08(0xFC04C05F)
47033 +#define MCF_INTC1_ICR32 MCF_REG08(0xFC04C060)
47034 +#define MCF_INTC1_ICR33 MCF_REG08(0xFC04C061)
47035 +#define MCF_INTC1_ICR34 MCF_REG08(0xFC04C062)
47036 +#define MCF_INTC1_ICR35 MCF_REG08(0xFC04C063)
47037 +#define MCF_INTC1_ICR36 MCF_REG08(0xFC04C064)
47038 +#define MCF_INTC1_ICR37 MCF_REG08(0xFC04C065)
47039 +#define MCF_INTC1_ICR38 MCF_REG08(0xFC04C066)
47040 +#define MCF_INTC1_ICR39 MCF_REG08(0xFC04C067)
47041 +#define MCF_INTC1_ICR40 MCF_REG08(0xFC04C068)
47042 +#define MCF_INTC1_ICR41 MCF_REG08(0xFC04C069)
47043 +#define MCF_INTC1_ICR42 MCF_REG08(0xFC04C06A)
47044 +#define MCF_INTC1_ICR43 MCF_REG08(0xFC04C06B)
47045 +#define MCF_INTC1_ICR44 MCF_REG08(0xFC04C06C)
47046 +#define MCF_INTC1_ICR45 MCF_REG08(0xFC04C06D)
47047 +#define MCF_INTC1_ICR46 MCF_REG08(0xFC04C06E)
47048 +#define MCF_INTC1_ICR47 MCF_REG08(0xFC04C06F)
47049 +#define MCF_INTC1_ICR48 MCF_REG08(0xFC04C070)
47050 +#define MCF_INTC1_ICR49 MCF_REG08(0xFC04C071)
47051 +#define MCF_INTC1_ICR50 MCF_REG08(0xFC04C072)
47052 +#define MCF_INTC1_ICR51 MCF_REG08(0xFC04C073)
47053 +#define MCF_INTC1_ICR52 MCF_REG08(0xFC04C074)
47054 +#define MCF_INTC1_ICR53 MCF_REG08(0xFC04C075)
47055 +#define MCF_INTC1_ICR54 MCF_REG08(0xFC04C076)
47056 +#define MCF_INTC1_ICR55 MCF_REG08(0xFC04C077)
47057 +#define MCF_INTC1_ICR56 MCF_REG08(0xFC04C078)
47058 +#define MCF_INTC1_ICR57 MCF_REG08(0xFC04C079)
47059 +#define MCF_INTC1_ICR58 MCF_REG08(0xFC04C07A)
47060 +#define MCF_INTC1_ICR59 MCF_REG08(0xFC04C07B)
47061 +#define MCF_INTC1_ICR60 MCF_REG08(0xFC04C07C)
47062 +#define MCF_INTC1_ICR61 MCF_REG08(0xFC04C07D)
47063 +#define MCF_INTC1_ICR62 MCF_REG08(0xFC04C07E)
47064 +#define MCF_INTC1_ICR63 MCF_REG08(0xFC04C07F)
47065 +#define MCF_INTC1_SWIACK MCF_REG08(0xFC04C0E0)
47066 +#define MCF_INTC1_L1IACK MCF_REG08(0xFC04C0E4)
47067 +#define MCF_INTC1_L2IACK MCF_REG08(0xFC04C0E8)
47068 +#define MCF_INTC1_L3IACK MCF_REG08(0xFC04C0EC)
47069 +#define MCF_INTC1_L4IACK MCF_REG08(0xFC04C0F0)
47070 +#define MCF_INTC1_L5IACK MCF_REG08(0xFC04C0F4)
47071 +#define MCF_INTC1_L6IACK MCF_REG08(0xFC04C0F8
47072 +#define MCF_INTC1_L7IACK MCF_REG08(0xFC04C0FC)
47074 +/* Parameterized register read/write macros for multiple registers */
47075 +#define MCF_INTC0_ICR(x) MCF_REG08(0xFC048041+((x-1)*0x001))
47076 +#define MCF_INTC0_LIACK(x) MCF_REG08(0xFC0480E4+((x-1)*0x004))
47077 +#define MCF_INTC1_ICR(x) MCF_REG08(0xFC04C041+((x-1)*0x001))
47078 +#define MCF_INTC1_LIACK(x) MCF_REG08(0xFC04C0E4+((x-1)*0x004))
47080 +/* Parameterized register read/write macros for multiple modules */
47081 +#define MCF_INTC_IPRH(x) MCF_REG32(0xFC048000+((x)*0x4000))
47082 +#define MCF_INTC_IPRL(x) MCF_REG32(0xFC048004+((x)*0x4000))
47083 +#define MCF_INTC_IMRH(x) MCF_REG32(0xFC048008+((x)*0x4000))
47084 +#define MCF_INTC_IMRL(x) MCF_REG32(0xFC04800C+((x)*0x4000))
47085 +#define MCF_INTC_INTFRCH(x) MCF_REG32(0xFC048010+((x)*0x4000))
47086 +#define MCF_INTC_INTFRCL(x) MCF_REG32(0xFC048014+((x)*0x4000))
47087 +#define MCF_INTC_ICONFIG(x) MCF_REG16(0xFC04801A+((x)*0x4000))
47088 +#define MCF_INTC_SIMR(x) MCF_REG08(0xFC04801C+((x)*0x4000))
47089 +#define MCF_INTC_CIMR(x) MCF_REG08(0xFC04801D+((x)*0x4000))
47090 +#define MCF_INTC_CLMASK(x) MCF_REG08(0xFC04801E+((x)*0x4000))
47091 +#define MCF_INTC_SLMASK(x) MCF_REG08(0xFC04801F+((x)*0x4000))
47092 +#define MCF_INTC_ICR1(x) MCF_REG08(0xFC048041+((x)*0x4000))
47093 +#define MCF_INTC_ICR2(x) MCF_REG08(0xFC048042+((x)*0x4000))
47094 +#define MCF_INTC_ICR3(x) MCF_REG08(0xFC048043+((x)*0x4000))
47095 +#define MCF_INTC_ICR4(x) MCF_REG08(0xFC048044+((x)*0x4000))
47096 +#define MCF_INTC_ICR5(x) MCF_REG08(0xFC048045+((x)*0x4000))
47097 +#define MCF_INTC_ICR6(x) MCF_REG08(0xFC048046+((x)*0x4000))
47098 +#define MCF_INTC_ICR7(x) MCF_REG08(0xFC048047+((x)*0x4000))
47099 +#define MCF_INTC_ICR8(x) MCF_REG08(0xFC048048+((x)*0x4000))
47100 +#define MCF_INTC_ICR9(x) MCF_REG08(0xFC048049+((x)*0x4000))
47101 +#define MCF_INTC_ICR10(x) MCF_REG08(0xFC04804A+((x)*0x4000))
47102 +#define MCF_INTC_ICR11(x) MCF_REG08(0xFC04804B+((x)*0x4000))
47103 +#define MCF_INTC_ICR12(x) MCF_REG08(0xFC04804C+((x)*0x4000))
47104 +#define MCF_INTC_ICR13(x) MCF_REG08(0xFC04804D+((x)*0x4000))
47105 +#define MCF_INTC_ICR14(x) MCF_REG08(0xFC04804E+((x)*0x4000))
47106 +#define MCF_INTC_ICR15(x) MCF_REG08(0xFC04804F+((x)*0x4000))
47107 +#define MCF_INTC_ICR16(x) MCF_REG08(0xFC048050+((x)*0x4000))
47108 +#define MCF_INTC_ICR17(x) MCF_REG08(0xFC048051+((x)*0x4000))
47109 +#define MCF_INTC_ICR18(x) MCF_REG08(0xFC048052+((x)*0x4000))
47110 +#define MCF_INTC_ICR19(x) MCF_REG08(0xFC048053+((x)*0x4000))
47111 +#define MCF_INTC_ICR20(x) MCF_REG08(0xFC048054+((x)*0x4000))
47112 +#define MCF_INTC_ICR21(x) MCF_REG08(0xFC048055+((x)*0x4000))
47113 +#define MCF_INTC_ICR22(x) MCF_REG08(0xFC048056+((x)*0x4000))
47114 +#define MCF_INTC_ICR23(x) MCF_REG08(0xFC048057+((x)*0x4000))
47115 +#define MCF_INTC_ICR24(x) MCF_REG08(0xFC048058+((x)*0x4000))
47116 +#define MCF_INTC_ICR25(x) MCF_REG08(0xFC048059+((x)*0x4000))
47117 +#define MCF_INTC_ICR26(x) MCF_REG08(0xFC04805A+((x)*0x4000))
47118 +#define MCF_INTC_ICR27(x) MCF_REG08(0xFC04805B+((x)*0x4000))
47119 +#define MCF_INTC_ICR28(x) MCF_REG08(0xFC04805C+((x)*0x4000))
47120 +#define MCF_INTC_ICR29(x) MCF_REG08(0xFC04805D+((x)*0x4000))
47121 +#define MCF_INTC_ICR30(x) MCF_REG08(0xFC04805E+((x)*0x4000))
47122 +#define MCF_INTC_ICR31(x) MCF_REG08(0xFC04805F+((x)*0x4000))
47123 +#define MCF_INTC_ICR32(x) MCF_REG08(0xFC048060+((x)*0x4000))
47124 +#define MCF_INTC_ICR33(x) MCF_REG08(0xFC048061+((x)*0x4000))
47125 +#define MCF_INTC_ICR34(x) MCF_REG08(0xFC048062+((x)*0x4000))
47126 +#define MCF_INTC_ICR35(x) MCF_REG08(0xFC048063+((x)*0x4000))
47127 +#define MCF_INTC_ICR36(x) MCF_REG08(0xFC048064+((x)*0x4000))
47128 +#define MCF_INTC_ICR37(x) MCF_REG08(0xFC048065+((x)*0x4000))
47129 +#define MCF_INTC_ICR38(x) MCF_REG08(0xFC048066+((x)*0x4000))
47130 +#define MCF_INTC_ICR39(x) MCF_REG08(0xFC048067+((x)*0x4000))
47131 +#define MCF_INTC_ICR40(x) MCF_REG08(0xFC048068+((x)*0x4000))
47132 +#define MCF_INTC_ICR41(x) MCF_REG08(0xFC048069+((x)*0x4000))
47133 +#define MCF_INTC_ICR42(x) MCF_REG08(0xFC04806A+((x)*0x4000))
47134 +#define MCF_INTC_ICR43(x) MCF_REG08(0xFC04806B+((x)*0x4000))
47135 +#define MCF_INTC_ICR44(x) MCF_REG08(0xFC04806C+((x)*0x4000))
47136 +#define MCF_INTC_ICR45(x) MCF_REG08(0xFC04806D+((x)*0x4000))
47137 +#define MCF_INTC_ICR46(x) MCF_REG08(0xFC04806E+((x)*0x4000))
47138 +#define MCF_INTC_ICR47(x) MCF_REG08(0xFC04806F+((x)*0x4000))
47139 +#define MCF_INTC_ICR48(x) MCF_REG08(0xFC048070+((x)*0x4000))
47140 +#define MCF_INTC_ICR49(x) MCF_REG08(0xFC048071+((x)*0x4000))
47141 +#define MCF_INTC_ICR50(x) MCF_REG08(0xFC048072+((x)*0x4000))
47142 +#define MCF_INTC_ICR51(x) MCF_REG08(0xFC048073+((x)*0x4000))
47143 +#define MCF_INTC_ICR52(x) MCF_REG08(0xFC048074+((x)*0x4000))
47144 +#define MCF_INTC_ICR53(x) MCF_REG08(0xFC048075+((x)*0x4000))
47145 +#define MCF_INTC_ICR54(x) MCF_REG08(0xFC048076+((x)*0x4000))
47146 +#define MCF_INTC_ICR55(x) MCF_REG08(0xFC048077+((x)*0x4000))
47147 +#define MCF_INTC_ICR56(x) MCF_REG08(0xFC048078+((x)*0x4000))
47148 +#define MCF_INTC_ICR57(x) MCF_REG08(0xFC048079+((x)*0x4000))
47149 +#define MCF_INTC_ICR58(x) MCF_REG08(0xFC04807A+((x)*0x4000))
47150 +#define MCF_INTC_ICR59(x) MCF_REG08(0xFC04807B+((x)*0x4000))
47151 +#define MCF_INTC_ICR60(x) MCF_REG08(0xFC04807C+((x)*0x4000))
47152 +#define MCF_INTC_ICR61(x) MCF_REG08(0xFC04807D+((x)*0x4000))
47153 +#define MCF_INTC_ICR62(x) MCF_REG08(0xFC04807E+((x)*0x4000))
47154 +#define MCF_INTC_ICR63(x) MCF_REG08(0xFC04807F+((x)*0x4000))
47155 +#define MCF_INTC_SWIACK(x) MCF_REG08(0xFC0480E0+((x)*0x4000))
47156 +#define MCF_INTC_L1IACK(x) MCF_REG08(0xFC0480E4+((x)*0x4000))
47157 +#define MCF_INTC_L2IACK(x) MCF_REG08(0xFC0480E8+((x)*0x4000))
47158 +#define MCF_INTC_L3IACK(x) MCF_REG08(0xFC0480EC+((x)*0x4000))
47159 +#define MCF_INTC_L4IACK(x) MCF_REG08(0xFC0480F0+((x)*0x4000))
47160 +#define MCF_INTC_L5IACK(x) MCF_REG08(0xFC0480F4+((x)*0x4000))
47161 +#define MCF_INTC_L6IACK(x) MCF_REG08(0xFC0480F8+((x)*0x4000))
47162 +#define MCF_INTC_L7IACK(x) MCF_REG08(0xFC0480FC+((x)*0x4000))
47164 +/* Bit definitions and macros for IPRH */
47165 +#define MCF_INTC_IPRH_INT32 (0x00000001)
47166 +#define MCF_INTC_IPRH_INT33 (0x00000002)
47167 +#define MCF_INTC_IPRH_INT34 (0x00000004)
47168 +#define MCF_INTC_IPRH_INT35 (0x00000008)
47169 +#define MCF_INTC_IPRH_INT36 (0x00000010)
47170 +#define MCF_INTC_IPRH_INT37 (0x00000020)
47171 +#define MCF_INTC_IPRH_INT38 (0x00000040)
47172 +#define MCF_INTC_IPRH_INT39 (0x00000080)
47173 +#define MCF_INTC_IPRH_INT40 (0x00000100)
47174 +#define MCF_INTC_IPRH_INT41 (0x00000200)
47175 +#define MCF_INTC_IPRH_INT42 (0x00000400)
47176 +#define MCF_INTC_IPRH_INT43 (0x00000800)
47177 +#define MCF_INTC_IPRH_INT44 (0x00001000)
47178 +#define MCF_INTC_IPRH_INT45 (0x00002000)
47179 +#define MCF_INTC_IPRH_INT46 (0x00004000)
47180 +#define MCF_INTC_IPRH_INT47 (0x00008000)
47181 +#define MCF_INTC_IPRH_INT48 (0x00010000)
47182 +#define MCF_INTC_IPRH_INT49 (0x00020000)
47183 +#define MCF_INTC_IPRH_INT50 (0x00040000)
47184 +#define MCF_INTC_IPRH_INT51 (0x00080000)
47185 +#define MCF_INTC_IPRH_INT52 (0x00100000)
47186 +#define MCF_INTC_IPRH_INT53 (0x00200000)
47187 +#define MCF_INTC_IPRH_INT54 (0x00400000)
47188 +#define MCF_INTC_IPRH_INT55 (0x00800000)
47189 +#define MCF_INTC_IPRH_INT56 (0x01000000)
47190 +#define MCF_INTC_IPRH_INT57 (0x02000000)
47191 +#define MCF_INTC_IPRH_INT58 (0x04000000)
47192 +#define MCF_INTC_IPRH_INT59 (0x08000000)
47193 +#define MCF_INTC_IPRH_INT60 (0x10000000)
47194 +#define MCF_INTC_IPRH_INT61 (0x20000000)
47195 +#define MCF_INTC_IPRH_INT62 (0x40000000)
47196 +#define MCF_INTC_IPRH_INT63 (0x80000000)
47198 +/* Bit definitions and macros for IPRL */
47199 +#define MCF_INTC_IPRL_INT0 (0x00000001)
47200 +#define MCF_INTC_IPRL_INT1 (0x00000002)
47201 +#define MCF_INTC_IPRL_INT2 (0x00000004)
47202 +#define MCF_INTC_IPRL_INT3 (0x00000008)
47203 +#define MCF_INTC_IPRL_INT4 (0x00000010)
47204 +#define MCF_INTC_IPRL_INT5 (0x00000020)
47205 +#define MCF_INTC_IPRL_INT6 (0x00000040)
47206 +#define MCF_INTC_IPRL_INT7 (0x00000080)
47207 +#define MCF_INTC_IPRL_INT8 (0x00000100)
47208 +#define MCF_INTC_IPRL_INT9 (0x00000200)
47209 +#define MCF_INTC_IPRL_INT10 (0x00000400)
47210 +#define MCF_INTC_IPRL_INT11 (0x00000800)
47211 +#define MCF_INTC_IPRL_INT12 (0x00001000)
47212 +#define MCF_INTC_IPRL_INT13 (0x00002000)
47213 +#define MCF_INTC_IPRL_INT14 (0x00004000)
47214 +#define MCF_INTC_IPRL_INT15 (0x00008000)
47215 +#define MCF_INTC_IPRL_INT16 (0x00010000)
47216 +#define MCF_INTC_IPRL_INT17 (0x00020000)
47217 +#define MCF_INTC_IPRL_INT18 (0x00040000)
47218 +#define MCF_INTC_IPRL_INT19 (0x00080000)
47219 +#define MCF_INTC_IPRL_INT20 (0x00100000)
47220 +#define MCF_INTC_IPRL_INT21 (0x00200000)
47221 +#define MCF_INTC_IPRL_INT22 (0x00400000)
47222 +#define MCF_INTC_IPRL_INT23 (0x00800000)
47223 +#define MCF_INTC_IPRL_INT24 (0x01000000)
47224 +#define MCF_INTC_IPRL_INT25 (0x02000000)
47225 +#define MCF_INTC_IPRL_INT26 (0x04000000)
47226 +#define MCF_INTC_IPRL_INT27 (0x08000000)
47227 +#define MCF_INTC_IPRL_INT28 (0x10000000)
47228 +#define MCF_INTC_IPRL_INT29 (0x20000000)
47229 +#define MCF_INTC_IPRL_INT30 (0x40000000)
47230 +#define MCF_INTC_IPRL_INT31 (0x80000000)
47232 +/* Bit definitions and macros for IMRH */
47233 +#define MCF_INTC_IMRH_INT_MASK32 (0x00000001)
47234 +#define MCF_INTC_IMRH_INT_MASK33 (0x00000002)
47235 +#define MCF_INTC_IMRH_INT_MASK34 (0x00000004)
47236 +#define MCF_INTC_IMRH_INT_MASK35 (0x00000008)
47237 +#define MCF_INTC_IMRH_INT_MASK36 (0x00000010)
47238 +#define MCF_INTC_IMRH_INT_MASK37 (0x00000020)
47239 +#define MCF_INTC_IMRH_INT_MASK38 (0x00000040)
47240 +#define MCF_INTC_IMRH_INT_MASK39 (0x00000080)
47241 +#define MCF_INTC_IMRH_INT_MASK40 (0x00000100)
47242 +#define MCF_INTC_IMRH_INT_MASK41 (0x00000200)
47243 +#define MCF_INTC_IMRH_INT_MASK42 (0x00000400)
47244 +#define MCF_INTC_IMRH_INT_MASK43 (0x00000800)
47245 +#define MCF_INTC_IMRH_INT_MASK44 (0x00001000)
47246 +#define MCF_INTC_IMRH_INT_MASK45 (0x00002000)
47247 +#define MCF_INTC_IMRH_INT_MASK46 (0x00004000)
47248 +#define MCF_INTC_IMRH_INT_MASK47 (0x00008000)
47249 +#define MCF_INTC_IMRH_INT_MASK48 (0x00010000)
47250 +#define MCF_INTC_IMRH_INT_MASK49 (0x00020000)
47251 +#define MCF_INTC_IMRH_INT_MASK50 (0x00040000)
47252 +#define MCF_INTC_IMRH_INT_MASK51 (0x00080000)
47253 +#define MCF_INTC_IMRH_INT_MASK52 (0x00100000)
47254 +#define MCF_INTC_IMRH_INT_MASK53 (0x00200000)
47255 +#define MCF_INTC_IMRH_INT_MASK54 (0x00400000)
47256 +#define MCF_INTC_IMRH_INT_MASK55 (0x00800000)
47257 +#define MCF_INTC_IMRH_INT_MASK56 (0x01000000)
47258 +#define MCF_INTC_IMRH_INT_MASK57 (0x02000000)
47259 +#define MCF_INTC_IMRH_INT_MASK58 (0x04000000)
47260 +#define MCF_INTC_IMRH_INT_MASK59 (0x08000000)
47261 +#define MCF_INTC_IMRH_INT_MASK60 (0x10000000)
47262 +#define MCF_INTC_IMRH_INT_MASK61 (0x20000000)
47263 +#define MCF_INTC_IMRH_INT_MASK62 (0x40000000)
47264 +#define MCF_INTC_IMRH_INT_MASK63 (0x80000000)
47266 +/* Bit definitions and macros for IMRL */
47267 +#define MCF_INTC_IMRL_INT_MASK0 (0x00000001)
47268 +#define MCF_INTC_IMRL_INT_MASK1 (0x00000002)
47269 +#define MCF_INTC_IMRL_INT_MASK2 (0x00000004)
47270 +#define MCF_INTC_IMRL_INT_MASK3 (0x00000008)
47271 +#define MCF_INTC_IMRL_INT_MASK4 (0x00000010)
47272 +#define MCF_INTC_IMRL_INT_MASK5 (0x00000020)
47273 +#define MCF_INTC_IMRL_INT_MASK6 (0x00000040)
47274 +#define MCF_INTC_IMRL_INT_MASK7 (0x00000080)
47275 +#define MCF_INTC_IMRL_INT_MASK8 (0x00000100)
47276 +#define MCF_INTC_IMRL_INT_MASK9 (0x00000200)
47277 +#define MCF_INTC_IMRL_INT_MASK10 (0x00000400)
47278 +#define MCF_INTC_IMRL_INT_MASK11 (0x00000800)
47279 +#define MCF_INTC_IMRL_INT_MASK12 (0x00001000)
47280 +#define MCF_INTC_IMRL_INT_MASK13 (0x00002000)
47281 +#define MCF_INTC_IMRL_INT_MASK14 (0x00004000)
47282 +#define MCF_INTC_IMRL_INT_MASK15 (0x00008000)
47283 +#define MCF_INTC_IMRL_INT_MASK16 (0x00010000)
47284 +#define MCF_INTC_IMRL_INT_MASK17 (0x00020000)
47285 +#define MCF_INTC_IMRL_INT_MASK18 (0x00040000)
47286 +#define MCF_INTC_IMRL_INT_MASK19 (0x00080000)
47287 +#define MCF_INTC_IMRL_INT_MASK20 (0x00100000)
47288 +#define MCF_INTC_IMRL_INT_MASK21 (0x00200000)
47289 +#define MCF_INTC_IMRL_INT_MASK22 (0x00400000)
47290 +#define MCF_INTC_IMRL_INT_MASK23 (0x00800000)
47291 +#define MCF_INTC_IMRL_INT_MASK24 (0x01000000)
47292 +#define MCF_INTC_IMRL_INT_MASK25 (0x02000000)
47293 +#define MCF_INTC_IMRL_INT_MASK26 (0x04000000)
47294 +#define MCF_INTC_IMRL_INT_MASK27 (0x08000000)
47295 +#define MCF_INTC_IMRL_INT_MASK28 (0x10000000)
47296 +#define MCF_INTC_IMRL_INT_MASK29 (0x20000000)
47297 +#define MCF_INTC_IMRL_INT_MASK30 (0x40000000)
47298 +#define MCF_INTC_IMRL_INT_MASK31 (0x80000000)
47300 +/* Bit definitions and macros for INTFRCH */
47301 +#define MCF_INTC_INTFRCH_INTFRC32 (0x00000001)
47302 +#define MCF_INTC_INTFRCH_INTFRC33 (0x00000002)
47303 +#define MCF_INTC_INTFRCH_INTFRC34 (0x00000004)
47304 +#define MCF_INTC_INTFRCH_INTFRC35 (0x00000008)
47305 +#define MCF_INTC_INTFRCH_INTFRC36 (0x00000010)
47306 +#define MCF_INTC_INTFRCH_INTFRC37 (0x00000020)
47307 +#define MCF_INTC_INTFRCH_INTFRC38 (0x00000040)
47308 +#define MCF_INTC_INTFRCH_INTFRC39 (0x00000080)
47309 +#define MCF_INTC_INTFRCH_INTFRC40 (0x00000100)
47310 +#define MCF_INTC_INTFRCH_INTFRC41 (0x00000200)
47311 +#define MCF_INTC_INTFRCH_INTFRC42 (0x00000400)
47312 +#define MCF_INTC_INTFRCH_INTFRC43 (0x00000800)
47313 +#define MCF_INTC_INTFRCH_INTFRC44 (0x00001000)
47314 +#define MCF_INTC_INTFRCH_INTFRC45 (0x00002000)
47315 +#define MCF_INTC_INTFRCH_INTFRC46 (0x00004000)
47316 +#define MCF_INTC_INTFRCH_INTFRC47 (0x00008000)
47317 +#define MCF_INTC_INTFRCH_INTFRC48 (0x00010000)
47318 +#define MCF_INTC_INTFRCH_INTFRC49 (0x00020000)
47319 +#define MCF_INTC_INTFRCH_INTFRC50 (0x00040000)
47320 +#define MCF_INTC_INTFRCH_INTFRC51 (0x00080000)
47321 +#define MCF_INTC_INTFRCH_INTFRC52 (0x00100000)
47322 +#define MCF_INTC_INTFRCH_INTFRC53 (0x00200000)
47323 +#define MCF_INTC_INTFRCH_INTFRC54 (0x00400000)
47324 +#define MCF_INTC_INTFRCH_INTFRC55 (0x00800000)
47325 +#define MCF_INTC_INTFRCH_INTFRC56 (0x01000000)
47326 +#define MCF_INTC_INTFRCH_INTFRC57 (0x02000000)
47327 +#define MCF_INTC_INTFRCH_INTFRC58 (0x04000000)
47328 +#define MCF_INTC_INTFRCH_INTFRC59 (0x08000000)
47329 +#define MCF_INTC_INTFRCH_INTFRC60 (0x10000000)
47330 +#define MCF_INTC_INTFRCH_INTFRC61 (0x20000000)
47331 +#define MCF_INTC_INTFRCH_INTFRC62 (0x40000000)
47332 +#define MCF_INTC_INTFRCH_INTFRC63 (0x80000000)
47334 +/* Bit definitions and macros for INTFRCL */
47335 +#define MCF_INTC_INTFRCL_INTFRC0 (0x00000001)
47336 +#define MCF_INTC_INTFRCL_INTFRC1 (0x00000002)
47337 +#define MCF_INTC_INTFRCL_INTFRC2 (0x00000004)
47338 +#define MCF_INTC_INTFRCL_INTFRC3 (0x00000008)
47339 +#define MCF_INTC_INTFRCL_INTFRC4 (0x00000010)
47340 +#define MCF_INTC_INTFRCL_INTFRC5 (0x00000020)
47341 +#define MCF_INTC_INTFRCL_INTFRC6 (0x00000040)
47342 +#define MCF_INTC_INTFRCL_INTFRC7 (0x00000080)
47343 +#define MCF_INTC_INTFRCL_INTFRC8 (0x00000100)
47344 +#define MCF_INTC_INTFRCL_INTFRC9 (0x00000200)
47345 +#define MCF_INTC_INTFRCL_INTFRC10 (0x00000400)
47346 +#define MCF_INTC_INTFRCL_INTFRC11 (0x00000800)
47347 +#define MCF_INTC_INTFRCL_INTFRC12 (0x00001000)
47348 +#define MCF_INTC_INTFRCL_INTFRC13 (0x00002000)
47349 +#define MCF_INTC_INTFRCL_INTFRC14 (0x00004000)
47350 +#define MCF_INTC_INTFRCL_INTFRC15 (0x00008000)
47351 +#define MCF_INTC_INTFRCL_INTFRC16 (0x00010000)
47352 +#define MCF_INTC_INTFRCL_INTFRC17 (0x00020000)
47353 +#define MCF_INTC_INTFRCL_INTFRC18 (0x00040000)
47354 +#define MCF_INTC_INTFRCL_INTFRC19 (0x00080000)
47355 +#define MCF_INTC_INTFRCL_INTFRC20 (0x00100000)
47356 +#define MCF_INTC_INTFRCL_INTFRC21 (0x00200000)
47357 +#define MCF_INTC_INTFRCL_INTFRC22 (0x00400000)
47358 +#define MCF_INTC_INTFRCL_INTFRC23 (0x00800000)
47359 +#define MCF_INTC_INTFRCL_INTFRC24 (0x01000000)
47360 +#define MCF_INTC_INTFRCL_INTFRC25 (0x02000000)
47361 +#define MCF_INTC_INTFRCL_INTFRC26 (0x04000000)
47362 +#define MCF_INTC_INTFRCL_INTFRC27 (0x08000000)
47363 +#define MCF_INTC_INTFRCL_INTFRC28 (0x10000000)
47364 +#define MCF_INTC_INTFRCL_INTFRC29 (0x20000000)
47365 +#define MCF_INTC_INTFRCL_INTFRC30 (0x40000000)
47366 +#define MCF_INTC_INTFRCL_INTFRC31 (0x80000000)
47368 +/* Bit definitions and macros for ICONFIG */
47369 +#define MCF_INTC_ICONFIG_EMASK (0x0020)
47370 +#define MCF_INTC_ICONFIG_ELVLPRI1 (0x0200)
47371 +#define MCF_INTC_ICONFIG_ELVLPRI2 (0x0400)
47372 +#define MCF_INTC_ICONFIG_ELVLPRI3 (0x0800)
47373 +#define MCF_INTC_ICONFIG_ELVLPRI4 (0x1000)
47374 +#define MCF_INTC_ICONFIG_ELVLPRI5 (0x2000)
47375 +#define MCF_INTC_ICONFIG_ELVLPRI6 (0x4000)
47376 +#define MCF_INTC_ICONFIG_ELVLPRI7 (0x8000)
47378 +/* Bit definitions and macros for SIMR */
47379 +#define MCF_INTC_SIMR_SIMR(x) (((x)&0x7F))
47381 +/* Bit definitions and macros for CIMR */
47382 +#define MCF_INTC_CIMR_CIMR(x) (((x)&0x7F))
47384 +/* Bit definitions and macros for CLMASK */
47385 +#define MCF_INTC_CLMASK_CLMASK(x) (((x)&0x0F))
47387 +/* Bit definitions and macros for SLMASK */
47388 +#define MCF_INTC_SLMASK_SLMASK(x) (((x)&0x0F))
47390 +/* Bit definitions and macros for ICR group */
47391 +#define MCF_INTC_ICR_IL(x) (((x)&0x07))
47393 +/* Bit definitions and macros for ICR1 */
47394 +#define MCF_INTC_ICR1_IL(x) (((x)&0x07))
47396 +/* Bit definitions and macros for ICR2 */
47397 +#define MCF_INTC_ICR2_IL(x) (((x)&0x07))
47399 +/* Bit definitions and macros for ICR3 */
47400 +#define MCF_INTC_ICR3_IL(x) (((x)&0x07))
47402 +/* Bit definitions and macros for ICR4 */
47403 +#define MCF_INTC_ICR4_IL(x) (((x)&0x07))
47405 +/* Bit definitions and macros for ICR5 */
47406 +#define MCF_INTC_ICR5_IL(x) (((x)&0x07))
47408 +/* Bit definitions and macros for ICR6 */
47409 +#define MCF_INTC_ICR6_IL(x) (((x)&0x07))
47411 +/* Bit definitions and macros for ICR7 */
47412 +#define MCF_INTC_ICR7_IL(x) (((x)&0x07))
47414 +/* Bit definitions and macros for ICR8 */
47415 +#define MCF_INTC_ICR8_IL(x) (((x)&0x07))
47417 +/* Bit definitions and macros for ICR9 */
47418 +#define MCF_INTC_ICR9_IL(x) (((x)&0x07))
47420 +/* Bit definitions and macros for ICR10 */
47421 +#define MCF_INTC_ICR10_IL(x) (((x)&0x07))
47423 +/* Bit definitions and macros for ICR11 */
47424 +#define MCF_INTC_ICR11_IL(x) (((x)&0x07))
47426 +/* Bit definitions and macros for ICR12 */
47427 +#define MCF_INTC_ICR12_IL(x) (((x)&0x07))
47429 +/* Bit definitions and macros for ICR13 */
47430 +#define MCF_INTC_ICR13_IL(x) (((x)&0x07))
47432 +/* Bit definitions and macros for ICR14 */
47433 +#define MCF_INTC_ICR14_IL(x) (((x)&0x07))
47435 +/* Bit definitions and macros for ICR15 */
47436 +#define MCF_INTC_ICR15_IL(x) (((x)&0x07))
47438 +/* Bit definitions and macros for ICR16 */
47439 +#define MCF_INTC_ICR16_IL(x) (((x)&0x07))
47441 +/* Bit definitions and macros for ICR17 */
47442 +#define MCF_INTC_ICR17_IL(x) (((x)&0x07))
47444 +/* Bit definitions and macros for ICR18 */
47445 +#define MCF_INTC_ICR18_IL(x) (((x)&0x07))
47447 +/* Bit definitions and macros for ICR19 */
47448 +#define MCF_INTC_ICR19_IL(x) (((x)&0x07))
47450 +/* Bit definitions and macros for ICR20 */
47451 +#define MCF_INTC_ICR20_IL(x) (((x)&0x07))
47453 +/* Bit definitions and macros for ICR21 */
47454 +#define MCF_INTC_ICR21_IL(x) (((x)&0x07))
47456 +/* Bit definitions and macros for ICR22 */
47457 +#define MCF_INTC_ICR22_IL(x) (((x)&0x07))
47459 +/* Bit definitions and macros for ICR23 */
47460 +#define MCF_INTC_ICR23_IL(x) (((x)&0x07))
47462 +/* Bit definitions and macros for ICR24 */
47463 +#define MCF_INTC_ICR24_IL(x) (((x)&0x07))
47465 +/* Bit definitions and macros for ICR25 */
47466 +#define MCF_INTC_ICR25_IL(x) (((x)&0x07))
47468 +/* Bit definitions and macros for ICR26 */
47469 +#define MCF_INTC_ICR26_IL(x) (((x)&0x07))
47471 +/* Bit definitions and macros for ICR27 */
47472 +#define MCF_INTC_ICR27_IL(x) (((x)&0x07))
47474 +/* Bit definitions and macros for ICR28 */
47475 +#define MCF_INTC_ICR28_IL(x) (((x)&0x07))
47477 +/* Bit definitions and macros for ICR29 */
47478 +#define MCF_INTC_ICR29_IL(x) (((x)&0x07))
47480 +/* Bit definitions and macros for ICR30 */
47481 +#define MCF_INTC_ICR30_IL(x) (((x)&0x07))
47483 +/* Bit definitions and macros for ICR31 */
47484 +#define MCF_INTC_ICR31_IL(x) (((x)&0x07))
47486 +/* Bit definitions and macros for ICR32 */
47487 +#define MCF_INTC_ICR32_IL(x) (((x)&0x07))
47489 +/* Bit definitions and macros for ICR33 */
47490 +#define MCF_INTC_ICR33_IL(x) (((x)&0x07))
47492 +/* Bit definitions and macros for ICR34 */
47493 +#define MCF_INTC_ICR34_IL(x) (((x)&0x07))
47495 +/* Bit definitions and macros for ICR35 */
47496 +#define MCF_INTC_ICR35_IL(x) (((x)&0x07))
47498 +/* Bit definitions and macros for ICR36 */
47499 +#define MCF_INTC_ICR36_IL(x) (((x)&0x07))
47501 +/* Bit definitions and macros for ICR37 */
47502 +#define MCF_INTC_ICR37_IL(x) (((x)&0x07))
47504 +/* Bit definitions and macros for ICR38 */
47505 +#define MCF_INTC_ICR38_IL(x) (((x)&0x07))
47507 +/* Bit definitions and macros for ICR39 */
47508 +#define MCF_INTC_ICR39_IL(x) (((x)&0x07))
47510 +/* Bit definitions and macros for ICR40 */
47511 +#define MCF_INTC_ICR40_IL(x) (((x)&0x07))
47513 +/* Bit definitions and macros for ICR41 */
47514 +#define MCF_INTC_ICR41_IL(x) (((x)&0x07))
47516 +/* Bit definitions and macros for ICR42 */
47517 +#define MCF_INTC_ICR42_IL(x) (((x)&0x07))
47519 +/* Bit definitions and macros for ICR43 */
47520 +#define MCF_INTC_ICR43_IL(x) (((x)&0x07))
47522 +/* Bit definitions and macros for ICR44 */
47523 +#define MCF_INTC_ICR44_IL(x) (((x)&0x07))
47525 +/* Bit definitions and macros for ICR45 */
47526 +#define MCF_INTC_ICR45_IL(x) (((x)&0x07))
47528 +/* Bit definitions and macros for ICR46 */
47529 +#define MCF_INTC_ICR46_IL(x) (((x)&0x07))
47531 +/* Bit definitions and macros for ICR47 */
47532 +#define MCF_INTC_ICR47_IL(x) (((x)&0x07))
47534 +/* Bit definitions and macros for ICR48 */
47535 +#define MCF_INTC_ICR48_IL(x) (((x)&0x07))
47537 +/* Bit definitions and macros for ICR49 */
47538 +#define MCF_INTC_ICR49_IL(x) (((x)&0x07))
47540 +/* Bit definitions and macros for ICR50 */
47541 +#define MCF_INTC_ICR50_IL(x) (((x)&0x07))
47543 +/* Bit definitions and macros for ICR51 */
47544 +#define MCF_INTC_ICR51_IL(x) (((x)&0x07))
47546 +/* Bit definitions and macros for ICR52 */
47547 +#define MCF_INTC_ICR52_IL(x) (((x)&0x07))
47549 +/* Bit definitions and macros for ICR53 */
47550 +#define MCF_INTC_ICR53_IL(x) (((x)&0x07))
47552 +/* Bit definitions and macros for ICR54 */
47553 +#define MCF_INTC_ICR54_IL(x) (((x)&0x07))
47555 +/* Bit definitions and macros for ICR55 */
47556 +#define MCF_INTC_ICR55_IL(x) (((x)&0x07))
47558 +/* Bit definitions and macros for ICR56 */
47559 +#define MCF_INTC_ICR56_IL(x) (((x)&0x07))
47561 +/* Bit definitions and macros for ICR57 */
47562 +#define MCF_INTC_ICR57_IL(x) (((x)&0x07))
47564 +/* Bit definitions and macros for ICR58 */
47565 +#define MCF_INTC_ICR58_IL(x) (((x)&0x07))
47567 +/* Bit definitions and macros for ICR59 */
47568 +#define MCF_INTC_ICR59_IL(x) (((x)&0x07))
47570 +/* Bit definitions and macros for ICR60 */
47571 +#define MCF_INTC_ICR60_IL(x) (((x)&0x07))
47573 +/* Bit definitions and macros for ICR61 */
47574 +#define MCF_INTC_ICR61_IL(x) (((x)&0x07))
47576 +/* Bit definitions and macros for ICR62 */
47577 +#define MCF_INTC_ICR62_IL(x) (((x)&0x07))
47579 +/* Bit definitions and macros for ICR63 */
47580 +#define MCF_INTC_ICR63_IL(x) (((x)&0x07))
47582 +/* Bit definitions and macros for SWIACK */
47583 +#define MCF_INTC_SWIACK_VECTOR(x) (x)
47585 +/* Bit definitions and macros for LIACK group */
47586 +#define MCF_INTC_LIACK_VECTOR(x) (x)
47588 +/* Bit definitions and macros for L1IACK */
47589 +#define MCF_INTC_L1IACK_VECTOR(x) (x)
47591 +/* Bit definitions and macros for L2IACK */
47592 +#define MCF_INTC_L2IACK_VECTOR(x) (x)
47594 +/* Bit definitions and macros for L3IACK */
47595 +#define MCF_INTC_L3IACK_VECTOR(x) (x)
47597 +/* Bit definitions and macros for L4IACK */
47598 +#define MCF_INTC_L4IACK_VECTOR(x) (x)
47600 +/* Bit definitions and macros for L5IACK */
47601 +#define MCF_INTC_L5IACK_VECTOR(x) (x)
47603 +/* Bit definitions and macros for L6IACK */
47604 +#define MCF_INTC_L6IACK_VECTOR(x) (x)
47606 +/* Bit definitions and macros for L7IACK */
47607 +#define MCF_INTC_L7IACK_VECTOR(x) (x)
47609 +/********************************************************************/
47611 +#endif /* __MCF5445X_INTC_H__ */
47613 +++ b/include/asm-m68k/mcf5445x_pciarb.h
47616 + * Kurt Mahan kmahan@freescale.com
47618 + * Copyright Freescale Semiconductor, Inc. 2007
47620 + * This program is free software; you can redistribute it and/or modify it
47621 + * under the terms of the GNU General Public License as published by the
47622 + * Free Software Foundation; either version 2 of the License, or (at your
47623 + * option) any later version.
47626 +#ifndef __MCF5445X_PCIARB_H__
47627 +#define __MCF5445X_PCIARB_H__
47629 +/*********************************************************************
47631 +* PCI Arbiter Module (PCIARB)
47633 +*********************************************************************/
47635 +/* Register read/write macros */
47636 +#define MCF_PCIARB_PACR MCF_REG32(0xFC0AC000)
47637 +#define MCF_PCIARB_PASR MCF_REG32(0xFC0AC004)
47639 +/* Bit definitions and macros for PACR */
47640 +#define MCF_PCIARB_PACR_INTMPRI (0x00000001)
47641 +#define MCF_PCIARB_PACR_EXTMPRI(x) (((x)&0x0000001F)<<1)
47642 +#define MCF_PCIARB_PACR_RA (0x00008000)
47643 +#define MCF_PCIARB_PACR_INTMINTEN (0x00010000)
47644 +#define MCF_PCIARB_PACR_EXTMINTEN(x) (((x)&0x0000001F)<<17)
47645 +#define MCF_PCIARB_PACR_PKMD (0x40000000)
47646 +#define MCF_PCIARB_PACR_DS (0x80000000)
47648 +/* Bit definitions and macros for PASR */
47649 +#define MCF_PCIARB_PASR_ITLMBK (0x00010000)
47650 +#define MCF_PCIARB_PASR_EXTMBK(x) (((x)&0x0000001F)<<17)
47652 +/********************************************************************/
47654 +#endif /* __MCF5445X_PCIARB_H__ */
47656 +++ b/include/asm-m68k/mcf5445x_pci.h
47659 + * Kurt Mahan kmahan@freescale.com
47661 + * Copyright Freescale Semiconductor, Inc. 2007
47663 + * This program is free software; you can redistribute it and/or modify it
47664 + * under the terms of the GNU General Public License as published by the
47665 + * Free Software Foundation; either version 2 of the License, or (at your
47666 + * option) any later version.
47669 +#ifndef __MCF5445X_PCI_H__
47670 +#define __MCF5445X_PCI_H__
47672 +/*********************************************************************
47674 +* PCI Bus Controller (PCI)
47676 +*********************************************************************/
47678 +/* Register read/write macros */
47679 +#define MCF_PCI_PCIIDR MCF_REG32(0xFC0A8000)
47680 +#define MCF_PCI_PCISCR MCF_REG32(0xFC0A8004)
47681 +#define MCF_PCI_PCICCRIR MCF_REG32(0xFC0A8008)
47682 +#define MCF_PCI_PCICR1 MCF_REG32(0xFC0A800C)
47683 +#define MCF_PCI_PCIBAR0 MCF_REG32(0xFC0A8010)
47684 +#define MCF_PCI_PCIBAR1 MCF_REG32(0xFC0A8014)
47685 +#define MCF_PCI_PCIBAR2 MCF_REG32(0xFC0A8018)
47686 +#define MCF_PCI_PCIBAR3 MCF_REG32(0xFC0A801C)
47687 +#define MCF_PCI_PCIBAR4 MCF_REG32(0xFC0A8020)
47688 +#define MCF_PCI_PCIBAR5 MCF_REG32(0xFC0A8024)
47689 +#define MCF_PCI_PCISID MCF_REG32(0xFC0A802C)
47690 +#define MCF_PCI_PCICR2 MCF_REG32(0xFC0A803C)
47691 +#define MCF_PCI_PCIGSCR MCF_REG32(0xFC0A8060)
47692 +#define MCF_PCI_PCITBATR0A MCF_REG32(0xFC0A8064)
47693 +#define MCF_PCI_PCITBATR1A MCF_REG32(0xFC0A8068)
47694 +#define MCF_PCI_PCITCR MCF_REG32(0xFC0A806C)
47695 +#define MCF_PCI_PCIIW0BTAR MCF_REG32(0xFC0A8070)
47696 +#define MCF_PCI_PCIIW1BTAR MCF_REG32(0xFC0A8074)
47697 +#define MCF_PCI_PCIIW2BTAR MCF_REG32(0xFC0A8078)
47698 +#define MCF_PCI_PCIIWCR MCF_REG32(0xFC0A8080)
47699 +#define MCF_PCI_PCIICR MCF_REG32(0xFC0A8084)
47700 +#define MCF_PCI_PCIISR MCF_REG32(0xFC0A8088)
47701 +#define MCF_PCI_PCITCR2 MCF_REG32(0xFC0A808C)
47702 +#define MCF_PCI_PCITBATR0 MCF_REG32(0xFC0A8090)
47703 +#define MCF_PCI_PCITBATR1 MCF_REG32(0xFC0A8094)
47704 +#define MCF_PCI_PCITBATR2 MCF_REG32(0xFC0A8098)
47705 +#define MCF_PCI_PCITBATR3 MCF_REG32(0xFC0A809C)
47706 +#define MCF_PCI_PCITBATR4 MCF_REG32(0xFC0A80A0)
47707 +#define MCF_PCI_PCITBATR5 MCF_REG32(0xFC0A80A4)
47708 +#define MCF_PCI_PCICAR MCF_REG32(0xFC0A80F8)
47710 +/* Parameterized register read/write macros for multiple registers */
47711 +#define MCF_PCI_PCIIWBTAR(x) MCF_REG32(0xFC0A8070+((x)*0x004))
47713 +/* Bit definitions and macros for PCIIDR */
47714 +#define MCF_PCI_PCIIDR_VENDORID(x) (((x)&0x0000FFFF))
47715 +#define MCF_PCI_PCIIDR_DEVICEID(x) (((x)&0x0000FFFF)<<16)
47717 +/* Bit definitions and macros for PCISCR */
47718 +#define MCF_PCI_PCISCR_M (0x00000002)
47719 +#define MCF_PCI_PCISCR_B (0x00000004)
47720 +#define MCF_PCI_PCISCR_SP (0x00000008)
47721 +#define MCF_PCI_PCISCR_MW (0x00000010)
47722 +#define MCF_PCI_PCISCR_PER (0x00000040)
47723 +#define MCF_PCI_PCISCR_S (0x00000100)
47724 +#define MCF_PCI_PCISCR_F (0x00000200)
47725 +#define MCF_PCI_PCISCR_C (0x00100000)
47726 +#define MCF_PCI_PCISCR_66M (0x00200000)
47727 +#define MCF_PCI_PCISCR_R (0x00400000)
47728 +#define MCF_PCI_PCISCR_FC (0x00800000)
47729 +#define MCF_PCI_PCISCR_DP (0x01000000)
47730 +#define MCF_PCI_PCISCR_DT(x) (((x)&0x00000003)<<25)
47731 +#define MCF_PCI_PCISCR_TS (0x08000000)
47732 +#define MCF_PCI_PCISCR_TR (0x10000000)
47733 +#define MCF_PCI_PCISCR_MA (0x20000000)
47734 +#define MCF_PCI_PCISCR_SE (0x40000000)
47735 +#define MCF_PCI_PCISCR_PE (0x80000000)
47737 +/* Bit definitions and macros for PCICCRIR */
47738 +#define MCF_PCI_PCICCRIR_REVID(x) (((x)&0x000000FF))
47739 +#define MCF_PCI_PCICCRIR_CLASSCODE(x) (((x)&0x00FFFFFF)<<8)
47741 +/* Bit definitions and macros for PCICR1 */
47742 +#define MCF_PCI_PCICR1_CACHELINESIZE(x) (((x)&0x0000000F))
47743 +#define MCF_PCI_PCICR1_LATTIMER(x) (((x)&0x000000FF)<<8)
47744 +#define MCF_PCI_PCICR1_HEADERTYPE(x) (((x)&0x000000FF)<<16)
47745 +#define MCF_PCI_PCICR1_BIST(x) (((x)&0x000000FF)<<24)
47747 +/* Bit definitions and macros for PCIBAR0 */
47748 +#define MCF_PCI_PCIBAR0_IO (0x00000001)
47749 +#define MCF_PCI_PCIBAR0_RANGE(x) (((x)&0x00000003)<<1)
47750 +#define MCF_PCI_PCIBAR0_PREF (0x00000008)
47751 +#define MCF_PCI_PCIBAR0_BAR0(x) (((x)&0x00003FFF)<<18)
47753 +/* Bit definitions and macros for PCIBAR1 */
47754 +#define MCF_PCI_PCIBAR1_IO (0x00000001)
47755 +#define MCF_PCI_PCIBAR1_PREF (0x00000008)
47756 +#define MCF_PCI_PCIBAR1_BAR1(x) (((x)&0x00000FFF)<<20)
47758 +/* Bit definitions and macros for PCIBAR2 */
47759 +#define MCF_PCI_PCIBAR2_IO (0x00000001)
47760 +#define MCF_PCI_PCIBAR2_RANGE(x) (((x)&0x00000003)<<1)
47761 +#define MCF_PCI_PCIBAR2_PREF (0x00000008)
47762 +#define MCF_PCI_PCIBAR2_BAR2(x) (((x)&0x000003FF)<<22)
47764 +/* Bit definitions and macros for PCIBAR3 */
47765 +#define MCF_PCI_PCIBAR3_IO (0x00000001)
47766 +#define MCF_PCI_PCIBAR3_PREF (0x00000008)
47767 +#define MCF_PCI_PCIBAR3_BAR3(x) (((x)&0x000000FF)<<24)
47769 +/* Bit definitions and macros for PCIBAR4 */
47770 +#define MCF_PCI_PCIBAR4_IO (0x00000001)
47771 +#define MCF_PCI_PCIBAR4_RANGE(x) (((x)&0x00000003)<<1)
47772 +#define MCF_PCI_PCIBAR4_PREF (0x00000008)
47773 +#define MCF_PCI_PCIBAR4_BAR4(x) (((x)&0x0000001F)<<27)
47775 +/* Bit definitions and macros for PCIBAR5 */
47776 +#define MCF_PCI_PCIBAR5_IO (0x00000001)
47777 +#define MCF_PCI_PCIBAR5_PREF (0x00000008)
47778 +#define MCF_PCI_PCIBAR5_BAR5(x) (((x)&0x0000000F)<<28)
47780 +/* Bit definitions and macros for PCISID */
47781 +#define MCF_PCI_PCISID_VENDORID(x) (((x)&0x0000FFFF))
47782 +#define MCF_PCI_PCISID_ID(x) (((x)&0x0000FFFF)<<16)
47784 +/* Bit definitions and macros for PCICR2 */
47785 +#define MCF_PCI_PCICR2_INTLINE(x) (((x)&0x000000FF))
47786 +#define MCF_PCI_PCICR2_INTPIN(x) (((x)&0x000000FF)<<8)
47787 +#define MCF_PCI_PCICR2_MINGNT(x) (((x)&0x000000FF)<<16)
47788 +#define MCF_PCI_PCICR2_MAXLAT(x) (((x)&0x000000FF)<<24)
47790 +/* Bit definitions and macros for PCIGSCR */
47791 +#define MCF_PCI_PCIGSCR_PR (0x00000001)
47792 +#define MCF_PCI_PCIGSCR_SEE (0x00001000)
47793 +#define MCF_PCI_PCIGSCR_PEE (0x00002000)
47794 +#define MCF_PCI_PCIGSCR_SE (0x10000000)
47795 +#define MCF_PCI_PCIGSCR_PE (0x20000000)
47797 +/* Bit definitions and macros for PCITBATR0A */
47798 +#define MCF_PCI_PCITBATR0A_EN (0x00000001)
47799 +#define MCF_PCI_PCITBATR0A_BAT0(x) (((x)&0x00003FFF)<<18)
47801 +/* Bit definitions and macros for PCITBATR1A */
47802 +#define MCF_PCI_PCITBATR1A_EN (0x00000001)
47803 +#define MCF_PCI_PCITBATR1A_BAT1(x) (((x)&0x00000FFF)<<20)
47805 +/* Bit definitions and macros for PCITCR */
47806 +#define MCF_PCI_PCITCR_WCT(x) (((x)&0x000000FF))
47807 +#define MCF_PCI_PCITCR_WCD (0x00000100)
47808 +#define MCF_PCI_PCITCR_P (0x00010000)
47809 +#define MCF_PCI_PCITCR_PID (0x00020000)
47810 +#define MCF_PCI_PCITCR_LD (0x01000000)
47812 +/* Bit definitions and macros for PCIIWBTAR group */
47813 +#define MCF_PCI_PCIIWBTAR_WBA(x) ((((x)&0xFF000000)))
47814 +#define MCF_PCI_PCIIWBTAR_WAM(x) ((((x)&0xFF000000)
47815 +#define MCF_PCI_PCIIWBTAR_WTA(x) ((((x)&0xFF000000)
47817 +/* Bit definitions and macros for PCIIW0BTAR */
47818 +#define MCF_PCI_PCIIW0BTAR_WBA(x) ((((x)&0xFF000000)))
47819 +#define MCF_PCI_PCIIW0BTAR_WAM(x) ((((x)&0xFF000000)
47820 +#define MCF_PCI_PCIIW0BTAR_WTA(x) ((((x)&0xFF000000)
47822 +/* Bit definitions and macros for PCIIWCR */
47823 +#define MCF_PCI_PCIIWCR_WINCTRL2(x) (((x)&0x0000000F)<<8)
47824 +#define MCF_PCI_PCIIWCR_WINCTRL1(x) (((x)&0x0000000F)<<16)
47825 +#define MCF_PCI_PCIIWCR_WINCTRL0(x) (((x)&0x0000000F)<<24)
47826 +#define MCF_PCI_PCIIWCR_WINCTRL0_ENABLE (0x01000000)
47827 +#define MCF_PCI_PCIIWCR_WINCTRL0_MEMREAD (0x01000000)
47828 +#define MCF_PCI_PCIIWCR_WINCTRL0_MEMRDLINE (0x03000000)
47829 +#define MCF_PCI_PCIIWCR_WINCTRL0_MEMRDMUL (0x05000000)
47830 +#define MCF_PCI_PCIIWCR_WINCTRL0_IO (0x09000000)
47831 +#define MCF_PCI_PCIIWCR_WINCTRL1_MEMREAD (0x00010000)
47832 +#define MCF_PCI_PCIIWCR_WINCTRL1_ENABLE (0x00010000)
47833 +#define MCF_PCI_PCIIWCR_WINCTRL1_MEMRDLINE (0x00030000)
47834 +#define MCF_PCI_PCIIWCR_WINCTRL1_MEMRDMUL (0x00050000)
47835 +#define MCF_PCI_PCIIWCR_WINCTRL1_IO (0x00090000)
47836 +#define MCF_PCI_PCIIWCR_WINCTRL2_ENABLE (0x00000100)
47837 +#define MCF_PCI_PCIIWCR_WINCTRL2_MEMREAD (0x00000100)
47838 +#define MCF_PCI_PCIIWCR_WINCTRL2_MEMRDLINE (0x00000300)
47839 +#define MCF_PCI_PCIIWCR_WINCTRL2_MEMRDMUL (0x00000500)
47840 +#define MCF_PCI_PCIIWCR_WINCTRL2_IO (0x00000900)
47842 +/* Bit definitions and macros for PCIICR */
47843 +#define MCF_PCI_PCIICR_MAXRETRY(x) (((x)&0x000000FF))
47844 +#define MCF_PCI_PCIICR_TAE (0x01000000)
47845 +#define MCF_PCI_PCIICR_IAE (0x02000000)
47846 +#define MCF_PCI_PCIICR_REE (0x04000000)
47848 +/* Bit definitions and macros for PCIISR */
47849 +#define MCF_PCI_PCIISR_TA (0x01000000)
47850 +#define MCF_PCI_PCIISR_IA (0x02000000)
47851 +#define MCF_PCI_PCIISR_RE (0x04000000)
47853 +/* Bit definitions and macros for PCITCR2 */
47854 +#define MCF_PCI_PCITCR2_CR (0x00000001)
47855 +#define MCF_PCI_PCITCR2_B0E (0x00000100)
47856 +#define MCF_PCI_PCITCR2_B1E (0x00000200)
47857 +#define MCF_PCI_PCITCR2_B2E (0x00000400)
47858 +#define MCF_PCI_PCITCR2_B3E (0x00000800)
47859 +#define MCF_PCI_PCITCR2_B4E (0x00001000)
47860 +#define MCF_PCI_PCITCR2_B5E (0x00002000)
47862 +/* Bit definitions and macros for PCITBATR0 */
47863 +#define MCF_PCI_PCITBATR0_EN (0x00000001)
47864 +#define MCF_PCI_PCITBATR0_BAT0(x) (((x)&0x00003FFF)<<18)
47866 +/* Bit definitions and macros for PCITBATR1 */
47867 +#define MCF_PCI_PCITBATR1_EN (0x00000001)
47868 +#define MCF_PCI_PCITBATR1_BAT1(x) (((x)&0x00000FFF)<<20)
47870 +/* Bit definitions and macros for PCITBATR2 */
47871 +#define MCF_PCI_PCITBATR2_EN (0x00000001)
47872 +#define MCF_PCI_PCITBATR2_BAT2(x) (((x)&0x000003FF)<<22)
47874 +/* Bit definitions and macros for PCITBATR3 */
47875 +#define MCF_PCI_PCITBATR3_EN (0x00000001)
47876 +#define MCF_PCI_PCITBATR3_BAT3(x) (((x)&0x000000FF)<<24)
47878 +/* Bit definitions and macros for PCITBATR4 */
47879 +#define MCF_PCI_PCITBATR4_EN (0x00000001)
47880 +#define MCF_PCI_PCITBATR4_BAT4(x) (((x)&0x0000001F)<<27)
47882 +/* Bit definitions and macros for PCITBATR5 */
47883 +#define MCF_PCI_PCITBATR5_EN (0x00000001)
47884 +#define MCF_PCI_PCITBATR5_BAT5(x) (((x)&0x0000000F)<<28)
47886 +/* Bit definitions and macros for PCICAR */
47887 +#define MCF_PCI_PCICAR_DWORD(x) ((x)&0x000000FC)
47888 +#define MCF_PCI_PCICAR_FUNCNUM(x) (((x)&0x00000007)<<8)
47889 +#define MCF_PCI_PCICAR_DEVNUM(x) (((x)&0x0000001F)<<11)
47890 +#define MCF_PCI_PCICAR_BUSNUM(x) (((x)&0x000000FF)<<16)
47891 +#define MCF_PCI_PCICAR_E (0x80000000)
47893 +/********************************************************************/
47895 +#endif /* __MCF5445X_PCI_H__ */
47897 +++ b/include/asm-m68k/mcf5445x_sdramc.h
47900 + * Matt Waddel Matt.Waddel@freescale.com
47902 + * Copyright Freescale Semiconductor, Inc. 2007
47904 + * This program is free software; you can redistribute it and/or modify it
47905 + * under the terms of the GNU General Public License as published by the
47906 + * Free Software Foundation; either version 2 of the License, or (at your
47907 + * option) any later version.
47910 +#ifndef __MCF5445X_SDRAMC_H__
47911 +#define __MCF5445X_SDRAMC_H__
47913 +/*********************************************************************
47915 +* SDRAM Controller (SDRAMC)
47917 +*********************************************************************/
47919 +/* Register read/write macros */
47920 +#define MCF_SDRAMC_SDMR (*(vuint32 *)(0xFC0B8000)) /* SDRAM Mode/Extended Mode Register */
47921 +#define MCF_SDRAMC_SDCR (*(vuint32 *)(0xFC0B8004)) /* SDRAM Control Register */
47922 +#define MCF_SDRAMC_SDCFG1 (*(vuint32 *)(0xFC0B8008)) /* SDRAM Configuration Register 1 */
47923 +#define MCF_SDRAMC_SDCFG2 (*(vuint32 *)(0xFC0B800C)) /* SDRAM Configuration Register 2 */
47924 +#define MCF_SDRAMC_SDCS0 (*(vuint32 *)(0xFC0B8110)) /* SDRAM Chip Select Register */
47925 +#define MCF_SDRAMC_SDCS1 (*(vuint32 *)(0xFC0B8114)) /* SDRAM Chip Select Register */
47927 +/* Parameterized register read/write macros for multiple registers */
47928 +#define MCF_SDRAMC_SDCS(x) (*(vuint32 *)(0xFC0B8110+((x)*0x004))) /* SDRAM Chip Select Register */
47930 +/* Bit definitions and macros for SDMR */
47931 +#define MCF_SDRAMC_SDMR_DDR2_AD(x) (((x)&0x00003FFF)) /* Address for DDR2 */
47932 +#define MCF_SDRAMC_SDMR_CMD (0x00010000) /* Command */
47933 +#define MCF_SDRAMC_SDMR_AD(x) (((x)&0x00000FFF)<<18) /* Address */
47934 +#define MCF_SDRAMC_SDMR_BK(x) (((x)&0x00000003)<<30) /* Bank Address */
47935 +#define MCF_SDRAMC_SDMR_BK_LMR (0x00000000)
47936 +#define MCF_SDRAMC_SDMR_BK_LEMR (0x40000000)
47938 +/* Bit definitions and macros for SDCR */
47939 +#define MCF_SDRAMC_SDCR_DPD (0x00000001) /* Deep Power-Down Mode */
47940 +#define MCF_SDRAMC_SDCR_IPALL (0x00000002) /* Initiate Precharge All */
47941 +#define MCF_SDRAMC_SDCR_IREF (0x00000004) /* Initiate Refresh */
47942 +#define MCF_SDRAMC_SDCR_DQS_OE(x) (((x)&0x00000003)<<10) /* DQS Output Enable */
47943 +#define MCF_SDRAMC_SDCR_MEM_PS (0x00002000) /* Data Port Size */
47944 +#define MCF_SDRAMC_SDCR_REF_CNT(x) (((x)&0x0000003F)<<16) /* Periodic Refresh Counter */
47945 +#define MCF_SDRAMC_SDCR_OE_RULE (0x00400000) /* Drive Rule Selection */
47946 +#define MCF_SDRAMC_SDCR_ADDR_MUX(x) (((x)&0x00000003)<<24) /* Internal Address Mux Select */
47947 +#define MCF_SDRAMC_SDCR_DDR2_MODE (0x08000000) /* DDR2 Mode Select */
47948 +#define MCF_SDRAMC_SDCR_REF_EN (0x10000000) /* Refresh Enable */
47949 +#define MCF_SDRAMC_SDCR_DDR_MODE (0x20000000) /* DDR Mode Select */
47950 +#define MCF_SDRAMC_SDCR_CKE (0x40000000) /* Clock Enable */
47951 +#define MCF_SDRAMC_SDCR_MODE_EN (0x80000000) /* SDRAM Mode Register Programming Enable */
47952 +#define MCF_SDRAMC_SDCR_DQS_OE_BOTH (0x00000C00)
47954 +/* Bit definitions and macros for SDCFG1 */
47955 +#define MCF_SDRAMC_SDCFG1_WT_LAT(x) (((x)&0x00000007)<<4) /* Write Latency */
47956 +#define MCF_SDRAMC_SDCFG1_REF2ACT(x) (((x)&0x0000000F)<<8) /* Refresh to active delay */
47957 +#define MCF_SDRAMC_SDCFG1_PRE2ACT(x) (((x)&0x00000007)<<12) /* Precharge to active delay */
47958 +#define MCF_SDRAMC_SDCFG1_ACT2RW(x) (((x)&0x00000007)<<16) /* Active to read/write delay */
47959 +#define MCF_SDRAMC_SDCFG1_RD_LAT(x) (((x)&0x0000000F)<<20) /* Read CAS Latency */
47960 +#define MCF_SDRAMC_SDCFG1_SWT2RWP(x) (((x)&0x00000007)<<24) /* Single write to read/write/precharge delay */
47961 +#define MCF_SDRAMC_SDCFG1_SRD2RWP(x) (((x)&0x0000000F)<<28) /* Single read to read/write/precharge delay */
47963 +/* Bit definitions and macros for SDCFG2 */
47964 +#define MCF_SDRAMC_SDCFG2_BL(x) (((x)&0x0000000F)<<16) /* Burst Length */
47965 +#define MCF_SDRAMC_SDCFG2_BRD2W(x) (((x)&0x0000000F)<<20) /* Burst read to write delay */
47966 +#define MCF_SDRAMC_SDCFG2_BWT2RWP(x) (((x)&0x0000000F)<<24) /* Burst write to read/write/precharge delay */
47967 +#define MCF_SDRAMC_SDCFG2_BRD2RP(x) (((x)&0x0000000F)<<28) /* Burst read to read/precharge delay */
47969 +/* Bit definitions and macros for SDCS group */
47970 +#define MCF_SDRAMC_SDCS_CSSZ(x) (((x)&0x0000001F)) /* Chip-Select Size */
47971 +#define MCF_SDRAMC_SDCS_CSBA(x) (((x)&0x00000FFF)<<20) /* Chip-Select Base Address */
47972 +#define MCF_SDRAMC_SDCS_BA(x) ((x)&0xFFF00000)
47973 +#define MCF_SDRAMC_SDCS_CSSZ_DISABLE (0x00000000)
47974 +#define MCF_SDRAMC_SDCS_CSSZ_1MBYTE (0x00000013)
47975 +#define MCF_SDRAMC_SDCS_CSSZ_2MBYTE (0x00000014)
47976 +#define MCF_SDRAMC_SDCS_CSSZ_4MBYTE (0x00000015)
47977 +#define MCF_SDRAMC_SDCS_CSSZ_8MBYTE (0x00000016)
47978 +#define MCF_SDRAMC_SDCS_CSSZ_16MBYTE (0x00000017)
47979 +#define MCF_SDRAMC_SDCS_CSSZ_32MBYTE (0x00000018)
47980 +#define MCF_SDRAMC_SDCS_CSSZ_64MBYTE (0x00000019)
47981 +#define MCF_SDRAMC_SDCS_CSSZ_128MBYTE (0x0000001A)
47982 +#define MCF_SDRAMC_SDCS_CSSZ_256MBYTE (0x0000001B)
47983 +#define MCF_SDRAMC_SDCS_CSSZ_512MBYTE (0x0000001C)
47984 +#define MCF_SDRAMC_SDCS_CSSZ_1GBYTE (0x0000001D)
47985 +#define MCF_SDRAMC_SDCS_CSSZ_2GBYTE (0x0000001E)
47986 +#define MCF_SDRAMC_SDCS_CSSZ_4GBYTE (0x0000001F)
47988 +/* Bit definitions and macros for SDCS0 */
47989 +#define MCF_SDRAMC_SDCS0_CSSZ(x) (((x)&0x0000001F)) /* Chip-Select Size */
47990 +#define MCF_SDRAMC_SDCS0_CSBA(x) (((x)&0x00000FFF)<<20) /* Chip-Select Base Address */
47991 +#define MCF_SDRAMC_SDCS0_BA(x) ((x)&0xFFF00000)
47992 +#define MCF_SDRAMC_SDCS0_CSSZ_DISABLE (0x00000000)
47993 +#define MCF_SDRAMC_SDCS0_CSSZ_1MBYTE (0x00000013)
47994 +#define MCF_SDRAMC_SDCS0_CSSZ_2MBYTE (0x00000014)
47995 +#define MCF_SDRAMC_SDCS0_CSSZ_4MBYTE (0x00000015)
47996 +#define MCF_SDRAMC_SDCS0_CSSZ_8MBYTE (0x00000016)
47997 +#define MCF_SDRAMC_SDCS0_CSSZ_16MBYTE (0x00000017)
47998 +#define MCF_SDRAMC_SDCS0_CSSZ_32MBYTE (0x00000018)
47999 +#define MCF_SDRAMC_SDCS0_CSSZ_64MBYTE (0x00000019)
48000 +#define MCF_SDRAMC_SDCS0_CSSZ_128MBYTE (0x0000001A)
48001 +#define MCF_SDRAMC_SDCS0_CSSZ_256MBYTE (0x0000001B)
48002 +#define MCF_SDRAMC_SDCS0_CSSZ_512MBYTE (0x0000001C)
48003 +#define MCF_SDRAMC_SDCS0_CSSZ_1GBYTE (0x0000001D)
48004 +#define MCF_SDRAMC_SDCS0_CSSZ_2GBYTE (0x0000001E)
48005 +#define MCF_SDRAMC_SDCS0_CSSZ_4GBYTE (0x0000001F)
48007 +/* Bit definitions and macros for SDCS1 */
48008 +#define MCF_SDRAMC_SDCS1_CSSZ(x) (((x)&0x0000001F)) /* Chip-Select Size */
48009 +#define MCF_SDRAMC_SDCS1_CSBA(x) (((x)&0x00000FFF)<<20) /* Chip-Select Base Address */
48011 +/********************************************************************/
48013 +#endif /* __MCF5445X_SDRAMC_H__ */
48015 +++ b/include/asm-m68k/mcf5445x_ssi.h
48018 + * Yaroslav Vinogradov yaroslav.vinogradov@freescale.com
48020 + * Copyright Freescale Semiconductor, Inc. 2007
48022 + * This program is free software; you can redistribute it and/or modify it
48023 + * under the terms of the GNU General Public License as published by the
48024 + * Free Software Foundation; either version 2 of the License, or (at your
48025 + * option) any later version.
48028 +#ifndef __MCF5445X_SSI_H__
48029 +#define __MCF5445X_SSI_H__
48031 +/*********************************************************************
48033 +* Synchronous Serial Interface (SSI)
48035 +*********************************************************************/
48037 +/* Register read/write macros */
48038 +#define MCF_SSI_TX0 MCF_REG32(0xFC0BC000)
48039 +#define MCF_SSI_TX1 MCF_REG32(0xFC0BC004)
48040 +#define MCF_SSI_RX0 MCF_REG32(0xFC0BC008)
48041 +#define MCF_SSI_RX1 MCF_REG32(0xFC0BC00C)
48042 +#define MCF_SSI_CR MCF_REG32(0xFC0BC010)
48043 +#define MCF_SSI_ISR MCF_REG32(0xFC0BC014)
48044 +#define MCF_SSI_IER MCF_REG32(0xFC0BC018)
48045 +#define MCF_SSI_TCR MCF_REG32(0xFC0BC01C)
48046 +#define MCF_SSI_RCR MCF_REG32(0xFC0BC020)
48047 +#define MCF_SSI_CCR MCF_REG32(0xFC0BC024)
48048 +#define MCF_SSI_FCSR MCF_REG32(0xFC0BC02C)
48049 +#define MCF_SSI_ACR MCF_REG32(0xFC0BC038)
48050 +#define MCF_SSI_ACADD MCF_REG32(0xFC0BC03C)
48051 +#define MCF_SSI_ACDAT MCF_REG32(0xFC0BC040)
48052 +#define MCF_SSI_ATAG MCF_REG32(0xFC0BC044)
48053 +#define MCF_SSI_TMASK MCF_REG32(0xFC0BC048)
48054 +#define MCF_SSI_RMASK MCF_REG32(0xFC0BC04C)
48056 +/* Parameterized register read/write macros for multiple registers */
48057 +#define MCF_SSI_TX(x) MCF_REG32(0xFC0BC000+((x)*0x004))
48058 +#define MCF_SSI_RX(x) MCF_REG32(0xFC0BC008+((x)*0x004))
48060 +/* Bit definitions and macros for TX group */
48061 +#define MCF_SSI_TX_SSI_TX(x) (x)
48063 +/* Bit definitions and macros for TX0 */
48064 +#define MCF_SSI_TX0_SSI_TX(x) (x)
48066 +/* Bit definitions and macros for TX1 */
48067 +#define MCF_SSI_TX1_SSI_TX(x) (x)
48069 +/* Bit definitions and macros for RX group */
48070 +#define MCF_SSI_RX_SSI_RX(x) (x)
48072 +/* Bit definitions and macros for RX0 */
48073 +#define MCF_SSI_RX0_SSI_RX(x) (x)
48075 +/* Bit definitions and macros for RX1 */
48076 +#define MCF_SSI_RX1_SSI_RX(x) (x)
48078 +/* Bit definitions and macros for CR */
48079 +#define MCF_SSI_CR_SSI_EN (0x00000001)
48080 +#define MCF_SSI_CR_TE (0x00000002)
48081 +#define MCF_SSI_CR_RE (0x00000004)
48082 +#define MCF_SSI_CR_NET (0x00000008)
48083 +#define MCF_SSI_CR_SYN (0x00000010)
48084 +#define MCF_SSI_CR_I2S(x) (((x)&0x00000003)<<5)
48085 +#define MCF_SSI_CR_MCE (0x00000080)
48086 +#define MCF_SSI_CR_TCH (0x00000100)
48087 +#define MCF_SSI_CR_CIS (0x00000200)
48088 +#define MCF_SSI_CR_I2S_NORMAL (0x00000000)
48089 +#define MCF_SSI_CR_I2S_MASTER (0x00000020)
48090 +#define MCF_SSI_CR_I2S_SLAVE (0x00000040)
48092 +/* Bit definitions and macros for ISR */
48093 +#define MCF_SSI_ISR_TFE0 (0x00000001)
48094 +#define MCF_SSI_ISR_TFE1 (0x00000002)
48095 +#define MCF_SSI_ISR_RFF0 (0x00000004)
48096 +#define MCF_SSI_ISR_RFF1 (0x00000008)
48097 +#define MCF_SSI_ISR_RLS (0x00000010)
48098 +#define MCF_SSI_ISR_TLS (0x00000020)
48099 +#define MCF_SSI_ISR_RFS (0x00000040)
48100 +#define MCF_SSI_ISR_TFS (0x00000080)
48101 +#define MCF_SSI_ISR_TUE0 (0x00000100)
48102 +#define MCF_SSI_ISR_TUE1 (0x00000200)
48103 +#define MCF_SSI_ISR_ROE0 (0x00000400)
48104 +#define MCF_SSI_ISR_ROE1 (0x00000800)
48105 +#define MCF_SSI_ISR_TDE0 (0x00001000)
48106 +#define MCF_SSI_ISR_TDE1 (0x00002000)
48107 +#define MCF_SSI_ISR_RDR0 (0x00004000)
48108 +#define MCF_SSI_ISR_RDR1 (0x00008000)
48109 +#define MCF_SSI_ISR_RXT (0x00010000)
48110 +#define MCF_SSI_ISR_CMDDU (0x00020000)
48111 +#define MCF_SSI_ISR_CMDAU (0x00040000)
48113 +/* Bit definitions and macros for IER */
48114 +#define MCF_SSI_IER_TFE0 (0x00000001)
48115 +#define MCF_SSI_IER_TFE1 (0x00000002)
48116 +#define MCF_SSI_IER_RFF0 (0x00000004)
48117 +#define MCF_SSI_IER_RFF1 (0x00000008)
48118 +#define MCF_SSI_IER_RLS (0x00000010)
48119 +#define MCF_SSI_IER_TLS (0x00000020)
48120 +#define MCF_SSI_IER_RFS (0x00000040)
48121 +#define MCF_SSI_IER_TFS (0x00000080)
48122 +#define MCF_SSI_IER_TUE0 (0x00000100)
48123 +#define MCF_SSI_IER_TUE1 (0x00000200)
48124 +#define MCF_SSI_IER_ROE0 (0x00000400)
48125 +#define MCF_SSI_IER_ROE1 (0x00000800)
48126 +#define MCF_SSI_IER_TDE0 (0x00001000)
48127 +#define MCF_SSI_IER_TDE1 (0x00002000)
48128 +#define MCF_SSI_IER_RDR0 (0x00004000)
48129 +#define MCF_SSI_IER_RDR1 (0x00008000)
48130 +#define MCF_SSI_IER_RXT (0x00010000)
48131 +#define MCF_SSI_IER_CMDU (0x00020000)
48132 +#define MCF_SSI_IER_CMDAU (0x00040000)
48133 +#define MCF_SSI_IER_TIE (0x00080000)
48134 +#define MCF_SSI_IER_TDMAE (0x00100000)
48135 +#define MCF_SSI_IER_RIE (0x00200000)
48136 +#define MCF_SSI_IER_RDMAE (0x00400000)
48138 +/* Bit definitions and macros for TCR */
48139 +#define MCF_SSI_TCR_TEFS (0x00000001)
48140 +#define MCF_SSI_TCR_TFSL (0x00000002)
48141 +#define MCF_SSI_TCR_TFSI (0x00000004)
48142 +#define MCF_SSI_TCR_TSCKP (0x00000008)
48143 +#define MCF_SSI_TCR_TSHFD (0x00000010)
48144 +#define MCF_SSI_TCR_TXDIR (0x00000020)
48145 +#define MCF_SSI_TCR_TFDIR (0x00000040)
48146 +#define MCF_SSI_TCR_TFEN0 (0x00000080)
48147 +#define MCF_SSI_TCR_TFEN1 (0x00000100)
48148 +#define MCF_SSI_TCR_TXBIT0 (0x00000200)
48150 +/* Bit definitions and macros for RCR */
48151 +#define MCF_SSI_RCR_REFS (0x00000001)
48152 +#define MCF_SSI_RCR_RFSL (0x00000002)
48153 +#define MCF_SSI_RCR_RFSI (0x00000004)
48154 +#define MCF_SSI_RCR_RSCKP (0x00000008)
48155 +#define MCF_SSI_RCR_RSHFD (0x00000010)
48156 +#define MCF_SSI_RCR_RFEN0 (0x00000080)
48157 +#define MCF_SSI_RCR_RFEN1 (0x00000100)
48158 +#define MCF_SSI_RCR_RXBIT0 (0x00000200)
48159 +#define MCF_SSI_RCR_RXEXT (0x00000400)
48161 +/* Bit definitions and macros for CCR */
48162 +#define MCF_SSI_CCR_PM(x) (((x)&0x000000FF))
48163 +#define MCF_SSI_CCR_DC(x) (((x)&0x0000001F)<<8)
48164 +#define MCF_SSI_CCR_WL(x) (((x)&0x0000000F)<<13)
48165 +#define MCF_SSI_CCR_PSR (0x00020000)
48166 +#define MCF_SSI_CCR_DIV2 (0x00040000)
48168 +/* Bit definitions and macros for FCSR */
48169 +#define MCF_SSI_FCSR_TFWM0(x) (((x)&0x0000000F))
48170 +#define MCF_SSI_FCSR_RFWM0(x) (((x)&0x0000000F)<<4)
48171 +#define MCF_SSI_FCSR_TFCNT0(x) (((x)&0x0000000F)<<8)
48172 +#define MCF_SSI_FCSR_RFCNT0(x) (((x)&0x0000000F)<<12)
48173 +#define MCF_SSI_FCSR_TFWM1(x) (((x)&0x0000000F)<<16)
48174 +#define MCF_SSI_FCSR_RFWM1(x) (((x)&0x0000000F)<<20)
48175 +#define MCF_SSI_FCSR_TFCNT1(x) (((x)&0x0000000F)<<24)
48176 +#define MCF_SSI_FCSR_RFCNT1(x) (((x)&0x0000000F)<<28)
48178 +/* Bit definitions and macros for ACR */
48179 +#define MCF_SSI_ACR_AC97EN (0x00000001)
48180 +#define MCF_SSI_ACR_FV (0x00000002)
48181 +#define MCF_SSI_ACR_TIF (0x00000004)
48182 +#define MCF_SSI_ACR_RD (0x00000008)
48183 +#define MCF_SSI_ACR_WR (0x00000010)
48184 +#define MCF_SSI_ACR_FRDIV(x) (((x)&0x0000003F)<<5)
48186 +/* Bit definitions and macros for ACADD */
48187 +#define MCF_SSI_ACADD_SSI_ACADD(x) (((x)&0x0007FFFF))
48189 +/* Bit definitions and macros for ACDAT */
48190 +#define MCF_SSI_ACDAT_SSI_ACDAT(x) (((x)&0x0007FFFF))
48192 +/* Bit definitions and macros for ATAG */
48193 +#define MCF_SSI_ATAG_DDI_ATAG(x) (((x)&0x0000FFFF))
48195 +/* Bit definitions and macros for TMASK */
48196 +#define MCF_SSI_TMASK_SSI_TMASK(x) (x)
48198 +/* Bit definitions and macros for RMASK */
48199 +#define MCF_SSI_RMASK_SSI_RMASK(x) (x)
48201 +/********************************************************************/
48203 +#endif /* __MCF5445X_SSI_H__ */
48205 +++ b/include/asm-m68k/mcf5445x_usb.h
48208 + * Duck Schmid duck@freescale.com
48210 + * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
48214 + * The code contained herein is licensed under the GNU General Public
48215 + * License. You may obtain a copy of the GNU General Public License
48216 + * Version 2 or later at the following locations:
48218 + * http://www.opensource.org/licenses/gpl-license.html
48219 + * http://www.gnu.org/copyleft/gpl.html
48222 +#include <asm/mcfsim.h>
48224 +/* ehci_arc_hc_driver.flags value */
48225 +#define FSL_PLATFORM_HC_FLAGS (HCD_USB2 | HCD_MEMORY)
48227 +static inline int fsl_platform_verify(struct platform_device *pdev)
48232 +static inline void fsl_platform_usb_setup(struct usb_hcd *hcd)
48236 +static inline void fsl_platform_set_host_mode(struct usb_hcd *hcd)
48238 + unsigned int temp;
48239 + struct fsl_usb2_platform_data *pdata;
48240 + struct fsl_usb_host_regs *regs;
48242 + pdata = hcd->self.controller->platform_data;
48243 + regs = pdata->regs;
48245 + if (pdata->xcvr_ops && pdata->xcvr_ops->set_host)
48246 + pdata->xcvr_ops->set_host();
48248 + /* set host mode and select "big endian" */
48249 + temp = fsl_readl(®s->usbmode);
48250 + temp |= USBMODE_CM_HOST | (pdata->es ? USBMODE_ES : 0);
48251 + fsl_writel(temp, ®s->usbmode);
48253 + pr_debug("%s: set usbmode to 0x%x\n\n", __FUNCTION__,
48254 + fsl_readl(®s->usbmode));
48258 +++ b/include/asm-m68k/mcf5445x_xbs.h
48261 + * Kurt Mahan kmahan@freescale.com
48263 + * Copyright Freescale Semiconductor, Inc. 2007
48265 + * This program is free software; you can redistribute it and/or modify it
48266 + * under the terms of the GNU General Public License as published by the
48267 + * Free Software Foundation; either version 2 of the License, or (at your
48268 + * option) any later version.
48271 +#ifndef __MCF5445X_XBS_H__
48272 +#define __MCF5445X_XBS_H__
48275 + * Crossbar Switch (XBS)
48278 +/* Register read/write macros */
48279 +#define MCF_XBS_PRS1 MCF_REG32(0xFC004100) /* Flexbus Priority */
48280 +#define MCF_XBS_CRS1 MCF_REG32(0xFC004110) /* Flexbus Control */
48281 +#define MCF_XBS_PRS2 MCF_REG32(0xFC004200) /* SDRam Priority */
48282 +#define MCF_XBS_CRS2 MCF_REG32(0xFC004210) /* SDRam Control */
48283 +#define MCF_XBS_PRS3 MCF_REG32(0xFC004300) /* ATA Priority */
48284 +#define MCF_XBS_CRS3 MCF_REG32(0xFC004310) /* ATA Control */
48285 +#define MCF_XBS_PRS4 MCF_REG32(0xFC004400) /* SRAM Priority */
48286 +#define MCF_XBS_CRS4 MCF_REG32(0xFC004410) /* SRAM Control */
48287 +#define MCF_XBS_PRS5 MCF_REG32(0xFC004500) /* PCI Priority */
48288 +#define MCF_XBS_CRS5 MCF_REG32(0xFC004510) /* PCI Control */
48289 +#define MCF_XBS_PRS6 MCF_REG32(0xFC004600) /* Slave6 Priority */
48290 +#define MCF_XBS_CRS6 MCF_REG32(0xFC004610) /* Slave6 Control */
48291 +#define MCF_XBS_PRS7 MCF_REG32(0xFC004700) /* Other Priority */
48292 +#define MCF_XBS_CRS7 MCF_REG32(0xFC004710) /* Other Control */
48295 +#define MCF_XBS_PRI_1 0 /* Level 1 (highest) */
48296 +#define MCF_XBS_PRI_2 1 /* Level 2 */
48297 +#define MCF_XBS_PRI_3 2 /* Level 3 */
48298 +#define MCF_XBS_PRI_4 3 /* Level 4 */
48299 +#define MCF_XBS_PRI_5 4 /* Level 5 */
48300 +#define MCF_XBS_PRI_6 5 /* Level 6 */
48301 +#define MCF_XBS_PRI_7 6 /* Level 7 (lowest) */
48302 +#define MCF_XBS_PRI_MASK 7 /* Mask (Not a valid level) */
48304 +/* Priority Register (PRSn) Defs */
48305 +#define MCF_XBS_PRS_MACRO(m,p) ((p)<<((m)<<2))
48306 +#define MCF_XBS_PRS_M0(p) MCF_XBS_PRS_MACRO(0, p) /* Coldfire Core */
48307 +#define MCF_XBS_PRS_M1(p) MCF_XBS_PRS_MACRO(1, p) /* eDMA */
48308 +#define MCF_XBS_PRS_M2(p) MCF_XBS_PRS_MACRO(2, p) /* FEC0 */
48309 +#define MCF_XBS_PRS_M3(p) MCF_XBS_PRS_MACRO(3, p) /* FEC1 */
48310 +#define MCF_XBS_PRS_M4(p) MCF_XBS_PRS_MACRO(4, p) /* Master 4 */
48311 +#define MCF_XBS_PRS_M5(p) MCF_XBS_PRS_MACRO(5, p) /* PCI */
48312 +#define MCF_XBS_PRS_M6(p) MCF_XBS_PRS_MACRO(6, p) /* USB OTG */
48313 +#define MCF_XBS_PRS_M7(p) MCF_XBS_PRS_MACRO(7, p) /* Serial Boot */
48315 +/* Control Register (CRSn) Defs */
48316 +#define MCF_XBS_CRS_RO 0x80000000 /* Read Only */
48317 +#define MCF_XBS_CRS_ARB 0x00000100 /* Arbitration Mode */
48318 +#define MCF_XBS_CRS_PCTL 0x00000030 /* Parking Control */
48319 +#define MCF_XBS_CRS_PARK 0x00000007 /* Park Location */
48321 +/* MCF_XBS_CRS_ARB Defs */
48322 +#define MCF_ABS_CRS_ARB_FIXED 0x00000000 /* Fixed priority */
48323 +#define MCF_ABS_CRS_ARB_ROUND 0x00000100 /* Round Robin priority */
48325 +/* MCF_XBS_CRS_PCTL Defs */
48326 +#define MCF_ABS_CRS_PCTL_PARK 0x00000000 /* Park on the defined PARK */
48327 +#define MCF_ABS_CRS_PCTL_LAST 0x00000010 /* Park on the last master */
48328 +#define MCF_ABS_CRS_PCTL_NONE 0x00000020 /* Don't park */
48330 +/* MCF_XBS_CRS_PARK Defs */
48331 +#define MCF_ABS_CRS_PARK_M0 0x00000000 /* Park on Coldfire Core */
48332 +#define MCF_ABS_CRS_PARK_M1 0x00000001 /* Park on eDMA */
48333 +#define MCF_ABS_CRS_PARK_M2 0x00000002 /* Park on FEC0 */
48334 +#define MCF_ABS_CRS_PARK_M3 0x00000003 /* Park on FEC1 */
48335 +#define MCF_ABS_CRS_PARK_M4 0x00000004 /* Park on Reserved */
48336 +#define MCF_ABS_CRS_PARK_M5 0x00000005 /* Park on PCI */
48337 +#define MCF_ABS_CRS_PARK_M6 0x00000006 /* Park on USB OTG */
48338 +#define MCF_ABS_CRS_PARK_M7 0x00000007 /* Park on Serial Boot */
48340 +#endif /* __MCF5445X_XBS_H__ */
48342 +++ b/include/asm-m68k/mcfdspi.h
48345 + * mcfdspi.h-DSPI controller for the ColdFire processors.
48348 + * Copyright Freescale Semiconductor, Inc. 2008
48350 + * This file is based on mcfqspi.h
48352 + * This program is free software; you can redistribute it and/or modify it
48353 + * under the terms of the GNU General Public License as published by the
48354 + * Free Software Foundation; either version 2 of the License, or (at your
48355 + * option) any later version.
48357 + * This program is distributed in the hope that it will be useful,
48358 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
48359 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48360 + * GNU General Public License for more details.
48362 + * You should have received a copy of the GNU General Public License
48363 + * along with this program; if not, write to the Free Software
48364 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
48366 + ***************************************************************************
48368 + * v0.001 25 March 2008 Andrey Butok
48369 + * Initial Release - developed on uClinux with 2.6.23 kernel.
48373 +#ifndef MCFDSPI_H_
48374 +#define MCFDSPI_H_
48376 +struct coldfire_dspi_chip {
48378 + u8 bits_per_word;
48379 + u16 void_write_data;
48380 + /* Only used in master mode */
48381 + u8 dbr; /* Double baud rate */
48382 + u8 pbr; /* Baud rate prescaler */
48383 + u8 br; /* Baud rate scaler */
48384 + u8 pcssck; /* PCS to SCK delay prescaler */
48385 + u8 pasc; /* After SCK delay prescaler */
48386 + u8 pdt; /* Delay after transfer prescaler */
48387 + u8 cssck; /* PCS to SCK delay scaler */
48388 + u8 asc; /* After SCK delay scaler */
48389 + u8 dt; /* Delay after transfer scaler */
48391 +#endif /*MCFDSPI_H_*/
48393 +++ b/include/asm-m68k/mcfqspi.h
48395 +/****************************************************************************/
48397 + * mcfqspi.h - Master QSPI controller for the ColdFire processors
48399 + * (C) Copyright 2005, Intec Automation,
48400 + * Mike Lavender (mike@steroidmicros)
48403 + This program is free software; you can redistribute it and/or modify
48404 + it under the terms of the GNU General Public License as published by
48405 + the Free Software Foundation; either version 2 of the License, or
48406 + (at your option) any later version.
48408 + This program is distributed in the hope that it will be useful,
48409 + but WITHOUT ANY WARRANTY; without even the implied warranty of
48410 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48411 + GNU General Public License for more details.
48413 + You should have received a copy of the GNU General Public License
48414 + along with this program; if not, write to the Free Software
48415 + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
48416 +/* ------------------------------------------------------------------------- */
48418 +#ifndef MCFQSPI_H_
48419 +#define MCFQSPI_H_
48421 +#define QSPI_CS_INIT 0x01
48422 +#define QSPI_CS_ASSERT 0x02
48423 +#define QSPI_CS_DROP 0x04
48425 +struct coldfire_spi_master {
48427 + u16 num_chipselect;
48434 + void (*cs_control)(u8 cs, u8 command);
48438 +struct coldfire_spi_chip {
48440 + u8 bits_per_word;
48441 + u8 del_cs_to_clk;
48442 + u8 del_after_trans;
48443 + u16 void_write_data;
48445 +#endif /*MCFQSPI_H_*/
48447 +++ b/include/asm-m68k/mcfsim.h
48450 + * mcfsim.h -- ColdFire System Integration Module support.
48452 + * (C) Copyright 1999-2003, Greg Ungerer (gerg@snapgear.com)
48453 + * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
48459 +#if defined(CONFIG_COLDFIRE)
48460 +#include <asm/coldfire.h>
48463 +#if defined(CONFIG_M5445X)
48464 +#include <asm/mcf5445x_intc.h>
48465 +#include <asm/mcf5445x_gpio.h>
48466 +#include <asm/mcf5445x_i2c.h>
48467 +#include <asm/mcf5445x_ccm.h>
48468 +#include <asm/mcf5445x_pci.h>
48469 +#include <asm/mcf5445x_pciarb.h>
48470 +#include <asm/mcf5445x_eport.h>
48471 +#include <asm/mcf5445x_fbcs.h>
48472 +#include <asm/mcf5445x_xbs.h>
48473 +#include <asm/mcf5445x_dtim.h>
48474 +#elif defined(CONFIG_M547X_8X)
48475 +#include <asm/m5485sim.h>
48476 +#include <asm/m5485gpio.h>
48480 + * Define the base address of the SIM within the MBAR address space.
48482 +#define MCFSIM_BASE 0x0 /* Base address of SIM */
48485 + * Bit definitions for the ICR family of registers.
48487 +#define MCFSIM_ICR_AUTOVEC 0x80 /* Auto-vectored intr */
48488 +#define MCFSIM_ICR_LEVEL0 0x00 /* Level 0 intr */
48489 +#define MCFSIM_ICR_LEVEL1 0x04 /* Level 1 intr */
48490 +#define MCFSIM_ICR_LEVEL2 0x08 /* Level 2 intr */
48491 +#define MCFSIM_ICR_LEVEL3 0x0c /* Level 3 intr */
48492 +#define MCFSIM_ICR_LEVEL4 0x10 /* Level 4 intr */
48493 +#define MCFSIM_ICR_LEVEL5 0x14 /* Level 5 intr */
48494 +#define MCFSIM_ICR_LEVEL6 0x18 /* Level 6 intr */
48495 +#define MCFSIM_ICR_LEVEL7 0x1c /* Level 7 intr */
48497 +#define MCFSIM_ICR_PRI0 0x00 /* Priority 0 intr */
48498 +#define MCFSIM_ICR_PRI1 0x01 /* Priority 1 intr */
48499 +#define MCFSIM_ICR_PRI2 0x02 /* Priority 2 intr */
48500 +#define MCFSIM_ICR_PRI3 0x03 /* Priority 3 intr */
48503 + * Bit definitions for the Interrupt Mask register (IMR).
48505 +#define MCFSIM_IMR_EINT1 0x0002 /* External intr # 1 */
48506 +#define MCFSIM_IMR_EINT2 0x0004 /* External intr # 2 */
48507 +#define MCFSIM_IMR_EINT3 0x0008 /* External intr # 3 */
48508 +#define MCFSIM_IMR_EINT4 0x0010 /* External intr # 4 */
48509 +#define MCFSIM_IMR_EINT5 0x0020 /* External intr # 5 */
48510 +#define MCFSIM_IMR_EINT6 0x0040 /* External intr # 6 */
48511 +#define MCFSIM_IMR_EINT7 0x0080 /* External intr # 7 */
48513 +#define MCFSIM_IMR_SWD 0x0100 /* Software Watchdog intr */
48514 +#define MCFSIM_IMR_TIMER1 0x0200 /* TIMER 1 intr */
48515 +#define MCFSIM_IMR_TIMER2 0x0400 /* TIMER 2 intr */
48516 +#define MCFSIM_IMR_MBUS 0x0800 /* MBUS intr */
48517 +#define MCFSIM_IMR_UART1 0x1000 /* UART 1 intr */
48518 +#define MCFSIM_IMR_UART2 0x2000 /* UART 2 intr */
48521 + * Mask for all of the SIM devices. Some parts have more or less
48522 + * SIM devices. This is a catchall for the sandard set.
48524 +#ifndef MCFSIM_IMR_MASKALL
48525 +#define MCFSIM_IMR_MASKALL 0x3ffe /* All intr sources */
48530 + * PIT interrupt settings, if not found in mXXXXsim.h file.
48532 +#ifndef ICR_INTRCONF
48533 +#define ICR_INTRCONF 0x2b /* PIT1 level 5, priority 3 */
48535 +#ifndef MCFPIT_IMR
48536 +#define MCFPIT_IMR MCFINTC_IMRH
48538 +#ifndef MCFPIT_IMR_IBIT
48539 +#define MCFPIT_IMR_IBIT (1 << (MCFINT_PIT1 - 32))
48543 +#ifndef __ASSEMBLY__
48545 + * Definition for the interrupt auto-vectoring support.
48547 +extern void mcf_autovector(unsigned int vec);
48548 +#endif /* __ASSEMBLY__ */
48550 +#endif /* mcfsim_h */
48552 +++ b/include/asm-m68k/mcfuart.h
48555 + * mcfuart.h -- ColdFire internal UART support defines.
48557 + * Matt Waddel Matt.Waddel@freescale.com
48558 + * Copyright Freescale Semiconductor, Inc. 2007
48560 + * Derived from m68knommu version of this same file (Greg Ungerer & Lineo).
48568 + * Define the base address of the UARTS within the MBAR address
48571 +#if defined(CONFIG_M5445X)
48572 +#include <asm/mcf5445x_intc.h>
48573 +#define MCFUART_BASE1 0xfc060000 /* Base address of UART1 */
48574 +#define MCFUART_BASE2 0xfc064000 /* Base address of UART2 */
48575 +#define MCFUART_BASE3 0xfc068000 /* Base address of UART3 */
48576 +#define MCFINT_VECBASE 64
48577 +#define MCFINT_UART0 26
48579 +#elif defined(CONFIG_M547X_8X)
48581 +#define MCFUART_BASE1 0x8600 /* Base address of UART1 */
48582 +#define MCFUART_BASE2 0x8700 /* Base address of UART2 */
48583 +#define MCFUART_BASE3 0x8800 /* Base address of UART3 */
48584 +#define MCFUART_BASE4 0x8900 /* Base address of UART4 */
48585 +#define MCFINT_VECBASE 64
48586 +#define MCFINT_UART0 35
48591 + * Define the ColdFire UART register set addresses.
48593 +#define MCFUART_UMR 0x00 /* Mode register (r/w) */
48594 +#define MCFUART_USR 0x04 /* Status register (r) */
48595 +#define MCFUART_UCSR 0x04 /* Clock Select (w) */
48596 +#define MCFUART_UCR 0x08 /* Command register (w) */
48597 +#define MCFUART_URB 0x0c /* Receiver Buffer (r) */
48598 +#define MCFUART_UTB 0x0c /* Transmit Buffer (w) */
48599 +#define MCFUART_UIPCR 0x10 /* Input Port Change (r) */
48600 +#define MCFUART_UACR 0x10 /* Auxiliary Control (w) */
48601 +#define MCFUART_UISR 0x14 /* Interrup Status (r) */
48602 +#define MCFUART_UIMR 0x14 /* Interrupt Mask (w) */
48603 +#define MCFUART_UBG1 0x18 /* Baud Rate MSB (r/w) */
48604 +#define MCFUART_UBG2 0x1c /* Baud Rate LSB (r/w) */
48605 +#ifdef CONFIG_M5272
48606 +#define MCFUART_UTF 0x28 /* Transmitter FIFO (r/w) */
48607 +#define MCFUART_URF 0x2c /* Receiver FIFO (r/w) */
48608 +#define MCFUART_UFPD 0x30 /* Frac Prec. Divider (r/w) */
48610 +#define MCFUART_UIVR 0x30 /* Interrupt Vector (r/w) */
48612 +#define MCFUART_UIPR 0x34 /* Input Port (r) */
48613 +#define MCFUART_UOP1 0x38 /* Output Port Bit Set (w) */
48614 +#define MCFUART_UOP0 0x3c /* Output Port Bit Reset (w) */
48618 + * Define bit flags in Mode Register 1 (MR1).
48620 +#define MCFUART_MR1_RXRTS 0x80 /* Auto RTS flow control */
48621 +#define MCFUART_MR1_RXIRQFULL 0x40 /* RX IRQ type FULL */
48622 +#define MCFUART_MR1_RXIRQRDY 0x00 /* RX IRQ type RDY */
48623 +#define MCFUART_MR1_RXERRBLOCK 0x20 /* RX block error mode */
48624 +#define MCFUART_MR1_RXERRCHAR 0x00 /* RX char error mode */
48626 +#define MCFUART_MR1_PARITYNONE 0x10 /* No parity */
48627 +#define MCFUART_MR1_PARITYEVEN 0x00 /* Even parity */
48628 +#define MCFUART_MR1_PARITYODD 0x04 /* Odd parity */
48629 +#define MCFUART_MR1_PARITYSPACE 0x08 /* Space parity */
48630 +#define MCFUART_MR1_PARITYMARK 0x0c /* Mark parity */
48632 +#define MCFUART_MR1_CS5 0x00 /* 5 bits per char */
48633 +#define MCFUART_MR1_CS6 0x01 /* 6 bits per char */
48634 +#define MCFUART_MR1_CS7 0x02 /* 7 bits per char */
48635 +#define MCFUART_MR1_CS8 0x03 /* 8 bits per char */
48638 + * Define bit flags in Mode Register 2 (MR2).
48640 +#define MCFUART_MR2_LOOPBACK 0x80 /* Loopback mode */
48641 +#define MCFUART_MR2_REMOTELOOP 0xc0 /* Remote loopback mode */
48642 +#define MCFUART_MR2_AUTOECHO 0x40 /* Automatic echo */
48643 +#define MCFUART_MR2_TXRTS 0x20 /* Assert RTS on TX */
48644 +#define MCFUART_MR2_TXCTS 0x10 /* Auto CTS flow control */
48646 +#define MCFUART_MR2_STOP1 0x07 /* 1 stop bit */
48647 +#define MCFUART_MR2_STOP15 0x08 /* 1.5 stop bits */
48648 +#define MCFUART_MR2_STOP2 0x0f /* 2 stop bits */
48651 + * Define bit flags in Status Register (USR).
48653 +#define MCFUART_USR_RXBREAK 0x80 /* Received BREAK */
48654 +#define MCFUART_USR_RXFRAMING 0x40 /* Received framing error */
48655 +#define MCFUART_USR_RXPARITY 0x20 /* Received parity error */
48656 +#define MCFUART_USR_RXOVERRUN 0x10 /* Received overrun error */
48657 +#define MCFUART_USR_TXEMPTY 0x08 /* Transmitter empty */
48658 +#define MCFUART_USR_TXREADY 0x04 /* Transmitter ready */
48659 +#define MCFUART_USR_RXFULL 0x02 /* Receiver full */
48660 +#define MCFUART_USR_RXREADY 0x01 /* Receiver ready */
48662 +#if defined(CONFIG_M547X_8X)
48663 +#define MCFUART_USR_TXREADY_BN 0x0a
48664 +#define MCFUART_USR_TXEMPTY_BN 0x0b
48667 +#define MCFUART_USR_RXERR (MCFUART_USR_RXBREAK | MCFUART_USR_RXFRAMING | \
48668 + MCFUART_USR_RXPARITY | MCFUART_USR_RXOVERRUN)
48671 + * Define bit flags in Clock Select Register (UCSR).
48673 +#define MCFUART_UCSR_RXCLKTIMER 0xd0 /* RX clock is timer */
48674 +#define MCFUART_UCSR_RXCLKEXT16 0xe0 /* RX clock is external x16 */
48675 +#define MCFUART_UCSR_RXCLKEXT1 0xf0 /* RX clock is external x1 */
48677 +#define MCFUART_UCSR_TXCLKTIMER 0x0d /* TX clock is timer */
48678 +#define MCFUART_UCSR_TXCLKEXT16 0x0e /* TX clock is external x16 */
48679 +#define MCFUART_UCSR_TXCLKEXT1 0x0f /* TX clock is external x1 */
48682 + * Define bit flags in Command Register (UCR).
48684 +#define MCFUART_UCR_CMDNULL 0x00 /* No command */
48685 +#define MCFUART_UCR_CMDRESETMRPTR 0x10 /* Reset MR pointer */
48686 +#define MCFUART_UCR_CMDRESETRX 0x20 /* Reset receiver */
48687 +#define MCFUART_UCR_CMDRESETTX 0x30 /* Reset transmitter */
48688 +#define MCFUART_UCR_CMDRESETERR 0x40 /* Reset error status */
48689 +#define MCFUART_UCR_CMDRESETBREAK 0x50 /* Reset BREAK change */
48690 +#define MCFUART_UCR_CMDBREAKSTART 0x60 /* Start BREAK */
48691 +#define MCFUART_UCR_CMDBREAKSTOP 0x70 /* Stop BREAK */
48693 +#define MCFUART_UCR_TXNULL 0x00 /* No TX command */
48694 +#define MCFUART_UCR_TXENABLE 0x04 /* Enable TX */
48695 +#define MCFUART_UCR_TXDISABLE 0x08 /* Disable TX */
48696 +#define MCFUART_UCR_RXNULL 0x00 /* No RX command */
48697 +#define MCFUART_UCR_RXENABLE 0x01 /* Enable RX */
48698 +#define MCFUART_UCR_RXDISABLE 0x02 /* Disable RX */
48701 + * Define bit flags in Input Port Change Register (UIPCR).
48703 +#define MCFUART_UIPCR_CTSCOS 0x10 /* CTS change of state */
48704 +#define MCFUART_UIPCR_CTS 0x01 /* CTS value */
48707 + * Define bit flags in Input Port Register (UIP).
48709 +#define MCFUART_UIPR_CTS 0x01 /* CTS value */
48712 + * Define bit flags in Output Port Registers (UOP).
48713 + * Clear bit by writing to UOP0, set by writing to UOP1.
48715 +#define MCFUART_UOP_RTS 0x01 /* RTS set or clear */
48718 + * Define bit flags in the Auxiliary Control Register (UACR).
48720 +#define MCFUART_UACR_IEC 0x01 /* Input enable control */
48723 + * Define bit flags in Interrupt Status Register (UISR).
48724 + * These same bits are used for the Interrupt Mask Register (UIMR).
48726 +#define MCFUART_UIR_COS 0x80 /* Change of state (CTS) */
48727 +#define MCFUART_UIR_DELTABREAK 0x04 /* Break start or stop */
48728 +#define MCFUART_UIR_RXREADY 0x02 /* Receiver ready */
48729 +#define MCFUART_UIR_TXREADY 0x01 /* Transmitter ready */
48731 +#ifdef CONFIG_M5272
48733 + * Define bit flags in the Transmitter FIFO Register (UTF).
48735 +#define MCFUART_UTF_TXB 0x1f /* Transmitter data level */
48736 +#define MCFUART_UTF_FULL 0x20 /* Transmitter fifo full */
48737 +#define MCFUART_UTF_TXS 0xc0 /* Transmitter status */
48740 + * Define bit flags in the Receiver FIFO Register (URF).
48742 +#define MCFUART_URF_RXB 0x1f /* Receiver data level */
48743 +#define MCFUART_URF_FULL 0x20 /* Receiver fifo full */
48744 +#define MCFUART_URF_RXS 0xc0 /* Receiver status */
48747 +#endif /* mcfuart_h */
48748 --- a/include/asm-m68k/mmu_context.h
48749 +++ b/include/asm-m68k/mmu_context.h
48750 @@ -7,7 +7,7 @@ static inline void enter_lazy_tlb(struct
48754 -#ifndef CONFIG_SUN3
48755 +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
48757 #include <asm/setup.h>
48758 #include <asm/page.h>
48759 @@ -102,7 +102,7 @@ static inline void activate_mm(struct mm
48760 switch_mm_0460(next_mm);
48763 -#else /* CONFIG_SUN3 */
48764 +#elif defined(CONFIG_SUN3)
48765 #include <asm/sun3mmu.h>
48766 #include <linux/sched.h>
48768 @@ -150,5 +150,155 @@ static inline void activate_mm(struct mm
48769 activate_context(next_mm);
48773 +#else /* CONFIG_COLDFIRE */
48775 +#include <asm/coldfire.h>
48776 +#include <asm/atomic.h>
48777 +#include <asm/bitops.h>
48778 +#include <asm/mmu.h>
48780 +#define NO_CONTEXT 256
48781 +#define LAST_CONTEXT 255
48782 +#define FIRST_CONTEXT 1
48784 +extern void set_context(mm_context_t context, pgd_t *pgd);
48785 +extern unsigned long context_map[];
48786 +extern mm_context_t next_mmu_context;
48788 +extern atomic_t nr_free_contexts;
48789 +extern struct mm_struct *context_mm[LAST_CONTEXT+1];
48790 +extern void steal_context(void);
48792 +static inline void get_mmu_context(struct mm_struct *mm)
48794 + mm_context_t ctx;
48796 + if (mm->context != NO_CONTEXT)
48798 + while (atomic_dec_and_test_lt(&nr_free_contexts)) {
48799 + atomic_inc(&nr_free_contexts);
48802 + ctx = next_mmu_context;
48803 + while (test_and_set_bit(ctx, context_map)) {
48804 + ctx = find_next_zero_bit(context_map, LAST_CONTEXT+1, ctx);
48805 + if (ctx > LAST_CONTEXT)
48808 + next_mmu_context = (ctx + 1) & LAST_CONTEXT;
48809 + mm->context = ctx;
48810 + context_mm[ctx] = mm;
48814 + * Set up the context for a new address space.
48816 +#define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0)
48819 + * We're finished using the context for an address space.
48821 +static inline void destroy_context(struct mm_struct *mm)
48823 + if (mm->context != NO_CONTEXT) {
48824 + clear_bit(mm->context, context_map);
48825 + mm->context = NO_CONTEXT;
48826 + atomic_inc(&nr_free_contexts);
48830 +static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
48831 + struct task_struct *tsk)
48833 + get_mmu_context(tsk->mm);
48834 + set_context(tsk->mm->context, next->pgd);
48838 + * After we have set current->mm to a new value, this activates
48839 + * the context for the new mm so we see the new mappings.
48841 +static inline void activate_mm(struct mm_struct *active_mm,
48842 + struct mm_struct *mm)
48844 + get_mmu_context(mm);
48845 + set_context(mm->context, mm->pgd);
48848 +#define deactivate_mm(tsk, mm) do { } while (0)
48850 +extern void mmu_context_init(void);
48851 +#if defined(CONFIG_M547X_8X)
48852 +#define prepare_arch_switch(next) load_ksp_mmu(next)
48854 +static inline void load_ksp_mmu(struct task_struct *task)
48857 + struct mm_struct *mm;
48862 + unsigned long mmuar;
48864 + local_irq_save(flags);
48865 + mmuar = task->thread.ksp;
48867 + /* Search for a valid TLB entry, if one is found, don't remap */
48869 + *MMUOR = MMUOR_STLB | MMUOR_ADR;
48870 + if ((*MMUSR) & MMUSR_HIT)
48873 + if (mmuar >= PAGE_OFFSET) {
48876 + printk ("load_ksp_mmu: non-kernel mm found: 0x%08x\n", (unsigned int) task->mm);
48883 + pgd = pgd_offset(mm, mmuar);
48884 + if (pgd_none(*pgd))
48887 + pmd = pmd_offset(pgd, mmuar);
48888 + if (pmd_none(*pmd))
48891 + pte = (mmuar >= PAGE_OFFSET) ? pte_offset_kernel(pmd, mmuar)
48892 + : pte_offset_map(pmd, mmuar);
48893 + if (pte_none(*pte) || !pte_present(*pte))
48896 + set_pte(pte, pte_mkyoung(*pte));
48897 + asid = mm->context & 0xff;
48898 + if (!pte_dirty(*pte) && mmuar<=PAGE_OFFSET)
48899 + set_pte(pte, pte_wrprotect(*pte));
48901 + *MMUTR = (mmuar & PAGE_MASK) | (asid << CF_ASID_MMU_SHIFT)
48902 + | (((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK ) >> CF_PAGE_MMUTR_SHIFT)
48905 + *MMUDR = (pte_val(*pte) & PAGE_MASK)
48906 + | ((pte->pte) & CF_PAGE_MMUDR_MASK)
48907 + | MMUDR_SZ8K | MMUDR_X;
48909 + *MMUOR = MMUOR_ACC | MMUOR_UAA;
48915 + printk ("ksp load failed: mm=0x%08x ksp=0x%08x\n", (unsigned int) mm, (unsigned int) mmuar);
48918 + local_irq_restore(flags);
48921 +#endif /* CONFIG_M547X_8X */
48923 +#endif /* CONFIG_COLDFIRE */
48925 --- a/include/asm-m68k/page.h
48926 +++ b/include/asm-m68k/page.h
48928 #include <linux/const.h>
48930 /* PAGE_SHIFT determines the page size */
48931 -#ifndef CONFIG_SUN3
48932 +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
48933 #define PAGE_SHIFT (12)
48935 #define PAGE_SHIFT (13)
48936 @@ -116,10 +116,31 @@ typedef struct page *pgtable_t;
48938 extern unsigned long m68k_memoffset;
48940 -#ifndef CONFIG_SUN3
48941 +#if !defined(CONFIG_SUN3)
48943 #define WANT_PAGE_VIRTUAL
48945 +#if defined(CONFIG_COLDFIRE)
48946 +static inline unsigned long ___pa(void *vaddr)
48948 +#if CONFIG_SDRAM_BASE != PAGE_OFFSET
48949 + return (((unsigned long)vaddr & 0x0fffffff) + CONFIG_SDRAM_BASE);
48951 + return (unsigned long)vaddr;
48954 +#define __pa(vaddr) ___pa((void *)(vaddr))
48956 +static inline void *__va(unsigned long paddr)
48958 +#if CONFIG_SDRAM_BASE != PAGE_OFFSET
48959 + return (void *)((paddr & 0x0fffffff) + PAGE_OFFSET);
48961 + return (void *)paddr;
48966 static inline unsigned long ___pa(void *vaddr)
48968 unsigned long paddr;
48969 @@ -141,6 +162,7 @@ static inline void *__va(unsigned long p
48970 : "0" (paddr), "i" (m68k_fixup_memoffset));
48975 #else /* !CONFIG_SUN3 */
48976 /* This #define is a horrible hack to suppress lots of warnings. --m */
48977 @@ -172,6 +194,8 @@ static inline void *__va(unsigned long x
48978 * memory node, but we have no highmem, so that works for now.
48979 * TODO: implement (fast) pfn<->pgdat_idx conversion functions, this makes lots
48980 * of the shifts unnecessary.
48982 + * PFNs are used to map physical pages. So PFN[0] maps to the base phys addr.
48984 #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
48985 #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
48986 @@ -228,4 +252,9 @@ static inline __attribute_const__ int __
48988 #include <asm-generic/page.h>
48990 +#ifdef CONFIG_VSYSCALL
48991 +/* vDSO support */
48992 +#define __HAVE_ARCH_GATE_AREA
48995 #endif /* _M68K_PAGE_H */
48996 --- a/include/asm-m68k/page_offset.h
48997 +++ b/include/asm-m68k/page_offset.h
49000 + * Page and physical memory maps.
49002 +#if defined(CONFIG_SUN3)
49003 +#define PAGE_OFFSET_RAW 0x0E000000
49005 +#elif defined(CONFIG_M5445X) || defined(CONFIG_M547X_8X)
49006 +#define PHYS_OFFSET CONFIG_SDRAM_BASE
49007 +#define PAGE_OFFSET_RAW (PHYS_OFFSET)
49008 +/* #define PAGE_OFFSET_RAW 0xC0000000 */
49010 -/* This handles the memory map.. */
49011 -#ifndef CONFIG_SUN3
49012 -#define PAGE_OFFSET_RAW 0x00000000
49014 -#define PAGE_OFFSET_RAW 0x0E000000
49016 +#define PAGE_OFFSET_RAW 0x00000000
49019 --- a/include/asm-m68k/pci.h
49020 +++ b/include/asm-m68k/pci.h
49022 -#ifndef _ASM_M68K_PCI_H
49023 -#define _ASM_M68K_PCI_H
49024 +#ifndef M68K_PCI_H
49025 +#define M68K_PCI_H
49028 - * asm-m68k/pci_m68k.h - m68k specific PCI declarations.
49030 - * Written by Wout Klaren.
49032 +#ifdef CONFIG_M5445X
49033 +#include "5445x_pci.h"
49035 +#include "548x_pci.h"
49038 -#include <asm/scatterlist.h>
49043 - * Structure with hardware dependent information and functions of the
49047 -struct pci_bus_info
49050 - * Resources of the PCI bus.
49053 - struct resource mem_space;
49054 - struct resource io_space;
49057 - * System dependent functions.
49060 - struct pci_ops *m68k_pci_ops;
49062 - void (*fixup)(int pci_modify);
49063 - void (*conf_device)(struct pci_dev *dev);
49066 -#define pcibios_assign_all_busses() 0
49067 -#define pcibios_scan_all_fns(a, b) 0
49069 -static inline void pcibios_set_master(struct pci_dev *dev)
49071 - /* No special bus mastering setup handling */
49074 -static inline void pcibios_penalize_isa_irq(int irq, int active)
49076 - /* We don't do dynamic PCI IRQ allocation */
49079 -/* The PCI address space does equal the physical memory
49080 - * address space. The networking and block device layers use
49081 - * this boolean for bounce buffer decisions.
49083 -#define PCI_DMA_BUS_IS_PHYS (1)
49085 -#endif /* _ASM_M68K_PCI_H */
49086 +#endif /* M68K_PCI_H */
49087 --- a/include/asm-m68k/pgalloc.h
49088 +++ b/include/asm-m68k/pgalloc.h
49090 #include <asm/virtconvert.h>
49093 -#ifdef CONFIG_SUN3
49094 +#if defined(CONFIG_SUN3)
49095 #include <asm/sun3_pgalloc.h>
49096 +#elif defined(CONFIG_COLDFIRE)
49097 +#include <asm/cf_pgalloc.h>
49099 #include <asm/motorola_pgalloc.h>
49101 --- a/include/asm-m68k/pgtable.h
49102 +++ b/include/asm-m68k/pgtable.h
49104 /* PGDIR_SHIFT determines what a third-level page table entry can map */
49106 #define PGDIR_SHIFT 17
49107 +#elif defined(CONFIG_COLDFIRE)
49108 +#define PGDIR_SHIFT 22
49110 #define PGDIR_SHIFT 25
49113 #define PTRS_PER_PTE 16
49114 #define PTRS_PER_PMD 1
49115 #define PTRS_PER_PGD 2048
49116 +#elif defined(CONFIG_COLDFIRE)
49117 +#define PTRS_PER_PTE 512
49118 +#define PTRS_PER_PMD 1
49119 +#define PTRS_PER_PGD 1024
49121 #define PTRS_PER_PTE 1024
49122 #define PTRS_PER_PMD 8
49125 #define KMAP_START 0x0DC00000
49126 #define KMAP_END 0x0E000000
49127 +#elif defined(CONFIG_COLDFIRE)
49128 +#define VMALLOC_START 0xc0000000
49129 +#define VMALLOC_END 0xcfffffff
49130 +#define KMAP_START (VMALLOC_END + 1)
49131 +#define KMAP_END 0xe0000000
49133 #define KMAP_START 0xd0000000
49134 #define KMAP_END 0xf0000000
49136 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
49137 * area for the same reason. ;)
49139 +#if !defined(CONFIG_COLDFIRE)
49140 #define VMALLOC_OFFSET (8*1024*1024)
49141 #define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
49142 #define VMALLOC_END KMAP_START
49145 extern unsigned long vmalloc_end;
49146 #define VMALLOC_START 0x0f800000
49147 @@ -130,6 +143,8 @@ static inline void update_mmu_cache(stru
49150 #include <asm/sun3_pgtable.h>
49151 +#elif defined(CONFIG_COLDFIRE)
49152 +#include <asm/cf_pgtable.h>
49154 #include <asm/motorola_pgtable.h>
49156 @@ -140,6 +155,9 @@ static inline void update_mmu_cache(stru
49158 * Macro to mark a page protection value as "uncacheable".
49160 +#ifdef CONFIG_COLDFIRE
49161 +# define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | CF_PAGE_NOCACHE))
49162 +#else /* CONFIG_COLDFIRE */
49163 #ifdef SUN3_PAGE_NOCACHE
49164 # define __SUN3_PAGE_NOCACHE SUN3_PAGE_NOCACHE
49166 @@ -154,6 +172,7 @@ static inline void update_mmu_cache(stru
49167 ? (__pgprot((pgprot_val(prot) & _CACHEMASK040) | _PAGE_NOCACHE_S)) \
49170 +#endif /* CONFIG_COLDFIRE */
49171 #endif /* !__ASSEMBLY__ */
49174 --- a/include/asm-m68k/processor.h
49175 +++ b/include/asm-m68k/processor.h
49176 @@ -22,24 +22,38 @@ static inline unsigned long rdusp(void)
49180 +#ifndef CONFIG_COLDFIRE
49181 __asm__ __volatile__("move %/usp,%0" : "=a" (usp));
49183 + __asm__ __volatile__("movel %/usp,%0" : "=a" (usp));
49188 static inline void wrusp(unsigned long usp)
49190 +#ifndef CONFIG_COLDFIRE
49191 __asm__ __volatile__("move %0,%/usp" : : "a" (usp));
49193 + __asm__ __volatile__("movel %0,%/usp" : : "a" (usp));
49198 * User space process size: 3.75GB. This is hardcoded into a few places,
49199 * so don't change it unless you know what you are doing.
49201 -#ifndef CONFIG_SUN3
49202 +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
49203 #define TASK_SIZE (0xF0000000UL)
49204 +#elif defined(CONFIG_COLDFIRE)
49205 +#define TASK_SIZE (0xC0000000UL)
49206 +#else /* CONFIG_SUN3 */
49207 +#ifdef __ASSEMBLY__
49208 +#define TASK_SIZE (0x0E000000)
49210 #define TASK_SIZE (0x0E000000UL)
49215 #define STACK_TOP TASK_SIZE
49216 @@ -49,9 +63,11 @@ static inline void wrusp(unsigned long u
49217 /* This decides where the kernel will search for a free chunk of vm
49218 * space during mmap's.
49220 -#ifndef CONFIG_SUN3
49221 -#define TASK_UNMAPPED_BASE 0xC0000000UL
49223 +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
49224 +#define TASK_UNMAPPED_BASE 0xC0000000UL
49225 +#elif defined(CONFIG_COLDFIRE)
49226 +#define TASK_UNMAPPED_BASE 0x80000000UL
49227 +#else /* CONFIG_SUN3 */
49228 #define TASK_UNMAPPED_BASE 0x0A000000UL
49230 #define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
49231 @@ -60,7 +76,11 @@ struct thread_struct {
49232 unsigned long ksp; /* kernel stack pointer */
49233 unsigned long usp; /* user stack pointer */
49234 unsigned short sr; /* saved status register */
49235 +#ifndef CONFIG_COLDFIRE
49236 unsigned short fs; /* saved fs (sfc, dfc) */
49240 unsigned long crp[2]; /* cpu root pointer */
49241 unsigned long esp0; /* points to SR of stack frame */
49242 unsigned long faddr; /* info about last fault */
49243 @@ -81,6 +101,7 @@ struct thread_struct {
49245 * Do necessary setup to start up a newly executed thread.
49247 +#ifndef CONFIG_COLDFIRE
49248 static inline void start_thread(struct pt_regs * regs, unsigned long pc,
49251 @@ -91,6 +112,23 @@ static inline void start_thread(struct p
49252 regs->sr &= ~0x2000;
49257 + * Do necessary setup to start up a newly executed thread.
49259 + * pass the data segment into user programs if it exists,
49260 + * it can't hurt anything as far as I can tell
49262 +#define start_thread(_regs, _pc, _usp) \
49264 + set_fs(USER_DS); /* reads from user space */ \
49265 + (_regs)->pc = (_pc); \
49266 + if (current->mm) \
49267 + (_regs)->d5 = current->mm->start_data; \
49268 + (_regs)->sr &= ~0x2000; \
49273 /* Forward declaration, a strange C thing */
49274 struct task_struct;
49275 --- a/include/asm-m68k/ptrace.h
49276 +++ b/include/asm-m68k/ptrace.h
49277 @@ -38,10 +38,21 @@ struct pt_regs {
49281 +#ifndef CONFIG_COLDFIRE
49284 unsigned format : 4; /* frame format specifier */
49285 unsigned vector : 12; /* vector offset */
49287 + unsigned long mmuar;
49288 + unsigned long mmusr;
49289 + unsigned format : 4; /* frame format specifier */
49290 + unsigned fs2 : 2;
49291 + unsigned vector: 8;
49292 + unsigned fs1 : 2;
49293 + unsigned short sr;
49294 + unsigned long pc;
49299 --- a/include/asm-m68k/raw_io.h
49300 +++ b/include/asm-m68k/raw_io.h
49301 @@ -46,6 +46,29 @@ extern void __iounmap(void *addr, unsign
49302 #define out_le16(addr,w) (void)((*(__force volatile __le16 *) (addr)) = cpu_to_le16(w))
49303 #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
49305 +#if (defined CONFIG_COLDFIRE) && (defined CONFIG_PCI)
49306 +unsigned char pci_inb(long addr);
49307 +unsigned short pci_inw(long addr);
49308 +unsigned long pci_inl(long addr);
49309 +void pci_outb(unsigned char val, long addr);
49310 +void pci_outw(unsigned short val, long addr);
49311 +void pci_outl(unsigned long val, long addr);
49312 +unsigned short pci_raw_inw(long addr);
49313 +unsigned long pci_raw_inl(long addr);
49314 +void pci_raw_outw(unsigned short val, long addr);
49315 +void pci_raw_outl(unsigned long val, long addr);
49316 +#define raw_inb(port) pci_inb((long)((volatile unsigned char *)(port)))
49317 +#define raw_inw(port) pci_raw_inw((long)((volatile unsigned short *)(port)))
49318 +#define raw_inl(port) pci_raw_inl((long)((volatile unsigned long *)(port)))
49320 +#define raw_outb(val,port) pci_outb((val),(long)((volatile unsigned char *)(port)))
49321 +#define raw_outw(val,port) pci_raw_outw((val),(long)((volatile unsigned short *)(port)))
49322 +#define raw_outl(val,port) pci_raw_outl((val),(long)((volatile unsigned long *)(port)))
49324 +#define swap_inw(port) pci_inw((long)((volatile unsigned short *)(port)))
49325 +#define swap_outw(val,port) pci_outw((val),(long)((volatile unsigned short *)(port)))
49328 #define raw_inb in_8
49329 #define raw_inw in_be16
49330 #define raw_inl in_be32
49331 @@ -60,6 +83,9 @@ extern void __iounmap(void *addr, unsign
49332 #define __raw_writew(val,addr) out_be16((addr),(val))
49333 #define __raw_writel(val,addr) out_be32((addr),(val))
49335 +#define swap_inw(port) in_le16((port))
49336 +#define swap_outw(val,port) out_le16((port),(val))
49338 static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len)
49341 @@ -77,6 +103,7 @@ static inline void raw_outsb(volatile u8
49342 out_8(port, *buf++);
49345 +#ifndef CONFIG_COLDFIRE
49346 static inline void raw_insw(volatile u16 __iomem *port, u16 *buf, unsigned int nr)
49349 @@ -342,6 +369,63 @@ static inline void raw_outsw_swapw(volat
49350 : "d0", "a0", "a1", "d6");
49354 +#else /*CONFIG_COLDFIRE */
49356 +static inline void raw_insw(volatile u16 *port, u16 *buf, unsigned int nr)
49360 + for (i = 0; i < nr; i++)
49361 + *buf++ = raw_inw(port);
49364 +static inline void raw_outsw(volatile u16 *port, const u16 *buf,
49369 + for (i = 0; i < nr; i++, buf++)
49370 + raw_outw(*buf, port);
49373 +static inline void raw_insl(volatile u32 *port, u32 *buf, unsigned int nr)
49377 + for (i = 0; i < nr; i++)
49378 + *buf++ = raw_inl(port);
49381 +static inline void raw_outsl(volatile u32 *port, const u32 *buf,
49386 + for (i = 0; i < nr; i++, buf++)
49387 + raw_outl(*buf, port);
49390 +static inline void raw_insw_swapw(volatile u16 *port, u16 *buf,
49395 + for (i = 0; i < nr; i++)
49396 + *buf++ = in_le16(port);
49400 +static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf,
49405 + for (i = 0; i < nr; i++, buf++)
49406 + out_le16(port, *buf);
49408 +#endif /*CONFIG_COLDFIRE */
49410 #endif /* __KERNEL__ */
49412 #endif /* _RAW_IO_H */
49413 --- a/include/asm-m68k/segment.h
49414 +++ b/include/asm-m68k/segment.h
49415 @@ -29,6 +29,7 @@ typedef struct {
49416 * Get/set the SFC/DFC registers for MOVES instructions
49419 +#ifndef CONFIG_COLDFIRE
49420 static inline mm_segment_t get_fs(void)
49423 @@ -50,6 +51,15 @@ static inline void set_fs(mm_segment_t v
49424 : /* no outputs */ : "r" (val.seg) : "memory");
49427 +#else /* CONFIG_COLDFIRE */
49429 +#include <asm/current.h>
49430 +#define get_fs() (current->thread.fs)
49431 +#define set_fs(val) (current->thread.fs = (val))
49432 +#define get_ds() (KERNEL_DS)
49434 +#endif /* CONFIG_COLDFIRE */
49436 #define segment_eq(a,b) ((a).seg == (b).seg)
49438 #endif /* __ASSEMBLY__ */
49439 --- a/include/asm-m68k/setup.h
49440 +++ b/include/asm-m68k/setup.h
49442 #define MACH_HP300 9
49443 #define MACH_Q40 10
49444 #define MACH_SUN3X 11
49445 +#define MACH_CFMMU 12
49447 #define COMMAND_LINE_SIZE 256
49449 @@ -189,6 +190,14 @@ extern unsigned long m68k_machtype;
49450 # define MACH_TYPE (MACH_SUN3X)
49453 +#if !defined(CONFIG_COLDFIRE)
49454 +# define MACH_IS_COLDFIRE (0)
49456 +# define CONFIG_COLDFIRE_ONLY
49457 +# define MACH_IS_COLDFIRE (1)
49458 +# define MACH_TYPE (MACH_CFMMU)
49462 # define MACH_TYPE (m68k_machtype)
49464 @@ -211,23 +220,31 @@ extern unsigned long m68k_machtype;
49465 #define CPUB_68030 1
49466 #define CPUB_68040 2
49467 #define CPUB_68060 3
49468 +#define CPUB_CFV4E 4
49470 #define CPU_68020 (1<<CPUB_68020)
49471 #define CPU_68030 (1<<CPUB_68030)
49472 #define CPU_68040 (1<<CPUB_68040)
49473 #define CPU_68060 (1<<CPUB_68060)
49474 +#define CPU_CFV4E (1<<CPUB_CFV4E)
49476 #define FPUB_68881 0
49477 #define FPUB_68882 1
49478 #define FPUB_68040 2 /* Internal FPU */
49479 #define FPUB_68060 3 /* Internal FPU */
49480 #define FPUB_SUNFPA 4 /* Sun-3 FPA */
49481 +#define FPUB_CFV4E 5
49483 #define FPU_68881 (1<<FPUB_68881)
49484 #define FPU_68882 (1<<FPUB_68882)
49485 #define FPU_68040 (1<<FPUB_68040)
49486 #define FPU_68060 (1<<FPUB_68060)
49487 #define FPU_SUNFPA (1<<FPUB_SUNFPA)
49488 +#ifndef CONFIG_M5445X
49489 +#define FPU_CFV4E (1<<FPUB_CFV4E)
49491 +#define FPU_CFV4E 0
49494 #define MMUB_68851 0
49495 #define MMUB_68030 1 /* Internal MMU */
49496 @@ -235,6 +252,7 @@ extern unsigned long m68k_machtype;
49497 #define MMUB_68060 3 /* Internal MMU */
49498 #define MMUB_APOLLO 4 /* Custom Apollo */
49499 #define MMUB_SUN3 5 /* Custom Sun-3 */
49500 +#define MMUB_CFV4E 6
49502 #define MMU_68851 (1<<MMUB_68851)
49503 #define MMU_68030 (1<<MMUB_68030)
49504 @@ -242,6 +260,7 @@ extern unsigned long m68k_machtype;
49505 #define MMU_68060 (1<<MMUB_68060)
49506 #define MMU_SUN3 (1<<MMUB_SUN3)
49507 #define MMU_APOLLO (1<<MMUB_APOLLO)
49508 +#define MMU_CFV4E (1<<MMUB_CFV4E)
49512 @@ -341,6 +360,14 @@ extern int m68k_is040or060;
49516 +#if !defined(CONFIG_CFV4E)
49517 +# define CPU_IS_COLDFIRE (0)
49519 +# define CPU_IS_COLDFIRE (1)
49520 +# define CPU_IS_CFV4E (1)
49521 +# define MMU_IS_CFV4E (1)
49524 #define CPU_TYPE (m68k_cputype)
49526 #ifdef CONFIG_M68KFPU_EMU
49527 --- a/include/asm-m68k/signal.h
49528 +++ b/include/asm-m68k/signal.h
49529 @@ -150,6 +150,7 @@ typedef struct sigaltstack {
49531 #include <asm/sigcontext.h>
49533 +#ifndef CONFIG_COLDFIRE
49534 #define __HAVE_ARCH_SIG_BITOPS
49536 static inline void sigaddset(sigset_t *set, int _sig)
49537 @@ -200,6 +201,10 @@ static inline int sigfindinword(unsigned
49540 extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
49543 +#define ptrace_signal_deliver(regs, cookie) do { } while (0)
49544 +#endif /* CONFIG_COLDFIRE */
49546 #endif /* __KERNEL__ */
49548 --- a/include/asm-m68k/string.h
49549 +++ b/include/asm-m68k/string.h
49550 @@ -93,6 +93,7 @@ static inline char *strchr(const char *s
49551 return (char *)s - 1;
49554 +#ifndef CONFIG_COLDFIRE
49555 #define __HAVE_ARCH_STRCMP
49556 static inline int strcmp(const char *cs, const char *ct)
49558 @@ -110,6 +111,7 @@ static inline int strcmp(const char *cs,
49559 : "+a" (cs), "+a" (ct), "=d" (res));
49564 #define __HAVE_ARCH_MEMSET
49565 extern void *memset(void *, int, __kernel_size_t);
49566 --- a/include/asm-m68k/system.h
49567 +++ b/include/asm-m68k/system.h
49569 #include <linux/kernel.h>
49570 #include <asm/segment.h>
49571 #include <asm/entry.h>
49572 +#include <asm/cfcache.h>
49576 +#ifdef CONFIG_COLDFIRE
49577 +#define FLUSH_BC (0x00040000)
49579 +#define finish_arch_switch(prev) do { \
49580 + unsigned long tmpreg; \
49581 + asm volatile ( "move.l %2,%0\n" \
49583 + "movec %0,%%cacr" \
49584 + : "=&d" (tmpreg) \
49585 + : "id" (FLUSH_BC), "m" (shadow_cacr)); \
49591 * switch_to(n) should switch tasks to task ptr, first checking that
49592 * ptr isn't the current task, in which case it does nothing. This
49593 @@ -63,16 +78,25 @@ asmlinkage void resume(void);
49594 #define smp_read_barrier_depends() ((void)0)
49596 /* interrupt control.. */
49598 -#define local_irq_enable() asm volatile ("andiw %0,%%sr": : "i" (ALLOWINT) : "memory")
49600 #include <linux/hardirq.h>
49601 +#ifndef CONFIG_COLDFIRE
49602 #define local_irq_enable() ({ \
49603 if (MACH_IS_Q40 || !hardirq_count()) \
49604 asm volatile ("andiw %0,%%sr": : "i" (ALLOWINT) : "memory"); \
49607 #define local_irq_disable() asm volatile ("oriw #0x0700,%%sr": : : "memory")
49608 +#else /* CONFIG_COLDFIRE */
49609 +#define local_irq_enable() \
49610 + asm volatile ("move.w %%sr, %%d0\n\t" \
49611 + "andil #0xf8ff,%%d0\n\t" \
49612 + "move.w %%d0, %%sr\n" \
49613 + : : : "cc", "d0", "memory")
49614 +#define local_irq_disable() \
49615 + asm volatile ("move %/sr,%%d0\n\t" \
49616 + "ori.l #0x0700,%%d0\n\t" \
49617 + "move %%d0,%/sr\n" \
49618 + : : : "cc", "%d0", "memory")
49620 #define local_save_flags(x) asm volatile ("movew %%sr,%0":"=d" (x) : : "memory")
49621 #define local_irq_restore(x) asm volatile ("movew %0,%%sr": :"d" (x) : "memory")
49623 --- a/include/asm-m68k/thread_info.h
49624 +++ b/include/asm-m68k/thread_info.h
49625 @@ -58,5 +58,6 @@ struct thread_info {
49626 #define TIF_DELAYED_TRACE 14 /* single step a syscall */
49627 #define TIF_SYSCALL_TRACE 15 /* syscall trace active */
49628 #define TIF_MEMDIE 16
49629 +#define TIF_FREEZE 17 /* freezing processes */
49631 #endif /* _ASM_M68K_THREAD_INFO_H */
49632 --- a/include/asm-m68k/tlbflush.h
49633 +++ b/include/asm-m68k/tlbflush.h
49635 #define _M68K_TLBFLUSH_H
49638 -#ifndef CONFIG_SUN3
49639 +#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
49641 #include <asm/current.h>
49643 @@ -92,7 +92,12 @@ static inline void flush_tlb_kernel_rang
49648 +static inline void flush_tlb_pgtables(struct mm_struct *mm,
49649 + unsigned long start, unsigned long end)
49653 +#elif defined(CONFIG_SUN3)
49656 /* Reserved PMEGs. */
49657 @@ -214,6 +219,13 @@ static inline void flush_tlb_kernel_page
49658 sun3_put_segmap (addr & ~(SUN3_PMEG_SIZE - 1), SUN3_INVALID_PMEG);
49661 +static inline void flush_tlb_pgtables(struct mm_struct *mm,
49662 + unsigned long start, unsigned long end)
49666 +#else /* CONFIG_COLDFIRE */
49667 +#include <asm/cf_tlbflush.h>
49670 #endif /* _M68K_TLBFLUSH_H */
49671 --- a/include/asm-m68k/uaccess.h
49672 +++ b/include/asm-m68k/uaccess.h
49674 #ifndef __M68K_UACCESS_H
49675 #define __M68K_UACCESS_H
49677 +#ifdef CONFIG_COLDFIRE
49678 +#include <asm/cf_uaccess.h>
49681 * User space memory access functions
49683 @@ -367,4 +370,5 @@ unsigned long __clear_user(void __user *
49685 #define strlen_user(str) strnlen_user(str, 32767)
49687 +#endif /* CONFIG_COLDFIRE */
49688 #endif /* _M68K_UACCESS_H */
49689 --- a/include/asm-m68k/virtconvert.h
49690 +++ b/include/asm-m68k/virtconvert.h
49691 @@ -46,9 +46,14 @@ static inline void *phys_to_virt(unsigne
49692 #define virt_to_bus(a) (virt_to_phys(a) + (MACH_IS_HADES ? 0x80000000 : 0))
49693 #define bus_to_virt(a) (phys_to_virt((a) - (MACH_IS_HADES ? 0x80000000 : 0)))
49695 +#ifdef CONFIG_COLDFIRE
49696 +#define virt_to_bus(a) (a - PAGE_OFFSET + PCI_DMA_BASE)
49697 +#define bus_to_virt(a) (a - PCI_DMA_BASE + PAGE_OFFSET)
49698 +#else /* CONFIG_COLDFIRE */
49699 #define virt_to_bus virt_to_phys
49700 #define bus_to_virt phys_to_virt
49707 +++ b/include/linux/can/dev.h
49710 + * linux/can/dev.h
49712 + * Definitions for CAN controller network devices lib (work in progress)
49716 + * Author: Andrey Volkov <avolkov@varma-el.com>
49717 + * Copyright (c) 2006 Varma Electronics Oy
49721 +#ifndef CAN_DEVICE_H
49722 +#define CAN_DEVICE_H
49724 +#include <linux/version.h>
49725 +#include <linux/can/error.h>
49726 +#include <linux/can/ioctl.h>
49729 + struct can_device_stats can_stats;
49731 + /* can-bus oscillator frequency, in Hz,
49732 + BE CAREFUL! SOME CONTROLLERS (LIKE SJA1000)
49733 + FOOLISH ABOUT THIS FRQ (for sja1000 as ex. this
49734 + clock must be xtal clock divided by 2). */
49735 + u32 can_sys_clock;
49737 + /* by default max_brp is equal 64,
49738 + but for a Freescale TouCAN, as ex., it can be 255*/
49740 + /* For the mostly all controllers, max_sjw is equal 4, but
49741 + some, hmm, CAN implementations hardwared it to 1 */
49744 + u32 baudrate; /* in bauds */
49745 + struct can_bittime bit_time;
49747 + spinlock_t irq_lock;
49748 + /* Please hold this lock when touching net_stats/can_stats*/
49749 + spinlock_t stats_lock;
49751 + can_state_t state;
49753 + can_ctrlmode_t ctrlmode;
49755 + int (*do_set_bit_time)(struct net_device *dev, struct can_bittime *br);
49756 + int (*do_get_state) (struct net_device *dev, can_state_t *state);
49757 + int (*do_set_mode) (struct net_device *dev, can_mode_t mode);
49758 + int (*do_set_ctrlmode)(struct net_device *dev, can_ctrlmode_t ctrlmode);
49759 + int (*do_get_ctrlmode)(struct net_device *dev, can_ctrlmode_t *ctrlmode);
49762 +#define ND2D(_ndev) (_ndev->dev.parent)
49764 +struct net_device *alloc_candev(int sizeof_priv);
49765 +void free_candev(struct net_device *dev);
49767 +int can_calc_bit_time(struct can_priv *can, u32 baudrate,
49768 + struct can_bittime_std *bit_time);
49770 +#endif /* CAN_DEVICE_H */
49772 +++ b/include/linux/can/ioctl.h
49775 + * linux/can/ioctl.h
49777 + * Definitions for CAN controller setup (work in progress)
49781 + * Send feedback to <socketcan-users@lists.berlios.de>
49785 +#ifndef CAN_IOCTL_H
49786 +#define CAN_IOCTL_H
49788 +#include <linux/sockios.h>
49791 +/* max. 16 private ioctls */
49793 +#define SIOCSCANBAUDRATE (SIOCDEVPRIVATE+0)
49794 +#define SIOCGCANBAUDRATE (SIOCDEVPRIVATE+1)
49796 +#define SIOCSCANCUSTOMBITTIME (SIOCDEVPRIVATE+2)
49797 +#define SIOCGCANCUSTOMBITTIME (SIOCDEVPRIVATE+3)
49799 +#define SIOCSCANMODE (SIOCDEVPRIVATE+4)
49800 +#define SIOCGCANMODE (SIOCDEVPRIVATE+5)
49802 +#define SIOCSCANCTRLMODE (SIOCDEVPRIVATE+6)
49803 +#define SIOCGCANCTRLMODE (SIOCDEVPRIVATE+7)
49805 +#define SIOCSCANFILTER (SIOCDEVPRIVATE+8)
49806 +#define SIOCGCANFILTER (SIOCDEVPRIVATE+9)
49808 +#define SIOCGCANSTATE (SIOCDEVPRIVATE+10)
49809 +#define SIOCGCANSTATS (SIOCDEVPRIVATE+11)
49811 +#define SIOCSCANERRORCONFIG (SIOCDEVPRIVATE+12)
49812 +#define SIOCGCANERRORCONFIG (SIOCDEVPRIVATE+13)
49814 +/* parameters for ioctls */
49816 +/* SIOC[SG]CANBAUDRATE */
49817 +/* baudrate for CAN-controller in bits per second. */
49818 +/* 0 = Scan for baudrate (Autobaud) */
49820 +typedef __u32 can_baudrate_t;
49823 +/* SIOC[SG]CANCUSTOMBITTIME */
49825 +typedef enum CAN_BITTIME_TYPE {
49828 +} can_bittime_type_t;
49830 +/* TSEG1 of controllers usually is a sum of synch_seg (always 1),
49831 + * prop_seg and phase_seg1, TSEG2 = phase_seg2 */
49833 +struct can_bittime_std {
49834 + __u32 brp; /* baud rate prescaler */
49835 + __u8 prop_seg; /* from 1 to 8 */
49836 + __u8 phase_seg1; /* from 1 to 8 */
49837 + __u8 phase_seg2; /* from 1 to 8 */
49838 + __u8 sjw:7; /* from 1 to 4 */
49839 + __u8 sam:1; /* 1 - enable triple sampling */
49842 +struct can_bittime_btr {
49847 +struct can_bittime {
49848 + can_bittime_type_t type;
49850 + struct can_bittime_std std;
49851 + struct can_bittime_btr btr;
49855 +#define CAN_BAUDRATE_UNCONFIGURED ((__u32) 0xFFFFFFFFU)
49856 +#define CAN_BAUDRATE_UNKNOWN 0
49858 +/* SIOC[SG]CANMODE */
49860 +typedef __u32 can_mode_t;
49862 +#define CAN_MODE_STOP 0
49863 +#define CAN_MODE_START 1
49864 +#define CAN_MODE_SLEEP 2
49867 +/* SIOC[SG]CANCTRLMODE */
49869 +typedef __u32 can_ctrlmode_t;
49871 +#define CAN_CTRLMODE_LOOPBACK 0x1
49872 +#define CAN_CTRLMODE_LISTENONLY 0x2
49875 +/* SIOCGCANFILTER */
49877 +typedef __u32 can_filter_t;
49879 +/* filter modes (may vary due to controller specific capabilities) */
49880 +#define CAN_FILTER_CAPAB 0 /* get filter type capabilities
49881 + (32 Bit value) */
49882 +#define CAN_FILTER_MASK_VALUE 1 /* easy bit filter (see struct can_filter) */
49883 +#define CAN_FILTER_SFF_BITMASK 2 /* bitfield with 2048 bit SFF filter */
49884 + /* filters 3 - 31 currently undefined */
49886 +#define CAN_FILTER_MAX 31 /* max. filter type value */
49889 +/* SIOCGCANSTATE */
49891 +typedef __u32 can_state_t;
49893 +#define CAN_STATE_ACTIVE 0
49894 +#define CAN_STATE_BUS_WARNING 1
49895 +#define CAN_STATE_BUS_PASSIVE 2
49896 +#define CAN_STATE_BUS_OFF 3
49897 +#define CAN_STATE_SCANNING_BAUDRATE 4
49898 +#define CAN_STATE_STOPPED 5
49899 +#define CAN_STATE_SLEEPING 6
49902 +/* SIOCGCANSTATS */
49904 +struct can_device_stats {
49905 + int error_warning;
49906 + int data_overrun;
49909 + int error_passive;
49910 + int arbitration_lost;
49912 + int bus_error_at_init;
49915 +/* SIOC[SG]CANERRORCONFIG */
49917 +typedef enum CAN_ERRCFG_TYPE {
49919 + CAN_ERRCFG_BUSERR,
49920 + CAN_ERRCFG_BUSOFF
49921 +} can_errcfg_type_t;
49925 +#endif /* CAN_IOCTL_H */
49927 +++ b/include/linux/can/version.h
49930 + * linux/can/version.h
49932 + * Version information for the CAN network layer implementation
49934 + * Author: Urs Thuermann <urs.thuermann@volkswagen.de>
49935 + * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
49936 + * All rights reserved.
49938 + * Send feedback to <socketcan-users@lists.berlios.de>
49942 +#ifndef CAN_VERSION_H
49943 +#define CAN_VERSION_H
49945 +#define RCSID(s) asm(".section .rodata.str1.1,\"aMS\",@progbits,1\n\t" \
49946 + ".string \"" s "\"\n\t.previous\n")
49950 +#endif /* CAN_VERSION_H */
49951 --- a/include/linux/fb.h
49952 +++ b/include/linux/fb.h
49953 @@ -873,6 +873,17 @@ struct fb_info {
49954 #define fb_writeq sbus_writeq
49955 #define fb_memset sbus_memset_io
49957 +#elif defined(CONFIG_COLDFIRE)
49958 +#define fb_readb readb
49959 +#define fb_readw readw
49960 +#define fb_readl readl
49961 +#define fb_readq readq
49962 +#define fb_writeb writeb
49963 +#define fb_writew writew
49964 +#define fb_writel writel
49965 +#define fb_writeq writeq
49966 +#define fb_memset memset_io
49968 #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || (defined(__sh__) && !defined(__SH5__)) || defined(__powerpc__) || defined(__avr32__)
49970 #define fb_readb __raw_readb
49971 @@ -899,7 +910,7 @@ struct fb_info {
49975 -#if defined (__BIG_ENDIAN)
49976 +#if defined (__BIG_ENDIAN) && !defined(CONFIG_COLDFIRE)
49977 #define FB_LEFT_POS(bpp) (32 - bpp)
49978 #define FB_SHIFT_HIGH(val, bits) ((val) >> (bits))
49979 #define FB_SHIFT_LOW(val, bits) ((val) << (bits))
49980 --- a/include/linux/fsl_devices.h
49981 +++ b/include/linux/fsl_devices.h
49982 @@ -91,6 +91,19 @@ enum fsl_usb2_operating_modes {
49987 + * replace _operating_modes with _controller
49989 + * the operating_mode tests in fsl_platform_verify() aren't needed,
49990 + * since the ehci driver isn't going to be probe()d unless it's
49991 + * "fsl-ehci" device anyway, and what we really need to know is
49992 + * which controller (MPH/DR) we're dealing with
49994 +enum fsl_usb2_controller {
49999 enum fsl_usb2_phy_modes {
50002 @@ -101,9 +114,36 @@ enum fsl_usb2_phy_modes {
50004 struct fsl_usb2_platform_data {
50005 /* board specific information */
50006 - enum fsl_usb2_operating_modes operating_mode;
50008 + * DDD see note above
50009 + * enum fsl_usb2_operating_modes operating_mode;
50011 + enum fsl_usb2_controller controller;
50012 enum fsl_usb2_phy_modes phy_mode;
50013 unsigned int port_enables;
50015 + * DDD this could arguably be moved to a separate
50016 + * fsl usb2 device header file
50018 + char *name; /* pretty print */
50019 + int (*platform_init) (struct platform_device *);
50020 + void (*platform_uninit) (struct platform_device *);
50021 + int (*platform_verify) (struct platform_device *);
50022 + u32 xcvr_type; /* PORTSCX_PTS_* */
50023 + u32 view; /* ULPI viewport register */
50024 + u32 r_start; /* start of MEM resource */
50025 + u32 r_len; /* length of MEM resource */
50026 + void __iomem *regs; /* ioremap'd register base */
50027 + unsigned big_endian_mmio : 1;
50028 + unsigned big_endian_desc : 1;
50029 + unsigned es : 1; /* need USBMODE:ES */
50030 + unsigned have_sysif_regs : 1;
50031 + unsigned le_setup_buf : 1;
50032 + unsigned does_otg : 1; /* set IFF it's an OTG port */
50034 + unsigned power_budget; /* for hcd->power_budget */
50035 + struct fsl_xcvr_ops *xcvr_ops;
50036 + int max_ep_nr; /* max # of endpoints */
50039 /* Flags in fsl_usb2_mph_platform_data */
50040 @@ -126,5 +166,16 @@ struct mpc8xx_pcmcia_ops {
50041 int(*voltage_set)(int slot, int vcc, int vpp);
50044 +struct fsl_ata_platform_data {
50045 +#ifdef CONFIG_FSL_PATA_USE_DMA
50046 + int udma_mask; /* UDMA modes h/w can handle */
50047 + int fifo_alarm; /* value for fifo_alarm reg */
50048 + int max_sg; /* longest sglist h/w can handle */
50050 + int (*init)(struct platform_device *pdev);
50051 + void (*exit)(void);
50052 + int (*get_clk_rate)(void);
50055 #endif /* _FSL_DEVICE_H_ */
50056 #endif /* __KERNEL__ */
50057 --- a/include/linux/pci.h
50058 +++ b/include/linux/pci.h
50059 @@ -458,8 +458,10 @@ int __must_check pcibios_enable_device(s
50060 char *pcibios_setup(char *str);
50062 /* Used only when drivers/pci/setup.c is used */
50063 +#ifndef CONFIG_COLDFIRE
50064 void pcibios_align_resource(void *, struct resource *, resource_size_t,
50067 void pcibios_update_irq(struct pci_dev *, int irq);
50069 /* Generic PCI functions used internally */
50071 +++ b/include/linux/spi/mcfqspi.h
50073 +/****************************************************************************/
50076 + * mcfqspi.c - Master QSPI controller for the ColdFire processors
50078 + * (C) Copyright 2005, Intec Automation,
50079 + * Mike Lavender (mike@steroidmicros)
50082 + This program is free software; you can redistribute it and/or modify
50083 + it under the terms of the GNU General Public License as published by
50084 + the Free Software Foundation; either version 2 of the License, or
50085 + (at your option) any later version.
50087 + This program is distributed in the hope that it will be useful,
50088 + but WITHOUT ANY WARRANTY; without even the implied warranty of
50089 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50090 + GNU General Public License for more details.
50092 + You should have received a copy of the GNU General Public License
50093 + along with this program; if not, write to the Free Software
50094 + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
50095 +/* ------------------------------------------------------------------------- */
50097 +#ifndef MCFQSPI_H_
50098 +#define MCFQSPI_H_
50100 +#define QSPI_CS_INIT 0x01
50101 +#define QSPI_CS_ASSERT 0x02
50102 +#define QSPI_CS_DROP 0x04
50104 +#define QSPIIOCS_DOUT_HIZ 1 /* QMR[DOHIE] set hi-z dout between transfers */
50105 +#define QSPIIOCS_BITS 2 /* QMR[BITS] set transfer size */
50106 +#define QSPIIOCG_BITS 3 /* QMR[BITS] get transfer size */
50107 +#define QSPIIOCS_CPOL 4 /* QMR[CPOL] set SCK inactive state */
50108 +#define QSPIIOCS_CPHA 5 /* QMR[CPHA] set SCK phase, 1=rising edge */
50109 +#define QSPIIOCS_BAUD 6 /* QMR[BAUD] set SCK baud rate divider */
50110 +#define QSPIIOCS_QCD 7 /* QDLYR[QCD] set start delay */
50111 +#define QSPIIOCS_DTL 8 /* QDLYR[DTL] set after delay */
50112 +#define QSPIIOCS_CONT 9 /* continuous CS asserted during transfer */
50113 +#define QSPIIOCS_READDATA 10 /* set data send during read */
50114 +#define QSPIIOCS_ODD_MOD 11 /* if length of buffer is a odd number, 16-bit transfers */
50115 + /* are finalized with a 8-bit transfer */
50116 +#define QSPIIOCS_DSP_MOD 12 /* transfers are bounded to 15/30 bytes (a multiple of 3 bytes = 1 DSPword) */
50117 +#define QSPIIOCS_POLL_MOD 13 /* driver uses polling instead of interrupts */
50119 +#define QSPIIOCS_SET_CSIV 14 /* sets CSIV flag (cs inactive level) */
50121 +#ifdef CONFIG_M520x
50122 +#undef MCF_GPIO_PAR_QSPI
50123 +#define MCF_GPIO_PAR_QSPI (0xA4034)
50126 +struct coldfire_spi_master {
50128 + u16 num_chipselect;
50135 + void (*cs_control)(u8 cs, u8 command);
50139 +struct coldfire_spi_chip {
50141 + u8 bits_per_word;
50142 + u8 del_cs_to_clk;
50143 + u8 del_after_trans;
50144 + u16 void_write_data;
50147 +typedef struct qspi_read_data {
50149 + __u8 *buf; /* data to send during read */
50150 + unsigned int loop : 1;
50152 +#endif /*MCFQSPI_H_*/
50154 +++ b/include/linux/usb/fsl_usb2.h
50157 + * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
50161 + * The code contained herein is licensed under the GNU General Public
50162 + * License. You may obtain a copy of the GNU General Public License
50163 + * Version 2 or later at the following locations:
50165 + * http://www.opensource.org/licenses/gpl-license.html
50166 + * http://www.gnu.org/copyleft/gpl.html
50170 + * Freescale USB device/endpoint management registers
50172 +#ifndef __FSL_USB2_H
50173 +#define __FSL_USB2_H
50176 + /* USB DR device mode registers (Little Endian) */
50177 +struct fsl_usb_device_regs {
50178 + /* Capability register */
50181 + u16 caplength; /* Capability Register Length */
50182 + u16 hciversion; /* Host Controller Interface Version */
50183 + u32 hcsparams; /* Host Controller Structual Parameters */
50184 + u32 hccparams; /* Host Controller Capability Parameters */
50186 + u32 dciversion; /* Device Controller Interface Version */
50187 + u32 dccparams; /* Device Controller Capability Parameters */
50189 + /* Operation register */
50190 + u32 usbcmd; /* USB Command Register */
50191 + u32 usbsts; /* USB Status Register */
50192 + u32 usbintr; /* USB Interrupt Enable Register */
50193 + u32 frindex; /* Frame Index Register */
50195 + u32 deviceaddr; /* Device Address */
50196 + u32 endpointlistaddr; /* Endpoint List Address Register */
50198 + u32 burstsize; /* Master Interface Data Burst Size Register */
50199 + u32 txttfilltuning; /* Transmit FIFO Tuning Controls Register */
50203 + u32 configflag; /* Configure Flag Register */
50204 + u32 portsc1; /* Port 1 Status and Control Register */
50206 + u32 otgsc; /* On-The-Go Status and Control */
50207 + u32 usbmode; /* USB Mode Register */
50208 + u32 endptsetupstat; /* Endpoint Setup Status Register */
50209 + u32 endpointprime; /* Endpoint Initialization Register */
50210 + u32 endptflush; /* Endpoint Flush Register */
50211 + u32 endptstatus; /* Endpoint Status Register */
50212 + u32 endptcomplete; /* Endpoint Complete Register */
50214 + u32 endptctrl[USB_MAX_ENDPOINTS]; /* Endpoint Control Registers */
50216 + // DDD see DCCPARAMS:DEN for the real number of device endpoints
50217 + // DDD 16 is the max
50218 + u32 endptctrl[16]; /* Endpoint Control Registers */
50222 + /* USB DR host mode registers (Little Endian) */
50223 +struct fsl_usb_host_regs {
50224 + /* Capability register */
50227 + u16 caplength; /* Capability Register Length */
50228 + u16 hciversion; /* Host Controller Interface Version */
50229 + u32 hcsparams; /* Host Controller Structual Parameters */
50230 + u32 hccparams; /* Host Controller Capability Parameters */
50232 + u32 dciversion; /* Device Controller Interface Version */
50233 + u32 dccparams; /* Device Controller Capability Parameters */
50235 + /* Operation register */
50236 + u32 usbcmd; /* USB Command Register */
50237 + u32 usbsts; /* USB Status Register */
50238 + u32 usbintr; /* USB Interrupt Enable Register */
50239 + u32 frindex; /* Frame Index Register */
50241 + u32 periodiclistbase; /* Periodic Frame List Base Address Register */
50242 + u32 asynclistaddr; /* Current Asynchronous List Address Register */
50244 + u32 burstsize; /* Master Interface Data Burst Size Register */
50245 + u32 txttfilltuning; /* Transmit FIFO Tuning Controls Register */
50249 + u32 configflag; /* Configure Flag Register */
50250 + u32 portsc1; /* Port 1 Status and Control Register */
50252 + u32 otgsc; /* On-The-Go Status and Control */
50253 + u32 usbmode; /* USB Mode Register */
50254 + u32 endptsetupstat; /* Endpoint Setup Status Register */
50255 + u32 endpointprime; /* Endpoint Initialization Register */
50256 + u32 endptflush; /* Endpoint Flush Register */
50257 + u32 endptstatus; /* Endpoint Status Register */
50258 + u32 endptcomplete; /* Endpoint Complete Register */
50260 + u32 endptctrl[USB_MAX_ENDPOINTS]; /* Endpoint Control Registers */
50262 + /* DDD see DCCPARAMS:DEN for the real number of device endpoints */
50263 + /* DDD 16 is the max */
50264 + u32 endptctrl[16]; /* Endpoint Control Registers */
50268 + /* non-EHCI USB system interface registers (Big Endian) */
50269 +struct usb_sys_interface {
50272 + u32 age_cnt_thresh; /* Age Count Threshold Register */
50273 + u32 pri_ctrl; /* Priority Control Register */
50274 + u32 si_ctrl; /* System Interface Control Register */
50276 + u32 control; /* General Purpose Control Register */
50279 +/* ep0 transfer state */
50280 +#define WAIT_FOR_SETUP 0
50281 +#define DATA_STATE_XMIT 1
50282 +#define DATA_STATE_NEED_ZLP 2
50283 +#define WAIT_FOR_OUT_STATUS 3
50284 +#define DATA_STATE_RECV 4
50286 +/* Frame Index Register Bit Masks */
50287 +#define USB_FRINDEX_MASKS 0x3fff
50291 +/* USBCMD Register Bit Masks */
50292 +#define USB_CMD_RUN_STOP 0x00000001
50293 +#define USB_CMD_CTRL_RESET 0x00000002
50294 +#define USB_CMD_PERIODIC_SCHEDULE_EN 0x00000010
50295 +#define USB_CMD_ASYNC_SCHEDULE_EN 0x00000020
50296 +#define USB_CMD_INT_AA_DOORBELL 0x00000040
50297 +#define USB_CMD_ASP 0x00000300
50298 +#define USB_CMD_ASYNC_SCH_PARK_EN 0x00000800
50299 +#define USB_CMD_SUTW 0x00002000
50300 +#define USB_CMD_ATDTW 0x00004000
50301 +#define USB_CMD_ITC 0x00FF0000
50303 +/* bit 15,3,2 are frame list size */
50304 +#define USB_CMD_FRAME_SIZE_1024 0x00000000
50305 +#define USB_CMD_FRAME_SIZE_512 0x00000004
50306 +#define USB_CMD_FRAME_SIZE_256 0x00000008
50307 +#define USB_CMD_FRAME_SIZE_128 0x0000000C
50308 +#define USB_CMD_FRAME_SIZE_64 0x00008000
50309 +#define USB_CMD_FRAME_SIZE_32 0x00008004
50310 +#define USB_CMD_FRAME_SIZE_16 0x00008008
50311 +#define USB_CMD_FRAME_SIZE_8 0x0000800C
50313 +/* bit 9-8 are async schedule park mode count */
50314 +#define USB_CMD_ASP_00 0x00000000
50315 +#define USB_CMD_ASP_01 0x00000100
50316 +#define USB_CMD_ASP_10 0x00000200
50317 +#define USB_CMD_ASP_11 0x00000300
50318 +#define USB_CMD_ASP_BIT_POS 8
50320 +/* bit 23-16 are interrupt threshold control */
50321 +#define USB_CMD_ITC_NO_THRESHOLD 0x00000000
50322 +#define USB_CMD_ITC_1_MICRO_FRM 0x00010000
50323 +#define USB_CMD_ITC_2_MICRO_FRM 0x00020000
50324 +#define USB_CMD_ITC_4_MICRO_FRM 0x00040000
50325 +#define USB_CMD_ITC_8_MICRO_FRM 0x00080000
50326 +#define USB_CMD_ITC_16_MICRO_FRM 0x00100000
50327 +#define USB_CMD_ITC_32_MICRO_FRM 0x00200000
50328 +#define USB_CMD_ITC_64_MICRO_FRM 0x00400000
50329 +#define USB_CMD_ITC_BIT_POS 16
50334 +/* USB STS Register Bit Masks */
50335 +#define USB_STS_INT 0x00000001
50336 +#define USB_STS_ERR 0x00000002
50337 +#define USB_STS_PORT_CHANGE 0x00000004
50338 +#define USB_STS_FRM_LST_ROLL 0x00000008
50339 +#define USB_STS_SYS_ERR 0x00000010
50340 +#define USB_STS_IAA 0x00000020
50341 +#define USB_STS_RESET 0x00000040
50342 +#define USB_STS_SOF 0x00000080
50343 +#define USB_STS_SUSPEND 0x00000100
50344 +#define USB_STS_HC_HALTED 0x00001000
50345 +#define USB_STS_RCL 0x00002000
50346 +#define USB_STS_PERIODIC_SCHEDULE 0x00004000
50347 +#define USB_STS_ASYNC_SCHEDULE 0x00008000
50349 +/* USB INTR Register Bit Masks */
50350 +#define USB_INTR_INT_EN 0x00000001
50351 +#define USB_INTR_ERR_INT_EN 0x00000002
50352 +#define USB_INTR_PTC_DETECT_EN 0x00000004
50353 +#define USB_INTR_FRM_LST_ROLL_EN 0x00000008
50354 +#define USB_INTR_SYS_ERR_EN 0x00000010
50355 +#define USB_INTR_ASYN_ADV_EN 0x00000020
50356 +#define USB_INTR_RESET_EN 0x00000040
50357 +#define USB_INTR_SOF_EN 0x00000080
50358 +#define USB_INTR_DEVICE_SUSPEND 0x00000100
50360 +/* Device Address bit masks */
50361 +#define USB_DEVICE_ADDRESS_MASK 0xFE000000
50362 +#define USB_DEVICE_ADDRESS_BIT_POS 25
50364 +/* endpoint list address bit masks */
50365 +#define USB_EP_LIST_ADDRESS_MASK 0xfffff800
50369 +/* bit 31-30 are port transceiver select */
50370 +#define PORTSCX_PTS_MASK (3 << 30) /* parallel xcvr select mask */
50371 +#define PORTSCX_PHY_TYPE_SEL PORTSCX_PTS_MASK
50372 +#define PORTSCX_PTS_UTMI (0 << 30) /* UTMI/UTMI+ */
50373 +#define PORTSCX_PTS_PHILIPS (1 << 30) /* Philips classic */
50374 +#define PORTSCX_PTS_ULPI (2 << 30) /* ULPI */
50375 +#define PORTSCX_PTS_SERIAL (3 << 30) /* serial */
50376 +#define PORTSCX_PTS_FSLS PORTSCX_PTS_SERIAL
50377 +#define PORTSCX_PTS_ONCHIP PORTSCX_PTS_FSLS
50379 +#define PORTSCX_STS (1 << 29) /* serial xcvr select */
50381 +/* bit 28 is parallel transceiver width for UTMI interface */
50382 +#define PORTSCX_PTW_8BIT (0 << 28) /* 8 bit parallel xcvr */
50383 +#define PORTSCX_PTW_16BIT (1 << 28) /* 16 bi parallel xcvr */
50385 +/* bit 27-26 are port speed */
50386 +#define PORTSCX_PORT_SPEED_FULL (0 << 26)
50387 +#define PORTSCX_PORT_SPEED_LOW (1 << 26)
50388 +#define PORTSCX_PORT_SPEED_HIGH (2 << 26)
50389 +#define PORTSCX_PORT_SPEED_UNDEF (3 << 26)
50390 +#define PORTSCX_PORT_SPEED_MASK (3 << 26)
50392 +#define PORTSCX_PHY_LOW_POWER_SPD (1 << 23) /* phy low pwr suspend/clk disable */
50394 +/* bit 19-16 are port test control */
50395 +#define PORTSCX_PTC_DISABLE (0 << 16)
50396 +#define PORTSCX_PTC_JSTATE (1 << 16)
50397 +#define PORTSCX_PTC_KSTATE (2 << 16)
50398 +#define PORTSCX_PTC_SEQNAK (3 << 16) /* SE0 (host) / NAK (device) */
50399 +#define PORTSCX_PTC_PACKET (4 << 16)
50400 +#define PORTSCX_PTC_FORCE_EN_HS (5 << 16)
50401 +#define PORTSCX_PTC_FORCE_EN_FS (6 << 16)
50402 +#define PORTSCX_PTC_FORCE_EN_LS (7 << 16)
50405 +/* bit 15-14 are port indicator control */
50406 +#define PORTSCX_PIC_OFF (0 << 14)
50407 +#define PORTSCX_PIC_AMBER (1 << 14)
50408 +#define PORTSCX_PIC_GREEN (2 << 14)
50409 +#define PORTSCX_PIC_UNDEF (3 << 14)
50411 +#define PORTSCX_PORT_POWER (1 << 12) /* port power */
50413 +/* bit 11-10 are line status */
50414 +#define PORTSCX_LS_MASK (3 << 10) /* Line State mask */
50415 +#define PORTSCX_LS_SE0 (0 << 10) /* SE0 */
50416 +#define PORTSCX_LS_K_STATE (1 << 10) /* K-state */
50417 +#define PORTSCX_LS_J_STATE (2 << 10) /* J-state */
50419 +#define PORTSCX_PORT_RESET (1 << 8) /* Port reset */
50420 +#define PORTSCX_PORT_SUSPEND (1 << 7) /* Suspend */
50421 +#define PORTSCX_PORT_FORCE_RESUME (1 << 6) /* Force port resume */
50422 +#define PORTSCX_OVER_CURRENT_CHG (1 << 5) /* over current change */
50423 +#define PORTSCX_OVER_CURRENT_ACT (1 << 4) /* over currrent active */
50424 +#define PORTSCX_PORT_EN_DIS_CHANGE (1 << 3) /* port {en,dis}able change */
50425 +#define PORTSCX_PORT_ENABLE (1 << 2) /* port enabled */
50426 +#define PORTSCX_CONNECT_STATUS_CHANGE (1 << 1) /* connect status change */
50427 +#define PORTSCX_CURRENT_CONNECT_STATUS (1 << 0) /* current connect status */
50429 +#define PORTSCX_W1C_BITS \
50430 + ( PORTSCX_CONNECT_STATUS_CHANGE | \
50431 + PORTSCX_PORT_EN_DIS_CHANGE | \
50432 + PORTSCX_OVER_CURRENT_CHG )
50436 +/* UOG_OTGSC Register Bits */
50437 +/* control bits: */
50438 +#define OTGSC_CTRL_VBUS_DISCHARGE (1 << 0)
50439 +#define OTGSC_CTRL_VBUS_CHARGE (1 << 1)
50440 +#define OTGSC_CTRL_OTG_TERM (1 << 3) /* controls DM pulldown */
50441 +#define OTGSC_CTRL_DATA_PULSING (1 << 4)
50442 +#define OTGSC_CTRL_USB_ID_PU (1 << 5) /* enable ID pullup */
50443 +/* current status: (R/O) */
50444 +#define OTGSC_STS_USB_ID (1 << 8) /* 0=A-device 1=B-device */
50445 +#define OTGSC_STS_A_VBUS_VALID (1 << 9)
50446 +#define OTGSC_STS_A_SESSION_VALID (1 << 10)
50447 +#define OTGSC_STS_B_SESSION_VALID (1 << 11)
50448 +#define OTGSC_STS_B_SESSION_END (1 << 12)
50449 +#define OTGSC_STS_1ms_TIMER (1 << 13)
50450 +#define OTGSC_STS_DATA_PULSE (1 << 14)
50451 +/* interrupt status: (write to clear) */
50452 +#define OTGSC_INTSTS_MASK (0x7f << 16)
50453 +#define OTGSC_INTSTS_USB_ID (1 << 16)
50454 +#define OTGSC_INTSTS_A_VBUS_VALID (1 << 17)
50455 +#define OTGSC_INTSTS_A_SESSION_VALID (1 << 18)
50456 +#define OTGSC_INTSTS_B_SESSION_VALID (1 << 19)
50457 +#define OTGSC_INTSTS_B_SESSION_END (1 << 20)
50458 +#define OTGSC_INTSTS_1MS_TIMER (1 << 21)
50459 +#define OTGSC_INTSTS_DATA_PULSE (1 << 22)
50460 +/* interrupt enables: */
50461 +#define OTGSC_IE_MASK (0x7f << 24)
50462 +#define OTGSC_IE_USB_ID (1 << 24)
50463 +#define OTGSC_IE_A_VBUS_VALID (1 << 25)
50464 +#define OTGSC_IE_A_SESSION_VALID (1 << 26)
50465 +#define OTGSC_IE_B_SESSION_VALID (1 << 27)
50466 +#define OTGSC_IE_B_SESSION_END (1 << 28)
50467 +#define OTGSC_IE_1ms_TIMER (1 << 29)
50468 +#define OTGSC_IE_DATA_PULSE (1 << 30)
50470 +#if 1 /* DDD FIXME these here for compatibility between my names and Leo's */
50471 +/* OTG interrupt enable bit masks */
50472 +#define OTGSC_INTERRUPT_ENABLE_BITS_MASK OTGSC_IE_MASK
50474 +/* OTG interrupt status bit masks */
50475 +#define OTGSC_INTERRUPT_STATUS_BITS_MASK OTGSC_INTSTS_MASK
50481 +#undef USBMODE_SDIS /* defined as bit 3 in drivers/usb/host/ehci.h */
50482 +#define USBMODE_SDIS (1 << 4) /* stream disable mode */
50483 +#define USBMODE_SLOM (1 << 3) /* setup lockout mode */
50484 +#define USBMODE_ES (1 << 2) /* (big) endian select */
50485 +#define USBMODE_CM_MASK (3 << 0) /* controller mode mask */
50486 +#define USBMODE_CM_HOST (3 << 0) /* host */
50487 +#define USBMODE_CM_DEVICE (2 << 0) /* device */
50488 +// DDD #define USBMODE_CM_IDLE (0 << 0) /* idle */
50490 +/* DDD for compatibility for now */
50491 +#define USB_MODE_CTRL_MODE_IDLE USBMODE_CM_IDLE
50492 +#define USB_MODE_CTRL_MODE_DEVICE USBMODE_CM_DEVICE
50493 +#define USB_MODE_CTRL_MODE_HOST USBMODE_CM_HOST
50494 +#define USB_MODE_SETUP_LOCK_OFF USBMODE_SLOM
50495 +#define USB_MODE_STREAM_DISABLE USBMODE_SDIS
50498 +/* ULPIVIEW register bits */
50499 +#define ULPIVW_WU (1 << 31) /* Wakeup */
50500 +#define ULPIVW_RUN (1 << 30) /* read/write run */
50501 +#define ULPIVW_WRITE (1 << 29) /* 0=read 1=write */
50502 +#define ULPIVW_SS (1 << 27) /* SyncState */
50503 +#define ULPIVW_PORT_MASK 0x07 /* Port field */
50504 +#define ULPIVW_PORT_SHIFT 24
50505 +#define ULPIVW_ADDR_MASK 0xFF /* data address field */
50506 +#define ULPIVW_ADDR_SHIFT 16
50507 +#define ULPIVW_RDATA_MASK 0xFF /* read data field */
50508 +#define ULPIVW_RDATA_SHIFT 8
50509 +#define ULPIVW_WDATA_MASK 0xFF /* write data field */
50510 +#define ULPIVW_WDATA_SHIFT 0
50513 +/* Endpoint Flush Register */
50514 +#define EPFLUSH_TX_OFFSET 0x00010000
50515 +#define EPFLUSH_RX_OFFSET 0x00000000
50517 +/* Endpoint Setup Status bit masks */
50518 +#define EP_SETUP_STATUS_MASK 0x0000003F
50519 +#define EP_SETUP_STATUS_EP0 0x00000001
50521 +/* ENDPOINTCTRLx Register Bit Masks */
50522 +#define EPCTRL_TX_ENABLE 0x00800000
50523 +#define EPCTRL_TX_DATA_TOGGLE_RST 0x00400000 /* Not EP0 */
50524 +#define EPCTRL_TX_DATA_TOGGLE_INH 0x00200000 /* Not EP0 */
50525 +#define EPCTRL_TX_TYPE 0x000C0000
50526 +#define EPCTRL_TX_DATA_SOURCE 0x00020000 /* Not EP0 */
50527 +#define EPCTRL_TX_EP_STALL 0x00010000
50528 +#define EPCTRL_RX_ENABLE 0x00000080
50529 +#define EPCTRL_RX_DATA_TOGGLE_RST 0x00000040 /* Not EP0 */
50530 +#define EPCTRL_RX_DATA_TOGGLE_INH 0x00000020 /* Not EP0 */
50531 +#define EPCTRL_RX_TYPE 0x0000000C
50532 +#define EPCTRL_RX_DATA_SINK 0x00000002 /* Not EP0 */
50533 +#define EPCTRL_RX_EP_STALL 0x00000001
50535 +/* bit 19-18 and 3-2 are endpoint type */
50536 +#define EPCTRL_EP_TYPE_CONTROL 0
50537 +#define EPCTRL_EP_TYPE_ISO 1
50538 +#define EPCTRL_EP_TYPE_BULK 2
50539 +#define EPCTRL_EP_TYPE_INTERRUPT 3
50540 +#define EPCTRL_TX_EP_TYPE_SHIFT 18
50541 +#define EPCTRL_RX_EP_TYPE_SHIFT 2
50543 +/* SNOOPn Register Bit Masks */
50544 +#define SNOOP_ADDRESS_MASK 0xFFFFF000
50545 +#define SNOOP_SIZE_ZERO 0x00 /* snooping disable */
50546 +#define SNOOP_SIZE_4KB 0x0B /* 4KB snoop size */
50547 +#define SNOOP_SIZE_8KB 0x0C
50548 +#define SNOOP_SIZE_16KB 0x0D
50549 +#define SNOOP_SIZE_32KB 0x0E
50550 +#define SNOOP_SIZE_64KB 0x0F
50551 +#define SNOOP_SIZE_128KB 0x10
50552 +#define SNOOP_SIZE_256KB 0x11
50553 +#define SNOOP_SIZE_512KB 0x12
50554 +#define SNOOP_SIZE_1MB 0x13
50555 +#define SNOOP_SIZE_2MB 0x14
50556 +#define SNOOP_SIZE_4MB 0x15
50557 +#define SNOOP_SIZE_8MB 0x16
50558 +#define SNOOP_SIZE_16MB 0x17
50559 +#define SNOOP_SIZE_32MB 0x18
50560 +#define SNOOP_SIZE_64MB 0x19
50561 +#define SNOOP_SIZE_128MB 0x1A
50562 +#define SNOOP_SIZE_256MB 0x1B
50563 +#define SNOOP_SIZE_512MB 0x1C
50564 +#define SNOOP_SIZE_1GB 0x1D
50565 +#define SNOOP_SIZE_2GB 0x1E /* 2GB snoop size */
50567 +/* pri_ctrl Register Bit Masks */
50568 +#define PRI_CTRL_PRI_LVL1 0x0000000C
50569 +#define PRI_CTRL_PRI_LVL0 0x00000003
50571 +/* si_ctrl Register Bit Masks */
50572 +#define SI_CTRL_ERR_DISABLE 0x00000010
50573 +#define SI_CTRL_IDRC_DISABLE 0x00000008
50574 +#define SI_CTRL_RD_SAFE_EN 0x00000004
50575 +#define SI_CTRL_RD_PREFETCH_DISABLE 0x00000002
50576 +#define SI_CTRL_RD_PREFEFETCH_VAL 0x00000001
50579 +/* control Register Bit Masks */
50580 +#define USB_CTRL_IOENB 0x00000004
50581 +#define USB_CTRL_ULPI_INT0EN 0x00000001
50584 +/* Endpoint Transfer Descriptor bit Masks */
50585 +#define DTD_NEXT_TERMINATE 0x00000001
50586 +#define DTD_IOC 0x00008000
50587 +#define DTD_STATUS_ACTIVE 0x00000080
50588 +#define DTD_STATUS_HALTED 0x00000040
50589 +#define DTD_STATUS_DATA_BUFF_ERR 0x00000020
50590 +#define DTD_STATUS_TRANSACTION_ERR 0x00000008
50591 +#define DTD_RESERVED_FIELDS 0x80007300
50592 +#define DTD_ADDR_MASK 0xFFFFFFE0
50593 +#define DTD_PACKET_SIZE 0x7FFF0000
50594 +#define DTD_LENGTH_BIT_POS 16
50595 +#define DTD_ERROR_MASK (DTD_STATUS_HALTED | \
50596 + DTD_STATUS_DATA_BUFF_ERR | \
50597 + DTD_STATUS_TRANSACTION_ERR)
50598 +/* Alignment requirements; must be a power of two */
50599 +#define DTD_ALIGNMENT 0x20
50600 +#define QH_ALIGNMENT 2048
50602 +/* Controller dma boundary */
50603 +#define UDC_DMA_BOUNDARY 0x1000
50605 +#if defined CONFIG_PPC32
50606 +#define fsl_readl(addr) in_le32((addr))
50607 +#define fsl_writel(addr, val32) out_le32((addr), (val32))
50608 +#elif defined CONFIG_COLDFIRE
50609 +#define fsl_readl(addr) in_be32((__force unsigned *)(addr))
50610 +#define fsl_writel(val32, addr) out_be32((__force unsigned *)(addr), (val32))
50612 +#define fsl_readw(addr) in_be16((__force unsigned *)(addr))
50613 +#define fsl_writew(val16, addr) out_be16((__force unsigned *)(addr), (val16))
50615 +#error fsl_{readl, writel} must be defined
50618 +#endif /* __FSL_USB2_H */
50620 +++ b/include/linux/usb/fsl_xcvr.h
50623 + * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
50627 + * The code contained herein is licensed under the GNU General Public
50628 + * License. You may obtain a copy of the GNU General Public License
50629 + * Version 2 or later at the following locations:
50631 + * http://www.opensource.org/licenses/gpl-license.html
50632 + * http://www.gnu.org/copyleft/gpl.html
50635 +enum fsl_usb_ctrlr {
50636 + USB_CTRLR_H1 = 0,
50637 + USB_CTRLR_H2 = 1,
50638 + USB_CTRLR_OTG = 2,
50643 + * struct fsl_xcvr_ops - USB transceiver operations
50645 + * @xcvr_type: one of PORTSCX_PTS_{UTMI,SERIAL,ULPI}
50646 + * @init: transceiver- and board-specific initialization function
50647 + * @uninit: transceiver- and board-specific uninitialization function
50652 +struct fsl_xcvr_ops {
50653 + enum fsl_usb_ctrlr ctrlr; /* H1, H2, OTG */
50656 + void (*init)(struct platform_device *pdev);
50657 + void (*uninit)(struct platform_device *pdev);
50658 + void (*set_host)(void); /* DDD combine set_host and _device ? */
50659 + void (*set_device)(void);
50660 + void (*set_vbus_power)(struct fsl_usb2_platform_data *pdata, int on);
50665 +++ b/net/can/dev.c
50670 + * Copyright (C) 2005 Marc Kleine-Budde, Pengutronix
50671 + * Copyright (C) 2006 Andrey Volkov, Varma Electronics
50673 + * This program is free software; you can redistribute it and/or modify
50674 + * it under the terms of the version 2 of the GNU General Public License
50675 + * as published by the Free Software Foundation
50677 + * This program is distributed in the hope that it will be useful,
50678 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
50679 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50680 + * GNU General Public License for more details.
50682 + * You should have received a copy of the GNU General Public License
50683 + * along with this program; if not, write to the Free Software
50684 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
50687 +#include <linux/module.h>
50688 +#include <linux/netdevice.h>
50689 +#include <linux/if_arp.h>
50690 +#include <linux/can.h>
50691 +#include <linux/can/dev.h>
50693 +MODULE_DESCRIPTION("CAN netdevice library");
50694 +MODULE_LICENSE("GPL v2");
50695 +MODULE_AUTHOR("Marc Kleine-Budde <mkl@pengutronix.de>, "
50696 + "Andrey Volkov <avolkov@varma-el.com>");
50700 + Baud rate calculated with next formula:
50701 + baud = frq/(brp*(1 + prop_seg+ phase_seg1 + phase_seg2))
50703 + This calc function based on work of Florian Hartwich and Armin Bassemi
50704 + "The Configuration of the CAN Bit Timing"
50705 + (http://www.semiconductors.bosch.de/pdf/CiA99Paper.pdf)
50709 + bit_time_nsec - expected bit time in nanosecs
50712 + bit_time - calculated time segments, for meaning of
50713 + each field read CAN standard.
50716 +#define DEFAULT_MAX_BRP 64U
50717 +#define DEFAULT_MAX_SJW 4U
50719 +/* All below values in tq units */
50720 +#define MAX_BIT_TIME 25U
50721 +#define MIN_BIT_TIME 8U
50722 +#define MAX_PROP_SEG 8U
50723 +#define MAX_PHASE_SEG1 8U
50724 +#define MAX_PHASE_SEG2 8U
50726 +int can_calc_bit_time(struct can_priv *can, u32 baudrate,
50727 + struct can_bittime_std *bit_time)
50729 + int best_error = -1; /* Ariphmetic error */
50730 + int df, best_df = -1; /* oscillator's tolerance range */
50731 + u32 quanta; /*in tq units*/
50732 + u32 brp, phase_seg1, phase_seg2, sjw, prop_seg;
50733 + u32 brp_min, brp_max, brp_expected;
50736 + /* baudrate range [1baud,1Mbaud] */
50737 + if (baudrate == 0 || baudrate > 1000000UL)
50740 + tmp = (u64)can->can_sys_clock*1000;
50741 + do_div(tmp, baudrate);
50742 + brp_expected = (u32)tmp;
50744 + brp_min = brp_expected / (1000 * MAX_BIT_TIME);
50745 + if (brp_min == 0)
50747 + if (brp_min > can->max_brp)
50750 + brp_max = (brp_expected + 500 * MIN_BIT_TIME) / (1000 * MIN_BIT_TIME);
50751 + if (brp_max == 0)
50753 + if (brp_max > can->max_brp)
50754 + brp_max = can->max_brp;
50756 + for (brp = brp_min; brp <= brp_max; brp++) {
50757 + quanta = brp_expected / (brp * 1000);
50758 + if (quanta < MAX_BIT_TIME && quanta * brp * 1000 !=
50761 + if (quanta < MIN_BIT_TIME || quanta > MAX_BIT_TIME)
50764 + phase_seg2 = min((quanta - 3) / 2, MAX_PHASE_SEG2);
50765 + for (sjw = can->max_sjw; sjw > 0; sjw--) {
50766 + for (; phase_seg2 > sjw; phase_seg2--) {
50768 + phase_seg1 = phase_seg2 % 2 ?
50769 + phase_seg2-1 : phase_seg2;
50770 + prop_seg = quanta-1 - phase_seg2 - phase_seg1;
50772 + * FIXME: support of longer lines
50773 + * (i.e. bigger prop_seg) is more prefered
50774 + * than support of cheap oscillators
50775 + * (i.e. bigger df/phase_seg1/phase_seg2)
50778 + if (prop_seg < phase_seg1)
50780 + if (prop_seg > MAX_PROP_SEG)
50783 + err1 = phase_seg1 * brp * 500 * 1000 /
50784 + (13 * brp_expected - phase_seg2 *
50786 + err2 = sjw * brp * 50 * 1000 / brp_expected;
50788 + df = min(err1, err2);
50789 + if (df >= best_df) {
50790 + unsigned error = abs(brp_expected * 10 /
50791 + (brp * (1 + prop_seg +
50793 + phase_seg2)) - 10000);
50795 + if (error > 10 || error > best_error)
50798 + if (error == best_error && prop_seg <
50799 + bit_time->prop_seg)
50802 + best_error = error;
50804 + bit_time->brp = brp;
50805 + bit_time->prop_seg = prop_seg;
50806 + bit_time->phase_seg1 = phase_seg1;
50807 + bit_time->phase_seg2 = phase_seg2;
50808 + bit_time->sjw = sjw;
50810 + (bit_time->phase_seg1 > 3);
50817 + if (best_error < 0)
50821 +EXPORT_SYMBOL(can_calc_bit_time);
50823 +static int can_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
50825 + struct can_priv *can = netdev_priv(dev);
50826 + struct can_bittime *bt = (struct can_bittime *)&ifr->ifr_ifru;
50827 + ulong *baudrate = (ulong *)&ifr->ifr_ifru;
50828 + int ret = -EOPNOTSUPP;
50830 + dev_dbg(ND2D(dev), "(%s) 0x%08x %p\n", __func__, cmd, &ifr->ifr_ifru);
50833 + case SIOCSCANBAUDRATE:
50834 + if (can->do_set_bit_time) {
50835 + struct can_bittime bit_time;
50836 + ret = can_calc_bit_time(can, *baudrate, &bit_time.std);
50839 + bit_time.type = CAN_BITTIME_STD;
50840 + ret = can->do_set_bit_time(dev, &bit_time);
50842 + can->baudrate = *baudrate;
50843 + can->bit_time = bit_time;
50847 + case SIOCGCANBAUDRATE:
50848 + *baudrate = can->baudrate;
50851 + case SIOCSCANCUSTOMBITTIME:
50852 + if (can->do_set_bit_time) {
50853 + ret = can->do_set_bit_time(dev, bt);
50855 + can->bit_time = *bt;
50856 + if (bt->type == CAN_BITTIME_STD && bt->std.brp) {
50857 + can->baudrate = can->can_sys_clock /
50858 + (bt->std.brp * (1 + bt->std.prop_seg +
50859 + bt->std.phase_seg1 +
50860 + bt->std.phase_seg2));
50862 + can->baudrate = CAN_BAUDRATE_UNKNOWN;
50866 + case SIOCGCANCUSTOMBITTIME:
50867 + *bt = can->bit_time;
50870 + case SIOCSCANMODE:
50871 + if (can->do_set_mode) {
50872 + can_mode_t mode =
50873 + *((can_mode_t *)(&ifr->ifr_ifru));
50874 + if (mode == CAN_MODE_START &&
50875 + can->baudrate == CAN_BAUDRATE_UNCONFIGURED) {
50876 + dev_info(ND2D(dev), "Impossible to start \
50877 + on UNKNOWN speed\n");
50880 + return can->do_set_mode(dev, mode);
50883 + case SIOCGCANMODE:
50884 + *((can_mode_t *)(&ifr->ifr_ifru)) = can->mode;
50887 + case SIOCSCANCTRLMODE:
50888 + if (can->do_set_ctrlmode) {
50889 + can_ctrlmode_t ctrlmode =
50890 + *((can_ctrlmode_t *)(&ifr->ifr_ifru));
50891 + return can->do_set_ctrlmode(dev, ctrlmode);
50894 + case SIOCGCANCTRLMODE:
50895 + *((can_ctrlmode_t *)(&ifr->ifr_ifru)) = can->ctrlmode;
50898 + case SIOCSCANFILTER:
50900 + case SIOCGCANFILTER:
50902 + case SIOCGCANSTATE:
50903 + if (can->do_get_state)
50904 + return can->do_get_state(dev,
50905 + (can_state_t *)(&ifr->ifr_ifru));
50907 + case SIOCGCANSTATS:
50908 + *((struct can_device_stats *)(&ifr->ifr_ifru)) = can->can_stats;
50916 +static void can_setup(struct net_device *dev)
50918 + dev->type = ARPHRD_CAN;
50919 + dev->mtu = sizeof(struct can_frame);
50920 + dev->do_ioctl = can_ioctl;
50921 + dev->hard_header_len = 0;
50922 + dev->addr_len = 0;
50923 + dev->tx_queue_len = 10;
50925 + /* New-style flags. */
50926 + dev->flags = IFF_NOARP;
50927 + dev->features = NETIF_F_NO_CSUM;
50931 + * Function alloc_candev
50932 + * Allocates and sets up an CAN device
50934 +struct net_device *alloc_candev(int sizeof_priv)
50936 + struct net_device *dev;
50937 + struct can_priv *priv;
50939 + dev = alloc_netdev(sizeof_priv, "can%d", can_setup);
50943 + priv = netdev_priv(dev);
50945 + priv->baudrate = CAN_BAUDRATE_UNCONFIGURED;
50946 + priv->max_brp = DEFAULT_MAX_BRP;
50947 + priv->max_sjw = DEFAULT_MAX_SJW;
50948 + spin_lock_init(&priv->irq_lock);
50952 +EXPORT_SYMBOL(alloc_candev);
50954 +void free_candev(struct net_device *dev)
50956 + free_netdev(dev);
50958 +EXPORT_SYMBOL(free_candev);
50959 --- a/net/can/Makefile
50960 +++ b/net/can/Makefile
50961 @@ -10,3 +10,6 @@ can-raw-objs := raw.o
50963 obj-$(CONFIG_CAN_BCM) += can-bcm.o
50964 can-bcm-objs := bcm.o
50966 +obj-$(CONFIG_CAN) += candev.o
50967 +candev-objs := dev.o
50968 --- a/net/irda/irlap.c
50969 +++ b/net/irda/irlap.c
50970 @@ -627,7 +627,7 @@ void irlap_status_indication(struct irla
50972 switch (quality_of_link) {
50973 case STATUS_NO_ACTIVITY:
50974 - IRDA_MESSAGE("IrLAP, no activity on link!\n");
50975 + /* IRDA_MESSAGE("IrLAP, no activity on link!\n"); */
50978 IRDA_MESSAGE("IrLAP, noisy link!\n");
50980 +++ b/scripts/checkfiles
50983 +# (c) 2007, Erez Zadok <ezk@cs.sunysb.edu> (initial version)
50984 +# Licensed under the terms of the GNU GPL License version 2
50986 +# Check source files for compliance with coding standards, using terse
50987 +# output in the style that g/cc produces. This output can be easily parsed
50988 +# within text editors (e.g., emacs/vim) which can produce a split text
50989 +# screen showing in one screen the error message, and in another screen the
50990 +# corresponding source file, with the cursor placed on the offending line.
50991 +# See for example the documentation for Emacs's "next-error" command, often
50992 +# bound to M-x ` (ESC x back-tick).
50994 +# Usage: checkfiles file [files...]
50995 +# if "file" is a directory, will check all *.[hc] files recursively
50999 + echo "Usage: checkfiles file [files...]"
51000 + echo "(if \"file\" is a directory, check recursively for all C sources/headers)"
51004 +# if test -z "$@" ; then
51007 +if ! test -f scripts/checkpatch.pl ; then
51008 + echo "checkfiles: must run from top level source tree"
51012 +# check coding-style compliance of each source file found
51013 +find "$@" -type f -name '*.[hc]' | \
51015 + diff -u /dev/null $f | perl scripts/checkpatch.pl -
51018 +++ b/scripts/checkfilesterse
51021 +# (c) 2007, Erez Zadok <ezk@cs.sunysb.edu> (initial version)
51022 +# Licensed under the terms of the GNU GPL License version 2
51024 +# Check source files for compliance with coding standards, using terse
51025 +# output in the style that g/cc produces. This output can be easily parsed
51026 +# within text editors (e.g., emacs/vim) which can produce a split text
51027 +# screen showing in one screen the error message, and in another screen the
51028 +# corresponding source file, with the cursor placed on the offending line.
51029 +# See for example the documentation for Emacs's "next-error" command, often
51030 +# bound to M-x ` (ESC x back-tick).
51032 +# Usage: checkfiles file [files...]
51033 +# if "file" is a directory, will check all *.[hc] files recursively
51037 + echo "Usage: checkfiles file [files...]"
51038 + echo "(if \"file\" is a directory, check recursively for all C sources/headers)"
51041 +if test -z "" ; then
51044 +if ! test -f scripts/checkpatch.pl ; then
51045 + echo "checkfiles: must run from top level source tree"
51049 +# check coding-style compliance of each source file found, using terse output
51050 +find "$@" -type f -name '*.[hc]' | \
51052 + diff -u /dev/null $f | perl scripts/checkpatch.pl -t -