aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h3
-rw-r--r--include/asm-alpha/atomic.h64
-rw-r--r--include/asm-alpha/kdebug.h1
-rw-r--r--include/asm-alpha/local.h126
-rw-r--r--include/asm-alpha/pgtable.h4
-rw-r--r--include/asm-alpha/system.h226
-rw-r--r--include/asm-alpha/thread_info.h22
-rw-r--r--include/asm-arm/arch-at91/at91_adc.h61
-rw-r--r--include/asm-arm/arch-at91/board.h12
-rw-r--r--include/asm-arm/arch-ebsa110/io.h8
-rw-r--r--include/asm-arm/arch-imx/imx-regs.h118
-rw-r--r--include/asm-arm/arch-iop13xx/io.h1
-rw-r--r--include/asm-arm/arch-iop13xx/iop13xx.h24
-rw-r--r--include/asm-arm/arch-iop13xx/time.h56
-rw-r--r--include/asm-arm/arch-iop32x/io.h1
-rw-r--r--include/asm-arm/arch-iop32x/iop32x.h9
-rw-r--r--include/asm-arm/arch-iop32x/memory.h4
-rw-r--r--include/asm-arm/arch-iop33x/io.h1
-rw-r--r--include/asm-arm/arch-iop33x/iop33x.h10
-rw-r--r--include/asm-arm/arch-iop33x/memory.h4
-rw-r--r--include/asm-arm/arch-ixp23xx/io.h4
-rw-r--r--include/asm-arm/arch-ixp4xx/cpu.h31
-rw-r--r--include/asm-arm/arch-ixp4xx/dsmg600.h57
-rw-r--r--include/asm-arm/arch-ixp4xx/entry-macro.S4
-rw-r--r--include/asm-arm/arch-ixp4xx/gpio.h73
-rw-r--r--include/asm-arm/arch-ixp4xx/hardware.h12
-rw-r--r--include/asm-arm/arch-ixp4xx/io.h6
-rw-r--r--include/asm-arm/arch-ixp4xx/irqs.h16
-rw-r--r--include/asm-arm/arch-ixp4xx/ixp4xx-regs.h15
-rw-r--r--include/asm-arm/arch-netx/netx-regs.h4
-rw-r--r--include/asm-arm/arch-ns9xxx/board.h2
-rw-r--r--include/asm-arm/arch-ns9xxx/clock.h34
-rw-r--r--include/asm-arm/arch-ns9xxx/hardware.h5
-rw-r--r--include/asm-arm/arch-ns9xxx/processor.h3
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-sys.h6
-rw-r--r--include/asm-arm/arch-pxa/i2c.h1
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h58
-rw-r--r--include/asm-arm/arch-s3c2410/regs-ac97.h56
-rw-r--r--include/asm-arm/arch-s3c2410/regs-udc.h6
-rw-r--r--include/asm-arm/atomic.h1
-rw-r--r--include/asm-arm/ecard.h52
-rw-r--r--include/asm-arm/hardware/iop3xx.h24
-rw-r--r--include/asm-arm/io.h33
-rw-r--r--include/asm-arm/kdebug.h1
-rw-r--r--include/asm-arm/kexec.h2
-rw-r--r--include/asm-arm/mach/map.h21
-rw-r--r--include/asm-arm/pgtable-nommu.h4
-rw-r--r--include/asm-arm/pgtable.h4
-rw-r--r--include/asm-arm/plat-s3c24xx/clock.h1
-rw-r--r--include/asm-arm/plat-s3c24xx/cpu.h16
-rw-r--r--include/asm-arm/ptrace.h10
-rw-r--r--include/asm-arm/system.h6
-rw-r--r--include/asm-arm/thread_info.h1
-rw-r--r--include/asm-arm26/atomic.h1
-rw-r--r--include/asm-arm26/kdebug.h1
-rw-r--r--include/asm-arm26/pgtable.h4
-rw-r--r--include/asm-arm26/system.h2
-rw-r--r--include/asm-avr32/kdebug.h25
-rw-r--r--include/asm-avr32/pgtable.h4
-rw-r--r--include/asm-blackfin/Kbuild1
-rw-r--r--include/asm-blackfin/a.out.h25
-rw-r--r--include/asm-blackfin/atomic.h144
-rw-r--r--include/asm-blackfin/auxvec.h4
-rw-r--r--include/asm-blackfin/bf5xx_timers.h209
-rw-r--r--include/asm-blackfin/bfin-global.h120
-rw-r--r--include/asm-blackfin/bfin5xx_spi.h170
-rw-r--r--include/asm-blackfin/bfin_simple_timer.h13
-rw-r--r--include/asm-blackfin/bfin_sport.h175
-rw-r--r--include/asm-blackfin/bitops.h213
-rw-r--r--include/asm-blackfin/blackfin.h81
-rw-r--r--include/asm-blackfin/bug.h4
-rw-r--r--include/asm-blackfin/bugs.h16
-rw-r--r--include/asm-blackfin/byteorder.h48
-rw-r--r--include/asm-blackfin/cache.h29
-rw-r--r--include/asm-blackfin/cacheflush.h90
-rw-r--r--include/asm-blackfin/checksum.h101
-rw-r--r--include/asm-blackfin/cplb.h51
-rw-r--r--include/asm-blackfin/cplbinit.h203
-rw-r--r--include/asm-blackfin/cpumask.h6
-rw-r--r--include/asm-blackfin/cputime.h6
-rw-r--r--include/asm-blackfin/current.h23
-rw-r--r--include/asm-blackfin/delay.h44
-rw-r--r--include/asm-blackfin/device.h7
-rw-r--r--include/asm-blackfin/div64.h1
-rw-r--r--include/asm-blackfin/dma-mapping.h66
-rw-r--r--include/asm-blackfin/dma.h188
-rw-r--r--include/asm-blackfin/dpmc.h70
-rw-r--r--include/asm-blackfin/elf.h127
-rw-r--r--include/asm-blackfin/emergency-restart.h6
-rw-r--r--include/asm-blackfin/entry.h56
-rw-r--r--include/asm-blackfin/errno.h6
-rw-r--r--include/asm-blackfin/fcntl.h13
-rw-r--r--include/asm-blackfin/flat.h58
-rw-r--r--include/asm-blackfin/futex.h6
-rw-r--r--include/asm-blackfin/gpio.h367
-rw-r--r--include/asm-blackfin/hardirq.h41
-rw-r--r--include/asm-blackfin/hw_irq.h6
-rw-r--r--include/asm-blackfin/ide.h32
-rw-r--r--include/asm-blackfin/io.h207
-rw-r--r--include/asm-blackfin/ioctl.h1
-rw-r--r--include/asm-blackfin/ioctls.h82
-rw-r--r--include/asm-blackfin/ipc.h1
-rw-r--r--include/asm-blackfin/ipcbuf.h30
-rw-r--r--include/asm-blackfin/irq.h70
-rw-r--r--include/asm-blackfin/irq_handler.h22
-rw-r--r--include/asm-blackfin/irq_regs.h1
-rw-r--r--include/asm-blackfin/kdebug.h1
-rw-r--r--include/asm-blackfin/kmap_types.h21
-rw-r--r--include/asm-blackfin/l1layout.h31
-rw-r--r--include/asm-blackfin/linkage.h7
-rw-r--r--include/asm-blackfin/local.h6
-rw-r--r--include/asm-blackfin/mach-bf533/anomaly.h175
-rw-r--r--include/asm-blackfin/mach-bf533/bf533.h306
-rw-r--r--include/asm-blackfin/mach-bf533/bfin_serial_5xx.h108
-rw-r--r--include/asm-blackfin/mach-bf533/blackfin.h45
-rw-r--r--include/asm-blackfin/mach-bf533/cdefBF532.h706
-rw-r--r--include/asm-blackfin/mach-bf533/defBF532.h1175
-rw-r--r--include/asm-blackfin/mach-bf533/dma.h54
-rw-r--r--include/asm-blackfin/mach-bf533/irq.h177
-rw-r--r--include/asm-blackfin/mach-bf533/mem_init.h316
-rw-r--r--include/asm-blackfin/mach-bf533/mem_map.h168
-rw-r--r--include/asm-blackfin/mach-bf537/anomaly.h120
-rw-r--r--include/asm-blackfin/mach-bf537/bf537.h287
-rw-r--r--include/asm-blackfin/mach-bf537/bfin_serial_5xx.h147
-rw-r--r--include/asm-blackfin/mach-bf537/blackfin.h430
-rw-r--r--include/asm-blackfin/mach-bf537/cdefBF534.h1823
-rw-r--r--include/asm-blackfin/mach-bf537/cdefBF537.h209
-rw-r--r--include/asm-blackfin/mach-bf537/defBF534.h2501
-rw-r--r--include/asm-blackfin/mach-bf537/defBF537.h404
-rw-r--r--include/asm-blackfin/mach-bf537/dma.h55
-rw-r--r--include/asm-blackfin/mach-bf537/irq.h219
-rw-r--r--include/asm-blackfin/mach-bf537/mem_init.h330
-rw-r--r--include/asm-blackfin/mach-bf537/mem_map.h175
-rw-r--r--include/asm-blackfin/mach-bf561/anomaly.h184
-rw-r--r--include/asm-blackfin/mach-bf561/bf561.h408
-rw-r--r--include/asm-blackfin/mach-bf561/bfin_serial_5xx.h108
-rw-r--r--include/asm-blackfin/mach-bf561/blackfin.h52
-rw-r--r--include/asm-blackfin/mach-bf561/cdefBF561.h1543
-rw-r--r--include/asm-blackfin/mach-bf561/defBF561.h1717
-rw-r--r--include/asm-blackfin/mach-bf561/dma.h35
-rw-r--r--include/asm-blackfin/mach-bf561/irq.h450
-rw-r--r--include/asm-blackfin/mach-bf561/mem_init.h322
-rw-r--r--include/asm-blackfin/mach-bf561/mem_map.h75
-rw-r--r--include/asm-blackfin/mach-common/cdef_LPBlackfin.h471
-rw-r--r--include/asm-blackfin/mach-common/context.S350
-rw-r--r--include/asm-blackfin/mach-common/def_LPBlackfin.h691
-rw-r--r--include/asm-blackfin/macros.h95
-rw-r--r--include/asm-blackfin/mem_map.h12
-rw-r--r--include/asm-blackfin/mman.h45
-rw-r--r--include/asm-blackfin/mmu.h30
-rw-r--r--include/asm-blackfin/mmu_context.h129
-rw-r--r--include/asm-blackfin/module.h19
-rw-r--r--include/asm-blackfin/msgbuf.h31
-rw-r--r--include/asm-blackfin/mutex.h9
-rw-r--r--include/asm-blackfin/namei.h19
-rw-r--r--include/asm-blackfin/page.h89
-rw-r--r--include/asm-blackfin/page_offset.h6
-rw-r--r--include/asm-blackfin/param.h22
-rw-r--r--include/asm-blackfin/pci.h148
-rw-r--r--include/asm-blackfin/percpu.h6
-rw-r--r--include/asm-blackfin/pgalloc.h8
-rw-r--r--include/asm-blackfin/pgtable.h96
-rw-r--r--include/asm-blackfin/poll.h24
-rw-r--r--include/asm-blackfin/posix_types.h65
-rw-r--r--include/asm-blackfin/processor.h130
-rw-r--r--include/asm-blackfin/ptrace.h166
-rw-r--r--include/asm-blackfin/resource.h6
-rw-r--r--include/asm-blackfin/scatterlist.h26
-rw-r--r--include/asm-blackfin/sections.h7
-rw-r--r--include/asm-blackfin/segment.h7
-rw-r--r--include/asm-blackfin/semaphore-helper.h82
-rw-r--r--include/asm-blackfin/semaphore.h106
-rw-r--r--include/asm-blackfin/sembuf.h25
-rw-r--r--include/asm-blackfin/setup.h17
-rw-r--r--include/asm-blackfin/shmbuf.h42
-rw-r--r--include/asm-blackfin/shmparam.h6
-rw-r--r--include/asm-blackfin/sigcontext.h55
-rw-r--r--include/asm-blackfin/siginfo.h35
-rw-r--r--include/asm-blackfin/signal.h160
-rw-r--r--include/asm-blackfin/socket.h53
-rw-r--r--include/asm-blackfin/sockios.h13
-rw-r--r--include/asm-blackfin/spinlock.h6
-rw-r--r--include/asm-blackfin/stat.h63
-rw-r--r--include/asm-blackfin/statfs.h6
-rw-r--r--include/asm-blackfin/string.h104
-rw-r--r--include/asm-blackfin/system.h249
-rw-r--r--include/asm-blackfin/termbits.h184
-rw-r--r--include/asm-blackfin/termios.h106
-rw-r--r--include/asm-blackfin/thread_info.h143
-rw-r--r--include/asm-blackfin/timex.h18
-rw-r--r--include/asm-blackfin/tlb.h16
-rw-r--r--include/asm-blackfin/tlbflush.h62
-rw-r--r--include/asm-blackfin/topology.h6
-rw-r--r--include/asm-blackfin/traps.h75
-rw-r--r--include/asm-blackfin/types.h66
-rw-r--r--include/asm-blackfin/uaccess.h271
-rw-r--r--include/asm-blackfin/ucontext.h17
-rw-r--r--include/asm-blackfin/unaligned.h6
-rw-r--r--include/asm-blackfin/unistd.h382
-rw-r--r--include/asm-blackfin/user.h89
-rw-r--r--include/asm-cris/kdebug.h1
-rw-r--r--include/asm-frv/atomic.h91
-rw-r--r--include/asm-frv/kdebug.h1
-rw-r--r--include/asm-frv/pgtable.h4
-rw-r--r--include/asm-frv/semaphore.h14
-rw-r--r--include/asm-frv/system.h70
-rw-r--r--include/asm-generic/atomic.h140
-rw-r--r--include/asm-generic/kdebug.h8
-rw-r--r--include/asm-generic/local.h33
-rw-r--r--include/asm-h8300/irq.h1
-rw-r--r--include/asm-h8300/irq_regs.h1
-rw-r--r--include/asm-h8300/kdebug.h1
-rw-r--r--include/asm-h8300/pgtable.h5
-rw-r--r--include/asm-h8300/system.h1
-rw-r--r--include/asm-i386/atomic.h45
-rw-r--r--include/asm-i386/cmpxchg.h293
-rw-r--r--include/asm-i386/elf.h2
-rw-r--r--include/asm-i386/ioctls.h4
-rw-r--r--include/asm-i386/kdebug.h25
-rw-r--r--include/asm-i386/kexec.h2
-rw-r--r--include/asm-i386/local.h205
-rw-r--r--include/asm-i386/msr.h12
-rw-r--r--include/asm-i386/pgtable.h41
-rw-r--r--include/asm-i386/serial.h16
-rw-r--r--include/asm-i386/system.h234
-rw-r--r--include/asm-i386/termbits.h14
-rw-r--r--include/asm-i386/termios.h6
-rw-r--r--include/asm-i386/thread_info.h8
-rw-r--r--include/asm-i386/unistd.h3
-rw-r--r--include/asm-ia64/asmmacro.h10
-rw-r--r--include/asm-ia64/atomic.h53
-rw-r--r--include/asm-ia64/io.h6
-rw-r--r--include/asm-ia64/kdebug.h27
-rw-r--r--include/asm-ia64/kexec.h2
-rw-r--r--include/asm-ia64/kregs.h3
-rw-r--r--include/asm-ia64/local.h51
-rw-r--r--include/asm-ia64/pal.h33
-rw-r--r--include/asm-ia64/patch.h1
-rw-r--r--include/asm-ia64/pgtable.h4
-rw-r--r--include/asm-ia64/processor.h1
-rw-r--r--include/asm-ia64/sections.h1
-rw-r--r--include/asm-m32r/atomic.h23
-rw-r--r--include/asm-m32r/kdebug.h1
-rw-r--r--include/asm-m32r/pgtable.h4
-rw-r--r--include/asm-m32r/system.h2
-rw-r--r--include/asm-m68k/atomic.h31
-rw-r--r--include/asm-m68k/kdebug.h1
-rw-r--r--include/asm-m68k/pgtable.h4
-rw-r--r--include/asm-m68k/system.h1
-rw-r--r--include/asm-m68knommu/atomic.h25
-rw-r--r--include/asm-m68knommu/kdebug.h1
-rw-r--r--include/asm-m68knommu/pgtable.h4
-rw-r--r--include/asm-m68knommu/system.h1
-rw-r--r--include/asm-mips/atomic.h57
-rw-r--r--include/asm-mips/kdebug.h1
-rw-r--r--include/asm-mips/kexec.h2
-rw-r--r--include/asm-mips/local.h304
-rw-r--r--include/asm-mips/mach-au1x00/au1550_spi.h16
-rw-r--r--include/asm-mips/pgtable.h4
-rw-r--r--include/asm-mips/system.h126
-rw-r--r--include/asm-parisc/atomic.h56
-rw-r--r--include/asm-parisc/kdebug.h1
-rw-r--r--include/asm-parisc/local.h41
-rw-r--r--include/asm-parisc/pgtable.h4
-rw-r--r--include/asm-powerpc/atomic.h7
-rw-r--r--include/asm-powerpc/bitops.h1
-rw-r--r--include/asm-powerpc/iommu.h14
-rw-r--r--include/asm-powerpc/kdebug.h34
-rw-r--r--include/asm-powerpc/kexec.h2
-rw-r--r--include/asm-powerpc/kprobes.h7
-rw-r--r--include/asm-powerpc/local.h201
-rw-r--r--include/asm-powerpc/machdep.h19
-rw-r--r--include/asm-powerpc/mmu-44x.h78
-rw-r--r--include/asm-powerpc/mmu.h7
-rw-r--r--include/asm-powerpc/mpc52xx.h11
-rw-r--r--include/asm-powerpc/mpic.h20
-rw-r--r--include/asm-powerpc/of_device.h2
-rw-r--r--include/asm-powerpc/page.h10
-rw-r--r--include/asm-powerpc/page_32.h2
-rw-r--r--include/asm-powerpc/parport.h5
-rw-r--r--include/asm-powerpc/pgalloc-32.h41
-rw-r--r--include/asm-powerpc/pgalloc-64.h152
-rw-r--r--include/asm-powerpc/pgalloc.h154
-rw-r--r--include/asm-powerpc/pgtable-4k.h3
-rw-r--r--include/asm-powerpc/pgtable-64k.h5
-rw-r--r--include/asm-powerpc/pgtable-ppc32.h813
-rw-r--r--include/asm-powerpc/pgtable-ppc64.h492
-rw-r--r--include/asm-powerpc/pgtable.h493
-rw-r--r--include/asm-powerpc/pmac_feature.h2
-rw-r--r--include/asm-powerpc/prom.h34
-rw-r--r--include/asm-powerpc/ps3.h33
-rw-r--r--include/asm-powerpc/suspend.h9
-rw-r--r--include/asm-powerpc/system.h130
-rw-r--r--include/asm-powerpc/tsi108.h12
-rw-r--r--include/asm-powerpc/tsi108_pci.h45
-rw-r--r--include/asm-powerpc/udbg.h1
-rw-r--r--include/asm-ppc/kdebug.h1
-rw-r--r--include/asm-ppc/pgtable.h4
-rw-r--r--include/asm-ppc/system.h2
-rw-r--r--include/asm-s390/dma-mapping.h2
-rw-r--r--include/asm-s390/kdebug.h30
-rw-r--r--include/asm-s390/kexec.h2
-rw-r--r--include/asm-s390/qdio.h1
-rw-r--r--include/asm-sh/bug.h92
-rw-r--r--include/asm-sh/clock.h32
-rw-r--r--include/asm-sh/cpu-sh3/mmu_context.h1
-rw-r--r--include/asm-sh/cpu-sh4/freq.h8
-rw-r--r--include/asm-sh/irq.h91
-rw-r--r--include/asm-sh/kdebug.h36
-rw-r--r--include/asm-sh/kexec.h44
-rw-r--r--include/asm-sh/kgdb.h51
-rw-r--r--include/asm-sh/lboxre2.h27
-rw-r--r--include/asm-sh/mmu_context.h6
-rw-r--r--include/asm-sh/page.h10
-rw-r--r--include/asm-sh/param.h2
-rw-r--r--include/asm-sh/pci.h2
-rw-r--r--include/asm-sh/pgtable.h4
-rw-r--r--include/asm-sh/processor.h2
-rw-r--r--include/asm-sh/r7780rp.h76
-rw-r--r--include/asm-sh/se.h4
-rw-r--r--include/asm-sh/se7722.h118
-rw-r--r--include/asm-sh/se7751.h2
-rw-r--r--include/asm-sh/se7780.h108
-rw-r--r--include/asm-sh/stat.h19
-rw-r--r--include/asm-sh/system.h13
-rw-r--r--include/asm-sh64/kdebug.h1
-rw-r--r--include/asm-sh64/pgtable.h4
-rw-r--r--include/asm-sh64/system.h2
-rw-r--r--include/asm-sparc/kdebug.h4
-rw-r--r--include/asm-sparc/system.h1
-rw-r--r--include/asm-sparc64/Kbuild1
-rw-r--r--include/asm-sparc64/atomic.h53
-rw-r--r--include/asm-sparc64/const.h19
-rw-r--r--include/asm-sparc64/iommu.h1
-rw-r--r--include/asm-sparc64/kdebug.h23
-rw-r--r--include/asm-sparc64/local.h41
-rw-r--r--include/asm-sparc64/lsu.h2
-rw-r--r--include/asm-sparc64/mmu.h2
-rw-r--r--include/asm-sparc64/page.h2
-rw-r--r--include/asm-sparc64/pgalloc.h26
-rw-r--r--include/asm-sparc64/pgtable.h2
-rw-r--r--include/asm-sparc64/pstate.h2
-rw-r--r--include/asm-sparc64/sfafsr.h2
-rw-r--r--include/asm-sparc64/system.h1
-rw-r--r--include/asm-um/cmpxchg.h6
-rw-r--r--include/asm-um/kdebug.h1
-rw-r--r--include/asm-um/page.h3
-rw-r--r--include/asm-um/tlbflush.h24
-rw-r--r--include/asm-v850/kdebug.h1
-rw-r--r--include/asm-v850/system.h1
-rw-r--r--include/asm-x86_64/Kbuild1
-rw-r--r--include/asm-x86_64/atomic.h65
-rw-r--r--include/asm-x86_64/cmpxchg.h134
-rw-r--r--include/asm-x86_64/kdebug.h25
-rw-r--r--include/asm-x86_64/kexec.h2
-rw-r--r--include/asm-x86_64/local.h196
-rw-r--r--include/asm-x86_64/msr.h11
-rw-r--r--include/asm-x86_64/page.h27
-rw-r--r--include/asm-x86_64/pgtable.h21
-rw-r--r--include/asm-x86_64/serial.h16
-rw-r--r--include/asm-x86_64/system.h96
-rw-r--r--include/asm-x86_64/termbits.h2
-rw-r--r--include/asm-x86_64/unistd.h2
-rw-r--r--include/asm-xtensa/atomic.h23
-rw-r--r--include/asm-xtensa/kdebug.h1
-rw-r--r--include/asm-xtensa/system.h2
-rw-r--r--include/linux/Kbuild8
-rw-r--r--include/linux/awe_voice.h525
-rw-r--r--include/linux/buffer_head.h5
-rw-r--r--include/linux/byteorder/generic.h25
-rw-r--r--include/linux/byteorder/swab.h108
-rw-r--r--include/linux/clockchips.h10
-rw-r--r--include/linux/clocksource.h15
-rw-r--r--include/linux/compat_ioctl.h830
-rw-r--r--include/linux/compiler-gcc.h3
-rw-r--r--include/linux/compiler-gcc3.h6
-rw-r--r--include/linux/compiler-gcc4.h6
-rw-r--r--include/linux/compiler-intel.h5
-rw-r--r--include/linux/console.h7
-rw-r--r--include/linux/console_struct.h3
-rw-r--r--include/linux/const.h (renamed from include/asm-x86_64/const.h)9
-rw-r--r--include/linux/cpu.h3
-rw-r--r--include/linux/cyclades.h229
-rw-r--r--include/linux/dcache.h6
-rw-r--r--include/linux/device.h4
-rw-r--r--include/linux/display.h61
-rw-r--r--include/linux/dlm_device.h9
-rw-r--r--include/linux/ds1wm.h11
-rw-r--r--include/linux/efi.h1
-rw-r--r--include/linux/elf-em.h1
-rw-r--r--include/linux/etherdevice.h12
-rw-r--r--include/linux/ext3_fs.h1
-rw-r--r--include/linux/fb.h57
-rw-r--r--include/linux/fcntl.h4
-rw-r--r--include/linux/font.h3
-rw-r--r--include/linux/fs.h27
-rw-r--r--include/linux/futex.h29
-rw-r--r--include/linux/gfp.h3
-rw-r--r--include/linux/hugetlb.h6
-rw-r--r--include/linux/init.h5
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/input.h4
-rw-r--r--include/linux/interrupt.h38
-rw-r--r--include/linux/ioctl32.h17
-rw-r--r--include/linux/ipc.h11
-rw-r--r--include/linux/irq.h4
-rw-r--r--include/linux/isdn/capiutil.h1
-rw-r--r--include/linux/isdn_divertif.h5
-rw-r--r--include/linux/kallsyms.h13
-rw-r--r--include/linux/kdebug.h20
-rw-r--r--include/linux/kernel.h3
-rw-r--r--include/linux/kexec.h17
-rw-r--r--include/linux/kprobes.h22
-rw-r--r--include/linux/kvm.h133
-rw-r--r--include/linux/libata.h40
-rw-r--r--include/linux/list.h11
-rw-r--r--include/linux/lockd/lockd.h14
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/mc146818rtc.h7
-rw-r--r--include/linux/migrate.h15
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mm.h55
-rw-r--r--include/linux/mm_types.h17
-rw-r--r--include/linux/mmzone.h12
-rw-r--r--include/linux/mnt_namespace.h5
-rw-r--r--include/linux/mod_devicetable.h1
-rw-r--r--include/linux/module.h30
-rw-r--r--include/linux/msdos_fs.h3
-rw-r--r--include/linux/nfs_fs_sb.h2
-rw-r--r--include/linux/nsproxy.h3
-rw-r--r--include/linux/page-flags.h41
-rw-r--r--include/linux/pagemap.h22
-rw-r--r--include/linux/parport.h8
-rw-r--r--include/linux/parport_pc.h3
-rw-r--r--include/linux/phantom.h42
-rw-r--r--include/linux/pid_namespace.h2
-rw-r--r--include/linux/pmu.h8
-rw-r--r--include/linux/pnp.h3
-rw-r--r--include/linux/poison.h7
-rw-r--r--include/linux/proc_fs.h4
-rw-r--r--include/linux/quicklist.h94
-rw-r--r--include/linux/quota.h4
-rw-r--r--include/linux/quotaops.h3
-rw-r--r--include/linux/reiserfs_fs_sb.h3
-rw-r--r--include/linux/rfkill.h89
-rw-r--r--include/linux/rtc.h39
-rw-r--r--include/linux/sched.h35
-rw-r--r--include/linux/serial_core.h10
-rw-r--r--include/linux/serial_reg.h2
-rw-r--r--include/linux/slab.h36
-rw-r--r--include/linux/slub_def.h206
-rw-r--r--include/linux/spi/Kbuild1
-rw-r--r--include/linux/spi/ad7877.h24
-rw-r--r--include/linux/spi/spi.h82
-rw-r--r--include/linux/spi/spidev.h124
-rw-r--r--include/linux/spinlock_types.h6
-rw-r--r--include/linux/stacktrace.h6
-rw-r--r--include/linux/stat.h3
-rw-r--r--include/linux/suspend.h37
-rw-r--r--include/linux/svga.h1
-rw-r--r--include/linux/sysdev.h1
-rw-r--r--include/linux/tifm.h1
-rw-r--r--include/linux/time.h3
-rw-r--r--include/linux/timer.h1
-rw-r--r--include/linux/tty.h2
-rw-r--r--include/linux/uinput.h2
-rw-r--r--include/linux/usb_sl811.h26
-rw-r--r--include/linux/utsname.h19
-rw-r--r--include/linux/vmalloc.h1
-rw-r--r--include/linux/vt_kern.h3
-rw-r--r--include/linux/workqueue.h6
-rw-r--r--include/math-emu/extended.h396
-rw-r--r--include/net/sock.h9
-rw-r--r--include/pcmcia/ds.h6
-rw-r--r--include/rdma/ib_verbs.h47
-rw-r--r--include/video/mach64.h1
-rw-r--r--include/video/permedia2.h4
-rw-r--r--include/video/tgafb.h47
478 files changed, 30631 insertions, 4756 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 16c3c441256e..9cfd5b1a48eb 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -303,6 +303,9 @@ struct acpi_device {
303#define to_acpi_device(d) container_of(d, struct acpi_device, dev) 303#define to_acpi_device(d) container_of(d, struct acpi_device, dev)
304#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) 304#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv)
305 305
306/* acpi_device.dev.bus == &acpi_bus_type */
307extern struct bus_type acpi_bus_type;
308
306/* 309/*
307 * Events 310 * Events
308 * ------ 311 * ------
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h
index fc77f7413083..f5cb7b878af2 100644
--- a/include/asm-alpha/atomic.h
+++ b/include/asm-alpha/atomic.h
@@ -2,6 +2,7 @@
2#define _ALPHA_ATOMIC_H 2#define _ALPHA_ATOMIC_H
3 3
4#include <asm/barrier.h> 4#include <asm/barrier.h>
5#include <asm/system.h>
5 6
6/* 7/*
7 * Atomic operations that C can't guarantee us. Useful for 8 * Atomic operations that C can't guarantee us. Useful for
@@ -175,19 +176,64 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
175 return result; 176 return result;
176} 177}
177 178
178#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) 179#define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
180#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
181
182#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
179#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 183#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
180 184
181#define atomic_add_unless(v, a, u) \ 185/**
182({ \ 186 * atomic_add_unless - add unless the number is a given value
183 int c, old; \ 187 * @v: pointer of type atomic_t
184 c = atomic_read(v); \ 188 * @a: the amount to add to v...
185 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ 189 * @u: ...unless v is equal to u.
186 c = old; \ 190 *
187 c != (u); \ 191 * Atomically adds @a to @v, so long as it was not @u.
188}) 192 * Returns non-zero if @v was not @u, and zero otherwise.
193 */
194static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
195{
196 int c, old;
197 c = atomic_read(v);
198 for (;;) {
199 if (unlikely(c == (u)))
200 break;
201 old = atomic_cmpxchg((v), c, c + (a));
202 if (likely(old == c))
203 break;
204 c = old;
205 }
206 return c != (u);
207}
208
189#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 209#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
190 210
211/**
212 * atomic64_add_unless - add unless the number is a given value
213 * @v: pointer of type atomic64_t
214 * @a: the amount to add to v...
215 * @u: ...unless v is equal to u.
216 *
217 * Atomically adds @a to @v, so long as it was not @u.
218 * Returns non-zero if @v was not @u, and zero otherwise.
219 */
220static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
221{
222 long c, old;
223 c = atomic64_read(v);
224 for (;;) {
225 if (unlikely(c == (u)))
226 break;
227 old = atomic64_cmpxchg((v), c, c + (a));
228 if (likely(old == c))
229 break;
230 c = old;
231 }
232 return c != (u);
233}
234
235#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
236
191#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) 237#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
192#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0) 238#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
193 239
diff --git a/include/asm-alpha/kdebug.h b/include/asm-alpha/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-alpha/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-alpha/local.h b/include/asm-alpha/local.h
index 90a510fa358e..6ad3ea696421 100644
--- a/include/asm-alpha/local.h
+++ b/include/asm-alpha/local.h
@@ -4,37 +4,115 @@
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5#include <asm/atomic.h> 5#include <asm/atomic.h>
6 6
7typedef atomic64_t local_t; 7typedef struct
8{
9 atomic_long_t a;
10} local_t;
8 11
9#define LOCAL_INIT(i) ATOMIC64_INIT(i) 12#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
10#define local_read(v) atomic64_read(v) 13#define local_read(l) atomic_long_read(&(l)->a)
11#define local_set(v,i) atomic64_set(v,i) 14#define local_set(l,i) atomic_long_set(&(l)->a, (i))
15#define local_inc(l) atomic_long_inc(&(l)->a)
16#define local_dec(l) atomic_long_dec(&(l)->a)
17#define local_add(i,l) atomic_long_add((i),(&(l)->a))
18#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
12 19
13#define local_inc(v) atomic64_inc(v) 20static __inline__ long local_add_return(long i, local_t * l)
14#define local_dec(v) atomic64_dec(v) 21{
15#define local_add(i, v) atomic64_add(i, v) 22 long temp, result;
16#define local_sub(i, v) atomic64_sub(i, v) 23 __asm__ __volatile__(
24 "1: ldq_l %0,%1\n"
25 " addq %0,%3,%2\n"
26 " addq %0,%3,%0\n"
27 " stq_c %0,%1\n"
28 " beq %0,2f\n"
29 ".subsection 2\n"
30 "2: br 1b\n"
31 ".previous"
32 :"=&r" (temp), "=m" (l->a.counter), "=&r" (result)
33 :"Ir" (i), "m" (l->a.counter) : "memory");
34 return result;
35}
17 36
18#define __local_inc(v) ((v)->counter++) 37static __inline__ long local_sub_return(long i, local_t * l)
19#define __local_dec(v) ((v)->counter++) 38{
20#define __local_add(i,v) ((v)->counter+=(i)) 39 long temp, result;
21#define __local_sub(i,v) ((v)->counter-=(i)) 40 __asm__ __volatile__(
41 "1: ldq_l %0,%1\n"
42 " subq %0,%3,%2\n"
43 " subq %0,%3,%0\n"
44 " stq_c %0,%1\n"
45 " beq %0,2f\n"
46 ".subsection 2\n"
47 "2: br 1b\n"
48 ".previous"
49 :"=&r" (temp), "=m" (l->a.counter), "=&r" (result)
50 :"Ir" (i), "m" (l->a.counter) : "memory");
51 return result;
52}
53
54#define local_cmpxchg(l, o, n) \
55 (cmpxchg_local(&((l)->a.counter), (o), (n)))
56#define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n)))
57
58/**
59 * local_add_unless - add unless the number is a given value
60 * @l: pointer of type local_t
61 * @a: the amount to add to l...
62 * @u: ...unless l is equal to u.
63 *
64 * Atomically adds @a to @l, so long as it was not @u.
65 * Returns non-zero if @l was not @u, and zero otherwise.
66 */
67#define local_add_unless(l, a, u) \
68({ \
69 long c, old; \
70 c = local_read(l); \
71 for (;;) { \
72 if (unlikely(c == (u))) \
73 break; \
74 old = local_cmpxchg((l), c, c + (a)); \
75 if (likely(old == c)) \
76 break; \
77 c = old; \
78 } \
79 c != (u); \
80})
81#define local_inc_not_zero(l) local_add_unless((l), 1, 0)
82
83#define local_add_negative(a, l) (local_add_return((a), (l)) < 0)
84
85#define local_dec_return(l) local_sub_return(1,(l))
86
87#define local_inc_return(l) local_add_return(1,(l))
88
89#define local_sub_and_test(i,l) (local_sub_return((i), (l)) == 0)
90
91#define local_inc_and_test(l) (local_add_return(1, (l)) == 0)
92
93#define local_dec_and_test(l) (local_sub_return(1, (l)) == 0)
94
95/* Verify if faster than atomic ops */
96#define __local_inc(l) ((l)->a.counter++)
97#define __local_dec(l) ((l)->a.counter++)
98#define __local_add(i,l) ((l)->a.counter+=(i))
99#define __local_sub(i,l) ((l)->a.counter-=(i))
22 100
23/* Use these for per-cpu local_t variables: on some archs they are 101/* Use these for per-cpu local_t variables: on some archs they are
24 * much more efficient than these naive implementations. Note they take 102 * much more efficient than these naive implementations. Note they take
25 * a variable, not an address. 103 * a variable, not an address.
26 */ 104 */
27#define cpu_local_read(v) local_read(&__get_cpu_var(v)) 105#define cpu_local_read(l) local_read(&__get_cpu_var(l))
28#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i)) 106#define cpu_local_set(l, i) local_set(&__get_cpu_var(l), (i))
29 107
30#define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) 108#define cpu_local_inc(l) local_inc(&__get_cpu_var(l))
31#define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) 109#define cpu_local_dec(l) local_dec(&__get_cpu_var(l))
32#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) 110#define cpu_local_add(i, l) local_add((i), &__get_cpu_var(l))
33#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) 111#define cpu_local_sub(i, l) local_sub((i), &__get_cpu_var(l))
34 112
35#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v)) 113#define __cpu_local_inc(l) __local_inc(&__get_cpu_var(l))
36#define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v)) 114#define __cpu_local_dec(l) __local_dec(&__get_cpu_var(l))
37#define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v)) 115#define __cpu_local_add(i, l) __local_add((i), &__get_cpu_var(l))
38#define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v)) 116#define __cpu_local_sub(i, l) __local_sub((i), &__get_cpu_var(l))
39 117
40#endif /* _ALPHA_LOCAL_H */ 118#endif /* _ALPHA_LOCAL_H */
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
index 49ac9bee7ced..616d20662ff3 100644
--- a/include/asm-alpha/pgtable.h
+++ b/include/asm-alpha/pgtable.h
@@ -345,10 +345,6 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
345#define io_remap_pfn_range(vma, start, pfn, size, prot) \ 345#define io_remap_pfn_range(vma, start, pfn, size, prot) \
346 remap_pfn_range(vma, start, pfn, size, prot) 346 remap_pfn_range(vma, start, pfn, size, prot)
347 347
348#define MK_IOSPACE_PFN(space, pfn) (pfn)
349#define GET_IOSPACE(pfn) 0
350#define GET_PFN(pfn) (pfn)
351
352#define pte_ERROR(e) \ 348#define pte_ERROR(e) \
353 printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) 349 printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
354#define pmd_ERROR(e) \ 350#define pmd_ERROR(e) \
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index 03e9c0e5ed74..cf1021a97b2e 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -443,8 +443,110 @@ extern void __xchg_called_with_bad_pointer(void);
443 (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \ 443 (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \
444 }) 444 })
445 445
446#define tas(ptr) (xchg((ptr),1)) 446static inline unsigned long
447__xchg_u8_local(volatile char *m, unsigned long val)
448{
449 unsigned long ret, tmp, addr64;
450
451 __asm__ __volatile__(
452 " andnot %4,7,%3\n"
453 " insbl %1,%4,%1\n"
454 "1: ldq_l %2,0(%3)\n"
455 " extbl %2,%4,%0\n"
456 " mskbl %2,%4,%2\n"
457 " or %1,%2,%2\n"
458 " stq_c %2,0(%3)\n"
459 " beq %2,2f\n"
460 ".subsection 2\n"
461 "2: br 1b\n"
462 ".previous"
463 : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
464 : "r" ((long)m), "1" (val) : "memory");
447 465
466 return ret;
467}
468
469static inline unsigned long
470__xchg_u16_local(volatile short *m, unsigned long val)
471{
472 unsigned long ret, tmp, addr64;
473
474 __asm__ __volatile__(
475 " andnot %4,7,%3\n"
476 " inswl %1,%4,%1\n"
477 "1: ldq_l %2,0(%3)\n"
478 " extwl %2,%4,%0\n"
479 " mskwl %2,%4,%2\n"
480 " or %1,%2,%2\n"
481 " stq_c %2,0(%3)\n"
482 " beq %2,2f\n"
483 ".subsection 2\n"
484 "2: br 1b\n"
485 ".previous"
486 : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
487 : "r" ((long)m), "1" (val) : "memory");
488
489 return ret;
490}
491
492static inline unsigned long
493__xchg_u32_local(volatile int *m, unsigned long val)
494{
495 unsigned long dummy;
496
497 __asm__ __volatile__(
498 "1: ldl_l %0,%4\n"
499 " bis $31,%3,%1\n"
500 " stl_c %1,%2\n"
501 " beq %1,2f\n"
502 ".subsection 2\n"
503 "2: br 1b\n"
504 ".previous"
505 : "=&r" (val), "=&r" (dummy), "=m" (*m)
506 : "rI" (val), "m" (*m) : "memory");
507
508 return val;
509}
510
511static inline unsigned long
512__xchg_u64_local(volatile long *m, unsigned long val)
513{
514 unsigned long dummy;
515
516 __asm__ __volatile__(
517 "1: ldq_l %0,%4\n"
518 " bis $31,%3,%1\n"
519 " stq_c %1,%2\n"
520 " beq %1,2f\n"
521 ".subsection 2\n"
522 "2: br 1b\n"
523 ".previous"
524 : "=&r" (val), "=&r" (dummy), "=m" (*m)
525 : "rI" (val), "m" (*m) : "memory");
526
527 return val;
528}
529
530#define __xchg_local(ptr, x, size) \
531({ \
532 unsigned long __xchg__res; \
533 volatile void *__xchg__ptr = (ptr); \
534 switch (size) { \
535 case 1: __xchg__res = __xchg_u8_local(__xchg__ptr, x); break; \
536 case 2: __xchg__res = __xchg_u16_local(__xchg__ptr, x); break; \
537 case 4: __xchg__res = __xchg_u32_local(__xchg__ptr, x); break; \
538 case 8: __xchg__res = __xchg_u64_local(__xchg__ptr, x); break; \
539 default: __xchg_called_with_bad_pointer(); __xchg__res = x; \
540 } \
541 __xchg__res; \
542})
543
544#define xchg_local(ptr,x) \
545 ({ \
546 __typeof__(*(ptr)) _x_ = (x); \
547 (__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_, \
548 sizeof(*(ptr))); \
549 })
448 550
449/* 551/*
450 * Atomic compare and exchange. Compare OLD with MEM, if identical, 552 * Atomic compare and exchange. Compare OLD with MEM, if identical,
@@ -596,6 +698,128 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
596 (unsigned long)_n_, sizeof(*(ptr))); \ 698 (unsigned long)_n_, sizeof(*(ptr))); \
597 }) 699 })
598 700
701static inline unsigned long
702__cmpxchg_u8_local(volatile char *m, long old, long new)
703{
704 unsigned long prev, tmp, cmp, addr64;
705
706 __asm__ __volatile__(
707 " andnot %5,7,%4\n"
708 " insbl %1,%5,%1\n"
709 "1: ldq_l %2,0(%4)\n"
710 " extbl %2,%5,%0\n"
711 " cmpeq %0,%6,%3\n"
712 " beq %3,2f\n"
713 " mskbl %2,%5,%2\n"
714 " or %1,%2,%2\n"
715 " stq_c %2,0(%4)\n"
716 " beq %2,3f\n"
717 "2:\n"
718 ".subsection 2\n"
719 "3: br 1b\n"
720 ".previous"
721 : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
722 : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
723
724 return prev;
725}
726
727static inline unsigned long
728__cmpxchg_u16_local(volatile short *m, long old, long new)
729{
730 unsigned long prev, tmp, cmp, addr64;
731
732 __asm__ __volatile__(
733 " andnot %5,7,%4\n"
734 " inswl %1,%5,%1\n"
735 "1: ldq_l %2,0(%4)\n"
736 " extwl %2,%5,%0\n"
737 " cmpeq %0,%6,%3\n"
738 " beq %3,2f\n"
739 " mskwl %2,%5,%2\n"
740 " or %1,%2,%2\n"
741 " stq_c %2,0(%4)\n"
742 " beq %2,3f\n"
743 "2:\n"
744 ".subsection 2\n"
745 "3: br 1b\n"
746 ".previous"
747 : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
748 : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
749
750 return prev;
751}
752
753static inline unsigned long
754__cmpxchg_u32_local(volatile int *m, int old, int new)
755{
756 unsigned long prev, cmp;
757
758 __asm__ __volatile__(
759 "1: ldl_l %0,%5\n"
760 " cmpeq %0,%3,%1\n"
761 " beq %1,2f\n"
762 " mov %4,%1\n"
763 " stl_c %1,%2\n"
764 " beq %1,3f\n"
765 "2:\n"
766 ".subsection 2\n"
767 "3: br 1b\n"
768 ".previous"
769 : "=&r"(prev), "=&r"(cmp), "=m"(*m)
770 : "r"((long) old), "r"(new), "m"(*m) : "memory");
771
772 return prev;
773}
774
775static inline unsigned long
776__cmpxchg_u64_local(volatile long *m, unsigned long old, unsigned long new)
777{
778 unsigned long prev, cmp;
779
780 __asm__ __volatile__(
781 "1: ldq_l %0,%5\n"
782 " cmpeq %0,%3,%1\n"
783 " beq %1,2f\n"
784 " mov %4,%1\n"
785 " stq_c %1,%2\n"
786 " beq %1,3f\n"
787 "2:\n"
788 ".subsection 2\n"
789 "3: br 1b\n"
790 ".previous"
791 : "=&r"(prev), "=&r"(cmp), "=m"(*m)
792 : "r"((long) old), "r"(new), "m"(*m) : "memory");
793
794 return prev;
795}
796
797static __always_inline unsigned long
798__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
799 int size)
800{
801 switch (size) {
802 case 1:
803 return __cmpxchg_u8_local(ptr, old, new);
804 case 2:
805 return __cmpxchg_u16_local(ptr, old, new);
806 case 4:
807 return __cmpxchg_u32_local(ptr, old, new);
808 case 8:
809 return __cmpxchg_u64_local(ptr, old, new);
810 }
811 __cmpxchg_called_with_bad_pointer();
812 return old;
813}
814
815#define cmpxchg_local(ptr,o,n) \
816 ({ \
817 __typeof__(*(ptr)) _o_ = (o); \
818 __typeof__(*(ptr)) _n_ = (n); \
819 (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
820 (unsigned long)_n_, sizeof(*(ptr))); \
821 })
822
599#endif /* __ASSEMBLY__ */ 823#endif /* __ASSEMBLY__ */
600 824
601#define arch_align_stack(x) (x) 825#define arch_align_stack(x) (x)
diff --git a/include/asm-alpha/thread_info.h b/include/asm-alpha/thread_info.h
index 69ffd93f8e22..eeb3bef91e11 100644
--- a/include/asm-alpha/thread_info.h
+++ b/include/asm-alpha/thread_info.h
@@ -92,5 +92,27 @@ register struct thread_info *__current_thread_info __asm__("$8");
92#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \ 92#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
93 | _TIF_SYSCALL_TRACE) 93 | _TIF_SYSCALL_TRACE)
94 94
95#define ALPHA_UAC_SHIFT 6
96#define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \
97 1 << TIF_UAC_SIGBUS)
98
99#define SET_UNALIGN_CTL(task,value) ({ \
100 (task)->thread_info->flags = (((task)->thread_info->flags & \
101 ~ALPHA_UAC_MASK) \
102 | (((value) << ALPHA_UAC_SHIFT) & (1<<TIF_UAC_NOPRINT))\
103 | (((value) << (ALPHA_UAC_SHIFT + 1)) & (1<<TIF_UAC_SIGBUS)) \
104 | (((value) << (ALPHA_UAC_SHIFT - 1)) & (1<<TIF_UAC_NOFIX)));\
105 0; })
106
107#define GET_UNALIGN_CTL(task,value) ({ \
108 put_user(((task)->thread_info->flags & (1 << TIF_UAC_NOPRINT)) \
109 >> ALPHA_UAC_SHIFT \
110 | ((task)->thread_info->flags & (1 << TIF_UAC_SIGBUS)) \
111 >> (ALPHA_UAC_SHIFT + 1) \
112 | ((task)->thread_info->flags & (1 << TIF_UAC_NOFIX)) \
113 >> (ALPHA_UAC_SHIFT - 1), \
114 (int __user *)(value)); \
115 })
116
95#endif /* __KERNEL__ */ 117#endif /* __KERNEL__ */
96#endif /* _ALPHA_THREAD_INFO_H */ 118#endif /* _ALPHA_THREAD_INFO_H */
diff --git a/include/asm-arm/arch-at91/at91_adc.h b/include/asm-arm/arch-at91/at91_adc.h
new file mode 100644
index 000000000000..1ed66eaaf83a
--- /dev/null
+++ b/include/asm-arm/arch-at91/at91_adc.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-arm/arch-at91/at91_adc.h
3 *
4 * Copyright (C) SAN People
5 *
6 * Analog-to-Digital Converter (ADC) registers.
7 * Based on AT91SAM9260 datasheet revision D.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14
15#ifndef AT91_ADC_H
16#define AT91_ADC_H
17
18#define AT91_ADC_CR 0x00 /* Control Register */
19#define AT91_ADC_SWRST (1 << 0) /* Software Reset */
20#define AT91_ADC_START (1 << 1) /* Start Conversion */
21
22#define AT91_ADC_MR 0x04 /* Mode Register */
23#define AT91_ADC_TRGEN (1 << 0) /* Trigger Enable */
24#define AT91_ADC_TRGSEL (7 << 1) /* Trigger Selection */
25#define AT91_ADC_TRGSEL_TC0 (0 << 1)
26#define AT91_ADC_TRGSEL_TC1 (1 << 1)
27#define AT91_ADC_TRGSEL_TC2 (2 << 1)
28#define AT91_ADC_TRGSEL_EXTERNAL (6 << 1)
29#define AT91_ADC_LOWRES (1 << 4) /* Low Resolution */
30#define AT91_ADC_SLEEP (1 << 5) /* Sleep Mode */
31#define AT91_ADC_PRESCAL (0x3f << 8) /* Prescalar Rate Selection */
32#define AT91_ADC_PRESCAL_(x) ((x) << 8)
33#define AT91_ADC_STARTUP (0x1f << 16) /* Startup Up Time */
34#define AT91_ADC_STARTUP_(x) ((x) << 16)
35#define AT91_ADC_SHTIM (0xf << 24) /* Sample & Hold Time */
36#define AT91_ADC_SHTIM_(x) ((x) << 24)
37
38#define AT91_ADC_CHER 0x10 /* Channel Enable Register */
39#define AT91_ADC_CHDR 0x14 /* Channel Disable Register */
40#define AT91_ADC_CHSR 0x18 /* Channel Status Register */
41#define AT91_ADC_CH(n) (1 << (n)) /* Channel Number */
42
43#define AT91_ADC_SR 0x1C /* Status Register */
44#define AT91_ADC_EOC(n) (1 << (n)) /* End of Conversion on Channel N */
45#define AT91_ADC_OVRE(n) (1 << ((n) + 8))/* Overrun Error on Channel N */
46#define AT91_ADC_DRDY (1 << 16) /* Data Ready */
47#define AT91_ADC_GOVRE (1 << 17) /* General Overrun Error */
48#define AT91_ADC_ENDRX (1 << 18) /* End of RX Buffer */
49#define AT91_ADC_RXFUFF (1 << 19) /* RX Buffer Full */
50
51#define AT91_ADC_LCDR 0x20 /* Last Converted Data Register */
52#define AT91_ADC_LDATA (0x3ff)
53
54#define AT91_ADC_IER 0x24 /* Interrupt Enable Register */
55#define AT91_ADC_IDR 0x28 /* Interrupt Disable Register */
56#define AT91_ADC_IMR 0x2C /* Interrupt Mask Register */
57
58#define AT91_ADC_CHR(n) (0x30 + ((n) * 4) /* Channel Data Register N */
59#define AT91_ADC_DATA (0x3ff)
60
61#endif
diff --git a/include/asm-arm/arch-at91/board.h b/include/asm-arm/arch-at91/board.h
index 7b9903c2c447..7a34a5b1fed0 100644
--- a/include/asm-arm/arch-at91/board.h
+++ b/include/asm-arm/arch-at91/board.h
@@ -62,7 +62,7 @@ struct at91_mmc_data {
62}; 62};
63extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data); 63extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data);
64 64
65 /* Ethernet */ 65 /* Ethernet (EMAC & MACB) */
66struct at91_eth_data { 66struct at91_eth_data {
67 u8 phy_irq_pin; /* PHY IRQ */ 67 u8 phy_irq_pin; /* PHY IRQ */
68 u8 is_rmii; /* using RMII interface? */ 68 u8 is_rmii; /* using RMII interface? */
@@ -114,6 +114,16 @@ struct atmel_uart_data {
114}; 114};
115extern void __init at91_add_device_serial(void); 115extern void __init at91_add_device_serial(void);
116 116
117 /* LCD Controller */
118struct atmel_lcdfb_info;
119extern void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data);
120
121 /* AC97 */
122struct atmel_ac97_data {
123 u8 reset_pin; /* reset */
124}
125extern void __init at91_add_device_ac97(struct atmel_ac97_data *data);
126
117 /* LEDs */ 127 /* LEDs */
118extern u8 at91_leds_cpu; 128extern u8 at91_leds_cpu;
119extern u8 at91_leds_timer; 129extern u8 at91_leds_timer;
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h
index 722c5e086285..44a4001de807 100644
--- a/include/asm-arm/arch-ebsa110/io.h
+++ b/include/asm-arm/arch-ebsa110/io.h
@@ -81,4 +81,12 @@ extern void outsb(unsigned int port, const void *buf, int sz);
81extern void outsw(unsigned int port, const void *buf, int sz); 81extern void outsw(unsigned int port, const void *buf, int sz);
82extern void outsl(unsigned int port, const void *buf, int sz); 82extern void outsl(unsigned int port, const void *buf, int sz);
83 83
84/* can't support writesb atm */
85extern void writesw(void __iomem *addr, const void *data, int wordlen);
86extern void writesl(void __iomem *addr, const void *data, int longlen);
87
88/* can't support readsb atm */
89extern void readsw(const void __iomem *addr, void *data, int wordlen);
90extern void readsl(const void __iomem *addr, void *data, int longlen);
91
84#endif 92#endif
diff --git a/include/asm-arm/arch-imx/imx-regs.h b/include/asm-arm/arch-imx/imx-regs.h
index e56a4e247d62..de6494a4dc6b 100644
--- a/include/asm-arm/arch-imx/imx-regs.h
+++ b/include/asm-arm/arch-imx/imx-regs.h
@@ -477,122 +477,4 @@
477#define LCDISR_EOF (1<<1) 477#define LCDISR_EOF (1<<1)
478#define LCDISR_BOF (1<<0) 478#define LCDISR_BOF (1<<0)
479 479
480/*
481 * UART Module. Takes the UART base address as argument
482 */
483#define URXD0(x) __REG( 0x0 + (x)) /* Receiver Register */
484#define URTX0(x) __REG( 0x40 + (x)) /* Transmitter Register */
485#define UCR1(x) __REG( 0x80 + (x)) /* Control Register 1 */
486#define UCR2(x) __REG( 0x84 + (x)) /* Control Register 2 */
487#define UCR3(x) __REG( 0x88 + (x)) /* Control Register 3 */
488#define UCR4(x) __REG( 0x8c + (x)) /* Control Register 4 */
489#define UFCR(x) __REG( 0x90 + (x)) /* FIFO Control Register */
490#define USR1(x) __REG( 0x94 + (x)) /* Status Register 1 */
491#define USR2(x) __REG( 0x98 + (x)) /* Status Register 2 */
492#define UESC(x) __REG( 0x9c + (x)) /* Escape Character Register */
493#define UTIM(x) __REG( 0xa0 + (x)) /* Escape Timer Register */
494#define UBIR(x) __REG( 0xa4 + (x)) /* BRM Incremental Register */
495#define UBMR(x) __REG( 0xa8 + (x)) /* BRM Modulator Register */
496#define UBRC(x) __REG( 0xac + (x)) /* Baud Rate Count Register */
497#define BIPR1(x) __REG( 0xb0 + (x)) /* Incremental Preset Register 1 */
498#define BIPR2(x) __REG( 0xb4 + (x)) /* Incremental Preset Register 2 */
499#define BIPR3(x) __REG( 0xb8 + (x)) /* Incremental Preset Register 3 */
500#define BIPR4(x) __REG( 0xbc + (x)) /* Incremental Preset Register 4 */
501#define BMPR1(x) __REG( 0xc0 + (x)) /* BRM Modulator Register 1 */
502#define BMPR2(x) __REG( 0xc4 + (x)) /* BRM Modulator Register 2 */
503#define BMPR3(x) __REG( 0xc8 + (x)) /* BRM Modulator Register 3 */
504#define BMPR4(x) __REG( 0xcc + (x)) /* BRM Modulator Register 4 */
505#define UTS(x) __REG( 0xd0 + (x)) /* UART Test Register */
506
507/* UART Control Register Bit Fields.*/
508#define URXD_CHARRDY (1<<15)
509#define URXD_ERR (1<<14)
510#define URXD_OVRRUN (1<<13)
511#define URXD_FRMERR (1<<12)
512#define URXD_BRK (1<<11)
513#define URXD_PRERR (1<<10)
514#define UCR1_ADEN (1<<15) /* Auto dectect interrupt */
515#define UCR1_ADBR (1<<14) /* Auto detect baud rate */
516#define UCR1_TRDYEN (1<<13) /* Transmitter ready interrupt enable */
517#define UCR1_IDEN (1<<12) /* Idle condition interrupt */
518#define UCR1_RRDYEN (1<<9) /* Recv ready interrupt enable */
519#define UCR1_RDMAEN (1<<8) /* Recv ready DMA enable */
520#define UCR1_IREN (1<<7) /* Infrared interface enable */
521#define UCR1_TXMPTYEN (1<<6) /* Transimitter empty interrupt enable */
522#define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */
523#define UCR1_SNDBRK (1<<4) /* Send break */
524#define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */
525#define UCR1_UARTCLKEN (1<<2) /* UART clock enabled */
526#define UCR1_DOZE (1<<1) /* Doze */
527#define UCR1_UARTEN (1<<0) /* UART enabled */
528#define UCR2_ESCI (1<<15) /* Escape seq interrupt enable */
529#define UCR2_IRTS (1<<14) /* Ignore RTS pin */
530#define UCR2_CTSC (1<<13) /* CTS pin control */
531#define UCR2_CTS (1<<12) /* Clear to send */
532#define UCR2_ESCEN (1<<11) /* Escape enable */
533#define UCR2_PREN (1<<8) /* Parity enable */
534#define UCR2_PROE (1<<7) /* Parity odd/even */
535#define UCR2_STPB (1<<6) /* Stop */
536#define UCR2_WS (1<<5) /* Word size */
537#define UCR2_RTSEN (1<<4) /* Request to send interrupt enable */
538#define UCR2_TXEN (1<<2) /* Transmitter enabled */
539#define UCR2_RXEN (1<<1) /* Receiver enabled */
540#define UCR2_SRST (1<<0) /* SW reset */
541#define UCR3_DTREN (1<<13) /* DTR interrupt enable */
542#define UCR3_PARERREN (1<<12) /* Parity enable */
543#define UCR3_FRAERREN (1<<11) /* Frame error interrupt enable */
544#define UCR3_DSR (1<<10) /* Data set ready */
545#define UCR3_DCD (1<<9) /* Data carrier detect */
546#define UCR3_RI (1<<8) /* Ring indicator */
547#define UCR3_TIMEOUTEN (1<<7) /* Timeout interrupt enable */
548#define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */
549#define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */
550#define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */
551#define UCR3_REF25 (1<<3) /* Ref freq 25 MHz */
552#define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz */
553#define UCR3_INVT (1<<1) /* Inverted Infrared transmission */
554#define UCR3_BPEN (1<<0) /* Preset registers enable */
555#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */
556#define UCR4_INVR (1<<9) /* Inverted infrared reception */
557#define UCR4_ENIRI (1<<8) /* Serial infrared interrupt enable */
558#define UCR4_WKEN (1<<7) /* Wake interrupt enable */
559#define UCR4_REF16 (1<<6) /* Ref freq 16 MHz */
560#define UCR4_IRSC (1<<5) /* IR special case */
561#define UCR4_TCEN (1<<3) /* Transmit complete interrupt enable */
562#define UCR4_BKEN (1<<2) /* Break condition interrupt enable */
563#define UCR4_OREN (1<<1) /* Receiver overrun interrupt enable */
564#define UCR4_DREN (1<<0) /* Recv data ready interrupt enable */
565#define UFCR_RXTL_SHF 0 /* Receiver trigger level shift */
566#define UFCR_RFDIV (7<<7) /* Reference freq divider mask */
567#define UFCR_TXTL_SHF 10 /* Transmitter trigger level shift */
568#define USR1_PARITYERR (1<<15) /* Parity error interrupt flag */
569#define USR1_RTSS (1<<14) /* RTS pin status */
570#define USR1_TRDY (1<<13) /* Transmitter ready interrupt/dma flag */
571#define USR1_RTSD (1<<12) /* RTS delta */
572#define USR1_ESCF (1<<11) /* Escape seq interrupt flag */
573#define USR1_FRAMERR (1<<10) /* Frame error interrupt flag */
574#define USR1_RRDY (1<<9) /* Receiver ready interrupt/dma flag */
575#define USR1_TIMEOUT (1<<7) /* Receive timeout interrupt status */
576#define USR1_RXDS (1<<6) /* Receiver idle interrupt flag */
577#define USR1_AIRINT (1<<5) /* Async IR wake interrupt flag */
578#define USR1_AWAKE (1<<4) /* Aysnc wake interrupt flag */
579#define USR2_ADET (1<<15) /* Auto baud rate detect complete */
580#define USR2_TXFE (1<<14) /* Transmit buffer FIFO empty */
581#define USR2_DTRF (1<<13) /* DTR edge interrupt flag */
582#define USR2_IDLE (1<<12) /* Idle condition */
583#define USR2_IRINT (1<<8) /* Serial infrared interrupt flag */
584#define USR2_WAKE (1<<7) /* Wake */
585#define USR2_RTSF (1<<4) /* RTS edge interrupt flag */
586#define USR2_TXDC (1<<3) /* Transmitter complete */
587#define USR2_BRCD (1<<2) /* Break condition */
588#define USR2_ORE (1<<1) /* Overrun error */
589#define USR2_RDR (1<<0) /* Recv data ready */
590#define UTS_FRCPERR (1<<13) /* Force parity error */
591#define UTS_LOOP (1<<12) /* Loop tx and rx */
592#define UTS_TXEMPTY (1<<6) /* TxFIFO empty */
593#define UTS_RXEMPTY (1<<5) /* RxFIFO empty */
594#define UTS_TXFULL (1<<4) /* TxFIFO full */
595#define UTS_RXFULL (1<<3) /* RxFIFO full */
596#define UTS_SOFTRST (1<<0) /* Software reset */
597
598#endif // _IMX_REGS_H 480#endif // _IMX_REGS_H
diff --git a/include/asm-arm/arch-iop13xx/io.h b/include/asm-arm/arch-iop13xx/io.h
index 5a7bdb526606..7dfff4ad82b3 100644
--- a/include/asm-arm/arch-iop13xx/io.h
+++ b/include/asm-arm/arch-iop13xx/io.h
@@ -26,7 +26,6 @@
26#define __mem_isa(a) (a) 26#define __mem_isa(a) (a)
27 27
28extern void __iomem * __iop13xx_io(unsigned long io_addr); 28extern void __iomem * __iop13xx_io(unsigned long io_addr);
29extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
30extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size, 29extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size,
31 unsigned long flags); 30 unsigned long flags);
32extern void __iop13xx_iounmap(void __iomem *addr); 31extern void __iop13xx_iounmap(void __iomem *addr);
diff --git a/include/asm-arm/arch-iop13xx/iop13xx.h b/include/asm-arm/arch-iop13xx/iop13xx.h
index d26b755a9879..85707e9c3325 100644
--- a/include/asm-arm/arch-iop13xx/iop13xx.h
+++ b/include/asm-arm/arch-iop13xx/iop13xx.h
@@ -8,6 +8,7 @@ extern u32 iop13xx_atue_pmmr_offset;
8void iop13xx_init_irq(void); 8void iop13xx_init_irq(void);
9void iop13xx_map_io(void); 9void iop13xx_map_io(void);
10void iop13xx_platform_init(void); 10void iop13xx_platform_init(void);
11void iop13xx_add_tpmi_devices(void);
11void iop13xx_init_irq(void); 12void iop13xx_init_irq(void);
12 13
13/* CPUID CP6 R0 Page 0 */ 14/* CPUID CP6 R0 Page 0 */
@@ -27,19 +28,24 @@ static inline int iop13xx_cpu_id(void)
27#define IOP13XX_PCI_OFFSET IOP13XX_MAX_RAM_SIZE 28#define IOP13XX_PCI_OFFSET IOP13XX_MAX_RAM_SIZE
28 29
29/* PCI MAP 30/* PCI MAP
30 * 0x0000.0000 - 0x8000.0000 1:1 mapping with Physical RAM 31 * bus range cpu phys cpu virt note
31 * 0x8000.0000 - 0x8800.0000 PCIX/PCIE memory window (128MB) 32 * 0x0000.0000 + 2GB (n/a) (n/a) inbound, 1:1 mapping with Physical RAM
32*/ 33 * 0x8000.0000 + 928M 0x1.8000.0000 (ioremap) PCIX outbound memory window
34 * 0x8000.0000 + 928M 0x2.8000.0000 (ioremap) PCIE outbound memory window
35 *
36 * IO MAP
37 * 0x1000 + 64K 0x0.fffb.1000 0xfec6.1000 PCIX outbound i/o window
38 * 0x1000 + 64K 0x0.fffd.1000 0xfed7.1000 PCIE outbound i/o window
39 */
33#define IOP13XX_PCIX_IO_WINDOW_SIZE 0x10000UL 40#define IOP13XX_PCIX_IO_WINDOW_SIZE 0x10000UL
34#define IOP13XX_PCIX_LOWER_IO_PA 0xfffb0000UL 41#define IOP13XX_PCIX_LOWER_IO_PA 0xfffb0000UL
35#define IOP13XX_PCIX_LOWER_IO_VA 0xfec60000UL 42#define IOP13XX_PCIX_LOWER_IO_VA 0xfec60000UL
36#define IOP13XX_PCIX_LOWER_IO_BA 0x0fff0000UL 43#define IOP13XX_PCIX_LOWER_IO_BA 0x0UL /* OIOTVR */
44#define IOP13XX_PCIX_IO_BUS_OFFSET 0x1000UL
37#define IOP13XX_PCIX_UPPER_IO_PA (IOP13XX_PCIX_LOWER_IO_PA +\ 45#define IOP13XX_PCIX_UPPER_IO_PA (IOP13XX_PCIX_LOWER_IO_PA +\
38 IOP13XX_PCIX_IO_WINDOW_SIZE - 1) 46 IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
39#define IOP13XX_PCIX_UPPER_IO_VA (IOP13XX_PCIX_LOWER_IO_VA +\ 47#define IOP13XX_PCIX_UPPER_IO_VA (IOP13XX_PCIX_LOWER_IO_VA +\
40 IOP13XX_PCIX_IO_WINDOW_SIZE - 1) 48 IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
41#define IOP13XX_PCIX_IO_OFFSET (IOP13XX_PCIX_LOWER_IO_VA -\
42 IOP13XX_PCIX_LOWER_IO_BA)
43#define IOP13XX_PCIX_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ 49#define IOP13XX_PCIX_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
44 (IOP13XX_PCIX_LOWER_IO_PA\ 50 (IOP13XX_PCIX_LOWER_IO_PA\
45 - IOP13XX_PCIX_LOWER_IO_VA)) 51 - IOP13XX_PCIX_LOWER_IO_VA))
@@ -65,15 +71,14 @@ static inline int iop13xx_cpu_id(void)
65#define IOP13XX_PCIE_IO_WINDOW_SIZE 0x10000UL 71#define IOP13XX_PCIE_IO_WINDOW_SIZE 0x10000UL
66#define IOP13XX_PCIE_LOWER_IO_PA 0xfffd0000UL 72#define IOP13XX_PCIE_LOWER_IO_PA 0xfffd0000UL
67#define IOP13XX_PCIE_LOWER_IO_VA 0xfed70000UL 73#define IOP13XX_PCIE_LOWER_IO_VA 0xfed70000UL
68#define IOP13XX_PCIE_LOWER_IO_BA 0x0fff0000UL 74#define IOP13XX_PCIE_LOWER_IO_BA 0x0UL /* OIOTVR */
75#define IOP13XX_PCIE_IO_BUS_OFFSET 0x1000UL
69#define IOP13XX_PCIE_UPPER_IO_PA (IOP13XX_PCIE_LOWER_IO_PA +\ 76#define IOP13XX_PCIE_UPPER_IO_PA (IOP13XX_PCIE_LOWER_IO_PA +\
70 IOP13XX_PCIE_IO_WINDOW_SIZE - 1) 77 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
71#define IOP13XX_PCIE_UPPER_IO_VA (IOP13XX_PCIE_LOWER_IO_VA +\ 78#define IOP13XX_PCIE_UPPER_IO_VA (IOP13XX_PCIE_LOWER_IO_VA +\
72 IOP13XX_PCIE_IO_WINDOW_SIZE - 1) 79 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
73#define IOP13XX_PCIE_UPPER_IO_BA (IOP13XX_PCIE_LOWER_IO_BA +\ 80#define IOP13XX_PCIE_UPPER_IO_BA (IOP13XX_PCIE_LOWER_IO_BA +\
74 IOP13XX_PCIE_IO_WINDOW_SIZE - 1) 81 IOP13XX_PCIE_IO_WINDOW_SIZE - 1)
75#define IOP13XX_PCIE_IO_OFFSET (IOP13XX_PCIE_LOWER_IO_VA -\
76 IOP13XX_PCIE_LOWER_IO_BA)
77#define IOP13XX_PCIE_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ 82#define IOP13XX_PCIE_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
78 (IOP13XX_PCIE_LOWER_IO_PA\ 83 (IOP13XX_PCIE_LOWER_IO_PA\
79 - IOP13XX_PCIE_LOWER_IO_VA)) 84 - IOP13XX_PCIE_LOWER_IO_VA))
@@ -451,4 +456,5 @@ static inline int iop13xx_cpu_id(void)
451#define IOP13XX_PBI_BAR1 IOP13XX_PBI_OFFSET(0x10) 456#define IOP13XX_PBI_BAR1 IOP13XX_PBI_OFFSET(0x10)
452#define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14) 457#define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14)
453 458
459#define IOP13XX_PROCESSOR_FREQ IOP13XX_REG_ADDR32(0x2180)
454#endif /* _IOP13XX_HW_H_ */ 460#endif /* _IOP13XX_HW_H_ */
diff --git a/include/asm-arm/arch-iop13xx/time.h b/include/asm-arm/arch-iop13xx/time.h
index 77a837a02dec..49213d9d7cad 100644
--- a/include/asm-arm/arch-iop13xx/time.h
+++ b/include/asm-arm/arch-iop13xx/time.h
@@ -7,9 +7,65 @@
7#define IOP_TMR_PRIVILEGED 0x08 7#define IOP_TMR_PRIVILEGED 0x08
8#define IOP_TMR_RATIO_1_1 0x00 8#define IOP_TMR_RATIO_1_1 0x00
9 9
10#define IOP13XX_XSI_FREQ_RATIO_MASK (3 << 19)
11#define IOP13XX_XSI_FREQ_RATIO_2 (0 << 19)
12#define IOP13XX_XSI_FREQ_RATIO_3 (1 << 19)
13#define IOP13XX_XSI_FREQ_RATIO_4 (2 << 19)
14#define IOP13XX_CORE_FREQ_MASK (7 << 16)
15#define IOP13XX_CORE_FREQ_600 (0 << 16)
16#define IOP13XX_CORE_FREQ_667 (1 << 16)
17#define IOP13XX_CORE_FREQ_800 (2 << 16)
18#define IOP13XX_CORE_FREQ_933 (3 << 16)
19#define IOP13XX_CORE_FREQ_1000 (4 << 16)
20#define IOP13XX_CORE_FREQ_1200 (5 << 16)
21
10void iop_init_time(unsigned long tickrate); 22void iop_init_time(unsigned long tickrate);
11unsigned long iop_gettimeoffset(void); 23unsigned long iop_gettimeoffset(void);
12 24
25static inline unsigned long iop13xx_core_freq(void)
26{
27 unsigned long freq = __raw_readl(IOP13XX_PROCESSOR_FREQ);
28 freq &= IOP13XX_CORE_FREQ_MASK;
29 switch (freq) {
30 case IOP13XX_CORE_FREQ_600:
31 return 600000000;
32 case IOP13XX_CORE_FREQ_667:
33 return 667000000;
34 case IOP13XX_CORE_FREQ_800:
35 return 800000000;
36 case IOP13XX_CORE_FREQ_933:
37 return 933000000;
38 case IOP13XX_CORE_FREQ_1000:
39 return 1000000000;
40 case IOP13XX_CORE_FREQ_1200:
41 return 1200000000;
42 default:
43 printk("%s: warning unknown frequency, defaulting to 800Mhz\n",
44 __FUNCTION__);
45 }
46
47 return 800000000;
48}
49
50static inline unsigned long iop13xx_xsi_bus_ratio(void)
51{
52 unsigned long ratio = __raw_readl(IOP13XX_PROCESSOR_FREQ);
53 ratio &= IOP13XX_XSI_FREQ_RATIO_MASK;
54 switch (ratio) {
55 case IOP13XX_XSI_FREQ_RATIO_2:
56 return 2;
57 case IOP13XX_XSI_FREQ_RATIO_3:
58 return 3;
59 case IOP13XX_XSI_FREQ_RATIO_4:
60 return 4;
61 default:
62 printk("%s: warning unknown ratio, defaulting to 2\n",
63 __FUNCTION__);
64 }
65
66 return 2;
67}
68
13static inline void write_tmr0(u32 val) 69static inline void write_tmr0(u32 val)
14{ 70{
15 asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val)); 71 asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val));
diff --git a/include/asm-arm/arch-iop32x/io.h b/include/asm-arm/arch-iop32x/io.h
index 5f570a598a37..994f16af5057 100644
--- a/include/asm-arm/arch-iop32x/io.h
+++ b/include/asm-arm/arch-iop32x/io.h
@@ -13,7 +13,6 @@
13 13
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15 15
16extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
17extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size, 16extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
18 unsigned long flags); 17 unsigned long flags);
19extern void __iop3xx_iounmap(void __iomem *addr); 18extern void __iop3xx_iounmap(void __iomem *addr);
diff --git a/include/asm-arm/arch-iop32x/iop32x.h b/include/asm-arm/arch-iop32x/iop32x.h
index 2e9469047eb1..0d8af57221a1 100644
--- a/include/asm-arm/arch-iop32x/iop32x.h
+++ b/include/asm-arm/arch-iop32x/iop32x.h
@@ -24,5 +24,14 @@
24 24
25#include <asm/hardware/iop3xx.h> 25#include <asm/hardware/iop3xx.h>
26 26
27/* ATU Parameters
28 * set up a 1:1 bus to physical ram relationship
29 * w/ physical ram on top of pci in the memory map
30 */
31#define IOP32X_MAX_RAM_SIZE 0x40000000UL
32#define IOP3XX_MAX_RAM_SIZE IOP32X_MAX_RAM_SIZE
33#define IOP3XX_PCI_LOWER_MEM_BA 0x80000000
34#define IOP32X_PCI_MEM_WINDOW_SIZE 0x04000000
35#define IOP3XX_PCI_MEM_WINDOW_SIZE IOP32X_PCI_MEM_WINDOW_SIZE
27 36
28#endif 37#endif
diff --git a/include/asm-arm/arch-iop32x/memory.h b/include/asm-arm/arch-iop32x/memory.h
index 764cd3f0d416..c51072af214e 100644
--- a/include/asm-arm/arch-iop32x/memory.h
+++ b/include/asm-arm/arch-iop32x/memory.h
@@ -19,8 +19,8 @@
19 * bus_to_virt: Used to convert an address for DMA operations 19 * bus_to_virt: Used to convert an address for DMA operations
20 * to an address that the kernel can use. 20 * to an address that the kernel can use.
21 */ 21 */
22#define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP3XX_IATVR2)) | ((*IOP3XX_IABAR2) & 0xfffffff0)) 22#define __virt_to_bus(x) (__virt_to_phys(x))
23#define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP3XX_IALR2)) | ( *IOP3XX_IATVR2))) 23#define __bus_to_virt(x) (__phys_to_virt(x))
24 24
25 25
26#endif 26#endif
diff --git a/include/asm-arm/arch-iop33x/io.h b/include/asm-arm/arch-iop33x/io.h
index 1bb5071e1fa8..993f7589b29f 100644
--- a/include/asm-arm/arch-iop33x/io.h
+++ b/include/asm-arm/arch-iop33x/io.h
@@ -13,7 +13,6 @@
13 13
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15 15
16extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
17extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size, 16extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
18 unsigned long flags); 17 unsigned long flags);
19extern void __iop3xx_iounmap(void __iomem *addr); 18extern void __iop3xx_iounmap(void __iomem *addr);
diff --git a/include/asm-arm/arch-iop33x/iop33x.h b/include/asm-arm/arch-iop33x/iop33x.h
index 7ac6e93db5ff..766985b9a723 100644
--- a/include/asm-arm/arch-iop33x/iop33x.h
+++ b/include/asm-arm/arch-iop33x/iop33x.h
@@ -29,5 +29,15 @@
29#define IOP33X_UART1_PHYS (IOP3XX_PERIPHERAL_PHYS_BASE + 0x1740) 29#define IOP33X_UART1_PHYS (IOP3XX_PERIPHERAL_PHYS_BASE + 0x1740)
30#define IOP33X_UART1_VIRT (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1740) 30#define IOP33X_UART1_VIRT (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1740)
31 31
32/* ATU Parameters
33 * set up a 1:1 bus to physical ram relationship
34 * w/ pci on top of physical ram in memory map
35 */
36#define IOP33X_MAX_RAM_SIZE 0x80000000UL
37#define IOP3XX_MAX_RAM_SIZE IOP33X_MAX_RAM_SIZE
38#define IOP3XX_PCI_LOWER_MEM_BA (PHYS_OFFSET + IOP33X_MAX_RAM_SIZE)
39#define IOP33X_PCI_MEM_WINDOW_SIZE 0x08000000
40#define IOP3XX_PCI_MEM_WINDOW_SIZE IOP33X_PCI_MEM_WINDOW_SIZE
41
32 42
33#endif 43#endif
diff --git a/include/asm-arm/arch-iop33x/memory.h b/include/asm-arm/arch-iop33x/memory.h
index 0d39139b241e..c8749127d6ab 100644
--- a/include/asm-arm/arch-iop33x/memory.h
+++ b/include/asm-arm/arch-iop33x/memory.h
@@ -19,8 +19,8 @@
19 * bus_to_virt: Used to convert an address for DMA operations 19 * bus_to_virt: Used to convert an address for DMA operations
20 * to an address that the kernel can use. 20 * to an address that the kernel can use.
21 */ 21 */
22#define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP3XX_IATVR2)) | ((*IOP3XX_IABAR2) & 0xfffffff0)) 22#define __virt_to_bus(x) (__virt_to_phys(x))
23#define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP3XX_IALR2)) | ( *IOP3XX_IATVR2))) 23#define __bus_to_virt(x) (__phys_to_virt(x))
24 24
25 25
26#endif 26#endif
diff --git a/include/asm-arm/arch-ixp23xx/io.h b/include/asm-arm/arch-ixp23xx/io.h
index 18415a81ac74..66f5bafc315c 100644
--- a/include/asm-arm/arch-ixp23xx/io.h
+++ b/include/asm-arm/arch-ixp23xx/io.h
@@ -23,7 +23,7 @@
23#include <linux/kernel.h> /* For BUG */ 23#include <linux/kernel.h> /* For BUG */
24 24
25static inline void __iomem * 25static inline void __iomem *
26ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned long flags) 26ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned int mtype)
27{ 27{
28 if (addr >= IXP23XX_PCI_MEM_START && 28 if (addr >= IXP23XX_PCI_MEM_START &&
29 addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) { 29 addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) {
@@ -34,7 +34,7 @@ ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned long flags)
34 ((addr - IXP23XX_PCI_MEM_START) + IXP23XX_PCI_MEM_VIRT); 34 ((addr - IXP23XX_PCI_MEM_START) + IXP23XX_PCI_MEM_VIRT);
35 } 35 }
36 36
37 return __ioremap(addr, size, flags); 37 return __arm_ioremap(addr, size, mtype);
38} 38}
39 39
40static inline void 40static inline void
diff --git a/include/asm-arm/arch-ixp4xx/cpu.h b/include/asm-arm/arch-ixp4xx/cpu.h
new file mode 100644
index 000000000000..d2523b326c6c
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/cpu.h
@@ -0,0 +1,31 @@
1/*
2 * include/asm-arm/arch-ixp4xx/cpu.h
3 *
4 * IXP4XX cpu type detection
5 *
6 * Copyright (C) 2007 MontaVista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#ifndef __ASM_ARCH_CPU_H__
15#define __ASM_ARCH_CPU_H__
16
17extern unsigned int processor_id;
18/* Processor id value in CP15 Register 0 */
19#define IXP425_PROCESSOR_ID_VALUE 0x690541c0
20#define IXP435_PROCESSOR_ID_VALUE 0x69054040
21#define IXP465_PROCESSOR_ID_VALUE 0x69054200
22#define IXP4XX_PROCESSOR_ID_MASK 0xfffffff0
23
24#define cpu_is_ixp42x() ((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \
25 IXP425_PROCESSOR_ID_VALUE)
26#define cpu_is_ixp43x() ((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \
27 IXP435_PROCESSOR_ID_VALUE)
28#define cpu_is_ixp46x() ((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \
29 IXP465_PROCESSOR_ID_VALUE)
30
31#endif /* _ASM_ARCH_CPU_H */
diff --git a/include/asm-arm/arch-ixp4xx/dsmg600.h b/include/asm-arm/arch-ixp4xx/dsmg600.h
new file mode 100644
index 000000000000..a19605ad240d
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/dsmg600.h
@@ -0,0 +1,57 @@
1/*
2 * DSM-G600 platform specific definitions
3 *
4 * Copyright (C) 2006 Tower Technologies
5 * Author: Alessandro Zummo <a.zummo@towertech.it>
6 *
7 * based on ixdp425.h:
8 * Copyright 2004 (C) MontaVista, Software, Inc.
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13 */
14
15#ifndef __ASM_ARCH_HARDWARE_H__
16#error "Do not include this directly, instead #include <asm/hardware.h>"
17#endif
18
19#define DSMG600_SDA_PIN 5
20#define DSMG600_SCL_PIN 4
21
22/*
23 * DSMG600 PCI IRQs
24 */
25#define DSMG600_PCI_MAX_DEV 4
26#define DSMG600_PCI_IRQ_LINES 3
27
28
29/* PCI controller GPIO to IRQ pin mappings */
30#define DSMG600_PCI_INTA_PIN 11
31#define DSMG600_PCI_INTB_PIN 10
32#define DSMG600_PCI_INTC_PIN 9
33#define DSMG600_PCI_INTD_PIN 8
34#define DSMG600_PCI_INTE_PIN 7
35#define DSMG600_PCI_INTF_PIN 6
36
37/* DSM-G600 Timer Setting */
38#define DSMG600_FREQ 66000000
39
40/* Buttons */
41
42#define DSMG600_PB_GPIO 15 /* power button */
43#define DSMG600_PB_BM (1L << DSMG600_PB_GPIO)
44
45#define DSMG600_RB_GPIO 3 /* reset button */
46
47#define DSMG600_RB_IRQ IRQ_IXP4XX_GPIO3
48
49#define DSMG600_PO_GPIO 2 /* power off */
50
51/* LEDs */
52
53#define DSMG600_LED_PWR_GPIO 0
54#define DSMG600_LED_PWR_BM (1L << DSMG600_LED_PWR_GPIO)
55
56#define DSMG600_LED_WLAN_GPIO 14
57#define DSMG600_LED_WLAN_BM (1L << DSMG600_LED_WLAN_GPIO)
diff --git a/include/asm-arm/arch-ixp4xx/entry-macro.S b/include/asm-arm/arch-ixp4xx/entry-macro.S
index dadb568b7ef0..f144a005ed95 100644
--- a/include/asm-arm/arch-ixp4xx/entry-macro.S
+++ b/include/asm-arm/arch-ixp4xx/entry-macro.S
@@ -31,9 +31,9 @@
31 31
321001: 321001:
33 /* 33 /*
34 * IXP465 has an upper IRQ status register 34 * IXP465/IXP435 has an upper IRQ status register
35 */ 35 */
36#if defined(CONFIG_CPU_IXP46X) 36#if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X)
37 ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET) 37 ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET)
38 ldr \irqstat, [\irqstat] @ get upper interrupts 38 ldr \irqstat, [\irqstat] @ get upper interrupts
39 mov \irqnr, #63 39 mov \irqnr, #63
diff --git a/include/asm-arm/arch-ixp4xx/gpio.h b/include/asm-arm/arch-ixp4xx/gpio.h
new file mode 100644
index 000000000000..3a4c5b8ae9e1
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/gpio.h
@@ -0,0 +1,73 @@
1/*
2 * linux/include/asm-arm/arch-ixp4xx/gpio.h
3 *
4 * IXP4XX GPIO wrappers for arch-neutral GPIO calls
5 *
6 * Written by Milan Svoboda <msvoboda@ra.rockwell.com>
7 * Based on PXA implementation by Philipp Zabel <philipp.zabel@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#ifndef __ASM_ARCH_IXP4XX_GPIO_H
26#define __ASM_ARCH_IXP4XX_GPIO_H
27
28#include <asm/hardware.h>
29
30static inline int gpio_request(unsigned gpio, const char *label)
31{
32 return 0;
33}
34
35static inline void gpio_free(unsigned gpio)
36{
37 return;
38}
39
40static inline int gpio_direction_input(unsigned gpio)
41{
42 gpio_line_config(gpio, IXP4XX_GPIO_IN);
43 return 0;
44}
45
46static inline int gpio_direction_output(unsigned gpio, int level)
47{
48 gpio_line_set(gpio, level);
49 gpio_line_config(gpio, IXP4XX_GPIO_OUT);
50 return 0;
51}
52
53static inline int gpio_get_value(unsigned gpio)
54{
55 int value;
56
57 gpio_line_get(gpio, &value);
58
59 return value;
60}
61
62static inline void gpio_set_value(unsigned gpio, int value)
63{
64 gpio_line_set(gpio, value);
65}
66
67#include <asm-generic/gpio.h> /* cansleep wrappers */
68
69extern int gpio_to_irq(int gpio);
70extern int irq_to_gpio(int gpio);
71
72#endif
73
diff --git a/include/asm-arm/arch-ixp4xx/hardware.h b/include/asm-arm/arch-ixp4xx/hardware.h
index 88fd0877dcc1..297ceda08b61 100644
--- a/include/asm-arm/arch-ixp4xx/hardware.h
+++ b/include/asm-arm/arch-ixp4xx/hardware.h
@@ -17,8 +17,8 @@
17#ifndef __ASM_ARCH_HARDWARE_H__ 17#ifndef __ASM_ARCH_HARDWARE_H__
18#define __ASM_ARCH_HARDWARE_H__ 18#define __ASM_ARCH_HARDWARE_H__
19 19
20#define PCIBIOS_MIN_IO 0x00001000 20#define PCIBIOS_MIN_IO 0x00001000
21#define PCIBIOS_MIN_MEM 0x48000000 21#define PCIBIOS_MIN_MEM (cpu_is_ixp43x() ? 0x40000000 : 0x48000000)
22 22
23/* 23/*
24 * We override the standard dma-mask routines for bouncing. 24 * We override the standard dma-mask routines for bouncing.
@@ -27,11 +27,8 @@
27 27
28#define pcibios_assign_all_busses() 1 28#define pcibios_assign_all_busses() 1
29 29
30#if defined(CONFIG_CPU_IXP46X) && !defined(__ASSEMBLY__) 30#ifndef __ASSEMBLER__
31extern unsigned int processor_id; 31#include <asm/arch/cpu.h>
32#define cpu_is_ixp465() ((processor_id & 0xffffffc0) == 0x69054200)
33#else
34#define cpu_is_ixp465() (0)
35#endif 32#endif
36 33
37/* Register locations and bits */ 34/* Register locations and bits */
@@ -47,5 +44,6 @@ extern unsigned int processor_id;
47#include "prpmc1100.h" 44#include "prpmc1100.h"
48#include "nslu2.h" 45#include "nslu2.h"
49#include "nas100d.h" 46#include "nas100d.h"
47#include "dsmg600.h"
50 48
51#endif /* _ASM_ARCH_HARDWARE_H */ 49#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h
index a41ba229c564..c72f9d79417c 100644
--- a/include/asm-arm/arch-ixp4xx/io.h
+++ b/include/asm-arm/arch-ixp4xx/io.h
@@ -59,10 +59,10 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
59 * fallback to the default. 59 * fallback to the default.
60 */ 60 */
61static inline void __iomem * 61static inline void __iomem *
62__ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags) 62__ixp4xx_ioremap(unsigned long addr, size_t size, unsigned int mtype)
63{ 63{
64 if((addr < 0x48000000) || (addr > 0x4fffffff)) 64 if((addr < PCIBIOS_MIN_MEM) || (addr > 0x4fffffff))
65 return __ioremap(addr, size, flags); 65 return __arm_ioremap(addr, size, mtype);
66 66
67 return (void *)addr; 67 return (void *)addr;
68} 68}
diff --git a/include/asm-arm/arch-ixp4xx/irqs.h b/include/asm-arm/arch-ixp4xx/irqs.h
index e44a563d00ff..11801605047b 100644
--- a/include/asm-arm/arch-ixp4xx/irqs.h
+++ b/include/asm-arm/arch-ixp4xx/irqs.h
@@ -62,10 +62,10 @@
62/* 62/*
63 * Only first 32 sources are valid if running on IXP42x systems 63 * Only first 32 sources are valid if running on IXP42x systems
64 */ 64 */
65#ifndef CONFIG_CPU_IXP46X 65#if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X)
66#define NR_IRQS 32
67#else
68#define NR_IRQS 64 66#define NR_IRQS 64
67#else
68#define NR_IRQS 32
69#endif 69#endif
70 70
71#define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU) 71#define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU)
@@ -118,4 +118,14 @@
118#define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8 118#define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8
119#define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7 119#define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7
120 120
121/*
122 * D-Link DSM-G600 RevA board IRQs
123 */
124#define IRQ_DSMG600_PCI_INTA IRQ_IXP4XX_GPIO11
125#define IRQ_DSMG600_PCI_INTB IRQ_IXP4XX_GPIO10
126#define IRQ_DSMG600_PCI_INTC IRQ_IXP4XX_GPIO9
127#define IRQ_DSMG600_PCI_INTD IRQ_IXP4XX_GPIO8
128#define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7
129#define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6
130
121#endif 131#endif
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
index ed35e5c94f40..5d949d763a91 100644
--- a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
+++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
@@ -607,19 +607,4 @@
607 607
608#define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ 608#define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */
609 609
610#ifndef __ASSEMBLY__
611static inline int cpu_is_ixp46x(void)
612{
613#ifdef CONFIG_CPU_IXP46X
614 unsigned int processor_id;
615
616 asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :);
617
618 if ((processor_id & 0xffffff00) == 0x69054200)
619 return 1;
620#endif
621 return 0;
622}
623#endif
624
625#endif 610#endif
diff --git a/include/asm-arm/arch-netx/netx-regs.h b/include/asm-arm/arch-netx/netx-regs.h
index 8ab45bea83ca..fc9aa21f360c 100644
--- a/include/asm-arm/arch-netx/netx-regs.h
+++ b/include/asm-arm/arch-netx/netx-regs.h
@@ -121,8 +121,8 @@
121#define NETX_SYSTEM_IOC_MR NETX_SYSTEM_REG(0x08) 121#define NETX_SYSTEM_IOC_MR NETX_SYSTEM_REG(0x08)
122 122
123/* FIXME: Docs are not consistent */ 123/* FIXME: Docs are not consistent */
124#define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x08) 124/* #define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x08) */
125/* #define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x0c) */ 125#define NETX_SYSTEM_RES_CR NETX_SYSTEM_REG(0x0c)
126 126
127#define NETX_SYSTEM_PHY_CONTROL NETX_SYSTEM_REG(0x10) 127#define NETX_SYSTEM_PHY_CONTROL NETX_SYSTEM_REG(0x10)
128#define NETX_SYSTEM_REV NETX_SYSTEM_REG(0x34) 128#define NETX_SYSTEM_REV NETX_SYSTEM_REG(0x34)
diff --git a/include/asm-arm/arch-ns9xxx/board.h b/include/asm-arm/arch-ns9xxx/board.h
index 91dc8fb1027f..716f34fdb716 100644
--- a/include/asm-arm/arch-ns9xxx/board.h
+++ b/include/asm-arm/arch-ns9xxx/board.h
@@ -15,4 +15,6 @@
15 15
16#define board_is_a9m9750dev() (machine_is_cc9p9360dev()) 16#define board_is_a9m9750dev() (machine_is_cc9p9360dev())
17 17
18#define board_is_jscc9p9360() (machine_is_cc9p9360js())
19
18#endif /* ifndef __ASM_ARCH_BOARD_H */ 20#endif /* ifndef __ASM_ARCH_BOARD_H */
diff --git a/include/asm-arm/arch-ns9xxx/clock.h b/include/asm-arm/arch-ns9xxx/clock.h
index a7c5ab3d9011..bf30cbdcc2bf 100644
--- a/include/asm-arm/arch-ns9xxx/clock.h
+++ b/include/asm-arm/arch-ns9xxx/clock.h
@@ -11,13 +11,43 @@
11#ifndef __ASM_ARCH_CLOCK_H 11#ifndef __ASM_ARCH_CLOCK_H
12#define __ASM_ARCH_CLOCK_H 12#define __ASM_ARCH_CLOCK_H
13 13
14#include <asm/arch-ns9xxx/regs-sys.h>
15
16#define CRYSTAL 29491200 /* Hz */
17
18/* The HRM calls this value f_vco */
14static inline u32 ns9xxx_systemclock(void) __attribute__((const)); 19static inline u32 ns9xxx_systemclock(void) __attribute__((const));
15static inline u32 ns9xxx_systemclock(void) 20static inline u32 ns9xxx_systemclock(void)
16{ 21{
22 u32 pll = SYS_PLL;
23
17 /* 24 /*
18 * This should be a multiple of HZ * TIMERCLOCKSELECT (in time.c) 25 * The system clock should be a multiple of HZ * TIMERCLOCKSELECT (in
26 * time.c).
27 *
28 * The following values are given:
29 * - TIMERCLOCKSELECT == 2^i for an i in {0 .. 6}
30 * - CRYSTAL == 29491200 == 2^17 * 3^2 * 5^2
31 * - ND in {0 .. 31}
32 * - FS in {0 .. 3}
33 *
34 * Assuming the worst, we consider:
35 * - TIMERCLOCKSELECT == 64
36 * - ND == 0
37 * - FS == 3
38 *
39 * So HZ should be a divisor of:
40 * (CRYSTAL * (ND + 1) >> FS) / TIMERCLOCKSELECT
41 * == (2^17 * 3^2 * 5^2 * 1 >> 3) / 64
42 * == 2^8 * 3^2 * 5^2
43 * == 57600
44 *
45 * Currently HZ is defined to be 100 for this platform.
46 *
47 * Fine.
19 */ 48 */
20 return 353894400; 49 return CRYSTAL * (REGGET(pll, SYS_PLL, ND) + 1)
50 >> REGGET(pll, SYS_PLL, FS);
21} 51}
22 52
23static inline u32 ns9xxx_cpuclock(void) __attribute__((const)); 53static inline u32 ns9xxx_cpuclock(void) __attribute__((const));
diff --git a/include/asm-arm/arch-ns9xxx/hardware.h b/include/asm-arm/arch-ns9xxx/hardware.h
index 6819da7c48d4..25600554c4fe 100644
--- a/include/asm-arm/arch-ns9xxx/hardware.h
+++ b/include/asm-arm/arch-ns9xxx/hardware.h
@@ -51,8 +51,9 @@
51 ~(__REGVAL(reg ## _ ## field, value)))) \ 51 ~(__REGVAL(reg ## _ ## field, value)))) \
52 | (__REGVAL(reg ## _ ## field, value)))) 52 | (__REGVAL(reg ## _ ## field, value))))
53 53
54# define REGGET(reg, field) \ 54# define REGGET(var, reg, field) \
55 ((reg & (reg ## _ ## field)) / (field & (-field))) 55 ((var & (reg ## _ ## field)) / \
56 ((reg ## _ ## field) & (-(reg ## _ ## field))))
56 57
57#else 58#else
58 59
diff --git a/include/asm-arm/arch-ns9xxx/processor.h b/include/asm-arm/arch-ns9xxx/processor.h
index 716c106ac0bf..223e51b8e104 100644
--- a/include/asm-arm/arch-ns9xxx/processor.h
+++ b/include/asm-arm/arch-ns9xxx/processor.h
@@ -13,6 +13,7 @@
13 13
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15 15
16#define processor_is_ns9360() (machine_is_cc9p9360dev()) 16#define processor_is_ns9360() (machine_is_cc9p9360dev() \
17 || machine_is_cc9p9360js())
17 18
18#endif /* ifndef __ASM_ARCH_PROCESSOR_H */ 19#endif /* ifndef __ASM_ARCH_PROCESSOR_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys.h b/include/asm-arm/arch-ns9xxx/regs-sys.h
index 8162a50bb273..a42546aeb92a 100644
--- a/include/asm-arm/arch-ns9xxx/regs-sys.h
+++ b/include/asm-arm/arch-ns9xxx/regs-sys.h
@@ -48,6 +48,12 @@
48/* PLL Configuration register */ 48/* PLL Configuration register */
49#define SYS_PLL __REG(0xa0900188) 49#define SYS_PLL __REG(0xa0900188)
50 50
51/* PLL FS status */
52#define SYS_PLL_FS __REGBITS(24, 23)
53
54/* PLL ND status */
55#define SYS_PLL_ND __REGBITS(20, 16)
56
51/* PLL Configuration register: PLL SW change */ 57/* PLL Configuration register: PLL SW change */
52#define SYS_PLL_SWC __REGBIT(15) 58#define SYS_PLL_SWC __REGBIT(15)
53#define SYS_PLL_SWC_NO __REGVAL(SYS_PLL_SWC, 0) 59#define SYS_PLL_SWC_NO __REGVAL(SYS_PLL_SWC, 0)
diff --git a/include/asm-arm/arch-pxa/i2c.h b/include/asm-arm/arch-pxa/i2c.h
index 46ec2243974a..e404b233d8a8 100644
--- a/include/asm-arm/arch-pxa/i2c.h
+++ b/include/asm-arm/arch-pxa/i2c.h
@@ -64,6 +64,7 @@ struct i2c_slave_client;
64struct i2c_pxa_platform_data { 64struct i2c_pxa_platform_data {
65 unsigned int slave_addr; 65 unsigned int slave_addr;
66 struct i2c_slave_client *slave; 66 struct i2c_slave_client *slave;
67 unsigned int class;
67}; 68};
68 69
69extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info); 70extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info);
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 139c9d954818..dbcc9298b0c8 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1801,35 +1801,35 @@
1801#define CCCR_M_MASK 0x0060 /* Memory Frequency to Run Mode Frequency Multiplier */ 1801#define CCCR_M_MASK 0x0060 /* Memory Frequency to Run Mode Frequency Multiplier */
1802#define CCCR_L_MASK 0x001f /* Crystal Frequency to Memory Frequency Multiplier */ 1802#define CCCR_L_MASK 0x001f /* Crystal Frequency to Memory Frequency Multiplier */
1803 1803
1804#define CKEN24_CAMERA (1 << 24) /* Camera Interface Clock Enable */ 1804#define CKEN_CAMERA (24) /* Camera Interface Clock Enable */
1805#define CKEN23_SSP1 (1 << 23) /* SSP1 Unit Clock Enable */ 1805#define CKEN_SSP1 (23) /* SSP1 Unit Clock Enable */
1806#define CKEN22_MEMC (1 << 22) /* Memory Controller Clock Enable */ 1806#define CKEN_MEMC (22) /* Memory Controller Clock Enable */
1807#define CKEN21_MEMSTK (1 << 21) /* Memory Stick Host Controller */ 1807#define CKEN_MEMSTK (21) /* Memory Stick Host Controller */
1808#define CKEN20_IM (1 << 20) /* Internal Memory Clock Enable */ 1808#define CKEN_IM (20) /* Internal Memory Clock Enable */
1809#define CKEN19_KEYPAD (1 << 19) /* Keypad Interface Clock Enable */ 1809#define CKEN_KEYPAD (19) /* Keypad Interface Clock Enable */
1810#define CKEN18_USIM (1 << 18) /* USIM Unit Clock Enable */ 1810#define CKEN_USIM (18) /* USIM Unit Clock Enable */
1811#define CKEN17_MSL (1 << 17) /* MSL Unit Clock Enable */ 1811#define CKEN_MSL (17) /* MSL Unit Clock Enable */
1812#define CKEN16_LCD (1 << 16) /* LCD Unit Clock Enable */ 1812#define CKEN_LCD (16) /* LCD Unit Clock Enable */
1813#define CKEN15_PWRI2C (1 << 15) /* PWR I2C Unit Clock Enable */ 1813#define CKEN_PWRI2C (15) /* PWR I2C Unit Clock Enable */
1814#define CKEN14_I2C (1 << 14) /* I2C Unit Clock Enable */ 1814#define CKEN_I2C (14) /* I2C Unit Clock Enable */
1815#define CKEN13_FICP (1 << 13) /* FICP Unit Clock Enable */ 1815#define CKEN_FICP (13) /* FICP Unit Clock Enable */
1816#define CKEN12_MMC (1 << 12) /* MMC Unit Clock Enable */ 1816#define CKEN_MMC (12) /* MMC Unit Clock Enable */
1817#define CKEN11_USB (1 << 11) /* USB Unit Clock Enable */ 1817#define CKEN_USB (11) /* USB Unit Clock Enable */
1818#define CKEN10_ASSP (1 << 10) /* ASSP (SSP3) Clock Enable */ 1818#define CKEN_ASSP (10) /* ASSP (SSP3) Clock Enable */
1819#define CKEN10_USBHOST (1 << 10) /* USB Host Unit Clock Enable */ 1819#define CKEN_USBHOST (10) /* USB Host Unit Clock Enable */
1820#define CKEN9_OSTIMER (1 << 9) /* OS Timer Unit Clock Enable */ 1820#define CKEN_OSTIMER (9) /* OS Timer Unit Clock Enable */
1821#define CKEN9_NSSP (1 << 9) /* NSSP (SSP2) Clock Enable */ 1821#define CKEN_NSSP (9) /* NSSP (SSP2) Clock Enable */
1822#define CKEN8_I2S (1 << 8) /* I2S Unit Clock Enable */ 1822#define CKEN_I2S (8) /* I2S Unit Clock Enable */
1823#define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */ 1823#define CKEN_BTUART (7) /* BTUART Unit Clock Enable */
1824#define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */ 1824#define CKEN_FFUART (6) /* FFUART Unit Clock Enable */
1825#define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */ 1825#define CKEN_STUART (5) /* STUART Unit Clock Enable */
1826#define CKEN4_HWUART (1 << 4) /* HWUART Unit Clock Enable */ 1826#define CKEN_HWUART (4) /* HWUART Unit Clock Enable */
1827#define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */ 1827#define CKEN_SSP3 (4) /* SSP3 Unit Clock Enable */
1828#define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */ 1828#define CKEN_SSP (3) /* SSP Unit Clock Enable */
1829#define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */ 1829#define CKEN_SSP2 (3) /* SSP2 Unit Clock Enable */
1830#define CKEN2_AC97 (1 << 2) /* AC97 Unit Clock Enable */ 1830#define CKEN_AC97 (2) /* AC97 Unit Clock Enable */
1831#define CKEN1_PWM1 (1 << 1) /* PWM1 Clock Enable */ 1831#define CKEN_PWM1 (1) /* PWM1 Clock Enable */
1832#define CKEN0_PWM0 (1 << 0) /* PWM0 Clock Enable */ 1832#define CKEN_PWM0 (0) /* PWM0 Clock Enable */
1833 1833
1834#define OSCC_OON (1 << 1) /* 32.768kHz OON (write-once only bit) */ 1834#define OSCC_OON (1 << 1) /* 32.768kHz OON (write-once only bit) */
1835#define OSCC_OOK (1 << 0) /* 32.768kHz OOK (read-only bit) */ 1835#define OSCC_OOK (1 << 0) /* 32.768kHz OOK (read-only bit) */
diff --git a/include/asm-arm/arch-s3c2410/regs-ac97.h b/include/asm-arm/arch-s3c2410/regs-ac97.h
index bdd6a4f93d7f..b004dee6bcaf 100644
--- a/include/asm-arm/arch-s3c2410/regs-ac97.h
+++ b/include/asm-arm/arch-s3c2410/regs-ac97.h
@@ -13,11 +13,55 @@
13#ifndef __ASM_ARCH_REGS_AC97_H 13#ifndef __ASM_ARCH_REGS_AC97_H
14#define __ASM_ARCH_REGS_AC97_H __FILE__ 14#define __ASM_ARCH_REGS_AC97_H __FILE__
15 15
16#define S3C_AC97_GLBCTRL (0x00) 16#define S3C_AC97_GLBCTRL (0x00)
17#define S3C_AC97_GLBSTAT (0x04) 17
18#define S3C_AC97_CODEC_CMD (0x08) 18#define S3C_AC97_GLBCTRL_CODECREADYIE (1<<22)
19#define S3C_AC97_PCM_ADDR (0x10) 19#define S3C_AC97_GLBCTRL_PCMOUTURIE (1<<21)
20#define S3C_AC97_PCM_DATA (0x18) 20#define S3C_AC97_GLBCTRL_PCMINORIE (1<<20)
21#define S3C_AC97_MIC_DATA (0x1C) 21#define S3C_AC97_GLBCTRL_MICINORIE (1<<19)
22#define S3C_AC97_GLBCTRL_PCMOUTTIE (1<<18)
23#define S3C_AC97_GLBCTRL_PCMINTIE (1<<17)
24#define S3C_AC97_GLBCTRL_MICINTIE (1<<16)
25#define S3C_AC97_GLBCTRL_PCMOUTTM_OFF (0<<12)
26#define S3C_AC97_GLBCTRL_PCMOUTTM_PIO (1<<12)
27#define S3C_AC97_GLBCTRL_PCMOUTTM_DMA (2<<12)
28#define S3C_AC97_GLBCTRL_PCMOUTTM_MASK (3<<12)
29#define S3C_AC97_GLBCTRL_PCMINTM_OFF (0<<10)
30#define S3C_AC97_GLBCTRL_PCMINTM_PIO (1<<10)
31#define S3C_AC97_GLBCTRL_PCMINTM_DMA (2<<10)
32#define S3C_AC97_GLBCTRL_PCMINTM_MASK (3<<10)
33#define S3C_AC97_GLBCTRL_MICINTM_OFF (0<<8)
34#define S3C_AC97_GLBCTRL_MICINTM_PIO (1<<8)
35#define S3C_AC97_GLBCTRL_MICINTM_DMA (2<<8)
36#define S3C_AC97_GLBCTRL_MICINTM_MASK (3<<8)
37#define S3C_AC97_GLBCTRL_TRANSFERDATAENABLE (1<<3)
38#define S3C_AC97_GLBCTRL_ACLINKON (1<<2)
39#define S3C_AC97_GLBCTRL_WARMRESET (1<<1)
40#define S3C_AC97_GLBCTRL_COLDRESET (1<<0)
41
42#define S3C_AC97_GLBSTAT (0x04)
43
44#define S3C_AC97_GLBSTAT_CODECREADY (1<<22)
45#define S3C_AC97_GLBSTAT_PCMOUTUR (1<<21)
46#define S3C_AC97_GLBSTAT_PCMINORI (1<<20)
47#define S3C_AC97_GLBSTAT_MICINORI (1<<19)
48#define S3C_AC97_GLBSTAT_PCMOUTTI (1<<18)
49#define S3C_AC97_GLBSTAT_PCMINTI (1<<17)
50#define S3C_AC97_GLBSTAT_MICINTI (1<<16)
51#define S3C_AC97_GLBSTAT_MAINSTATE_IDLE (0<<0)
52#define S3C_AC97_GLBSTAT_MAINSTATE_INIT (1<<0)
53#define S3C_AC97_GLBSTAT_MAINSTATE_READY (2<<0)
54#define S3C_AC97_GLBSTAT_MAINSTATE_ACTIVE (3<<0)
55#define S3C_AC97_GLBSTAT_MAINSTATE_LP (4<<0)
56#define S3C_AC97_GLBSTAT_MAINSTATE_WARM (5<<0)
57
58#define S3C_AC97_CODEC_CMD (0x08)
59
60#define S3C_AC97_CODEC_CMD_READ (1<<23)
61
62#define S3C_AC97_STAT (0x0c)
63#define S3C_AC97_PCM_ADDR (0x10)
64#define S3C_AC97_PCM_DATA (0x18)
65#define S3C_AC97_MIC_DATA (0x1C)
22 66
23#endif /* __ASM_ARCH_REGS_AC97_H */ 67#endif /* __ASM_ARCH_REGS_AC97_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-udc.h b/include/asm-arm/arch-s3c2410/regs-udc.h
index 3c8354619b60..e1e9805d2d9a 100644
--- a/include/asm-arm/arch-s3c2410/regs-udc.h
+++ b/include/asm-arm/arch-s3c2410/regs-udc.h
@@ -75,7 +75,7 @@
75#define S3C2410_UDC_OUT_FIFO_CNT1_REG S3C2410_USBDREG(0x0198) 75#define S3C2410_UDC_OUT_FIFO_CNT1_REG S3C2410_USBDREG(0x0198)
76#define S3C2410_UDC_OUT_FIFO_CNT2_REG S3C2410_USBDREG(0x019c) 76#define S3C2410_UDC_OUT_FIFO_CNT2_REG S3C2410_USBDREG(0x019c)
77 77
78 78#define S3C2410_UDC_FUNCADDR_UPDATE (1<<7)
79 79
80#define S3C2410_UDC_PWR_ISOUP (1<<7) // R/W 80#define S3C2410_UDC_PWR_ISOUP (1<<7) // R/W
81#define S3C2410_UDC_PWR_RESET (1<<3) // R 81#define S3C2410_UDC_PWR_RESET (1<<3) // R
@@ -135,10 +135,6 @@
135#define S3C2410_UDC_OCSR2_ISO (1<<6) // R/W 135#define S3C2410_UDC_OCSR2_ISO (1<<6) // R/W
136#define S3C2410_UDC_OCSR2_DMAIEN (1<<5) // R/W 136#define S3C2410_UDC_OCSR2_DMAIEN (1<<5) // R/W
137 137
138#define S3C2410_UDC_SETIX(base,x) \
139 writel(S3C2410_UDC_INDEX_ ## x, base+S3C2410_UDC_INDEX_REG);
140
141
142#define S3C2410_UDC_EP0_CSR_OPKRDY (1<<0) 138#define S3C2410_UDC_EP0_CSR_OPKRDY (1<<0)
143#define S3C2410_UDC_EP0_CSR_IPKRDY (1<<1) 139#define S3C2410_UDC_EP0_CSR_IPKRDY (1<<1)
144#define S3C2410_UDC_EP0_CSR_SENTSTL (1<<2) 140#define S3C2410_UDC_EP0_CSR_SENTSTL (1<<2)
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index f266c2795124..3b59f94b5a3d 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -12,6 +12,7 @@
12#define __ASM_ARM_ATOMIC_H 12#define __ASM_ARM_ATOMIC_H
13 13
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <asm/system.h>
15 16
16typedef struct { volatile int counter; } atomic_t; 17typedef struct { volatile int counter; } atomic_t;
17 18
diff --git a/include/asm-arm/ecard.h b/include/asm-arm/ecard.h
index a0ae2b954d29..3a6d3eb27622 100644
--- a/include/asm-arm/ecard.h
+++ b/include/asm-arm/ecard.h
@@ -160,6 +160,7 @@ struct expansion_card {
160 unsigned char irqmask; /* IRQ mask */ 160 unsigned char irqmask; /* IRQ mask */
161 unsigned char fiqmask; /* FIQ mask */ 161 unsigned char fiqmask; /* FIQ mask */
162 unsigned char claimed; /* Card claimed? */ 162 unsigned char claimed; /* Card claimed? */
163 unsigned char easi; /* EASI card */
163 164
164 void *irq_data; /* Data for use for IRQ by card */ 165 void *irq_data; /* Data for use for IRQ by card */
165 void *fiq_data; /* Data for use for FIQ by card */ 166 void *fiq_data; /* Data for use for FIQ by card */
@@ -169,7 +170,6 @@ struct expansion_card {
169 CONST unsigned int dma; /* DMA number (for request_dma) */ 170 CONST unsigned int dma; /* DMA number (for request_dma) */
170 CONST unsigned int irq; /* IRQ number (for request_irq) */ 171 CONST unsigned int irq; /* IRQ number (for request_irq) */
171 CONST unsigned int fiq; /* FIQ number (for request_irq) */ 172 CONST unsigned int fiq; /* FIQ number (for request_irq) */
172 CONST card_type_t type; /* Type of card */
173 CONST struct in_ecid cid; /* Card Identification */ 173 CONST struct in_ecid cid; /* Card Identification */
174 174
175 /* Private internal data */ 175 /* Private internal data */
@@ -224,56 +224,6 @@ ecard_address(struct expansion_card *ec, card_type_t type, card_speed_t speed)
224extern int ecard_request_resources(struct expansion_card *ec); 224extern int ecard_request_resources(struct expansion_card *ec);
225extern void ecard_release_resources(struct expansion_card *ec); 225extern void ecard_release_resources(struct expansion_card *ec);
226 226
227#ifdef ECARD_C
228/* Definitions internal to ecard.c - for it's use only!!
229 *
230 * External expansion card header as read from the card
231 */
232struct ex_ecid {
233 unsigned char r_irq:1;
234 unsigned char r_zero:1;
235 unsigned char r_fiq:1;
236 unsigned char r_id:4;
237 unsigned char r_a:1;
238
239 unsigned char r_cd:1;
240 unsigned char r_is:1;
241 unsigned char r_w:2;
242 unsigned char r_r1:4;
243
244 unsigned char r_r2:8;
245
246 unsigned char r_prod[2];
247
248 unsigned char r_manu[2];
249
250 unsigned char r_country;
251
252 unsigned char r_fiqmask;
253 unsigned char r_fiqoff[3];
254
255 unsigned char r_irqmask;
256 unsigned char r_irqoff[3];
257};
258
259/*
260 * Chunk directory entry as read from the card
261 */
262struct ex_chunk_dir {
263 unsigned char r_id;
264 unsigned char r_len[3];
265 unsigned long r_start;
266 union {
267 char string[256];
268 char data[1];
269 } d;
270#define c_id(x) ((x)->r_id)
271#define c_len(x) ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
272#define c_start(x) ((x)->r_start)
273};
274
275#endif
276
277extern struct bus_type ecard_bus_type; 227extern struct bus_type ecard_bus_type;
278 228
279#define ECARD_DEV(_d) container_of((_d), struct expansion_card, dev) 229#define ECARD_DEV(_d) container_of((_d), struct expansion_card, dev)
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
index 15141a9caca8..63feceb7ede5 100644
--- a/include/asm-arm/hardware/iop3xx.h
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -28,6 +28,7 @@
28extern void gpio_line_config(int line, int direction); 28extern void gpio_line_config(int line, int direction);
29extern int gpio_line_get(int line); 29extern int gpio_line_get(int line);
30extern void gpio_line_set(int line, int value); 30extern void gpio_line_set(int line, int value);
31extern int init_atu;
31#endif 32#endif
32 33
33 34
@@ -41,7 +42,7 @@ extern void gpio_line_set(int line, int value);
41 IOP3XX_PERIPHERAL_SIZE - 1) 42 IOP3XX_PERIPHERAL_SIZE - 1)
42#define IOP3XX_PERIPHERAL_UPPER_VA (IOP3XX_PERIPHERAL_VIRT_BASE +\ 43#define IOP3XX_PERIPHERAL_UPPER_VA (IOP3XX_PERIPHERAL_VIRT_BASE +\
43 IOP3XX_PERIPHERAL_SIZE - 1) 44 IOP3XX_PERIPHERAL_SIZE - 1)
44#define IOP3XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\ 45#define IOP3XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) (addr) -\
45 (IOP3XX_PERIPHERAL_PHYS_BASE\ 46 (IOP3XX_PERIPHERAL_PHYS_BASE\
46 - IOP3XX_PERIPHERAL_VIRT_BASE)) 47 - IOP3XX_PERIPHERAL_VIRT_BASE))
47#define IOP3XX_REG_ADDR(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + (reg)) 48#define IOP3XX_REG_ADDR(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + (reg))
@@ -103,6 +104,21 @@ extern void gpio_line_set(int line, int value);
103#define IOP3XX_PCIXCMD (volatile u16 *)IOP3XX_REG_ADDR(0x01e2) 104#define IOP3XX_PCIXCMD (volatile u16 *)IOP3XX_REG_ADDR(0x01e2)
104#define IOP3XX_PCIXSR (volatile u32 *)IOP3XX_REG_ADDR(0x01e4) 105#define IOP3XX_PCIXSR (volatile u32 *)IOP3XX_REG_ADDR(0x01e4)
105#define IOP3XX_PCIIRSR (volatile u32 *)IOP3XX_REG_ADDR(0x01ec) 106#define IOP3XX_PCIIRSR (volatile u32 *)IOP3XX_REG_ADDR(0x01ec)
107#define IOP3XX_PCSR_OUT_Q_BUSY (1 << 15)
108#define IOP3XX_PCSR_IN_Q_BUSY (1 << 14)
109#define IOP3XX_ATUCR_OUT_EN (1 << 1)
110
111#define IOP3XX_INIT_ATU_DEFAULT 0
112#define IOP3XX_INIT_ATU_DISABLE -1
113#define IOP3XX_INIT_ATU_ENABLE 1
114
115#ifdef CONFIG_IOP3XX_ATU
116#define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\
117 IOP3XX_INIT_ATU_ENABLE : init_atu)
118#else
119#define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\
120 IOP3XX_INIT_ATU_DISABLE : init_atu)
121#endif
106 122
107/* Messaging Unit */ 123/* Messaging Unit */
108#define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310) 124#define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310)
@@ -253,14 +269,12 @@ extern void gpio_line_set(int line, int value);
253/* 269/*
254 * IOP3XX I/O and Mem space regions for PCI autoconfiguration 270 * IOP3XX I/O and Mem space regions for PCI autoconfiguration
255 */ 271 */
256#define IOP3XX_PCI_MEM_WINDOW_SIZE 0x04000000 272#define IOP3XX_PCI_LOWER_MEM_PA 0x80000000
257#define IOP3XX_PCI_LOWER_MEM_PA 0x80000000
258#define IOP3XX_PCI_LOWER_MEM_BA (*IOP3XX_OMWTVR0)
259 273
260#define IOP3XX_PCI_IO_WINDOW_SIZE 0x00010000 274#define IOP3XX_PCI_IO_WINDOW_SIZE 0x00010000
261#define IOP3XX_PCI_LOWER_IO_PA 0x90000000 275#define IOP3XX_PCI_LOWER_IO_PA 0x90000000
262#define IOP3XX_PCI_LOWER_IO_VA 0xfe000000 276#define IOP3XX_PCI_LOWER_IO_VA 0xfe000000
263#define IOP3XX_PCI_LOWER_IO_BA (*IOP3XX_OIOWTVR) 277#define IOP3XX_PCI_LOWER_IO_BA 0x90000000
264#define IOP3XX_PCI_UPPER_IO_PA (IOP3XX_PCI_LOWER_IO_PA +\ 278#define IOP3XX_PCI_UPPER_IO_PA (IOP3XX_PCI_LOWER_IO_PA +\
265 IOP3XX_PCI_IO_WINDOW_SIZE - 1) 279 IOP3XX_PCI_IO_WINDOW_SIZE - 1)
266#define IOP3XX_PCI_UPPER_IO_VA (IOP3XX_PCI_LOWER_IO_VA +\ 280#define IOP3XX_PCI_UPPER_IO_VA (IOP3XX_PCI_LOWER_IO_VA +\
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 5f60b4220906..8261ff9e7955 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -56,13 +56,22 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen);
56 56
57/* 57/*
58 * Architecture ioremap implementation. 58 * Architecture ioremap implementation.
59 *
60 * __ioremap takes CPU physical address.
61 *
62 * __ioremap_pfn takes a Page Frame Number and an offset into that page
63 */ 59 */
64extern void __iomem * __ioremap_pfn(unsigned long, unsigned long, size_t, unsigned long); 60#define MT_DEVICE 0
65extern void __iomem * __ioremap(unsigned long, size_t, unsigned long); 61#define MT_DEVICE_NONSHARED 1
62#define MT_DEVICE_CACHED 2
63#define MT_DEVICE_IXP2000 3
64/*
65 * types 4 onwards can be found in asm/mach/map.h and are undefined
66 * for ioremap
67 */
68
69/*
70 * __arm_ioremap takes CPU physical address.
71 * __arm_ioremap_pfn takes a Page Frame Number and an offset into that page
72 */
73extern void __iomem * __arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
74extern void __iomem * __arm_ioremap(unsigned long, size_t, unsigned int);
66extern void __iounmap(volatile void __iomem *addr); 75extern void __iounmap(volatile void __iomem *addr);
67 76
68/* 77/*
@@ -203,14 +212,14 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
203 * 212 *
204 */ 213 */
205#ifndef __arch_ioremap 214#ifndef __arch_ioremap
206#define ioremap(cookie,size) __ioremap(cookie,size,0) 215#define ioremap(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE)
207#define ioremap_nocache(cookie,size) __ioremap(cookie,size,0) 216#define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE)
208#define ioremap_cached(cookie,size) __ioremap(cookie,size,L_PTE_CACHEABLE) 217#define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED)
209#define iounmap(cookie) __iounmap(cookie) 218#define iounmap(cookie) __iounmap(cookie)
210#else 219#else
211#define ioremap(cookie,size) __arch_ioremap((cookie),(size),0) 220#define ioremap(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE)
212#define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0) 221#define ioremap_nocache(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE)
213#define ioremap_cached(cookie,size) __arch_ioremap((cookie),(size),L_PTE_CACHEABLE) 222#define ioremap_cached(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_CACHED)
214#define iounmap(cookie) __arch_iounmap(cookie) 223#define iounmap(cookie) __arch_iounmap(cookie)
215#endif 224#endif
216 225
diff --git a/include/asm-arm/kdebug.h b/include/asm-arm/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-arm/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-arm/kexec.h b/include/asm-arm/kexec.h
index 8c1c6162a80c..b5b030ef633d 100644
--- a/include/asm-arm/kexec.h
+++ b/include/asm-arm/kexec.h
@@ -16,8 +16,6 @@
16 16
17#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
18 18
19#define MAX_NOTE_BYTES 1024
20
21struct kimage; 19struct kimage;
22/* Provide a dummy definition to avoid build failures. */ 20/* Provide a dummy definition to avoid build failures. */
23static inline void crash_setup_regs(struct pt_regs *newregs, 21static inline void crash_setup_regs(struct pt_regs *newregs,
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h
index cef5364ed5fe..7ef3c8390180 100644
--- a/include/asm-arm/mach/map.h
+++ b/include/asm-arm/mach/map.h
@@ -9,6 +9,8 @@
9 * 9 *
10 * Page table mapping constructs and function prototypes 10 * Page table mapping constructs and function prototypes
11 */ 11 */
12#include <asm/io.h>
13
12struct map_desc { 14struct map_desc {
13 unsigned long virtual; 15 unsigned long virtual;
14 unsigned long pfn; 16 unsigned long pfn;
@@ -16,15 +18,16 @@ struct map_desc {
16 unsigned int type; 18 unsigned int type;
17}; 19};
18 20
19#define MT_DEVICE 0 21/* types 0-3 are defined in asm/io.h */
20#define MT_CACHECLEAN 1 22#define MT_CACHECLEAN 4
21#define MT_MINICLEAN 2 23#define MT_MINICLEAN 5
22#define MT_LOW_VECTORS 3 24#define MT_LOW_VECTORS 6
23#define MT_HIGH_VECTORS 4 25#define MT_HIGH_VECTORS 7
24#define MT_MEMORY 5 26#define MT_MEMORY 8
25#define MT_ROM 6 27#define MT_ROM 9
26#define MT_IXP2000_DEVICE 7 28
27#define MT_NONSHARED_DEVICE 8 29#define MT_NONSHARED_DEVICE MT_DEVICE_NONSHARED
30#define MT_IXP2000_DEVICE MT_DEVICE_IXP2000
28 31
29#ifdef CONFIG_MMU 32#ifdef CONFIG_MMU
30extern void iotable_init(struct map_desc *, int); 33extern void iotable_init(struct map_desc *, int);
diff --git a/include/asm-arm/pgtable-nommu.h b/include/asm-arm/pgtable-nommu.h
index 7b1c9acdf79a..0c8be19fd66b 100644
--- a/include/asm-arm/pgtable-nommu.h
+++ b/include/asm-arm/pgtable-nommu.h
@@ -83,10 +83,6 @@ extern int is_in_rom(unsigned long);
83#define io_remap_page_range remap_page_range 83#define io_remap_page_range remap_page_range
84#define io_remap_pfn_range remap_pfn_range 84#define io_remap_pfn_range remap_pfn_range
85 85
86#define MK_IOSPACE_PFN(space, pfn) (pfn)
87#define GET_IOSPACE(pfn) 0
88#define GET_PFN(pfn) (pfn)
89
90 86
91/* 87/*
92 * All 32bit addresses are effectively valid for vmalloc... 88 * All 32bit addresses are effectively valid for vmalloc...
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 7b2bafce21a2..21dec9f258d8 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -395,10 +395,6 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
395#define io_remap_pfn_range(vma,from,pfn,size,prot) \ 395#define io_remap_pfn_range(vma,from,pfn,size,prot) \
396 remap_pfn_range(vma, from, pfn, size, prot) 396 remap_pfn_range(vma, from, pfn, size, prot)
397 397
398#define MK_IOSPACE_PFN(space, pfn) (pfn)
399#define GET_IOSPACE(pfn) 0
400#define GET_PFN(pfn) (pfn)
401
402#define pgtable_cache_init() do { } while (0) 398#define pgtable_cache_init() do { } while (0)
403 399
404#endif /* !__ASSEMBLY__ */ 400#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/plat-s3c24xx/clock.h b/include/asm-arm/plat-s3c24xx/clock.h
index f6135dbb9fa9..235b753cd877 100644
--- a/include/asm-arm/plat-s3c24xx/clock.h
+++ b/include/asm-arm/plat-s3c24xx/clock.h
@@ -56,6 +56,7 @@ extern struct mutex clocks_mutex;
56extern int s3c2410_clkcon_enable(struct clk *clk, int enable); 56extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
57 57
58extern int s3c24xx_register_clock(struct clk *clk); 58extern int s3c24xx_register_clock(struct clk *clk);
59extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks);
59 60
60extern int s3c24xx_setup_clocks(unsigned long xtal, 61extern int s3c24xx_setup_clocks(unsigned long xtal,
61 unsigned long fclk, 62 unsigned long fclk,
diff --git a/include/asm-arm/plat-s3c24xx/cpu.h b/include/asm-arm/plat-s3c24xx/cpu.h
index 15dd18810905..23e420e8bd5b 100644
--- a/include/asm-arm/plat-s3c24xx/cpu.h
+++ b/include/asm-arm/plat-s3c24xx/cpu.h
@@ -40,22 +40,6 @@ extern void s3c24xx_init_uartdevs(char *name,
40 struct s3c24xx_uart_resources *res, 40 struct s3c24xx_uart_resources *res,
41 struct s3c2410_uartcfg *cfg, int no); 41 struct s3c2410_uartcfg *cfg, int no);
42 42
43/* the board structure is used at first initialsation time
44 * to get info such as the devices to register for this
45 * board. This is done because platfrom_add_devices() cannot
46 * be called from the map_io entry.
47*/
48
49struct s3c24xx_board {
50 struct platform_device **devices;
51 unsigned int devices_count;
52
53 struct clk **clocks;
54 unsigned int clocks_count;
55};
56
57extern void s3c24xx_set_board(struct s3c24xx_board *board);
58
59/* timer for 2410/2440 */ 43/* timer for 2410/2440 */
60 44
61struct sys_timer; 45struct sys_timer;
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
index 5a8ef787dbf8..2d0dad8c10ac 100644
--- a/include/asm-arm/ptrace.h
+++ b/include/asm-arm/ptrace.h
@@ -10,23 +10,19 @@
10#ifndef __ASM_ARM_PTRACE_H 10#ifndef __ASM_ARM_PTRACE_H
11#define __ASM_ARM_PTRACE_H 11#define __ASM_ARM_PTRACE_H
12 12
13
14#define PTRACE_GETREGS 12 13#define PTRACE_GETREGS 12
15#define PTRACE_SETREGS 13 14#define PTRACE_SETREGS 13
16#define PTRACE_GETFPREGS 14 15#define PTRACE_GETFPREGS 14
17#define PTRACE_SETFPREGS 15 16#define PTRACE_SETFPREGS 15
18 17/* PTRACE_ATTACH is 16 */
18/* PTRACE_DETACH is 17 */
19#define PTRACE_GETWMMXREGS 18 19#define PTRACE_GETWMMXREGS 18
20#define PTRACE_SETWMMXREGS 19 20#define PTRACE_SETWMMXREGS 19
21 21/* 20 is unused */
22#define PTRACE_OLDSETOPTIONS 21 22#define PTRACE_OLDSETOPTIONS 21
23
24#define PTRACE_GET_THREAD_AREA 22 23#define PTRACE_GET_THREAD_AREA 22
25
26#define PTRACE_SET_SYSCALL 23 24#define PTRACE_SET_SYSCALL 23
27
28/* PTRACE_SYSCALL is 24 */ 25/* PTRACE_SYSCALL is 24 */
29
30#define PTRACE_GETCRUNCHREGS 25 26#define PTRACE_GETCRUNCHREGS 25
31#define PTRACE_SETCRUNCHREGS 26 27#define PTRACE_SETCRUNCHREGS 26
32 28
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 69134c7518c1..f2da3b6e3a83 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -76,6 +76,8 @@
76#include <linux/linkage.h> 76#include <linux/linkage.h>
77#include <linux/irqflags.h> 77#include <linux/irqflags.h>
78 78
79#define __exception __attribute__((section(".exception.text")))
80
79struct thread_info; 81struct thread_info;
80struct task_struct; 82struct task_struct;
81 83
@@ -91,7 +93,7 @@ void die(const char *msg, struct pt_regs *regs, int err)
91 __attribute__((noreturn)); 93 __attribute__((noreturn));
92 94
93struct siginfo; 95struct siginfo;
94void notify_die(const char *str, struct pt_regs *regs, struct siginfo *info, 96void arm_notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
95 unsigned long err, unsigned long trap); 97 unsigned long err, unsigned long trap);
96 98
97void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, 99void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
@@ -101,8 +103,6 @@ void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
101#define xchg(ptr,x) \ 103#define xchg(ptr,x) \
102 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 104 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
103 105
104#define tas(ptr) (xchg((ptr),1))
105
106extern asmlinkage void __backtrace(void); 106extern asmlinkage void __backtrace(void);
107extern asmlinkage void c_backtrace(unsigned long fp, int pmode); 107extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
108 108
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index 5014794f9eb3..eae85b09db2e 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -57,6 +57,7 @@ struct thread_info {
57 __u32 cpu; /* cpu */ 57 __u32 cpu; /* cpu */
58 __u32 cpu_domain; /* cpu domain */ 58 __u32 cpu_domain; /* cpu domain */
59 struct cpu_context_save cpu_context; /* cpu context */ 59 struct cpu_context_save cpu_context; /* cpu context */
60 __u32 syscall; /* syscall number */
60 __u8 used_cp[16]; /* thread used copro */ 61 __u8 used_cp[16]; /* thread used copro */
61 unsigned long tp_value; 62 unsigned long tp_value;
62 struct crunch_state crunchstate; 63 struct crunch_state crunchstate;
diff --git a/include/asm-arm26/atomic.h b/include/asm-arm26/atomic.h
index 97e944fe1cff..d6dd42374cf3 100644
--- a/include/asm-arm26/atomic.h
+++ b/include/asm-arm26/atomic.h
@@ -20,7 +20,6 @@
20#ifndef __ASM_ARM_ATOMIC_H 20#ifndef __ASM_ARM_ATOMIC_H
21#define __ASM_ARM_ATOMIC_H 21#define __ASM_ARM_ATOMIC_H
22 22
23
24#ifdef CONFIG_SMP 23#ifdef CONFIG_SMP
25#error SMP is NOT supported 24#error SMP is NOT supported
26#endif 25#endif
diff --git a/include/asm-arm26/kdebug.h b/include/asm-arm26/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-arm26/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h
index 63a8881fae13..2b20e9f08857 100644
--- a/include/asm-arm26/pgtable.h
+++ b/include/asm-arm26/pgtable.h
@@ -297,10 +297,6 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
297#define io_remap_pfn_range(vma,from,pfn,size,prot) \ 297#define io_remap_pfn_range(vma,from,pfn,size,prot) \
298 remap_pfn_range(vma, from, pfn, size, prot) 298 remap_pfn_range(vma, from, pfn, size, prot)
299 299
300#define MK_IOSPACE_PFN(space, pfn) (pfn)
301#define GET_IOSPACE(pfn) 0
302#define GET_PFN(pfn) (pfn)
303
304#endif /* !__ASSEMBLY__ */ 300#endif /* !__ASSEMBLY__ */
305 301
306#endif /* _ASMARM_PGTABLE_H */ 302#endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h
index 00ae32aa1dba..4703593b3bb5 100644
--- a/include/asm-arm26/system.h
+++ b/include/asm-arm26/system.h
@@ -52,8 +52,6 @@ void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
52#define xchg(ptr,x) \ 52#define xchg(ptr,x) \
53 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 53 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
54 54
55#define tas(ptr) (xchg((ptr),1))
56
57extern asmlinkage void __backtrace(void); 55extern asmlinkage void __backtrace(void);
58 56
59#define set_cr(x) \ 57#define set_cr(x) \
diff --git a/include/asm-avr32/kdebug.h b/include/asm-avr32/kdebug.h
index f583b643ffb2..de419278fc39 100644
--- a/include/asm-avr32/kdebug.h
+++ b/include/asm-avr32/kdebug.h
@@ -3,19 +3,6 @@
3 3
4#include <linux/notifier.h> 4#include <linux/notifier.h>
5 5
6struct pt_regs;
7
8struct die_args {
9 struct pt_regs *regs;
10 int trapnr;
11};
12
13int register_die_notifier(struct notifier_block *nb);
14int unregister_die_notifier(struct notifier_block *nb);
15int register_page_fault_notifier(struct notifier_block *nb);
16int unregister_page_fault_notifier(struct notifier_block *nb);
17extern struct atomic_notifier_head avr32_die_chain;
18
19/* Grossly misnamed. */ 6/* Grossly misnamed. */
20enum die_val { 7enum die_val {
21 DIE_FAULT, 8 DIE_FAULT,
@@ -24,15 +11,7 @@ enum die_val {
24 DIE_PAGE_FAULT, 11 DIE_PAGE_FAULT,
25}; 12};
26 13
27static inline int notify_die(enum die_val val, struct pt_regs *regs, 14int register_page_fault_notifier(struct notifier_block *nb);
28 int trap, int sig) 15int unregister_page_fault_notifier(struct notifier_block *nb);
29{
30 struct die_args args = {
31 .regs = regs,
32 .trapnr = trap,
33 };
34
35 return atomic_notifier_call_chain(&avr32_die_chain, val, &args);
36}
37 16
38#endif /* __ASM_AVR32_KDEBUG_H */ 17#endif /* __ASM_AVR32_KDEBUG_H */
diff --git a/include/asm-avr32/pgtable.h b/include/asm-avr32/pgtable.h
index 6b8ca9db2bd5..f6cc2b0f75c3 100644
--- a/include/asm-avr32/pgtable.h
+++ b/include/asm-avr32/pgtable.h
@@ -394,10 +394,6 @@ typedef pte_t *pte_addr_t;
394#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 394#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
395 remap_pfn_range(vma, vaddr, pfn, size, prot) 395 remap_pfn_range(vma, vaddr, pfn, size, prot)
396 396
397#define MK_IOSPACE_PFN(space, pfn) (pfn)
398#define GET_IOSPACE(pfn) 0
399#define GET_PFN(pfn) (pfn)
400
401/* No page table caches to initialize (?) */ 397/* No page table caches to initialize (?) */
402#define pgtable_cache_init() do { } while(0) 398#define pgtable_cache_init() do { } while(0)
403 399
diff --git a/include/asm-blackfin/Kbuild b/include/asm-blackfin/Kbuild
new file mode 100644
index 000000000000..c68e1680da01
--- /dev/null
+++ b/include/asm-blackfin/Kbuild
@@ -0,0 +1 @@
include include/asm-generic/Kbuild.asm
diff --git a/include/asm-blackfin/a.out.h b/include/asm-blackfin/a.out.h
new file mode 100644
index 000000000000..d37a6849bf74
--- /dev/null
+++ b/include/asm-blackfin/a.out.h
@@ -0,0 +1,25 @@
1#ifndef __BFIN_A_OUT_H__
2#define __BFIN_A_OUT_H__
3
4struct exec {
5 unsigned long a_info; /* Use macros N_MAGIC, etc for access */
6 unsigned a_text; /* length of text, in bytes */
7 unsigned a_data; /* length of data, in bytes */
8 unsigned a_bss; /* length of uninitialized data area for file, in bytes */
9 unsigned a_syms; /* length of symbol table data in file, in bytes */
10 unsigned a_entry; /* start address */
11 unsigned a_trsize; /* length of relocation info for text, in bytes */
12 unsigned a_drsize; /* length of relocation info for data, in bytes */
13};
14
15#define N_TRSIZE(a) ((a).a_trsize)
16#define N_DRSIZE(a) ((a).a_drsize)
17#define N_SYMSIZE(a) ((a).a_syms)
18
19#ifdef __KERNEL__
20
21#define STACK_TOP TASK_SIZE
22
23#endif
24
25#endif /* __BFIN_A_OUT_H__ */
diff --git a/include/asm-blackfin/atomic.h b/include/asm-blackfin/atomic.h
new file mode 100644
index 000000000000..7cf508718605
--- /dev/null
+++ b/include/asm-blackfin/atomic.h
@@ -0,0 +1,144 @@
1#ifndef __ARCH_BLACKFIN_ATOMIC__
2#define __ARCH_BLACKFIN_ATOMIC__
3
4#include <asm/system.h> /* local_irq_XXX() */
5
6/*
7 * Atomic operations that C can't guarantee us. Useful for
8 * resource counting etc..
9 *
10 * Generally we do not concern about SMP BFIN systems, so we don't have
11 * to deal with that.
12 *
13 * Tony Kou (tonyko@lineo.ca) Lineo Inc. 2001
14 */
15
16typedef struct {
17 int counter;
18} atomic_t;
19#define ATOMIC_INIT(i) { (i) }
20
21#define atomic_read(v) ((v)->counter)
22#define atomic_set(v, i) (((v)->counter) = i)
23
24static __inline__ void atomic_add(int i, atomic_t * v)
25{
26 long flags;
27
28 local_irq_save(flags);
29 v->counter += i;
30 local_irq_restore(flags);
31}
32
33static __inline__ void atomic_sub(int i, atomic_t * v)
34{
35 long flags;
36
37 local_irq_save(flags);
38 v->counter -= i;
39 local_irq_restore(flags);
40
41}
42
43static inline int atomic_add_return(int i, atomic_t * v)
44{
45 int __temp = 0;
46 long flags;
47
48 local_irq_save(flags);
49 v->counter += i;
50 __temp = v->counter;
51 local_irq_restore(flags);
52
53
54 return __temp;
55}
56
57#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
58static inline int atomic_sub_return(int i, atomic_t * v)
59{
60 int __temp = 0;
61 long flags;
62
63 local_irq_save(flags);
64 v->counter -= i;
65 __temp = v->counter;
66 local_irq_restore(flags);
67
68 return __temp;
69}
70
71static __inline__ void atomic_inc(volatile atomic_t * v)
72{
73 long flags;
74
75 local_irq_save(flags);
76 v->counter++;
77 local_irq_restore(flags);
78}
79
80#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
81#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
82
83#define atomic_add_unless(v, a, u) \
84({ \
85 int c, old; \
86 c = atomic_read(v); \
87 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
88 c = old; \
89 c != (u); \
90})
91#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
92
93static __inline__ void atomic_dec(volatile atomic_t * v)
94{
95 long flags;
96
97 local_irq_save(flags);
98 v->counter--;
99 local_irq_restore(flags);
100}
101
102static __inline__ void atomic_clear_mask(unsigned int mask, atomic_t * v)
103{
104 long flags;
105
106 local_irq_save(flags);
107 v->counter &= ~mask;
108 local_irq_restore(flags);
109}
110
111static __inline__ void atomic_set_mask(unsigned int mask, atomic_t * v)
112{
113 long flags;
114
115 local_irq_save(flags);
116 v->counter |= mask;
117 local_irq_restore(flags);
118}
119
120/* Atomic operations are already serializing */
121#define smp_mb__before_atomic_dec() barrier()
122#define smp_mb__after_atomic_dec() barrier()
123#define smp_mb__before_atomic_inc() barrier()
124#define smp_mb__after_atomic_inc() barrier()
125
126#define atomic_dec_return(v) atomic_sub_return(1,(v))
127#define atomic_inc_return(v) atomic_add_return(1,(v))
128
129/*
130 * atomic_inc_and_test - increment and test
131 * @v: pointer of type atomic_t
132 *
133 * Atomically increments @v by 1
134 * and returns true if the result is zero, or false for all
135 * other cases.
136 */
137#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
138
139#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
140#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
141
142#include <asm-generic/atomic.h>
143
144#endif /* __ARCH_BLACKFIN_ATOMIC __ */
diff --git a/include/asm-blackfin/auxvec.h b/include/asm-blackfin/auxvec.h
new file mode 100644
index 000000000000..215506cd87b7
--- /dev/null
+++ b/include/asm-blackfin/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMBFIN_AUXVEC_H
2#define __ASMBFIN_AUXVEC_H
3
4#endif
diff --git a/include/asm-blackfin/bf5xx_timers.h b/include/asm-blackfin/bf5xx_timers.h
new file mode 100644
index 000000000000..86c770321b61
--- /dev/null
+++ b/include/asm-blackfin/bf5xx_timers.h
@@ -0,0 +1,209 @@
1/*
2 * include/asm/bf5xx_timers.h
3 *
4 * This file contains the major Data structures and constants
5 * used for General Purpose Timer Implementation in BF5xx
6 *
7 * Copyright (C) 2005 John DeHority
8 * Copyright (C) 2006 Hella Aglaia GmbH (awe@aglaia-gmbh.de)
9 *
10 */
11
12#ifndef _BLACKFIN_TIMERS_H_
13#define _BLACKFIN_TIMERS_H_
14
15#undef MAX_BLACKFIN_GPTIMERS
16/*
17 * BF537: 8 timers:
18 */
19#if defined(CONFIG_BF537)
20# define MAX_BLACKFIN_GPTIMERS 8
21# define TIMER0_GROUP_REG TIMER_ENABLE
22#endif
23/*
24 * BF561: 12 timers:
25 */
26#if defined(CONFIG_BF561)
27# define MAX_BLACKFIN_GPTIMERS 12
28# define TIMER0_GROUP_REG TMRS8_ENABLE
29# define TIMER8_GROUP_REG TMRS4_ENABLE
30#endif
31/*
32 * All others: 3 timers:
33 */
34#if !defined(MAX_BLACKFIN_GPTIMERS)
35# define MAX_BLACKFIN_GPTIMERS 3
36# define TIMER0_GROUP_REG TIMER_ENABLE
37#endif
38
39#define BLACKFIN_GPTIMER_IDMASK ((1UL << MAX_BLACKFIN_GPTIMERS) - 1)
40#define BFIN_TIMER_OCTET(x) ((x) >> 3)
41
42/* used in masks for timer_enable() and timer_disable() */
43#define TIMER0bit 0x0001 /* 0001b */
44#define TIMER1bit 0x0002 /* 0010b */
45#define TIMER2bit 0x0004 /* 0100b */
46
47#if (MAX_BLACKFIN_GPTIMERS > 3)
48# define TIMER3bit 0x0008
49# define TIMER4bit 0x0010
50# define TIMER5bit 0x0020
51# define TIMER6bit 0x0040
52# define TIMER7bit 0x0080
53#endif
54
55#if (MAX_BLACKFIN_GPTIMERS > 8)
56# define TIMER8bit 0x0100
57# define TIMER9bit 0x0200
58# define TIMER10bit 0x0400
59# define TIMER11bit 0x0800
60#endif
61
62#define TIMER0_id 0
63#define TIMER1_id 1
64#define TIMER2_id 2
65
66#if (MAX_BLACKFIN_GPTIMERS > 3)
67# define TIMER3_id 3
68# define TIMER4_id 4
69# define TIMER5_id 5
70# define TIMER6_id 6
71# define TIMER7_id 7
72#endif
73
74#if (MAX_BLACKFIN_GPTIMERS > 8)
75# define TIMER8_id 8
76# define TIMER9_id 9
77# define TIMER10_id 10
78# define TIMER11_id 11
79#endif
80
81/* associated timers for ppi framesync: */
82
83#if defined(CONFIG_BF561)
84# define FS0_1_TIMER_ID TIMER8_id
85# define FS0_2_TIMER_ID TIMER9_id
86# define FS1_1_TIMER_ID TIMER10_id
87# define FS1_2_TIMER_ID TIMER11_id
88# define FS0_1_TIMER_BIT TIMER8bit
89# define FS0_2_TIMER_BIT TIMER9bit
90# define FS1_1_TIMER_BIT TIMER10bit
91# define FS1_2_TIMER_BIT TIMER11bit
92# undef FS1_TIMER_ID
93# undef FS2_TIMER_ID
94# undef FS1_TIMER_BIT
95# undef FS2_TIMER_BIT
96#else
97# define FS1_TIMER_ID TIMER0_id
98# define FS2_TIMER_ID TIMER1_id
99# define FS1_TIMER_BIT TIMER0bit
100# define FS2_TIMER_BIT TIMER1bit
101#endif
102
103/*
104** Timer Configuration Register Bits
105*/
106#define TIMER_ERR 0xC000
107#define TIMER_ERR_OVFL 0x4000
108#define TIMER_ERR_PROG_PER 0x8000
109#define TIMER_ERR_PROG_PW 0xC000
110#define TIMER_EMU_RUN 0x0200
111#define TIMER_TOGGLE_HI 0x0100
112#define TIMER_CLK_SEL 0x0080
113#define TIMER_OUT_DIS 0x0040
114#define TIMER_TIN_SEL 0x0020
115#define TIMER_IRQ_ENA 0x0010
116#define TIMER_PERIOD_CNT 0x0008
117#define TIMER_PULSE_HI 0x0004
118#define TIMER_MODE 0x0003
119#define TIMER_MODE_PWM 0x0001
120#define TIMER_MODE_WDTH 0x0002
121#define TIMER_MODE_EXT_CLK 0x0003
122
123/*
124** Timer Status Register Bits
125*/
126#define TIMER_STATUS_TIMIL0 0x0001
127#define TIMER_STATUS_TIMIL1 0x0002
128#define TIMER_STATUS_TIMIL2 0x0004
129#if (MAX_BLACKFIN_GPTIMERS > 3)
130# define TIMER_STATUS_TIMIL3 0x00000008
131# define TIMER_STATUS_TIMIL4 0x00010000
132# define TIMER_STATUS_TIMIL5 0x00020000
133# define TIMER_STATUS_TIMIL6 0x00040000
134# define TIMER_STATUS_TIMIL7 0x00080000
135# if (MAX_BLACKFIN_GPTIMERS > 8)
136# define TIMER_STATUS_TIMIL8 0x0001
137# define TIMER_STATUS_TIMIL9 0x0002
138# define TIMER_STATUS_TIMIL10 0x0004
139# define TIMER_STATUS_TIMIL11 0x0008
140# endif
141# define TIMER_STATUS_INTR 0x000F000F
142#else
143# define TIMER_STATUS_INTR 0x0007 /* any timer interrupt */
144#endif
145
146#define TIMER_STATUS_TOVF0 0x0010 /* timer 0 overflow error */
147#define TIMER_STATUS_TOVF1 0x0020
148#define TIMER_STATUS_TOVF2 0x0040
149#if (MAX_BLACKFIN_GPTIMERS > 3)
150# define TIMER_STATUS_TOVF3 0x00000080
151# define TIMER_STATUS_TOVF4 0x00100000
152# define TIMER_STATUS_TOVF5 0x00200000
153# define TIMER_STATUS_TOVF6 0x00400000
154# define TIMER_STATUS_TOVF7 0x00800000
155# if (MAX_BLACKFIN_GPTIMERS > 8)
156# define TIMER_STATUS_TOVF8 0x0010
157# define TIMER_STATUS_TOVF9 0x0020
158# define TIMER_STATUS_TOVF10 0x0040
159# define TIMER_STATUS_TOVF11 0x0080
160# endif
161# define TIMER_STATUS_OFLOW 0x00F000F0
162#else
163# define TIMER_STATUS_OFLOW 0x0070 /* any timer overflow */
164#endif
165
166/*
167** Timer Slave Enable Status : write 1 to clear
168*/
169#define TIMER_STATUS_TRUN0 0x1000
170#define TIMER_STATUS_TRUN1 0x2000
171#define TIMER_STATUS_TRUN2 0x4000
172#if (MAX_BLACKFIN_GPTIMERS > 3)
173# define TIMER_STATUS_TRUN3 0x00008000
174# define TIMER_STATUS_TRUN4 0x10000000
175# define TIMER_STATUS_TRUN5 0x20000000
176# define TIMER_STATUS_TRUN6 0x40000000
177# define TIMER_STATUS_TRUN7 0x80000000
178# define TIMER_STATUS_TRUN 0xF000F000
179# if (MAX_BLACKFIN_GPTIMERS > 8)
180# define TIMER_STATUS_TRUN8 0x1000
181# define TIMER_STATUS_TRUN9 0x2000
182# define TIMER_STATUS_TRUN10 0x4000
183# define TIMER_STATUS_TRUN11 0x8000
184# endif
185#else
186# define TIMER_STATUS_TRUN 0x7000
187#endif
188
189/*******************************************************************************
190* GP_TIMER API's
191*******************************************************************************/
192
193void set_gptimer_pwidth (int timer_id, int width);
194int get_gptimer_pwidth (int timer_id);
195void set_gptimer_period (int timer_id, int period);
196int get_gptimer_period (int timer_id);
197int get_gptimer_count (int timer_id);
198short get_gptimer_intr (int timer_id);
199void set_gptimer_config (int timer_id, short config);
200short get_gptimer_config (int timer_id);
201void set_gptimer_pulse_hi (int timer_id);
202void clear_gptimer_pulse_hi(int timer_id);
203void enable_gptimers (short mask);
204void disable_gptimers (short mask);
205short get_enabled_timers (void);
206int get_gptimer_status (int octet);
207void set_gptimer_status (int octet, int value);
208
209#endif
diff --git a/include/asm-blackfin/bfin-global.h b/include/asm-blackfin/bfin-global.h
new file mode 100644
index 000000000000..e37f81609fc3
--- /dev/null
+++ b/include/asm-blackfin/bfin-global.h
@@ -0,0 +1,120 @@
1/*
2 * File: include/asm-blackfin/bfin-global.h
3 * Based on:
4 * Author: *
5 * Created:
6 * Description: Global extern defines for blackfin
7 *
8 * Modified:
9 * Copyright 2004-2006 Analog Devices Inc.
10 *
11 * Bugs: Enter bugs at http://blackfin.uclinux.org/
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, see the file COPYING, or write
25 * to the Free Software Foundation, Inc.,
26 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 */
28
29#ifndef _BFIN_GLOBAL_H_
30#define _BFIN_GLOBAL_H_
31
32#ifndef __ASSEMBLY__
33
34#include <asm-generic/sections.h>
35#include <asm/ptrace.h>
36#include <asm/user.h>
37#include <linux/linkage.h>
38#include <linux/types.h>
39
40#if defined(CONFIG_DMA_UNCACHED_2M)
41# define DMA_UNCACHED_REGION (2 * 1024 * 1024)
42#elif defined(CONFIG_DMA_UNCACHED_1M)
43# define DMA_UNCACHED_REGION (1024 * 1024)
44#else
45# define DMA_UNCACHED_REGION (0)
46#endif
47
48extern unsigned long get_cclk(void);
49extern unsigned long get_sclk(void);
50
51extern void dump_thread(struct pt_regs *regs, struct user *dump);
52extern void dump_bfin_regs(struct pt_regs *fp, void *retaddr);
53extern void dump_bfin_trace_buffer(void);
54
55extern int init_arch_irq(void);
56extern void bfin_reset(void);
57extern void _cplb_hdr(void);
58/* Blackfin cache functions */
59extern void bfin_icache_init(void);
60extern void bfin_dcache_init(void);
61extern int read_iloc(void);
62extern int bfin_console_init(void);
63extern asmlinkage void lower_to_irq14(void);
64extern void init_dma(void);
65extern void program_IAR(void);
66extern void evt14_softirq(void);
67extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
68extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type);
69
70extern void *l1_data_A_sram_alloc(size_t);
71extern void *l1_data_B_sram_alloc(size_t);
72extern void *l1_inst_sram_alloc(size_t);
73extern void *l1_data_sram_alloc(size_t);
74extern void *l1_data_sram_zalloc(size_t);
75extern int l1_data_A_sram_free(const void*);
76extern int l1_data_B_sram_free(const void*);
77extern int l1_inst_sram_free(const void*);
78extern int l1_data_sram_free(const void*);
79extern int sram_free(const void*);
80
81#define L1_INST_SRAM 0x00000001
82#define L1_DATA_A_SRAM 0x00000002
83#define L1_DATA_B_SRAM 0x00000004
84#define L1_DATA_SRAM 0x00000006
85extern void *sram_alloc_with_lsl(size_t, unsigned long);
86extern int sram_free_with_lsl(const void*);
87
88extern void led_on(int);
89extern void led_off(int);
90extern void led_toggle(int);
91extern void led_disp_num(int);
92extern void led_toggle_num(int);
93extern void init_leds(void);
94
95extern char *bfin_board_name __attribute__ ((weak));
96extern unsigned long wall_jiffies;
97extern unsigned long ipdt_table[];
98extern unsigned long dpdt_table[];
99extern unsigned long icplb_table[];
100extern unsigned long dcplb_table[];
101
102extern unsigned long ipdt_swapcount_table[];
103extern unsigned long dpdt_swapcount_table[];
104
105extern unsigned long table_start, table_end;
106
107extern struct file_operations dpmc_fops;
108extern char _start;
109extern unsigned long _ramstart, _ramend, _rambase;
110extern unsigned long memory_start, memory_end, physical_mem_end;
111extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
112 _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _ebss_b_l1[];
113
114#ifdef CONFIG_MTD_UCLINUX
115extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
116#endif
117
118#endif
119
120#endif /* _BLACKFIN_H_ */
diff --git a/include/asm-blackfin/bfin5xx_spi.h b/include/asm-blackfin/bfin5xx_spi.h
new file mode 100644
index 000000000000..95c1c952e7c1
--- /dev/null
+++ b/include/asm-blackfin/bfin5xx_spi.h
@@ -0,0 +1,170 @@
1/************************************************************
2*
3* Copyright (C) 2004, Analog Devices. All Rights Reserved
4*
5* FILE bfin5xx_spi.h
6* PROGRAMMER(S): Luke Yang (Analog Devices Inc.)
7*
8*
9* DATE OF CREATION: March. 10th 2006
10*
11* SYNOPSIS:
12*
13* DESCRIPTION: header file for SPI controller driver for Blackfin5xx.
14**************************************************************
15
16* MODIFICATION HISTORY:
17* March 10, 2006 bfin5xx_spi.h Created. (Luke Yang)
18
19************************************************************/
20
21#ifndef _SPI_CHANNEL_H_
22#define _SPI_CHANNEL_H_
23
24#define SPI0_REGBASE 0xffc00500
25
26#define SPI_READ 0
27#define SPI_WRITE 1
28
29#define SPI_CTRL_OFF 0x0
30#define SPI_FLAG_OFF 0x4
31#define SPI_STAT_OFF 0x8
32#define SPI_TXBUFF_OFF 0xc
33#define SPI_RXBUFF_OFF 0x10
34#define SPI_BAUD_OFF 0x14
35#define SPI_SHAW_OFF 0x18
36
37#define CMD_SPI_OUT_ENABLE 1
38#define CMD_SPI_SET_BAUDRATE 2
39#define CMD_SPI_SET_POLAR 3
40#define CMD_SPI_SET_PHASE 4
41#define CMD_SPI_SET_MASTER 5
42#define CMD_SPI_SET_SENDOPT 6
43#define CMD_SPI_SET_RECVOPT 7
44#define CMD_SPI_SET_ORDER 8
45#define CMD_SPI_SET_LENGTH16 9
46#define CMD_SPI_GET_STAT 11
47#define CMD_SPI_GET_CFG 12
48#define CMD_SPI_SET_CSAVAIL 13
49#define CMD_SPI_SET_CSHIGH 14 /* CS unavail */
50#define CMD_SPI_SET_CSLOW 15 /* CS avail */
51#define CMD_SPI_MISO_ENABLE 16
52#define CMD_SPI_SET_CSENABLE 17
53#define CMD_SPI_SET_CSDISABLE 18
54
55#define CMD_SPI_SET_TRIGGER_MODE 19
56#define CMD_SPI_SET_TRIGGER_SENSE 20
57#define CMD_SPI_SET_TRIGGER_EDGE 21
58#define CMD_SPI_SET_TRIGGER_LEVEL 22
59
60#define CMD_SPI_SET_TIME_SPS 23
61#define CMD_SPI_SET_TIME_SAMPLES 24
62#define CMD_SPI_GET_SYSTEMCLOCK 25
63
64#define CMD_SPI_SET_WRITECONTINUOUS 26
65#define CMD_SPI_SET_SKFS 27
66
67#define CMD_SPI_GET_ALLCONFIG 32 /* For debug */
68
69#define SPI_DEFAULT_BARD 0x0100
70
71#define SPI0_IRQ_NUM IRQ_SPI
72#define SPI_ERR_TRIG -1
73
74#define BIT_CTL_ENABLE 0x4000
75#define BIT_CTL_OPENDRAIN 0x2000
76#define BIT_CTL_MASTER 0x1000
77#define BIT_CTL_POLAR 0x0800
78#define BIT_CTL_PHASE 0x0400
79#define BIT_CTL_BITORDER 0x0200
80#define BIT_CTL_WORDSIZE 0x0100
81#define BIT_CTL_MISOENABLE 0x0020
82#define BIT_CTL_RXMOD 0x0000
83#define BIT_CTL_TXMOD 0x0001
84#define BIT_CTL_TIMOD_DMA_TX 0x0003
85#define BIT_CTL_TIMOD_DMA_RX 0x0002
86#define BIT_CTL_SENDOPT 0x0004
87#define BIT_CTL_TIMOD 0x0003
88
89#define BIT_STAT_SPIF 0x0001
90#define BIT_STAT_MODF 0x0002
91#define BIT_STAT_TXE 0x0004
92#define BIT_STAT_TXS 0x0008
93#define BIT_STAT_RBSY 0x0010
94#define BIT_STAT_RXS 0x0020
95#define BIT_STAT_TXCOL 0x0040
96#define BIT_STAT_CLR 0xFFFF
97
98#define BIT_STU_SENDOVER 0x0001
99#define BIT_STU_RECVFULL 0x0020
100
101#define CFG_SPI_ENABLE 1
102#define CFG_SPI_DISABLE 0
103
104#define CFG_SPI_OUTENABLE 1
105#define CFG_SPI_OUTDISABLE 0
106
107#define CFG_SPI_ACTLOW 1
108#define CFG_SPI_ACTHIGH 0
109
110#define CFG_SPI_PHASESTART 1
111#define CFG_SPI_PHASEMID 0
112
113#define CFG_SPI_MASTER 1
114#define CFG_SPI_SLAVE 0
115
116#define CFG_SPI_SENELAST 0
117#define CFG_SPI_SENDZERO 1
118
119#define CFG_SPI_RCVFLUSH 1
120#define CFG_SPI_RCVDISCARD 0
121
122#define CFG_SPI_LSBFIRST 1
123#define CFG_SPI_MSBFIRST 0
124
125#define CFG_SPI_WORDSIZE16 1
126#define CFG_SPI_WORDSIZE8 0
127
128#define CFG_SPI_MISOENABLE 1
129#define CFG_SPI_MISODISABLE 0
130
131#define CFG_SPI_READ 0x00
132#define CFG_SPI_WRITE 0x01
133#define CFG_SPI_DMAREAD 0x02
134#define CFG_SPI_DMAWRITE 0x03
135
136#define CFG_SPI_CSCLEARALL 0
137#define CFG_SPI_CHIPSEL1 1
138#define CFG_SPI_CHIPSEL2 2
139#define CFG_SPI_CHIPSEL3 3
140#define CFG_SPI_CHIPSEL4 4
141#define CFG_SPI_CHIPSEL5 5
142#define CFG_SPI_CHIPSEL6 6
143#define CFG_SPI_CHIPSEL7 7
144
145#define CFG_SPI_CS1VALUE 1
146#define CFG_SPI_CS2VALUE 2
147#define CFG_SPI_CS3VALUE 3
148#define CFG_SPI_CS4VALUE 4
149#define CFG_SPI_CS5VALUE 5
150#define CFG_SPI_CS6VALUE 6
151#define CFG_SPI_CS7VALUE 7
152
153/* device.platform_data for SSP controller devices */
154struct bfin5xx_spi_master {
155 u16 num_chipselect;
156 u8 enable_dma;
157};
158
159/* spi_board_info.controller_data for SPI slave devices,
160 * copied to spi_device.platform_data ... mostly for dma tuning
161 */
162struct bfin5xx_spi_chip {
163 u16 ctl_reg;
164 u8 enable_dma;
165 u8 bits_per_word;
166 u8 cs_change_per_word;
167 u8 cs_chg_udelay;
168};
169
170#endif /* _SPI_CHANNEL_H_ */
diff --git a/include/asm-blackfin/bfin_simple_timer.h b/include/asm-blackfin/bfin_simple_timer.h
new file mode 100644
index 000000000000..fccbb595464a
--- /dev/null
+++ b/include/asm-blackfin/bfin_simple_timer.h
@@ -0,0 +1,13 @@
1#ifndef _bfin_simple_timer_h_
2#define _bfin_simple_timer_h_
3
4#include <linux/ioctl.h>
5
6#define BFIN_SIMPLE_TIMER_IOCTL_MAGIC 't'
7
8#define BFIN_SIMPLE_TIMER_SET_PERIOD _IO (BFIN_SIMPLE_TIMER_IOCTL_MAGIC, 2)
9#define BFIN_SIMPLE_TIMER_START _IO (BFIN_SIMPLE_TIMER_IOCTL_MAGIC, 6)
10#define BFIN_SIMPLE_TIMER_STOP _IO (BFIN_SIMPLE_TIMER_IOCTL_MAGIC, 8)
11#define BFIN_SIMPLE_TIMER_READ _IO (BFIN_SIMPLE_TIMER_IOCTL_MAGIC, 10)
12
13#endif
diff --git a/include/asm-blackfin/bfin_sport.h b/include/asm-blackfin/bfin_sport.h
new file mode 100644
index 000000000000..c76ed8def302
--- /dev/null
+++ b/include/asm-blackfin/bfin_sport.h
@@ -0,0 +1,175 @@
1/*
2 * File: include/asm-blackfin/bfin_sport.h
3 * Based on:
4 * Author: Roy Huang (roy.huang@analog.com)
5 *
6 * Created: Thu Aug. 24 2006
7 * Description:
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#ifndef __BFIN_SPORT_H__
31#define __BFIN_SPORT_H__
32
33#define SPORT_MAJOR 237
34#define SPORT_NR_DEVS 2
35
36/* Sport mode: it can be set to TDM, i2s or others */
37#define NORM_MODE 0x0
38#define TDM_MODE 0x1
39#define I2S_MODE 0x2
40
41/* Data format, normal, a-law or u-law */
42#define NORM_FORMAT 0x0
43#define ALAW_FORMAT 0x2
44#define ULAW_FORMAT 0x3
45struct sport_register;
46
47/* Function driver which use sport must initialize the structure */
48struct sport_config {
49 /*TDM (multichannels), I2S or other mode */
50 unsigned int mode:3;
51
52 /* if TDM mode is selected, channels must be set */
53 int channels; /* Must be in 8 units */
54 unsigned int frame_delay:4; /* Delay between frame sync pulse and first bit */
55
56 /* I2S mode */
57 unsigned int right_first:1; /* Right stereo channel first */
58
59 /* In mormal mode, the following item need to be set */
60 unsigned int lsb_first:1; /* order of transmit or receive data */
61 unsigned int fsync:1; /* Frame sync required */
62 unsigned int data_indep:1; /* data independent frame sync generated */
63 unsigned int act_low:1; /* Active low TFS */
64 unsigned int late_fsync:1; /* Late frame sync */
65 unsigned int tckfe:1;
66 unsigned int sec_en:1; /* Secondary side enabled */
67
68 /* Choose clock source */
69 unsigned int int_clk:1; /* Internal or external clock */
70
71 /* If external clock is used, the following fields are ignored */
72 int serial_clk;
73 int fsync_clk;
74
75 unsigned int data_format:2; /*Normal, u-law or a-law */
76
77 int word_len; /* How length of the word in bits, 3-32 bits */
78 int dma_enabled;
79};
80
81struct sport_register {
82 unsigned short tcr1;
83 unsigned short reserved0;
84 unsigned short tcr2;
85 unsigned short reserved1;
86 unsigned short tclkdiv;
87 unsigned short reserved2;
88 unsigned short tfsdiv;
89 unsigned short reserved3;
90 unsigned long tx;
91 unsigned long reserved_l0;
92 unsigned long rx;
93 unsigned long reserved_l1;
94 unsigned short rcr1;
95 unsigned short reserved4;
96 unsigned short rcr2;
97 unsigned short reserved5;
98 unsigned short rclkdiv;
99 unsigned short reserved6;
100 unsigned short rfsdiv;
101 unsigned short reserved7;
102 unsigned short stat;
103 unsigned short reserved8;
104 unsigned short chnl;
105 unsigned short reserved9;
106 unsigned short mcmc1;
107 unsigned short reserved10;
108 unsigned short mcmc2;
109 unsigned short reserved11;
110 unsigned long mtcs0;
111 unsigned long mtcs1;
112 unsigned long mtcs2;
113 unsigned long mtcs3;
114 unsigned long mrcs0;
115 unsigned long mrcs1;
116 unsigned long mrcs2;
117 unsigned long mrcs3;
118};
119
120#define SPORT_IOC_MAGIC 'P'
121#define SPORT_IOC_CONFIG _IOWR('P', 0x01, struct sport_config)
122
123/* Test purpose */
124#define ENABLE_AD73311 _IOWR('P', 0x02, int)
125
126struct sport_dev {
127 struct cdev cdev; /* Char device structure */
128
129 int sport_num;
130
131 int dma_rx_chan;
132 int dma_tx_chan;
133
134 int rx_irq;
135 unsigned char *rx_buf; /* Buffer store the received data */
136 int rx_len; /* How many bytes will be received */
137 int rx_received; /* How many bytes has been received */
138
139 int tx_irq;
140 const unsigned char *tx_buf;
141 int tx_len;
142 int tx_sent;
143
144 int sport_err_irq;
145
146 struct mutex mutex; /* mutual exclusion semaphore */
147 struct task_struct *task;
148
149 wait_queue_head_t waitq;
150 int wait_con;
151 struct sport_register *regs;
152 struct sport_config config;
153};
154
155#define SPORT_TCR1 0
156#define SPORT_TCR2 1
157#define SPORT_TCLKDIV 2
158#define SPORT_TFSDIV 3
159#define SPORT_RCR1 8
160#define SPORT_RCR2 9
161#define SPORT_RCLKDIV 10
162#define SPORT_RFSDIV 11
163#define SPORT_CHANNEL 13
164#define SPORT_MCMC1 14
165#define SPORT_MCMC2 15
166#define SPORT_MTCS0 16
167#define SPORT_MTCS1 17
168#define SPORT_MTCS2 18
169#define SPORT_MTCS3 19
170#define SPORT_MRCS0 20
171#define SPORT_MRCS1 21
172#define SPORT_MRCS2 22
173#define SPORT_MRCS3 23
174
175#endif /*__BFIN_SPORT_H__*/
diff --git a/include/asm-blackfin/bitops.h b/include/asm-blackfin/bitops.h
new file mode 100644
index 000000000000..27c2d0e48e1b
--- /dev/null
+++ b/include/asm-blackfin/bitops.h
@@ -0,0 +1,213 @@
1#ifndef _BLACKFIN_BITOPS_H
2#define _BLACKFIN_BITOPS_H
3
4/*
5 * Copyright 1992, Linus Torvalds.
6 */
7
8#include <linux/compiler.h>
9#include <asm/byteorder.h> /* swab32 */
10#include <asm/system.h> /* save_flags */
11
12#ifdef __KERNEL__
13
14#include <asm-generic/bitops/ffs.h>
15#include <asm-generic/bitops/__ffs.h>
16#include <asm-generic/bitops/sched.h>
17#include <asm-generic/bitops/ffz.h>
18
19static __inline__ void set_bit(int nr, volatile unsigned long *addr)
20{
21 int *a = (int *)addr;
22 int mask;
23 unsigned long flags;
24
25 a += nr >> 5;
26 mask = 1 << (nr & 0x1f);
27 local_irq_save(flags);
28 *a |= mask;
29 local_irq_restore(flags);
30}
31
32static __inline__ void __set_bit(int nr, volatile unsigned long *addr)
33{
34 int *a = (int *)addr;
35 int mask;
36
37 a += nr >> 5;
38 mask = 1 << (nr & 0x1f);
39 *a |= mask;
40}
41
42/*
43 * clear_bit() doesn't provide any barrier for the compiler.
44 */
45#define smp_mb__before_clear_bit() barrier()
46#define smp_mb__after_clear_bit() barrier()
47
48static __inline__ void clear_bit(int nr, volatile unsigned long *addr)
49{
50 int *a = (int *)addr;
51 int mask;
52 unsigned long flags;
53 a += nr >> 5;
54 mask = 1 << (nr & 0x1f);
55 local_irq_save(flags);
56 *a &= ~mask;
57 local_irq_restore(flags);
58}
59
60static __inline__ void __clear_bit(int nr, volatile unsigned long *addr)
61{
62 int *a = (int *)addr;
63 int mask;
64
65 a += nr >> 5;
66 mask = 1 << (nr & 0x1f);
67 *a &= ~mask;
68}
69
70static __inline__ void change_bit(int nr, volatile unsigned long *addr)
71{
72 int mask, flags;
73 unsigned long *ADDR = (unsigned long *)addr;
74
75 ADDR += nr >> 5;
76 mask = 1 << (nr & 31);
77 local_irq_save(flags);
78 *ADDR ^= mask;
79 local_irq_restore(flags);
80}
81
82static __inline__ void __change_bit(int nr, volatile unsigned long *addr)
83{
84 int mask;
85 unsigned long *ADDR = (unsigned long *)addr;
86
87 ADDR += nr >> 5;
88 mask = 1 << (nr & 31);
89 *ADDR ^= mask;
90}
91
92static __inline__ int test_and_set_bit(int nr, void *addr)
93{
94 int mask, retval;
95 volatile unsigned int *a = (volatile unsigned int *)addr;
96 unsigned long flags;
97
98 a += nr >> 5;
99 mask = 1 << (nr & 0x1f);
100 local_irq_save(flags);
101 retval = (mask & *a) != 0;
102 *a |= mask;
103 local_irq_restore(flags);
104
105 return retval;
106}
107
108static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr)
109{
110 int mask, retval;
111 volatile unsigned int *a = (volatile unsigned int *)addr;
112
113 a += nr >> 5;
114 mask = 1 << (nr & 0x1f);
115 retval = (mask & *a) != 0;
116 *a |= mask;
117 return retval;
118}
119
120static __inline__ int test_and_clear_bit(int nr, volatile unsigned long *addr)
121{
122 int mask, retval;
123 volatile unsigned int *a = (volatile unsigned int *)addr;
124 unsigned long flags;
125
126 a += nr >> 5;
127 mask = 1 << (nr & 0x1f);
128 local_irq_save(flags);
129 retval = (mask & *a) != 0;
130 *a &= ~mask;
131 local_irq_restore(flags);
132
133 return retval;
134}
135
136static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr)
137{
138 int mask, retval;
139 volatile unsigned int *a = (volatile unsigned int *)addr;
140
141 a += nr >> 5;
142 mask = 1 << (nr & 0x1f);
143 retval = (mask & *a) != 0;
144 *a &= ~mask;
145 return retval;
146}
147
148static __inline__ int test_and_change_bit(int nr, volatile unsigned long *addr)
149{
150 int mask, retval;
151 volatile unsigned int *a = (volatile unsigned int *)addr;
152 unsigned long flags;
153
154 a += nr >> 5;
155 mask = 1 << (nr & 0x1f);
156 local_irq_save(flags);
157 retval = (mask & *a) != 0;
158 *a ^= mask;
159 local_irq_restore(flags);
160 return retval;
161}
162
163static __inline__ int __test_and_change_bit(int nr,
164 volatile unsigned long *addr)
165{
166 int mask, retval;
167 volatile unsigned int *a = (volatile unsigned int *)addr;
168
169 a += nr >> 5;
170 mask = 1 << (nr & 0x1f);
171 retval = (mask & *a) != 0;
172 *a ^= mask;
173 return retval;
174}
175
176/*
177 * This routine doesn't need to be atomic.
178 */
179static __inline__ int __constant_test_bit(int nr, const void *addr)
180{
181 return ((1UL << (nr & 31)) &
182 (((const volatile unsigned int *)addr)[nr >> 5])) != 0;
183}
184
185static __inline__ int __test_bit(int nr, const void *addr)
186{
187 int *a = (int *)addr;
188 int mask;
189
190 a += nr >> 5;
191 mask = 1 << (nr & 0x1f);
192 return ((mask & *a) != 0);
193}
194
195#define test_bit(nr,addr) \
196(__builtin_constant_p(nr) ? \
197 __constant_test_bit((nr),(addr)) : \
198 __test_bit((nr),(addr)))
199
200#include <asm-generic/bitops/find.h>
201#include <asm-generic/bitops/hweight.h>
202
203#include <asm-generic/bitops/ext2-atomic.h>
204#include <asm-generic/bitops/ext2-non-atomic.h>
205
206#include <asm-generic/bitops/minix.h>
207
208#endif /* __KERNEL__ */
209
210#include <asm-generic/bitops/fls.h>
211#include <asm-generic/bitops/fls64.h>
212
213#endif /* _BLACKFIN_BITOPS_H */
diff --git a/include/asm-blackfin/blackfin.h b/include/asm-blackfin/blackfin.h
new file mode 100644
index 000000000000..14e58de73973
--- /dev/null
+++ b/include/asm-blackfin/blackfin.h
@@ -0,0 +1,81 @@
1/*
2 * Common header file for blackfin family of processors.
3 *
4 */
5
6#ifndef _BLACKFIN_H_
7#define _BLACKFIN_H_
8
9#include <asm/macros.h>
10#include <asm/mach/blackfin.h>
11#include <asm/bfin-global.h>
12
13#ifndef __ASSEMBLY__
14
15/* SSYNC implementation for C file */
16#if defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
17static inline void SSYNC (void)
18{
19 int _tmp;
20 __asm__ __volatile__ ("cli %0;\n\t"
21 "nop;nop;\n\t"
22 "ssync;\n\t"
23 "sti %0;\n\t"
24 :"=d"(_tmp):);
25}
26#elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
27static inline void SSYNC (void)
28{
29 int _tmp;
30 __asm__ __volatile__ ("cli %0;\n\t"
31 "ssync;\n\t"
32 "sti %0;\n\t"
33 :"=d"(_tmp):);
34}
35#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
36static inline void SSYNC (void)
37{
38 __builtin_bfin_ssync();
39}
40#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
41static inline void SSYNC (void)
42{
43 __asm__ __volatile__ ("ssync;\n\t");
44}
45#endif
46
47/* CSYNC implementation for C file */
48#if defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
49static inline void CSYNC (void)
50{
51 int _tmp;
52 __asm__ __volatile__ ("cli %0;\n\t"
53 "nop;nop;\n\t"
54 "csync;\n\t"
55 "sti %0;\n\t"
56 :"=d"(_tmp):);
57}
58#elif defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
59static inline void CSYNC (void)
60{
61 int _tmp;
62 __asm__ __volatile__ ("cli %0;\n\t"
63 "csync;\n\t"
64 "sti %0;\n\t"
65 :"=d"(_tmp):);
66}
67#elif !defined(ANOMALY_05000312) && defined(ANOMALY_05000244)
68static inline void CSYNC (void)
69{
70 __builtin_bfin_csync();
71}
72#elif !defined(ANOMALY_05000312) && !defined(ANOMALY_05000244)
73static inline void CSYNC (void)
74{
75 __asm__ __volatile__ ("csync;\n\t");
76}
77#endif
78
79#endif /* __ASSEMBLY__ */
80
81#endif /* _BLACKFIN_H_ */
diff --git a/include/asm-blackfin/bug.h b/include/asm-blackfin/bug.h
new file mode 100644
index 000000000000..41e53b29f167
--- /dev/null
+++ b/include/asm-blackfin/bug.h
@@ -0,0 +1,4 @@
1#ifndef _BLACKFIN_BUG_H
2#define _BLACKFIN_BUG_H
3#include <asm-generic/bug.h>
4#endif
diff --git a/include/asm-blackfin/bugs.h b/include/asm-blackfin/bugs.h
new file mode 100644
index 000000000000..9093c9c1fb81
--- /dev/null
+++ b/include/asm-blackfin/bugs.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-blackfin/bugs.h
3 *
4 * Copyright (C) 1994 Linus Torvalds
5 */
6
7/*
8 * This is included by init/main.c to check for architecture-dependent bugs.
9 *
10 * Needs:
11 * void check_bugs(void);
12 */
13
14static void check_bugs(void)
15{
16}
diff --git a/include/asm-blackfin/byteorder.h b/include/asm-blackfin/byteorder.h
new file mode 100644
index 000000000000..6a673d42da18
--- /dev/null
+++ b/include/asm-blackfin/byteorder.h
@@ -0,0 +1,48 @@
1#ifndef _BLACKFIN_BYTEORDER_H
2#define _BLACKFIN_BYTEORDER_H
3
4#include <asm/types.h>
5#include <linux/compiler.h>
6
7#ifdef __GNUC__
8
9static __inline__ __attribute_const__ __u32 ___arch__swahb32(__u32 xx)
10{
11 __u32 tmp;
12 __asm__("%1 = %0 >> 8 (V);\n\t"
13 "%0 = %0 << 8 (V);\n\t"
14 "%0 = %0 | %1;\n\t"
15 : "+d"(xx), "=&d"(tmp));
16 return xx;
17}
18
19static __inline__ __attribute_const__ __u32 ___arch__swahw32(__u32 xx)
20{
21 __u32 rv;
22 __asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv): "d"(xx));
23 return rv;
24}
25
26#define __arch__swahb32(x) ___arch__swahb32(x)
27#define __arch__swahw32(x) ___arch__swahw32(x)
28#define __arch__swab32(x) ___arch__swahb32(___arch__swahw32(x))
29
30static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 xx)
31{
32 __u32 xw = xx;
33 __asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw));
34 return (__u16)xw;
35}
36
37#define __arch__swab16(x) ___arch__swab16(x)
38
39#endif
40
41#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
42# define __BYTEORDER_HAS_U64__
43# define __SWAB_64_THRU_32__
44#endif
45
46#include <linux/byteorder/little_endian.h>
47
48#endif /* _BLACKFIN_BYTEORDER_H */
diff --git a/include/asm-blackfin/cache.h b/include/asm-blackfin/cache.h
new file mode 100644
index 000000000000..023d72133b5a
--- /dev/null
+++ b/include/asm-blackfin/cache.h
@@ -0,0 +1,29 @@
1/*
2 * include/asm-blackfin/cache.h
3 */
4#ifndef __ARCH_BLACKFIN_CACHE_H
5#define __ARCH_BLACKFIN_CACHE_H
6
7/*
8 * Bytes per L1 cache line
9 * Blackfin loads 32 bytes for cache
10 */
11#define L1_CACHE_SHIFT 5
12#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
13#define SMP_CACHE_BYTES L1_CACHE_BYTES
14
15/*
16 * Put cacheline_aliged data to L1 data memory
17 */
18#ifdef CONFIG_CACHELINE_ALIGNED_L1
19#define __cacheline_aligned \
20 __attribute__((__aligned__(L1_CACHE_BYTES), \
21 __section__(".data_l1.cacheline_aligned")))
22#endif
23
24/*
25 * largest L1 which this arch supports
26 */
27#define L1_CACHE_SHIFT_MAX 5
28
29#endif
diff --git a/include/asm-blackfin/cacheflush.h b/include/asm-blackfin/cacheflush.h
new file mode 100644
index 000000000000..e5e000de3c36
--- /dev/null
+++ b/include/asm-blackfin/cacheflush.h
@@ -0,0 +1,90 @@
1/*
2 * File: include/asm-blackfin/cacheflush.h
3 * Based on: include/asm-m68knommu/cacheflush.h
4 * Author: LG Soft India
5 * Copyright (C) 2004 Analog Devices Inc.
6 * Created: Tue Sep 21 2004
7 * Description: Blackfin low-level cache routines adapted from the i386
8 * and PPC versions by Greg Ungerer (gerg@snapgear.com)
9 *
10 * Modified:
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2, or (at your option)
17 * any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; see the file COPYING.
26 * If not, write to the Free Software Foundation,
27 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 */
29
30#ifndef _BLACKFIN_CACHEFLUSH_H
31#define _BLACKFIN_CACHEFLUSH_H
32
33#include <asm/cplb.h>
34
35extern void blackfin_icache_dcache_flush_range(unsigned int, unsigned int);
36extern void blackfin_icache_flush_range(unsigned int, unsigned int);
37extern void blackfin_dcache_flush_range(unsigned int, unsigned int);
38extern void blackfin_dcache_invalidate_range(unsigned int, unsigned int);
39extern void blackfin_dflush_page(void *);
40
41#define flush_dcache_mmap_lock(mapping) do { } while (0)
42#define flush_dcache_mmap_unlock(mapping) do { } while (0)
43#define flush_cache_mm(mm) do { } while (0)
44#define flush_cache_range(vma, start, end) do { } while (0)
45#define flush_cache_page(vma, vmaddr) do { } while (0)
46#define flush_cache_vmap(start, end) do { } while (0)
47#define flush_cache_vunmap(start, end) do { } while (0)
48
49static inline void flush_icache_range(unsigned start, unsigned end)
50{
51#if defined(CONFIG_BLKFIN_DCACHE) && defined(CONFIG_BLKFIN_CACHE)
52
53# if defined(CONFIG_BLKFIN_WT)
54 blackfin_icache_flush_range((start), (end));
55# else
56 blackfin_icache_dcache_flush_range((start), (end));
57# endif
58
59#else
60
61# if defined(CONFIG_BLKFIN_CACHE)
62 blackfin_icache_flush_range((start), (end));
63# endif
64# if defined(CONFIG_BLKFIN_DCACHE)
65 blackfin_dcache_flush_range((start), (end));
66# endif
67
68#endif
69}
70
71#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
72do { memcpy(dst, src, len); \
73 flush_icache_range ((unsigned) (dst), (unsigned) (dst) + (len)); \
74} while (0)
75#define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
76
77#if defined(CONFIG_BLKFIN_DCACHE)
78# define invalidate_dcache_range(start,end) blackfin_dcache_invalidate_range((start), (end))
79#else
80# define invalidate_dcache_range(start,end) do { } while (0)
81#endif
82#if defined(CONFIG_BLKFIN_DCACHE) && defined(CONFIG_BLKFIN_WB)
83# define flush_dcache_range(start,end) blackfin_dcache_flush_range((start), (end))
84# define flush_dcache_page(page) blackfin_dflush_page(page_address(page))
85#else
86# define flush_dcache_range(start,end) do { } while (0)
87# define flush_dcache_page(page) do { } while (0)
88#endif
89
90#endif /* _BLACKFIN_CACHEFLUSH_H */
diff --git a/include/asm-blackfin/checksum.h b/include/asm-blackfin/checksum.h
new file mode 100644
index 000000000000..2638f2586d2f
--- /dev/null
+++ b/include/asm-blackfin/checksum.h
@@ -0,0 +1,101 @@
1#ifndef _BFIN_CHECKSUM_H
2#define _BFIN_CHECKSUM_H
3
4/*
5 * MODIFIED FOR BFIN April 30, 2001 akbar.hussain@lineo.com
6 *
7 * computes the checksum of a memory block at buff, length len,
8 * and adds in "sum" (32-bit)
9 *
10 * returns a 32-bit number suitable for feeding into itself
11 * or csum_tcpudp_magic
12 *
13 * this function must be called with even lengths, except
14 * for the last fragment, which may be odd
15 *
16 * it's best to have buff aligned on a 32-bit boundary
17 */
18unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum);
19
20/*
21 * the same as csum_partial, but copies from src while it
22 * checksums
23 *
24 * here even more important to align src and dst on a 32-bit (or even
25 * better 64-bit) boundary
26 */
27
28unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst,
29 int len, int sum);
30
31/*
32 * the same as csum_partial_copy, but copies from user space.
33 *
34 * here even more important to align src and dst on a 32-bit (or even
35 * better 64-bit) boundary
36 */
37
38extern unsigned int csum_partial_copy_from_user(const unsigned char *src,
39 unsigned char *dst, int len,
40 int sum, int *csum_err);
41
42#define csum_partial_copy_nocheck(src, dst, len, sum) \
43 csum_partial_copy((src), (dst), (len), (sum))
44
45unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl);
46
47/*
48 * Fold a partial checksum
49 */
50
51static inline unsigned int csum_fold(unsigned int sum)
52{
53 while (sum >> 16)
54 sum = (sum & 0xffff) + (sum >> 16);
55 return ((~(sum << 16)) >> 16);
56}
57
58/*
59 * computes the checksum of the TCP/UDP pseudo-header
60 * returns a 16-bit checksum, already complemented
61 */
62
63static inline unsigned int
64csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
65 unsigned short proto, unsigned int sum)
66{
67
68 __asm__ ("%0 = %0 + %1;\n\t"
69 "CC = AC0;\n\t"
70 "if !CC jump 4;\n\t"
71 "%0 = %0 + %4;\n\t"
72 "%0 = %0 + %2;\n\t"
73 "CC = AC0;\n\t"
74 "if !CC jump 4;\n\t"
75 "%0 = %0 + %4;\n\t"
76 "%0 = %0 + %3;\n\t"
77 "CC = AC0;\n\t"
78 "if !CC jump 4;\n\t"
79 "%0 = %0 + %4;\n\t"
80 "NOP;\n\t"
81 : "=d" (sum)
82 : "d" (daddr), "d" (saddr), "d" ((ntohs(len)<<16)+proto*256), "d" (1), "0"(sum));
83
84 return (sum);
85}
86
87static inline unsigned short int
88csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
89 unsigned short proto, unsigned int sum)
90{
91 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
92}
93
94/*
95 * this routine is used for miscellaneous IP-like checksums, mainly
96 * in icmp.c
97 */
98
99extern unsigned short ip_compute_csum(const unsigned char *buff, int len);
100
101#endif /* _BFIN_CHECKSUM_H */
diff --git a/include/asm-blackfin/cplb.h b/include/asm-blackfin/cplb.h
new file mode 100644
index 000000000000..e0dd56bfa4c7
--- /dev/null
+++ b/include/asm-blackfin/cplb.h
@@ -0,0 +1,51 @@
1/************************************************************************
2 *
3 * cplb.h
4 *
5 * (c) Copyright 2002-2003 Analog Devices, Inc. All rights reserved.
6 *
7 ************************************************************************/
8
9/* Defines necessary for cplb initialisation routines. */
10
11#ifndef _CPLB_H
12#define _CPLB_H
13
14# include <asm/blackfin.h>
15
16#define CPLB_ENABLE_ICACHE_P 0
17#define CPLB_ENABLE_DCACHE_P 1
18#define CPLB_ENABLE_DCACHE2_P 2
19#define CPLB_ENABLE_CPLBS_P 3 /* Deprecated! */
20#define CPLB_ENABLE_ICPLBS_P 4
21#define CPLB_ENABLE_DCPLBS_P 5
22
23#define CPLB_ENABLE_ICACHE (1<<CPLB_ENABLE_ICACHE_P)
24#define CPLB_ENABLE_DCACHE (1<<CPLB_ENABLE_DCACHE_P)
25#define CPLB_ENABLE_DCACHE2 (1<<CPLB_ENABLE_DCACHE2_P)
26#define CPLB_ENABLE_CPLBS (1<<CPLB_ENABLE_CPLBS_P)
27#define CPLB_ENABLE_ICPLBS (1<<CPLB_ENABLE_ICPLBS_P)
28#define CPLB_ENABLE_DCPLBS (1<<CPLB_ENABLE_DCPLBS_P)
29#define CPLB_ENABLE_ANY_CPLBS CPLB_ENABLE_CPLBS | \
30 CPLB_ENABLE_ICPLBS | \
31 CPLB_ENABLE_DCPLBS
32
33#define CPLB_RELOADED 0x0000
34#define CPLB_NO_UNLOCKED 0x0001
35#define CPLB_NO_ADDR_MATCH 0x0002
36#define CPLB_PROT_VIOL 0x0003
37#define CPLB_UNKNOWN_ERR 0x0004
38
39#define CPLB_DEF_CACHE CPLB_L1_CHBL | CPLB_WT
40#define CPLB_CACHE_ENABLED CPLB_L1_CHBL | CPLB_DIRTY
41
42#define CPLB_ALL_ACCESS CPLB_SUPV_WR | CPLB_USER_RD | CPLB_USER_WR
43
44#define CPLB_I_PAGE_MGMT CPLB_LOCK | CPLB_VALID
45#define CPLB_D_PAGE_MGMT CPLB_LOCK | CPLB_ALL_ACCESS | CPLB_VALID
46#define CPLB_DNOCACHE CPLB_ALL_ACCESS | CPLB_VALID
47#define CPLB_DDOCACHE CPLB_DNOCACHE | CPLB_DEF_CACHE
48#define CPLB_INOCACHE CPLB_USER_RD | CPLB_VALID
49#define CPLB_IDOCACHE CPLB_INOCACHE | CPLB_L1_CHBL
50
51#endif /* _CPLB_H */
diff --git a/include/asm-blackfin/cplbinit.h b/include/asm-blackfin/cplbinit.h
new file mode 100644
index 000000000000..3bad2d1e6a8c
--- /dev/null
+++ b/include/asm-blackfin/cplbinit.h
@@ -0,0 +1,203 @@
1/*
2 * File: include/asm-blackfin/cplbinit.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <asm/blackfin.h>
31#include <asm/cplb.h>
32
33#define INITIAL_T 0x1
34#define SWITCH_T 0x2
35#define I_CPLB 0x4
36#define D_CPLB 0x8
37
38#define IN_KERNEL 1
39
40enum
41{ZERO_P, L1I_MEM, L1D_MEM, SDRAM_KERN , SDRAM_RAM_MTD, SDRAM_DMAZ, RES_MEM, ASYNC_MEM, L2_MEM};
42
43struct cplb_desc {
44 u32 start; /* start address */
45 u32 end; /* end address */
46 u32 psize; /* prefered size if any otherwise 1MB or 4MB*/
47 u16 attr;/* attributes */
48 u16 i_conf;/* I-CPLB DATA */
49 u16 d_conf;/* D-CPLB DATA */
50 u16 valid;/* valid */
51 const s8 name[30];/* name */
52};
53
54struct cplb_tab {
55 u_long *tab;
56 u16 pos;
57 u16 size;
58};
59
60u_long icplb_table[MAX_CPLBS+1];
61u_long dcplb_table[MAX_CPLBS+1];
62
63/* Till here we are discussing about the static memory management model.
64 * However, the operating envoronments commonly define more CPLB
65 * descriptors to cover the entire addressable memory than will fit into
66 * the available on-chip 16 CPLB MMRs. When this happens, the below table
67 * will be used which will hold all the potentially required CPLB descriptors
68 *
69 * This is how Page descriptor Table is implemented in uClinux/Blackfin.
70 */
71
72#ifdef CONFIG_CPLB_SWITCH_TAB_L1
73u_long ipdt_table[MAX_SWITCH_I_CPLBS+1]__attribute__((l1_data));
74u_long dpdt_table[MAX_SWITCH_D_CPLBS+1]__attribute__((l1_data));
75
76#ifdef CONFIG_CPLB_INFO
77u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS]__attribute__((l1_data));
78u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS]__attribute__((l1_data));
79#endif /* CONFIG_CPLB_INFO */
80
81#else
82
83u_long ipdt_table[MAX_SWITCH_I_CPLBS+1];
84u_long dpdt_table[MAX_SWITCH_D_CPLBS+1];
85
86#ifdef CONFIG_CPLB_INFO
87u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS];
88u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS];
89#endif /* CONFIG_CPLB_INFO */
90
91#endif /*CONFIG_CPLB_SWITCH_TAB_L1*/
92
93struct s_cplb {
94 struct cplb_tab init_i;
95 struct cplb_tab init_d;
96 struct cplb_tab switch_i;
97 struct cplb_tab switch_d;
98};
99
100#if defined(CONFIG_BLKFIN_DCACHE) || defined(CONFIG_BLKFIN_CACHE)
101static struct cplb_desc cplb_data[] = {
102 {
103 .start = 0,
104 .end = SIZE_4K,
105 .psize = SIZE_4K,
106 .attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB,
107 .i_conf = SDRAM_OOPS,
108 .d_conf = SDRAM_OOPS,
109#if defined(CONFIG_DEBUG_HUNT_FOR_ZERO)
110 .valid = 1,
111#else
112 .valid = 0,
113#endif
114 .name = "ZERO Pointer Saveguard",
115 },
116 {
117 .start = L1_CODE_START,
118 .end = L1_CODE_START + L1_CODE_LENGTH,
119 .psize = SIZE_4M,
120 .attr = INITIAL_T | SWITCH_T | I_CPLB,
121 .i_conf = L1_IMEMORY,
122 .d_conf = 0,
123 .valid = 1,
124 .name = "L1 I-Memory",
125 },
126 {
127 .start = L1_DATA_A_START,
128 .end = L1_DATA_B_START + L1_DATA_B_LENGTH,
129 .psize = SIZE_4M,
130 .attr = INITIAL_T | SWITCH_T | D_CPLB,
131 .i_conf = 0,
132 .d_conf = L1_DMEMORY,
133#if ((L1_DATA_A_LENGTH > 0) || (L1_DATA_B_LENGTH > 0))
134 .valid = 1,
135#else
136 .valid = 0,
137#endif
138 .name = "L1 D-Memory",
139 },
140 {
141 .start = 0,
142 .end = 0, /* dynamic */
143 .psize = 0,
144 .attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB,
145 .i_conf = SDRAM_IGENERIC,
146 .d_conf = SDRAM_DGENERIC,
147 .valid = 1,
148 .name = "SDRAM Kernel",
149 },
150 {
151 .start = 0, /* dynamic */
152 .end = 0, /* dynamic */
153 .psize = 0,
154 .attr = INITIAL_T | SWITCH_T | D_CPLB,
155 .i_conf = SDRAM_IGENERIC,
156 .d_conf = SDRAM_DNON_CHBL,
157 .valid = 1,
158 .name = "SDRAM RAM MTD",
159 },
160 {
161 .start = 0, /* dynamic */
162 .end = 0, /* dynamic */
163 .psize = SIZE_1M,
164 .attr = INITIAL_T | SWITCH_T | D_CPLB,
165 .d_conf = SDRAM_DNON_CHBL,
166 .valid = 1,//(DMA_UNCACHED_REGION > 0),
167 .name = "SDRAM Uncached DMA ZONE",
168 },
169 {
170 .start = 0, /* dynamic */
171 .end = 0, /* dynamic */
172 .psize = 0,
173 .attr = SWITCH_T | D_CPLB,
174 .i_conf = 0, /* dynamic */
175 .d_conf = 0, /* dynamic */
176 .valid = 1,
177 .name = "SDRAM Reserved Memory",
178 },
179 {
180 .start = ASYNC_BANK0_BASE,
181 .end = ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE,
182 .psize = 0,
183 .attr = SWITCH_T | D_CPLB,
184 .d_conf = SDRAM_EBIU,
185 .valid = 1,
186 .name = "ASYNC Memory",
187 },
188 {
189#if defined(CONFIG_BF561)
190 .start = L2_SRAM,
191 .end = L2_SRAM_END,
192 .psize = SIZE_1M,
193 .attr = SWITCH_T | D_CPLB,
194 .i_conf = L2_MEMORY,
195 .d_conf = L2_MEMORY,
196 .valid = 1,
197#else
198 .valid = 0,
199#endif
200 .name = "L2 Memory",
201 }
202};
203#endif
diff --git a/include/asm-blackfin/cpumask.h b/include/asm-blackfin/cpumask.h
new file mode 100644
index 000000000000..b20a8e9012cb
--- /dev/null
+++ b/include/asm-blackfin/cpumask.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_BLACKFIN_CPUMASK_H
2#define _ASM_BLACKFIN_CPUMASK_H
3
4#include <asm-generic/cpumask.h>
5
6#endif /* _ASM_BLACKFIN_CPUMASK_H */
diff --git a/include/asm-blackfin/cputime.h b/include/asm-blackfin/cputime.h
new file mode 100644
index 000000000000..2b19705f9885
--- /dev/null
+++ b/include/asm-blackfin/cputime.h
@@ -0,0 +1,6 @@
1#ifndef __BLACKFIN_CPUTIME_H
2#define __BLACKFIN_CPUTIME_H
3
4#include <asm-generic/cputime.h>
5
6#endif /* __BLACKFIN_CPUTIME_H */
diff --git a/include/asm-blackfin/current.h b/include/asm-blackfin/current.h
new file mode 100644
index 000000000000..31918d29122c
--- /dev/null
+++ b/include/asm-blackfin/current.h
@@ -0,0 +1,23 @@
1#ifndef _BLACKFIN_CURRENT_H
2#define _BLACKFIN_CURRENT_H
3/*
4 * current.h
5 * (C) Copyright 2000, Lineo, David McCullough <davidm@lineo.com>
6 *
7 * rather than dedicate a register (as the m68k source does), we
8 * just keep a global, we should probably just change it all to be
9 * current and lose _current_task.
10 */
11#include <linux/thread_info.h>
12
13struct task_struct;
14
15static inline struct task_struct *get_current(void) __attribute__ ((__const__));
16static inline struct task_struct *get_current(void)
17{
18 return (current_thread_info()->task);
19}
20
21#define current (get_current())
22
23#endif /* _BLACKFIN_CURRENT_H */
diff --git a/include/asm-blackfin/delay.h b/include/asm-blackfin/delay.h
new file mode 100644
index 000000000000..52e7a10d7ff8
--- /dev/null
+++ b/include/asm-blackfin/delay.h
@@ -0,0 +1,44 @@
1#ifndef _BLACKFIN_DELAY_H
2#define _BLACKFIN_DELAY_H
3
4static inline void __delay(unsigned long loops)
5{
6
7/* FIXME: Currently the assembler doesn't recognize Loop Register Clobbers,
8 uncomment this as soon those are implemented */
9/*
10 __asm__ __volatile__ ( "\t LSETUP (1f,1f) LC0= %0\n\t"
11 "1:\t NOP;\n\t"
12 : :"a" (loops)
13 : "LT0","LB0","LC0");
14
15*/
16
17 __asm__ __volatile__("[--SP] = LC0;\n\t"
18 "[--SP] = LT0;\n\t"
19 "[--SP] = LB0;\n\t"
20 "LSETUP (1f,1f) LC0 = %0;\n\t"
21 "1:\t NOP;\n\t"
22 "LB0 = [SP++];\n\t"
23 "LT0 = [SP++];\n\t"
24 "LC0 = [SP++];\n"
25 :
26 :"a" (loops));
27}
28
29#include <linux/param.h> /* needed for HZ */
30
31/*
32 * Use only for very small delays ( < 1 msec). Should probably use a
33 * lookup table, really, as the multiplications take much too long with
34 * short delays. This is a "reasonable" implementation, though (and the
35 * first constant multiplications gets optimized away if the delay is
36 * a constant)
37 */
38static inline void udelay(unsigned long usecs)
39{
40 extern unsigned long loops_per_jiffy;
41 __delay(usecs * loops_per_jiffy / (1000000 / HZ));
42}
43
44#endif /* defined(_BLACKFIN_DELAY_H) */
diff --git a/include/asm-blackfin/device.h b/include/asm-blackfin/device.h
new file mode 100644
index 000000000000..d8f9872b0e2d
--- /dev/null
+++ b/include/asm-blackfin/device.h
@@ -0,0 +1,7 @@
1/*
2 * Arch specific extensions to struct device
3 *
4 * This file is released under the GPLv2
5 */
6#include <asm-generic/device.h>
7
diff --git a/include/asm-blackfin/div64.h b/include/asm-blackfin/div64.h
new file mode 100644
index 000000000000..6cd978cefb28
--- /dev/null
+++ b/include/asm-blackfin/div64.h
@@ -0,0 +1 @@
#include <asm-generic/div64.h>
diff --git a/include/asm-blackfin/dma-mapping.h b/include/asm-blackfin/dma-mapping.h
new file mode 100644
index 000000000000..7a77d7fe3a33
--- /dev/null
+++ b/include/asm-blackfin/dma-mapping.h
@@ -0,0 +1,66 @@
1#ifndef _BLACKFIN_DMA_MAPPING_H
2#define _BLACKFIN_DMA_MAPPING_H
3
4#include <asm/scatterlist.h>
5
6void dma_alloc_init(unsigned long start, unsigned long end);
7void *dma_alloc_coherent(struct device *dev, size_t size,
8 dma_addr_t *dma_handle, gfp_t gfp);
9void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
10 dma_addr_t dma_handle);
11
12/*
13 * Now for the API extensions over the pci_ one
14 */
15#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
16#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
17
18/*
19 * Map a single buffer of the indicated size for DMA in streaming mode.
20 * The 32-bit bus address to use is returned.
21 *
22 * Once the device is given the dma address, the device owns this memory
23 * until either pci_unmap_single or pci_dma_sync_single is performed.
24 */
25extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
26 enum dma_data_direction direction);
27
28/*
29 * Unmap a single streaming mode DMA translation. The dma_addr and size
30 * must match what was provided for in a previous pci_map_single call. All
31 * other usages are undefined.
32 *
33 * After this call, reads by the cpu to the buffer are guarenteed to see
34 * whatever the device wrote there.
35 */
36extern void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
37 enum dma_data_direction direction);
38
39/*
40 * Map a set of buffers described by scatterlist in streaming
41 * mode for DMA. This is the scather-gather version of the
42 * above pci_map_single interface. Here the scatter gather list
43 * elements are each tagged with the appropriate dma address
44 * and length. They are obtained via sg_dma_{address,length}(SG).
45 *
46 * NOTE: An implementation may be able to use a smaller number of
47 * DMA address/length pairs than there are SG table elements.
48 * (for example via virtual mapping capabilities)
49 * The routine returns the number of addr/length pairs actually
50 * used, at most nents.
51 *
52 * Device ownership issues as mentioned above for pci_map_single are
53 * the same here.
54 */
55extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
56 enum dma_data_direction direction);
57
58/*
59 * Unmap a set of streaming mode DMA translations.
60 * Again, cpu read rules concerning calls here are the same as for
61 * pci_unmap_single() above.
62 */
63extern void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
64 int nhwentries, enum dma_data_direction direction);
65
66#endif /* _BLACKFIN_DMA_MAPPING_H */
diff --git a/include/asm-blackfin/dma.h b/include/asm-blackfin/dma.h
new file mode 100644
index 000000000000..be0d913e5516
--- /dev/null
+++ b/include/asm-blackfin/dma.h
@@ -0,0 +1,188 @@
1/*
2 * File: include/asm-blackfin/simple_bf533_dma.h
3 * Based on: none - original work
4 * Author: LG Soft India
5 * Copyright (C) 2004-2005 Analog Devices Inc.
6 * Created: Tue Sep 21 2004
7 * Description: This file contains the major Data structures and constants
8 * used for DMA Implementation in BF533
9 * Modified:
10 *
11 * Bugs: Enter bugs at http://blackfin.uclinux.org/
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; see the file COPYING.
25 * If not, write to the Free Software Foundation,
26 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */
28
29#ifndef _BLACKFIN_DMA_H_
30#define _BLACKFIN_DMA_H_
31
32#include <asm/io.h>
33#include <linux/slab.h>
34#include <asm/irq.h>
35#include <asm/signal.h>
36#include <asm/semaphore.h>
37
38#include <linux/kernel.h>
39#include <asm/mach/dma.h>
40#include <linux/mm.h>
41#include <linux/interrupt.h>
42#include <asm/blackfin.h>
43
44#define MAX_DMA_ADDRESS PAGE_OFFSET
45
46/*****************************************************************************
47* Generic DMA Declarations
48*
49****************************************************************************/
50enum dma_chan_status {
51 DMA_CHANNEL_FREE,
52 DMA_CHANNEL_REQUESTED,
53 DMA_CHANNEL_ENABLED,
54};
55
56/*-------------------------
57 * config reg bits value
58 *-------------------------*/
59#define DATA_SIZE_8 0
60#define DATA_SIZE_16 1
61#define DATA_SIZE_32 2
62
63#define DMA_FLOW_STOP 0
64#define DMA_FLOW_AUTO 1
65#define DMA_FLOW_ARRAY 4
66#define DMA_FLOW_SMALL 6
67#define DMA_FLOW_LARGE 7
68
69#define DIMENSION_LINEAR 0
70#define DIMENSION_2D 1
71
72#define DIR_READ 0
73#define DIR_WRITE 1
74
75#define INTR_DISABLE 0
76#define INTR_ON_BUF 2
77#define INTR_ON_ROW 3
78
79struct dmasg {
80 unsigned long next_desc_addr;
81 unsigned long start_addr;
82 unsigned short cfg;
83 unsigned short x_count;
84 short x_modify;
85 unsigned short y_count;
86 short y_modify;
87} __attribute__((packed));
88
89struct dma_register {
90 unsigned long next_desc_ptr; /* DMA Next Descriptor Pointer register */
91 unsigned long start_addr; /* DMA Start address register */
92
93 unsigned short cfg; /* DMA Configuration register */
94 unsigned short dummy1; /* DMA Configuration register */
95
96 unsigned long reserved;
97
98 unsigned short x_count; /* DMA x_count register */
99 unsigned short dummy2;
100
101 short x_modify; /* DMA x_modify register */
102 unsigned short dummy3;
103
104 unsigned short y_count; /* DMA y_count register */
105 unsigned short dummy4;
106
107 short y_modify; /* DMA y_modify register */
108 unsigned short dummy5;
109
110 unsigned long curr_desc_ptr; /* DMA Current Descriptor Pointer
111 register */
112 unsigned short curr_addr_ptr_lo; /* DMA Current Address Pointer
113 register */
114 unsigned short curr_addr_ptr_hi; /* DMA Current Address Pointer
115 register */
116 unsigned short irq_status; /* DMA irq status register */
117 unsigned short dummy6;
118
119 unsigned short peripheral_map; /* DMA peripheral map register */
120 unsigned short dummy7;
121
122 unsigned short curr_x_count; /* DMA Current x-count register */
123 unsigned short dummy8;
124
125 unsigned long reserved2;
126
127 unsigned short curr_y_count; /* DMA Current y-count register */
128 unsigned short dummy9;
129
130 unsigned long reserved3;
131
132};
133
134typedef irqreturn_t(*dma_interrupt_t) (int irq, void *dev_id);
135
136struct dma_channel {
137 struct mutex dmalock;
138 char *device_id;
139 enum dma_chan_status chan_status;
140 struct dma_register *regs;
141 struct dmasg *sg; /* large mode descriptor */
142 unsigned int ctrl_num; /* controller number */
143 dma_interrupt_t irq_callback;
144 void *data;
145 unsigned int dma_enable_flag;
146 unsigned int loopback_flag;
147};
148
149/*******************************************************************************
150* DMA API's
151*******************************************************************************/
152/* functions to set register mode */
153void set_dma_start_addr(unsigned int channel, unsigned long addr);
154void set_dma_next_desc_addr(unsigned int channel, unsigned long addr);
155void set_dma_x_count(unsigned int channel, unsigned short x_count);
156void set_dma_x_modify(unsigned int channel, short x_modify);
157void set_dma_y_count(unsigned int channel, unsigned short y_count);
158void set_dma_y_modify(unsigned int channel, short y_modify);
159void set_dma_config(unsigned int channel, unsigned short config);
160unsigned short set_bfin_dma_config(char direction, char flow_mode,
161 char intr_mode, char dma_mode, char width);
162
163/* get curr status for polling */
164unsigned short get_dma_curr_irqstat(unsigned int channel);
165unsigned short get_dma_curr_xcount(unsigned int channel);
166unsigned short get_dma_curr_ycount(unsigned int channel);
167
168/* set large DMA mode descriptor */
169void set_dma_sg(unsigned int channel, struct dmasg *sg, int nr_sg);
170
171/* check if current channel is in use */
172int dma_channel_active(unsigned int channel);
173
174/* common functions must be called in any mode */
175void free_dma(unsigned int channel);
176int dma_channel_active(unsigned int channel); /* check if a channel is in use */
177void disable_dma(unsigned int channel);
178void enable_dma(unsigned int channel);
179int request_dma(unsigned int channel, char *device_id);
180int set_dma_callback(unsigned int channel, dma_interrupt_t callback,
181 void *data);
182void dma_disable_irq(unsigned int channel);
183void dma_enable_irq(unsigned int channel);
184void clear_dma_irqstat(unsigned int channel);
185void *dma_memcpy(void *dest, const void *src, size_t count);
186void *safe_dma_memcpy(void *dest, const void *src, size_t count);
187
188#endif
diff --git a/include/asm-blackfin/dpmc.h b/include/asm-blackfin/dpmc.h
new file mode 100644
index 000000000000..f162edb23033
--- /dev/null
+++ b/include/asm-blackfin/dpmc.h
@@ -0,0 +1,70 @@
1/*
2 * include/asm-blackfin/dpmc.h - Miscellaneous IOCTL commands for Dynamic Power
3 * Management Controller Driver.
4 * Copyright (C) 2004 Analog Device Inc.
5 *
6 */
7#ifndef _BLACKFIN_DPMC_H_
8#define _BLACKFIN_DPMC_H_
9
10#define SLEEP_MODE 1
11#define DEEP_SLEEP_MODE 2
12#define ACTIVE_PLL_DISABLED 3
13#define FULLON_MODE 4
14#define ACTIVE_PLL_ENABLED 5
15#define HIBERNATE_MODE 6
16
17#define IOCTL_FULL_ON_MODE _IO('s', 0xA0)
18#define IOCTL_ACTIVE_MODE _IO('s', 0xA1)
19#define IOCTL_SLEEP_MODE _IO('s', 0xA2)
20#define IOCTL_DEEP_SLEEP_MODE _IO('s', 0xA3)
21#define IOCTL_HIBERNATE_MODE _IO('s', 0xA4)
22#define IOCTL_CHANGE_FREQUENCY _IOW('s', 0xA5, unsigned long)
23#define IOCTL_CHANGE_VOLTAGE _IOW('s', 0xA6, unsigned long)
24#define IOCTL_SET_CCLK _IOW('s', 0xA7, unsigned long)
25#define IOCTL_SET_SCLK _IOW('s', 0xA8, unsigned long)
26#define IOCTL_GET_PLLSTATUS _IOW('s', 0xA9, unsigned long)
27#define IOCTL_GET_CORECLOCK _IOW('s', 0xAA, unsigned long)
28#define IOCTL_GET_SYSTEMCLOCK _IOW('s', 0xAB, unsigned long)
29#define IOCTL_GET_VCO _IOW('s', 0xAC, unsigned long)
30#define IOCTL_DISABLE_WDOG_TIMER _IO('s', 0xAD)
31#define IOCTL_UNMASK_WDOG_WAKEUP_EVENT _IO('s',0xAE)
32#define IOCTL_PROGRAM_WDOG_TIMER _IOW('s',0xAF,unsigned long)
33#define IOCTL_CLEAR_WDOG_WAKEUP_EVENT _IO('s',0xB0)
34#define IOCTL_SLEEP_DEEPER_MODE _IO('s',0xB1)
35
36#define DPMC_MINOR 254
37
38#define ON 0
39#define OFF 1
40
41#ifdef __KERNEL__
42
43unsigned long calc_volt(void);
44int calc_vlev(int vlt);
45unsigned long change_voltage(unsigned long volt);
46int calc_msel(int vco_hz);
47unsigned long change_frequency(unsigned long vco_mhz);
48int set_pll_div(unsigned short sel, unsigned char flag);
49int get_vco(void);
50unsigned long change_system_clock(unsigned long clock);
51unsigned long change_core_clock(unsigned long clock);
52unsigned long get_pll_status(void);
53void change_baud(int baud);
54void fullon_mode(void);
55void active_mode(void);
56void sleep_mode(u32 sic_iwr);
57void deep_sleep(u32 sic_iwr);
58void hibernate_mode(u32 sic_iwr);
59void sleep_deeper(u32 sic_iwr);
60void program_wdog_timer(unsigned long);
61void unmask_wdog_wakeup_evt(void);
62void clear_wdog_wakeup_evt(void);
63void disable_wdog_timer(void);
64
65extern unsigned long get_cclk(void);
66extern unsigned long get_sclk(void);
67
68#endif /* __KERNEL__ */
69
70#endif /*_BLACKFIN_DPMC_H_*/
diff --git a/include/asm-blackfin/elf.h b/include/asm-blackfin/elf.h
new file mode 100644
index 000000000000..5264b5536a70
--- /dev/null
+++ b/include/asm-blackfin/elf.h
@@ -0,0 +1,127 @@
1/* Changes made by LG Soft Oct 2004*/
2
3#ifndef __ASMBFIN_ELF_H
4#define __ASMBFIN_ELF_H
5
6/*
7 * ELF register definitions..
8 */
9
10#include <asm/ptrace.h>
11#include <asm/user.h>
12
13/* Processor specific flags for the ELF header e_flags field. */
14#define EF_BFIN_PIC 0x00000001 /* -fpic */
15#define EF_BFIN_FDPIC 0x00000002 /* -mfdpic */
16#define EF_BFIN_CODE_IN_L1 0x00000010 /* --code-in-l1 */
17#define EF_BFIN_DATA_IN_L1 0x00000020 /* --data-in-l1 */
18
19typedef unsigned long elf_greg_t;
20
21#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
22typedef elf_greg_t elf_gregset_t[ELF_NGREG];
23
24typedef struct user_bfinfp_struct elf_fpregset_t;
25/*
26 * This is used to ensure we don't load something for the wrong architecture.
27 */
28#define elf_check_arch(x) ((x)->e_machine == EM_BLACKFIN)
29
30#define elf_check_fdpic(x) ((x)->e_flags & EF_BFIN_FDPIC /* && !((x)->e_flags & EF_FRV_NON_PIC_RELOCS) */)
31#define elf_check_const_displacement(x) ((x)->e_flags & EF_BFIN_PIC)
32
33/* EM_BLACKFIN defined in linux/elf.h */
34
35/*
36 * These are used to set parameters in the core dumps.
37 */
38#define ELF_CLASS ELFCLASS32
39#define ELF_DATA ELFDATA2LSB
40#define ELF_ARCH EM_BLACKFIN
41
42#define ELF_PLAT_INIT(_r) _r->p1 = 0
43
44#define ELF_FDPIC_PLAT_INIT(_regs, _exec_map_addr, _interp_map_addr, _dynamic_addr) \
45do { \
46 _regs->r7 = 0; \
47 _regs->p0 = _exec_map_addr; \
48 _regs->p1 = _interp_map_addr; \
49 _regs->p2 = _dynamic_addr; \
50} while(0)
51
52#define USE_ELF_CORE_DUMP
53#define ELF_FDPIC_CORE_EFLAGS EF_BFIN_FDPIC
54#define ELF_EXEC_PAGESIZE 4096
55
56#define R_unused0 0 /* relocation type 0 is not defined */
57#define R_pcrel5m2 1 /*LSETUP part a */
58#define R_unused1 2 /* relocation type 2 is not defined */
59#define R_pcrel10 3 /* type 3, if cc jump <target> */
60#define R_pcrel12_jump 4 /* type 4, jump <target> */
61#define R_rimm16 5 /* type 0x5, rN = <target> */
62#define R_luimm16 6 /* # 0x6, preg.l=<target> Load imm 16 to lower half */
63#define R_huimm16 7 /* # 0x7, preg.h=<target> Load imm 16 to upper half */
64#define R_pcrel12_jump_s 8 /* # 0x8 jump.s <target> */
65#define R_pcrel24_jump_x 9 /* # 0x9 jump.x <target> */
66#define R_pcrel24 10 /* # 0xa call <target> , not expandable */
67#define R_unusedb 11 /* # 0xb not generated */
68#define R_unusedc 12 /* # 0xc not used */
69#define R_pcrel24_jump_l 13 /*0xd jump.l <target> */
70#define R_pcrel24_call_x 14 /* 0xE, call.x <target> if <target> is above 24 bit limit call through P1 */
71#define R_var_eq_symb 15 /* 0xf, linker should treat it same as 0x12 */
72#define R_byte_data 16 /* 0x10, .byte var = symbol */
73#define R_byte2_data 17 /* 0x11, .byte2 var = symbol */
74#define R_byte4_data 18 /* 0x12, .byte4 var = symbol and .var var=symbol */
75#define R_pcrel11 19 /* 0x13, lsetup part b */
76#define R_unused14 20 /* 0x14, undefined */
77#define R_unused15 21 /* not generated by VDSP 3.5 */
78
79/* arithmetic relocations */
80#define R_push 0xE0
81#define R_const 0xE1
82#define R_add 0xE2
83#define R_sub 0xE3
84#define R_mult 0xE4
85#define R_div 0xE5
86#define R_mod 0xE6
87#define R_lshift 0xE7
88#define R_rshift 0xE8
89#define R_and 0xE9
90#define R_or 0xEA
91#define R_xor 0xEB
92#define R_land 0xEC
93#define R_lor 0xED
94#define R_len 0xEE
95#define R_neg 0xEF
96#define R_comp 0xF0
97#define R_page 0xF1
98#define R_hwpage 0xF2
99#define R_addr 0xF3
100
101/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
102 use of this is to invoke "./ld.so someprog" to test out a new version of
103 the loader. We need to make sure that it is out of the way of the program
104 that it will "exec", and that there is sufficient room for the brk. */
105
106#define ELF_ET_DYN_BASE 0xD0000000UL
107
108#define ELF_CORE_COPY_REGS(pr_reg, regs) \
109 memcpy((char *) &pr_reg, (char *)regs, \
110 sizeof(struct pt_regs));
111
112/* This yields a mask that user programs can use to figure out what
113 instruction set this cpu supports. */
114
115#define ELF_HWCAP (0)
116
117/* This yields a string that ld.so will use to load implementation
118 specific libraries for optimization. This is more specific in
119 intent than poking at uname or /proc/cpuinfo. */
120
121#define ELF_PLATFORM (NULL)
122
123#ifdef __KERNEL__
124#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
125#endif
126
127#endif
diff --git a/include/asm-blackfin/emergency-restart.h b/include/asm-blackfin/emergency-restart.h
new file mode 100644
index 000000000000..27f6c785d103
--- /dev/null
+++ b/include/asm-blackfin/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-blackfin/entry.h b/include/asm-blackfin/entry.h
new file mode 100644
index 000000000000..562c6d3a3232
--- /dev/null
+++ b/include/asm-blackfin/entry.h
@@ -0,0 +1,56 @@
1#ifndef __BFIN_ENTRY_H
2#define __BFIN_ENTRY_H
3
4#include <asm/setup.h>
5#include <asm/page.h>
6
7#ifdef __ASSEMBLY__
8
9#define LFLUSH_I_AND_D 0x00000808
10#define LSIGTRAP 5
11
12/* process bits for task_struct.flags */
13#define PF_TRACESYS_OFF 3
14#define PF_TRACESYS_BIT 5
15#define PF_PTRACED_OFF 3
16#define PF_PTRACED_BIT 4
17#define PF_DTRACE_OFF 1
18#define PF_DTRACE_BIT 5
19
20/* This one is used for exceptions, emulation, and NMI. It doesn't push
21 RETI and doesn't do cli. */
22#define SAVE_ALL_SYS save_context_no_interrupts
23/* This is used for all normal interrupts. It saves a minimum of registers
24 to the stack, loads the IRQ number, and jumps to common code. */
25#define INTERRUPT_ENTRY(N) \
26 [--sp] = SYSCFG; \
27 \
28 [--sp] = P0; /*orig_p0*/ \
29 [--sp] = R0; /*orig_r0*/ \
30 [--sp] = (R7:0,P5:0); \
31 R0 = (N); \
32 jump __common_int_entry;
33
34/* For timer interrupts, we need to save IPEND, since the user_mode
35 macro accesses it to determine where to account time. */
36#define TIMER_INTERRUPT_ENTRY(N) \
37 [--sp] = SYSCFG; \
38 \
39 [--sp] = P0; /*orig_p0*/ \
40 [--sp] = R0; /*orig_r0*/ \
41 [--sp] = (R7:0,P5:0); \
42 p0.l = lo(IPEND); \
43 p0.h = hi(IPEND); \
44 r1 = [p0]; \
45 R0 = (N); \
46 jump __common_int_entry;
47
48/* This one pushes RETI without using CLI. Interrupts are enabled. */
49#define SAVE_CONTEXT_SYSCALL save_context_syscall
50#define SAVE_CONTEXT save_context_with_interrupts
51
52#define RESTORE_ALL_SYS restore_context_no_interrupts
53#define RESTORE_CONTEXT restore_context_with_interrupts
54
55#endif /* __ASSEMBLY__ */
56#endif /* __BFIN_ENTRY_H */
diff --git a/include/asm-blackfin/errno.h b/include/asm-blackfin/errno.h
new file mode 100644
index 000000000000..164e4f39bb57
--- /dev/null
+++ b/include/asm-blackfin/errno.h
@@ -0,0 +1,6 @@
1#ifndef _BFIN_ERRNO_H
2#define _BFIN_ERRNO_H
3
4#include<asm-generic/errno.h>
5
6#endif /* _BFIN_ERRNO_H */
diff --git a/include/asm-blackfin/fcntl.h b/include/asm-blackfin/fcntl.h
new file mode 100644
index 000000000000..9c4037127857
--- /dev/null
+++ b/include/asm-blackfin/fcntl.h
@@ -0,0 +1,13 @@
1#ifndef _BFIN_FCNTL_H
2#define _BFIN_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_DIRECTORY 040000 /* must be a directory */
7#define O_NOFOLLOW 0100000 /* don't follow links */
8#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
9#define O_LARGEFILE 0400000
10
11#include <asm-generic/fcntl.h>
12
13#endif
diff --git a/include/asm-blackfin/flat.h b/include/asm-blackfin/flat.h
new file mode 100644
index 000000000000..e70074e05f4e
--- /dev/null
+++ b/include/asm-blackfin/flat.h
@@ -0,0 +1,58 @@
1/*
2 * include/asm-blackfin/flat.h -- uClinux flat-format executables
3 *
4 * Copyright (C) 2003,
5 *
6 */
7
8#ifndef __BLACKFIN_FLAT_H__
9#define __BLACKFIN_FLAT_H__
10
11#include <asm/unaligned.h>
12
13#define flat_stack_align(sp) /* nothing needed */
14#define flat_argvp_envp_on_stack() 0
15#define flat_old_ram_flag(flags) (flags)
16
17extern unsigned long bfin_get_addr_from_rp (unsigned long *ptr,
18 unsigned long relval,
19 unsigned long flags,
20 unsigned long *persistent);
21
22extern void bfin_put_addr_at_rp(unsigned long *ptr, unsigned long addr,
23 unsigned long relval);
24
25/* The amount by which a relocation can exceed the program image limits
26 without being regarded as an error. */
27
28#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
29
30#define flat_get_addr_from_rp(rp, relval, flags, persistent) \
31 bfin_get_addr_from_rp(rp, relval, flags, persistent)
32#define flat_put_addr_at_rp(rp, val, relval) \
33 bfin_put_addr_at_rp(rp, val, relval)
34
35/* Convert a relocation entry into an address. */
36static inline unsigned long
37flat_get_relocate_addr (unsigned long relval)
38{
39 return relval & 0x03ffffff; /* Mask out top 6 bits */
40}
41
42static inline int flat_set_persistent(unsigned long relval,
43 unsigned long *persistent)
44{
45 int type = (relval >> 26) & 7;
46 if (type == 3) {
47 *persistent = relval << 16;
48 return 1;
49 }
50 return 0;
51}
52
53static inline int flat_addr_absolute(unsigned long relval)
54{
55 return (relval & (1 << 29)) != 0;
56}
57
58#endif /* __BLACKFIN_FLAT_H__ */
diff --git a/include/asm-blackfin/futex.h b/include/asm-blackfin/futex.h
new file mode 100644
index 000000000000..6a332a9f099c
--- /dev/null
+++ b/include/asm-blackfin/futex.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#include <asm-generic/futex.h>
5
6#endif
diff --git a/include/asm-blackfin/gpio.h b/include/asm-blackfin/gpio.h
new file mode 100644
index 000000000000..d16fe3cd6135
--- /dev/null
+++ b/include/asm-blackfin/gpio.h
@@ -0,0 +1,367 @@
1/*
2 * File: arch/blackfin/kernel/bfin_gpio.h
3 * Based on:
4 * Author: Michael Hennerich (hennerich@blackfin.uclinux.org)
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30/*
31* Number BF537/6/4 BF561 BF533/2/1
32*
33* GPIO_0 PF0 PF0 PF0
34* GPIO_1 PF1 PF1 PF1
35* GPIO_2 PF2 PF2 PF2
36* GPIO_3 PF3 PF3 PF3
37* GPIO_4 PF4 PF4 PF4
38* GPIO_5 PF5 PF5 PF5
39* GPIO_6 PF6 PF6 PF6
40* GPIO_7 PF7 PF7 PF7
41* GPIO_8 PF8 PF8 PF8
42* GPIO_9 PF9 PF9 PF9
43* GPIO_10 PF10 PF10 PF10
44* GPIO_11 PF11 PF11 PF11
45* GPIO_12 PF12 PF12 PF12
46* GPIO_13 PF13 PF13 PF13
47* GPIO_14 PF14 PF14 PF14
48* GPIO_15 PF15 PF15 PF15
49* GPIO_16 PG0 PF16
50* GPIO_17 PG1 PF17
51* GPIO_18 PG2 PF18
52* GPIO_19 PG3 PF19
53* GPIO_20 PG4 PF20
54* GPIO_21 PG5 PF21
55* GPIO_22 PG6 PF22
56* GPIO_23 PG7 PF23
57* GPIO_24 PG8 PF24
58* GPIO_25 PG9 PF25
59* GPIO_26 PG10 PF26
60* GPIO_27 PG11 PF27
61* GPIO_28 PG12 PF28
62* GPIO_29 PG13 PF29
63* GPIO_30 PG14 PF30
64* GPIO_31 PG15 PF31
65* GPIO_32 PH0 PF32
66* GPIO_33 PH1 PF33
67* GPIO_34 PH2 PF34
68* GPIO_35 PH3 PF35
69* GPIO_36 PH4 PF36
70* GPIO_37 PH5 PF37
71* GPIO_38 PH6 PF38
72* GPIO_39 PH7 PF39
73* GPIO_40 PH8 PF40
74* GPIO_41 PH9 PF41
75* GPIO_42 PH10 PF42
76* GPIO_43 PH11 PF43
77* GPIO_44 PH12 PF44
78* GPIO_45 PH13 PF45
79* GPIO_46 PH14 PF46
80* GPIO_47 PH15 PF47
81*/
82
83#ifndef __ARCH_BLACKFIN_GPIO_H__
84#define __ARCH_BLACKFIN_GPIO_H__
85
86#define gpio_bank(x) ((x) >> 4)
87#define gpio_bit(x) (1<<((x) & 0xF))
88#define gpio_sub_n(x) ((x) & 0xF)
89
90#define GPIO_BANKSIZE 16
91
92#define GPIO_0 0
93#define GPIO_1 1
94#define GPIO_2 2
95#define GPIO_3 3
96#define GPIO_4 4
97#define GPIO_5 5
98#define GPIO_6 6
99#define GPIO_7 7
100#define GPIO_8 8
101#define GPIO_9 9
102#define GPIO_10 10
103#define GPIO_11 11
104#define GPIO_12 12
105#define GPIO_13 13
106#define GPIO_14 14
107#define GPIO_15 15
108#define GPIO_16 16
109#define GPIO_17 17
110#define GPIO_18 18
111#define GPIO_19 19
112#define GPIO_20 20
113#define GPIO_21 21
114#define GPIO_22 22
115#define GPIO_23 23
116#define GPIO_24 24
117#define GPIO_25 25
118#define GPIO_26 26
119#define GPIO_27 27
120#define GPIO_28 28
121#define GPIO_29 29
122#define GPIO_30 30
123#define GPIO_31 31
124#define GPIO_32 32
125#define GPIO_33 33
126#define GPIO_34 34
127#define GPIO_35 35
128#define GPIO_36 36
129#define GPIO_37 37
130#define GPIO_38 38
131#define GPIO_39 39
132#define GPIO_40 40
133#define GPIO_41 41
134#define GPIO_42 42
135#define GPIO_43 43
136#define GPIO_44 44
137#define GPIO_45 45
138#define GPIO_46 46
139#define GPIO_47 47
140
141
142#define PERIPHERAL_USAGE 1
143#define GPIO_USAGE 0
144
145#ifdef BF533_FAMILY
146#define MAX_BLACKFIN_GPIOS 16
147#endif
148
149#ifdef BF537_FAMILY
150#define MAX_BLACKFIN_GPIOS 48
151#define PORT_F 0
152#define PORT_G 1
153#define PORT_H 2
154#define PORT_J 3
155
156#define GPIO_PF0 0
157#define GPIO_PF1 1
158#define GPIO_PF2 2
159#define GPIO_PF3 3
160#define GPIO_PF4 4
161#define GPIO_PF5 5
162#define GPIO_PF6 6
163#define GPIO_PF7 7
164#define GPIO_PF8 8
165#define GPIO_PF9 9
166#define GPIO_PF10 10
167#define GPIO_PF11 11
168#define GPIO_PF12 12
169#define GPIO_PF13 13
170#define GPIO_PF14 14
171#define GPIO_PF15 15
172#define GPIO_PG0 16
173#define GPIO_PG1 17
174#define GPIO_PG2 18
175#define GPIO_PG3 19
176#define GPIO_PG4 20
177#define GPIO_PG5 21
178#define GPIO_PG6 22
179#define GPIO_PG7 23
180#define GPIO_PG8 24
181#define GPIO_PG9 25
182#define GPIO_PG10 26
183#define GPIO_PG11 27
184#define GPIO_PG12 28
185#define GPIO_PG13 29
186#define GPIO_PG14 30
187#define GPIO_PG15 31
188#define GPIO_PH0 32
189#define GPIO_PH1 33
190#define GPIO_PH2 34
191#define GPIO_PH3 35
192#define GPIO_PH4 36
193#define GPIO_PH5 37
194#define GPIO_PH6 38
195#define GPIO_PH7 39
196#define GPIO_PH8 40
197#define GPIO_PH9 41
198#define GPIO_PH10 42
199#define GPIO_PH11 43
200#define GPIO_PH12 44
201#define GPIO_PH13 45
202#define GPIO_PH14 46
203#define GPIO_PH15 47
204
205#endif
206
207#ifdef BF561_FAMILY
208#define MAX_BLACKFIN_GPIOS 48
209#define PORT_FIO0 0
210#define PORT_FIO1 1
211#define PORT_FIO2 2
212#endif
213
214#ifndef __ASSEMBLY__
215
216/***********************************************************
217*
218* FUNCTIONS: Blackfin General Purpose Ports Access Functions
219*
220* INPUTS/OUTPUTS:
221* gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS
222*
223*
224* DESCRIPTION: These functions abstract direct register access
225* to Blackfin processor General Purpose
226* Ports Regsiters
227*
228* CAUTION: These functions do not belong to the GPIO Driver API
229*************************************************************
230* MODIFICATION HISTORY :
231**************************************************************/
232
233void set_gpio_dir(unsigned short, unsigned short);
234void set_gpio_inen(unsigned short, unsigned short);
235void set_gpio_polar(unsigned short, unsigned short);
236void set_gpio_edge(unsigned short, unsigned short);
237void set_gpio_both(unsigned short, unsigned short);
238void set_gpio_data(unsigned short, unsigned short);
239void set_gpio_maska(unsigned short, unsigned short);
240void set_gpio_maskb(unsigned short, unsigned short);
241void set_gpio_toggle(unsigned short);
242void set_gpiop_dir(unsigned short, unsigned short);
243void set_gpiop_inen(unsigned short, unsigned short);
244void set_gpiop_polar(unsigned short, unsigned short);
245void set_gpiop_edge(unsigned short, unsigned short);
246void set_gpiop_both(unsigned short, unsigned short);
247void set_gpiop_data(unsigned short, unsigned short);
248void set_gpiop_maska(unsigned short, unsigned short);
249void set_gpiop_maskb(unsigned short, unsigned short);
250unsigned short get_gpio_dir(unsigned short);
251unsigned short get_gpio_inen(unsigned short);
252unsigned short get_gpio_polar(unsigned short);
253unsigned short get_gpio_edge(unsigned short);
254unsigned short get_gpio_both(unsigned short);
255unsigned short get_gpio_maska(unsigned short);
256unsigned short get_gpio_maskb(unsigned short);
257unsigned short get_gpio_data(unsigned short);
258unsigned short get_gpiop_dir(unsigned short);
259unsigned short get_gpiop_inen(unsigned short);
260unsigned short get_gpiop_polar(unsigned short);
261unsigned short get_gpiop_edge(unsigned short);
262unsigned short get_gpiop_both(unsigned short);
263unsigned short get_gpiop_maska(unsigned short);
264unsigned short get_gpiop_maskb(unsigned short);
265unsigned short get_gpiop_data(unsigned short);
266
267struct gpio_port_t {
268 unsigned short data;
269 unsigned short dummy1;
270 unsigned short data_clear;
271 unsigned short dummy2;
272 unsigned short data_set;
273 unsigned short dummy3;
274 unsigned short toggle;
275 unsigned short dummy4;
276 unsigned short maska;
277 unsigned short dummy5;
278 unsigned short maska_clear;
279 unsigned short dummy6;
280 unsigned short maska_set;
281 unsigned short dummy7;
282 unsigned short maska_toggle;
283 unsigned short dummy8;
284 unsigned short maskb;
285 unsigned short dummy9;
286 unsigned short maskb_clear;
287 unsigned short dummy10;
288 unsigned short maskb_set;
289 unsigned short dummy11;
290 unsigned short maskb_toggle;
291 unsigned short dummy12;
292 unsigned short dir;
293 unsigned short dummy13;
294 unsigned short polar;
295 unsigned short dummy14;
296 unsigned short edge;
297 unsigned short dummy15;
298 unsigned short both;
299 unsigned short dummy16;
300 unsigned short inen;
301};
302
303#ifdef CONFIG_PM
304#define PM_WAKE_RISING 0x1
305#define PM_WAKE_FALLING 0x2
306#define PM_WAKE_HIGH 0x4
307#define PM_WAKE_LOW 0x8
308#define PM_WAKE_BOTH_EDGES (PM_WAKE_RISING | PM_WAKE_FALLING)
309
310int gpio_pm_wakeup_request(unsigned short gpio, unsigned char type);
311void gpio_pm_wakeup_free(unsigned short gpio);
312unsigned int gpio_pm_setup(void);
313void gpio_pm_restore(void);
314
315struct gpio_port_s {
316 unsigned short data;
317 unsigned short data_clear;
318 unsigned short data_set;
319 unsigned short toggle;
320 unsigned short maska;
321 unsigned short maska_clear;
322 unsigned short maska_set;
323 unsigned short maska_toggle;
324 unsigned short maskb;
325 unsigned short maskb_clear;
326 unsigned short maskb_set;
327 unsigned short maskb_toggle;
328 unsigned short dir;
329 unsigned short polar;
330 unsigned short edge;
331 unsigned short both;
332 unsigned short inen;
333
334 unsigned short fer;
335};
336#endif /*CONFIG_PM*/
337
338/***********************************************************
339*
340* FUNCTIONS: Blackfin GPIO Driver
341*
342* INPUTS/OUTPUTS:
343* gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS
344*
345*
346* DESCRIPTION: Blackfin GPIO Driver API
347*
348* CAUTION:
349*************************************************************
350* MODIFICATION HISTORY :
351**************************************************************/
352
353int gpio_request(unsigned short, const char *);
354void gpio_free(unsigned short);
355
356void gpio_set_value(unsigned short gpio, unsigned short arg);
357unsigned short gpio_get_value(unsigned short gpio);
358
359#define gpio_get_value(gpio) get_gpio_data(gpio)
360#define gpio_set_value(gpio, value) set_gpio_data(gpio, value)
361
362void gpio_direction_input(unsigned short gpio);
363void gpio_direction_output(unsigned short gpio);
364
365#endif /* __ASSEMBLY__ */
366
367#endif /* __ARCH_BLACKFIN_GPIO_H__ */
diff --git a/include/asm-blackfin/hardirq.h b/include/asm-blackfin/hardirq.h
new file mode 100644
index 000000000000..0cab0d35badc
--- /dev/null
+++ b/include/asm-blackfin/hardirq.h
@@ -0,0 +1,41 @@
1#ifndef __BFIN_HARDIRQ_H
2#define __BFIN_HARDIRQ_H
3
4#include <linux/cache.h>
5#include <linux/threads.h>
6#include <asm/irq.h>
7
8typedef struct {
9 unsigned int __softirq_pending;
10 unsigned int __syscall_count;
11 struct task_struct *__ksoftirqd_task;
12} ____cacheline_aligned irq_cpustat_t;
13
14#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
15
16/*
17 * We put the hardirq and softirq counter into the preemption
18 * counter. The bitmask has the following meaning:
19 *
20 * - bits 0-7 are the preemption count (max preemption depth: 256)
21 * - bits 8-15 are the softirq count (max # of softirqs: 256)
22 * - bits 16-23 are the hardirq count (max # of hardirqs: 256)
23 *
24 * - ( bit 26 is the PREEMPT_ACTIVE flag. )
25 *
26 * PREEMPT_MASK: 0x000000ff
27 * HARDIRQ_MASK: 0x0000ff00
28 * SOFTIRQ_MASK: 0x00ff0000
29 */
30
31#define HARDIRQ_BITS 8
32
33#ifdef NR_IRQS
34# if (1 << HARDIRQ_BITS) < NR_IRQS
35# error HARDIRQ_BITS is too low!
36# endif
37#endif
38
39#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
40
41#endif
diff --git a/include/asm-blackfin/hw_irq.h b/include/asm-blackfin/hw_irq.h
new file mode 100644
index 000000000000..5b51eaec012c
--- /dev/null
+++ b/include/asm-blackfin/hw_irq.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_BFIN_HW_IRQ_H
2#define __ASM_BFIN_HW_IRQ_H
3
4/* Dummy include. */
5
6#endif
diff --git a/include/asm-blackfin/ide.h b/include/asm-blackfin/ide.h
new file mode 100644
index 000000000000..41b2db46a168
--- /dev/null
+++ b/include/asm-blackfin/ide.h
@@ -0,0 +1,32 @@
1/****************************************************************************/
2
3/*
4 * linux/include/asm-blackfin/ide.h
5 *
6 * Copyright (C) 1994-1996 Linus Torvalds & authors
7 * Copyright (C) 2001 Lineo Inc., davidm@snapgear.com
8 * Copyright (C) 2002 Greg Ungerer (gerg@snapgear.com)
9 * Copyright (C) 2002 Yoshinori Sato (ysato@users.sourceforge.jp)
10 * Copyright (C) 2005 Hennerich Michael (hennerich@blackfin.uclinux.org)
11 */
12
13/****************************************************************************/
14#ifndef _BLACKFIN_IDE_H
15#define _BLACKFIN_IDE_H
16/****************************************************************************/
17#ifdef __KERNEL__
18/****************************************************************************/
19
20#define MAX_HWIFS 1
21
22/* Legacy ... BLK_DEV_IDECS */
23#define IDE_ARCH_OBSOLETE_INIT
24#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
25
26
27#include <asm-generic/ide_iops.h>
28
29/****************************************************************************/
30#endif /* __KERNEL__ */
31#endif /* _BLACKFIN_IDE_H */
32/****************************************************************************/
diff --git a/include/asm-blackfin/io.h b/include/asm-blackfin/io.h
new file mode 100644
index 000000000000..7e6995e80d97
--- /dev/null
+++ b/include/asm-blackfin/io.h
@@ -0,0 +1,207 @@
1#ifndef _BFIN_IO_H
2#define _BFIN_IO_H
3
4#ifdef __KERNEL__
5
6#ifndef __ASSEMBLY__
7#include <linux/types.h>
8#endif
9#include <linux/compiler.h>
10
11/*
12 * These are for ISA/PCI shared memory _only_ and should never be used
13 * on any other type of memory, including Zorro memory. They are meant to
14 * access the bus in the bus byte order which is little-endian!.
15 *
16 * readX/writeX() are used to access memory mapped devices. On some
17 * architectures the memory mapped IO stuff needs to be accessed
18 * differently. On the bfin architecture, we just read/write the
19 * memory location directly.
20 */
21#ifndef __ASSEMBLY__
22
23static inline unsigned char readb(void __iomem *addr)
24{
25 unsigned int val;
26 int tmp;
27
28 __asm__ __volatile__ ("cli %1;\n\t"
29 "NOP; NOP; SSYNC;\n\t"
30 "%0 = b [%2] (z);\n\t"
31 "sti %1;\n\t"
32 : "=d"(val), "=d"(tmp): "a"(addr)
33 );
34
35 return (unsigned char) val;
36}
37
38static inline unsigned short readw(void __iomem *addr)
39{
40 unsigned int val;
41 int tmp;
42
43 __asm__ __volatile__ ("cli %1;\n\t"
44 "NOP; NOP; SSYNC;\n\t"
45 "%0 = w [%2] (z);\n\t"
46 "sti %1;\n\t"
47 : "=d"(val), "=d"(tmp): "a"(addr)
48 );
49
50 return (unsigned short) val;
51}
52
53static inline unsigned int readl(void __iomem *addr)
54{
55 unsigned int val;
56 int tmp;
57
58 __asm__ __volatile__ ("cli %1;\n\t"
59 "NOP; NOP; SSYNC;\n\t"
60 "%0 = [%2];\n\t"
61 "sti %1;\n\t"
62 : "=d"(val), "=d"(tmp): "a"(addr)
63 );
64 return val;
65}
66
67#endif /* __ASSEMBLY__ */
68
69#define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b))
70#define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
71#define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
72
73#define __raw_readb readb
74#define __raw_readw readw
75#define __raw_readl readl
76#define __raw_writeb writeb
77#define __raw_writew writew
78#define __raw_writel writel
79#define memset_io(a,b,c) memset((void *)(a),(b),(c))
80#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
81#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
82
83#define inb(addr) readb(addr)
84#define inw(addr) readw(addr)
85#define inl(addr) readl(addr)
86#define outb(x,addr) ((void) writeb(x,addr))
87#define outw(x,addr) ((void) writew(x,addr))
88#define outl(x,addr) ((void) writel(x,addr))
89
90#define inb_p(addr) inb(addr)
91#define inw_p(addr) inw(addr)
92#define inl_p(addr) inl(addr)
93#define outb_p(x,addr) outb(x,addr)
94#define outw_p(x,addr) outw(x,addr)
95#define outl_p(x,addr) outl(x,addr)
96
97#define ioread8_rep(a,d,c) insb(a,d,c)
98#define ioread16_rep(a,d,c) insw(a,d,c)
99#define ioread32_rep(a,d,c) insl(a,d,c)
100#define iowrite8_rep(a,s,c) outsb(a,s,c)
101#define iowrite16_rep(a,s,c) outsw(a,s,c)
102#define iowrite32_rep(a,s,c) outsl(a,s,c)
103
104#define ioread8(X) readb(X)
105#define ioread16(X) readw(X)
106#define ioread32(X) readl(X)
107#define iowrite8(val,X) writeb(val,X)
108#define iowrite16(val,X) writew(val,X)
109#define iowrite32(val,X) writel(val,X)
110
111#define IO_SPACE_LIMIT 0xffffffff
112
113/* Values for nocacheflag and cmode */
114#define IOMAP_NOCACHE_SER 1
115
116#ifndef __ASSEMBLY__
117
118extern void outsb(void __iomem *port, const void *addr, unsigned long count);
119extern void outsw(void __iomem *port, const void *addr, unsigned long count);
120extern void outsl(void __iomem *port, const void *addr, unsigned long count);
121
122extern void insb(const void __iomem *port, void *addr, unsigned long count);
123extern void insw(const void __iomem *port, void *addr, unsigned long count);
124extern void insl(const void __iomem *port, void *addr, unsigned long count);
125
126/*
127 * Map some physical address range into the kernel address space.
128 */
129static inline void __iomem *__ioremap(unsigned long physaddr, unsigned long size,
130 int cacheflag)
131{
132 return (void __iomem *)physaddr;
133}
134
135/*
136 * Unmap a ioremap()ed region again
137 */
138static inline void iounmap(void *addr)
139{
140}
141
142/*
143 * __iounmap unmaps nearly everything, so be careful
144 * it doesn't free currently pointer/page tables anymore but it
145 * wans't used anyway and might be added later.
146 */
147static inline void __iounmap(void *addr, unsigned long size)
148{
149}
150
151/*
152 * Set new cache mode for some kernel address space.
153 * The caller must push data for that range itself, if such data may already
154 * be in the cache.
155 */
156static inline void kernel_set_cachemode(void *addr, unsigned long size,
157 int cmode)
158{
159}
160
161static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
162{
163 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
164}
165static inline void __iomem *ioremap_nocache(unsigned long physaddr,
166 unsigned long size)
167{
168 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
169}
170
171extern void blkfin_inv_cache_all(void);
172
173#endif
174
175#define ioport_map(port, nr) ((void __iomem*)(port))
176#define ioport_unmap(addr)
177
178#define dma_cache_inv(_start,_size) do { blkfin_inv_cache_all();} while (0)
179#define dma_cache_wback(_start,_size) do { } while (0)
180#define dma_cache_wback_inv(_start,_size) do { blkfin_inv_cache_all();} while (0)
181
182/* Pages to physical address... */
183#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
184#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
185
186#define mm_ptov(vaddr) ((void *) (vaddr))
187#define mm_vtop(vaddr) ((unsigned long) (vaddr))
188#define phys_to_virt(vaddr) ((void *) (vaddr))
189#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
190
191#define virt_to_bus virt_to_phys
192#define bus_to_virt phys_to_virt
193
194/*
195 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
196 * access
197 */
198#define xlate_dev_mem_ptr(p) __va(p)
199
200/*
201 * Convert a virtual cached pointer to an uncached pointer
202 */
203#define xlate_dev_kmem_ptr(p) p
204
205#endif /* __KERNEL__ */
206
207#endif /* _BFIN_IO_H */
diff --git a/include/asm-blackfin/ioctl.h b/include/asm-blackfin/ioctl.h
new file mode 100644
index 000000000000..b279fe06dfe5
--- /dev/null
+++ b/include/asm-blackfin/ioctl.h
@@ -0,0 +1 @@
#include <asm-generic/ioctl.h>
diff --git a/include/asm-blackfin/ioctls.h b/include/asm-blackfin/ioctls.h
new file mode 100644
index 000000000000..8356204151db
--- /dev/null
+++ b/include/asm-blackfin/ioctls.h
@@ -0,0 +1,82 @@
1#ifndef __ARCH_BFIN_IOCTLS_H__
2#define __ARCH_BFIN_IOCTLS_H__
3
4#include <asm/ioctl.h>
5
6/* 0x54 is just a magic number to make these relatively unique ('T') */
7
8#define TCGETS 0x5401
9#define TCSETS 0x5402
10#define TCSETSW 0x5403
11#define TCSETSF 0x5404
12#define TCGETA 0x5405
13#define TCSETA 0x5406
14#define TCSETAW 0x5407
15#define TCSETAF 0x5408
16#define TCSBRK 0x5409
17#define TCXONC 0x540A
18#define TCFLSH 0x540B
19#define TIOCEXCL 0x540C
20#define TIOCNXCL 0x540D
21#define TIOCSCTTY 0x540E
22#define TIOCGPGRP 0x540F
23#define TIOCSPGRP 0x5410
24#define TIOCOUTQ 0x5411
25#define TIOCSTI 0x5412
26#define TIOCGWINSZ 0x5413
27#define TIOCSWINSZ 0x5414
28#define TIOCMGET 0x5415
29#define TIOCMBIS 0x5416
30#define TIOCMBIC 0x5417
31#define TIOCMSET 0x5418
32#define TIOCGSOFTCAR 0x5419
33#define TIOCSSOFTCAR 0x541A
34#define FIONREAD 0x541B
35#define TIOCINQ FIONREAD
36#define TIOCLINUX 0x541C
37#define TIOCCONS 0x541D
38#define TIOCGSERIAL 0x541E
39#define TIOCSSERIAL 0x541F
40#define TIOCPKT 0x5420
41#define FIONBIO 0x5421
42#define TIOCNOTTY 0x5422
43#define TIOCSETD 0x5423
44#define TIOCGETD 0x5424
45#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
46#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
51#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
52
53#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
54#define FIOCLEX 0x5451
55#define FIOASYNC 0x5452
56#define TIOCSERCONFIG 0x5453
57#define TIOCSERGWILD 0x5454
58#define TIOCSERSWILD 0x5455
59#define TIOCGLCKTRMIOS 0x5456
60#define TIOCSLCKTRMIOS 0x5457
61#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
62#define TIOCSERGETLSR 0x5459 /* Get line status register */
63#define TIOCSERGETMULTI 0x545A /* Get multiport config */
64#define TIOCSERSETMULTI 0x545B /* Set multiport config */
65
66#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
67#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
68
69#define FIOQSIZE 0x545E
70
71/* Used for packet mode */
72#define TIOCPKT_DATA 0
73#define TIOCPKT_FLUSHREAD 1
74#define TIOCPKT_FLUSHWRITE 2
75#define TIOCPKT_STOP 4
76#define TIOCPKT_START 8
77#define TIOCPKT_NOSTOP 16
78#define TIOCPKT_DOSTOP 32
79
80#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
81
82#endif /* __ARCH_BFIN_IOCTLS_H__ */
diff --git a/include/asm-blackfin/ipc.h b/include/asm-blackfin/ipc.h
new file mode 100644
index 000000000000..a46e3d9c2a3f
--- /dev/null
+++ b/include/asm-blackfin/ipc.h
@@ -0,0 +1 @@
#include <asm-generic/ipc.h>
diff --git a/include/asm-blackfin/ipcbuf.h b/include/asm-blackfin/ipcbuf.h
new file mode 100644
index 000000000000..8f0899cdf4d2
--- /dev/null
+++ b/include/asm-blackfin/ipcbuf.h
@@ -0,0 +1,30 @@
1/* Changes origined from m68k version. Lineo Inc. May 2001 */
2
3#ifndef __BFIN_IPCBUF_H__
4#define __BFIN_IPCBUF_H__
5
6/*
7 * The user_ipc_perm structure for m68k architecture.
8 * Note extra padding because this structure is passed back and forth
9 * between kernel and user space.
10 *
11 * Pad space is left for:
12 * - 32-bit mode_t and seq
13 * - 2 miscellaneous 32-bit values
14 */
15
16struct ipc64_perm {
17 __kernel_key_t key;
18 __kernel_uid32_t uid;
19 __kernel_gid32_t gid;
20 __kernel_uid32_t cuid;
21 __kernel_gid32_t cgid;
22 __kernel_mode_t mode;
23 unsigned short __pad1;
24 unsigned short seq;
25 unsigned short __pad2;
26 unsigned long __unused1;
27 unsigned long __unused2;
28};
29
30#endif /* __BFIN_IPCBUF_H__ */
diff --git a/include/asm-blackfin/irq.h b/include/asm-blackfin/irq.h
new file mode 100644
index 000000000000..65480dab244e
--- /dev/null
+++ b/include/asm-blackfin/irq.h
@@ -0,0 +1,70 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file COPYING in the main directory of this archive
4 * for more details.
5 *
6 * Changed by HuTao Apr18, 2003
7 *
8 * Copyright was missing when I got the code so took from MIPS arch ...MaTed---
9 * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
10 * Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001 by Ralf Baechle
11 *
12 * Adapted for BlackFin (ADI) by Ted Ma <mated@sympatico.ca>
13 * Copyright (c) 2002 Arcturus Networks Inc. (www.arcturusnetworks.com)
14 * Copyright (c) 2002 Lineo, Inc. <mattw@lineo.com>
15 */
16
17#ifndef _BFIN_IRQ_H_
18#define _BFIN_IRQ_H_
19
20#include <asm/mach/irq.h>
21#include <asm/ptrace.h>
22
23/*******************************************************************************
24 ***** INTRODUCTION ***********
25 * On the Blackfin, the interrupt structure allows remmapping of the hardware
26 * levels.
27 * - I'm going to assume that the H/W level is going to stay at the default
28 * settings. If someone wants to go through and abstart this out, feel free
29 * to mod the interrupt numbering scheme.
30 * - I'm abstracting the interrupts so that uClinux does not know anything
31 * about the H/W levels. If you want to change the H/W AND keep the abstracted
32 * levels that uClinux sees, you should be able to do most of it here.
33 * - I've left the "abstract" numbering sparce in case someone wants to pull the
34 * interrupts apart (just the TX/RX for the various devices)
35 *******************************************************************************/
36
37/* SYS_IRQS and NR_IRQS are defined in <asm/mach-bf5xx/irq.h>*/
38
39/*
40 * Machine specific interrupt sources.
41 *
42 * Adding an interrupt service routine for a source with this bit
43 * set indicates a special machine specific interrupt source.
44 * The machine specific files define these sources.
45 *
46 * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
47 * introduce unnecessary overhead.
48 *
49 * All interrupt handling is actually machine specific so it is better
50 * to use function pointers, as used by the Sparc port, and select the
51 * interrupt handling functions when initializing the kernel. This way
52 * we save some unnecessary overhead at run-time.
53 * 01/11/97 - Jes
54 */
55
56extern void ack_bad_irq(unsigned int irq);
57
58static __inline__ int irq_canonicalize(int irq)
59{
60 return irq;
61}
62
63/* count of spurious interrupts */
64/* extern volatile unsigned int num_spurious; */
65
66#ifndef NO_IRQ
67#define NO_IRQ ((unsigned int)(-1))
68#endif
69
70#endif /* _BFIN_IRQ_H_ */
diff --git a/include/asm-blackfin/irq_handler.h b/include/asm-blackfin/irq_handler.h
new file mode 100644
index 000000000000..d830f0a49a1c
--- /dev/null
+++ b/include/asm-blackfin/irq_handler.h
@@ -0,0 +1,22 @@
1#ifndef _IRQ_HANDLER_H
2#define _IRQ_HANDLER_H
3
4/* BASE LEVEL interrupt handler routines */
5asmlinkage void evt_emulation(void);
6asmlinkage void evt_exception(void);
7asmlinkage void trap(void);
8asmlinkage void evt_ivhw(void);
9asmlinkage void evt_timer(void);
10asmlinkage void evt_evt2(void);
11asmlinkage void evt_evt7(void);
12asmlinkage void evt_evt8(void);
13asmlinkage void evt_evt9(void);
14asmlinkage void evt_evt10(void);
15asmlinkage void evt_evt11(void);
16asmlinkage void evt_evt12(void);
17asmlinkage void evt_evt13(void);
18asmlinkage void evt_soft_int1(void);
19asmlinkage void evt_system_call(void);
20asmlinkage void init_exception_buff(void);
21
22#endif
diff --git a/include/asm-blackfin/irq_regs.h b/include/asm-blackfin/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/include/asm-blackfin/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/include/asm-blackfin/kdebug.h b/include/asm-blackfin/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-blackfin/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-blackfin/kmap_types.h b/include/asm-blackfin/kmap_types.h
new file mode 100644
index 000000000000..e215f7104974
--- /dev/null
+++ b/include/asm-blackfin/kmap_types.h
@@ -0,0 +1,21 @@
1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H
3
4enum km_type {
5 KM_BOUNCE_READ,
6 KM_SKB_SUNRPC_DATA,
7 KM_SKB_DATA_SOFTIRQ,
8 KM_USER0,
9 KM_USER1,
10 KM_BIO_SRC_IRQ,
11 KM_BIO_DST_IRQ,
12 KM_PTE0,
13 KM_PTE1,
14 KM_IRQ0,
15 KM_IRQ1,
16 KM_SOFTIRQ0,
17 KM_SOFTIRQ1,
18 KM_TYPE_NR
19};
20
21#endif
diff --git a/include/asm-blackfin/l1layout.h b/include/asm-blackfin/l1layout.h
new file mode 100644
index 000000000000..c13ded777828
--- /dev/null
+++ b/include/asm-blackfin/l1layout.h
@@ -0,0 +1,31 @@
1/*
2 * l1layout.h
3 * Defines a layout of L1 scratchpad memory that userspace can rely on.
4 */
5
6#ifndef _L1LAYOUT_H_
7#define _L1LAYOUT_H_
8
9#include <asm/blackfin.h>
10
11#ifndef __ASSEMBLY__
12
13/* Data that is "mapped" into the process VM at the start of the L1 scratch
14 memory, so that each process can access it at a fixed address. Used for
15 stack checking. */
16struct l1_scratch_task_info
17{
18 /* Points to the start of the stack. */
19 void *stack_start;
20 /* Not updated by the kernel; a user process can modify this to
21 keep track of the lowest address of the stack pointer during its
22 runtime. */
23 void *lowest_sp;
24};
25
26/* A pointer to the structure in memory. */
27#define L1_SCRATCH_TASK_INFO ((struct l1_scratch_task_info *)L1_SCRATCH_START)
28
29#endif
30
31#endif
diff --git a/include/asm-blackfin/linkage.h b/include/asm-blackfin/linkage.h
new file mode 100644
index 000000000000..5a822bb790f7
--- /dev/null
+++ b/include/asm-blackfin/linkage.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_LINKAGE_H
2#define __ASM_LINKAGE_H
3
4#define __ALIGN .align 4
5#define __ALIGN_STR ".align 4"
6
7#endif
diff --git a/include/asm-blackfin/local.h b/include/asm-blackfin/local.h
new file mode 100644
index 000000000000..75afffbc6421
--- /dev/null
+++ b/include/asm-blackfin/local.h
@@ -0,0 +1,6 @@
1#ifndef __BLACKFIN_LOCAL_H
2#define __BLACKFIN_LOCAL_H
3
4#include <asm-generic/local.h>
5
6#endif /* __BLACKFIN_LOCAL_H */
diff --git a/include/asm-blackfin/mach-bf533/anomaly.h b/include/asm-blackfin/mach-bf533/anomaly.h
new file mode 100644
index 000000000000..a84d3909345e
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/anomaly.h
@@ -0,0 +1,175 @@
1/*
2 * File: include/asm-blackfin/mach-bf533/anomaly.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31/* This file shoule be up to date with:
32 * - Revision U, May 17, 2006; ADSP-BF533 Blackfin Processor Anomaly List
33 * - Revision Y, May 17, 2006; ADSP-BF532 Blackfin Processor Anomaly List
34 * - Revision T, May 17, 2006; ADSP-BF531 Blackfin Processor Anomaly List
35 */
36
37#ifndef _MACH_ANOMALY_H_
38#define _MACH_ANOMALY_H_
39
40/* We do not support 0.1 or 0.2 silicon - sorry */
41#if (defined(CONFIG_BF_REV_0_1) || defined(CONFIG_BF_REV_0_2))
42#error Kernel will not work on BF533 Version 0.1 or 0.2
43#endif
44
45/* Issues that are common to 0.5, 0.4, and 0.3 silicon */
46#if (defined(CONFIG_BF_REV_0_5) || defined(CONFIG_BF_REV_0_4) || defined(CONFIG_BF_REV_0_3))
47#define ANOMALY_05000074 /* A multi issue instruction with dsp32shiftimm in
48 slot1 and store of a P register in slot 2 is not
49 supported */
50#define ANOMALY_05000105 /* Watchpoint Status Register (WPSTAT) bits are set on
51 every corresponding match */
52#define ANOMALY_05000119 /* DMA_RUN bit is not valid after a Peripheral Receive
53 Channel DMA stops */
54#define ANOMALY_05000122 /* Rx.H can not be used to access 16-bit System MMR
55 registers. */
56#define ANOMALY_05000166 /* PPI Data Lengths Between 8 and 16 do not zero out
57 upper bits*/
58#define ANOMALY_05000167 /* Turning Serial Ports on With External Frame Syncs */
59#define ANOMALY_05000180 /* PPI_DELAY not functional in PPI modes with 0 frame
60 syncs */
61#define ANOMALY_05000208 /* VSTAT status bit in PLL_STAT register is not
62 functional */
63#define ANOMALY_05000219 /* NMI event at boot time results in unpredictable
64 state */
65#define ANOMALY_05000229 /* SPI Slave Boot Mode modifies registers */
66#define ANOMALY_05000272 /* Certain data cache write through modes fail for
67 VDDint <=0.9V */
68#define ANOMALY_05000273 /* Writes to Synchronous SDRAM memory may be lost */
69#define ANOMALY_05000277 /* Writes to a flag data register one SCLK cycle after
70 an edge is detected may clear interrupt */
71#define ANOMALY_05000278 /* Disabling Peripherals with DMA running may cause
72 DMA system instability */
73#define ANOMALY_05000281 /* False Hardware Error Exception when ISR context is
74 not restored */
75#define ANOMALY_05000282 /* Memory DMA corruption with 32-bit data and traffic
76 control */
77#define ANOMALY_05000283 /* A system MMR write is stalled indefinitely when
78 killed in a particular stage*/
79#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC
80 registers are interrupted */
81#define ANOMALY_05000311 /* Erroneous flag pin operations under specific sequences*/
82
83#endif
84
85/* These issues only occur on 0.3 or 0.4 BF533 */
86#if (defined(CONFIG_BF_REV_0_4) || defined(CONFIG_BF_REV_0_3))
87#define ANOMALY_05000099 /* UART Line Status Register (UART_LSR) bits are not
88 updated at the same time. */
89#define ANOMALY_05000158 /* Boot fails when data cache enabled: Data from a Data
90 Cache Fill can be corrupted after or during
91 Instruction DMA if certain core stalls exist */
92#define ANOMALY_05000179 /* PPI_COUNT cannot be programmed to 0 in General
93 Purpose TX or RX modes */
94#define ANOMALY_05000198 /* Failing SYSTEM MMR accesses when stalled by
95 preceding memory read */
96#define ANOMALY_05000200 /* SPORT TFS and DT are incorrectly driven during
97 inactive channels in certain conditions */
98#define ANOMALY_05000202 /* Possible infinite stall with specific dual dag
99 situation */
100#define ANOMALY_05000215 /* UART TX Interrupt masked erroneously */
101#define ANOMALY_05000225 /* Incorrect pulse-width of UART start-bit */
102#define ANOMALY_05000227 /* Scratchpad memory bank reads may return incorrect
103 data*/
104#define ANOMALY_05000230 /* UART Receiver is less robust against Baudrate
105 Differences in certain Conditions */
106#define ANOMALY_05000231 /* UART STB bit incorrectly affects receiver setting */
107#define ANOMALY_05000242 /* DF bit in PLL_CTL register does not respond to
108 hardware reset */
109#define ANOMALY_05000244 /* With instruction cache enabled, a CSYNC or SSYNC or
110 IDLE around a Change of Control causes
111 unpredictable results */
112#define ANOMALY_05000245 /* Spurious Hardware Error from an access in the
113 shadow of a conditional branch */
114#define ANOMALY_05000246 /* Data CPLB's should prevent spurious hardware
115 errors */
116#define ANOMALY_05000253 /* Maximum external clock speed for Timers */
117#define ANOMALY_05000255 /* Entering Hibernate Mode with RTC Seconds event
118 interrupt not functional */
119#define ANOMALY_05000257 /* An interrupt or exception during short Hardware
120 loops may cause the instruction fetch unit to
121 malfunction */
122#define ANOMALY_05000258 /* Instruction Cache is corrupted when bit 9 and 12 of
123 the ICPLB Data registers differ */
124#define ANOMALY_05000260 /* ICPLB_STATUS MMR register may be corrupted */
125#define ANOMALY_05000261 /* DCPLB_FAULT_ADDR MMR register may be corrupted */
126#define ANOMALY_05000262 /* Stores to data cache may be lost */
127#define ANOMALY_05000263 /* Hardware loop corrupted when taking an ICPLB exception */
128#define ANOMALY_05000264 /* A Sync instruction (CSYNC, SSYNC) or an IDLE
129 instruction will cause an infinite stall in the
130 second to last instruction in a hardware loop */
131#define ANOMALY_05000265 /* Sensitivity to noise with slow input edge rates on
132 SPORT external receive and transmit clocks. */
133#define ANOMALY_05000269 /* High I/O activity causes the output voltage of the
134 internal voltage regulator (VDDint) to increase. */
135#define ANOMALY_05000270 /* High I/O activity causes the output voltage of the
136 internal voltage regulator (VDDint) to decrease */
137#endif
138
139/* These issues are only on 0.4 silicon */
140#if (defined(CONFIG_BF_REV_0_4))
141#define ANOMALY_05000234 /* Incorrect Revision Number in DSPID Register */
142#define ANOMALY_05000250 /* Incorrect Bit-Shift of Data Word in Multichannel
143 (TDM) */
144#endif
145
146/* These issues are only on 0.3 silicon */
147#if defined(CONFIG_BF_REV_0_3)
148#define ANOMALY_05000183 /* Timer Pin limitations for PPI TX Modes with
149 External Frame Syncs */
150#define ANOMALY_05000189 /* False Protection Exceptions caused by Speculative
151 Instruction or Data Fetches, or by Fetches at the
152 boundary of reserved memory space */
153#define ANOMALY_05000193 /* False Flag Pin Interrupts on Edge Sensitive Inputs
154 when polarity setting is changed */
155#define ANOMALY_05000194 /* Sport Restarting in specific modes may cause data
156 corruption */
157#define ANOMALY_05000199 /* DMA current address shows wrong value during carry
158 fix */
159#define ANOMALY_05000201 /* Receive frame sync not ignored during active
160 frames in sport MCM */
161#define ANOMALY_05000203 /* Specific sequence that can cause DMA error or DMA
162 stopping */
163#if defined(CONFIG_BF533)
164#define ANOMALY_05000204 /* Incorrect data read with write-through cache and
165 allocate cache lines on reads only mode */
166#endif /* CONFIG_BF533 */
167#define ANOMALY_05000207 /* Recovery from "brown-out" condition */
168#define ANOMALY_05000209 /* Speed-Path in computational unit affects certain
169 instructions */
170#define ANOMALY_05000233 /* PPI_FS3 is not driven in 2 or 3 internal Frame
171 Sync Transmit Mode */
172#define ANOMALY_05000271 /* Spontaneous reset of Internal Voltage Regulator */
173#endif
174
175#endif /* _MACH_ANOMALY_H_ */
diff --git a/include/asm-blackfin/mach-bf533/bf533.h b/include/asm-blackfin/mach-bf533/bf533.h
new file mode 100644
index 000000000000..185fc1284858
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/bf533.h
@@ -0,0 +1,306 @@
1/*
2 * File: include/asm-blackfin/mach-bf533/bf533.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF561
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#ifndef __MACH_BF533_H__
31#define __MACH_BF533_H__
32
33#define SUPPORTED_REVID 2
34
35#define OFFSET_(x) ((x) & 0x0000FFFF)
36
37/*some misc defines*/
38#define IMASK_IVG15 0x8000
39#define IMASK_IVG14 0x4000
40#define IMASK_IVG13 0x2000
41#define IMASK_IVG12 0x1000
42
43#define IMASK_IVG11 0x0800
44#define IMASK_IVG10 0x0400
45#define IMASK_IVG9 0x0200
46#define IMASK_IVG8 0x0100
47
48#define IMASK_IVG7 0x0080
49#define IMASK_IVGTMR 0x0040
50#define IMASK_IVGHW 0x0020
51
52/***************************/
53
54
55#define BLKFIN_DSUBBANKS 4
56#define BLKFIN_DWAYS 2
57#define BLKFIN_DLINES 64
58#define BLKFIN_ISUBBANKS 4
59#define BLKFIN_IWAYS 4
60#define BLKFIN_ILINES 32
61
62#define WAY0_L 0x1
63#define WAY1_L 0x2
64#define WAY01_L 0x3
65#define WAY2_L 0x4
66#define WAY02_L 0x5
67#define WAY12_L 0x6
68#define WAY012_L 0x7
69
70#define WAY3_L 0x8
71#define WAY03_L 0x9
72#define WAY13_L 0xA
73#define WAY013_L 0xB
74
75#define WAY32_L 0xC
76#define WAY320_L 0xD
77#define WAY321_L 0xE
78#define WAYALL_L 0xF
79
80#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
81
82/* IAR0 BIT FIELDS*/
83#define RTC_ERROR_BIT 0x0FFFFFFF
84#define UART_ERROR_BIT 0xF0FFFFFF
85#define SPORT1_ERROR_BIT 0xFF0FFFFF
86#define SPI_ERROR_BIT 0xFFF0FFFF
87#define SPORT0_ERROR_BIT 0xFFFF0FFF
88#define PPI_ERROR_BIT 0xFFFFF0FF
89#define DMA_ERROR_BIT 0xFFFFFF0F
90#define PLLWAKE_ERROR_BIT 0xFFFFFFFF
91
92/* IAR1 BIT FIELDS*/
93#define DMA7_UARTTX_BIT 0x0FFFFFFF
94#define DMA6_UARTRX_BIT 0xF0FFFFFF
95#define DMA5_SPI_BIT 0xFF0FFFFF
96#define DMA4_SPORT1TX_BIT 0xFFF0FFFF
97#define DMA3_SPORT1RX_BIT 0xFFFF0FFF
98#define DMA2_SPORT0TX_BIT 0xFFFFF0FF
99#define DMA1_SPORT0RX_BIT 0xFFFFFF0F
100#define DMA0_PPI_BIT 0xFFFFFFFF
101
102/* IAR2 BIT FIELDS*/
103#define WDTIMER_BIT 0x0FFFFFFF
104#define MEMDMA1_BIT 0xF0FFFFFF
105#define MEMDMA0_BIT 0xFF0FFFFF
106#define PFB_BIT 0xFFF0FFFF
107#define PFA_BIT 0xFFFF0FFF
108#define TIMER2_BIT 0xFFFFF0FF
109#define TIMER1_BIT 0xFFFFFF0F
110#define TIMER0_BIT 0xFFFFFFFF
111
112/********************************* EBIU Settings ************************************/
113#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
114#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
115
116#ifdef CONFIG_C_AMBEN_ALL
117#define V_AMBEN AMBEN_ALL
118#endif
119#ifdef CONFIG_C_AMBEN
120#define V_AMBEN 0x0
121#endif
122#ifdef CONFIG_C_AMBEN_B0
123#define V_AMBEN AMBEN_B0
124#endif
125#ifdef CONFIG_C_AMBEN_B0_B1
126#define V_AMBEN AMBEN_B0_B1
127#endif
128#ifdef CONFIG_C_AMBEN_B0_B1_B2
129#define V_AMBEN AMBEN_B0_B1_B2
130#endif
131#ifdef CONFIG_C_AMCKEN
132#define V_AMCKEN AMCKEN
133#else
134#define V_AMCKEN 0x0
135#endif
136#ifdef CONFIG_C_CDPRIO
137#define V_CDPRIO 0x100
138#else
139#define V_CDPRIO 0x0
140#endif
141
142#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO)
143
144#define MAX_VC 650000000
145#define MIN_VC 50000000
146
147#ifdef CONFIG_BFIN_KERNEL_CLOCK
148/********************************PLL Settings **************************************/
149#if (CONFIG_VCO_MULT < 0)
150#error "VCO Multiplier is less than 0. Please select a different value"
151#endif
152
153#if (CONFIG_VCO_MULT == 0)
154#error "VCO Multiplier should be greater than 0. Please select a different value"
155#endif
156
157#if (CONFIG_VCO_MULT > 64)
158#error "VCO Multiplier is more than 64. Please select a different value"
159#endif
160
161#ifndef CONFIG_CLKIN_HALF
162#define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
163#else
164#define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
165#endif
166
167#ifndef CONFIG_PLL_BYPASS
168#define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
169#define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
170#else
171#define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
172#define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
173#endif
174
175#if (CONFIG_SCLK_DIV < 1)
176#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
177#endif
178
179#if (CONFIG_SCLK_DIV > 15)
180#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
181#endif
182
183#if (CONFIG_CCLK_DIV != 1)
184#if (CONFIG_CCLK_DIV != 2)
185#if (CONFIG_CCLK_DIV != 4)
186#if (CONFIG_CCLK_DIV != 8)
187#error "CCLK DIV can be 1,2,4 or 8 only. Please select a proper value"
188#endif
189#endif
190#endif
191#endif
192
193#if (CONFIG_VCO_HZ > MAX_VC)
194#error "VCO selected is more than maximum value. Please change the VCO multipler"
195#endif
196
197#if (CONFIG_SCLK_HZ > 133000000)
198#error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
199#endif
200
201#if (CONFIG_SCLK_HZ < 27000000)
202#error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
203#endif
204
205#if (CONFIG_SCLK_HZ > CONFIG_CCLK_HZ)
206#if (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ)
207#if (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
208#error "Please select sclk less than cclk"
209#endif
210#endif
211#endif
212
213#if (CONFIG_CCLK_DIV == 1)
214#define CONFIG_CCLK_ACT_DIV CCLK_DIV1
215#endif
216#if (CONFIG_CCLK_DIV == 2)
217#define CONFIG_CCLK_ACT_DIV CCLK_DIV2
218#endif
219#if (CONFIG_CCLK_DIV == 4)
220#define CONFIG_CCLK_ACT_DIV CCLK_DIV4
221#endif
222#if (CONFIG_CCLK_DIV == 8)
223#define CONFIG_CCLK_ACT_DIV CCLK_DIV8
224#endif
225#ifndef CONFIG_CCLK_ACT_DIV
226#define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
227#endif
228
229#if defined(ANOMALY_05000273) && (CONFIG_CCLK_DIV == 1)
230#error ANOMALY 05000273, please make sure CCLK is at least 2x SCLK
231#endif
232
233#endif /* CONFIG_BFIN_KERNEL_CLOCK */
234
235#ifdef CONFIG_BF533
236#define CPU "BF533"
237#define CPUID 0x027a5000
238#endif
239#ifdef CONFIG_BF532
240#define CPU "BF532"
241#define CPUID 0x0275A000
242#endif
243#ifdef CONFIG_BF531
244#define CPU "BF531"
245#define CPUID 0x027a5000
246#endif
247#ifndef CPU
248#define CPU "UNKNOWN"
249#define CPUID 0x0
250#endif
251
252#if (CONFIG_MEM_SIZE % 4)
253#error "SDRAM mem size must be multible of 4MB"
254#endif
255
256#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO)
257#define SDRAM_IKERNEL (SDRAM_IGENERIC | CPLB_LOCK)
258#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
259#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID)
260
261/*Use the menuconfig cache policy here - CONFIG_BLKFIN_WT/CONFIG_BLKFIN_WB*/
262
263#define ANOMALY_05000158_WORKAROUND 0x200
264#ifdef CONFIG_BLKFIN_WB /*Write Back Policy */
265#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_DIRTY \
266 | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
267#else /*Write Through */
268#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_DIRTY \
269 | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
270#endif
271
272#define L1_DMEMORY (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
273#define SDRAM_DNON_CHBL (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
274#define SDRAM_EBIU (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
275#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
276
277#define SIZE_1K 0x00000400 /* 1K */
278#define SIZE_4K 0x00001000 /* 4K */
279#define SIZE_1M 0x00100000 /* 1M */
280#define SIZE_4M 0x00400000 /* 4M */
281
282#define MAX_CPLBS (16 * 2)
283
284/*
285* Number of required data CPLB switchtable entries
286* MEMSIZE / 4 (we mostly install 4M page size CPLBs
287* approx 16 for smaller 1MB page size CPLBs for allignment purposes
288* 1 for L1 Data Memory
289* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
290* 1 for ASYNC Memory
291*/
292
293
294#define MAX_SWITCH_D_CPLBS (((CONFIG_MEM_SIZE / 4) + 16 + 1 + 1 + 1) * 2)
295
296/*
297* Number of required instruction CPLB switchtable entries
298* MEMSIZE / 4 (we mostly install 4M page size CPLBs
299* approx 12 for smaller 1MB page size CPLBs for allignment purposes
300* 1 for L1 Instruction Memory
301* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
302*/
303
304#define MAX_SWITCH_I_CPLBS (((CONFIG_MEM_SIZE / 4) + 12 + 1 + 1) * 2)
305
306#endif /* __MACH_BF533_H__ */
diff --git a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
new file mode 100644
index 000000000000..23bf76aa3451
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
@@ -0,0 +1,108 @@
1#include <linux/serial.h>
2#include <asm/dma.h>
3
4#define NR_PORTS 1
5
6#define OFFSET_THR 0x00 /* Transmit Holding register */
7#define OFFSET_RBR 0x00 /* Receive Buffer register */
8#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
9#define OFFSET_IER 0x04 /* Interrupt Enable Register */
10#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
11#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
12#define OFFSET_LCR 0x0C /* Line Control Register */
13#define OFFSET_MCR 0x10 /* Modem Control Register */
14#define OFFSET_LSR 0x14 /* Line Status Register */
15#define OFFSET_MSR 0x18 /* Modem Status Register */
16#define OFFSET_SCR 0x1C /* SCR Scratch Register */
17#define OFFSET_GCTL 0x24 /* Global Control Register */
18
19#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
20#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
21#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
22#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
23#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
24#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
25#define UART_GET_LSR(uart) bfin_read16(((uart)->port.membase + OFFSET_LSR))
26#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
27
28#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
29#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
30#define UART_PUT_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER),v)
31#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
32#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
33#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
34
35#ifdef CONFIG_BFIN_UART0_CTSRTS
36# define CONFIG_SERIAL_BFIN_CTSRTS
37# ifndef CONFIG_UART0_CTS_PIN
38# define CONFIG_UART0_CTS_PIN -1
39# endif
40# ifndef CONFIG_UART0_RTS_PIN
41# define CONFIG_UART0_RTS_PIN -1
42# endif
43#endif
44
45struct bfin_serial_port {
46 struct uart_port port;
47 unsigned int old_status;
48#ifdef CONFIG_SERIAL_BFIN_DMA
49 int tx_done;
50 int tx_count;
51 struct circ_buf rx_dma_buf;
52 struct timer_list rx_dma_timer;
53 int rx_dma_nrows;
54 unsigned int tx_dma_channel;
55 unsigned int rx_dma_channel;
56 struct work_struct tx_dma_workqueue;
57#else
58 struct work_struct cts_workqueue;
59#endif
60#ifdef CONFIG_SERIAL_BFIN_CTSRTS
61 int cts_pin;
62 int rts_pin;
63#endif
64};
65
66struct bfin_serial_port bfin_serial_ports[NR_PORTS];
67struct bfin_serial_res {
68 unsigned long uart_base_addr;
69 int uart_irq;
70#ifdef CONFIG_SERIAL_BFIN_DMA
71 unsigned int uart_tx_dma_channel;
72 unsigned int uart_rx_dma_channel;
73#endif
74#ifdef CONFIG_SERIAL_BFIN_CTSRTS
75 int uart_cts_pin;
76 int uart_rts_pin;
77#endif
78};
79
80struct bfin_serial_res bfin_serial_resource[] = {
81 0xFFC00400,
82 IRQ_UART_RX,
83#ifdef CONFIG_SERIAL_BFIN_DMA
84 CH_UART_TX,
85 CH_UART_RX,
86#endif
87#ifdef CONFIG_BFIN_UART0_CTSRTS
88 CONFIG_UART0_CTS_PIN,
89 CONFIG_UART0_RTS_PIN,
90#endif
91};
92
93
94int nr_ports = NR_PORTS;
95static void bfin_serial_hw_init(struct bfin_serial_port *uart)
96{
97
98#ifdef CONFIG_SERIAL_BFIN_CTSRTS
99 if (uart->cts_pin >= 0) {
100 gpio_request(uart->cts_pin, NULL);
101 gpio_direction_input(uart->cts_pin);
102 }
103 if (uart->rts_pin >= 0) {
104 gpio_request(uart->rts_pin, NULL);
105 gpio_direction_input(uart->rts_pin);
106 }
107#endif
108}
diff --git a/include/asm-blackfin/mach-bf533/blackfin.h b/include/asm-blackfin/mach-bf533/blackfin.h
new file mode 100644
index 000000000000..e4384491e972
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/blackfin.h
@@ -0,0 +1,45 @@
1/*
2 * File: include/asm-blackfin/mach-bf533/blackfin.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _MACH_BLACKFIN_H_
32#define _MACH_BLACKFIN_H_
33
34#define BF533_FAMILY
35
36#include "bf533.h"
37#include "mem_map.h"
38#include "defBF532.h"
39#include "anomaly.h"
40
41#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
42#include "cdefBF532.h"
43#endif
44
45#endif /* _MACH_BLACKFIN_H_ */
diff --git a/include/asm-blackfin/mach-bf533/cdefBF532.h b/include/asm-blackfin/mach-bf533/cdefBF532.h
new file mode 100644
index 000000000000..1d7c494ceb64
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/cdefBF532.h
@@ -0,0 +1,706 @@
1/*
2 * File: include/asm-blackfin/mach-bf533/cdefBF532.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _CDEF_BF532_H
32#define _CDEF_BF532_H
33/*
34#if !defined(__ADSPLPBLACKFIN__)
35#warning cdefBF532.h should only be included for 532 compatible chips.
36#endif
37*/
38/*include all Core registers and bit definitions*/
39#include "defBF532.h"
40
41/*include core specific register pointer definitions*/
42#include <asm/mach-common/cdef_LPBlackfin.h>
43
44#include <asm/system.h>
45
46/* Clock and System Control (0xFFC0 0400-0xFFC0 07FF) */
47#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
48#define bfin_write_PLL_CTL(val) bfin_write16(PLL_CTL,val)
49#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
50#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
51#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
52#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
53#define bfin_read_CHIPID() bfin_read32(CHIPID)
54#define bfin_read_SWRST() bfin_read16(SWRST)
55#define bfin_write_SWRST(val) bfin_write16(SWRST,val)
56#define bfin_read_SYSCR() bfin_read16(SYSCR)
57#define bfin_write_SYSCR(val) bfin_write16(SYSCR,val)
58#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
59#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
60#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
61/* Writing to VR_CTL initiates a PLL relock sequence. */
62static __inline__ void bfin_write_VR_CTL(unsigned int val)
63{
64 unsigned long flags, iwr;
65
66 bfin_write16(VR_CTL, val);
67 __builtin_bfin_ssync();
68 /* Enable the PLL Wakeup bit in SIC IWR */
69 iwr = bfin_read32(SIC_IWR);
70 /* Only allow PPL Wakeup) */
71 bfin_write32(SIC_IWR, IWR_ENABLE(0));
72 local_irq_save(flags);
73 asm("IDLE;");
74 local_irq_restore(flags);
75 bfin_write32(SIC_IWR, iwr);
76}
77
78/* System Interrupt Controller (0xFFC0 0C00-0xFFC0 0FFF) */
79#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
80#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0,val)
81#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
82#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1,val)
83#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
84#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2,val)
85#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
86#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3,val)
87#define bfin_read_SIC_IMASK() bfin_read32(SIC_IMASK)
88#define bfin_write_SIC_IMASK(val) bfin_write32(SIC_IMASK,val)
89#define bfin_read_SIC_ISR() bfin_read32(SIC_ISR)
90#define bfin_write_SIC_ISR(val) bfin_write32(SIC_ISR,val)
91#define bfin_read_SIC_IWR() bfin_read32(SIC_IWR)
92#define bfin_write_SIC_IWR(val) bfin_write32(SIC_IWR,val)
93
94/* Watchdog Timer (0xFFC0 1000-0xFFC0 13FF) */
95#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
96#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL,val)
97#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
98#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT,val)
99#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
100#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT,val)
101
102/* Real Time Clock (0xFFC0 1400-0xFFC0 17FF) */
103#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
104#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT,val)
105#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
106#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL,val)
107#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
108#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT,val)
109#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
110#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT,val)
111#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
112#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM,val)
113#define bfin_read_RTC_FAST() bfin_read16(RTC_FAST)
114#define bfin_write_RTC_FAST(val) bfin_write16(RTC_FAST,val)
115#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
116#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN,val)
117
118/* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */
119#define bfin_read_FIO_DIR() bfin_read16(FIO_DIR)
120#define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val)
121#define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C)
122#define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C,val)
123#define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S)
124#define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S,val)
125#define bfin_read_FIO_MASKA_C() bfin_read16(FIO_MASKA_C)
126#define bfin_write_FIO_MASKA_C(val) bfin_write16(FIO_MASKA_C,val)
127#define bfin_read_FIO_MASKA_S() bfin_read16(FIO_MASKA_S)
128#define bfin_write_FIO_MASKA_S(val) bfin_write16(FIO_MASKA_S,val)
129#define bfin_read_FIO_MASKB_C() bfin_read16(FIO_MASKB_C)
130#define bfin_write_FIO_MASKB_C(val) bfin_write16(FIO_MASKB_C,val)
131#define bfin_read_FIO_MASKB_S() bfin_read16(FIO_MASKB_S)
132#define bfin_write_FIO_MASKB_S(val) bfin_write16(FIO_MASKB_S,val)
133#define bfin_read_FIO_POLAR() bfin_read16(FIO_POLAR)
134#define bfin_write_FIO_POLAR(val) bfin_write16(FIO_POLAR,val)
135#define bfin_read_FIO_EDGE() bfin_read16(FIO_EDGE)
136#define bfin_write_FIO_EDGE(val) bfin_write16(FIO_EDGE,val)
137#define bfin_read_FIO_BOTH() bfin_read16(FIO_BOTH)
138#define bfin_write_FIO_BOTH(val) bfin_write16(FIO_BOTH,val)
139#define bfin_read_FIO_INEN() bfin_read16(FIO_INEN)
140#define bfin_write_FIO_INEN(val) bfin_write16(FIO_INEN,val)
141#define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D)
142#define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D,val)
143#define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T)
144#define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T,val)
145#define bfin_read_FIO_MASKA_D() bfin_read16(FIO_MASKA_D)
146#define bfin_write_FIO_MASKA_D(val) bfin_write16(FIO_MASKA_D,val)
147#define bfin_read_FIO_MASKA_T() bfin_read16(FIO_MASKA_T)
148#define bfin_write_FIO_MASKA_T(val) bfin_write16(FIO_MASKA_T,val)
149#define bfin_read_FIO_MASKB_D() bfin_read16(FIO_MASKB_D)
150#define bfin_write_FIO_MASKB_D(val) bfin_write16(FIO_MASKB_D,val)
151#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T)
152#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val)
153
154/* DMA Traffic controls */
155#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
156#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER,val)
157#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
158#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT,val)
159#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
160#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER,val)
161#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
162#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT,val)
163
164/* DMA Controller */
165#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
166#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val)
167#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
168#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR,val)
169#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
170#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR,val)
171#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
172#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT,val)
173#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
174#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT,val)
175#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
176#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY,val)
177#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
178#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY,val)
179#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
180#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR,val)
181#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
182#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR,val)
183#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
184#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT,val)
185#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
186#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT,val)
187#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
188#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS,val)
189#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
190#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP,val)
191
192#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
193#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG,val)
194#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
195#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR,val)
196#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
197#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR,val)
198#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
199#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT,val)
200#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
201#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT,val)
202#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
203#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY,val)
204#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
205#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY,val)
206#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
207#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR,val)
208#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
209#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR,val)
210#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
211#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT,val)
212#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
213#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT,val)
214#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
215#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS,val)
216#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
217#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP,val)
218
219#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
220#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG,val)
221#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
222#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR,val)
223#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
224#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR,val)
225#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
226#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT,val)
227#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
228#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT,val)
229#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
230#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY,val)
231#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
232#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY,val)
233#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
234#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR,val)
235#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
236#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR,val)
237#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
238#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT,val)
239#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
240#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT,val)
241#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
242#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS,val)
243#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
244#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP,val)
245
246#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
247#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG,val)
248#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
249#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR,val)
250#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
251#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR,val)
252#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
253#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT,val)
254#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
255#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT,val)
256#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
257#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY,val)
258#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
259#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY,val)
260#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
261#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR,val)
262#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
263#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR,val)
264#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
265#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT,val)
266#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
267#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT,val)
268#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
269#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS,val)
270#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
271#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP,val)
272
273#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
274#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG,val)
275#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
276#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR,val)
277#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
278#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR,val)
279#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
280#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT,val)
281#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
282#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT,val)
283#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
284#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY,val)
285#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
286#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY,val)
287#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
288#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR,val)
289#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
290#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR,val)
291#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
292#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT,val)
293#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
294#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT,val)
295#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
296#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS,val)
297#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
298#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP,val)
299
300#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
301#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG,val)
302#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
303#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR,val)
304#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
305#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR,val)
306#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
307#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT,val)
308#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
309#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT,val)
310#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
311#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY,val)
312#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
313#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY,val)
314#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
315#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR,val)
316#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
317#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR,val)
318#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
319#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT,val)
320#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
321#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT,val)
322#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
323#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS,val)
324#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
325#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP,val)
326
327#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
328#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG,val)
329#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
330#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR,val)
331#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
332#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR,val)
333#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
334#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT,val)
335#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
336#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT,val)
337#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
338#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY,val)
339#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
340#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY,val)
341#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
342#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR,val)
343#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
344#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR,val)
345#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
346#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT,val)
347#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
348#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT,val)
349#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
350#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS,val)
351#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
352#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP,val)
353
354#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
355#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG,val)
356#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
357#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR,val)
358#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
359#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR,val)
360#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
361#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT,val)
362#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
363#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT,val)
364#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
365#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY,val)
366#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
367#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY,val)
368#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
369#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR,val)
370#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
371#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR,val)
372#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
373#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT,val)
374#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
375#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT,val)
376#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
377#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS,val)
378#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
379#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP,val)
380
381#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
382#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG,val)
383#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
384#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR,val)
385#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
386#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR,val)
387#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
388#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT,val)
389#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
390#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT,val)
391#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
392#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY,val)
393#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
394#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY,val)
395#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
396#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR,val)
397#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
398#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR,val)
399#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
400#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT,val)
401#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
402#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT,val)
403#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
404#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS,val)
405#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
406#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP,val)
407
408#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
409#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG,val)
410#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
411#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR,val)
412#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
413#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR,val)
414#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
415#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT,val)
416#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
417#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT,val)
418#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
419#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY,val)
420#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
421#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY,val)
422#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
423#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR,val)
424#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
425#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR,val)
426#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
427#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT,val)
428#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
429#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT,val)
430#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
431#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS,val)
432#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
433#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP,val)
434
435#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
436#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG,val)
437#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
438#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR,val)
439#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
440#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR,val)
441#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
442#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT,val)
443#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
444#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT,val)
445#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
446#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY,val)
447#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
448#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY,val)
449#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
450#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR,val)
451#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
452#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR,val)
453#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
454#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT,val)
455#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
456#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT,val)
457#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
458#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS,val)
459#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
460#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP,val)
461
462#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
463#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG,val)
464#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
465#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR,val)
466#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
467#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR,val)
468#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
469#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT,val)
470#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
471#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT,val)
472#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
473#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY,val)
474#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
475#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY,val)
476#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
477#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR,val)
478#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
479#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR,val)
480#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
481#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT,val)
482#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
483#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT,val)
484#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
485#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS,val)
486#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
487#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP,val)
488
489/* Aysnchronous Memory Controller - External Bus Interface Unit (0xFFC0 3C00-0xFFC0 3FFF) */
490#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
491#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL,val)
492#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
493#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0,val)
494#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
495#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1,val)
496
497/* SDRAM Controller External Bus Interface Unit (0xFFC0 4C00-0xFFC0 4FFF) */
498#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
499#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL,val)
500#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
501#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC,val)
502#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
503#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT,val)
504#define bfin_read_EBIU_SDBCTL() bfin_read16(EBIU_SDBCTL)
505#define bfin_write_EBIU_SDBCTL(val) bfin_write16(EBIU_SDBCTL,val)
506
507/* UART Controller */
508#define bfin_read_UART_THR() bfin_read16(UART_THR)
509#define bfin_write_UART_THR(val) bfin_write16(UART_THR,val)
510#define bfin_read_UART_RBR() bfin_read16(UART_RBR)
511#define bfin_write_UART_RBR(val) bfin_write16(UART_RBR,val)
512#define bfin_read_UART_DLL() bfin_read16(UART_DLL)
513#define bfin_write_UART_DLL(val) bfin_write16(UART_DLL,val)
514#define bfin_read_UART_IER() bfin_read16(UART_IER)
515#define bfin_write_UART_IER(val) bfin_write16(UART_IER,val)
516#define bfin_read_UART_DLH() bfin_read16(UART_DLH)
517#define bfin_write_UART_DLH(val) bfin_write16(UART_DLH,val)
518#define bfin_read_UART_IIR() bfin_read16(UART_IIR)
519#define bfin_write_UART_IIR(val) bfin_write16(UART_IIR,val)
520#define bfin_read_UART_LCR() bfin_read16(UART_LCR)
521#define bfin_write_UART_LCR(val) bfin_write16(UART_LCR,val)
522#define bfin_read_UART_MCR() bfin_read16(UART_MCR)
523#define bfin_write_UART_MCR(val) bfin_write16(UART_MCR,val)
524#define bfin_read_UART_LSR() bfin_read16(UART_LSR)
525#define bfin_write_UART_LSR(val) bfin_write16(UART_LSR,val)
526/*
527#define UART_MSR
528*/
529#define bfin_read_UART_SCR() bfin_read16(UART_SCR)
530#define bfin_write_UART_SCR(val) bfin_write16(UART_SCR,val)
531#define bfin_read_UART_GCTL() bfin_read16(UART_GCTL)
532#define bfin_write_UART_GCTL(val) bfin_write16(UART_GCTL,val)
533
534/* SPI Controller */
535#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
536#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL,val)
537#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
538#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG,val)
539#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
540#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT,val)
541#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
542#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR,val)
543#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
544#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR,val)
545#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
546#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD,val)
547#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
548#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW,val)
549
550/* TIMER 0, 1, 2 Registers */
551#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
552#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG,val)
553#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
554#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER,val)
555#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
556#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD,val)
557#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
558#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH,val)
559
560#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
561#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG,val)
562#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
563#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER,val)
564#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
565#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD,val)
566#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
567#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH,val)
568
569#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
570#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG,val)
571#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
572#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER,val)
573#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
574#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD,val)
575#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
576#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH,val)
577
578#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
579#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE,val)
580#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
581#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE,val)
582#define bfin_read_TIMER_STATUS() bfin_read16(TIMER_STATUS)
583#define bfin_write_TIMER_STATUS(val) bfin_write16(TIMER_STATUS,val)
584
585/* SPORT0 Controller */
586#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
587#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1,val)
588#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
589#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2,val)
590#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
591#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV,val)
592#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
593#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV,val)
594#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
595#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX,val)
596#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
597#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX,val)
598#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX)
599#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX,val)
600#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX)
601#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX,val)
602#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX)
603#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX,val)
604#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX)
605#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX,val)
606#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
607#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1,val)
608#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
609#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2,val)
610#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
611#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV,val)
612#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
613#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV,val)
614#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
615#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT,val)
616#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
617#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL,val)
618#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
619#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1,val)
620#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
621#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2,val)
622#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
623#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0,val)
624#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
625#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1,val)
626#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
627#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2,val)
628#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
629#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3,val)
630#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
631#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0,val)
632#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
633#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1,val)
634#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
635#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2,val)
636#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
637#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3,val)
638
639/* SPORT1 Controller */
640#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
641#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1,val)
642#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
643#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2,val)
644#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
645#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV,val)
646#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
647#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV,val)
648#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
649#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX,val)
650#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
651#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX,val)
652#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX)
653#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX,val)
654#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX)
655#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX,val)
656#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX)
657#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX,val)
658#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX)
659#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX,val)
660#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
661#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1,val)
662#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
663#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2,val)
664#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
665#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV,val)
666#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
667#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV,val)
668#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
669#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT,val)
670#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
671#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL,val)
672#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
673#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1,val)
674#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
675#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2,val)
676#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
677#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0,val)
678#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
679#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1,val)
680#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
681#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2,val)
682#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
683#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3,val)
684#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
685#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0,val)
686#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
687#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1,val)
688#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
689#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2,val)
690#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
691#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3,val)
692
693/* Parallel Peripheral Interface (PPI) */
694#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
695#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL,val)
696#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
697#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS,val)
698#define bfin_clear_PPI_STATUS() bfin_read_PPI_STATUS()
699#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
700#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY,val)
701#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
702#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT,val)
703#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
704#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val)
705
706#endif /* _CDEF_BF532_H */
diff --git a/include/asm-blackfin/mach-bf533/defBF532.h b/include/asm-blackfin/mach-bf533/defBF532.h
new file mode 100644
index 000000000000..b240a082aa09
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/defBF532.h
@@ -0,0 +1,1175 @@
1/************************************************************************
2 *
3 * This file is subject to the terms and conditions of the GNU Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Non-GPL License also available as part of VisualDSP++
8 * http://www.analog.com/processors/resources/crosscore/visualDspDevSoftware.html
9 *
10 * (c) Copyright 2001-2005 Analog Devices, Inc. All rights reserved
11 *
12 * This file under source code control, please send bugs or changes to:
13 * dsptools.support@analog.com
14 *
15 ************************************************************************/
16/*
17 * File: include/asm-blackfin/mach-bf533/defBF532.h
18 * Based on:
19 * Author:
20 *
21 * Created:
22 * Description:
23 *
24 * Rev:
25 *
26 * Modified:
27 *
28 * Bugs: Enter bugs at http://blackfin.uclinux.org/
29 *
30 * This program is free software; you can redistribute it and/or modify
31 * it under the terms of the GNU General Public License as published by
32 * the Free Software Foundation; either version 2, or (at your option)
33 * any later version.
34 *
35 * This program is distributed in the hope that it will be useful,
36 * but WITHOUT ANY WARRANTY; without even the implied warranty of
37 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 * GNU General Public License for more details.
39 *
40 * You should have received a copy of the GNU General Public License
41 * along with this program; see the file COPYING.
42 * If not, write to the Free Software Foundation,
43 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
44 */
45/* SYSTEM & MM REGISTER BIT & ADDRESS DEFINITIONS FOR ADSP-BF532 */
46
47#ifndef _DEF_BF532_H
48#define _DEF_BF532_H
49/*
50#if !defined(__ADSPLPBLACKFIN__)
51#warning defBF532.h should only be included for 532 compatible chips
52#endif
53*/
54/* include all Core registers and bit definitions */
55#include <asm/mach-common/def_LPBlackfin.h>
56
57/*********************************************************************************** */
58/* System MMR Register Map */
59/*********************************************************************************** */
60/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
61
62#define PLL_CTL 0xFFC00000 /* PLL Control register (16-bit) */
63#define PLL_DIV 0xFFC00004 /* PLL Divide Register (16-bit) */
64#define VR_CTL 0xFFC00008 /* Voltage Regulator Control Register (16-bit) */
65#define PLL_STAT 0xFFC0000C /* PLL Status register (16-bit) */
66#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */
67#define CHIPID 0xFFC00014 /* Chip ID Register */
68#define SWRST 0xFFC00100 /* Software Reset Register (16-bit) */
69#define SYSCR 0xFFC00104 /* System Configuration registe */
70
71/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
72#define SIC_RVECT 0xFFC00108 /* Interrupt Reset Vector Address Register */
73#define SIC_IMASK 0xFFC0010C /* Interrupt Mask Register */
74#define SIC_IAR0 0xFFC00110 /* Interrupt Assignment Register 0 */
75#define SIC_IAR1 0xFFC00114 /* Interrupt Assignment Register 1 */
76#define SIC_IAR2 0xFFC00118 /* Interrupt Assignment Register 2 */
77#define SIC_ISR 0xFFC00120 /* Interrupt Status Register */
78#define SIC_IWR 0xFFC00124 /* Interrupt Wakeup Register */
79
80/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
81#define WDOG_CTL 0xFFC00200 /* Watchdog Control Register */
82#define WDOG_CNT 0xFFC00204 /* Watchdog Count Register */
83#define WDOG_STAT 0xFFC00208 /* Watchdog Status Register */
84
85/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
86#define RTC_STAT 0xFFC00300 /* RTC Status Register */
87#define RTC_ICTL 0xFFC00304 /* RTC Interrupt Control Register */
88#define RTC_ISTAT 0xFFC00308 /* RTC Interrupt Status Register */
89#define RTC_SWCNT 0xFFC0030C /* RTC Stopwatch Count Register */
90#define RTC_ALARM 0xFFC00310 /* RTC Alarm Time Register */
91#define RTC_FAST 0xFFC00314 /* RTC Prescaler Enable Register */
92#define RTC_PREN 0xFFC00314 /* RTC Prescaler Enable Register (alternate macro) */
93
94/* UART Controller (0xFFC00400 - 0xFFC004FF) */
95#define UART_THR 0xFFC00400 /* Transmit Holding register */
96#define UART_RBR 0xFFC00400 /* Receive Buffer register */
97#define UART_DLL 0xFFC00400 /* Divisor Latch (Low-Byte) */
98#define UART_IER 0xFFC00404 /* Interrupt Enable Register */
99#define UART_DLH 0xFFC00404 /* Divisor Latch (High-Byte) */
100#define UART_IIR 0xFFC00408 /* Interrupt Identification Register */
101#define UART_LCR 0xFFC0040C /* Line Control Register */
102#define UART_MCR 0xFFC00410 /* Modem Control Register */
103#define UART_LSR 0xFFC00414 /* Line Status Register */
104#if 0
105#define UART_MSR 0xFFC00418 /* Modem Status Register (UNUSED in ADSP-BF532) */
106#endif
107#define UART_SCR 0xFFC0041C /* SCR Scratch Register */
108#define UART_GCTL 0xFFC00424 /* Global Control Register */
109
110/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
111#define SPI_CTL 0xFFC00500 /* SPI Control Register */
112#define SPI_FLG 0xFFC00504 /* SPI Flag register */
113#define SPI_STAT 0xFFC00508 /* SPI Status register */
114#define SPI_TDBR 0xFFC0050C /* SPI Transmit Data Buffer Register */
115#define SPI_RDBR 0xFFC00510 /* SPI Receive Data Buffer Register */
116#define SPI_BAUD 0xFFC00514 /* SPI Baud rate Register */
117#define SPI_SHADOW 0xFFC00518 /* SPI_RDBR Shadow Register */
118
119/* TIMER 0, 1, 2 Registers (0xFFC00600 - 0xFFC006FF) */
120
121#define TIMER0_CONFIG 0xFFC00600 /* Timer 0 Configuration Register */
122#define TIMER0_COUNTER 0xFFC00604 /* Timer 0 Counter Register */
123#define TIMER0_PERIOD 0xFFC00608 /* Timer 0 Period Register */
124#define TIMER0_WIDTH 0xFFC0060C /* Timer 0 Width Register */
125
126#define TIMER1_CONFIG 0xFFC00610 /* Timer 1 Configuration Register */
127#define TIMER1_COUNTER 0xFFC00614 /* Timer 1 Counter Register */
128#define TIMER1_PERIOD 0xFFC00618 /* Timer 1 Period Register */
129#define TIMER1_WIDTH 0xFFC0061C /* Timer 1 Width Register */
130
131#define TIMER2_CONFIG 0xFFC00620 /* Timer 2 Configuration Register */
132#define TIMER2_COUNTER 0xFFC00624 /* Timer 2 Counter Register */
133#define TIMER2_PERIOD 0xFFC00628 /* Timer 2 Period Register */
134#define TIMER2_WIDTH 0xFFC0062C /* Timer 2 Width Register */
135
136#define TIMER_ENABLE 0xFFC00640 /* Timer Enable Register */
137#define TIMER_DISABLE 0xFFC00644 /* Timer Disable Register */
138#define TIMER_STATUS 0xFFC00648 /* Timer Status Register */
139
140/* General Purpose IO (0xFFC00700 - 0xFFC007FF) */
141
142#define FIO_FLAG_D 0xFFC00700 /* Flag Mask to directly specify state of pins */
143#define FIO_FLAG_C 0xFFC00704 /* Peripheral Interrupt Flag Register (clear) */
144#define FIO_FLAG_S 0xFFC00708 /* Peripheral Interrupt Flag Register (set) */
145#define FIO_FLAG_T 0xFFC0070C /* Flag Mask to directly toggle state of pins */
146#define FIO_MASKA_D 0xFFC00710 /* Flag Mask Interrupt A Register (set directly) */
147#define FIO_MASKA_C 0xFFC00714 /* Flag Mask Interrupt A Register (clear) */
148#define FIO_MASKA_S 0xFFC00718 /* Flag Mask Interrupt A Register (set) */
149#define FIO_MASKA_T 0xFFC0071C /* Flag Mask Interrupt A Register (toggle) */
150#define FIO_MASKB_D 0xFFC00720 /* Flag Mask Interrupt B Register (set directly) */
151#define FIO_MASKB_C 0xFFC00724 /* Flag Mask Interrupt B Register (clear) */
152#define FIO_MASKB_S 0xFFC00728 /* Flag Mask Interrupt B Register (set) */
153#define FIO_MASKB_T 0xFFC0072C /* Flag Mask Interrupt B Register (toggle) */
154#define FIO_DIR 0xFFC00730 /* Peripheral Flag Direction Register */
155#define FIO_POLAR 0xFFC00734 /* Flag Source Polarity Register */
156#define FIO_EDGE 0xFFC00738 /* Flag Source Sensitivity Register */
157#define FIO_BOTH 0xFFC0073C /* Flag Set on BOTH Edges Register */
158#define FIO_INEN 0xFFC00740 /* Flag Input Enable Register */
159
160/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
161#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
162#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
163#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
164#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
165#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
166#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
167#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
168#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
169#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
170#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
171#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
172#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
173#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
174#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
175#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
176#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
177#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
178#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
179#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
180#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
181#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
182#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
183
184/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
185#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
186#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
187#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
188#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
189#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
190#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
191#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
192#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
193#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
194#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
195#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
196#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
197#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
198#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
199#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
200#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
201#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
202#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
203#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
204#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
205#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
206#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
207
208/* Asynchronous Memory Controller - External Bus Interface Unit */
209#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
210#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
211#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
212
213/* SDRAM Controller External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
214
215#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
216#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
217#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
218#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
219
220/* DMA Traffic controls */
221#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
222#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
223#define DMA_TC_PER 0xFFC00B0C /* Traffic Control Periods Register */
224#define DMA_TC_CNT 0xFFC00B10 /* Traffic Control Current Counts Register */
225
226/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */
227#define DMA0_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */
228#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
229#define DMA0_START_ADDR 0xFFC00C04 /* DMA Channel 0 Start Address Register */
230#define DMA0_X_COUNT 0xFFC00C10 /* DMA Channel 0 X Count Register */
231#define DMA0_Y_COUNT 0xFFC00C18 /* DMA Channel 0 Y Count Register */
232#define DMA0_X_MODIFY 0xFFC00C14 /* DMA Channel 0 X Modify Register */
233#define DMA0_Y_MODIFY 0xFFC00C1C /* DMA Channel 0 Y Modify Register */
234#define DMA0_CURR_DESC_PTR 0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
235#define DMA0_CURR_ADDR 0xFFC00C24 /* DMA Channel 0 Current Address Register */
236#define DMA0_CURR_X_COUNT 0xFFC00C30 /* DMA Channel 0 Current X Count Register */
237#define DMA0_CURR_Y_COUNT 0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
238#define DMA0_IRQ_STATUS 0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
239#define DMA0_PERIPHERAL_MAP 0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
240
241#define DMA1_CONFIG 0xFFC00C48 /* DMA Channel 1 Configuration Register */
242#define DMA1_NEXT_DESC_PTR 0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
243#define DMA1_START_ADDR 0xFFC00C44 /* DMA Channel 1 Start Address Register */
244#define DMA1_X_COUNT 0xFFC00C50 /* DMA Channel 1 X Count Register */
245#define DMA1_Y_COUNT 0xFFC00C58 /* DMA Channel 1 Y Count Register */
246#define DMA1_X_MODIFY 0xFFC00C54 /* DMA Channel 1 X Modify Register */
247#define DMA1_Y_MODIFY 0xFFC00C5C /* DMA Channel 1 Y Modify Register */
248#define DMA1_CURR_DESC_PTR 0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
249#define DMA1_CURR_ADDR 0xFFC00C64 /* DMA Channel 1 Current Address Register */
250#define DMA1_CURR_X_COUNT 0xFFC00C70 /* DMA Channel 1 Current X Count Register */
251#define DMA1_CURR_Y_COUNT 0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
252#define DMA1_IRQ_STATUS 0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
253#define DMA1_PERIPHERAL_MAP 0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
254
255#define DMA2_CONFIG 0xFFC00C88 /* DMA Channel 2 Configuration Register */
256#define DMA2_NEXT_DESC_PTR 0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
257#define DMA2_START_ADDR 0xFFC00C84 /* DMA Channel 2 Start Address Register */
258#define DMA2_X_COUNT 0xFFC00C90 /* DMA Channel 2 X Count Register */
259#define DMA2_Y_COUNT 0xFFC00C98 /* DMA Channel 2 Y Count Register */
260#define DMA2_X_MODIFY 0xFFC00C94 /* DMA Channel 2 X Modify Register */
261#define DMA2_Y_MODIFY 0xFFC00C9C /* DMA Channel 2 Y Modify Register */
262#define DMA2_CURR_DESC_PTR 0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
263#define DMA2_CURR_ADDR 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
264#define DMA2_CURR_X_COUNT 0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
265#define DMA2_CURR_Y_COUNT 0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
266#define DMA2_IRQ_STATUS 0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
267#define DMA2_PERIPHERAL_MAP 0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
268
269#define DMA3_CONFIG 0xFFC00CC8 /* DMA Channel 3 Configuration Register */
270#define DMA3_NEXT_DESC_PTR 0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
271#define DMA3_START_ADDR 0xFFC00CC4 /* DMA Channel 3 Start Address Register */
272#define DMA3_X_COUNT 0xFFC00CD0 /* DMA Channel 3 X Count Register */
273#define DMA3_Y_COUNT 0xFFC00CD8 /* DMA Channel 3 Y Count Register */
274#define DMA3_X_MODIFY 0xFFC00CD4 /* DMA Channel 3 X Modify Register */
275#define DMA3_Y_MODIFY 0xFFC00CDC /* DMA Channel 3 Y Modify Register */
276#define DMA3_CURR_DESC_PTR 0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
277#define DMA3_CURR_ADDR 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
278#define DMA3_CURR_X_COUNT 0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
279#define DMA3_CURR_Y_COUNT 0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
280#define DMA3_IRQ_STATUS 0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
281#define DMA3_PERIPHERAL_MAP 0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
282
283#define DMA4_CONFIG 0xFFC00D08 /* DMA Channel 4 Configuration Register */
284#define DMA4_NEXT_DESC_PTR 0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
285#define DMA4_START_ADDR 0xFFC00D04 /* DMA Channel 4 Start Address Register */
286#define DMA4_X_COUNT 0xFFC00D10 /* DMA Channel 4 X Count Register */
287#define DMA4_Y_COUNT 0xFFC00D18 /* DMA Channel 4 Y Count Register */
288#define DMA4_X_MODIFY 0xFFC00D14 /* DMA Channel 4 X Modify Register */
289#define DMA4_Y_MODIFY 0xFFC00D1C /* DMA Channel 4 Y Modify Register */
290#define DMA4_CURR_DESC_PTR 0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
291#define DMA4_CURR_ADDR 0xFFC00D24 /* DMA Channel 4 Current Address Register */
292#define DMA4_CURR_X_COUNT 0xFFC00D30 /* DMA Channel 4 Current X Count Register */
293#define DMA4_CURR_Y_COUNT 0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
294#define DMA4_IRQ_STATUS 0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
295#define DMA4_PERIPHERAL_MAP 0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
296
297#define DMA5_CONFIG 0xFFC00D48 /* DMA Channel 5 Configuration Register */
298#define DMA5_NEXT_DESC_PTR 0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
299#define DMA5_START_ADDR 0xFFC00D44 /* DMA Channel 5 Start Address Register */
300#define DMA5_X_COUNT 0xFFC00D50 /* DMA Channel 5 X Count Register */
301#define DMA5_Y_COUNT 0xFFC00D58 /* DMA Channel 5 Y Count Register */
302#define DMA5_X_MODIFY 0xFFC00D54 /* DMA Channel 5 X Modify Register */
303#define DMA5_Y_MODIFY 0xFFC00D5C /* DMA Channel 5 Y Modify Register */
304#define DMA5_CURR_DESC_PTR 0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
305#define DMA5_CURR_ADDR 0xFFC00D64 /* DMA Channel 5 Current Address Register */
306#define DMA5_CURR_X_COUNT 0xFFC00D70 /* DMA Channel 5 Current X Count Register */
307#define DMA5_CURR_Y_COUNT 0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
308#define DMA5_IRQ_STATUS 0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
309#define DMA5_PERIPHERAL_MAP 0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
310
311#define DMA6_CONFIG 0xFFC00D88 /* DMA Channel 6 Configuration Register */
312#define DMA6_NEXT_DESC_PTR 0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
313#define DMA6_START_ADDR 0xFFC00D84 /* DMA Channel 6 Start Address Register */
314#define DMA6_X_COUNT 0xFFC00D90 /* DMA Channel 6 X Count Register */
315#define DMA6_Y_COUNT 0xFFC00D98 /* DMA Channel 6 Y Count Register */
316#define DMA6_X_MODIFY 0xFFC00D94 /* DMA Channel 6 X Modify Register */
317#define DMA6_Y_MODIFY 0xFFC00D9C /* DMA Channel 6 Y Modify Register */
318#define DMA6_CURR_DESC_PTR 0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
319#define DMA6_CURR_ADDR 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
320#define DMA6_CURR_X_COUNT 0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
321#define DMA6_CURR_Y_COUNT 0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
322#define DMA6_IRQ_STATUS 0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
323#define DMA6_PERIPHERAL_MAP 0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
324
325#define DMA7_CONFIG 0xFFC00DC8 /* DMA Channel 7 Configuration Register */
326#define DMA7_NEXT_DESC_PTR 0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
327#define DMA7_START_ADDR 0xFFC00DC4 /* DMA Channel 7 Start Address Register */
328#define DMA7_X_COUNT 0xFFC00DD0 /* DMA Channel 7 X Count Register */
329#define DMA7_Y_COUNT 0xFFC00DD8 /* DMA Channel 7 Y Count Register */
330#define DMA7_X_MODIFY 0xFFC00DD4 /* DMA Channel 7 X Modify Register */
331#define DMA7_Y_MODIFY 0xFFC00DDC /* DMA Channel 7 Y Modify Register */
332#define DMA7_CURR_DESC_PTR 0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
333#define DMA7_CURR_ADDR 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
334#define DMA7_CURR_X_COUNT 0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
335#define DMA7_CURR_Y_COUNT 0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
336#define DMA7_IRQ_STATUS 0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
337#define DMA7_PERIPHERAL_MAP 0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
338
339#define MDMA_D1_CONFIG 0xFFC00E88 /* MemDMA Stream 1 Destination Configuration Register */
340#define MDMA_D1_NEXT_DESC_PTR 0xFFC00E80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
341#define MDMA_D1_START_ADDR 0xFFC00E84 /* MemDMA Stream 1 Destination Start Address Register */
342#define MDMA_D1_X_COUNT 0xFFC00E90 /* MemDMA Stream 1 Destination X Count Register */
343#define MDMA_D1_Y_COUNT 0xFFC00E98 /* MemDMA Stream 1 Destination Y Count Register */
344#define MDMA_D1_X_MODIFY 0xFFC00E94 /* MemDMA Stream 1 Destination X Modify Register */
345#define MDMA_D1_Y_MODIFY 0xFFC00E9C /* MemDMA Stream 1 Destination Y Modify Register */
346#define MDMA_D1_CURR_DESC_PTR 0xFFC00EA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
347#define MDMA_D1_CURR_ADDR 0xFFC00EA4 /* MemDMA Stream 1 Destination Current Address Register */
348#define MDMA_D1_CURR_X_COUNT 0xFFC00EB0 /* MemDMA Stream 1 Destination Current X Count Register */
349#define MDMA_D1_CURR_Y_COUNT 0xFFC00EB8 /* MemDMA Stream 1 Destination Current Y Count Register */
350#define MDMA_D1_IRQ_STATUS 0xFFC00EA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
351#define MDMA_D1_PERIPHERAL_MAP 0xFFC00EAC /* MemDMA Stream 1 Destination Peripheral Map Register */
352
353#define MDMA_S1_CONFIG 0xFFC00EC8 /* MemDMA Stream 1 Source Configuration Register */
354#define MDMA_S1_NEXT_DESC_PTR 0xFFC00EC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
355#define MDMA_S1_START_ADDR 0xFFC00EC4 /* MemDMA Stream 1 Source Start Address Register */
356#define MDMA_S1_X_COUNT 0xFFC00ED0 /* MemDMA Stream 1 Source X Count Register */
357#define MDMA_S1_Y_COUNT 0xFFC00ED8 /* MemDMA Stream 1 Source Y Count Register */
358#define MDMA_S1_X_MODIFY 0xFFC00ED4 /* MemDMA Stream 1 Source X Modify Register */
359#define MDMA_S1_Y_MODIFY 0xFFC00EDC /* MemDMA Stream 1 Source Y Modify Register */
360#define MDMA_S1_CURR_DESC_PTR 0xFFC00EE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
361#define MDMA_S1_CURR_ADDR 0xFFC00EE4 /* MemDMA Stream 1 Source Current Address Register */
362#define MDMA_S1_CURR_X_COUNT 0xFFC00EF0 /* MemDMA Stream 1 Source Current X Count Register */
363#define MDMA_S1_CURR_Y_COUNT 0xFFC00EF8 /* MemDMA Stream 1 Source Current Y Count Register */
364#define MDMA_S1_IRQ_STATUS 0xFFC00EE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
365#define MDMA_S1_PERIPHERAL_MAP 0xFFC00EEC /* MemDMA Stream 1 Source Peripheral Map Register */
366
367#define MDMA_D0_CONFIG 0xFFC00E08 /* MemDMA Stream 0 Destination Configuration Register */
368#define MDMA_D0_NEXT_DESC_PTR 0xFFC00E00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
369#define MDMA_D0_START_ADDR 0xFFC00E04 /* MemDMA Stream 0 Destination Start Address Register */
370#define MDMA_D0_X_COUNT 0xFFC00E10 /* MemDMA Stream 0 Destination X Count Register */
371#define MDMA_D0_Y_COUNT 0xFFC00E18 /* MemDMA Stream 0 Destination Y Count Register */
372#define MDMA_D0_X_MODIFY 0xFFC00E14 /* MemDMA Stream 0 Destination X Modify Register */
373#define MDMA_D0_Y_MODIFY 0xFFC00E1C /* MemDMA Stream 0 Destination Y Modify Register */
374#define MDMA_D0_CURR_DESC_PTR 0xFFC00E20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
375#define MDMA_D0_CURR_ADDR 0xFFC00E24 /* MemDMA Stream 0 Destination Current Address Register */
376#define MDMA_D0_CURR_X_COUNT 0xFFC00E30 /* MemDMA Stream 0 Destination Current X Count Register */
377#define MDMA_D0_CURR_Y_COUNT 0xFFC00E38 /* MemDMA Stream 0 Destination Current Y Count Register */
378#define MDMA_D0_IRQ_STATUS 0xFFC00E28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
379#define MDMA_D0_PERIPHERAL_MAP 0xFFC00E2C /* MemDMA Stream 0 Destination Peripheral Map Register */
380
381#define MDMA_S0_CONFIG 0xFFC00E48 /* MemDMA Stream 0 Source Configuration Register */
382#define MDMA_S0_NEXT_DESC_PTR 0xFFC00E40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
383#define MDMA_S0_START_ADDR 0xFFC00E44 /* MemDMA Stream 0 Source Start Address Register */
384#define MDMA_S0_X_COUNT 0xFFC00E50 /* MemDMA Stream 0 Source X Count Register */
385#define MDMA_S0_Y_COUNT 0xFFC00E58 /* MemDMA Stream 0 Source Y Count Register */
386#define MDMA_S0_X_MODIFY 0xFFC00E54 /* MemDMA Stream 0 Source X Modify Register */
387#define MDMA_S0_Y_MODIFY 0xFFC00E5C /* MemDMA Stream 0 Source Y Modify Register */
388#define MDMA_S0_CURR_DESC_PTR 0xFFC00E60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
389#define MDMA_S0_CURR_ADDR 0xFFC00E64 /* MemDMA Stream 0 Source Current Address Register */
390#define MDMA_S0_CURR_X_COUNT 0xFFC00E70 /* MemDMA Stream 0 Source Current X Count Register */
391#define MDMA_S0_CURR_Y_COUNT 0xFFC00E78 /* MemDMA Stream 0 Source Current Y Count Register */
392#define MDMA_S0_IRQ_STATUS 0xFFC00E68 /* MemDMA Stream 0 Source Interrupt/Status Register */
393#define MDMA_S0_PERIPHERAL_MAP 0xFFC00E6C /* MemDMA Stream 0 Source Peripheral Map Register */
394
395/* Parallel Peripheral Interface (PPI) (0xFFC01000 - 0xFFC010FF) */
396
397#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */
398#define PPI_STATUS 0xFFC01004 /* PPI Status Register */
399#define PPI_COUNT 0xFFC01008 /* PPI Transfer Count Register */
400#define PPI_DELAY 0xFFC0100C /* PPI Delay Count Register */
401#define PPI_FRAME 0xFFC01010 /* PPI Frame Length Register */
402
403/*********************************************************************************** */
404/* System MMR Register Bits */
405/******************************************************************************* */
406
407/* ********************* PLL AND RESET MASKS ************************ */
408
409/* PLL_CTL Masks */
410#define PLL_CLKIN 0x00000000 /* Pass CLKIN to PLL */
411#define PLL_CLKIN_DIV2 0x00000001 /* Pass CLKIN/2 to PLL */
412#define PLL_OFF 0x00000002 /* Shut off PLL clocks */
413#define STOPCK_OFF 0x00000008 /* Core clock off */
414#define PDWN 0x00000020 /* Put the PLL in a Deep Sleep state */
415#define BYPASS 0x00000100 /* Bypass the PLL */
416
417/* PLL_DIV Masks */
418
419#define SCLK_DIV(x) (x) /* SCLK = VCO / x */
420
421#define CCLK_DIV1 0x00000000 /* CCLK = VCO / 1 */
422#define CCLK_DIV2 0x00000010 /* CCLK = VCO / 2 */
423#define CCLK_DIV4 0x00000020 /* CCLK = VCO / 4 */
424#define CCLK_DIV8 0x00000030 /* CCLK = VCO / 8 */
425
426/* PLL_STAT Masks */
427#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
428#define FULL_ON 0x0002 /* Processor In Full On Mode */
429#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
430#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
431
432/* CHIPID Masks */
433#define CHIPID_VERSION 0xF0000000
434#define CHIPID_FAMILY 0x0FFFF000
435#define CHIPID_MANUFACTURE 0x00000FFE
436
437/* SWRST Mask */
438#define SYSTEM_RESET 0x00000007 /* Initiates a system software reset */
439
440/* ************* SYSTEM INTERRUPT CONTROLLER MASKS ***************** */
441
442 /* SIC_IAR0 Masks */
443
444#define P0_IVG(x) ((x)-7) /* Peripheral #0 assigned IVG #x */
445#define P1_IVG(x) ((x)-7) << 0x4 /* Peripheral #1 assigned IVG #x */
446#define P2_IVG(x) ((x)-7) << 0x8 /* Peripheral #2 assigned IVG #x */
447#define P3_IVG(x) ((x)-7) << 0xC /* Peripheral #3 assigned IVG #x */
448#define P4_IVG(x) ((x)-7) << 0x10 /* Peripheral #4 assigned IVG #x */
449#define P5_IVG(x) ((x)-7) << 0x14 /* Peripheral #5 assigned IVG #x */
450#define P6_IVG(x) ((x)-7) << 0x18 /* Peripheral #6 assigned IVG #x */
451#define P7_IVG(x) ((x)-7) << 0x1C /* Peripheral #7 assigned IVG #x */
452
453/* SIC_IAR1 Masks */
454
455#define P8_IVG(x) ((x)-7) /* Peripheral #8 assigned IVG #x */
456#define P9_IVG(x) ((x)-7) << 0x4 /* Peripheral #9 assigned IVG #x */
457#define P10_IVG(x) ((x)-7) << 0x8 /* Peripheral #10 assigned IVG #x */
458#define P11_IVG(x) ((x)-7) << 0xC /* Peripheral #11 assigned IVG #x */
459#define P12_IVG(x) ((x)-7) << 0x10 /* Peripheral #12 assigned IVG #x */
460#define P13_IVG(x) ((x)-7) << 0x14 /* Peripheral #13 assigned IVG #x */
461#define P14_IVG(x) ((x)-7) << 0x18 /* Peripheral #14 assigned IVG #x */
462#define P15_IVG(x) ((x)-7) << 0x1C /* Peripheral #15 assigned IVG #x */
463
464/* SIC_IAR2 Masks */
465#define P16_IVG(x) ((x)-7) /* Peripheral #16 assigned IVG #x */
466#define P17_IVG(x) ((x)-7) << 0x4 /* Peripheral #17 assigned IVG #x */
467#define P18_IVG(x) ((x)-7) << 0x8 /* Peripheral #18 assigned IVG #x */
468#define P19_IVG(x) ((x)-7) << 0xC /* Peripheral #19 assigned IVG #x */
469#define P20_IVG(x) ((x)-7) << 0x10 /* Peripheral #20 assigned IVG #x */
470#define P21_IVG(x) ((x)-7) << 0x14 /* Peripheral #21 assigned IVG #x */
471#define P22_IVG(x) ((x)-7) << 0x18 /* Peripheral #22 assigned IVG #x */
472#define P23_IVG(x) ((x)-7) << 0x1C /* Peripheral #23 assigned IVG #x */
473
474/* SIC_IMASK Masks */
475#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
476#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
477#define SIC_MASK(x) (1 << (x)) /* Mask Peripheral #x interrupt */
478#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << (x))) /* Unmask Peripheral #x interrupt */
479
480/* SIC_IWR Masks */
481#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
482#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
483#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */
484#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */
485
486/* ********* WATCHDOG TIMER MASKS ********************8 */
487
488/* Watchdog Timer WDOG_CTL Register */
489#define ICTL(x) ((x<<1) & 0x0006)
490#define ENABLE_RESET 0x00000000 /* Set Watchdog Timer to generate reset */
491#define ENABLE_NMI 0x00000002 /* Set Watchdog Timer to generate non-maskable interrupt */
492#define ENABLE_GPI 0x00000004 /* Set Watchdog Timer to generate general-purpose interrupt */
493#define DISABLE_EVT 0x00000006 /* Disable Watchdog Timer interrupts */
494
495#define TMR_EN 0x0000
496#define TMR_DIS 0x0AD0
497#define TRO 0x8000
498
499#define ICTL_P0 0x01
500#define ICTL_P1 0x02
501#define TRO_P 0x0F
502
503/* ***************************** UART CONTROLLER MASKS ********************** */
504
505/* UART_LCR Register */
506
507#define DLAB 0x80
508#define SB 0x40
509#define STP 0x20
510#define EPS 0x10
511#define PEN 0x08
512#define STB 0x04
513#define WLS(x) ((x-5) & 0x03)
514
515#define DLAB_P 0x07
516#define SB_P 0x06
517#define STP_P 0x05
518#define EPS_P 0x04
519#define PEN_P 0x03
520#define STB_P 0x02
521#define WLS_P1 0x01
522#define WLS_P0 0x00
523
524/* UART_MCR Register */
525#define LOOP_ENA 0x10
526#define LOOP_ENA_P 0x04
527
528/* UART_LSR Register */
529#define TEMT 0x40
530#define THRE 0x20
531#define BI 0x10
532#define FE 0x08
533#define PE 0x04
534#define OE 0x02
535#define DR 0x01
536
537#define TEMP_P 0x06
538#define THRE_P 0x05
539#define BI_P 0x04
540#define FE_P 0x03
541#define PE_P 0x02
542#define OE_P 0x01
543#define DR_P 0x00
544
545/* UART_IER Register */
546#define ELSI 0x04
547#define ETBEI 0x02
548#define ERBFI 0x01
549
550#define ELSI_P 0x02
551#define ETBEI_P 0x01
552#define ERBFI_P 0x00
553
554/* UART_IIR Register */
555#define STATUS(x) ((x << 1) & 0x06)
556#define NINT 0x01
557#define STATUS_P1 0x02
558#define STATUS_P0 0x01
559#define NINT_P 0x00
560#define IIR_TX_READY 0x02 /* UART_THR empty */
561#define IIR_RX_READY 0x04 /* Receive data ready */
562#define IIR_LINE_CHANGE 0x06 /* Receive line status */
563#define IIR_STATUS 0x06
564
565/* UART_GCTL Register */
566#define FFE 0x20
567#define FPE 0x10
568#define RPOLC 0x08
569#define TPOLC 0x04
570#define IREN 0x02
571#define UCEN 0x01
572
573#define FFE_P 0x05
574#define FPE_P 0x04
575#define RPOLC_P 0x03
576#define TPOLC_P 0x02
577#define IREN_P 0x01
578#define UCEN_P 0x00
579
580/* ********** SERIAL PORT MASKS ********************** */
581
582/* SPORTx_TCR1 Masks */
583#define TSPEN 0x0001 /* TX enable */
584#define ITCLK 0x0002 /* Internal TX Clock Select */
585#define TDTYPE 0x000C /* TX Data Formatting Select */
586#define TLSBIT 0x0010 /* TX Bit Order */
587#define ITFS 0x0200 /* Internal TX Frame Sync Select */
588#define TFSR 0x0400 /* TX Frame Sync Required Select */
589#define DITFS 0x0800 /* Data Independent TX Frame Sync Select */
590#define LTFS 0x1000 /* Low TX Frame Sync Select */
591#define LATFS 0x2000 /* Late TX Frame Sync Select */
592#define TCKFE 0x4000 /* TX Clock Falling Edge Select */
593
594/* SPORTx_TCR2 Masks */
595#define SLEN 0x001F /*TX Word Length */
596#define TXSE 0x0100 /*TX Secondary Enable */
597#define TSFSE 0x0200 /*TX Stereo Frame Sync Enable */
598#define TRFST 0x0400 /*TX Right-First Data Order */
599
600/* SPORTx_RCR1 Masks */
601#define RSPEN 0x0001 /* RX enable */
602#define IRCLK 0x0002 /* Internal RX Clock Select */
603#define RDTYPE 0x000C /* RX Data Formatting Select */
604#define RULAW 0x0008 /* u-Law enable */
605#define RALAW 0x000C /* A-Law enable */
606#define RLSBIT 0x0010 /* RX Bit Order */
607#define IRFS 0x0200 /* Internal RX Frame Sync Select */
608#define RFSR 0x0400 /* RX Frame Sync Required Select */
609#define LRFS 0x1000 /* Low RX Frame Sync Select */
610#define LARFS 0x2000 /* Late RX Frame Sync Select */
611#define RCKFE 0x4000 /* RX Clock Falling Edge Select */
612
613/* SPORTx_RCR2 Masks */
614#define SLEN 0x001F /*RX Word Length */
615#define RXSE 0x0100 /*RX Secondary Enable */
616#define RSFSE 0x0200 /*RX Stereo Frame Sync Enable */
617#define RRFST 0x0400 /*Right-First Data Order */
618
619/*SPORTx_STAT Masks */
620#define RXNE 0x0001 /*RX FIFO Not Empty Status */
621#define RUVF 0x0002 /*RX Underflow Status */
622#define ROVF 0x0004 /*RX Overflow Status */
623#define TXF 0x0008 /*TX FIFO Full Status */
624#define TUVF 0x0010 /*TX Underflow Status */
625#define TOVF 0x0020 /*TX Overflow Status */
626#define TXHRE 0x0040 /*TX Hold Register Empty */
627
628/*SPORTx_MCMC1 Masks */
629#define SP_WSIZE 0x0000F000 /*Multichannel Window Size Field */
630#define SP_WOFF 0x000003FF /*Multichannel Window Offset Field */
631
632/*SPORTx_MCMC2 Masks */
633#define MCCRM 0x00000003 /*Multichannel Clock Recovery Mode */
634#define MCDTXPE 0x00000004 /*Multichannel DMA Transmit Packing */
635#define MCDRXPE 0x00000008 /*Multichannel DMA Receive Packing */
636#define MCMEN 0x00000010 /*Multichannel Frame Mode Enable */
637#define FSDR 0x00000080 /*Multichannel Frame Sync to Data Relationship */
638#define MFD 0x0000F000 /*Multichannel Frame Delay */
639
640/* ********* PARALLEL PERIPHERAL INTERFACE (PPI) MASKS **************** */
641
642/* PPI_CONTROL Masks */
643#define PORT_EN 0x00000001 /* PPI Port Enable */
644#define PORT_DIR 0x00000002 /* PPI Port Direction */
645#define XFR_TYPE 0x0000000C /* PPI Transfer Type */
646#define PORT_CFG 0x00000030 /* PPI Port Configuration */
647#define FLD_SEL 0x00000040 /* PPI Active Field Select */
648#define PACK_EN 0x00000080 /* PPI Packing Mode */
649#define DMA32 0x00000100 /* PPI 32-bit DMA Enable */
650#define SKIP_EN 0x00000200 /* PPI Skip Element Enable */
651#define SKIP_EO 0x00000400 /* PPI Skip Even/Odd Elements */
652#define DLENGTH 0x00003800 /* PPI Data Length */
653#define DLEN_8 0x0000 /* Data Length = 8 Bits */
654#define DLEN_10 0x0800 /* Data Length = 10 Bits */
655#define DLEN_11 0x1000 /* Data Length = 11 Bits */
656#define DLEN_12 0x1800 /* Data Length = 12 Bits */
657#define DLEN_13 0x2000 /* Data Length = 13 Bits */
658#define DLEN_14 0x2800 /* Data Length = 14 Bits */
659#define DLEN_15 0x3000 /* Data Length = 15 Bits */
660#define DLEN_16 0x3800 /* Data Length = 16 Bits */
661#define DLEN(x) (((x-9) & 0x07) << 11) /* PPI Data Length (only works for x=10-->x=16) */
662#define POL 0x0000C000 /* PPI Signal Polarities */
663
664/* PPI_STATUS Masks */
665#define FLD 0x00000400 /* Field Indicator */
666#define FT_ERR 0x00000800 /* Frame Track Error */
667#define OVR 0x00001000 /* FIFO Overflow Error */
668#define UNDR 0x00002000 /* FIFO Underrun Error */
669#define ERR_DET 0x00004000 /* Error Detected Indicator */
670#define ERR_NCOR 0x00008000 /* Error Not Corrected Indicator */
671
672/* ********** DMA CONTROLLER MASKS *********************8 */
673
674/*DMAx_CONFIG, MDMA_yy_CONFIG Masks */
675#define DMAEN 0x00000001 /* Channel Enable */
676#define WNR 0x00000002 /* Channel Direction (W/R*) */
677#define WDSIZE_8 0x00000000 /* Word Size 8 bits */
678#define WDSIZE_16 0x00000004 /* Word Size 16 bits */
679#define WDSIZE_32 0x00000008 /* Word Size 32 bits */
680#define DMA2D 0x00000010 /* 2D/1D* Mode */
681#define RESTART 0x00000020 /* Restart */
682#define DI_SEL 0x00000040 /* Data Interrupt Select */
683#define DI_EN 0x00000080 /* Data Interrupt Enable */
684#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
685#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
686#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
687#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
688#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
689#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
690#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
691#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
692#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
693#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
694#define NDSIZE 0x00000900 /* Next Descriptor Size */
695#define DMAFLOW 0x00007000 /* Flow Control */
696#define DMAFLOW_STOP 0x0000 /* Stop Mode */
697#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
698#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
699#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
700#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
701
702#define DMAEN_P 0 /* Channel Enable */
703#define WNR_P 1 /* Channel Direction (W/R*) */
704#define DMA2D_P 4 /* 2D/1D* Mode */
705#define RESTART_P 5 /* Restart */
706#define DI_SEL_P 6 /* Data Interrupt Select */
707#define DI_EN_P 7 /* Data Interrupt Enable */
708
709/*DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS Masks */
710
711#define DMA_DONE 0x00000001 /* DMA Done Indicator */
712#define DMA_ERR 0x00000002 /* DMA Error Indicator */
713#define DFETCH 0x00000004 /* Descriptor Fetch Indicator */
714#define DMA_RUN 0x00000008 /* DMA Running Indicator */
715
716#define DMA_DONE_P 0 /* DMA Done Indicator */
717#define DMA_ERR_P 1 /* DMA Error Indicator */
718#define DFETCH_P 2 /* Descriptor Fetch Indicator */
719#define DMA_RUN_P 3 /* DMA Running Indicator */
720
721/*DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP Masks */
722
723#define CTYPE 0x00000040 /* DMA Channel Type Indicator */
724#define CTYPE_P 6 /* DMA Channel Type Indicator BIT POSITION */
725#define PCAP8 0x00000080 /* DMA 8-bit Operation Indicator */
726#define PCAP16 0x00000100 /* DMA 16-bit Operation Indicator */
727#define PCAP32 0x00000200 /* DMA 32-bit Operation Indicator */
728#define PCAPWR 0x00000400 /* DMA Write Operation Indicator */
729#define PCAPRD 0x00000800 /* DMA Read Operation Indicator */
730#define PMAP 0x00007000 /* DMA Peripheral Map Field */
731
732/* ************* GENERAL PURPOSE TIMER MASKS ******************** */
733
734/* PWM Timer bit definitions */
735
736/* TIMER_ENABLE Register */
737#define TIMEN0 0x0001
738#define TIMEN1 0x0002
739#define TIMEN2 0x0004
740
741#define TIMEN0_P 0x00
742#define TIMEN1_P 0x01
743#define TIMEN2_P 0x02
744
745/* TIMER_DISABLE Register */
746#define TIMDIS0 0x0001
747#define TIMDIS1 0x0002
748#define TIMDIS2 0x0004
749
750#define TIMDIS0_P 0x00
751#define TIMDIS1_P 0x01
752#define TIMDIS2_P 0x02
753
754/* TIMER_STATUS Register */
755#define TIMIL0 0x0001
756#define TIMIL1 0x0002
757#define TIMIL2 0x0004
758#define TOVL_ERR0 0x0010
759#define TOVL_ERR1 0x0020
760#define TOVL_ERR2 0x0040
761#define TRUN0 0x1000
762#define TRUN1 0x2000
763#define TRUN2 0x4000
764
765#define TIMIL0_P 0x00
766#define TIMIL1_P 0x01
767#define TIMIL2_P 0x02
768#define TOVL_ERR0_P 0x04
769#define TOVL_ERR1_P 0x05
770#define TOVL_ERR2_P 0x06
771#define TRUN0_P 0x0C
772#define TRUN1_P 0x0D
773#define TRUN2_P 0x0E
774
775/* TIMERx_CONFIG Registers */
776#define PWM_OUT 0x0001
777#define WDTH_CAP 0x0002
778#define EXT_CLK 0x0003
779#define PULSE_HI 0x0004
780#define PERIOD_CNT 0x0008
781#define IRQ_ENA 0x0010
782#define TIN_SEL 0x0020
783#define OUT_DIS 0x0040
784#define CLK_SEL 0x0080
785#define TOGGLE_HI 0x0100
786#define EMU_RUN 0x0200
787#define ERR_TYP(x) ((x & 0x03) << 14)
788
789#define TMODE_P0 0x00
790#define TMODE_P1 0x01
791#define PULSE_HI_P 0x02
792#define PERIOD_CNT_P 0x03
793#define IRQ_ENA_P 0x04
794#define TIN_SEL_P 0x05
795#define OUT_DIS_P 0x06
796#define CLK_SEL_P 0x07
797#define TOGGLE_HI_P 0x08
798#define EMU_RUN_P 0x09
799#define ERR_TYP_P0 0x0E
800#define ERR_TYP_P1 0x0F
801
802/*/ ****************** PROGRAMMABLE FLAG MASKS ********************* */
803
804/* General Purpose IO (0xFFC00700 - 0xFFC007FF) Masks */
805#define PF0 0x0001
806#define PF1 0x0002
807#define PF2 0x0004
808#define PF3 0x0008
809#define PF4 0x0010
810#define PF5 0x0020
811#define PF6 0x0040
812#define PF7 0x0080
813#define PF8 0x0100
814#define PF9 0x0200
815#define PF10 0x0400
816#define PF11 0x0800
817#define PF12 0x1000
818#define PF13 0x2000
819#define PF14 0x4000
820#define PF15 0x8000
821
822/* General Purpose IO (0xFFC00700 - 0xFFC007FF) BIT POSITIONS */
823#define PF0_P 0
824#define PF1_P 1
825#define PF2_P 2
826#define PF3_P 3
827#define PF4_P 4
828#define PF5_P 5
829#define PF6_P 6
830#define PF7_P 7
831#define PF8_P 8
832#define PF9_P 9
833#define PF10_P 10
834#define PF11_P 11
835#define PF12_P 12
836#define PF13_P 13
837#define PF14_P 14
838#define PF15_P 15
839
840/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS **************** */
841
842/* SPI_CTL Masks */
843#define TIMOD 0x00000003 /* Transfer initiation mode and interrupt generation */
844#define SZ 0x00000004 /* Send Zero (=0) or last (=1) word when TDBR empty. */
845#define GM 0x00000008 /* When RDBR full, get more (=1) data or discard (=0) incoming Data */
846#define PSSE 0x00000010 /* Enable (=1) Slave-Select input for Master. */
847#define EMISO 0x00000020 /* Enable (=1) MISO pin as an output. */
848#define SPI_LEN 0x00000100 /* Word length (0 => 8 bits, 1 => 16 bits) */
849#define LSBF 0x00000200 /* Data format (0 => MSB sent/received first 1 => LSB sent/received first) */
850#define CPHA 0x00000400 /* Clock phase (0 => SPICLK starts toggling in middle of xfer, 1 => SPICLK toggles at the beginning of xfer. */
851#define CPOL 0x00000800 /* Clock polarity (0 => active-high, 1 => active-low) */
852#define MSTR 0x00001000 /* Configures SPI as master (=1) or slave (=0) */
853#define WOM 0x00002000 /* Open drain (=1) data output enable (for MOSI and MISO) */
854#define SPE 0x00004000 /* SPI module enable (=1), disable (=0) */
855
856/* SPI_FLG Masks */
857#define FLS1 0x00000002 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
858#define FLS2 0x00000004 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
859#define FLS3 0x00000008 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
860#define FLS4 0x00000010 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
861#define FLS5 0x00000020 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
862#define FLS6 0x00000040 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
863#define FLS7 0x00000080 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
864#define FLG1 0x00000200 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
865#define FLG2 0x00000400 /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
866#define FLG3 0x00000800 /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
867#define FLG4 0x00001000 /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
868#define FLG5 0x00002000 /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
869#define FLG6 0x00004000 /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
870#define FLG7 0x00008000 /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
871
872/* SPI_FLG Bit Positions */
873#define FLS1_P 0x00000001 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
874#define FLS2_P 0x00000002 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
875#define FLS3_P 0x00000003 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
876#define FLS4_P 0x00000004 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
877#define FLS5_P 0x00000005 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
878#define FLS6_P 0x00000006 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
879#define FLS7_P 0x00000007 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
880#define FLG1_P 0x00000009 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
881#define FLG2_P 0x0000000A /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
882#define FLG3_P 0x0000000B /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
883#define FLG4_P 0x0000000C /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
884#define FLG5_P 0x0000000D /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
885#define FLG6_P 0x0000000E /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
886#define FLG7_P 0x0000000F /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
887
888/* SPI_STAT Masks */
889#define SPIF 0x00000001 /* Set (=1) when SPI single-word transfer complete */
890#define MODF 0x00000002 /* Set (=1) in a master device when some other device tries to become master */
891#define TXE 0x00000004 /* Set (=1) when transmission occurs with no new data in SPI_TDBR */
892#define TXS 0x00000008 /* SPI_TDBR Data Buffer Status (0=Empty, 1=Full) */
893#define RBSY 0x00000010 /* Set (=1) when data is received with RDBR full */
894#define RXS 0x00000020 /* SPI_RDBR Data Buffer Status (0=Empty, 1=Full) */
895#define TXCOL 0x00000040 /* When set (=1), corrupt data may have been transmitted */
896
897/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS ************* */
898
899/* AMGCTL Masks */
900#define AMCKEN 0x00000001 /* Enable CLKOUT */
901#define AMBEN_B0 0x00000002 /* Enable Asynchronous Memory Bank 0 only */
902#define AMBEN_B0_B1 0x00000004 /* Enable Asynchronous Memory Banks 0 & 1 only */
903#define AMBEN_B0_B1_B2 0x00000006 /* Enable Asynchronous Memory Banks 0, 1, and 2 */
904#define AMBEN_ALL 0x00000008 /* Enable Asynchronous Memory Banks (all) 0, 1, 2, and 3 */
905
906/* AMGCTL Bit Positions */
907#define AMCKEN_P 0x00000000 /* Enable CLKOUT */
908#define AMBEN_P0 0x00000001 /* Asynchronous Memory Enable, 000 - banks 0-3 disabled, 001 - Bank 0 enabled */
909#define AMBEN_P1 0x00000002 /* Asynchronous Memory Enable, 010 - banks 0&1 enabled, 011 - banks 0-3 enabled */
910#define AMBEN_P2 0x00000003 /* Asynchronous Memory Enable, 1xx - All banks (bank 0, 1, 2, and 3) enabled */
911
912/* AMBCTL0 Masks */
913#define B0RDYEN 0x00000001 /* Bank 0 RDY Enable, 0=disable, 1=enable */
914#define B0RDYPOL 0x00000002 /* Bank 0 RDY Active high, 0=active low, 1=active high */
915#define B0TT_1 0x00000004 /* Bank 0 Transition Time from Read to Write = 1 cycle */
916#define B0TT_2 0x00000008 /* Bank 0 Transition Time from Read to Write = 2 cycles */
917#define B0TT_3 0x0000000C /* Bank 0 Transition Time from Read to Write = 3 cycles */
918#define B0TT_4 0x00000000 /* Bank 0 Transition Time from Read to Write = 4 cycles */
919#define B0ST_1 0x00000010 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=1 cycle */
920#define B0ST_2 0x00000020 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=2 cycles */
921#define B0ST_3 0x00000030 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=3 cycles */
922#define B0ST_4 0x00000000 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=4 cycles */
923#define B0HT_1 0x00000040 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 1 cycle */
924#define B0HT_2 0x00000080 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 2 cycles */
925#define B0HT_3 0x000000C0 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 3 cycles */
926#define B0HT_0 0x00000000 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 0 cycles */
927#define B0RAT_1 0x00000100 /* Bank 0 Read Access Time = 1 cycle */
928#define B0RAT_2 0x00000200 /* Bank 0 Read Access Time = 2 cycles */
929#define B0RAT_3 0x00000300 /* Bank 0 Read Access Time = 3 cycles */
930#define B0RAT_4 0x00000400 /* Bank 0 Read Access Time = 4 cycles */
931#define B0RAT_5 0x00000500 /* Bank 0 Read Access Time = 5 cycles */
932#define B0RAT_6 0x00000600 /* Bank 0 Read Access Time = 6 cycles */
933#define B0RAT_7 0x00000700 /* Bank 0 Read Access Time = 7 cycles */
934#define B0RAT_8 0x00000800 /* Bank 0 Read Access Time = 8 cycles */
935#define B0RAT_9 0x00000900 /* Bank 0 Read Access Time = 9 cycles */
936#define B0RAT_10 0x00000A00 /* Bank 0 Read Access Time = 10 cycles */
937#define B0RAT_11 0x00000B00 /* Bank 0 Read Access Time = 11 cycles */
938#define B0RAT_12 0x00000C00 /* Bank 0 Read Access Time = 12 cycles */
939#define B0RAT_13 0x00000D00 /* Bank 0 Read Access Time = 13 cycles */
940#define B0RAT_14 0x00000E00 /* Bank 0 Read Access Time = 14 cycles */
941#define B0RAT_15 0x00000F00 /* Bank 0 Read Access Time = 15 cycles */
942#define B0WAT_1 0x00001000 /* Bank 0 Write Access Time = 1 cycle */
943#define B0WAT_2 0x00002000 /* Bank 0 Write Access Time = 2 cycles */
944#define B0WAT_3 0x00003000 /* Bank 0 Write Access Time = 3 cycles */
945#define B0WAT_4 0x00004000 /* Bank 0 Write Access Time = 4 cycles */
946#define B0WAT_5 0x00005000 /* Bank 0 Write Access Time = 5 cycles */
947#define B0WAT_6 0x00006000 /* Bank 0 Write Access Time = 6 cycles */
948#define B0WAT_7 0x00007000 /* Bank 0 Write Access Time = 7 cycles */
949#define B0WAT_8 0x00008000 /* Bank 0 Write Access Time = 8 cycles */
950#define B0WAT_9 0x00009000 /* Bank 0 Write Access Time = 9 cycles */
951#define B0WAT_10 0x0000A000 /* Bank 0 Write Access Time = 10 cycles */
952#define B0WAT_11 0x0000B000 /* Bank 0 Write Access Time = 11 cycles */
953#define B0WAT_12 0x0000C000 /* Bank 0 Write Access Time = 12 cycles */
954#define B0WAT_13 0x0000D000 /* Bank 0 Write Access Time = 13 cycles */
955#define B0WAT_14 0x0000E000 /* Bank 0 Write Access Time = 14 cycles */
956#define B0WAT_15 0x0000F000 /* Bank 0 Write Access Time = 15 cycles */
957#define B1RDYEN 0x00010000 /* Bank 1 RDY enable, 0=disable, 1=enable */
958#define B1RDYPOL 0x00020000 /* Bank 1 RDY Active high, 0=active low, 1=active high */
959#define B1TT_1 0x00040000 /* Bank 1 Transition Time from Read to Write = 1 cycle */
960#define B1TT_2 0x00080000 /* Bank 1 Transition Time from Read to Write = 2 cycles */
961#define B1TT_3 0x000C0000 /* Bank 1 Transition Time from Read to Write = 3 cycles */
962#define B1TT_4 0x00000000 /* Bank 1 Transition Time from Read to Write = 4 cycles */
963#define B1ST_1 0x00100000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
964#define B1ST_2 0x00200000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
965#define B1ST_3 0x00300000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
966#define B1ST_4 0x00000000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
967#define B1HT_1 0x00400000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
968#define B1HT_2 0x00800000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
969#define B1HT_3 0x00C00000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
970#define B1HT_0 0x00000000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
971#define B1RAT_1 0x01000000 /* Bank 1 Read Access Time = 1 cycle */
972#define B1RAT_2 0x02000000 /* Bank 1 Read Access Time = 2 cycles */
973#define B1RAT_3 0x03000000 /* Bank 1 Read Access Time = 3 cycles */
974#define B1RAT_4 0x04000000 /* Bank 1 Read Access Time = 4 cycles */
975#define B1RAT_5 0x05000000 /* Bank 1 Read Access Time = 5 cycles */
976#define B1RAT_6 0x06000000 /* Bank 1 Read Access Time = 6 cycles */
977#define B1RAT_7 0x07000000 /* Bank 1 Read Access Time = 7 cycles */
978#define B1RAT_8 0x08000000 /* Bank 1 Read Access Time = 8 cycles */
979#define B1RAT_9 0x09000000 /* Bank 1 Read Access Time = 9 cycles */
980#define B1RAT_10 0x0A000000 /* Bank 1 Read Access Time = 10 cycles */
981#define B1RAT_11 0x0B000000 /* Bank 1 Read Access Time = 11 cycles */
982#define B1RAT_12 0x0C000000 /* Bank 1 Read Access Time = 12 cycles */
983#define B1RAT_13 0x0D000000 /* Bank 1 Read Access Time = 13 cycles */
984#define B1RAT_14 0x0E000000 /* Bank 1 Read Access Time = 14 cycles */
985#define B1RAT_15 0x0F000000 /* Bank 1 Read Access Time = 15 cycles */
986#define B1WAT_1 0x10000000 /* Bank 1 Write Access Time = 1 cycle */
987#define B1WAT_2 0x20000000 /* Bank 1 Write Access Time = 2 cycles */
988#define B1WAT_3 0x30000000 /* Bank 1 Write Access Time = 3 cycles */
989#define B1WAT_4 0x40000000 /* Bank 1 Write Access Time = 4 cycles */
990#define B1WAT_5 0x50000000 /* Bank 1 Write Access Time = 5 cycles */
991#define B1WAT_6 0x60000000 /* Bank 1 Write Access Time = 6 cycles */
992#define B1WAT_7 0x70000000 /* Bank 1 Write Access Time = 7 cycles */
993#define B1WAT_8 0x80000000 /* Bank 1 Write Access Time = 8 cycles */
994#define B1WAT_9 0x90000000 /* Bank 1 Write Access Time = 9 cycles */
995#define B1WAT_10 0xA0000000 /* Bank 1 Write Access Time = 10 cycles */
996#define B1WAT_11 0xB0000000 /* Bank 1 Write Access Time = 11 cycles */
997#define B1WAT_12 0xC0000000 /* Bank 1 Write Access Time = 12 cycles */
998#define B1WAT_13 0xD0000000 /* Bank 1 Write Access Time = 13 cycles */
999#define B1WAT_14 0xE0000000 /* Bank 1 Write Access Time = 14 cycles */
1000#define B1WAT_15 0xF0000000 /* Bank 1 Write Access Time = 15 cycles */
1001
1002/* AMBCTL1 Masks */
1003#define B2RDYEN 0x00000001 /* Bank 2 RDY Enable, 0=disable, 1=enable */
1004#define B2RDYPOL 0x00000002 /* Bank 2 RDY Active high, 0=active low, 1=active high */
1005#define B2TT_1 0x00000004 /* Bank 2 Transition Time from Read to Write = 1 cycle */
1006#define B2TT_2 0x00000008 /* Bank 2 Transition Time from Read to Write = 2 cycles */
1007#define B2TT_3 0x0000000C /* Bank 2 Transition Time from Read to Write = 3 cycles */
1008#define B2TT_4 0x00000000 /* Bank 2 Transition Time from Read to Write = 4 cycles */
1009#define B2ST_1 0x00000010 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1010#define B2ST_2 0x00000020 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1011#define B2ST_3 0x00000030 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1012#define B2ST_4 0x00000000 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1013#define B2HT_1 0x00000040 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1014#define B2HT_2 0x00000080 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1015#define B2HT_3 0x000000C0 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1016#define B2HT_0 0x00000000 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1017#define B2RAT_1 0x00000100 /* Bank 2 Read Access Time = 1 cycle */
1018#define B2RAT_2 0x00000200 /* Bank 2 Read Access Time = 2 cycles */
1019#define B2RAT_3 0x00000300 /* Bank 2 Read Access Time = 3 cycles */
1020#define B2RAT_4 0x00000400 /* Bank 2 Read Access Time = 4 cycles */
1021#define B2RAT_5 0x00000500 /* Bank 2 Read Access Time = 5 cycles */
1022#define B2RAT_6 0x00000600 /* Bank 2 Read Access Time = 6 cycles */
1023#define B2RAT_7 0x00000700 /* Bank 2 Read Access Time = 7 cycles */
1024#define B2RAT_8 0x00000800 /* Bank 2 Read Access Time = 8 cycles */
1025#define B2RAT_9 0x00000900 /* Bank 2 Read Access Time = 9 cycles */
1026#define B2RAT_10 0x00000A00 /* Bank 2 Read Access Time = 10 cycles */
1027#define B2RAT_11 0x00000B00 /* Bank 2 Read Access Time = 11 cycles */
1028#define B2RAT_12 0x00000C00 /* Bank 2 Read Access Time = 12 cycles */
1029#define B2RAT_13 0x00000D00 /* Bank 2 Read Access Time = 13 cycles */
1030#define B2RAT_14 0x00000E00 /* Bank 2 Read Access Time = 14 cycles */
1031#define B2RAT_15 0x00000F00 /* Bank 2 Read Access Time = 15 cycles */
1032#define B2WAT_1 0x00001000 /* Bank 2 Write Access Time = 1 cycle */
1033#define B2WAT_2 0x00002000 /* Bank 2 Write Access Time = 2 cycles */
1034#define B2WAT_3 0x00003000 /* Bank 2 Write Access Time = 3 cycles */
1035#define B2WAT_4 0x00004000 /* Bank 2 Write Access Time = 4 cycles */
1036#define B2WAT_5 0x00005000 /* Bank 2 Write Access Time = 5 cycles */
1037#define B2WAT_6 0x00006000 /* Bank 2 Write Access Time = 6 cycles */
1038#define B2WAT_7 0x00007000 /* Bank 2 Write Access Time = 7 cycles */
1039#define B2WAT_8 0x00008000 /* Bank 2 Write Access Time = 8 cycles */
1040#define B2WAT_9 0x00009000 /* Bank 2 Write Access Time = 9 cycles */
1041#define B2WAT_10 0x0000A000 /* Bank 2 Write Access Time = 10 cycles */
1042#define B2WAT_11 0x0000B000 /* Bank 2 Write Access Time = 11 cycles */
1043#define B2WAT_12 0x0000C000 /* Bank 2 Write Access Time = 12 cycles */
1044#define B2WAT_13 0x0000D000 /* Bank 2 Write Access Time = 13 cycles */
1045#define B2WAT_14 0x0000E000 /* Bank 2 Write Access Time = 14 cycles */
1046#define B2WAT_15 0x0000F000 /* Bank 2 Write Access Time = 15 cycles */
1047#define B3RDYEN 0x00010000 /* Bank 3 RDY enable, 0=disable, 1=enable */
1048#define B3RDYPOL 0x00020000 /* Bank 3 RDY Active high, 0=active low, 1=active high */
1049#define B3TT_1 0x00040000 /* Bank 3 Transition Time from Read to Write = 1 cycle */
1050#define B3TT_2 0x00080000 /* Bank 3 Transition Time from Read to Write = 2 cycles */
1051#define B3TT_3 0x000C0000 /* Bank 3 Transition Time from Read to Write = 3 cycles */
1052#define B3TT_4 0x00000000 /* Bank 3 Transition Time from Read to Write = 4 cycles */
1053#define B3ST_1 0x00100000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1054#define B3ST_2 0x00200000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1055#define B3ST_3 0x00300000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1056#define B3ST_4 0x00000000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1057#define B3HT_1 0x00400000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1058#define B3HT_2 0x00800000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1059#define B3HT_3 0x00C00000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1060#define B3HT_0 0x00000000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1061#define B3RAT_1 0x01000000 /* Bank 3 Read Access Time = 1 cycle */
1062#define B3RAT_2 0x02000000 /* Bank 3 Read Access Time = 2 cycles */
1063#define B3RAT_3 0x03000000 /* Bank 3 Read Access Time = 3 cycles */
1064#define B3RAT_4 0x04000000 /* Bank 3 Read Access Time = 4 cycles */
1065#define B3RAT_5 0x05000000 /* Bank 3 Read Access Time = 5 cycles */
1066#define B3RAT_6 0x06000000 /* Bank 3 Read Access Time = 6 cycles */
1067#define B3RAT_7 0x07000000 /* Bank 3 Read Access Time = 7 cycles */
1068#define B3RAT_8 0x08000000 /* Bank 3 Read Access Time = 8 cycles */
1069#define B3RAT_9 0x09000000 /* Bank 3 Read Access Time = 9 cycles */
1070#define B3RAT_10 0x0A000000 /* Bank 3 Read Access Time = 10 cycles */
1071#define B3RAT_11 0x0B000000 /* Bank 3 Read Access Time = 11 cycles */
1072#define B3RAT_12 0x0C000000 /* Bank 3 Read Access Time = 12 cycles */
1073#define B3RAT_13 0x0D000000 /* Bank 3 Read Access Time = 13 cycles */
1074#define B3RAT_14 0x0E000000 /* Bank 3 Read Access Time = 14 cycles */
1075#define B3RAT_15 0x0F000000 /* Bank 3 Read Access Time = 15 cycles */
1076#define B3WAT_1 0x10000000 /* Bank 3 Write Access Time = 1 cycle */
1077#define B3WAT_2 0x20000000 /* Bank 3 Write Access Time = 2 cycles */
1078#define B3WAT_3 0x30000000 /* Bank 3 Write Access Time = 3 cycles */
1079#define B3WAT_4 0x40000000 /* Bank 3 Write Access Time = 4 cycles */
1080#define B3WAT_5 0x50000000 /* Bank 3 Write Access Time = 5 cycles */
1081#define B3WAT_6 0x60000000 /* Bank 3 Write Access Time = 6 cycles */
1082#define B3WAT_7 0x70000000 /* Bank 3 Write Access Time = 7 cycles */
1083#define B3WAT_8 0x80000000 /* Bank 3 Write Access Time = 8 cycles */
1084#define B3WAT_9 0x90000000 /* Bank 3 Write Access Time = 9 cycles */
1085#define B3WAT_10 0xA0000000 /* Bank 3 Write Access Time = 10 cycles */
1086#define B3WAT_11 0xB0000000 /* Bank 3 Write Access Time = 11 cycles */
1087#define B3WAT_12 0xC0000000 /* Bank 3 Write Access Time = 12 cycles */
1088#define B3WAT_13 0xD0000000 /* Bank 3 Write Access Time = 13 cycles */
1089#define B3WAT_14 0xE0000000 /* Bank 3 Write Access Time = 14 cycles */
1090#define B3WAT_15 0xF0000000 /* Bank 3 Write Access Time = 15 cycles */
1091
1092/* ********************** SDRAM CONTROLLER MASKS *************************** */
1093
1094/* SDGCTL Masks */
1095#define SCTLE 0x00000001 /* Enable SCLK[0], /SRAS, /SCAS, /SWE, SDQM[3:0] */
1096#define CL_2 0x00000008 /* SDRAM CAS latency = 2 cycles */
1097#define CL_3 0x0000000C /* SDRAM CAS latency = 3 cycles */
1098#define PFE 0x00000010 /* Enable SDRAM prefetch */
1099#define PFP 0x00000020 /* Prefetch has priority over AMC requests */
1100#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1101#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1102#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
1103#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
1104#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
1105#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
1106#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
1107#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
1108#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
1109#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
1110#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
1111#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
1112#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
1113#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
1114#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
1115#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
1116#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
1117#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
1118#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
1119#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
1120#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
1121#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
1122#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
1123#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
1124#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
1125#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
1126#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
1127#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
1128#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
1129#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
1130#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
1131#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
1132#define PUPSD 0x00200000 /*Power-up start delay */
1133#define PSM 0x00400000 /* SDRAM power-up sequence = Precharge, mode register set, 8 CBR refresh cycles */
1134#define PSS 0x00800000 /* enable SDRAM power-up sequence on next SDRAM access */
1135#define SRFS 0x01000000 /* Start SDRAM self-refresh mode */
1136#define EBUFE 0x02000000 /* Enable external buffering timing */
1137#define FBBRW 0x04000000 /* Fast back-to-back read write enable */
1138#define EMREN 0x10000000 /* Extended mode register enable */
1139#define TCSR 0x20000000 /* Temp compensated self refresh value 85 deg C */
1140#define CDDBG 0x40000000 /* Tristate SDRAM controls during bus grant */
1141
1142/* EBIU_SDBCTL Masks */
1143#define EBE 0x00000001 /* Enable SDRAM external bank */
1144#define EBSZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1145#define EBSZ_32 0x00000002 /* SDRAM external bank size = 32MB */
1146#define EBSZ_64 0x00000004 /* SDRAM external bank size = 64MB */
1147#define EBSZ_128 0x00000006 /* SDRAM external bank size = 128MB */
1148#define EBCAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1149#define EBCAW_9 0x00000010 /* SDRAM external bank column address width = 9 bits */
1150#define EBCAW_10 0x00000020 /* SDRAM external bank column address width = 9 bits */
1151#define EBCAW_11 0x00000030 /* SDRAM external bank column address width = 9 bits */
1152
1153/* EBIU_SDSTAT Masks */
1154#define SDCI 0x00000001 /* SDRAM controller is idle */
1155#define SDSRA 0x00000002 /* SDRAM SDRAM self refresh is active */
1156#define SDPUA 0x00000004 /* SDRAM power up active */
1157#define SDRS 0x00000008 /* SDRAM is in reset state */
1158#define SDEASE 0x00000010 /* SDRAM EAB sticky error status - W1C */
1159#define BGSTAT 0x00000020 /* Bus granted */
1160
1161/*VR_CTL Masks*/
1162#define WAKE 0x100
1163#define VLEV_6 0x60
1164#define VLEV_7 0x70
1165#define VLEV_8 0x80
1166#define VLEV_9 0x90
1167#define VLEV_10 0xA0
1168#define VLEV_11 0xB0
1169#define VLEV_12 0xC0
1170#define VLEV_13 0xD0
1171#define VLEV_14 0xE0
1172#define VLEV_15 0xF0
1173#define FREQ_3 0x03
1174
1175#endif /* _DEF_BF532_H */
diff --git a/include/asm-blackfin/mach-bf533/dma.h b/include/asm-blackfin/mach-bf533/dma.h
new file mode 100644
index 000000000000..bd9d5e94307d
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/dma.h
@@ -0,0 +1,54 @@
1/*****************************************************************************
2*
3* BF-533/2/1 Specific Declarations
4*
5****************************************************************************/
6/*
7 * File: include/asm-blackfin/mach-bf533/dma.h
8 * Based on:
9 * Author:
10 *
11 * Created:
12 * Description:
13 *
14 * Rev:
15 *
16 * Modified:
17 *
18 * Bugs: Enter bugs at http://blackfin.uclinux.org/
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2, or (at your option)
23 * any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * You should have received a copy of the GNU General Public License
31 * along with this program; see the file COPYING.
32 * If not, write to the Free Software Foundation,
33 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 */
35
36#ifndef _MACH_DMA_H_
37#define _MACH_DMA_H_
38
39#define MAX_BLACKFIN_DMA_CHANNEL 12
40
41#define CH_PPI 0
42#define CH_SPORT0_RX 1
43#define CH_SPORT0_TX 2
44#define CH_SPORT1_RX 3
45#define CH_SPORT1_TX 4
46#define CH_SPI 5
47#define CH_UART_RX 6
48#define CH_UART_TX 7
49#define CH_MEM_STREAM0_DEST 8 /* TX */
50#define CH_MEM_STREAM0_SRC 9 /* RX */
51#define CH_MEM_STREAM1_DEST 10 /* TX */
52#define CH_MEM_STREAM1_SRC 11 /* RX */
53
54#endif
diff --git a/include/asm-blackfin/mach-bf533/irq.h b/include/asm-blackfin/mach-bf533/irq.h
new file mode 100644
index 000000000000..9879e68e315c
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/irq.h
@@ -0,0 +1,177 @@
1/*
2 * File: include/asm-blackfin/mach-bf533/defBF532.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _BF533_IRQ_H_
32#define _BF533_IRQ_H_
33
34/*
35 * Interrupt source definitions
36 Event Source Core Event Name
37Core Emulation **
38 Events (highest priority) EMU 0
39 Reset RST 1
40 NMI NMI 2
41 Exception EVX 3
42 Reserved -- 4
43 Hardware Error IVHW 5
44 Core Timer IVTMR 6 *
45 PLL Wakeup Interrupt IVG7 7
46 DMA Error (generic) IVG7 8
47 PPI Error Interrupt IVG7 9
48 SPORT0 Error Interrupt IVG7 10
49 SPORT1 Error Interrupt IVG7 11
50 SPI Error Interrupt IVG7 12
51 UART Error Interrupt IVG7 13
52 RTC Interrupt IVG8 14
53 DMA0 Interrupt (PPI) IVG8 15
54 DMA1 (SPORT0 RX) IVG9 16
55 DMA2 (SPORT0 TX) IVG9 17
56 DMA3 (SPORT1 RX) IVG9 18
57 DMA4 (SPORT1 TX) IVG9 19
58 DMA5 (PPI) IVG10 20
59 DMA6 (UART RX) IVG10 21
60 DMA7 (UART TX) IVG10 22
61 Timer0 IVG11 23
62 Timer1 IVG11 24
63 Timer2 IVG11 25
64 PF Interrupt A IVG12 26
65 PF Interrupt B IVG12 27
66 DMA8/9 Interrupt IVG13 28
67 DMA10/11 Interrupt IVG13 29
68 Watchdog Timer IVG13 30
69 Software Interrupt 1 IVG14 31
70 Software Interrupt 2 --
71 (lowest priority) IVG15 32 *
72 */
73#define SYS_IRQS 32
74#define NR_PERI_INTS 24
75
76/* The ABSTRACT IRQ definitions */
77/** the first seven of the following are fixed, the rest you change if you need to **/
78#define IRQ_EMU 0 /*Emulation */
79#define IRQ_RST 1 /*reset */
80#define IRQ_NMI 2 /*Non Maskable */
81#define IRQ_EVX 3 /*Exception */
82#define IRQ_UNUSED 4 /*- unused interrupt*/
83#define IRQ_HWERR 5 /*Hardware Error */
84#define IRQ_CORETMR 6 /*Core timer */
85
86#define IRQ_PLL_WAKEUP 7 /*PLL Wakeup Interrupt */
87#define IRQ_DMA_ERROR 8 /*DMA Error (general) */
88#define IRQ_PPI_ERROR 9 /*PPI Error Interrupt */
89#define IRQ_SPORT0_ERROR 10 /*SPORT0 Error Interrupt */
90#define IRQ_SPORT1_ERROR 11 /*SPORT1 Error Interrupt */
91#define IRQ_SPI_ERROR 12 /*SPI Error Interrupt */
92#define IRQ_UART_ERROR 13 /*UART Error Interrupt */
93#define IRQ_RTC 14 /*RTC Interrupt */
94#define IRQ_PPI 15 /*DMA0 Interrupt (PPI) */
95#define IRQ_SPORT0_RX 16 /*DMA1 Interrupt (SPORT0 RX) */
96#define IRQ_SPORT0_TX 17 /*DMA2 Interrupt (SPORT0 TX) */
97#define IRQ_SPORT1_RX 18 /*DMA3 Interrupt (SPORT1 RX) */
98#define IRQ_SPORT1_TX 19 /*DMA4 Interrupt (SPORT1 TX) */
99#define IRQ_SPI 20 /*DMA5 Interrupt (SPI) */
100#define IRQ_UART_RX 21 /*DMA6 Interrupt (UART RX) */
101#define IRQ_UART_TX 22 /*DMA7 Interrupt (UART TX) */
102#define IRQ_TMR0 23 /*Timer 0 */
103#define IRQ_TMR1 24 /*Timer 1 */
104#define IRQ_TMR2 25 /*Timer 2 */
105#define IRQ_PROG_INTA 26 /*Programmable Flags A (8) */
106#define IRQ_PROG_INTB 27 /*Programmable Flags B (8) */
107#define IRQ_MEM_DMA0 28 /*DMA8/9 Interrupt (Memory DMA Stream 0) */
108#define IRQ_MEM_DMA1 29 /*DMA10/11 Interrupt (Memory DMA Stream 1) */
109#define IRQ_WATCH 30 /*Watch Dog Timer */
110
111#define IRQ_SW_INT1 31 /*Software Int 1 */
112#define IRQ_SW_INT2 32 /*Software Int 2 (reserved for SYSCALL) */
113
114#define IRQ_PF0 33
115#define IRQ_PF1 34
116#define IRQ_PF2 35
117#define IRQ_PF3 36
118#define IRQ_PF4 37
119#define IRQ_PF5 38
120#define IRQ_PF6 39
121#define IRQ_PF7 40
122#define IRQ_PF8 41
123#define IRQ_PF9 42
124#define IRQ_PF10 43
125#define IRQ_PF11 44
126#define IRQ_PF12 45
127#define IRQ_PF13 46
128#define IRQ_PF14 47
129#define IRQ_PF15 48
130
131#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
132#define NR_IRQS (IRQ_PF15+1)
133#else
134#define NR_IRQS SYS_IRQS
135#endif
136
137#define IVG7 7
138#define IVG8 8
139#define IVG9 9
140#define IVG10 10
141#define IVG11 11
142#define IVG12 12
143#define IVG13 13
144#define IVG14 14
145#define IVG15 15
146
147/* IAR0 BIT FIELDS*/
148#define RTC_ERROR_POS 28
149#define UART_ERROR_POS 24
150#define SPORT1_ERROR_POS 20
151#define SPI_ERROR_POS 16
152#define SPORT0_ERROR_POS 12
153#define PPI_ERROR_POS 8
154#define DMA_ERROR_POS 4
155#define PLLWAKE_ERROR_POS 0
156
157/* IAR1 BIT FIELDS*/
158#define DMA7_UARTTX_POS 28
159#define DMA6_UARTRX_POS 24
160#define DMA5_SPI_POS 20
161#define DMA4_SPORT1TX_POS 16
162#define DMA3_SPORT1RX_POS 12
163#define DMA2_SPORT0TX_POS 8
164#define DMA1_SPORT0RX_POS 4
165#define DMA0_PPI_POS 0
166
167/* IAR2 BIT FIELDS*/
168#define WDTIMER_POS 28
169#define MEMDMA1_POS 24
170#define MEMDMA0_POS 20
171#define PFB_POS 16
172#define PFA_POS 12
173#define TIMER2_POS 8
174#define TIMER1_POS 4
175#define TIMER0_POS 0
176
177#endif /* _BF533_IRQ_H_ */
diff --git a/include/asm-blackfin/mach-bf533/mem_init.h b/include/asm-blackfin/mach-bf533/mem_init.h
new file mode 100644
index 000000000000..1620dae5254d
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/mem_init.h
@@ -0,0 +1,316 @@
1/*
2 * File: include/asm-blackfin/mach-bf533/mem_init.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 * Copyright 2004-2006 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || CONFIG_MEM_GENERIC_BOARD)
33#if (CONFIG_SCLK_HZ > 119402985)
34#define SDRAM_tRP TRP_2
35#define SDRAM_tRP_num 2
36#define SDRAM_tRAS TRAS_7
37#define SDRAM_tRAS_num 7
38#define SDRAM_tRCD TRCD_2
39#define SDRAM_tWR TWR_2
40#endif
41#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
42#define SDRAM_tRP TRP_2
43#define SDRAM_tRP_num 2
44#define SDRAM_tRAS TRAS_6
45#define SDRAM_tRAS_num 6
46#define SDRAM_tRCD TRCD_2
47#define SDRAM_tWR TWR_2
48#endif
49#if (CONFIG_SCLK_HZ > 8955223) && (CONFIG_SCLK_HZ <= 104477612)
50#define SDRAM_tRP TRP_2
51#define SDRAM_tRP_num 2
52#define SDRAM_tRAS TRAS_5
53#define SDRAM_tRAS_num 5
54#define SDRAM_tRCD TRCD_2
55#define SDRAM_tWR TWR_2
56#endif
57#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
58#define SDRAM_tRP TRP_2
59#define SDRAM_tRP_num 2
60#define SDRAM_tRAS TRAS_4
61#define SDRAM_tRAS_num 4
62#define SDRAM_tRCD TRCD_2
63#define SDRAM_tWR TWR_2
64#endif
65#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
66#define SDRAM_tRP TRP_2
67#define SDRAM_tRP_num 2
68#define SDRAM_tRAS TRAS_3
69#define SDRAM_tRAS_num 3
70#define SDRAM_tRCD TRCD_2
71#define SDRAM_tWR TWR_2
72#endif
73#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
74#define SDRAM_tRP TRP_1
75#define SDRAM_tRP_num 1
76#define SDRAM_tRAS TRAS_4
77#define SDRAM_tRAS_num 3
78#define SDRAM_tRCD TRCD_1
79#define SDRAM_tWR TWR_2
80#endif
81#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
82#define SDRAM_tRP TRP_1
83#define SDRAM_tRP_num 1
84#define SDRAM_tRAS TRAS_3
85#define SDRAM_tRAS_num 3
86#define SDRAM_tRCD TRCD_1
87#define SDRAM_tWR TWR_2
88#endif
89#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
90#define SDRAM_tRP TRP_1
91#define SDRAM_tRP_num 1
92#define SDRAM_tRAS TRAS_2
93#define SDRAM_tRAS_num 2
94#define SDRAM_tRCD TRCD_1
95#define SDRAM_tWR TWR_2
96#endif
97#if (CONFIG_SCLK_HZ <= 29850746)
98#define SDRAM_tRP TRP_1
99#define SDRAM_tRP_num 1
100#define SDRAM_tRAS TRAS_1
101#define SDRAM_tRAS_num 1
102#define SDRAM_tRCD TRCD_1
103#define SDRAM_tWR TWR_2
104#endif
105#endif
106
107#if (CONFIG_MEM_MT48LC16M16A2TG_75)
108 /*SDRAM INFORMATION: */
109#define SDRAM_Tref 64 /* Refresh period in milliseconds */
110#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
111#define SDRAM_CL CL_3
112#endif
113
114#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
115 /*SDRAM INFORMATION: */
116#define SDRAM_Tref 64 /* Refresh period in milliseconds */
117#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
118#define SDRAM_CL CL_3
119#endif
120
121#if (CONFIG_MEM_GENERIC_BOARD)
122 /*SDRAM INFORMATION: Modify this for your board */
123#define SDRAM_Tref 64 /* Refresh period in milliseconds */
124#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
125#define SDRAM_CL CL_3
126#endif
127
128#if (CONFIG_MEM_SIZE == 128)
129#define SDRAM_SIZE EBSZ_128
130#endif
131#if (CONFIG_MEM_SIZE == 64)
132#define SDRAM_SIZE EBSZ_64
133#endif
134#if (CONFIG_MEM_SIZE == 32)
135#define SDRAM_SIZE EBSZ_32
136#endif
137#if (CONFIG_MEM_SIZE == 16)
138#define SDRAM_SIZE EBSZ_16
139#endif
140#if (CONFIG_MEM_ADD_WIDTH == 11)
141#define SDRAM_WIDTH EBCAW_11
142#endif
143#if (CONFIG_MEM_ADD_WIDTH == 10)
144#define SDRAM_WIDTH EBCAW_10
145#endif
146#if (CONFIG_MEM_ADD_WIDTH == 9)
147#define SDRAM_WIDTH EBCAW_9
148#endif
149#if (CONFIG_MEM_ADD_WIDTH == 8)
150#define SDRAM_WIDTH EBCAW_8
151#endif
152
153#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE)
154
155/* Equation from section 17 (p17-46) of BF533 HRM */
156#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
157
158/* Enable SCLK Out */
159#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
160
161#if defined CONFIG_CLKIN_HALF
162#define CLKIN_HALF 1
163#else
164#define CLKIN_HALF 0
165#endif
166
167#if defined CONFIG_PLL_BYPASS
168#define PLL_BYPASS 1
169#else
170#define PLL_BYPASS 0
171#endif
172
173/***************************************Currently Not Being Used *********************************/
174#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
175#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
176#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
177#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
178#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
179
180#if (flash_EBIU_AMBCTL_TT > 3)
181#define flash_EBIU_AMBCTL0_TT B0TT_4
182#endif
183#if (flash_EBIU_AMBCTL_TT == 3)
184#define flash_EBIU_AMBCTL0_TT B0TT_3
185#endif
186#if (flash_EBIU_AMBCTL_TT == 2)
187#define flash_EBIU_AMBCTL0_TT B0TT_2
188#endif
189#if (flash_EBIU_AMBCTL_TT < 2)
190#define flash_EBIU_AMBCTL0_TT B0TT_1
191#endif
192
193#if (flash_EBIU_AMBCTL_ST > 3)
194#define flash_EBIU_AMBCTL0_ST B0ST_4
195#endif
196#if (flash_EBIU_AMBCTL_ST == 3)
197#define flash_EBIU_AMBCTL0_ST B0ST_3
198#endif
199#if (flash_EBIU_AMBCTL_ST == 2)
200#define flash_EBIU_AMBCTL0_ST B0ST_2
201#endif
202#if (flash_EBIU_AMBCTL_ST < 2)
203#define flash_EBIU_AMBCTL0_ST B0ST_1
204#endif
205
206#if (flash_EBIU_AMBCTL_HT > 2)
207#define flash_EBIU_AMBCTL0_HT B0HT_3
208#endif
209#if (flash_EBIU_AMBCTL_HT == 2)
210#define flash_EBIU_AMBCTL0_HT B0HT_2
211#endif
212#if (flash_EBIU_AMBCTL_HT == 1)
213#define flash_EBIU_AMBCTL0_HT B0HT_1
214#endif
215#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
216#define flash_EBIU_AMBCTL0_HT B0HT_0
217#endif
218#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
219#define flash_EBIU_AMBCTL0_HT B0HT_1
220#endif
221
222#if (flash_EBIU_AMBCTL_WAT > 14)
223#define flash_EBIU_AMBCTL0_WAT B0WAT_15
224#endif
225#if (flash_EBIU_AMBCTL_WAT == 14)
226#define flash_EBIU_AMBCTL0_WAT B0WAT_14
227#endif
228#if (flash_EBIU_AMBCTL_WAT == 13)
229#define flash_EBIU_AMBCTL0_WAT B0WAT_13
230#endif
231#if (flash_EBIU_AMBCTL_WAT == 12)
232#define flash_EBIU_AMBCTL0_WAT B0WAT_12
233#endif
234#if (flash_EBIU_AMBCTL_WAT == 11)
235#define flash_EBIU_AMBCTL0_WAT B0WAT_11
236#endif
237#if (flash_EBIU_AMBCTL_WAT == 10)
238#define flash_EBIU_AMBCTL0_WAT B0WAT_10
239#endif
240#if (flash_EBIU_AMBCTL_WAT == 9)
241#define flash_EBIU_AMBCTL0_WAT B0WAT_9
242#endif
243#if (flash_EBIU_AMBCTL_WAT == 8)
244#define flash_EBIU_AMBCTL0_WAT B0WAT_8
245#endif
246#if (flash_EBIU_AMBCTL_WAT == 7)
247#define flash_EBIU_AMBCTL0_WAT B0WAT_7
248#endif
249#if (flash_EBIU_AMBCTL_WAT == 6)
250#define flash_EBIU_AMBCTL0_WAT B0WAT_6
251#endif
252#if (flash_EBIU_AMBCTL_WAT == 5)
253#define flash_EBIU_AMBCTL0_WAT B0WAT_5
254#endif
255#if (flash_EBIU_AMBCTL_WAT == 4)
256#define flash_EBIU_AMBCTL0_WAT B0WAT_4
257#endif
258#if (flash_EBIU_AMBCTL_WAT == 3)
259#define flash_EBIU_AMBCTL0_WAT B0WAT_3
260#endif
261#if (flash_EBIU_AMBCTL_WAT == 2)
262#define flash_EBIU_AMBCTL0_WAT B0WAT_2
263#endif
264#if (flash_EBIU_AMBCTL_WAT == 1)
265#define flash_EBIU_AMBCTL0_WAT B0WAT_1
266#endif
267
268#if (flash_EBIU_AMBCTL_RAT > 14)
269#define flash_EBIU_AMBCTL0_RAT B0RAT_15
270#endif
271#if (flash_EBIU_AMBCTL_RAT == 14)
272#define flash_EBIU_AMBCTL0_RAT B0RAT_14
273#endif
274#if (flash_EBIU_AMBCTL_RAT == 13)
275#define flash_EBIU_AMBCTL0_RAT B0RAT_13
276#endif
277#if (flash_EBIU_AMBCTL_RAT == 12)
278#define flash_EBIU_AMBCTL0_RAT B0RAT_12
279#endif
280#if (flash_EBIU_AMBCTL_RAT == 11)
281#define flash_EBIU_AMBCTL0_RAT B0RAT_11
282#endif
283#if (flash_EBIU_AMBCTL_RAT == 10)
284#define flash_EBIU_AMBCTL0_RAT B0RAT_10
285#endif
286#if (flash_EBIU_AMBCTL_RAT == 9)
287#define flash_EBIU_AMBCTL0_RAT B0RAT_9
288#endif
289#if (flash_EBIU_AMBCTL_RAT == 8)
290#define flash_EBIU_AMBCTL0_RAT B0RAT_8
291#endif
292#if (flash_EBIU_AMBCTL_RAT == 7)
293#define flash_EBIU_AMBCTL0_RAT B0RAT_7
294#endif
295#if (flash_EBIU_AMBCTL_RAT == 6)
296#define flash_EBIU_AMBCTL0_RAT B0RAT_6
297#endif
298#if (flash_EBIU_AMBCTL_RAT == 5)
299#define flash_EBIU_AMBCTL0_RAT B0RAT_5
300#endif
301#if (flash_EBIU_AMBCTL_RAT == 4)
302#define flash_EBIU_AMBCTL0_RAT B0RAT_4
303#endif
304#if (flash_EBIU_AMBCTL_RAT == 3)
305#define flash_EBIU_AMBCTL0_RAT B0RAT_3
306#endif
307#if (flash_EBIU_AMBCTL_RAT == 2)
308#define flash_EBIU_AMBCTL0_RAT B0RAT_2
309#endif
310#if (flash_EBIU_AMBCTL_RAT == 1)
311#define flash_EBIU_AMBCTL0_RAT B0RAT_1
312#endif
313
314#define flash_EBIU_AMBCTL0 \
315 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
316 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/include/asm-blackfin/mach-bf533/mem_map.h b/include/asm-blackfin/mach-bf533/mem_map.h
new file mode 100644
index 000000000000..e84baa3e939d
--- /dev/null
+++ b/include/asm-blackfin/mach-bf533/mem_map.h
@@ -0,0 +1,168 @@
1
2/*
3 * File: include/asm-blackfin/mach-bf533/mem_map.h
4 * Based on:
5 * Author:
6 *
7 * Created:
8 * Description:
9 *
10 * Rev:
11 *
12 * Modified:
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _MEM_MAP_533_H_
33#define _MEM_MAP_533_H_
34
35#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
36#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
37
38/* Async Memory Banks */
39#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
40#define ASYNC_BANK3_SIZE 0x00100000 /* 1M */
41#define ASYNC_BANK2_BASE 0x20200000 /* Async Bank 2 */
42#define ASYNC_BANK2_SIZE 0x00100000 /* 1M */
43#define ASYNC_BANK1_BASE 0x20100000 /* Async Bank 1 */
44#define ASYNC_BANK1_SIZE 0x00100000 /* 1M */
45#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
46#define ASYNC_BANK0_SIZE 0x00100000 /* 1M */
47
48/* Boot ROM Memory */
49
50#define BOOT_ROM_START 0xEF000000
51
52/* Level 1 Memory */
53
54#ifdef CONFIG_BLKFIN_CACHE
55#define BLKFIN_ICACHESIZE (16*1024)
56#else
57#define BLKFIN_ICACHESIZE (0*1024)
58#endif
59
60/* Memory Map for ADSP-BF533 processors */
61
62#ifdef CONFIG_BF533
63#define L1_CODE_START 0xFFA00000
64#define L1_DATA_A_START 0xFF800000
65#define L1_DATA_B_START 0xFF900000
66
67#ifdef CONFIG_BLKFIN_CACHE
68#define L1_CODE_LENGTH (0x14000 - 0x4000)
69#else
70#define L1_CODE_LENGTH 0x14000
71#endif
72
73#ifdef CONFIG_BLKFIN_DCACHE
74
75#ifdef CONFIG_BLKFIN_DCACHE_BANKA
76#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
77#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
78#define L1_DATA_B_LENGTH 0x8000
79#define BLKFIN_DCACHESIZE (16*1024)
80#define BLKFIN_DSUPBANKS 1
81#else
82#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
83#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
84#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
85#define BLKFIN_DCACHESIZE (32*1024)
86#define BLKFIN_DSUPBANKS 2
87#endif
88
89#else
90#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
91#define L1_DATA_A_LENGTH 0x8000
92#define L1_DATA_B_LENGTH 0x8000
93#define BLKFIN_DCACHESIZE (0*1024)
94#define BLKFIN_DSUPBANKS 0
95#endif /*CONFIG_BLKFIN_DCACHE*/
96#endif
97
98/* Memory Map for ADSP-BF532 processors */
99
100#ifdef CONFIG_BF532
101#define L1_CODE_START 0xFFA08000
102#define L1_DATA_A_START 0xFF804000
103#define L1_DATA_B_START 0xFF904000
104
105#ifdef CONFIG_BLKFIN_CACHE
106#define L1_CODE_LENGTH (0xC000 - 0x4000)
107#else
108#define L1_CODE_LENGTH 0xC000
109#endif
110
111#ifdef CONFIG_BLKFIN_DCACHE
112
113#ifdef CONFIG_BLKFIN_DCACHE_BANKA
114#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
115#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
116#define L1_DATA_B_LENGTH 0x4000
117#define BLKFIN_DCACHESIZE (16*1024)
118#define BLKFIN_DSUPBANKS 1
119
120#else
121#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
122#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
123#define L1_DATA_B_LENGTH (0x4000 - 0x4000)
124#define BLKFIN_DCACHESIZE (32*1024)
125#define BLKFIN_DSUPBANKS 2
126#endif
127
128#else
129#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
130#define L1_DATA_A_LENGTH 0x4000
131#define L1_DATA_B_LENGTH 0x4000
132#define BLKFIN_DCACHESIZE (0*1024)
133#define BLKFIN_DSUPBANKS 0
134#endif /*CONFIG_BLKFIN_DCACHE*/
135#endif
136
137/* Memory Map for ADSP-BF531 processors */
138
139#ifdef CONFIG_BF531
140#define L1_CODE_START 0xFFA08000
141#define L1_DATA_A_START 0xFF804000
142#define L1_DATA_B_START 0xFF904000
143#define L1_CODE_LENGTH 0x4000
144#define L1_DATA_B_LENGTH 0x0000
145
146
147#ifdef CONFIG_BLKFIN_DCACHE
148#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
149#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
150#define BLKFIN_DCACHESIZE (16*1024)
151#define BLKFIN_DSUPBANKS 1
152#else
153#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
154#define L1_DATA_A_LENGTH 0x4000
155#define BLKFIN_DCACHESIZE (0*1024)
156#define BLKFIN_DSUPBANKS 0
157#endif
158
159#endif
160
161/* Scratch Pad Memory */
162
163#if defined(CONFIG_BF533) || defined(CONFIG_BF532) || defined(CONFIG_BF531)
164#define L1_SCRATCH_START 0xFFB00000
165#define L1_SCRATCH_LENGTH 0x1000
166#endif
167
168#endif /* _MEM_MAP_533_H_ */
diff --git a/include/asm-blackfin/mach-bf537/anomaly.h b/include/asm-blackfin/mach-bf537/anomaly.h
new file mode 100644
index 000000000000..7f040f5ba018
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/anomaly.h
@@ -0,0 +1,120 @@
1
2/*
3 * File: include/asm-blackfin/mach-bf537/anomaly.h
4 * Based on:
5 * Author:
6 *
7 * Created:
8 * Description:
9 *
10 * Rev:
11 *
12 * Modified:
13 *
14 *
15 * Bugs: Enter bugs at http://blackfin.uclinux.org/
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2, or (at your option)
20 * any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; see the file COPYING.
29 * If not, write to the Free Software Foundation,
30 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 */
32
33/* This file shoule be up to date with:
34 * - Revision J, June 1, 2006; ADSP-BF537 Blackfin Processor Anomaly List
35 * - Revision I, June 1, 2006; ADSP-BF536 Blackfin Processor Anomaly List
36 * - Revision J, June 1, 2006; ADSP-BF534 Blackfin Processor Anomaly List
37 */
38
39#ifndef _MACH_ANOMALY_H_
40#define _MACH_ANOMALY_H_
41
42/* We do not support 0.1 silicon - sorry */
43#if (defined(CONFIG_BF_REV_0_1))
44#error Kernel will not work on BF537/6/4 Version 0.1
45#endif
46
47#if (defined(CONFIG_BF_REV_0_3) || defined(CONFIG_BF_REV_0_2))
48#define ANOMALY_05000074 /* A multi issue instruction with dsp32shiftimm in
49 slot1 and store of a P register in slot 2 is not
50 supported */
51#define ANOMALY_05000119 /* DMA_RUN bit is not valid after a Peripheral Receive
52 Channel DMA stops */
53#define ANOMALY_05000122 /* Rx.H can not be used to access 16-bit System MMR
54 registers. */
55#define ANOMALY_05000166 /* PPI Data Lengths Between 8 and 16 do not zero out
56 upper bits*/
57#define ANOMALY_05000180 /* PPI_DELAY not functional in PPI modes with 0 frame
58 syncs */
59#if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
60#define ANOMALY_05000247 /* CLKIN Buffer Output Enable Reset Behavior Is
61 Changed */
62#endif
63#define ANOMALY_05000265 /* Sensitivity to noise with slow input edge rates on
64 SPORT external receive and transmit clocks. */
65#define ANOMALY_05000272 /* Certain data cache write through modes fail for
66 VDDint <=0.9V */
67#define ANOMALY_05000273 /* Writes to Synchronous SDRAM memory may be lost */
68#define ANOMALY_05000277 /* Writes to a flag data register one SCLK cycle after
69 an edge is detected may clear interrupt */
70#define ANOMALY_05000281 /* False Hardware Error Exception when ISR context is
71 not restored */
72#define ANOMALY_05000282 /* Memory DMA corruption with 32-bit data and traffic
73 control */
74#define ANOMALY_05000283 /* A system MMR write is stalled indefinitely when
75 killed in a particular stage*/
76#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC
77 registers are interrupted */
78#endif
79
80#if defined(CONFIG_BF_REV_0_2)
81#define ANOMALY_05000244 /* With instruction cache enabled, a CSYNC or SSYNC or
82 IDLE around a Change of Control causes
83 unpredictable results */
84#define ANOMALY_05000250 /* Incorrect Bit-Shift of Data Word in Multichannel
85 (TDM) */
86#if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
87#define ANOMALY_05000252 /* EMAC Tx DMA error after an early frame abort */
88#endif
89#define ANOMALY_05000253 /* Maximum external clock speed for Timers */
90#define ANOMALY_05000255 /* Entering Hibernate Mode with RTC Seconds event
91 interrupt not functional */
92#if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
93#define ANOMALY_05000256 /* EMAC MDIO input latched on wrong MDC edge */
94#endif
95#define ANOMALY_05000257 /* An interrupt or exception during short Hardware
96 loops may cause the instruction fetch unit to
97 malfunction */
98#define ANOMALY_05000258 /* Instruction Cache is corrupted when bit 9 and 12 of
99 the ICPLB Data registers differ */
100#define ANOMALY_05000260 /* ICPLB_STATUS MMR register may be corrupted */
101#define ANOMALY_05000261 /* DCPLB_FAULT_ADDR MMR register may be corrupted */
102#define ANOMALY_05000262 /* Stores to data cache may be lost */
103#define ANOMALY_05000263 /* Hardware loop corrupted when taking an ICPLB exception */
104#define ANOMALY_05000264 /* A Sync instruction (CSYNC, SSYNC) or an IDLE
105 instruction will cause an infinite stall in the
106 second to last instruction in a hardware loop */
107#define ANOMALY_05000268 /* Memory DMA error when peripheral DMA is running
108 and non-zero DEB_TRAFFIC_PERIOD value */
109#define ANOMALY_05000270 /* High I/O activity causes the output voltage of the
110 internal voltage regulator (VDDint) to decrease */
111#define ANOMALY_05000277 /* Writes to a flag data register one SCLK cycle after
112 an edge is detected may clear interrupt */
113#define ANOMALY_05000278 /* Disabling Peripherals with DMA running may cause
114 DMA system instability */
115#define ANOMALY_05000280 /* SPI Master boot mode does not work well with
116 Atmel Dataflash devices */
117
118#endif /* CONFIG_BF_REV_0_2 */
119
120#endif /* _MACH_ANOMALY_H_ */
diff --git a/include/asm-blackfin/mach-bf537/bf537.h b/include/asm-blackfin/mach-bf537/bf537.h
new file mode 100644
index 000000000000..b8924cd7730c
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/bf537.h
@@ -0,0 +1,287 @@
1/*
2 * File: include/asm-blackfin/mach-bf537/bf537.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF537
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#ifndef __MACH_BF537_H__
31#define __MACH_BF537_H__
32
33#define SUPPORTED_REVID 2
34
35/* Masks for generic ERROR IRQ demultiplexing used in int-priority-sc.c */
36
37#define SPI_ERR_MASK (TXCOL | RBSY | MODF | TXE) /* SPI_STAT */
38#define SPORT_ERR_MASK (ROVF | RUVF | TOVF | TUVF) /* SPORTx_STAT */
39#define PPI_ERR_MASK (0xFFFF & ~FLD) /* PPI_STATUS */
40#define EMAC_ERR_MASK (PHYINT | MMCINT | RXFSINT | TXFSINT | WAKEDET | RXDMAERR | TXDMAERR | STMDONE) /* EMAC_SYSTAT */
41#define UART_ERR_MASK_STAT1 (0x4) /* UARTx_IIR */
42#define UART_ERR_MASK_STAT0 (0x2) /* UARTx_IIR */
43#define CAN_ERR_MASK (EWTIF | EWRIF | EPIF | BOIF | WUIF | UIAIF | AAIF | RMLIF | UCEIF | EXTIF | ADIF) /* CAN_GIF */
44
45#define OFFSET_(x) ((x) & 0x0000FFFF)
46
47/*some misc defines*/
48#define IMASK_IVG15 0x8000
49#define IMASK_IVG14 0x4000
50#define IMASK_IVG13 0x2000
51#define IMASK_IVG12 0x1000
52
53#define IMASK_IVG11 0x0800
54#define IMASK_IVG10 0x0400
55#define IMASK_IVG9 0x0200
56#define IMASK_IVG8 0x0100
57
58#define IMASK_IVG7 0x0080
59#define IMASK_IVGTMR 0x0040
60#define IMASK_IVGHW 0x0020
61
62/***************************/
63
64
65#define BLKFIN_DSUBBANKS 4
66#define BLKFIN_DWAYS 2
67#define BLKFIN_DLINES 64
68#define BLKFIN_ISUBBANKS 4
69#define BLKFIN_IWAYS 4
70#define BLKFIN_ILINES 32
71
72#define WAY0_L 0x1
73#define WAY1_L 0x2
74#define WAY01_L 0x3
75#define WAY2_L 0x4
76#define WAY02_L 0x5
77#define WAY12_L 0x6
78#define WAY012_L 0x7
79
80#define WAY3_L 0x8
81#define WAY03_L 0x9
82#define WAY13_L 0xA
83#define WAY013_L 0xB
84
85#define WAY32_L 0xC
86#define WAY320_L 0xD
87#define WAY321_L 0xE
88#define WAYALL_L 0xF
89
90#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
91
92/********************************* EBIU Settings ************************************/
93#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
94#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
95
96#ifdef CONFIG_C_AMBEN_ALL
97#define V_AMBEN AMBEN_ALL
98#endif
99#ifdef CONFIG_C_AMBEN
100#define V_AMBEN 0x0
101#endif
102#ifdef CONFIG_C_AMBEN_B0
103#define V_AMBEN AMBEN_B0
104#endif
105#ifdef CONFIG_C_AMBEN_B0_B1
106#define V_AMBEN AMBEN_B0_B1
107#endif
108#ifdef CONFIG_C_AMBEN_B0_B1_B2
109#define V_AMBEN AMBEN_B0_B1_B2
110#endif
111#ifdef CONFIG_C_AMCKEN
112#define V_AMCKEN AMCKEN
113#else
114#define V_AMCKEN 0x0
115#endif
116#ifdef CONFIG_C_CDPRIO
117#define V_CDPRIO 0x100
118#else
119#define V_CDPRIO 0x0
120#endif
121
122#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO)
123
124#define MAX_VC 650000000
125#define MIN_VC 50000000
126
127/********************************PLL Settings **************************************/
128#ifdef CONFIG_BFIN_KERNEL_CLOCK
129#if (CONFIG_VCO_MULT < 0)
130#error "VCO Multiplier is less than 0. Please select a different value"
131#endif
132
133#if (CONFIG_VCO_MULT == 0)
134#error "VCO Multiplier should be greater than 0. Please select a different value"
135#endif
136
137#if (CONFIG_VCO_MULT > 64)
138#error "VCO Multiplier is more than 64. Please select a different value"
139#endif
140
141#ifndef CONFIG_CLKIN_HALF
142#define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
143#else
144#define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
145#endif
146
147#ifndef CONFIG_PLL_BYPASS
148#define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
149#define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
150#else
151#define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
152#define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
153#endif
154
155#if (CONFIG_SCLK_DIV < 1)
156#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
157#endif
158
159#if (CONFIG_SCLK_DIV > 15)
160#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
161#endif
162
163#if (CONFIG_CCLK_DIV != 1)
164#if (CONFIG_CCLK_DIV != 2)
165#if (CONFIG_CCLK_DIV != 4)
166#if (CONFIG_CCLK_DIV != 8)
167#error "CCLK DIV can be 1,2,4 or 8 only. Please select a proper value"
168#endif
169#endif
170#endif
171#endif
172
173#if (CONFIG_VCO_HZ > MAX_VC)
174#error "VCO selected is more than maximum value. Please change the VCO multipler"
175#endif
176
177#if (CONFIG_SCLK_HZ > 133000000)
178#error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
179#endif
180
181#if (CONFIG_SCLK_HZ < 27000000)
182#error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
183#endif
184
185#if (CONFIG_SCLK_HZ >= CONFIG_CCLK_HZ)
186#if (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ)
187#if (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
188#error "Please select sclk less than cclk"
189#endif
190#endif
191#endif
192
193#if (CONFIG_CCLK_DIV == 1)
194#define CONFIG_CCLK_ACT_DIV CCLK_DIV1
195#endif
196#if (CONFIG_CCLK_DIV == 2)
197#define CONFIG_CCLK_ACT_DIV CCLK_DIV2
198#endif
199#if (CONFIG_CCLK_DIV == 4)
200#define CONFIG_CCLK_ACT_DIV CCLK_DIV4
201#endif
202#if (CONFIG_CCLK_DIV == 8)
203#define CONFIG_CCLK_ACT_DIV CCLK_DIV8
204#endif
205#ifndef CONFIG_CCLK_ACT_DIV
206#define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
207#endif
208
209#if defined(ANOMALY_05000273) && (CONFIG_CCLK_DIV == 1)
210#error ANOMALY 05000273, please make sure CCLK is at least 2x SCLK
211#endif
212
213#endif /* CONFIG_BFIN_KERNEL_CLOCK */
214
215#ifdef CONFIG_BF537
216#define CPU "BF537"
217#define CPUID 0x027c8000
218#endif
219#ifdef CONFIG_BF536
220#define CPU "BF536"
221#define CPUID 0x027c8000
222#endif
223#ifdef CONFIG_BF534
224#define CPU "BF534"
225#define CPUID 0x027c6000
226#endif
227#ifndef CPU
228#define CPU "UNKNOWN"
229#define CPUID 0x0
230#endif
231
232#if (CONFIG_MEM_SIZE % 4)
233#error "SDRAM mem size must be multible of 4MB"
234#endif
235
236#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO)
237#define SDRAM_IKERNEL (SDRAM_IGENERIC | CPLB_LOCK)
238#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
239#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID)
240
241/*Use the menuconfig cache policy here - CONFIG_BLKFIN_WT/CONFIG_BLKFIN_WB*/
242
243#define ANOMALY_05000158_WORKAROUND 0x200
244#ifdef CONFIG_BLKFIN_WB /*Write Back Policy */
245#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_DIRTY \
246 | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
247#else /*Write Through */
248#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW \
249 | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY )
250#endif
251
252
253#define L1_DMEMORY (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY )
254#define SDRAM_DNON_CHBL (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY )
255#define SDRAM_EBIU (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY )
256#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY )
257
258#define SIZE_1K 0x00000400 /* 1K */
259#define SIZE_4K 0x00001000 /* 4K */
260#define SIZE_1M 0x00100000 /* 1M */
261#define SIZE_4M 0x00400000 /* 4M */
262
263#define MAX_CPLBS (16 * 2)
264
265/*
266* Number of required data CPLB switchtable entries
267* MEMSIZE / 4 (we mostly install 4M page size CPLBs
268* approx 16 for smaller 1MB page size CPLBs for allignment purposes
269* 1 for L1 Data Memory
270* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
271* 1 for ASYNC Memory
272*/
273
274
275#define MAX_SWITCH_D_CPLBS (((CONFIG_MEM_SIZE / 4) + 16 + 1 + 1 + 1) * 2)
276
277/*
278* Number of required instruction CPLB switchtable entries
279* MEMSIZE / 4 (we mostly install 4M page size CPLBs
280* approx 12 for smaller 1MB page size CPLBs for allignment purposes
281* 1 for L1 Instruction Memory
282* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
283*/
284
285#define MAX_SWITCH_I_CPLBS (((CONFIG_MEM_SIZE / 4) + 12 + 1 + 1) * 2)
286
287#endif /* __MACH_BF537_H__ */
diff --git a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
new file mode 100644
index 000000000000..8f5d9c4d8d5b
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
@@ -0,0 +1,147 @@
1#include <linux/serial.h>
2#include <asm/dma.h>
3
4#define NR_PORTS 2
5
6#define OFFSET_THR 0x00 /* Transmit Holding register */
7#define OFFSET_RBR 0x00 /* Receive Buffer register */
8#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
9#define OFFSET_IER 0x04 /* Interrupt Enable Register */
10#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
11#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
12#define OFFSET_LCR 0x0C /* Line Control Register */
13#define OFFSET_MCR 0x10 /* Modem Control Register */
14#define OFFSET_LSR 0x14 /* Line Status Register */
15#define OFFSET_MSR 0x18 /* Modem Status Register */
16#define OFFSET_SCR 0x1C /* SCR Scratch Register */
17#define OFFSET_GCTL 0x24 /* Global Control Register */
18
19#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
20#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
21#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
22#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
23#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
24#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
25#define UART_GET_LSR(uart) bfin_read16(((uart)->port.membase + OFFSET_LSR))
26#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
27
28#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
29#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
30#define UART_PUT_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER),v)
31#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
32#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
33#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
34
35#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
36# define CONFIG_SERIAL_BFIN_CTSRTS
37
38# ifndef CONFIG_UART0_CTS_PIN
39# define CONFIG_UART0_CTS_PIN -1
40# endif
41
42# ifndef CONFIG_UART0_RTS_PIN
43# define CONFIG_UART0_RTS_PIN -1
44# endif
45
46# ifndef CONFIG_UART1_CTS_PIN
47# define CONFIG_UART1_CTS_PIN -1
48# endif
49
50# ifndef CONFIG_UART1_RTS_PIN
51# define CONFIG_UART1_RTS_PIN -1
52# endif
53#endif
54/*
55 * The pin configuration is different from schematic
56 */
57struct bfin_serial_port {
58 struct uart_port port;
59 unsigned int old_status;
60#ifdef CONFIG_SERIAL_BFIN_DMA
61 int tx_done;
62 int tx_count;
63 struct circ_buf rx_dma_buf;
64 struct timer_list rx_dma_timer;
65 int rx_dma_nrows;
66 unsigned int tx_dma_channel;
67 unsigned int rx_dma_channel;
68 struct work_struct tx_dma_workqueue;
69#else
70 struct work_struct cts_workqueue;
71#endif
72#ifdef CONFIG_SERIAL_BFIN_CTSRTS
73 int cts_pin;
74 int rts_pin;
75#endif
76};
77
78struct bfin_serial_port bfin_serial_ports[NR_PORTS];
79struct bfin_serial_res {
80 unsigned long uart_base_addr;
81 int uart_irq;
82#ifdef CONFIG_SERIAL_BFIN_DMA
83 unsigned int uart_tx_dma_channel;
84 unsigned int uart_rx_dma_channel;
85#endif
86#ifdef CONFIG_SERIAL_BFIN_CTSRTS
87 int uart_cts_pin;
88 int uart_rts_pin;
89#endif
90};
91
92struct bfin_serial_res bfin_serial_resource[] = {
93#ifdef CONFIG_SERIAL_BFIN_UART0
94 {
95 0xFFC00400,
96 IRQ_UART0_RX,
97#ifdef CONFIG_SERIAL_BFIN_DMA
98 CH_UART0_TX,
99 CH_UART0_RX,
100#endif
101#ifdef CONFIG_BFIN_UART0_CTSRTS
102 CONFIG_UART0_CTS_PIN,
103 CONFIG_UART0_RTS_PIN,
104#endif
105 },
106#endif
107#ifdef CONFIG_SERIAL_BFIN_UART1
108 {
109 0xFFC02000,
110 IRQ_UART1_RX,
111#ifdef CONFIG_SERIAL_BFIN_DMA
112 CH_UART1_TX,
113 CH_UART1_RX,
114#endif
115#ifdef CONFIG_BFIN_UART1_CTSRTS
116 CONFIG_UART1_CTS_PIN,
117 CONFIG_UART1_RTS_PIN,
118#endif
119 },
120#endif
121};
122
123int nr_ports = ARRAY_SIZE(bfin_serial_resource);
124
125static void bfin_serial_hw_init(struct bfin_serial_port *uart)
126{
127 unsigned short val;
128 val = bfin_read16(BFIN_PORT_MUX);
129 val &= ~(PFDE | PFTE);
130 bfin_write16(BFIN_PORT_MUX, val);
131
132 val = bfin_read16(PORTF_FER);
133 val |= 0xF;
134 bfin_write16(PORTF_FER, val);
135
136#ifdef CONFIG_SERIAL_BFIN_CTSRTS
137 if (uart->cts_pin >= 0) {
138 gpio_request(uart->cts_pin, NULL);
139 gpio_direction_input(uart->cts_pin);
140 }
141
142 if (uart->rts_pin >= 0) {
143 gpio_request(uart->rts_pin, NULL);
144 gpio_direction_output(uart->rts_pin);
145 }
146#endif
147}
diff --git a/include/asm-blackfin/mach-bf537/blackfin.h b/include/asm-blackfin/mach-bf537/blackfin.h
new file mode 100644
index 000000000000..bbd97051ec9c
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/blackfin.h
@@ -0,0 +1,430 @@
1/*
2 * File: include/asm-blackfin/mach-bf537/blackfin.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _MACH_BLACKFIN_H_
33#define _MACH_BLACKFIN_H_
34
35#define BF537_FAMILY
36
37#include "bf537.h"
38#include "mem_map.h"
39#include "defBF534.h"
40#include "anomaly.h"
41
42#if defined(CONFIG_BF537) || defined(CONFIG_BF536)
43#include "defBF537.h"
44#endif
45
46#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
47#include "cdefBF534.h"
48
49/* UART 0*/
50#define bfin_read_UART_THR() bfin_read_UART0_THR()
51#define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
52#define bfin_read_UART_RBR() bfin_read_UART0_RBR()
53#define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
54#define bfin_read_UART_DLL() bfin_read_UART0_DLL()
55#define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
56#define bfin_read_UART_IER() bfin_read_UART0_IER()
57#define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
58#define bfin_read_UART_DLH() bfin_read_UART0_DLH()
59#define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
60#define bfin_read_UART_IIR() bfin_read_UART0_IIR()
61#define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
62#define bfin_read_UART_LCR() bfin_read_UART0_LCR()
63#define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
64#define bfin_read_UART_MCR() bfin_read_UART0_MCR()
65#define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
66#define bfin_read_UART_LSR() bfin_read_UART0_LSR()
67#define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
68#define bfin_read_UART_SCR() bfin_read_UART0_SCR()
69#define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
70#define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
71#define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
72
73#if defined(CONFIG_BF537) || defined(CONFIG_BF536)
74#include "cdefBF537.h"
75#endif
76#endif
77
78/* MAP used DEFINES from BF533 to BF537 - so we don't need to change them in the driver, kernel, etc. */
79
80/* UART_IIR Register */
81#define STATUS(x) ((x << 1) & 0x06)
82#define STATUS_P1 0x02
83#define STATUS_P0 0x01
84
85/* UART 0*/
86
87/* DMA Channnel */
88#define bfin_read_CH_UART_RX() bfin_read_CH_UART0_RX()
89#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART0_RX(val)
90#define CH_UART_RX CH_UART0_RX
91#define bfin_read_CH_UART_TX() bfin_read_CH_UART0_TX()
92#define bfin_write_CH_UART_TX(val) bfin_write_CH_UART0_TX(val)
93#define CH_UART_TX CH_UART0_TX
94
95/* System Interrupt Controller */
96#define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART0_RX()
97#define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART0_RX(val)
98#define IRQ_UART_RX IRQ_UART0_RX
99#define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART0_TX()
100#define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART0_TX(val)
101#define IRQ_UART_TX IRQ_UART0_TX
102#define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART0_ERROR()
103#define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART0_ERROR(val)
104#define IRQ_UART_ERROR IRQ_UART0_ERROR
105
106/* MMR Registers*/
107#define bfin_read_UART_THR() bfin_read_UART0_THR()
108#define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
109#define UART_THR UART0_THR
110#define bfin_read_UART_RBR() bfin_read_UART0_RBR()
111#define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
112#define UART_RBR UART0_RBR
113#define bfin_read_UART_DLL() bfin_read_UART0_DLL()
114#define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
115#define UART_DLL UART0_DLL
116#define bfin_read_UART_IER() bfin_read_UART0_IER()
117#define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
118#define UART_IER UART0_IER
119#define bfin_read_UART_DLH() bfin_read_UART0_DLH()
120#define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
121#define UART_DLH UART0_DLH
122#define bfin_read_UART_IIR() bfin_read_UART0_IIR()
123#define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
124#define UART_IIR UART0_IIR
125#define bfin_read_UART_LCR() bfin_read_UART0_LCR()
126#define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
127#define UART_LCR UART0_LCR
128#define bfin_read_UART_MCR() bfin_read_UART0_MCR()
129#define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
130#define UART_MCR UART0_MCR
131#define bfin_read_UART_LSR() bfin_read_UART0_LSR()
132#define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
133#define UART_LSR UART0_LSR
134#define bfin_read_UART_SCR() bfin_read_UART0_SCR()
135#define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
136#define UART_SCR UART0_SCR
137#define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
138#define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
139#define UART_GCTL UART0_GCTL
140
141/* DPMC*/
142#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
143#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
144#define STOPCK_OFF STOPCK
145
146/* FIO USE PORT F*/
147#ifdef CONFIG_BF537_PORT_F
148#define bfin_read_PORT_FER() bfin_read_PORTF_FER()
149#define bfin_write_PORT_FER(val) bfin_write_PORTF_FER(val)
150#define bfin_read_FIO_FLAG_D() bfin_read_PORTFIO()
151#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTFIO(val)
152#define bfin_read_FIO_FLAG_C() bfin_read_PORTFIO_CLEAR()
153#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTFIO_CLEAR(val)
154#define bfin_read_FIO_FLAG_S() bfin_read_PORTFIO_SET()
155#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTFIO_SET(val)
156#define bfin_read_FIO_FLAG_T() bfin_read_PORTFIO_TOGGLE()
157#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTFIO_TOGGLE(val)
158#define bfin_read_FIO_MASKA_D() bfin_read_PORTFIO_MASKA()
159#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTFIO_MASKA(val)
160#define bfin_read_FIO_MASKA_C() bfin_read_PORTFIO_MASKA_CLEAR()
161#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTFIO_MASKA_CLEAR(val)
162#define bfin_read_FIO_MASKA_S() bfin_read_PORTFIO_MASKA_SET()
163#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTFIO_MASKA_SET(val)
164#define bfin_read_FIO_MASKA_T() bfin_read_PORTFIO_MASKA_TOGGLE()
165#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTFIO_MASKA_TOGGLE(val)
166#define bfin_read_FIO_MASKB_D() bfin_read_PORTFIO_MASKB()
167#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTFIO_MASKB(val)
168#define bfin_read_FIO_MASKB_C() bfin_read_PORTFIO_MASKB_CLEAR()
169#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTFIO_MASKB_CLEAR(val)
170#define bfin_read_FIO_MASKB_S() bfin_read_PORTFIO_MASKB_SET()
171#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTFIO_MASKB_SET(val)
172#define bfin_read_FIO_MASKB_T() bfin_read_PORTFIO_MASKB_TOGGLE()
173#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTFIO_MASKB_TOGGLE(val)
174#define bfin_read_FIO_DIR() bfin_read_PORTFIO_DIR()
175#define bfin_write_FIO_DIR(val) bfin_write_PORTFIO_DIR(val)
176#define bfin_read_FIO_POLAR() bfin_read_PORTFIO_POLAR()
177#define bfin_write_FIO_POLAR(val) bfin_write_PORTFIO_POLAR(val)
178#define bfin_read_FIO_EDGE() bfin_read_PORTFIO_EDGE()
179#define bfin_write_FIO_EDGE(val) bfin_write_PORTFIO_EDGE(val)
180#define bfin_read_FIO_BOTH() bfin_read_PORTFIO_BOTH()
181#define bfin_write_FIO_BOTH(val) bfin_write_PORTFIO_BOTH(val)
182#define bfin_read_FIO_INEN() bfin_read_PORTFIO_INEN()
183#define bfin_write_FIO_INEN(val) bfin_write_PORTFIO_INEN(val)
184
185#define bfin_read_FIO_FLAG_D() bfin_read_PORTFIO()
186#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTFIO(val)
187#define FIO_FLAG_D PORTFIO
188#define bfin_read_FIO_FLAG_C() bfin_read_PORTFIO_CLEAR()
189#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTFIO_CLEAR(val)
190#define FIO_FLAG_C PORTFIO_CLEAR
191#define bfin_read_FIO_FLAG_S() bfin_read_PORTFIO_SET()
192#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTFIO_SET(val)
193#define FIO_FLAG_S PORTFIO_SET
194#define bfin_read_FIO_FLAG_T() bfin_read_PORTFIO_TOGGLE()
195#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTFIO_TOGGLE(val)
196#define FIO_FLAG_T PORTFIO_TOGGLE
197#define bfin_read_FIO_MASKA_D() bfin_read_PORTFIO_MASKA()
198#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTFIO_MASKA(val)
199#define FIO_MASKA_D PORTFIO_MASKA
200#define bfin_read_FIO_MASKA_C() bfin_read_PORTFIO_MASKA_CLEAR()
201#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTFIO_MASKA_CLEAR(val)
202#define FIO_MASKA_C PORTFIO_MASKA_CLEAR
203#define bfin_read_FIO_MASKA_S() bfin_read_PORTFIO_MASKA_SET()
204#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTFIO_MASKA_SET(val)
205#define FIO_MASKA_S PORTFIO_MASKA_SET
206#define bfin_read_FIO_MASKA_T() bfin_read_PORTFIO_MASKA_TOGGLE()
207#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTFIO_MASKA_TOGGLE(val)
208#define FIO_MASKA_T PORTFIO_MASKA_TOGGLE
209#define bfin_read_FIO_MASKB_D() bfin_read_PORTFIO_MASKB()
210#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTFIO_MASKB(val)
211#define FIO_MASKB_D PORTFIO_MASKB
212#define bfin_read_FIO_MASKB_C() bfin_read_PORTFIO_MASKB_CLEAR()
213#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTFIO_MASKB_CLEAR(val)
214#define FIO_MASKB_C PORTFIO_MASKB_CLEAR
215#define bfin_read_FIO_MASKB_S() bfin_read_PORTFIO_MASKB_SET()
216#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTFIO_MASKB_SET(val)
217#define FIO_MASKB_S PORTFIO_MASKB_SET
218#define bfin_read_FIO_MASKB_T() bfin_read_PORTFIO_MASKB_TOGGLE()
219#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTFIO_MASKB_TOGGLE(val)
220#define FIO_MASKB_T PORTFIO_MASKB_TOGGLE
221#define bfin_read_FIO_DIR() bfin_read_PORTFIO_DIR()
222#define bfin_write_FIO_DIR(val) bfin_write_PORTFIO_DIR(val)
223#define FIO_DIR PORTFIO_DIR
224#define bfin_read_FIO_POLAR() bfin_read_PORTFIO_POLAR()
225#define bfin_write_FIO_POLAR(val) bfin_write_PORTFIO_POLAR(val)
226#define FIO_POLAR PORTFIO_POLAR
227#define bfin_read_FIO_EDGE() bfin_read_PORTFIO_EDGE()
228#define bfin_write_FIO_EDGE(val) bfin_write_PORTFIO_EDGE(val)
229#define FIO_EDGE PORTFIO_EDGE
230#define bfin_read_FIO_BOTH() bfin_read_PORTFIO_BOTH()
231#define bfin_write_FIO_BOTH(val) bfin_write_PORTFIO_BOTH(val)
232#define FIO_BOTH PORTFIO_BOTH
233#define bfin_read_FIO_INEN() bfin_read_PORTFIO_INEN()
234#define bfin_write_FIO_INEN(val) bfin_write_PORTFIO_INEN(val)
235#define FIO_INEN PORTFIO_INEN
236#endif
237
238/* FIO USE PORT G*/
239#ifdef CONFIG_BF537_PORT_G
240#define bfin_read_PORT_FER() bfin_read_PORTG_FER()
241#define bfin_write_PORT_FER(val) bfin_write_PORTG_FER(val)
242#define bfin_read_FIO_FLAG_D() bfin_read_PORTGIO()
243#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTGIO(val)
244#define bfin_read_FIO_FLAG_C() bfin_read_PORTGIO_CLEAR()
245#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTGIO_CLEAR(val)
246#define bfin_read_FIO_FLAG_S() bfin_read_PORTGIO_SET()
247#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTGIO_SET(val)
248#define bfin_read_FIO_FLAG_T() bfin_read_PORTGIO_TOGGLE()
249#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTGIO_TOGGLE(val)
250#define bfin_read_FIO_MASKA_D() bfin_read_PORTGIO_MASKA()
251#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTGIO_MASKA(val)
252#define bfin_read_FIO_MASKA_C() bfin_read_PORTGIO_MASKA_CLEAR()
253#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTGIO_MASKA_CLEAR(val)
254#define bfin_read_FIO_MASKA_S() bfin_read_PORTGIO_MASKA_SET()
255#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTGIO_MASKA_SET(val)
256#define bfin_read_FIO_MASKA_T() bfin_read_PORTGIO_MASKA_TOGGLE()
257#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTGIO_MASKA_TOGGLE(val)
258#define bfin_read_FIO_MASKB_D() bfin_read_PORTGIO_MASKB()
259#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTGIO_MASKB(val)
260#define bfin_read_FIO_MASKB_C() bfin_read_PORTGIO_MASKB_CLEAR()
261#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTGIO_MASKB_CLEAR(val)
262#define bfin_read_FIO_MASKB_S() bfin_read_PORTGIO_MASKB_SET()
263#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTGIO_MASKB_SET(val)
264#define bfin_read_FIO_MASKB_T() bfin_read_PORTGIO_MASKB_TOGGLE()
265#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTGIO_MASKB_TOGGLE(val)
266#define bfin_read_FIO_DIR() bfin_read_PORTGIO_DIR()
267#define bfin_write_FIO_DIR(val) bfin_write_PORTGIO_DIR(val)
268#define bfin_read_FIO_POLAR() bfin_read_PORTGIO_POLAR()
269#define bfin_write_FIO_POLAR(val) bfin_write_PORTGIO_POLAR(val)
270#define bfin_read_FIO_EDGE() bfin_read_PORTGIO_EDGE()
271#define bfin_write_FIO_EDGE(val) bfin_write_PORTGIO_EDGE(val)
272#define bfin_read_FIO_BOTH() bfin_read_PORTGIO_BOTH()
273#define bfin_write_FIO_BOTH(val) bfin_write_PORTGIO_BOTH(val)
274#define bfin_read_FIO_INEN() bfin_read_PORTGIO_INEN()
275#define bfin_write_FIO_INEN(val) bfin_write_PORTGIO_INEN(val)
276
277#define bfin_read_FIO_FLAG_D() bfin_read_PORTGIO()
278#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTGIO(val)
279#define FIO_FLAG_D PORTGIO
280#define bfin_read_FIO_FLAG_C() bfin_read_PORTGIO_CLEAR()
281#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTGIO_CLEAR(val)
282#define FIO_FLAG_C PORTGIO_CLEAR
283#define bfin_read_FIO_FLAG_S() bfin_read_PORTGIO_SET()
284#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTGIO_SET(val)
285#define FIO_FLAG_S PORTGIO_SET
286#define bfin_read_FIO_FLAG_T() bfin_read_PORTGIO_TOGGLE()
287#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTGIO_TOGGLE(val)
288#define FIO_FLAG_T PORTGIO_TOGGLE
289#define bfin_read_FIO_MASKA_D() bfin_read_PORTGIO_MASKA()
290#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTGIO_MASKA(val)
291#define FIO_MASKA_D PORTGIO_MASKA
292#define bfin_read_FIO_MASKA_C() bfin_read_PORTGIO_MASKA_CLEAR()
293#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTGIO_MASKA_CLEAR(val)
294#define FIO_MASKA_C PORTGIO_MASKA_CLEAR
295#define bfin_read_FIO_MASKA_S() bfin_read_PORTGIO_MASKA_SET()
296#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTGIO_MASKA_SET(val)
297#define FIO_MASKA_S PORTGIO_MASKA_SET
298#define bfin_read_FIO_MASKA_T() bfin_read_PORTGIO_MASKA_TOGGLE()
299#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTGIO_MASKA_TOGGLE(val)
300#define FIO_MASKA_T PORTGIO_MASKA_TOGGLE
301#define bfin_read_FIO_MASKB_D() bfin_read_PORTGIO_MASKB()
302#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTGIO_MASKB(val)
303#define FIO_MASKB_D PORTGIO_MASKB
304#define bfin_read_FIO_MASKB_C() bfin_read_PORTGIO_MASKB_CLEAR()
305#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTGIO_MASKB_CLEAR(val)
306#define FIO_MASKB_C PORTGIO_MASKB_CLEAR
307#define bfin_read_FIO_MASKB_S() bfin_read_PORTGIO_MASKB_SET()
308#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTGIO_MASKB_SET(val)
309#define FIO_MASKB_S PORTGIO_MASKB_SET
310#define bfin_read_FIO_MASKB_T() bfin_read_PORTGIO_MASKB_TOGGLE()
311#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTGIO_MASKB_TOGGLE(val)
312#define FIO_MASKB_T PORTGIO_MASKB_TOGGLE
313#define bfin_read_FIO_DIR() bfin_read_PORTGIO_DIR()
314#define bfin_write_FIO_DIR(val) bfin_write_PORTGIO_DIR(val)
315#define FIO_DIR PORTGIO_DIR
316#define bfin_read_FIO_POLAR() bfin_read_PORTGIO_POLAR()
317#define bfin_write_FIO_POLAR(val) bfin_write_PORTGIO_POLAR(val)
318#define FIO_POLAR PORTGIO_POLAR
319#define bfin_read_FIO_EDGE() bfin_read_PORTGIO_EDGE()
320#define bfin_write_FIO_EDGE(val) bfin_write_PORTGIO_EDGE(val)
321#define FIO_EDGE PORTGIO_EDGE
322#define bfin_read_FIO_BOTH() bfin_read_PORTGIO_BOTH()
323#define bfin_write_FIO_BOTH(val) bfin_write_PORTGIO_BOTH(val)
324#define FIO_BOTH PORTGIO_BOTH
325#define bfin_read_FIO_INEN() bfin_read_PORTGIO_INEN()
326#define bfin_write_FIO_INEN(val) bfin_write_PORTGIO_INEN(val)
327#define FIO_INEN PORTGIO_INEN
328
329#endif
330
331/* FIO USE PORT H*/
332#ifdef CONFIG_BF537_PORT_H
333#define bfin_read_PORT_FER() bfin_read_PORTH_FER()
334#define bfin_write_PORT_FER(val) bfin_write_PORTH_FER(val)
335#define bfin_read_FIO_FLAG_D() bfin_read_PORTHIO()
336#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTHIO(val)
337#define bfin_read_FIO_FLAG_C() bfin_read_PORTHIO_CLEAR()
338#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTHIO_CLEAR(val)
339#define bfin_read_FIO_FLAG_S() bfin_read_PORTHIO_SET()
340#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTHIO_SET(val)
341#define bfin_read_FIO_FLAG_T() bfin_read_PORTHIO_TOGGLE()
342#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTHIO_TOGGLE(val)
343#define bfin_read_FIO_MASKA_D() bfin_read_PORTHIO_MASKA()
344#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTHIO_MASKA(val)
345#define bfin_read_FIO_MASKA_C() bfin_read_PORTHIO_MASKA_CLEAR()
346#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTHIO_MASKA_CLEAR(val)
347#define bfin_read_FIO_MASKA_S() bfin_read_PORTHIO_MASKA_SET()
348#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTHIO_MASKA_SET(val)
349#define bfin_read_FIO_MASKA_T() bfin_read_PORTHIO_MASKA_TOGGLE()
350#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTHIO_MASKA_TOGGLE(val)
351#define bfin_read_FIO_MASKB_D() bfin_read_PORTHIO_MASKB()
352#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTHIO_MASKB(val)
353#define bfin_read_FIO_MASKB_C() bfin_read_PORTHIO_MASKB_CLEAR()
354#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTHIO_MASKB_CLEAR(val)
355#define bfin_read_FIO_MASKB_S() bfin_read_PORTHIO_MASKB_SET()
356#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTHIO_MASKB_SET(val)
357#define bfin_read_FIO_MASKB_T() bfin_read_PORTHIO_MASKB_TOGGLE()
358#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTHIO_MASKB_TOGGLE(val)
359#define bfin_read_FIO_DIR() bfin_read_PORTHIO_DIR()
360#define bfin_write_FIO_DIR(val) bfin_write_PORTHIO_DIR(val)
361#define bfin_read_FIO_POLAR() bfin_read_PORTHIO_POLAR()
362#define bfin_write_FIO_POLAR(val) bfin_write_PORTHIO_POLAR(val)
363#define bfin_read_FIO_EDGE() bfin_read_PORTHIO_EDGE()
364#define bfin_write_FIO_EDGE(val) bfin_write_PORTHIO_EDGE(val)
365#define bfin_read_FIO_BOTH() bfin_read_PORTHIO_BOTH()
366#define bfin_write_FIO_BOTH(val) bfin_write_PORTHIO_BOTH(val)
367#define bfin_read_FIO_INEN() bfin_read_PORTHIO_INEN()
368#define bfin_write_FIO_INEN(val) bfin_write_PORTHIO_INEN(val)
369
370#define bfin_read_FIO_FLAG_D() bfin_read_PORTHIO()
371#define bfin_write_FIO_FLAG_D(val) bfin_write_PORTHIO(val)
372#define FIO_FLAG_D PORTHIO
373#define bfin_read_FIO_FLAG_C() bfin_read_PORTHIO_CLEAR()
374#define bfin_write_FIO_FLAG_C(val) bfin_write_PORTHIO_CLEAR(val)
375#define FIO_FLAG_C PORTHIO_CLEAR
376#define bfin_read_FIO_FLAG_S() bfin_read_PORTHIO_SET()
377#define bfin_write_FIO_FLAG_S(val) bfin_write_PORTHIO_SET(val)
378#define FIO_FLAG_S PORTHIO_SET
379#define bfin_read_FIO_FLAG_T() bfin_read_PORTHIO_TOGGLE()
380#define bfin_write_FIO_FLAG_T(val) bfin_write_PORTHIO_TOGGLE(val)
381#define FIO_FLAG_T PORTHIO_TOGGLE
382#define bfin_read_FIO_MASKA_D() bfin_read_PORTHIO_MASKA()
383#define bfin_write_FIO_MASKA_D(val) bfin_write_PORTHIO_MASKA(val)
384#define FIO_MASKA_D PORTHIO_MASKA
385#define bfin_read_FIO_MASKA_C() bfin_read_PORTHIO_MASKA_CLEAR()
386#define bfin_write_FIO_MASKA_C(val) bfin_write_PORTHIO_MASKA_CLEAR(val)
387#define FIO_MASKA_C PORTHIO_MASKA_CLEAR
388#define bfin_read_FIO_MASKA_S() bfin_read_PORTHIO_MASKA_SET()
389#define bfin_write_FIO_MASKA_S(val) bfin_write_PORTHIO_MASKA_SET(val)
390#define FIO_MASKA_S PORTHIO_MASKA_SET
391#define bfin_read_FIO_MASKA_T() bfin_read_PORTHIO_MASKA_TOGGLE()
392#define bfin_write_FIO_MASKA_T(val) bfin_write_PORTHIO_MASKA_TOGGLE(val)
393#define FIO_MASKA_T PORTHIO_MASKA_TOGGLE
394#define bfin_read_FIO_MASKB_D() bfin_read_PORTHIO_MASKB()
395#define bfin_write_FIO_MASKB_D(val) bfin_write_PORTHIO_MASKB(val)
396#define FIO_MASKB_D PORTHIO_MASKB
397#define bfin_read_FIO_MASKB_C() bfin_read_PORTHIO_MASKB_CLEAR()
398#define bfin_write_FIO_MASKB_C(val) bfin_write_PORTHIO_MASKB_CLEAR(val)
399#define FIO_MASKB_C PORTHIO_MASKB_CLEAR
400#define bfin_read_FIO_MASKB_S() bfin_read_PORTHIO_MASKB_SET()
401#define bfin_write_FIO_MASKB_S(val) bfin_write_PORTHIO_MASKB_SET(val)
402#define FIO_MASKB_S PORTHIO_MASKB_SET
403#define bfin_read_FIO_MASKB_T() bfin_read_PORTHIO_MASKB_TOGGLE()
404#define bfin_write_FIO_MASKB_T(val) bfin_write_PORTHIO_MASKB_TOGGLE(val)
405#define FIO_MASKB_T PORTHIO_MASKB_TOGGLE
406#define bfin_read_FIO_DIR() bfin_read_PORTHIO_DIR()
407#define bfin_write_FIO_DIR(val) bfin_write_PORTHIO_DIR(val)
408#define FIO_DIR PORTHIO_DIR
409#define bfin_read_FIO_POLAR() bfin_read_PORTHIO_POLAR()
410#define bfin_write_FIO_POLAR(val) bfin_write_PORTHIO_POLAR(val)
411#define FIO_POLAR PORTHIO_POLAR
412#define bfin_read_FIO_EDGE() bfin_read_PORTHIO_EDGE()
413#define bfin_write_FIO_EDGE(val) bfin_write_PORTHIO_EDGE(val)
414#define FIO_EDGE PORTHIO_EDGE
415#define bfin_read_FIO_BOTH() bfin_read_PORTHIO_BOTH()
416#define bfin_write_FIO_BOTH(val) bfin_write_PORTHIO_BOTH(val)
417#define FIO_BOTH PORTHIO_BOTH
418#define bfin_read_FIO_INEN() bfin_read_PORTHIO_INEN()
419#define bfin_write_FIO_INEN(val) bfin_write_PORTHIO_INEN(val)
420#define FIO_INEN PORTHIO_INEN
421
422#endif
423
424/* PLL_DIV Masks */
425#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
426#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
427#define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
428#define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */
429
430#endif
diff --git a/include/asm-blackfin/mach-bf537/cdefBF534.h b/include/asm-blackfin/mach-bf537/cdefBF534.h
new file mode 100644
index 000000000000..7b658c175f85
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/cdefBF534.h
@@ -0,0 +1,1823 @@
1/*
2 * File: include/asm-blackfin/mach-bf537/cdefbf534.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: system mmr register map
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _CDEF_BF534_H
33#define _CDEF_BF534_H
34
35/* Include all Core registers and bit definitions */
36#include "defBF534.h"
37
38/* Include core specific register pointer definitions */
39#include <asm/mach-common/cdef_LPBlackfin.h>
40
41#include <asm/system.h>
42
43/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
44#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
45#define bfin_write_PLL_CTL(val) bfin_write16(PLL_CTL,val)
46#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
47#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
48#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
49/* Writing to VR_CTL initiates a PLL relock sequence. */
50static __inline__ void bfin_write_VR_CTL(unsigned int val)
51{
52 unsigned long flags, iwr;
53
54 bfin_write16(VR_CTL, val);
55 __builtin_bfin_ssync();
56 /* Enable the PLL Wakeup bit in SIC IWR */
57 iwr = bfin_read32(SIC_IWR);
58 /* Only allow PPL Wakeup) */
59 bfin_write32(SIC_IWR, IWR_ENABLE(0));
60 local_irq_save(flags);
61 asm("IDLE;");
62 local_irq_restore(flags);
63 bfin_write32(SIC_IWR, iwr);
64}
65#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
66#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
67#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
68#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
69#define bfin_read_CHIPID() bfin_read32(CHIPID)
70
71/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
72#define bfin_read_SWRST() bfin_read16(SWRST)
73#define bfin_write_SWRST(val) bfin_write16(SWRST,val)
74#define bfin_read_SYSCR() bfin_read16(SYSCR)
75#define bfin_write_SYSCR(val) bfin_write16(SYSCR,val)
76#define pSIC_RVECT ((void * volatile *)SIC_RVECT)
77#define bfin_read_SIC_RVECT() bfin_read32(SIC_RVECT)
78#define bfin_write_SIC_RVECT(val) bfin_write32(SIC_RVECT,val)
79#define bfin_read_SIC_IMASK() bfin_read32(SIC_IMASK)
80#define bfin_write_SIC_IMASK(val) bfin_write32(SIC_IMASK,val)
81#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
82#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0,val)
83#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
84#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1,val)
85#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
86#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2,val)
87#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
88#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3,val)
89#define bfin_read_SIC_ISR() bfin_read32(SIC_ISR)
90#define bfin_write_SIC_ISR(val) bfin_write32(SIC_ISR,val)
91#define bfin_read_SIC_IWR() bfin_read32(SIC_IWR)
92#define bfin_write_SIC_IWR(val) bfin_write32(SIC_IWR,val)
93
94/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
95#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
96#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL,val)
97#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
98#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT,val)
99#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
100#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT,val)
101
102/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
103#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
104#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT,val)
105#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
106#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL,val)
107#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
108#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT,val)
109#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
110#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT,val)
111#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
112#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM,val)
113#define bfin_read_RTC_FAST() bfin_read16(RTC_FAST)
114#define bfin_write_RTC_FAST(val) bfin_write16(RTC_FAST,val)
115#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
116#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN,val)
117
118/* UART0 Controller (0xFFC00400 - 0xFFC004FF) */
119#define bfin_read_UART0_THR() bfin_read16(UART0_THR)
120#define bfin_write_UART0_THR(val) bfin_write16(UART0_THR,val)
121#define bfin_read_UART0_RBR() bfin_read16(UART0_RBR)
122#define bfin_write_UART0_RBR(val) bfin_write16(UART0_RBR,val)
123#define bfin_read_UART0_DLL() bfin_read16(UART0_DLL)
124#define bfin_write_UART0_DLL(val) bfin_write16(UART0_DLL,val)
125#define bfin_read_UART0_IER() bfin_read16(UART0_IER)
126#define bfin_write_UART0_IER(val) bfin_write16(UART0_IER,val)
127#define bfin_read_UART0_DLH() bfin_read16(UART0_DLH)
128#define bfin_write_UART0_DLH(val) bfin_write16(UART0_DLH,val)
129#define bfin_read_UART0_IIR() bfin_read16(UART0_IIR)
130#define bfin_write_UART0_IIR(val) bfin_write16(UART0_IIR,val)
131#define bfin_read_UART0_LCR() bfin_read16(UART0_LCR)
132#define bfin_write_UART0_LCR(val) bfin_write16(UART0_LCR,val)
133#define bfin_read_UART0_MCR() bfin_read16(UART0_MCR)
134#define bfin_write_UART0_MCR(val) bfin_write16(UART0_MCR,val)
135#define bfin_read_UART0_LSR() bfin_read16(UART0_LSR)
136#define bfin_write_UART0_LSR(val) bfin_write16(UART0_LSR,val)
137#define bfin_read_UART0_MSR() bfin_read16(UART0_MSR)
138#define bfin_write_UART0_MSR(val) bfin_write16(UART0_MSR,val)
139#define bfin_read_UART0_SCR() bfin_read16(UART0_SCR)
140#define bfin_write_UART0_SCR(val) bfin_write16(UART0_SCR,val)
141#define bfin_read_UART0_GCTL() bfin_read16(UART0_GCTL)
142#define bfin_write_UART0_GCTL(val) bfin_write16(UART0_GCTL,val)
143
144/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
145#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
146#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL,val)
147#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
148#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG,val)
149#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
150#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT,val)
151#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
152#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR,val)
153#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
154#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR,val)
155#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
156#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD,val)
157#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
158#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW,val)
159
160/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
161#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
162#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG,val)
163#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
164#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER,val)
165#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
166#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD,val)
167#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
168#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH,val)
169
170#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
171#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG,val)
172#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
173#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER,val)
174#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
175#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD,val)
176#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
177#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH,val)
178
179#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
180#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG,val)
181#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
182#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER,val)
183#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
184#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD,val)
185#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
186#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH,val)
187
188#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
189#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG,val)
190#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
191#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER,val)
192#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
193#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD,val)
194#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
195#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH,val)
196
197#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
198#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG,val)
199#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
200#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER,val)
201#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
202#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD,val)
203#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
204#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH,val)
205
206#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
207#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG,val)
208#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
209#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER,val)
210#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
211#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD,val)
212#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
213#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH,val)
214
215#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
216#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG,val)
217#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
218#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER,val)
219#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
220#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD,val)
221#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
222#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH,val)
223
224#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
225#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG,val)
226#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
227#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER,val)
228#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
229#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD,val)
230#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
231#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH,val)
232
233#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
234#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE,val)
235#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
236#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE,val)
237#define bfin_read_TIMER_STATUS() bfin_read32(TIMER_STATUS)
238#define bfin_write_TIMER_STATUS(val) bfin_write32(TIMER_STATUS,val)
239
240/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
241#define bfin_read_PORTFIO() bfin_read16(PORTFIO)
242#define bfin_write_PORTFIO(val) bfin_write16(PORTFIO,val)
243#define bfin_read_PORTFIO_CLEAR() bfin_read16(PORTFIO_CLEAR)
244#define bfin_write_PORTFIO_CLEAR(val) bfin_write16(PORTFIO_CLEAR,val)
245#define bfin_read_PORTFIO_SET() bfin_read16(PORTFIO_SET)
246#define bfin_write_PORTFIO_SET(val) bfin_write16(PORTFIO_SET,val)
247#define bfin_read_PORTFIO_TOGGLE() bfin_read16(PORTFIO_TOGGLE)
248#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE,val)
249#define bfin_read_PORTFIO_MASKA() bfin_read16(PORTFIO_MASKA)
250#define bfin_write_PORTFIO_MASKA(val) bfin_write16(PORTFIO_MASKA,val)
251#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
252#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR,val)
253#define bfin_read_PORTFIO_MASKA_SET() bfin_read16(PORTFIO_MASKA_SET)
254#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET,val)
255#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
256#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE,val)
257#define bfin_read_PORTFIO_MASKB() bfin_read16(PORTFIO_MASKB)
258#define bfin_write_PORTFIO_MASKB(val) bfin_write16(PORTFIO_MASKB,val)
259#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
260#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR,val)
261#define bfin_read_PORTFIO_MASKB_SET() bfin_read16(PORTFIO_MASKB_SET)
262#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET,val)
263#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
264#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE,val)
265#define bfin_read_PORTFIO_DIR() bfin_read16(PORTFIO_DIR)
266#define bfin_write_PORTFIO_DIR(val) bfin_write16(PORTFIO_DIR,val)
267#define bfin_read_PORTFIO_POLAR() bfin_read16(PORTFIO_POLAR)
268#define bfin_write_PORTFIO_POLAR(val) bfin_write16(PORTFIO_POLAR,val)
269#define bfin_read_PORTFIO_EDGE() bfin_read16(PORTFIO_EDGE)
270#define bfin_write_PORTFIO_EDGE(val) bfin_write16(PORTFIO_EDGE,val)
271#define bfin_read_PORTFIO_BOTH() bfin_read16(PORTFIO_BOTH)
272#define bfin_write_PORTFIO_BOTH(val) bfin_write16(PORTFIO_BOTH,val)
273#define bfin_read_PORTFIO_INEN() bfin_read16(PORTFIO_INEN)
274#define bfin_write_PORTFIO_INEN(val) bfin_write16(PORTFIO_INEN,val)
275
276/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
277#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
278#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1,val)
279#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
280#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2,val)
281#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
282#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV,val)
283#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
284#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV,val)
285#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
286#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX,val)
287#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
288#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX,val)
289#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX)
290#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX,val)
291#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX)
292#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX,val)
293#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX)
294#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX,val)
295#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX)
296#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX,val)
297#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
298#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1,val)
299#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
300#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2,val)
301#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
302#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV,val)
303#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
304#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV,val)
305#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
306#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT,val)
307#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
308#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL,val)
309#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
310#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1,val)
311#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
312#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2,val)
313#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
314#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0,val)
315#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
316#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1,val)
317#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
318#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2,val)
319#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
320#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3,val)
321#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
322#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0,val)
323#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
324#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1,val)
325#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
326#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2,val)
327#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
328#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3,val)
329
330/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
331#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
332#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1,val)
333#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
334#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2,val)
335#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
336#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV,val)
337#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
338#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV,val)
339#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
340#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX,val)
341#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
342#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX,val)
343#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX)
344#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX,val)
345#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX)
346#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX,val)
347#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX)
348#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX,val)
349#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX)
350#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX,val)
351#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
352#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1,val)
353#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
354#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2,val)
355#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
356#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV,val)
357#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
358#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV,val)
359#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
360#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT,val)
361#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
362#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL,val)
363#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
364#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1,val)
365#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
366#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2,val)
367#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
368#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0,val)
369#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
370#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1,val)
371#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
372#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2,val)
373#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
374#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3,val)
375#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
376#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0,val)
377#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
378#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1,val)
379#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
380#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2,val)
381#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
382#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3,val)
383
384/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
385#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
386#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL,val)
387#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
388#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0,val)
389#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
390#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1,val)
391#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
392#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL,val)
393#define bfin_read_EBIU_SDBCTL() bfin_read16(EBIU_SDBCTL)
394#define bfin_write_EBIU_SDBCTL(val) bfin_write16(EBIU_SDBCTL,val)
395#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
396#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC,val)
397#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
398#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT,val)
399
400/* DMA Traffic Control Registers */
401#define pDMA_TCPER ((volatile unsigned short *)DMA_TCPER)
402#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
403#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER,val)
404#define pDMA_TCCNT ((volatile unsigned short *)DMA_TCCNT)
405#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
406#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT,val)
407
408/* DMA Controller */
409#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
410#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val)
411#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
412#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR,val)
413#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
414#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR,val)
415#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
416#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT,val)
417#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
418#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT,val)
419#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
420#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY,val)
421#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
422#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY,val)
423#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
424#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR,val)
425#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
426#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR,val)
427#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
428#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT,val)
429#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
430#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT,val)
431#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
432#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS,val)
433#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
434#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP,val)
435
436#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
437#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG,val)
438#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
439#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR,val)
440#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
441#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR,val)
442#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
443#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT,val)
444#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
445#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT,val)
446#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
447#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY,val)
448#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
449#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY,val)
450#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
451#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR,val)
452#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
453#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR,val)
454#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
455#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT,val)
456#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
457#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT,val)
458#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
459#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS,val)
460#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
461#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP,val)
462
463#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
464#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG,val)
465#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
466#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR,val)
467#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
468#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR,val)
469#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
470#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT,val)
471#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
472#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT,val)
473#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
474#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY,val)
475#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
476#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY,val)
477#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
478#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR,val)
479#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
480#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR,val)
481#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
482#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT,val)
483#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
484#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT,val)
485#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
486#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS,val)
487#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
488#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP,val)
489
490#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
491#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG,val)
492#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
493#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR,val)
494#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
495#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR,val)
496#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
497#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT,val)
498#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
499#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT,val)
500#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
501#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY,val)
502#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
503#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY,val)
504#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
505#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR,val)
506#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
507#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR,val)
508#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
509#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT,val)
510#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
511#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT,val)
512#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
513#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS,val)
514#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
515#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP,val)
516
517#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
518#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG,val)
519#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
520#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR,val)
521#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
522#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR,val)
523#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
524#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT,val)
525#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
526#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT,val)
527#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
528#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY,val)
529#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
530#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY,val)
531#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
532#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR,val)
533#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
534#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR,val)
535#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
536#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT,val)
537#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
538#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT,val)
539#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
540#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS,val)
541#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
542#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP,val)
543
544#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
545#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG,val)
546#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
547#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR,val)
548#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
549#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR,val)
550#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
551#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT,val)
552#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
553#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT,val)
554#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
555#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY,val)
556#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
557#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY,val)
558#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
559#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR,val)
560#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
561#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR,val)
562#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
563#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT,val)
564#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
565#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT,val)
566#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
567#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS,val)
568#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
569#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP,val)
570
571#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
572#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG,val)
573#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
574#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR,val)
575#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
576#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR,val)
577#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
578#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT,val)
579#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
580#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT,val)
581#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
582#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY,val)
583#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
584#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY,val)
585#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
586#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR,val)
587#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
588#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR,val)
589#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
590#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT,val)
591#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
592#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT,val)
593#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
594#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS,val)
595#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
596#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP,val)
597
598#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
599#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG,val)
600#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
601#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR,val)
602#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
603#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR,val)
604#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
605#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT,val)
606#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
607#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT,val)
608#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
609#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY,val)
610#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
611#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY,val)
612#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
613#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR,val)
614#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
615#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR,val)
616#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
617#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT,val)
618#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
619#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT,val)
620#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
621#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS,val)
622#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
623#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP,val)
624
625#define bfin_read_DMA8_CONFIG() bfin_read16(DMA8_CONFIG)
626#define bfin_write_DMA8_CONFIG(val) bfin_write16(DMA8_CONFIG,val)
627#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_read32(DMA8_NEXT_DESC_PTR)
628#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_write32(DMA8_NEXT_DESC_PTR,val)
629#define bfin_read_DMA8_START_ADDR() bfin_read32(DMA8_START_ADDR)
630#define bfin_write_DMA8_START_ADDR(val) bfin_write32(DMA8_START_ADDR,val)
631#define bfin_read_DMA8_X_COUNT() bfin_read16(DMA8_X_COUNT)
632#define bfin_write_DMA8_X_COUNT(val) bfin_write16(DMA8_X_COUNT,val)
633#define bfin_read_DMA8_Y_COUNT() bfin_read16(DMA8_Y_COUNT)
634#define bfin_write_DMA8_Y_COUNT(val) bfin_write16(DMA8_Y_COUNT,val)
635#define bfin_read_DMA8_X_MODIFY() bfin_read16(DMA8_X_MODIFY)
636#define bfin_write_DMA8_X_MODIFY(val) bfin_write16(DMA8_X_MODIFY,val)
637#define bfin_read_DMA8_Y_MODIFY() bfin_read16(DMA8_Y_MODIFY)
638#define bfin_write_DMA8_Y_MODIFY(val) bfin_write16(DMA8_Y_MODIFY,val)
639#define bfin_read_DMA8_CURR_DESC_PTR() bfin_read32(DMA8_CURR_DESC_PTR)
640#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_write32(DMA8_CURR_DESC_PTR,val)
641#define bfin_read_DMA8_CURR_ADDR() bfin_read32(DMA8_CURR_ADDR)
642#define bfin_write_DMA8_CURR_ADDR(val) bfin_write32(DMA8_CURR_ADDR,val)
643#define bfin_read_DMA8_CURR_X_COUNT() bfin_read16(DMA8_CURR_X_COUNT)
644#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT,val)
645#define bfin_read_DMA8_CURR_Y_COUNT() bfin_read16(DMA8_CURR_Y_COUNT)
646#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT,val)
647#define bfin_read_DMA8_IRQ_STATUS() bfin_read16(DMA8_IRQ_STATUS)
648#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS,val)
649#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
650#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP,val)
651
652#define bfin_read_DMA9_CONFIG() bfin_read16(DMA9_CONFIG)
653#define bfin_write_DMA9_CONFIG(val) bfin_write16(DMA9_CONFIG,val)
654#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_read32(DMA9_NEXT_DESC_PTR)
655#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_write32(DMA9_NEXT_DESC_PTR,val)
656#define bfin_read_DMA9_START_ADDR() bfin_read32(DMA9_START_ADDR)
657#define bfin_write_DMA9_START_ADDR(val) bfin_write32(DMA9_START_ADDR,val)
658#define bfin_read_DMA9_X_COUNT() bfin_read16(DMA9_X_COUNT)
659#define bfin_write_DMA9_X_COUNT(val) bfin_write16(DMA9_X_COUNT,val)
660#define bfin_read_DMA9_Y_COUNT() bfin_read16(DMA9_Y_COUNT)
661#define bfin_write_DMA9_Y_COUNT(val) bfin_write16(DMA9_Y_COUNT,val)
662#define bfin_read_DMA9_X_MODIFY() bfin_read16(DMA9_X_MODIFY)
663#define bfin_write_DMA9_X_MODIFY(val) bfin_write16(DMA9_X_MODIFY,val)
664#define bfin_read_DMA9_Y_MODIFY() bfin_read16(DMA9_Y_MODIFY)
665#define bfin_write_DMA9_Y_MODIFY(val) bfin_write16(DMA9_Y_MODIFY,val)
666#define bfin_read_DMA9_CURR_DESC_PTR() bfin_read32(DMA9_CURR_DESC_PTR)
667#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_write32(DMA9_CURR_DESC_PTR,val)
668#define bfin_read_DMA9_CURR_ADDR() bfin_read32(DMA9_CURR_ADDR)
669#define bfin_write_DMA9_CURR_ADDR(val) bfin_write32(DMA9_CURR_ADDR,val)
670#define bfin_read_DMA9_CURR_X_COUNT() bfin_read16(DMA9_CURR_X_COUNT)
671#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT,val)
672#define bfin_read_DMA9_CURR_Y_COUNT() bfin_read16(DMA9_CURR_Y_COUNT)
673#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT,val)
674#define bfin_read_DMA9_IRQ_STATUS() bfin_read16(DMA9_IRQ_STATUS)
675#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS,val)
676#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
677#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP,val)
678
679#define bfin_read_DMA10_CONFIG() bfin_read16(DMA10_CONFIG)
680#define bfin_write_DMA10_CONFIG(val) bfin_write16(DMA10_CONFIG,val)
681#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_read32(DMA10_NEXT_DESC_PTR)
682#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_write32(DMA10_NEXT_DESC_PTR,val)
683#define bfin_read_DMA10_START_ADDR() bfin_read32(DMA10_START_ADDR)
684#define bfin_write_DMA10_START_ADDR(val) bfin_write32(DMA10_START_ADDR,val)
685#define bfin_read_DMA10_X_COUNT() bfin_read16(DMA10_X_COUNT)
686#define bfin_write_DMA10_X_COUNT(val) bfin_write16(DMA10_X_COUNT,val)
687#define bfin_read_DMA10_Y_COUNT() bfin_read16(DMA10_Y_COUNT)
688#define bfin_write_DMA10_Y_COUNT(val) bfin_write16(DMA10_Y_COUNT,val)
689#define bfin_read_DMA10_X_MODIFY() bfin_read16(DMA10_X_MODIFY)
690#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY,val)
691#define bfin_read_DMA10_Y_MODIFY() bfin_read16(DMA10_Y_MODIFY)
692#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY,val)
693#define bfin_read_DMA10_CURR_DESC_PTR() bfin_read32(DMA10_CURR_DESC_PTR)
694#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_write32(DMA10_CURR_DESC_PTR,val)
695#define bfin_read_DMA10_CURR_ADDR() bfin_read32(DMA10_CURR_ADDR)
696#define bfin_write_DMA10_CURR_ADDR(val) bfin_write32(DMA10_CURR_ADDR,val)
697#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
698#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT,val)
699#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
700#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT,val)
701#define bfin_read_DMA10_IRQ_STATUS() bfin_read16(DMA10_IRQ_STATUS)
702#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS,val)
703#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
704#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP,val)
705
706#define bfin_read_DMA11_CONFIG() bfin_read16(DMA11_CONFIG)
707#define bfin_write_DMA11_CONFIG(val) bfin_write16(DMA11_CONFIG,val)
708#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_read32(DMA11_NEXT_DESC_PTR)
709#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_write32(DMA11_NEXT_DESC_PTR,val)
710#define bfin_read_DMA11_START_ADDR() bfin_read32(DMA11_START_ADDR)
711#define bfin_write_DMA11_START_ADDR(val) bfin_write32(DMA11_START_ADDR,val)
712#define bfin_read_DMA11_X_COUNT() bfin_read16(DMA11_X_COUNT)
713#define bfin_write_DMA11_X_COUNT(val) bfin_write16(DMA11_X_COUNT,val)
714#define bfin_read_DMA11_Y_COUNT() bfin_read16(DMA11_Y_COUNT)
715#define bfin_write_DMA11_Y_COUNT(val) bfin_write16(DMA11_Y_COUNT,val)
716#define bfin_read_DMA11_X_MODIFY() bfin_read16(DMA11_X_MODIFY)
717#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY,val)
718#define bfin_read_DMA11_Y_MODIFY() bfin_read16(DMA11_Y_MODIFY)
719#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY,val)
720#define bfin_read_DMA11_CURR_DESC_PTR() bfin_read32(DMA11_CURR_DESC_PTR)
721#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_write32(DMA11_CURR_DESC_PTR,val)
722#define bfin_read_DMA11_CURR_ADDR() bfin_read32(DMA11_CURR_ADDR)
723#define bfin_write_DMA11_CURR_ADDR(val) bfin_write32(DMA11_CURR_ADDR,val)
724#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
725#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT,val)
726#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
727#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT,val)
728#define bfin_read_DMA11_IRQ_STATUS() bfin_read16(DMA11_IRQ_STATUS)
729#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS,val)
730#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
731#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP,val)
732
733#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
734#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG,val)
735#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
736#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR,val)
737#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
738#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR,val)
739#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
740#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT,val)
741#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
742#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT,val)
743#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
744#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY,val)
745#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
746#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY,val)
747#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
748#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR,val)
749#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
750#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR,val)
751#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
752#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT,val)
753#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
754#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT,val)
755#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
756#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS,val)
757#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
758#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP,val)
759
760#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
761#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG,val)
762#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
763#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR,val)
764#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
765#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR,val)
766#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
767#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT,val)
768#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
769#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT,val)
770#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
771#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY,val)
772#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
773#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY,val)
774#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
775#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR,val)
776#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
777#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR,val)
778#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
779#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT,val)
780#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
781#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT,val)
782#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
783#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS,val)
784#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
785#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP,val)
786
787#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
788#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG,val)
789#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
790#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR,val)
791#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
792#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR,val)
793#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
794#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT,val)
795#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
796#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT,val)
797#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
798#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY,val)
799#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
800#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY,val)
801#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
802#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR,val)
803#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
804#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR,val)
805#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
806#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT,val)
807#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
808#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT,val)
809#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
810#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS,val)
811#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
812#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP,val)
813
814#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
815#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG,val)
816#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
817#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR,val)
818#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
819#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR,val)
820#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
821#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT,val)
822#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
823#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT,val)
824#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
825#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY,val)
826#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
827#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY,val)
828#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
829#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR,val)
830#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
831#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR,val)
832#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
833#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT,val)
834#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
835#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT,val)
836#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
837#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS,val)
838#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
839#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP,val)
840
841/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
842#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
843#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL,val)
844#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
845#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS,val)
846#define bfin_clear_PPI_STATUS() bfin_write_PPI_STATUS(0xFFFF)
847#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
848#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY,val)
849#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
850#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT,val)
851#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
852#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val)
853
854/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
855#define bfin_read_TWI_CLKDIV() bfin_read16(TWI_CLKDIV)
856#define bfin_write_TWI_CLKDIV(val) bfin_write16(TWI_CLKDIV,val)
857#define bfin_read_TWI_CONTROL() bfin_read16(TWI_CONTROL)
858#define bfin_write_TWI_CONTROL(val) bfin_write16(TWI_CONTROL,val)
859#define bfin_read_TWI_SLAVE_CTL() bfin_read16(TWI_SLAVE_CTL)
860#define bfin_write_TWI_SLAVE_CTL(val) bfin_write16(TWI_SLAVE_CTL,val)
861#define bfin_read_TWI_SLAVE_STAT() bfin_read16(TWI_SLAVE_STAT)
862#define bfin_write_TWI_SLAVE_STAT(val) bfin_write16(TWI_SLAVE_STAT,val)
863#define bfin_read_TWI_SLAVE_ADDR() bfin_read16(TWI_SLAVE_ADDR)
864#define bfin_write_TWI_SLAVE_ADDR(val) bfin_write16(TWI_SLAVE_ADDR,val)
865#define bfin_read_TWI_MASTER_CTL() bfin_read16(TWI_MASTER_CTL)
866#define bfin_write_TWI_MASTER_CTL(val) bfin_write16(TWI_MASTER_CTL,val)
867#define bfin_read_TWI_MASTER_STAT() bfin_read16(TWI_MASTER_STAT)
868#define bfin_write_TWI_MASTER_STAT(val) bfin_write16(TWI_MASTER_STAT,val)
869#define bfin_read_TWI_MASTER_ADDR() bfin_read16(TWI_MASTER_ADDR)
870#define bfin_write_TWI_MASTER_ADDR(val) bfin_write16(TWI_MASTER_ADDR,val)
871#define bfin_read_TWI_INT_STAT() bfin_read16(TWI_INT_STAT)
872#define bfin_write_TWI_INT_STAT(val) bfin_write16(TWI_INT_STAT,val)
873#define bfin_read_TWI_INT_MASK() bfin_read16(TWI_INT_MASK)
874#define bfin_write_TWI_INT_MASK(val) bfin_write16(TWI_INT_MASK,val)
875#define bfin_read_TWI_FIFO_CTL() bfin_read16(TWI_FIFO_CTL)
876#define bfin_write_TWI_FIFO_CTL(val) bfin_write16(TWI_FIFO_CTL,val)
877#define bfin_read_TWI_FIFO_STAT() bfin_read16(TWI_FIFO_STAT)
878#define bfin_write_TWI_FIFO_STAT(val) bfin_write16(TWI_FIFO_STAT,val)
879#define bfin_read_TWI_XMT_DATA8() bfin_read16(TWI_XMT_DATA8)
880#define bfin_write_TWI_XMT_DATA8(val) bfin_write16(TWI_XMT_DATA8,val)
881#define bfin_read_TWI_XMT_DATA16() bfin_read16(TWI_XMT_DATA16)
882#define bfin_write_TWI_XMT_DATA16(val) bfin_write16(TWI_XMT_DATA16,val)
883#define bfin_read_TWI_RCV_DATA8() bfin_read16(TWI_RCV_DATA8)
884#define bfin_write_TWI_RCV_DATA8(val) bfin_write16(TWI_RCV_DATA8,val)
885#define bfin_read_TWI_RCV_DATA16() bfin_read16(TWI_RCV_DATA16)
886#define bfin_write_TWI_RCV_DATA16(val) bfin_write16(TWI_RCV_DATA16,val)
887
888/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
889#define bfin_read_PORTGIO() bfin_read16(PORTGIO)
890#define bfin_write_PORTGIO(val) bfin_write16(PORTGIO,val)
891#define bfin_read_PORTGIO_CLEAR() bfin_read16(PORTGIO_CLEAR)
892#define bfin_write_PORTGIO_CLEAR(val) bfin_write16(PORTGIO_CLEAR,val)
893#define bfin_read_PORTGIO_SET() bfin_read16(PORTGIO_SET)
894#define bfin_write_PORTGIO_SET(val) bfin_write16(PORTGIO_SET,val)
895#define bfin_read_PORTGIO_TOGGLE() bfin_read16(PORTGIO_TOGGLE)
896#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE,val)
897#define bfin_read_PORTGIO_MASKA() bfin_read16(PORTGIO_MASKA)
898#define bfin_write_PORTGIO_MASKA(val) bfin_write16(PORTGIO_MASKA,val)
899#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
900#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR,val)
901#define bfin_read_PORTGIO_MASKA_SET() bfin_read16(PORTGIO_MASKA_SET)
902#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET,val)
903#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
904#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE,val)
905#define bfin_read_PORTGIO_MASKB() bfin_read16(PORTGIO_MASKB)
906#define bfin_write_PORTGIO_MASKB(val) bfin_write16(PORTGIO_MASKB,val)
907#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
908#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR,val)
909#define bfin_read_PORTGIO_MASKB_SET() bfin_read16(PORTGIO_MASKB_SET)
910#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET,val)
911#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
912#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE,val)
913#define bfin_read_PORTGIO_DIR() bfin_read16(PORTGIO_DIR)
914#define bfin_write_PORTGIO_DIR(val) bfin_write16(PORTGIO_DIR,val)
915#define bfin_read_PORTGIO_POLAR() bfin_read16(PORTGIO_POLAR)
916#define bfin_write_PORTGIO_POLAR(val) bfin_write16(PORTGIO_POLAR,val)
917#define bfin_read_PORTGIO_EDGE() bfin_read16(PORTGIO_EDGE)
918#define bfin_write_PORTGIO_EDGE(val) bfin_write16(PORTGIO_EDGE,val)
919#define bfin_read_PORTGIO_BOTH() bfin_read16(PORTGIO_BOTH)
920#define bfin_write_PORTGIO_BOTH(val) bfin_write16(PORTGIO_BOTH,val)
921#define bfin_read_PORTGIO_INEN() bfin_read16(PORTGIO_INEN)
922#define bfin_write_PORTGIO_INEN(val) bfin_write16(PORTGIO_INEN,val)
923
924/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
925#define bfin_read_PORTHIO() bfin_read16(PORTHIO)
926#define bfin_write_PORTHIO(val) bfin_write16(PORTHIO,val)
927#define bfin_read_PORTHIO_CLEAR() bfin_read16(PORTHIO_CLEAR)
928#define bfin_write_PORTHIO_CLEAR(val) bfin_write16(PORTHIO_CLEAR,val)
929#define bfin_read_PORTHIO_SET() bfin_read16(PORTHIO_SET)
930#define bfin_write_PORTHIO_SET(val) bfin_write16(PORTHIO_SET,val)
931#define bfin_read_PORTHIO_TOGGLE() bfin_read16(PORTHIO_TOGGLE)
932#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE,val)
933#define bfin_read_PORTHIO_MASKA() bfin_read16(PORTHIO_MASKA)
934#define bfin_write_PORTHIO_MASKA(val) bfin_write16(PORTHIO_MASKA,val)
935#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
936#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR,val)
937#define bfin_read_PORTHIO_MASKA_SET() bfin_read16(PORTHIO_MASKA_SET)
938#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET,val)
939#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
940#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE,val)
941#define bfin_read_PORTHIO_MASKB() bfin_read16(PORTHIO_MASKB)
942#define bfin_write_PORTHIO_MASKB(val) bfin_write16(PORTHIO_MASKB,val)
943#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
944#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR,val)
945#define bfin_read_PORTHIO_MASKB_SET() bfin_read16(PORTHIO_MASKB_SET)
946#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET,val)
947#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
948#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE,val)
949#define bfin_read_PORTHIO_DIR() bfin_read16(PORTHIO_DIR)
950#define bfin_write_PORTHIO_DIR(val) bfin_write16(PORTHIO_DIR,val)
951#define bfin_read_PORTHIO_POLAR() bfin_read16(PORTHIO_POLAR)
952#define bfin_write_PORTHIO_POLAR(val) bfin_write16(PORTHIO_POLAR,val)
953#define bfin_read_PORTHIO_EDGE() bfin_read16(PORTHIO_EDGE)
954#define bfin_write_PORTHIO_EDGE(val) bfin_write16(PORTHIO_EDGE,val)
955#define bfin_read_PORTHIO_BOTH() bfin_read16(PORTHIO_BOTH)
956#define bfin_write_PORTHIO_BOTH(val) bfin_write16(PORTHIO_BOTH,val)
957#define bfin_read_PORTHIO_INEN() bfin_read16(PORTHIO_INEN)
958#define bfin_write_PORTHIO_INEN(val) bfin_write16(PORTHIO_INEN,val)
959
960/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
961#define bfin_read_UART1_THR() bfin_read16(UART1_THR)
962#define bfin_write_UART1_THR(val) bfin_write16(UART1_THR,val)
963#define bfin_read_UART1_RBR() bfin_read16(UART1_RBR)
964#define bfin_write_UART1_RBR(val) bfin_write16(UART1_RBR,val)
965#define bfin_read_UART1_DLL() bfin_read16(UART1_DLL)
966#define bfin_write_UART1_DLL(val) bfin_write16(UART1_DLL,val)
967#define bfin_read_UART1_IER() bfin_read16(UART1_IER)
968#define bfin_write_UART1_IER(val) bfin_write16(UART1_IER,val)
969#define bfin_read_UART1_DLH() bfin_read16(UART1_DLH)
970#define bfin_write_UART1_DLH(val) bfin_write16(UART1_DLH,val)
971#define bfin_read_UART1_IIR() bfin_read16(UART1_IIR)
972#define bfin_write_UART1_IIR(val) bfin_write16(UART1_IIR,val)
973#define bfin_read_UART1_LCR() bfin_read16(UART1_LCR)
974#define bfin_write_UART1_LCR(val) bfin_write16(UART1_LCR,val)
975#define bfin_read_UART1_MCR() bfin_read16(UART1_MCR)
976#define bfin_write_UART1_MCR(val) bfin_write16(UART1_MCR,val)
977#define bfin_read_UART1_LSR() bfin_read16(UART1_LSR)
978#define bfin_write_UART1_LSR(val) bfin_write16(UART1_LSR,val)
979#define bfin_read_UART1_MSR() bfin_read16(UART1_MSR)
980#define bfin_write_UART1_MSR(val) bfin_write16(UART1_MSR,val)
981#define bfin_read_UART1_SCR() bfin_read16(UART1_SCR)
982#define bfin_write_UART1_SCR(val) bfin_write16(UART1_SCR,val)
983#define bfin_read_UART1_GCTL() bfin_read16(UART1_GCTL)
984#define bfin_write_UART1_GCTL(val) bfin_write16(UART1_GCTL,val)
985
986/* CAN Controller (0xFFC02A00 - 0xFFC02FFF) */
987/* For Mailboxes 0-15 */
988#define bfin_read_CAN_MC1() bfin_read16(CAN_MC1)
989#define bfin_write_CAN_MC1(val) bfin_write16(CAN_MC1,val)
990#define bfin_read_CAN_MD1() bfin_read16(CAN_MD1)
991#define bfin_write_CAN_MD1(val) bfin_write16(CAN_MD1,val)
992#define bfin_read_CAN_TRS1() bfin_read16(CAN_TRS1)
993#define bfin_write_CAN_TRS1(val) bfin_write16(CAN_TRS1,val)
994#define bfin_read_CAN_TRR1() bfin_read16(CAN_TRR1)
995#define bfin_write_CAN_TRR1(val) bfin_write16(CAN_TRR1,val)
996#define bfin_read_CAN_TA1() bfin_read16(CAN_TA1)
997#define bfin_write_CAN_TA1(val) bfin_write16(CAN_TA1,val)
998#define bfin_read_CAN_AA1() bfin_read16(CAN_AA1)
999#define bfin_write_CAN_AA1(val) bfin_write16(CAN_AA1,val)
1000#define bfin_read_CAN_RMP1() bfin_read16(CAN_RMP1)
1001#define bfin_write_CAN_RMP1(val) bfin_write16(CAN_RMP1,val)
1002#define bfin_read_CAN_RML1() bfin_read16(CAN_RML1)
1003#define bfin_write_CAN_RML1(val) bfin_write16(CAN_RML1,val)
1004#define bfin_read_CAN_MBTIF1() bfin_read16(CAN_MBTIF1)
1005#define bfin_write_CAN_MBTIF1(val) bfin_write16(CAN_MBTIF1,val)
1006#define bfin_read_CAN_MBRIF1() bfin_read16(CAN_MBRIF1)
1007#define bfin_write_CAN_MBRIF1(val) bfin_write16(CAN_MBRIF1,val)
1008#define bfin_read_CAN_MBIM1() bfin_read16(CAN_MBIM1)
1009#define bfin_write_CAN_MBIM1(val) bfin_write16(CAN_MBIM1,val)
1010#define bfin_read_CAN_RFH1() bfin_read16(CAN_RFH1)
1011#define bfin_write_CAN_RFH1(val) bfin_write16(CAN_RFH1,val)
1012#define bfin_read_CAN_OPSS1() bfin_read16(CAN_OPSS1)
1013#define bfin_write_CAN_OPSS1(val) bfin_write16(CAN_OPSS1,val)
1014
1015/* For Mailboxes 16-31 */
1016#define bfin_read_CAN_MC2() bfin_read16(CAN_MC2)
1017#define bfin_write_CAN_MC2(val) bfin_write16(CAN_MC2,val)
1018#define bfin_read_CAN_MD2() bfin_read16(CAN_MD2)
1019#define bfin_write_CAN_MD2(val) bfin_write16(CAN_MD2,val)
1020#define bfin_read_CAN_TRS2() bfin_read16(CAN_TRS2)
1021#define bfin_write_CAN_TRS2(val) bfin_write16(CAN_TRS2,val)
1022#define bfin_read_CAN_TRR2() bfin_read16(CAN_TRR2)
1023#define bfin_write_CAN_TRR2(val) bfin_write16(CAN_TRR2,val)
1024#define bfin_read_CAN_TA2() bfin_read16(CAN_TA2)
1025#define bfin_write_CAN_TA2(val) bfin_write16(CAN_TA2,val)
1026#define bfin_read_CAN_AA2() bfin_read16(CAN_AA2)
1027#define bfin_write_CAN_AA2(val) bfin_write16(CAN_AA2,val)
1028#define bfin_read_CAN_RMP2() bfin_read16(CAN_RMP2)
1029#define bfin_write_CAN_RMP2(val) bfin_write16(CAN_RMP2,val)
1030#define bfin_read_CAN_RML2() bfin_read16(CAN_RML2)
1031#define bfin_write_CAN_RML2(val) bfin_write16(CAN_RML2,val)
1032#define bfin_read_CAN_MBTIF2() bfin_read16(CAN_MBTIF2)
1033#define bfin_write_CAN_MBTIF2(val) bfin_write16(CAN_MBTIF2,val)
1034#define bfin_read_CAN_MBRIF2() bfin_read16(CAN_MBRIF2)
1035#define bfin_write_CAN_MBRIF2(val) bfin_write16(CAN_MBRIF2,val)
1036#define bfin_read_CAN_MBIM2() bfin_read16(CAN_MBIM2)
1037#define bfin_write_CAN_MBIM2(val) bfin_write16(CAN_MBIM2,val)
1038#define bfin_read_CAN_RFH2() bfin_read16(CAN_RFH2)
1039#define bfin_write_CAN_RFH2(val) bfin_write16(CAN_RFH2,val)
1040#define bfin_read_CAN_OPSS2() bfin_read16(CAN_OPSS2)
1041#define bfin_write_CAN_OPSS2(val) bfin_write16(CAN_OPSS2,val)
1042
1043#define bfin_read_CAN_CLOCK() bfin_read16(CAN_CLOCK)
1044#define bfin_write_CAN_CLOCK(val) bfin_write16(CAN_CLOCK,val)
1045#define bfin_read_CAN_TIMING() bfin_read16(CAN_TIMING)
1046#define bfin_write_CAN_TIMING(val) bfin_write16(CAN_TIMING,val)
1047#define bfin_read_CAN_DEBUG() bfin_read16(CAN_DEBUG)
1048#define bfin_write_CAN_DEBUG(val) bfin_write16(CAN_DEBUG,val)
1049#define bfin_read_CAN_STATUS() bfin_read16(CAN_STATUS)
1050#define bfin_write_CAN_STATUS(val) bfin_write16(CAN_STATUS,val)
1051#define bfin_read_CAN_CEC() bfin_read16(CAN_CEC)
1052#define bfin_write_CAN_CEC(val) bfin_write16(CAN_CEC,val)
1053#define bfin_read_CAN_GIS() bfin_read16(CAN_GIS)
1054#define bfin_write_CAN_GIS(val) bfin_write16(CAN_GIS,val)
1055#define bfin_read_CAN_GIM() bfin_read16(CAN_GIM)
1056#define bfin_write_CAN_GIM(val) bfin_write16(CAN_GIM,val)
1057#define bfin_read_CAN_GIF() bfin_read16(CAN_GIF)
1058#define bfin_write_CAN_GIF(val) bfin_write16(CAN_GIF,val)
1059#define bfin_read_CAN_CONTROL() bfin_read16(CAN_CONTROL)
1060#define bfin_write_CAN_CONTROL(val) bfin_write16(CAN_CONTROL,val)
1061#define bfin_read_CAN_INTR() bfin_read16(CAN_INTR)
1062#define bfin_write_CAN_INTR(val) bfin_write16(CAN_INTR,val)
1063#define bfin_read_CAN_SFCMVER() bfin_read16(CAN_SFCMVER)
1064#define bfin_write_CAN_SFCMVER(val) bfin_write16(CAN_SFCMVER,val)
1065#define bfin_read_CAN_MBTD() bfin_read16(CAN_MBTD)
1066#define bfin_write_CAN_MBTD(val) bfin_write16(CAN_MBTD,val)
1067#define bfin_read_CAN_EWR() bfin_read16(CAN_EWR)
1068#define bfin_write_CAN_EWR(val) bfin_write16(CAN_EWR,val)
1069#define bfin_read_CAN_ESR() bfin_read16(CAN_ESR)
1070#define bfin_write_CAN_ESR(val) bfin_write16(CAN_ESR,val)
1071#define bfin_read_CAN_UCREG() bfin_read16(CAN_UCREG)
1072#define bfin_write_CAN_UCREG(val) bfin_write16(CAN_UCREG,val)
1073#define bfin_read_CAN_UCCNT() bfin_read16(CAN_UCCNT)
1074#define bfin_write_CAN_UCCNT(val) bfin_write16(CAN_UCCNT,val)
1075#define bfin_read_CAN_UCRC() bfin_read16(CAN_UCRC)
1076#define bfin_write_CAN_UCRC(val) bfin_write16(CAN_UCRC,val)
1077#define bfin_read_CAN_UCCNF() bfin_read16(CAN_UCCNF)
1078#define bfin_write_CAN_UCCNF(val) bfin_write16(CAN_UCCNF,val)
1079#define bfin_read_CAN_SFCMVER2() bfin_read16(CAN_SFCMVER2)
1080#define bfin_write_CAN_SFCMVER2(val) bfin_write16(CAN_SFCMVER2,val)
1081
1082/* Mailbox Acceptance Masks */
1083#define bfin_read_CAN_AM00L() bfin_read16(CAN_AM00L)
1084#define bfin_write_CAN_AM00L(val) bfin_write16(CAN_AM00L,val)
1085#define bfin_read_CAN_AM00H() bfin_read16(CAN_AM00H)
1086#define bfin_write_CAN_AM00H(val) bfin_write16(CAN_AM00H,val)
1087#define bfin_read_CAN_AM01L() bfin_read16(CAN_AM01L)
1088#define bfin_write_CAN_AM01L(val) bfin_write16(CAN_AM01L,val)
1089#define bfin_read_CAN_AM01H() bfin_read16(CAN_AM01H)
1090#define bfin_write_CAN_AM01H(val) bfin_write16(CAN_AM01H,val)
1091#define bfin_read_CAN_AM02L() bfin_read16(CAN_AM02L)
1092#define bfin_write_CAN_AM02L(val) bfin_write16(CAN_AM02L,val)
1093#define bfin_read_CAN_AM02H() bfin_read16(CAN_AM02H)
1094#define bfin_write_CAN_AM02H(val) bfin_write16(CAN_AM02H,val)
1095#define bfin_read_CAN_AM03L() bfin_read16(CAN_AM03L)
1096#define bfin_write_CAN_AM03L(val) bfin_write16(CAN_AM03L,val)
1097#define bfin_read_CAN_AM03H() bfin_read16(CAN_AM03H)
1098#define bfin_write_CAN_AM03H(val) bfin_write16(CAN_AM03H,val)
1099#define bfin_read_CAN_AM04L() bfin_read16(CAN_AM04L)
1100#define bfin_write_CAN_AM04L(val) bfin_write16(CAN_AM04L,val)
1101#define bfin_read_CAN_AM04H() bfin_read16(CAN_AM04H)
1102#define bfin_write_CAN_AM04H(val) bfin_write16(CAN_AM04H,val)
1103#define bfin_read_CAN_AM05L() bfin_read16(CAN_AM05L)
1104#define bfin_write_CAN_AM05L(val) bfin_write16(CAN_AM05L,val)
1105#define bfin_read_CAN_AM05H() bfin_read16(CAN_AM05H)
1106#define bfin_write_CAN_AM05H(val) bfin_write16(CAN_AM05H,val)
1107#define bfin_read_CAN_AM06L() bfin_read16(CAN_AM06L)
1108#define bfin_write_CAN_AM06L(val) bfin_write16(CAN_AM06L,val)
1109#define bfin_read_CAN_AM06H() bfin_read16(CAN_AM06H)
1110#define bfin_write_CAN_AM06H(val) bfin_write16(CAN_AM06H,val)
1111#define bfin_read_CAN_AM07L() bfin_read16(CAN_AM07L)
1112#define bfin_write_CAN_AM07L(val) bfin_write16(CAN_AM07L,val)
1113#define bfin_read_CAN_AM07H() bfin_read16(CAN_AM07H)
1114#define bfin_write_CAN_AM07H(val) bfin_write16(CAN_AM07H,val)
1115#define bfin_read_CAN_AM08L() bfin_read16(CAN_AM08L)
1116#define bfin_write_CAN_AM08L(val) bfin_write16(CAN_AM08L,val)
1117#define bfin_read_CAN_AM08H() bfin_read16(CAN_AM08H)
1118#define bfin_write_CAN_AM08H(val) bfin_write16(CAN_AM08H,val)
1119#define bfin_read_CAN_AM09L() bfin_read16(CAN_AM09L)
1120#define bfin_write_CAN_AM09L(val) bfin_write16(CAN_AM09L,val)
1121#define bfin_read_CAN_AM09H() bfin_read16(CAN_AM09H)
1122#define bfin_write_CAN_AM09H(val) bfin_write16(CAN_AM09H,val)
1123#define bfin_read_CAN_AM10L() bfin_read16(CAN_AM10L)
1124#define bfin_write_CAN_AM10L(val) bfin_write16(CAN_AM10L,val)
1125#define bfin_read_CAN_AM10H() bfin_read16(CAN_AM10H)
1126#define bfin_write_CAN_AM10H(val) bfin_write16(CAN_AM10H,val)
1127#define bfin_read_CAN_AM11L() bfin_read16(CAN_AM11L)
1128#define bfin_write_CAN_AM11L(val) bfin_write16(CAN_AM11L,val)
1129#define bfin_read_CAN_AM11H() bfin_read16(CAN_AM11H)
1130#define bfin_write_CAN_AM11H(val) bfin_write16(CAN_AM11H,val)
1131#define bfin_read_CAN_AM12L() bfin_read16(CAN_AM12L)
1132#define bfin_write_CAN_AM12L(val) bfin_write16(CAN_AM12L,val)
1133#define bfin_read_CAN_AM12H() bfin_read16(CAN_AM12H)
1134#define bfin_write_CAN_AM12H(val) bfin_write16(CAN_AM12H,val)
1135#define bfin_read_CAN_AM13L() bfin_read16(CAN_AM13L)
1136#define bfin_write_CAN_AM13L(val) bfin_write16(CAN_AM13L,val)
1137#define bfin_read_CAN_AM13H() bfin_read16(CAN_AM13H)
1138#define bfin_write_CAN_AM13H(val) bfin_write16(CAN_AM13H,val)
1139#define bfin_read_CAN_AM14L() bfin_read16(CAN_AM14L)
1140#define bfin_write_CAN_AM14L(val) bfin_write16(CAN_AM14L,val)
1141#define bfin_read_CAN_AM14H() bfin_read16(CAN_AM14H)
1142#define bfin_write_CAN_AM14H(val) bfin_write16(CAN_AM14H,val)
1143#define bfin_read_CAN_AM15L() bfin_read16(CAN_AM15L)
1144#define bfin_write_CAN_AM15L(val) bfin_write16(CAN_AM15L,val)
1145#define bfin_read_CAN_AM15H() bfin_read16(CAN_AM15H)
1146#define bfin_write_CAN_AM15H(val) bfin_write16(CAN_AM15H,val)
1147
1148#define bfin_read_CAN_AM16L() bfin_read16(CAN_AM16L)
1149#define bfin_write_CAN_AM16L(val) bfin_write16(CAN_AM16L,val)
1150#define bfin_read_CAN_AM16H() bfin_read16(CAN_AM16H)
1151#define bfin_write_CAN_AM16H(val) bfin_write16(CAN_AM16H,val)
1152#define bfin_read_CAN_AM17L() bfin_read16(CAN_AM17L)
1153#define bfin_write_CAN_AM17L(val) bfin_write16(CAN_AM17L,val)
1154#define bfin_read_CAN_AM17H() bfin_read16(CAN_AM17H)
1155#define bfin_write_CAN_AM17H(val) bfin_write16(CAN_AM17H,val)
1156#define bfin_read_CAN_AM18L() bfin_read16(CAN_AM18L)
1157#define bfin_write_CAN_AM18L(val) bfin_write16(CAN_AM18L,val)
1158#define bfin_read_CAN_AM18H() bfin_read16(CAN_AM18H)
1159#define bfin_write_CAN_AM18H(val) bfin_write16(CAN_AM18H,val)
1160#define bfin_read_CAN_AM19L() bfin_read16(CAN_AM19L)
1161#define bfin_write_CAN_AM19L(val) bfin_write16(CAN_AM19L,val)
1162#define bfin_read_CAN_AM19H() bfin_read16(CAN_AM19H)
1163#define bfin_write_CAN_AM19H(val) bfin_write16(CAN_AM19H,val)
1164#define bfin_read_CAN_AM20L() bfin_read16(CAN_AM20L)
1165#define bfin_write_CAN_AM20L(val) bfin_write16(CAN_AM20L,val)
1166#define bfin_read_CAN_AM20H() bfin_read16(CAN_AM20H)
1167#define bfin_write_CAN_AM20H(val) bfin_write16(CAN_AM20H,val)
1168#define bfin_read_CAN_AM21L() bfin_read16(CAN_AM21L)
1169#define bfin_write_CAN_AM21L(val) bfin_write16(CAN_AM21L,val)
1170#define bfin_read_CAN_AM21H() bfin_read16(CAN_AM21H)
1171#define bfin_write_CAN_AM21H(val) bfin_write16(CAN_AM21H,val)
1172#define bfin_read_CAN_AM22L() bfin_read16(CAN_AM22L)
1173#define bfin_write_CAN_AM22L(val) bfin_write16(CAN_AM22L,val)
1174#define bfin_read_CAN_AM22H() bfin_read16(CAN_AM22H)
1175#define bfin_write_CAN_AM22H(val) bfin_write16(CAN_AM22H,val)
1176#define bfin_read_CAN_AM23L() bfin_read16(CAN_AM23L)
1177#define bfin_write_CAN_AM23L(val) bfin_write16(CAN_AM23L,val)
1178#define bfin_read_CAN_AM23H() bfin_read16(CAN_AM23H)
1179#define bfin_write_CAN_AM23H(val) bfin_write16(CAN_AM23H,val)
1180#define bfin_read_CAN_AM24L() bfin_read16(CAN_AM24L)
1181#define bfin_write_CAN_AM24L(val) bfin_write16(CAN_AM24L,val)
1182#define bfin_read_CAN_AM24H() bfin_read16(CAN_AM24H)
1183#define bfin_write_CAN_AM24H(val) bfin_write16(CAN_AM24H,val)
1184#define bfin_read_CAN_AM25L() bfin_read16(CAN_AM25L)
1185#define bfin_write_CAN_AM25L(val) bfin_write16(CAN_AM25L,val)
1186#define bfin_read_CAN_AM25H() bfin_read16(CAN_AM25H)
1187#define bfin_write_CAN_AM25H(val) bfin_write16(CAN_AM25H,val)
1188#define bfin_read_CAN_AM26L() bfin_read16(CAN_AM26L)
1189#define bfin_write_CAN_AM26L(val) bfin_write16(CAN_AM26L,val)
1190#define bfin_read_CAN_AM26H() bfin_read16(CAN_AM26H)
1191#define bfin_write_CAN_AM26H(val) bfin_write16(CAN_AM26H,val)
1192#define bfin_read_CAN_AM27L() bfin_read16(CAN_AM27L)
1193#define bfin_write_CAN_AM27L(val) bfin_write16(CAN_AM27L,val)
1194#define bfin_read_CAN_AM27H() bfin_read16(CAN_AM27H)
1195#define bfin_write_CAN_AM27H(val) bfin_write16(CAN_AM27H,val)
1196#define bfin_read_CAN_AM28L() bfin_read16(CAN_AM28L)
1197#define bfin_write_CAN_AM28L(val) bfin_write16(CAN_AM28L,val)
1198#define bfin_read_CAN_AM28H() bfin_read16(CAN_AM28H)
1199#define bfin_write_CAN_AM28H(val) bfin_write16(CAN_AM28H,val)
1200#define bfin_read_CAN_AM29L() bfin_read16(CAN_AM29L)
1201#define bfin_write_CAN_AM29L(val) bfin_write16(CAN_AM29L,val)
1202#define bfin_read_CAN_AM29H() bfin_read16(CAN_AM29H)
1203#define bfin_write_CAN_AM29H(val) bfin_write16(CAN_AM29H,val)
1204#define bfin_read_CAN_AM30L() bfin_read16(CAN_AM30L)
1205#define bfin_write_CAN_AM30L(val) bfin_write16(CAN_AM30L,val)
1206#define bfin_read_CAN_AM30H() bfin_read16(CAN_AM30H)
1207#define bfin_write_CAN_AM30H(val) bfin_write16(CAN_AM30H,val)
1208#define bfin_read_CAN_AM31L() bfin_read16(CAN_AM31L)
1209#define bfin_write_CAN_AM31L(val) bfin_write16(CAN_AM31L,val)
1210#define bfin_read_CAN_AM31H() bfin_read16(CAN_AM31H)
1211#define bfin_write_CAN_AM31H(val) bfin_write16(CAN_AM31H,val)
1212
1213/* CAN Acceptance Mask Area Macros */
1214#define bfin_read_CAN_AM_L(x)() bfin_read16(CAN_AM_L(x))
1215#define bfin_write_CAN_AM_L(x)(val) bfin_write16(CAN_AM_L(x),val)
1216#define bfin_read_CAN_AM_H(x)() bfin_read16(CAN_AM_H(x))
1217#define bfin_write_CAN_AM_H(x)(val) bfin_write16(CAN_AM_H(x),val)
1218
1219/* Mailbox Registers */
1220#define bfin_read_CAN_MB00_ID1() bfin_read16(CAN_MB00_ID1)
1221#define bfin_write_CAN_MB00_ID1(val) bfin_write16(CAN_MB00_ID1,val)
1222#define bfin_read_CAN_MB00_ID0() bfin_read16(CAN_MB00_ID0)
1223#define bfin_write_CAN_MB00_ID0(val) bfin_write16(CAN_MB00_ID0,val)
1224#define bfin_read_CAN_MB00_TIMESTAMP() bfin_read16(CAN_MB00_TIMESTAMP)
1225#define bfin_write_CAN_MB00_TIMESTAMP(val) bfin_write16(CAN_MB00_TIMESTAMP,val)
1226#define bfin_read_CAN_MB00_LENGTH() bfin_read16(CAN_MB00_LENGTH)
1227#define bfin_write_CAN_MB00_LENGTH(val) bfin_write16(CAN_MB00_LENGTH,val)
1228#define bfin_read_CAN_MB00_DATA3() bfin_read16(CAN_MB00_DATA3)
1229#define bfin_write_CAN_MB00_DATA3(val) bfin_write16(CAN_MB00_DATA3,val)
1230#define bfin_read_CAN_MB00_DATA2() bfin_read16(CAN_MB00_DATA2)
1231#define bfin_write_CAN_MB00_DATA2(val) bfin_write16(CAN_MB00_DATA2,val)
1232#define bfin_read_CAN_MB00_DATA1() bfin_read16(CAN_MB00_DATA1)
1233#define bfin_write_CAN_MB00_DATA1(val) bfin_write16(CAN_MB00_DATA1,val)
1234#define bfin_read_CAN_MB00_DATA0() bfin_read16(CAN_MB00_DATA0)
1235#define bfin_write_CAN_MB00_DATA0(val) bfin_write16(CAN_MB00_DATA0,val)
1236
1237#define bfin_read_CAN_MB01_ID1() bfin_read16(CAN_MB01_ID1)
1238#define bfin_write_CAN_MB01_ID1(val) bfin_write16(CAN_MB01_ID1,val)
1239#define bfin_read_CAN_MB01_ID0() bfin_read16(CAN_MB01_ID0)
1240#define bfin_write_CAN_MB01_ID0(val) bfin_write16(CAN_MB01_ID0,val)
1241#define bfin_read_CAN_MB01_TIMESTAMP() bfin_read16(CAN_MB01_TIMESTAMP)
1242#define bfin_write_CAN_MB01_TIMESTAMP(val) bfin_write16(CAN_MB01_TIMESTAMP,val)
1243#define bfin_read_CAN_MB01_LENGTH() bfin_read16(CAN_MB01_LENGTH)
1244#define bfin_write_CAN_MB01_LENGTH(val) bfin_write16(CAN_MB01_LENGTH,val)
1245#define bfin_read_CAN_MB01_DATA3() bfin_read16(CAN_MB01_DATA3)
1246#define bfin_write_CAN_MB01_DATA3(val) bfin_write16(CAN_MB01_DATA3,val)
1247#define bfin_read_CAN_MB01_DATA2() bfin_read16(CAN_MB01_DATA2)
1248#define bfin_write_CAN_MB01_DATA2(val) bfin_write16(CAN_MB01_DATA2,val)
1249#define bfin_read_CAN_MB01_DATA1() bfin_read16(CAN_MB01_DATA1)
1250#define bfin_write_CAN_MB01_DATA1(val) bfin_write16(CAN_MB01_DATA1,val)
1251#define bfin_read_CAN_MB01_DATA0() bfin_read16(CAN_MB01_DATA0)
1252#define bfin_write_CAN_MB01_DATA0(val) bfin_write16(CAN_MB01_DATA0,val)
1253
1254#define bfin_read_CAN_MB02_ID1() bfin_read16(CAN_MB02_ID1)
1255#define bfin_write_CAN_MB02_ID1(val) bfin_write16(CAN_MB02_ID1,val)
1256#define bfin_read_CAN_MB02_ID0() bfin_read16(CAN_MB02_ID0)
1257#define bfin_write_CAN_MB02_ID0(val) bfin_write16(CAN_MB02_ID0,val)
1258#define bfin_read_CAN_MB02_TIMESTAMP() bfin_read16(CAN_MB02_TIMESTAMP)
1259#define bfin_write_CAN_MB02_TIMESTAMP(val) bfin_write16(CAN_MB02_TIMESTAMP,val)
1260#define bfin_read_CAN_MB02_LENGTH() bfin_read16(CAN_MB02_LENGTH)
1261#define bfin_write_CAN_MB02_LENGTH(val) bfin_write16(CAN_MB02_LENGTH,val)
1262#define bfin_read_CAN_MB02_DATA3() bfin_read16(CAN_MB02_DATA3)
1263#define bfin_write_CAN_MB02_DATA3(val) bfin_write16(CAN_MB02_DATA3,val)
1264#define bfin_read_CAN_MB02_DATA2() bfin_read16(CAN_MB02_DATA2)
1265#define bfin_write_CAN_MB02_DATA2(val) bfin_write16(CAN_MB02_DATA2,val)
1266#define bfin_read_CAN_MB02_DATA1() bfin_read16(CAN_MB02_DATA1)
1267#define bfin_write_CAN_MB02_DATA1(val) bfin_write16(CAN_MB02_DATA1,val)
1268#define bfin_read_CAN_MB02_DATA0() bfin_read16(CAN_MB02_DATA0)
1269#define bfin_write_CAN_MB02_DATA0(val) bfin_write16(CAN_MB02_DATA0,val)
1270
1271#define bfin_read_CAN_MB03_ID1() bfin_read16(CAN_MB03_ID1)
1272#define bfin_write_CAN_MB03_ID1(val) bfin_write16(CAN_MB03_ID1,val)
1273#define bfin_read_CAN_MB03_ID0() bfin_read16(CAN_MB03_ID0)
1274#define bfin_write_CAN_MB03_ID0(val) bfin_write16(CAN_MB03_ID0,val)
1275#define bfin_read_CAN_MB03_TIMESTAMP() bfin_read16(CAN_MB03_TIMESTAMP)
1276#define bfin_write_CAN_MB03_TIMESTAMP(val) bfin_write16(CAN_MB03_TIMESTAMP,val)
1277#define bfin_read_CAN_MB03_LENGTH() bfin_read16(CAN_MB03_LENGTH)
1278#define bfin_write_CAN_MB03_LENGTH(val) bfin_write16(CAN_MB03_LENGTH,val)
1279#define bfin_read_CAN_MB03_DATA3() bfin_read16(CAN_MB03_DATA3)
1280#define bfin_write_CAN_MB03_DATA3(val) bfin_write16(CAN_MB03_DATA3,val)
1281#define bfin_read_CAN_MB03_DATA2() bfin_read16(CAN_MB03_DATA2)
1282#define bfin_write_CAN_MB03_DATA2(val) bfin_write16(CAN_MB03_DATA2,val)
1283#define bfin_read_CAN_MB03_DATA1() bfin_read16(CAN_MB03_DATA1)
1284#define bfin_write_CAN_MB03_DATA1(val) bfin_write16(CAN_MB03_DATA1,val)
1285#define bfin_read_CAN_MB03_DATA0() bfin_read16(CAN_MB03_DATA0)
1286#define bfin_write_CAN_MB03_DATA0(val) bfin_write16(CAN_MB03_DATA0,val)
1287
1288#define bfin_read_CAN_MB04_ID1() bfin_read16(CAN_MB04_ID1)
1289#define bfin_write_CAN_MB04_ID1(val) bfin_write16(CAN_MB04_ID1,val)
1290#define bfin_read_CAN_MB04_ID0() bfin_read16(CAN_MB04_ID0)
1291#define bfin_write_CAN_MB04_ID0(val) bfin_write16(CAN_MB04_ID0,val)
1292#define bfin_read_CAN_MB04_TIMESTAMP() bfin_read16(CAN_MB04_TIMESTAMP)
1293#define bfin_write_CAN_MB04_TIMESTAMP(val) bfin_write16(CAN_MB04_TIMESTAMP,val)
1294#define bfin_read_CAN_MB04_LENGTH() bfin_read16(CAN_MB04_LENGTH)
1295#define bfin_write_CAN_MB04_LENGTH(val) bfin_write16(CAN_MB04_LENGTH,val)
1296#define bfin_read_CAN_MB04_DATA3() bfin_read16(CAN_MB04_DATA3)
1297#define bfin_write_CAN_MB04_DATA3(val) bfin_write16(CAN_MB04_DATA3,val)
1298#define bfin_read_CAN_MB04_DATA2() bfin_read16(CAN_MB04_DATA2)
1299#define bfin_write_CAN_MB04_DATA2(val) bfin_write16(CAN_MB04_DATA2,val)
1300#define bfin_read_CAN_MB04_DATA1() bfin_read16(CAN_MB04_DATA1)
1301#define bfin_write_CAN_MB04_DATA1(val) bfin_write16(CAN_MB04_DATA1,val)
1302#define bfin_read_CAN_MB04_DATA0() bfin_read16(CAN_MB04_DATA0)
1303#define bfin_write_CAN_MB04_DATA0(val) bfin_write16(CAN_MB04_DATA0,val)
1304
1305#define bfin_read_CAN_MB05_ID1() bfin_read16(CAN_MB05_ID1)
1306#define bfin_write_CAN_MB05_ID1(val) bfin_write16(CAN_MB05_ID1,val)
1307#define bfin_read_CAN_MB05_ID0() bfin_read16(CAN_MB05_ID0)
1308#define bfin_write_CAN_MB05_ID0(val) bfin_write16(CAN_MB05_ID0,val)
1309#define bfin_read_CAN_MB05_TIMESTAMP() bfin_read16(CAN_MB05_TIMESTAMP)
1310#define bfin_write_CAN_MB05_TIMESTAMP(val) bfin_write16(CAN_MB05_TIMESTAMP,val)
1311#define bfin_read_CAN_MB05_LENGTH() bfin_read16(CAN_MB05_LENGTH)
1312#define bfin_write_CAN_MB05_LENGTH(val) bfin_write16(CAN_MB05_LENGTH,val)
1313#define bfin_read_CAN_MB05_DATA3() bfin_read16(CAN_MB05_DATA3)
1314#define bfin_write_CAN_MB05_DATA3(val) bfin_write16(CAN_MB05_DATA3,val)
1315#define bfin_read_CAN_MB05_DATA2() bfin_read16(CAN_MB05_DATA2)
1316#define bfin_write_CAN_MB05_DATA2(val) bfin_write16(CAN_MB05_DATA2,val)
1317#define bfin_read_CAN_MB05_DATA1() bfin_read16(CAN_MB05_DATA1)
1318#define bfin_write_CAN_MB05_DATA1(val) bfin_write16(CAN_MB05_DATA1,val)
1319#define bfin_read_CAN_MB05_DATA0() bfin_read16(CAN_MB05_DATA0)
1320#define bfin_write_CAN_MB05_DATA0(val) bfin_write16(CAN_MB05_DATA0,val)
1321
1322#define bfin_read_CAN_MB06_ID1() bfin_read16(CAN_MB06_ID1)
1323#define bfin_write_CAN_MB06_ID1(val) bfin_write16(CAN_MB06_ID1,val)
1324#define bfin_read_CAN_MB06_ID0() bfin_read16(CAN_MB06_ID0)
1325#define bfin_write_CAN_MB06_ID0(val) bfin_write16(CAN_MB06_ID0,val)
1326#define bfin_read_CAN_MB06_TIMESTAMP() bfin_read16(CAN_MB06_TIMESTAMP)
1327#define bfin_write_CAN_MB06_TIMESTAMP(val) bfin_write16(CAN_MB06_TIMESTAMP,val)
1328#define bfin_read_CAN_MB06_LENGTH() bfin_read16(CAN_MB06_LENGTH)
1329#define bfin_write_CAN_MB06_LENGTH(val) bfin_write16(CAN_MB06_LENGTH,val)
1330#define bfin_read_CAN_MB06_DATA3() bfin_read16(CAN_MB06_DATA3)
1331#define bfin_write_CAN_MB06_DATA3(val) bfin_write16(CAN_MB06_DATA3,val)
1332#define bfin_read_CAN_MB06_DATA2() bfin_read16(CAN_MB06_DATA2)
1333#define bfin_write_CAN_MB06_DATA2(val) bfin_write16(CAN_MB06_DATA2,val)
1334#define bfin_read_CAN_MB06_DATA1() bfin_read16(CAN_MB06_DATA1)
1335#define bfin_write_CAN_MB06_DATA1(val) bfin_write16(CAN_MB06_DATA1,val)
1336#define bfin_read_CAN_MB06_DATA0() bfin_read16(CAN_MB06_DATA0)
1337#define bfin_write_CAN_MB06_DATA0(val) bfin_write16(CAN_MB06_DATA0,val)
1338
1339#define bfin_read_CAN_MB07_ID1() bfin_read16(CAN_MB07_ID1)
1340#define bfin_write_CAN_MB07_ID1(val) bfin_write16(CAN_MB07_ID1,val)
1341#define bfin_read_CAN_MB07_ID0() bfin_read16(CAN_MB07_ID0)
1342#define bfin_write_CAN_MB07_ID0(val) bfin_write16(CAN_MB07_ID0,val)
1343#define bfin_read_CAN_MB07_TIMESTAMP() bfin_read16(CAN_MB07_TIMESTAMP)
1344#define bfin_write_CAN_MB07_TIMESTAMP(val) bfin_write16(CAN_MB07_TIMESTAMP,val)
1345#define bfin_read_CAN_MB07_LENGTH() bfin_read16(CAN_MB07_LENGTH)
1346#define bfin_write_CAN_MB07_LENGTH(val) bfin_write16(CAN_MB07_LENGTH,val)
1347#define bfin_read_CAN_MB07_DATA3() bfin_read16(CAN_MB07_DATA3)
1348#define bfin_write_CAN_MB07_DATA3(val) bfin_write16(CAN_MB07_DATA3,val)
1349#define bfin_read_CAN_MB07_DATA2() bfin_read16(CAN_MB07_DATA2)
1350#define bfin_write_CAN_MB07_DATA2(val) bfin_write16(CAN_MB07_DATA2,val)
1351#define bfin_read_CAN_MB07_DATA1() bfin_read16(CAN_MB07_DATA1)
1352#define bfin_write_CAN_MB07_DATA1(val) bfin_write16(CAN_MB07_DATA1,val)
1353#define bfin_read_CAN_MB07_DATA0() bfin_read16(CAN_MB07_DATA0)
1354#define bfin_write_CAN_MB07_DATA0(val) bfin_write16(CAN_MB07_DATA0,val)
1355
1356#define bfin_read_CAN_MB08_ID1() bfin_read16(CAN_MB08_ID1)
1357#define bfin_write_CAN_MB08_ID1(val) bfin_write16(CAN_MB08_ID1,val)
1358#define bfin_read_CAN_MB08_ID0() bfin_read16(CAN_MB08_ID0)
1359#define bfin_write_CAN_MB08_ID0(val) bfin_write16(CAN_MB08_ID0,val)
1360#define bfin_read_CAN_MB08_TIMESTAMP() bfin_read16(CAN_MB08_TIMESTAMP)
1361#define bfin_write_CAN_MB08_TIMESTAMP(val) bfin_write16(CAN_MB08_TIMESTAMP,val)
1362#define bfin_read_CAN_MB08_LENGTH() bfin_read16(CAN_MB08_LENGTH)
1363#define bfin_write_CAN_MB08_LENGTH(val) bfin_write16(CAN_MB08_LENGTH,val)
1364#define bfin_read_CAN_MB08_DATA3() bfin_read16(CAN_MB08_DATA3)
1365#define bfin_write_CAN_MB08_DATA3(val) bfin_write16(CAN_MB08_DATA3,val)
1366#define bfin_read_CAN_MB08_DATA2() bfin_read16(CAN_MB08_DATA2)
1367#define bfin_write_CAN_MB08_DATA2(val) bfin_write16(CAN_MB08_DATA2,val)
1368#define bfin_read_CAN_MB08_DATA1() bfin_read16(CAN_MB08_DATA1)
1369#define bfin_write_CAN_MB08_DATA1(val) bfin_write16(CAN_MB08_DATA1,val)
1370#define bfin_read_CAN_MB08_DATA0() bfin_read16(CAN_MB08_DATA0)
1371#define bfin_write_CAN_MB08_DATA0(val) bfin_write16(CAN_MB08_DATA0,val)
1372
1373#define bfin_read_CAN_MB09_ID1() bfin_read16(CAN_MB09_ID1)
1374#define bfin_write_CAN_MB09_ID1(val) bfin_write16(CAN_MB09_ID1,val)
1375#define bfin_read_CAN_MB09_ID0() bfin_read16(CAN_MB09_ID0)
1376#define bfin_write_CAN_MB09_ID0(val) bfin_write16(CAN_MB09_ID0,val)
1377#define bfin_read_CAN_MB09_TIMESTAMP() bfin_read16(CAN_MB09_TIMESTAMP)
1378#define bfin_write_CAN_MB09_TIMESTAMP(val) bfin_write16(CAN_MB09_TIMESTAMP,val)
1379#define bfin_read_CAN_MB09_LENGTH() bfin_read16(CAN_MB09_LENGTH)
1380#define bfin_write_CAN_MB09_LENGTH(val) bfin_write16(CAN_MB09_LENGTH,val)
1381#define bfin_read_CAN_MB09_DATA3() bfin_read16(CAN_MB09_DATA3)
1382#define bfin_write_CAN_MB09_DATA3(val) bfin_write16(CAN_MB09_DATA3,val)
1383#define bfin_read_CAN_MB09_DATA2() bfin_read16(CAN_MB09_DATA2)
1384#define bfin_write_CAN_MB09_DATA2(val) bfin_write16(CAN_MB09_DATA2,val)
1385#define bfin_read_CAN_MB09_DATA1() bfin_read16(CAN_MB09_DATA1)
1386#define bfin_write_CAN_MB09_DATA1(val) bfin_write16(CAN_MB09_DATA1,val)
1387#define bfin_read_CAN_MB09_DATA0() bfin_read16(CAN_MB09_DATA0)
1388#define bfin_write_CAN_MB09_DATA0(val) bfin_write16(CAN_MB09_DATA0,val)
1389
1390#define bfin_read_CAN_MB10_ID1() bfin_read16(CAN_MB10_ID1)
1391#define bfin_write_CAN_MB10_ID1(val) bfin_write16(CAN_MB10_ID1,val)
1392#define bfin_read_CAN_MB10_ID0() bfin_read16(CAN_MB10_ID0)
1393#define bfin_write_CAN_MB10_ID0(val) bfin_write16(CAN_MB10_ID0,val)
1394#define bfin_read_CAN_MB10_TIMESTAMP() bfin_read16(CAN_MB10_TIMESTAMP)
1395#define bfin_write_CAN_MB10_TIMESTAMP(val) bfin_write16(CAN_MB10_TIMESTAMP,val)
1396#define bfin_read_CAN_MB10_LENGTH() bfin_read16(CAN_MB10_LENGTH)
1397#define bfin_write_CAN_MB10_LENGTH(val) bfin_write16(CAN_MB10_LENGTH,val)
1398#define bfin_read_CAN_MB10_DATA3() bfin_read16(CAN_MB10_DATA3)
1399#define bfin_write_CAN_MB10_DATA3(val) bfin_write16(CAN_MB10_DATA3,val)
1400#define bfin_read_CAN_MB10_DATA2() bfin_read16(CAN_MB10_DATA2)
1401#define bfin_write_CAN_MB10_DATA2(val) bfin_write16(CAN_MB10_DATA2,val)
1402#define bfin_read_CAN_MB10_DATA1() bfin_read16(CAN_MB10_DATA1)
1403#define bfin_write_CAN_MB10_DATA1(val) bfin_write16(CAN_MB10_DATA1,val)
1404#define bfin_read_CAN_MB10_DATA0() bfin_read16(CAN_MB10_DATA0)
1405#define bfin_write_CAN_MB10_DATA0(val) bfin_write16(CAN_MB10_DATA0,val)
1406
1407#define bfin_read_CAN_MB11_ID1() bfin_read16(CAN_MB11_ID1)
1408#define bfin_write_CAN_MB11_ID1(val) bfin_write16(CAN_MB11_ID1,val)
1409#define bfin_read_CAN_MB11_ID0() bfin_read16(CAN_MB11_ID0)
1410#define bfin_write_CAN_MB11_ID0(val) bfin_write16(CAN_MB11_ID0,val)
1411#define bfin_read_CAN_MB11_TIMESTAMP() bfin_read16(CAN_MB11_TIMESTAMP)
1412#define bfin_write_CAN_MB11_TIMESTAMP(val) bfin_write16(CAN_MB11_TIMESTAMP,val)
1413#define bfin_read_CAN_MB11_LENGTH() bfin_read16(CAN_MB11_LENGTH)
1414#define bfin_write_CAN_MB11_LENGTH(val) bfin_write16(CAN_MB11_LENGTH,val)
1415#define bfin_read_CAN_MB11_DATA3() bfin_read16(CAN_MB11_DATA3)
1416#define bfin_write_CAN_MB11_DATA3(val) bfin_write16(CAN_MB11_DATA3,val)
1417#define bfin_read_CAN_MB11_DATA2() bfin_read16(CAN_MB11_DATA2)
1418#define bfin_write_CAN_MB11_DATA2(val) bfin_write16(CAN_MB11_DATA2,val)
1419#define bfin_read_CAN_MB11_DATA1() bfin_read16(CAN_MB11_DATA1)
1420#define bfin_write_CAN_MB11_DATA1(val) bfin_write16(CAN_MB11_DATA1,val)
1421#define bfin_read_CAN_MB11_DATA0() bfin_read16(CAN_MB11_DATA0)
1422#define bfin_write_CAN_MB11_DATA0(val) bfin_write16(CAN_MB11_DATA0,val)
1423
1424#define bfin_read_CAN_MB12_ID1() bfin_read16(CAN_MB12_ID1)
1425#define bfin_write_CAN_MB12_ID1(val) bfin_write16(CAN_MB12_ID1,val)
1426#define bfin_read_CAN_MB12_ID0() bfin_read16(CAN_MB12_ID0)
1427#define bfin_write_CAN_MB12_ID0(val) bfin_write16(CAN_MB12_ID0,val)
1428#define bfin_read_CAN_MB12_TIMESTAMP() bfin_read16(CAN_MB12_TIMESTAMP)
1429#define bfin_write_CAN_MB12_TIMESTAMP(val) bfin_write16(CAN_MB12_TIMESTAMP,val)
1430#define bfin_read_CAN_MB12_LENGTH() bfin_read16(CAN_MB12_LENGTH)
1431#define bfin_write_CAN_MB12_LENGTH(val) bfin_write16(CAN_MB12_LENGTH,val)
1432#define bfin_read_CAN_MB12_DATA3() bfin_read16(CAN_MB12_DATA3)
1433#define bfin_write_CAN_MB12_DATA3(val) bfin_write16(CAN_MB12_DATA3,val)
1434#define bfin_read_CAN_MB12_DATA2() bfin_read16(CAN_MB12_DATA2)
1435#define bfin_write_CAN_MB12_DATA2(val) bfin_write16(CAN_MB12_DATA2,val)
1436#define bfin_read_CAN_MB12_DATA1() bfin_read16(CAN_MB12_DATA1)
1437#define bfin_write_CAN_MB12_DATA1(val) bfin_write16(CAN_MB12_DATA1,val)
1438#define bfin_read_CAN_MB12_DATA0() bfin_read16(CAN_MB12_DATA0)
1439#define bfin_write_CAN_MB12_DATA0(val) bfin_write16(CAN_MB12_DATA0,val)
1440
1441#define bfin_read_CAN_MB13_ID1() bfin_read16(CAN_MB13_ID1)
1442#define bfin_write_CAN_MB13_ID1(val) bfin_write16(CAN_MB13_ID1,val)
1443#define bfin_read_CAN_MB13_ID0() bfin_read16(CAN_MB13_ID0)
1444#define bfin_write_CAN_MB13_ID0(val) bfin_write16(CAN_MB13_ID0,val)
1445#define bfin_read_CAN_MB13_TIMESTAMP() bfin_read16(CAN_MB13_TIMESTAMP)
1446#define bfin_write_CAN_MB13_TIMESTAMP(val) bfin_write16(CAN_MB13_TIMESTAMP,val)
1447#define bfin_read_CAN_MB13_LENGTH() bfin_read16(CAN_MB13_LENGTH)
1448#define bfin_write_CAN_MB13_LENGTH(val) bfin_write16(CAN_MB13_LENGTH,val)
1449#define bfin_read_CAN_MB13_DATA3() bfin_read16(CAN_MB13_DATA3)
1450#define bfin_write_CAN_MB13_DATA3(val) bfin_write16(CAN_MB13_DATA3,val)
1451#define bfin_read_CAN_MB13_DATA2() bfin_read16(CAN_MB13_DATA2)
1452#define bfin_write_CAN_MB13_DATA2(val) bfin_write16(CAN_MB13_DATA2,val)
1453#define bfin_read_CAN_MB13_DATA1() bfin_read16(CAN_MB13_DATA1)
1454#define bfin_write_CAN_MB13_DATA1(val) bfin_write16(CAN_MB13_DATA1,val)
1455#define bfin_read_CAN_MB13_DATA0() bfin_read16(CAN_MB13_DATA0)
1456#define bfin_write_CAN_MB13_DATA0(val) bfin_write16(CAN_MB13_DATA0,val)
1457
1458#define bfin_read_CAN_MB14_ID1() bfin_read16(CAN_MB14_ID1)
1459#define bfin_write_CAN_MB14_ID1(val) bfin_write16(CAN_MB14_ID1,val)
1460#define bfin_read_CAN_MB14_ID0() bfin_read16(CAN_MB14_ID0)
1461#define bfin_write_CAN_MB14_ID0(val) bfin_write16(CAN_MB14_ID0,val)
1462#define bfin_read_CAN_MB14_TIMESTAMP() bfin_read16(CAN_MB14_TIMESTAMP)
1463#define bfin_write_CAN_MB14_TIMESTAMP(val) bfin_write16(CAN_MB14_TIMESTAMP,val)
1464#define bfin_read_CAN_MB14_LENGTH() bfin_read16(CAN_MB14_LENGTH)
1465#define bfin_write_CAN_MB14_LENGTH(val) bfin_write16(CAN_MB14_LENGTH,val)
1466#define bfin_read_CAN_MB14_DATA3() bfin_read16(CAN_MB14_DATA3)
1467#define bfin_write_CAN_MB14_DATA3(val) bfin_write16(CAN_MB14_DATA3,val)
1468#define bfin_read_CAN_MB14_DATA2() bfin_read16(CAN_MB14_DATA2)
1469#define bfin_write_CAN_MB14_DATA2(val) bfin_write16(CAN_MB14_DATA2,val)
1470#define bfin_read_CAN_MB14_DATA1() bfin_read16(CAN_MB14_DATA1)
1471#define bfin_write_CAN_MB14_DATA1(val) bfin_write16(CAN_MB14_DATA1,val)
1472#define bfin_read_CAN_MB14_DATA0() bfin_read16(CAN_MB14_DATA0)
1473#define bfin_write_CAN_MB14_DATA0(val) bfin_write16(CAN_MB14_DATA0,val)
1474
1475#define bfin_read_CAN_MB15_ID1() bfin_read16(CAN_MB15_ID1)
1476#define bfin_write_CAN_MB15_ID1(val) bfin_write16(CAN_MB15_ID1,val)
1477#define bfin_read_CAN_MB15_ID0() bfin_read16(CAN_MB15_ID0)
1478#define bfin_write_CAN_MB15_ID0(val) bfin_write16(CAN_MB15_ID0,val)
1479#define bfin_read_CAN_MB15_TIMESTAMP() bfin_read16(CAN_MB15_TIMESTAMP)
1480#define bfin_write_CAN_MB15_TIMESTAMP(val) bfin_write16(CAN_MB15_TIMESTAMP,val)
1481#define bfin_read_CAN_MB15_LENGTH() bfin_read16(CAN_MB15_LENGTH)
1482#define bfin_write_CAN_MB15_LENGTH(val) bfin_write16(CAN_MB15_LENGTH,val)
1483#define bfin_read_CAN_MB15_DATA3() bfin_read16(CAN_MB15_DATA3)
1484#define bfin_write_CAN_MB15_DATA3(val) bfin_write16(CAN_MB15_DATA3,val)
1485#define bfin_read_CAN_MB15_DATA2() bfin_read16(CAN_MB15_DATA2)
1486#define bfin_write_CAN_MB15_DATA2(val) bfin_write16(CAN_MB15_DATA2,val)
1487#define bfin_read_CAN_MB15_DATA1() bfin_read16(CAN_MB15_DATA1)
1488#define bfin_write_CAN_MB15_DATA1(val) bfin_write16(CAN_MB15_DATA1,val)
1489#define bfin_read_CAN_MB15_DATA0() bfin_read16(CAN_MB15_DATA0)
1490#define bfin_write_CAN_MB15_DATA0(val) bfin_write16(CAN_MB15_DATA0,val)
1491
1492#define bfin_read_CAN_MB16_ID1() bfin_read16(CAN_MB16_ID1)
1493#define bfin_write_CAN_MB16_ID1(val) bfin_write16(CAN_MB16_ID1,val)
1494#define bfin_read_CAN_MB16_ID0() bfin_read16(CAN_MB16_ID0)
1495#define bfin_write_CAN_MB16_ID0(val) bfin_write16(CAN_MB16_ID0,val)
1496#define bfin_read_CAN_MB16_TIMESTAMP() bfin_read16(CAN_MB16_TIMESTAMP)
1497#define bfin_write_CAN_MB16_TIMESTAMP(val) bfin_write16(CAN_MB16_TIMESTAMP,val)
1498#define bfin_read_CAN_MB16_LENGTH() bfin_read16(CAN_MB16_LENGTH)
1499#define bfin_write_CAN_MB16_LENGTH(val) bfin_write16(CAN_MB16_LENGTH,val)
1500#define bfin_read_CAN_MB16_DATA3() bfin_read16(CAN_MB16_DATA3)
1501#define bfin_write_CAN_MB16_DATA3(val) bfin_write16(CAN_MB16_DATA3,val)
1502#define bfin_read_CAN_MB16_DATA2() bfin_read16(CAN_MB16_DATA2)
1503#define bfin_write_CAN_MB16_DATA2(val) bfin_write16(CAN_MB16_DATA2,val)
1504#define bfin_read_CAN_MB16_DATA1() bfin_read16(CAN_MB16_DATA1)
1505#define bfin_write_CAN_MB16_DATA1(val) bfin_write16(CAN_MB16_DATA1,val)
1506#define bfin_read_CAN_MB16_DATA0() bfin_read16(CAN_MB16_DATA0)
1507#define bfin_write_CAN_MB16_DATA0(val) bfin_write16(CAN_MB16_DATA0,val)
1508
1509#define bfin_read_CAN_MB17_ID1() bfin_read16(CAN_MB17_ID1)
1510#define bfin_write_CAN_MB17_ID1(val) bfin_write16(CAN_MB17_ID1,val)
1511#define bfin_read_CAN_MB17_ID0() bfin_read16(CAN_MB17_ID0)
1512#define bfin_write_CAN_MB17_ID0(val) bfin_write16(CAN_MB17_ID0,val)
1513#define bfin_read_CAN_MB17_TIMESTAMP() bfin_read16(CAN_MB17_TIMESTAMP)
1514#define bfin_write_CAN_MB17_TIMESTAMP(val) bfin_write16(CAN_MB17_TIMESTAMP,val)
1515#define bfin_read_CAN_MB17_LENGTH() bfin_read16(CAN_MB17_LENGTH)
1516#define bfin_write_CAN_MB17_LENGTH(val) bfin_write16(CAN_MB17_LENGTH,val)
1517#define bfin_read_CAN_MB17_DATA3() bfin_read16(CAN_MB17_DATA3)
1518#define bfin_write_CAN_MB17_DATA3(val) bfin_write16(CAN_MB17_DATA3,val)
1519#define bfin_read_CAN_MB17_DATA2() bfin_read16(CAN_MB17_DATA2)
1520#define bfin_write_CAN_MB17_DATA2(val) bfin_write16(CAN_MB17_DATA2,val)
1521#define bfin_read_CAN_MB17_DATA1() bfin_read16(CAN_MB17_DATA1)
1522#define bfin_write_CAN_MB17_DATA1(val) bfin_write16(CAN_MB17_DATA1,val)
1523#define bfin_read_CAN_MB17_DATA0() bfin_read16(CAN_MB17_DATA0)
1524#define bfin_write_CAN_MB17_DATA0(val) bfin_write16(CAN_MB17_DATA0,val)
1525
1526#define bfin_read_CAN_MB18_ID1() bfin_read16(CAN_MB18_ID1)
1527#define bfin_write_CAN_MB18_ID1(val) bfin_write16(CAN_MB18_ID1,val)
1528#define bfin_read_CAN_MB18_ID0() bfin_read16(CAN_MB18_ID0)
1529#define bfin_write_CAN_MB18_ID0(val) bfin_write16(CAN_MB18_ID0,val)
1530#define bfin_read_CAN_MB18_TIMESTAMP() bfin_read16(CAN_MB18_TIMESTAMP)
1531#define bfin_write_CAN_MB18_TIMESTAMP(val) bfin_write16(CAN_MB18_TIMESTAMP,val)
1532#define bfin_read_CAN_MB18_LENGTH() bfin_read16(CAN_MB18_LENGTH)
1533#define bfin_write_CAN_MB18_LENGTH(val) bfin_write16(CAN_MB18_LENGTH,val)
1534#define bfin_read_CAN_MB18_DATA3() bfin_read16(CAN_MB18_DATA3)
1535#define bfin_write_CAN_MB18_DATA3(val) bfin_write16(CAN_MB18_DATA3,val)
1536#define bfin_read_CAN_MB18_DATA2() bfin_read16(CAN_MB18_DATA2)
1537#define bfin_write_CAN_MB18_DATA2(val) bfin_write16(CAN_MB18_DATA2,val)
1538#define bfin_read_CAN_MB18_DATA1() bfin_read16(CAN_MB18_DATA1)
1539#define bfin_write_CAN_MB18_DATA1(val) bfin_write16(CAN_MB18_DATA1,val)
1540#define bfin_read_CAN_MB18_DATA0() bfin_read16(CAN_MB18_DATA0)
1541#define bfin_write_CAN_MB18_DATA0(val) bfin_write16(CAN_MB18_DATA0,val)
1542
1543#define bfin_read_CAN_MB19_ID1() bfin_read16(CAN_MB19_ID1)
1544#define bfin_write_CAN_MB19_ID1(val) bfin_write16(CAN_MB19_ID1,val)
1545#define bfin_read_CAN_MB19_ID0() bfin_read16(CAN_MB19_ID0)
1546#define bfin_write_CAN_MB19_ID0(val) bfin_write16(CAN_MB19_ID0,val)
1547#define bfin_read_CAN_MB19_TIMESTAMP() bfin_read16(CAN_MB19_TIMESTAMP)
1548#define bfin_write_CAN_MB19_TIMESTAMP(val) bfin_write16(CAN_MB19_TIMESTAMP,val)
1549#define bfin_read_CAN_MB19_LENGTH() bfin_read16(CAN_MB19_LENGTH)
1550#define bfin_write_CAN_MB19_LENGTH(val) bfin_write16(CAN_MB19_LENGTH,val)
1551#define bfin_read_CAN_MB19_DATA3() bfin_read16(CAN_MB19_DATA3)
1552#define bfin_write_CAN_MB19_DATA3(val) bfin_write16(CAN_MB19_DATA3,val)
1553#define bfin_read_CAN_MB19_DATA2() bfin_read16(CAN_MB19_DATA2)
1554#define bfin_write_CAN_MB19_DATA2(val) bfin_write16(CAN_MB19_DATA2,val)
1555#define bfin_read_CAN_MB19_DATA1() bfin_read16(CAN_MB19_DATA1)
1556#define bfin_write_CAN_MB19_DATA1(val) bfin_write16(CAN_MB19_DATA1,val)
1557#define bfin_read_CAN_MB19_DATA0() bfin_read16(CAN_MB19_DATA0)
1558#define bfin_write_CAN_MB19_DATA0(val) bfin_write16(CAN_MB19_DATA0,val)
1559
1560#define bfin_read_CAN_MB20_ID1() bfin_read16(CAN_MB20_ID1)
1561#define bfin_write_CAN_MB20_ID1(val) bfin_write16(CAN_MB20_ID1,val)
1562#define bfin_read_CAN_MB20_ID0() bfin_read16(CAN_MB20_ID0)
1563#define bfin_write_CAN_MB20_ID0(val) bfin_write16(CAN_MB20_ID0,val)
1564#define bfin_read_CAN_MB20_TIMESTAMP() bfin_read16(CAN_MB20_TIMESTAMP)
1565#define bfin_write_CAN_MB20_TIMESTAMP(val) bfin_write16(CAN_MB20_TIMESTAMP,val)
1566#define bfin_read_CAN_MB20_LENGTH() bfin_read16(CAN_MB20_LENGTH)
1567#define bfin_write_CAN_MB20_LENGTH(val) bfin_write16(CAN_MB20_LENGTH,val)
1568#define bfin_read_CAN_MB20_DATA3() bfin_read16(CAN_MB20_DATA3)
1569#define bfin_write_CAN_MB20_DATA3(val) bfin_write16(CAN_MB20_DATA3,val)
1570#define bfin_read_CAN_MB20_DATA2() bfin_read16(CAN_MB20_DATA2)
1571#define bfin_write_CAN_MB20_DATA2(val) bfin_write16(CAN_MB20_DATA2,val)
1572#define bfin_read_CAN_MB20_DATA1() bfin_read16(CAN_MB20_DATA1)
1573#define bfin_write_CAN_MB20_DATA1(val) bfin_write16(CAN_MB20_DATA1,val)
1574#define bfin_read_CAN_MB20_DATA0() bfin_read16(CAN_MB20_DATA0)
1575#define bfin_write_CAN_MB20_DATA0(val) bfin_write16(CAN_MB20_DATA0,val)
1576
1577#define bfin_read_CAN_MB21_ID1() bfin_read16(CAN_MB21_ID1)
1578#define bfin_write_CAN_MB21_ID1(val) bfin_write16(CAN_MB21_ID1,val)
1579#define bfin_read_CAN_MB21_ID0() bfin_read16(CAN_MB21_ID0)
1580#define bfin_write_CAN_MB21_ID0(val) bfin_write16(CAN_MB21_ID0,val)
1581#define bfin_read_CAN_MB21_TIMESTAMP() bfin_read16(CAN_MB21_TIMESTAMP)
1582#define bfin_write_CAN_MB21_TIMESTAMP(val) bfin_write16(CAN_MB21_TIMESTAMP,val)
1583#define bfin_read_CAN_MB21_LENGTH() bfin_read16(CAN_MB21_LENGTH)
1584#define bfin_write_CAN_MB21_LENGTH(val) bfin_write16(CAN_MB21_LENGTH,val)
1585#define bfin_read_CAN_MB21_DATA3() bfin_read16(CAN_MB21_DATA3)
1586#define bfin_write_CAN_MB21_DATA3(val) bfin_write16(CAN_MB21_DATA3,val)
1587#define bfin_read_CAN_MB21_DATA2() bfin_read16(CAN_MB21_DATA2)
1588#define bfin_write_CAN_MB21_DATA2(val) bfin_write16(CAN_MB21_DATA2,val)
1589#define bfin_read_CAN_MB21_DATA1() bfin_read16(CAN_MB21_DATA1)
1590#define bfin_write_CAN_MB21_DATA1(val) bfin_write16(CAN_MB21_DATA1,val)
1591#define bfin_read_CAN_MB21_DATA0() bfin_read16(CAN_MB21_DATA0)
1592#define bfin_write_CAN_MB21_DATA0(val) bfin_write16(CAN_MB21_DATA0,val)
1593
1594#define bfin_read_CAN_MB22_ID1() bfin_read16(CAN_MB22_ID1)
1595#define bfin_write_CAN_MB22_ID1(val) bfin_write16(CAN_MB22_ID1,val)
1596#define bfin_read_CAN_MB22_ID0() bfin_read16(CAN_MB22_ID0)
1597#define bfin_write_CAN_MB22_ID0(val) bfin_write16(CAN_MB22_ID0,val)
1598#define bfin_read_CAN_MB22_TIMESTAMP() bfin_read16(CAN_MB22_TIMESTAMP)
1599#define bfin_write_CAN_MB22_TIMESTAMP(val) bfin_write16(CAN_MB22_TIMESTAMP,val)
1600#define bfin_read_CAN_MB22_LENGTH() bfin_read16(CAN_MB22_LENGTH)
1601#define bfin_write_CAN_MB22_LENGTH(val) bfin_write16(CAN_MB22_LENGTH,val)
1602#define bfin_read_CAN_MB22_DATA3() bfin_read16(CAN_MB22_DATA3)
1603#define bfin_write_CAN_MB22_DATA3(val) bfin_write16(CAN_MB22_DATA3,val)
1604#define bfin_read_CAN_MB22_DATA2() bfin_read16(CAN_MB22_DATA2)
1605#define bfin_write_CAN_MB22_DATA2(val) bfin_write16(CAN_MB22_DATA2,val)
1606#define bfin_read_CAN_MB22_DATA1() bfin_read16(CAN_MB22_DATA1)
1607#define bfin_write_CAN_MB22_DATA1(val) bfin_write16(CAN_MB22_DATA1,val)
1608#define bfin_read_CAN_MB22_DATA0() bfin_read16(CAN_MB22_DATA0)
1609#define bfin_write_CAN_MB22_DATA0(val) bfin_write16(CAN_MB22_DATA0,val)
1610
1611#define bfin_read_CAN_MB23_ID1() bfin_read16(CAN_MB23_ID1)
1612#define bfin_write_CAN_MB23_ID1(val) bfin_write16(CAN_MB23_ID1,val)
1613#define bfin_read_CAN_MB23_ID0() bfin_read16(CAN_MB23_ID0)
1614#define bfin_write_CAN_MB23_ID0(val) bfin_write16(CAN_MB23_ID0,val)
1615#define bfin_read_CAN_MB23_TIMESTAMP() bfin_read16(CAN_MB23_TIMESTAMP)
1616#define bfin_write_CAN_MB23_TIMESTAMP(val) bfin_write16(CAN_MB23_TIMESTAMP,val)
1617#define bfin_read_CAN_MB23_LENGTH() bfin_read16(CAN_MB23_LENGTH)
1618#define bfin_write_CAN_MB23_LENGTH(val) bfin_write16(CAN_MB23_LENGTH,val)
1619#define bfin_read_CAN_MB23_DATA3() bfin_read16(CAN_MB23_DATA3)
1620#define bfin_write_CAN_MB23_DATA3(val) bfin_write16(CAN_MB23_DATA3,val)
1621#define bfin_read_CAN_MB23_DATA2() bfin_read16(CAN_MB23_DATA2)
1622#define bfin_write_CAN_MB23_DATA2(val) bfin_write16(CAN_MB23_DATA2,val)
1623#define bfin_read_CAN_MB23_DATA1() bfin_read16(CAN_MB23_DATA1)
1624#define bfin_write_CAN_MB23_DATA1(val) bfin_write16(CAN_MB23_DATA1,val)
1625#define bfin_read_CAN_MB23_DATA0() bfin_read16(CAN_MB23_DATA0)
1626#define bfin_write_CAN_MB23_DATA0(val) bfin_write16(CAN_MB23_DATA0,val)
1627
1628#define bfin_read_CAN_MB24_ID1() bfin_read16(CAN_MB24_ID1)
1629#define bfin_write_CAN_MB24_ID1(val) bfin_write16(CAN_MB24_ID1,val)
1630#define bfin_read_CAN_MB24_ID0() bfin_read16(CAN_MB24_ID0)
1631#define bfin_write_CAN_MB24_ID0(val) bfin_write16(CAN_MB24_ID0,val)
1632#define bfin_read_CAN_MB24_TIMESTAMP() bfin_read16(CAN_MB24_TIMESTAMP)
1633#define bfin_write_CAN_MB24_TIMESTAMP(val) bfin_write16(CAN_MB24_TIMESTAMP,val)
1634#define bfin_read_CAN_MB24_LENGTH() bfin_read16(CAN_MB24_LENGTH)
1635#define bfin_write_CAN_MB24_LENGTH(val) bfin_write16(CAN_MB24_LENGTH,val)
1636#define bfin_read_CAN_MB24_DATA3() bfin_read16(CAN_MB24_DATA3)
1637#define bfin_write_CAN_MB24_DATA3(val) bfin_write16(CAN_MB24_DATA3,val)
1638#define bfin_read_CAN_MB24_DATA2() bfin_read16(CAN_MB24_DATA2)
1639#define bfin_write_CAN_MB24_DATA2(val) bfin_write16(CAN_MB24_DATA2,val)
1640#define bfin_read_CAN_MB24_DATA1() bfin_read16(CAN_MB24_DATA1)
1641#define bfin_write_CAN_MB24_DATA1(val) bfin_write16(CAN_MB24_DATA1,val)
1642#define bfin_read_CAN_MB24_DATA0() bfin_read16(CAN_MB24_DATA0)
1643#define bfin_write_CAN_MB24_DATA0(val) bfin_write16(CAN_MB24_DATA0,val)
1644
1645#define bfin_read_CAN_MB25_ID1() bfin_read16(CAN_MB25_ID1)
1646#define bfin_write_CAN_MB25_ID1(val) bfin_write16(CAN_MB25_ID1,val)
1647#define bfin_read_CAN_MB25_ID0() bfin_read16(CAN_MB25_ID0)
1648#define bfin_write_CAN_MB25_ID0(val) bfin_write16(CAN_MB25_ID0,val)
1649#define bfin_read_CAN_MB25_TIMESTAMP() bfin_read16(CAN_MB25_TIMESTAMP)
1650#define bfin_write_CAN_MB25_TIMESTAMP(val) bfin_write16(CAN_MB25_TIMESTAMP,val)
1651#define bfin_read_CAN_MB25_LENGTH() bfin_read16(CAN_MB25_LENGTH)
1652#define bfin_write_CAN_MB25_LENGTH(val) bfin_write16(CAN_MB25_LENGTH,val)
1653#define bfin_read_CAN_MB25_DATA3() bfin_read16(CAN_MB25_DATA3)
1654#define bfin_write_CAN_MB25_DATA3(val) bfin_write16(CAN_MB25_DATA3,val)
1655#define bfin_read_CAN_MB25_DATA2() bfin_read16(CAN_MB25_DATA2)
1656#define bfin_write_CAN_MB25_DATA2(val) bfin_write16(CAN_MB25_DATA2,val)
1657#define bfin_read_CAN_MB25_DATA1() bfin_read16(CAN_MB25_DATA1)
1658#define bfin_write_CAN_MB25_DATA1(val) bfin_write16(CAN_MB25_DATA1,val)
1659#define bfin_read_CAN_MB25_DATA0() bfin_read16(CAN_MB25_DATA0)
1660#define bfin_write_CAN_MB25_DATA0(val) bfin_write16(CAN_MB25_DATA0,val)
1661
1662#define bfin_read_CAN_MB26_ID1() bfin_read16(CAN_MB26_ID1)
1663#define bfin_write_CAN_MB26_ID1(val) bfin_write16(CAN_MB26_ID1,val)
1664#define bfin_read_CAN_MB26_ID0() bfin_read16(CAN_MB26_ID0)
1665#define bfin_write_CAN_MB26_ID0(val) bfin_write16(CAN_MB26_ID0,val)
1666#define bfin_read_CAN_MB26_TIMESTAMP() bfin_read16(CAN_MB26_TIMESTAMP)
1667#define bfin_write_CAN_MB26_TIMESTAMP(val) bfin_write16(CAN_MB26_TIMESTAMP,val)
1668#define bfin_read_CAN_MB26_LENGTH() bfin_read16(CAN_MB26_LENGTH)
1669#define bfin_write_CAN_MB26_LENGTH(val) bfin_write16(CAN_MB26_LENGTH,val)
1670#define bfin_read_CAN_MB26_DATA3() bfin_read16(CAN_MB26_DATA3)
1671#define bfin_write_CAN_MB26_DATA3(val) bfin_write16(CAN_MB26_DATA3,val)
1672#define bfin_read_CAN_MB26_DATA2() bfin_read16(CAN_MB26_DATA2)
1673#define bfin_write_CAN_MB26_DATA2(val) bfin_write16(CAN_MB26_DATA2,val)
1674#define bfin_read_CAN_MB26_DATA1() bfin_read16(CAN_MB26_DATA1)
1675#define bfin_write_CAN_MB26_DATA1(val) bfin_write16(CAN_MB26_DATA1,val)
1676#define bfin_read_CAN_MB26_DATA0() bfin_read16(CAN_MB26_DATA0)
1677#define bfin_write_CAN_MB26_DATA0(val) bfin_write16(CAN_MB26_DATA0,val)
1678
1679#define bfin_read_CAN_MB27_ID1() bfin_read16(CAN_MB27_ID1)
1680#define bfin_write_CAN_MB27_ID1(val) bfin_write16(CAN_MB27_ID1,val)
1681#define bfin_read_CAN_MB27_ID0() bfin_read16(CAN_MB27_ID0)
1682#define bfin_write_CAN_MB27_ID0(val) bfin_write16(CAN_MB27_ID0,val)
1683#define bfin_read_CAN_MB27_TIMESTAMP() bfin_read16(CAN_MB27_TIMESTAMP)
1684#define bfin_write_CAN_MB27_TIMESTAMP(val) bfin_write16(CAN_MB27_TIMESTAMP,val)
1685#define bfin_read_CAN_MB27_LENGTH() bfin_read16(CAN_MB27_LENGTH)
1686#define bfin_write_CAN_MB27_LENGTH(val) bfin_write16(CAN_MB27_LENGTH,val)
1687#define bfin_read_CAN_MB27_DATA3() bfin_read16(CAN_MB27_DATA3)
1688#define bfin_write_CAN_MB27_DATA3(val) bfin_write16(CAN_MB27_DATA3,val)
1689#define bfin_read_CAN_MB27_DATA2() bfin_read16(CAN_MB27_DATA2)
1690#define bfin_write_CAN_MB27_DATA2(val) bfin_write16(CAN_MB27_DATA2,val)
1691#define bfin_read_CAN_MB27_DATA1() bfin_read16(CAN_MB27_DATA1)
1692#define bfin_write_CAN_MB27_DATA1(val) bfin_write16(CAN_MB27_DATA1,val)
1693#define bfin_read_CAN_MB27_DATA0() bfin_read16(CAN_MB27_DATA0)
1694#define bfin_write_CAN_MB27_DATA0(val) bfin_write16(CAN_MB27_DATA0,val)
1695
1696#define bfin_read_CAN_MB28_ID1() bfin_read16(CAN_MB28_ID1)
1697#define bfin_write_CAN_MB28_ID1(val) bfin_write16(CAN_MB28_ID1,val)
1698#define bfin_read_CAN_MB28_ID0() bfin_read16(CAN_MB28_ID0)
1699#define bfin_write_CAN_MB28_ID0(val) bfin_write16(CAN_MB28_ID0,val)
1700#define bfin_read_CAN_MB28_TIMESTAMP() bfin_read16(CAN_MB28_TIMESTAMP)
1701#define bfin_write_CAN_MB28_TIMESTAMP(val) bfin_write16(CAN_MB28_TIMESTAMP,val)
1702#define bfin_read_CAN_MB28_LENGTH() bfin_read16(CAN_MB28_LENGTH)
1703#define bfin_write_CAN_MB28_LENGTH(val) bfin_write16(CAN_MB28_LENGTH,val)
1704#define bfin_read_CAN_MB28_DATA3() bfin_read16(CAN_MB28_DATA3)
1705#define bfin_write_CAN_MB28_DATA3(val) bfin_write16(CAN_MB28_DATA3,val)
1706#define bfin_read_CAN_MB28_DATA2() bfin_read16(CAN_MB28_DATA2)
1707#define bfin_write_CAN_MB28_DATA2(val) bfin_write16(CAN_MB28_DATA2,val)
1708#define bfin_read_CAN_MB28_DATA1() bfin_read16(CAN_MB28_DATA1)
1709#define bfin_write_CAN_MB28_DATA1(val) bfin_write16(CAN_MB28_DATA1,val)
1710#define bfin_read_CAN_MB28_DATA0() bfin_read16(CAN_MB28_DATA0)
1711#define bfin_write_CAN_MB28_DATA0(val) bfin_write16(CAN_MB28_DATA0,val)
1712
1713#define bfin_read_CAN_MB29_ID1() bfin_read16(CAN_MB29_ID1)
1714#define bfin_write_CAN_MB29_ID1(val) bfin_write16(CAN_MB29_ID1,val)
1715#define bfin_read_CAN_MB29_ID0() bfin_read16(CAN_MB29_ID0)
1716#define bfin_write_CAN_MB29_ID0(val) bfin_write16(CAN_MB29_ID0,val)
1717#define bfin_read_CAN_MB29_TIMESTAMP() bfin_read16(CAN_MB29_TIMESTAMP)
1718#define bfin_write_CAN_MB29_TIMESTAMP(val) bfin_write16(CAN_MB29_TIMESTAMP,val)
1719#define bfin_read_CAN_MB29_LENGTH() bfin_read16(CAN_MB29_LENGTH)
1720#define bfin_write_CAN_MB29_LENGTH(val) bfin_write16(CAN_MB29_LENGTH,val)
1721#define bfin_read_CAN_MB29_DATA3() bfin_read16(CAN_MB29_DATA3)
1722#define bfin_write_CAN_MB29_DATA3(val) bfin_write16(CAN_MB29_DATA3,val)
1723#define bfin_read_CAN_MB29_DATA2() bfin_read16(CAN_MB29_DATA2)
1724#define bfin_write_CAN_MB29_DATA2(val) bfin_write16(CAN_MB29_DATA2,val)
1725#define bfin_read_CAN_MB29_DATA1() bfin_read16(CAN_MB29_DATA1)
1726#define bfin_write_CAN_MB29_DATA1(val) bfin_write16(CAN_MB29_DATA1,val)
1727#define bfin_read_CAN_MB29_DATA0() bfin_read16(CAN_MB29_DATA0)
1728#define bfin_write_CAN_MB29_DATA0(val) bfin_write16(CAN_MB29_DATA0,val)
1729
1730#define bfin_read_CAN_MB30_ID1() bfin_read16(CAN_MB30_ID1)
1731#define bfin_write_CAN_MB30_ID1(val) bfin_write16(CAN_MB30_ID1,val)
1732#define bfin_read_CAN_MB30_ID0() bfin_read16(CAN_MB30_ID0)
1733#define bfin_write_CAN_MB30_ID0(val) bfin_write16(CAN_MB30_ID0,val)
1734#define bfin_read_CAN_MB30_TIMESTAMP() bfin_read16(CAN_MB30_TIMESTAMP)
1735#define bfin_write_CAN_MB30_TIMESTAMP(val) bfin_write16(CAN_MB30_TIMESTAMP,val)
1736#define bfin_read_CAN_MB30_LENGTH() bfin_read16(CAN_MB30_LENGTH)
1737#define bfin_write_CAN_MB30_LENGTH(val) bfin_write16(CAN_MB30_LENGTH,val)
1738#define bfin_read_CAN_MB30_DATA3() bfin_read16(CAN_MB30_DATA3)
1739#define bfin_write_CAN_MB30_DATA3(val) bfin_write16(CAN_MB30_DATA3,val)
1740#define bfin_read_CAN_MB30_DATA2() bfin_read16(CAN_MB30_DATA2)
1741#define bfin_write_CAN_MB30_DATA2(val) bfin_write16(CAN_MB30_DATA2,val)
1742#define bfin_read_CAN_MB30_DATA1() bfin_read16(CAN_MB30_DATA1)
1743#define bfin_write_CAN_MB30_DATA1(val) bfin_write16(CAN_MB30_DATA1,val)
1744#define bfin_read_CAN_MB30_DATA0() bfin_read16(CAN_MB30_DATA0)
1745#define bfin_write_CAN_MB30_DATA0(val) bfin_write16(CAN_MB30_DATA0,val)
1746
1747#define bfin_read_CAN_MB31_ID1() bfin_read16(CAN_MB31_ID1)
1748#define bfin_write_CAN_MB31_ID1(val) bfin_write16(CAN_MB31_ID1,val)
1749#define bfin_read_CAN_MB31_ID0() bfin_read16(CAN_MB31_ID0)
1750#define bfin_write_CAN_MB31_ID0(val) bfin_write16(CAN_MB31_ID0,val)
1751#define bfin_read_CAN_MB31_TIMESTAMP() bfin_read16(CAN_MB31_TIMESTAMP)
1752#define bfin_write_CAN_MB31_TIMESTAMP(val) bfin_write16(CAN_MB31_TIMESTAMP,val)
1753#define bfin_read_CAN_MB31_LENGTH() bfin_read16(CAN_MB31_LENGTH)
1754#define bfin_write_CAN_MB31_LENGTH(val) bfin_write16(CAN_MB31_LENGTH,val)
1755#define bfin_read_CAN_MB31_DATA3() bfin_read16(CAN_MB31_DATA3)
1756#define bfin_write_CAN_MB31_DATA3(val) bfin_write16(CAN_MB31_DATA3,val)
1757#define bfin_read_CAN_MB31_DATA2() bfin_read16(CAN_MB31_DATA2)
1758#define bfin_write_CAN_MB31_DATA2(val) bfin_write16(CAN_MB31_DATA2,val)
1759#define bfin_read_CAN_MB31_DATA1() bfin_read16(CAN_MB31_DATA1)
1760#define bfin_write_CAN_MB31_DATA1(val) bfin_write16(CAN_MB31_DATA1,val)
1761#define bfin_read_CAN_MB31_DATA0() bfin_read16(CAN_MB31_DATA0)
1762#define bfin_write_CAN_MB31_DATA0(val) bfin_write16(CAN_MB31_DATA0,val)
1763
1764/* CAN Mailbox Area Macros */
1765#define bfin_read_CAN_MB_ID1(x)() bfin_read16(CAN_MB_ID1(x))
1766#define bfin_write_CAN_MB_ID1(x)(val) bfin_write16(CAN_MB_ID1(x),val)
1767#define bfin_read_CAN_MB_ID0(x)() bfin_read16(CAN_MB_ID0(x))
1768#define bfin_write_CAN_MB_ID0(x)(val) bfin_write16(CAN_MB_ID0(x),val)
1769#define bfin_read_CAN_MB_TIMESTAMP(x)() bfin_read16(CAN_MB_TIMESTAMP(x))
1770#define bfin_write_CAN_MB_TIMESTAMP(x)(val) bfin_write16(CAN_MB_TIMESTAMP(x),val)
1771#define bfin_read_CAN_MB_LENGTH(x)() bfin_read16(CAN_MB_LENGTH(x))
1772#define bfin_write_CAN_MB_LENGTH(x)(val) bfin_write16(CAN_MB_LENGTH(x),val)
1773#define bfin_read_CAN_MB_DATA3(x)() bfin_read16(CAN_MB_DATA3(x))
1774#define bfin_write_CAN_MB_DATA3(x)(val) bfin_write16(CAN_MB_DATA3(x),val)
1775#define bfin_read_CAN_MB_DATA2(x)() bfin_read16(CAN_MB_DATA2(x))
1776#define bfin_write_CAN_MB_DATA2(x)(val) bfin_write16(CAN_MB_DATA2(x),val)
1777#define bfin_read_CAN_MB_DATA1(x)() bfin_read16(CAN_MB_DATA1(x))
1778#define bfin_write_CAN_MB_DATA1(x)(val) bfin_write16(CAN_MB_DATA1(x),val)
1779#define bfin_read_CAN_MB_DATA0(x)() bfin_read16(CAN_MB_DATA0(x))
1780#define bfin_write_CAN_MB_DATA0(x)(val) bfin_write16(CAN_MB_DATA0(x),val)
1781
1782/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
1783#define bfin_read_PORTF_FER() bfin_read16(PORTF_FER)
1784#define bfin_write_PORTF_FER(val) bfin_write16(PORTF_FER,val)
1785#define bfin_read_PORTG_FER() bfin_read16(PORTG_FER)
1786#define bfin_write_PORTG_FER(val) bfin_write16(PORTG_FER,val)
1787#define bfin_read_PORTH_FER() bfin_read16(PORTH_FER)
1788#define bfin_write_PORTH_FER(val) bfin_write16(PORTH_FER,val)
1789#define bfin_read_PORT_MUX() bfin_read16(BFIN_PORT_MUX)
1790#define bfin_write_PORT_MUX(val) bfin_write16(BFIN_PORT_MUX,val)
1791
1792/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
1793#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
1794#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL,val)
1795#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
1796#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT,val)
1797#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
1798#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT,val)
1799#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
1800#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT,val)
1801#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
1802#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW,val)
1803#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
1804#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT,val)
1805#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
1806#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT,val)
1807
1808#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
1809#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL,val)
1810#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
1811#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT,val)
1812#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
1813#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT,val)
1814#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
1815#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT,val)
1816#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
1817#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW,val)
1818#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
1819#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT,val)
1820#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1821#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT,val)
1822
1823#endif /* _CDEF_BF534_H */
diff --git a/include/asm-blackfin/mach-bf537/cdefBF537.h b/include/asm-blackfin/mach-bf537/cdefBF537.h
new file mode 100644
index 000000000000..932a1b6b5d14
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/cdefBF537.h
@@ -0,0 +1,209 @@
1/*
2 * File: include/asm-blackfin/mach-bf537/cdefBF537.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 * System MMR Register Map
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _CDEF_BF537_H
33#define _CDEF_BF537_H
34
35/* Include MMRs Common to BF534 */
36#include "cdefBF534.h"
37
38/* Include all Core registers and bit definitions */
39#include "defBF537.h"
40
41/* Include Macro "Defines" For EMAC (Unique to BF536/BF537 */
42/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
43#define pEMAC_OPMODE ((volatile unsigned long *)EMAC_OPMODE)
44#define bfin_read_EMAC_OPMODE() bfin_read32(EMAC_OPMODE)
45#define bfin_write_EMAC_OPMODE(val) bfin_write32(EMAC_OPMODE,val)
46#define bfin_read_EMAC_ADDRLO() bfin_read32(EMAC_ADDRLO)
47#define bfin_write_EMAC_ADDRLO(val) bfin_write32(EMAC_ADDRLO,val)
48#define bfin_read_EMAC_ADDRHI() bfin_read32(EMAC_ADDRHI)
49#define bfin_write_EMAC_ADDRHI(val) bfin_write32(EMAC_ADDRHI,val)
50#define bfin_read_EMAC_HASHLO() bfin_read32(EMAC_HASHLO)
51#define bfin_write_EMAC_HASHLO(val) bfin_write32(EMAC_HASHLO,val)
52#define bfin_read_EMAC_HASHHI() bfin_read32(EMAC_HASHHI)
53#define bfin_write_EMAC_HASHHI(val) bfin_write32(EMAC_HASHHI,val)
54#define bfin_read_EMAC_STAADD() bfin_read32(EMAC_STAADD)
55#define bfin_write_EMAC_STAADD(val) bfin_write32(EMAC_STAADD,val)
56#define bfin_read_EMAC_STADAT() bfin_read32(EMAC_STADAT)
57#define bfin_write_EMAC_STADAT(val) bfin_write32(EMAC_STADAT,val)
58#define bfin_read_EMAC_FLC() bfin_read32(EMAC_FLC)
59#define bfin_write_EMAC_FLC(val) bfin_write32(EMAC_FLC,val)
60#define bfin_read_EMAC_VLAN1() bfin_read32(EMAC_VLAN1)
61#define bfin_write_EMAC_VLAN1(val) bfin_write32(EMAC_VLAN1,val)
62#define bfin_read_EMAC_VLAN2() bfin_read32(EMAC_VLAN2)
63#define bfin_write_EMAC_VLAN2(val) bfin_write32(EMAC_VLAN2,val)
64#define bfin_read_EMAC_WKUP_CTL() bfin_read32(EMAC_WKUP_CTL)
65#define bfin_write_EMAC_WKUP_CTL(val) bfin_write32(EMAC_WKUP_CTL,val)
66#define bfin_read_EMAC_WKUP_FFMSK0() bfin_read32(EMAC_WKUP_FFMSK0)
67#define bfin_write_EMAC_WKUP_FFMSK0(val) bfin_write32(EMAC_WKUP_FFMSK0,val)
68#define bfin_read_EMAC_WKUP_FFMSK1() bfin_read32(EMAC_WKUP_FFMSK1)
69#define bfin_write_EMAC_WKUP_FFMSK1(val) bfin_write32(EMAC_WKUP_FFMSK1,val)
70#define bfin_read_EMAC_WKUP_FFMSK2() bfin_read32(EMAC_WKUP_FFMSK2)
71#define bfin_write_EMAC_WKUP_FFMSK2(val) bfin_write32(EMAC_WKUP_FFMSK2,val)
72#define bfin_read_EMAC_WKUP_FFMSK3() bfin_read32(EMAC_WKUP_FFMSK3)
73#define bfin_write_EMAC_WKUP_FFMSK3(val) bfin_write32(EMAC_WKUP_FFMSK3,val)
74#define bfin_read_EMAC_WKUP_FFCMD() bfin_read32(EMAC_WKUP_FFCMD)
75#define bfin_write_EMAC_WKUP_FFCMD(val) bfin_write32(EMAC_WKUP_FFCMD,val)
76#define bfin_read_EMAC_WKUP_FFOFF() bfin_read32(EMAC_WKUP_FFOFF)
77#define bfin_write_EMAC_WKUP_FFOFF(val) bfin_write32(EMAC_WKUP_FFOFF,val)
78#define bfin_read_EMAC_WKUP_FFCRC0() bfin_read32(EMAC_WKUP_FFCRC0)
79#define bfin_write_EMAC_WKUP_FFCRC0(val) bfin_write32(EMAC_WKUP_FFCRC0,val)
80#define bfin_read_EMAC_WKUP_FFCRC1() bfin_read32(EMAC_WKUP_FFCRC1)
81#define bfin_write_EMAC_WKUP_FFCRC1(val) bfin_write32(EMAC_WKUP_FFCRC1,val)
82
83#define pEMAC_SYSCTL ((volatile unsigned long *)EMAC_SYSCTL)
84#define bfin_read_EMAC_SYSCTL() bfin_read32(EMAC_SYSCTL)
85#define bfin_write_EMAC_SYSCTL(val) bfin_write32(EMAC_SYSCTL,val)
86#define bfin_read_EMAC_SYSTAT() bfin_read32(EMAC_SYSTAT)
87#define bfin_write_EMAC_SYSTAT(val) bfin_write32(EMAC_SYSTAT,val)
88#define bfin_read_EMAC_RX_STAT() bfin_read32(EMAC_RX_STAT)
89#define bfin_write_EMAC_RX_STAT(val) bfin_write32(EMAC_RX_STAT,val)
90#define bfin_read_EMAC_RX_STKY() bfin_read32(EMAC_RX_STKY)
91#define bfin_write_EMAC_RX_STKY(val) bfin_write32(EMAC_RX_STKY,val)
92#define bfin_read_EMAC_RX_IRQE() bfin_read32(EMAC_RX_IRQE)
93#define bfin_write_EMAC_RX_IRQE(val) bfin_write32(EMAC_RX_IRQE,val)
94#define bfin_read_EMAC_TX_STAT() bfin_read32(EMAC_TX_STAT)
95#define bfin_write_EMAC_TX_STAT(val) bfin_write32(EMAC_TX_STAT,val)
96#define bfin_read_EMAC_TX_STKY() bfin_read32(EMAC_TX_STKY)
97#define bfin_write_EMAC_TX_STKY(val) bfin_write32(EMAC_TX_STKY,val)
98#define bfin_read_EMAC_TX_IRQE() bfin_read32(EMAC_TX_IRQE)
99#define bfin_write_EMAC_TX_IRQE(val) bfin_write32(EMAC_TX_IRQE,val)
100
101#define bfin_read_EMAC_MMC_CTL() bfin_read32(EMAC_MMC_CTL)
102#define bfin_write_EMAC_MMC_CTL(val) bfin_write32(EMAC_MMC_CTL,val)
103#define bfin_read_EMAC_MMC_RIRQS() bfin_read32(EMAC_MMC_RIRQS)
104#define bfin_write_EMAC_MMC_RIRQS(val) bfin_write32(EMAC_MMC_RIRQS,val)
105#define bfin_read_EMAC_MMC_RIRQE() bfin_read32(EMAC_MMC_RIRQE)
106#define bfin_write_EMAC_MMC_RIRQE(val) bfin_write32(EMAC_MMC_RIRQE,val)
107#define bfin_read_EMAC_MMC_TIRQS() bfin_read32(EMAC_MMC_TIRQS)
108#define bfin_write_EMAC_MMC_TIRQS(val) bfin_write32(EMAC_MMC_TIRQS,val)
109#define bfin_read_EMAC_MMC_TIRQE() bfin_read32(EMAC_MMC_TIRQE)
110#define bfin_write_EMAC_MMC_TIRQE(val) bfin_write32(EMAC_MMC_TIRQE,val)
111
112#define bfin_read_EMAC_RXC_OK() bfin_read32(EMAC_RXC_OK)
113#define bfin_write_EMAC_RXC_OK(val) bfin_write32(EMAC_RXC_OK,val)
114#define bfin_read_EMAC_RXC_FCS() bfin_read32(EMAC_RXC_FCS)
115#define bfin_write_EMAC_RXC_FCS(val) bfin_write32(EMAC_RXC_FCS,val)
116#define bfin_read_EMAC_RXC_ALIGN() bfin_read32(EMAC_RXC_ALIGN)
117#define bfin_write_EMAC_RXC_ALIGN(val) bfin_write32(EMAC_RXC_ALIGN,val)
118#define bfin_read_EMAC_RXC_OCTET() bfin_read32(EMAC_RXC_OCTET)
119#define bfin_write_EMAC_RXC_OCTET(val) bfin_write32(EMAC_RXC_OCTET,val)
120#define bfin_read_EMAC_RXC_DMAOVF() bfin_read32(EMAC_RXC_DMAOVF)
121#define bfin_write_EMAC_RXC_DMAOVF(val) bfin_write32(EMAC_RXC_DMAOVF,val)
122#define bfin_read_EMAC_RXC_UNICST() bfin_read32(EMAC_RXC_UNICST)
123#define bfin_write_EMAC_RXC_UNICST(val) bfin_write32(EMAC_RXC_UNICST,val)
124#define bfin_read_EMAC_RXC_MULTI() bfin_read32(EMAC_RXC_MULTI)
125#define bfin_write_EMAC_RXC_MULTI(val) bfin_write32(EMAC_RXC_MULTI,val)
126#define bfin_read_EMAC_RXC_BROAD() bfin_read32(EMAC_RXC_BROAD)
127#define bfin_write_EMAC_RXC_BROAD(val) bfin_write32(EMAC_RXC_BROAD,val)
128#define bfin_read_EMAC_RXC_LNERRI() bfin_read32(EMAC_RXC_LNERRI)
129#define bfin_write_EMAC_RXC_LNERRI(val) bfin_write32(EMAC_RXC_LNERRI,val)
130#define bfin_read_EMAC_RXC_LNERRO() bfin_read32(EMAC_RXC_LNERRO)
131#define bfin_write_EMAC_RXC_LNERRO(val) bfin_write32(EMAC_RXC_LNERRO,val)
132#define bfin_read_EMAC_RXC_LONG() bfin_read32(EMAC_RXC_LONG)
133#define bfin_write_EMAC_RXC_LONG(val) bfin_write32(EMAC_RXC_LONG,val)
134#define bfin_read_EMAC_RXC_MACCTL() bfin_read32(EMAC_RXC_MACCTL)
135#define bfin_write_EMAC_RXC_MACCTL(val) bfin_write32(EMAC_RXC_MACCTL,val)
136#define bfin_read_EMAC_RXC_OPCODE() bfin_read32(EMAC_RXC_OPCODE)
137#define bfin_write_EMAC_RXC_OPCODE(val) bfin_write32(EMAC_RXC_OPCODE,val)
138#define bfin_read_EMAC_RXC_PAUSE() bfin_read32(EMAC_RXC_PAUSE)
139#define bfin_write_EMAC_RXC_PAUSE(val) bfin_write32(EMAC_RXC_PAUSE,val)
140#define bfin_read_EMAC_RXC_ALLFRM() bfin_read32(EMAC_RXC_ALLFRM)
141#define bfin_write_EMAC_RXC_ALLFRM(val) bfin_write32(EMAC_RXC_ALLFRM,val)
142#define bfin_read_EMAC_RXC_ALLOCT() bfin_read32(EMAC_RXC_ALLOCT)
143#define bfin_write_EMAC_RXC_ALLOCT(val) bfin_write32(EMAC_RXC_ALLOCT,val)
144#define bfin_read_EMAC_RXC_TYPED() bfin_read32(EMAC_RXC_TYPED)
145#define bfin_write_EMAC_RXC_TYPED(val) bfin_write32(EMAC_RXC_TYPED,val)
146#define bfin_read_EMAC_RXC_SHORT() bfin_read32(EMAC_RXC_SHORT)
147#define bfin_write_EMAC_RXC_SHORT(val) bfin_write32(EMAC_RXC_SHORT,val)
148#define bfin_read_EMAC_RXC_EQ64() bfin_read32(EMAC_RXC_EQ64)
149#define bfin_write_EMAC_RXC_EQ64(val) bfin_write32(EMAC_RXC_EQ64,val)
150#define pEMAC_RXC_LT128 ((volatile unsigned long *)EMAC_RXC_LT128)
151#define bfin_read_EMAC_RXC_LT128() bfin_read32(EMAC_RXC_LT128)
152#define bfin_write_EMAC_RXC_LT128(val) bfin_write32(EMAC_RXC_LT128,val)
153#define bfin_read_EMAC_RXC_LT256() bfin_read32(EMAC_RXC_LT256)
154#define bfin_write_EMAC_RXC_LT256(val) bfin_write32(EMAC_RXC_LT256,val)
155#define bfin_read_EMAC_RXC_LT512() bfin_read32(EMAC_RXC_LT512)
156#define bfin_write_EMAC_RXC_LT512(val) bfin_write32(EMAC_RXC_LT512,val)
157#define bfin_read_EMAC_RXC_LT1024() bfin_read32(EMAC_RXC_LT1024)
158#define bfin_write_EMAC_RXC_LT1024(val) bfin_write32(EMAC_RXC_LT1024,val)
159#define bfin_read_EMAC_RXC_GE1024() bfin_read32(EMAC_RXC_GE1024)
160#define bfin_write_EMAC_RXC_GE1024(val) bfin_write32(EMAC_RXC_GE1024,val)
161
162#define bfin_read_EMAC_TXC_OK() bfin_read32(EMAC_TXC_OK)
163#define bfin_write_EMAC_TXC_OK(val) bfin_write32(EMAC_TXC_OK,val)
164#define bfin_read_EMAC_TXC_1COL() bfin_read32(EMAC_TXC_1COL)
165#define bfin_write_EMAC_TXC_1COL(val) bfin_write32(EMAC_TXC_1COL,val)
166#define bfin_read_EMAC_TXC_GT1COL() bfin_read32(EMAC_TXC_GT1COL)
167#define bfin_write_EMAC_TXC_GT1COL(val) bfin_write32(EMAC_TXC_GT1COL,val)
168#define bfin_read_EMAC_TXC_OCTET() bfin_read32(EMAC_TXC_OCTET)
169#define bfin_write_EMAC_TXC_OCTET(val) bfin_write32(EMAC_TXC_OCTET,val)
170#define bfin_read_EMAC_TXC_DEFER() bfin_read32(EMAC_TXC_DEFER)
171#define bfin_write_EMAC_TXC_DEFER(val) bfin_write32(EMAC_TXC_DEFER,val)
172#define bfin_read_EMAC_TXC_LATECL() bfin_read32(EMAC_TXC_LATECL)
173#define bfin_write_EMAC_TXC_LATECL(val) bfin_write32(EMAC_TXC_LATECL,val)
174#define bfin_read_EMAC_TXC_XS_COL() bfin_read32(EMAC_TXC_XS_COL)
175#define bfin_write_EMAC_TXC_XS_COL(val) bfin_write32(EMAC_TXC_XS_COL,val)
176#define bfin_read_EMAC_TXC_DMAUND() bfin_read32(EMAC_TXC_DMAUND)
177#define bfin_write_EMAC_TXC_DMAUND(val) bfin_write32(EMAC_TXC_DMAUND,val)
178#define bfin_read_EMAC_TXC_CRSERR() bfin_read32(EMAC_TXC_CRSERR)
179#define bfin_write_EMAC_TXC_CRSERR(val) bfin_write32(EMAC_TXC_CRSERR,val)
180#define bfin_read_EMAC_TXC_UNICST() bfin_read32(EMAC_TXC_UNICST)
181#define bfin_write_EMAC_TXC_UNICST(val) bfin_write32(EMAC_TXC_UNICST,val)
182#define bfin_read_EMAC_TXC_MULTI() bfin_read32(EMAC_TXC_MULTI)
183#define bfin_write_EMAC_TXC_MULTI(val) bfin_write32(EMAC_TXC_MULTI,val)
184#define bfin_read_EMAC_TXC_BROAD() bfin_read32(EMAC_TXC_BROAD)
185#define bfin_write_EMAC_TXC_BROAD(val) bfin_write32(EMAC_TXC_BROAD,val)
186#define bfin_read_EMAC_TXC_XS_DFR() bfin_read32(EMAC_TXC_XS_DFR)
187#define bfin_write_EMAC_TXC_XS_DFR(val) bfin_write32(EMAC_TXC_XS_DFR,val)
188#define bfin_read_EMAC_TXC_MACCTL() bfin_read32(EMAC_TXC_MACCTL)
189#define bfin_write_EMAC_TXC_MACCTL(val) bfin_write32(EMAC_TXC_MACCTL,val)
190#define bfin_read_EMAC_TXC_ALLFRM() bfin_read32(EMAC_TXC_ALLFRM)
191#define bfin_write_EMAC_TXC_ALLFRM(val) bfin_write32(EMAC_TXC_ALLFRM,val)
192#define bfin_read_EMAC_TXC_ALLOCT() bfin_read32(EMAC_TXC_ALLOCT)
193#define bfin_write_EMAC_TXC_ALLOCT(val) bfin_write32(EMAC_TXC_ALLOCT,val)
194#define bfin_read_EMAC_TXC_EQ64() bfin_read32(EMAC_TXC_EQ64)
195#define bfin_write_EMAC_TXC_EQ64(val) bfin_write32(EMAC_TXC_EQ64,val)
196#define bfin_read_EMAC_TXC_LT128() bfin_read32(EMAC_TXC_LT128)
197#define bfin_write_EMAC_TXC_LT128(val) bfin_write32(EMAC_TXC_LT128,val)
198#define bfin_read_EMAC_TXC_LT256() bfin_read32(EMAC_TXC_LT256)
199#define bfin_write_EMAC_TXC_LT256(val) bfin_write32(EMAC_TXC_LT256,val)
200#define bfin_read_EMAC_TXC_LT512() bfin_read32(EMAC_TXC_LT512)
201#define bfin_write_EMAC_TXC_LT512(val) bfin_write32(EMAC_TXC_LT512,val)
202#define bfin_read_EMAC_TXC_LT1024() bfin_read32(EMAC_TXC_LT1024)
203#define bfin_write_EMAC_TXC_LT1024(val) bfin_write32(EMAC_TXC_LT1024,val)
204#define bfin_read_EMAC_TXC_GE1024() bfin_read32(EMAC_TXC_GE1024)
205#define bfin_write_EMAC_TXC_GE1024(val) bfin_write32(EMAC_TXC_GE1024,val)
206#define bfin_read_EMAC_TXC_ABORT() bfin_read32(EMAC_TXC_ABORT)
207#define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT,val)
208
209#endif /* _CDEF_BF537_H */
diff --git a/include/asm-blackfin/mach-bf537/defBF534.h b/include/asm-blackfin/mach-bf537/defBF534.h
new file mode 100644
index 000000000000..e605e9709004
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/defBF534.h
@@ -0,0 +1,2501 @@
1/*
2 * File: include/asm-blackfin/mach-bf537/cdefBF537.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _DEF_BF534_H
32#define _DEF_BF534_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/mach-common/def_LPBlackfin.h>
36
37/************************************************************************************
38** System MMR Register Map
39*************************************************************************************/
40/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
41#define PLL_CTL 0xFFC00000 /* PLL Control Register */
42#define PLL_DIV 0xFFC00004 /* PLL Divide Register */
43#define VR_CTL 0xFFC00008 /* Voltage Regulator Control Register */
44#define PLL_STAT 0xFFC0000C /* PLL Status Register */
45#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count Register */
46#define CHIPID 0xFFC00014 /* Chip ID Register */
47
48/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
49#define SWRST 0xFFC00100 /* Software Reset Register */
50#define SYSCR 0xFFC00104 /* System Configuration Register */
51#define SIC_RVECT 0xFFC00108 /* Interrupt Reset Vector Address Register */
52#define SIC_IMASK 0xFFC0010C /* Interrupt Mask Register */
53#define SIC_IAR0 0xFFC00110 /* Interrupt Assignment Register 0 */
54#define SIC_IAR1 0xFFC00114 /* Interrupt Assignment Register 1 */
55#define SIC_IAR2 0xFFC00118 /* Interrupt Assignment Register 2 */
56#define SIC_IAR3 0xFFC0011C /* Interrupt Assignment Register 3 */
57#define SIC_ISR 0xFFC00120 /* Interrupt Status Register */
58#define SIC_IWR 0xFFC00124 /* Interrupt Wakeup Register */
59
60/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
61#define WDOG_CTL 0xFFC00200 /* Watchdog Control Register */
62#define WDOG_CNT 0xFFC00204 /* Watchdog Count Register */
63#define WDOG_STAT 0xFFC00208 /* Watchdog Status Register */
64
65/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
66#define RTC_STAT 0xFFC00300 /* RTC Status Register */
67#define RTC_ICTL 0xFFC00304 /* RTC Interrupt Control Register */
68#define RTC_ISTAT 0xFFC00308 /* RTC Interrupt Status Register */
69#define RTC_SWCNT 0xFFC0030C /* RTC Stopwatch Count Register */
70#define RTC_ALARM 0xFFC00310 /* RTC Alarm Time Register */
71#define RTC_FAST 0xFFC00314 /* RTC Prescaler Enable Register */
72#define RTC_PREN 0xFFC00314 /* RTC Prescaler Enable Alternate Macro */
73
74/* UART0 Controller (0xFFC00400 - 0xFFC004FF) */
75#define UART0_THR 0xFFC00400 /* Transmit Holding register */
76#define UART0_RBR 0xFFC00400 /* Receive Buffer register */
77#define UART0_DLL 0xFFC00400 /* Divisor Latch (Low-Byte) */
78#define UART0_IER 0xFFC00404 /* Interrupt Enable Register */
79#define UART0_DLH 0xFFC00404 /* Divisor Latch (High-Byte) */
80#define UART0_IIR 0xFFC00408 /* Interrupt Identification Register */
81#define UART0_LCR 0xFFC0040C /* Line Control Register */
82#define UART0_MCR 0xFFC00410 /* Modem Control Register */
83#define UART0_LSR 0xFFC00414 /* Line Status Register */
84#define UART0_MSR 0xFFC00418 /* Modem Status Register */
85#define UART0_SCR 0xFFC0041C /* SCR Scratch Register */
86#define UART0_GCTL 0xFFC00424 /* Global Control Register */
87
88/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
89#define SPI_CTL 0xFFC00500 /* SPI Control Register */
90#define SPI_FLG 0xFFC00504 /* SPI Flag register */
91#define SPI_STAT 0xFFC00508 /* SPI Status register */
92#define SPI_TDBR 0xFFC0050C /* SPI Transmit Data Buffer Register */
93#define SPI_RDBR 0xFFC00510 /* SPI Receive Data Buffer Register */
94#define SPI_BAUD 0xFFC00514 /* SPI Baud rate Register */
95#define SPI_SHADOW 0xFFC00518 /* SPI_RDBR Shadow Register */
96
97/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
98#define TIMER0_CONFIG 0xFFC00600 /* Timer 0 Configuration Register */
99#define TIMER0_COUNTER 0xFFC00604 /* Timer 0 Counter Register */
100#define TIMER0_PERIOD 0xFFC00608 /* Timer 0 Period Register */
101#define TIMER0_WIDTH 0xFFC0060C /* Timer 0 Width Register */
102
103#define TIMER1_CONFIG 0xFFC00610 /* Timer 1 Configuration Register */
104#define TIMER1_COUNTER 0xFFC00614 /* Timer 1 Counter Register */
105#define TIMER1_PERIOD 0xFFC00618 /* Timer 1 Period Register */
106#define TIMER1_WIDTH 0xFFC0061C /* Timer 1 Width Register */
107
108#define TIMER2_CONFIG 0xFFC00620 /* Timer 2 Configuration Register */
109#define TIMER2_COUNTER 0xFFC00624 /* Timer 2 Counter Register */
110#define TIMER2_PERIOD 0xFFC00628 /* Timer 2 Period Register */
111#define TIMER2_WIDTH 0xFFC0062C /* Timer 2 Width Register */
112
113#define TIMER3_CONFIG 0xFFC00630 /* Timer 3 Configuration Register */
114#define TIMER3_COUNTER 0xFFC00634 /* Timer 3 Counter Register */
115#define TIMER3_PERIOD 0xFFC00638 /* Timer 3 Period Register */
116#define TIMER3_WIDTH 0xFFC0063C /* Timer 3 Width Register */
117
118#define TIMER4_CONFIG 0xFFC00640 /* Timer 4 Configuration Register */
119#define TIMER4_COUNTER 0xFFC00644 /* Timer 4 Counter Register */
120#define TIMER4_PERIOD 0xFFC00648 /* Timer 4 Period Register */
121#define TIMER4_WIDTH 0xFFC0064C /* Timer 4 Width Register */
122
123#define TIMER5_CONFIG 0xFFC00650 /* Timer 5 Configuration Register */
124#define TIMER5_COUNTER 0xFFC00654 /* Timer 5 Counter Register */
125#define TIMER5_PERIOD 0xFFC00658 /* Timer 5 Period Register */
126#define TIMER5_WIDTH 0xFFC0065C /* Timer 5 Width Register */
127
128#define TIMER6_CONFIG 0xFFC00660 /* Timer 6 Configuration Register */
129#define TIMER6_COUNTER 0xFFC00664 /* Timer 6 Counter Register */
130#define TIMER6_PERIOD 0xFFC00668 /* Timer 6 Period Register */
131#define TIMER6_WIDTH 0xFFC0066C /* Timer 6 Width Register */
132
133#define TIMER7_CONFIG 0xFFC00670 /* Timer 7 Configuration Register */
134#define TIMER7_COUNTER 0xFFC00674 /* Timer 7 Counter Register */
135#define TIMER7_PERIOD 0xFFC00678 /* Timer 7 Period Register */
136#define TIMER7_WIDTH 0xFFC0067C /* Timer 7 Width Register */
137
138#define TIMER_ENABLE 0xFFC00680 /* Timer Enable Register */
139#define TIMER_DISABLE 0xFFC00684 /* Timer Disable Register */
140#define TIMER_STATUS 0xFFC00688 /* Timer Status Register */
141
142/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
143#define PORTFIO 0xFFC00700 /* Port F I/O Pin State Specify Register */
144#define PORTFIO_CLEAR 0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
145#define PORTFIO_SET 0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
146#define PORTFIO_TOGGLE 0xFFC0070C /* Port F I/O Pin State Toggle Register */
147#define PORTFIO_MASKA 0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
148#define PORTFIO_MASKA_CLEAR 0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
149#define PORTFIO_MASKA_SET 0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
150#define PORTFIO_MASKA_TOGGLE 0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
151#define PORTFIO_MASKB 0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
152#define PORTFIO_MASKB_CLEAR 0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
153#define PORTFIO_MASKB_SET 0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
154#define PORTFIO_MASKB_TOGGLE 0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
155#define PORTFIO_DIR 0xFFC00730 /* Port F I/O Direction Register */
156#define PORTFIO_POLAR 0xFFC00734 /* Port F I/O Source Polarity Register */
157#define PORTFIO_EDGE 0xFFC00738 /* Port F I/O Source Sensitivity Register */
158#define PORTFIO_BOTH 0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
159#define PORTFIO_INEN 0xFFC00740 /* Port F I/O Input Enable Register */
160
161/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
162#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
163#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
164#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
165#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
166#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
167#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
168#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
169#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
170#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
171#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
172#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
173#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
174#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
175#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
176#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
177#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
178#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
179#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
180#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
181#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
182#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
183#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
184
185/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
186#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
187#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
188#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
189#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
190#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
191#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
192#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
193#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
194#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
195#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
196#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
197#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
198#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
199#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
200#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
201#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
202#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
203#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
204#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
205#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
206#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
207#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
208
209/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
210#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
211#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
212#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
213#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
214#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
215#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
216#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
217
218/* DMA Traffic Control Registers */
219#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
220#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
221
222/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */
223#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
224#define DMA0_START_ADDR 0xFFC00C04 /* DMA Channel 0 Start Address Register */
225#define DMA0_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */
226#define DMA0_X_COUNT 0xFFC00C10 /* DMA Channel 0 X Count Register */
227#define DMA0_X_MODIFY 0xFFC00C14 /* DMA Channel 0 X Modify Register */
228#define DMA0_Y_COUNT 0xFFC00C18 /* DMA Channel 0 Y Count Register */
229#define DMA0_Y_MODIFY 0xFFC00C1C /* DMA Channel 0 Y Modify Register */
230#define DMA0_CURR_DESC_PTR 0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
231#define DMA0_CURR_ADDR 0xFFC00C24 /* DMA Channel 0 Current Address Register */
232#define DMA0_IRQ_STATUS 0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
233#define DMA0_PERIPHERAL_MAP 0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
234#define DMA0_CURR_X_COUNT 0xFFC00C30 /* DMA Channel 0 Current X Count Register */
235#define DMA0_CURR_Y_COUNT 0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
236
237#define DMA1_NEXT_DESC_PTR 0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
238#define DMA1_START_ADDR 0xFFC00C44 /* DMA Channel 1 Start Address Register */
239#define DMA1_CONFIG 0xFFC00C48 /* DMA Channel 1 Configuration Register */
240#define DMA1_X_COUNT 0xFFC00C50 /* DMA Channel 1 X Count Register */
241#define DMA1_X_MODIFY 0xFFC00C54 /* DMA Channel 1 X Modify Register */
242#define DMA1_Y_COUNT 0xFFC00C58 /* DMA Channel 1 Y Count Register */
243#define DMA1_Y_MODIFY 0xFFC00C5C /* DMA Channel 1 Y Modify Register */
244#define DMA1_CURR_DESC_PTR 0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
245#define DMA1_CURR_ADDR 0xFFC00C64 /* DMA Channel 1 Current Address Register */
246#define DMA1_IRQ_STATUS 0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
247#define DMA1_PERIPHERAL_MAP 0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
248#define DMA1_CURR_X_COUNT 0xFFC00C70 /* DMA Channel 1 Current X Count Register */
249#define DMA1_CURR_Y_COUNT 0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
250
251#define DMA2_NEXT_DESC_PTR 0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
252#define DMA2_START_ADDR 0xFFC00C84 /* DMA Channel 2 Start Address Register */
253#define DMA2_CONFIG 0xFFC00C88 /* DMA Channel 2 Configuration Register */
254#define DMA2_X_COUNT 0xFFC00C90 /* DMA Channel 2 X Count Register */
255#define DMA2_X_MODIFY 0xFFC00C94 /* DMA Channel 2 X Modify Register */
256#define DMA2_Y_COUNT 0xFFC00C98 /* DMA Channel 2 Y Count Register */
257#define DMA2_Y_MODIFY 0xFFC00C9C /* DMA Channel 2 Y Modify Register */
258#define DMA2_CURR_DESC_PTR 0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
259#define DMA2_CURR_ADDR 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
260#define DMA2_IRQ_STATUS 0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
261#define DMA2_PERIPHERAL_MAP 0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
262#define DMA2_CURR_X_COUNT 0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
263#define DMA2_CURR_Y_COUNT 0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
264
265#define DMA3_NEXT_DESC_PTR 0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
266#define DMA3_START_ADDR 0xFFC00CC4 /* DMA Channel 3 Start Address Register */
267#define DMA3_CONFIG 0xFFC00CC8 /* DMA Channel 3 Configuration Register */
268#define DMA3_X_COUNT 0xFFC00CD0 /* DMA Channel 3 X Count Register */
269#define DMA3_X_MODIFY 0xFFC00CD4 /* DMA Channel 3 X Modify Register */
270#define DMA3_Y_COUNT 0xFFC00CD8 /* DMA Channel 3 Y Count Register */
271#define DMA3_Y_MODIFY 0xFFC00CDC /* DMA Channel 3 Y Modify Register */
272#define DMA3_CURR_DESC_PTR 0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
273#define DMA3_CURR_ADDR 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
274#define DMA3_IRQ_STATUS 0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
275#define DMA3_PERIPHERAL_MAP 0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
276#define DMA3_CURR_X_COUNT 0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
277#define DMA3_CURR_Y_COUNT 0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
278
279#define DMA4_NEXT_DESC_PTR 0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
280#define DMA4_START_ADDR 0xFFC00D04 /* DMA Channel 4 Start Address Register */
281#define DMA4_CONFIG 0xFFC00D08 /* DMA Channel 4 Configuration Register */
282#define DMA4_X_COUNT 0xFFC00D10 /* DMA Channel 4 X Count Register */
283#define DMA4_X_MODIFY 0xFFC00D14 /* DMA Channel 4 X Modify Register */
284#define DMA4_Y_COUNT 0xFFC00D18 /* DMA Channel 4 Y Count Register */
285#define DMA4_Y_MODIFY 0xFFC00D1C /* DMA Channel 4 Y Modify Register */
286#define DMA4_CURR_DESC_PTR 0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
287#define DMA4_CURR_ADDR 0xFFC00D24 /* DMA Channel 4 Current Address Register */
288#define DMA4_IRQ_STATUS 0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
289#define DMA4_PERIPHERAL_MAP 0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
290#define DMA4_CURR_X_COUNT 0xFFC00D30 /* DMA Channel 4 Current X Count Register */
291#define DMA4_CURR_Y_COUNT 0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
292
293#define DMA5_NEXT_DESC_PTR 0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
294#define DMA5_START_ADDR 0xFFC00D44 /* DMA Channel 5 Start Address Register */
295#define DMA5_CONFIG 0xFFC00D48 /* DMA Channel 5 Configuration Register */
296#define DMA5_X_COUNT 0xFFC00D50 /* DMA Channel 5 X Count Register */
297#define DMA5_X_MODIFY 0xFFC00D54 /* DMA Channel 5 X Modify Register */
298#define DMA5_Y_COUNT 0xFFC00D58 /* DMA Channel 5 Y Count Register */
299#define DMA5_Y_MODIFY 0xFFC00D5C /* DMA Channel 5 Y Modify Register */
300#define DMA5_CURR_DESC_PTR 0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
301#define DMA5_CURR_ADDR 0xFFC00D64 /* DMA Channel 5 Current Address Register */
302#define DMA5_IRQ_STATUS 0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
303#define DMA5_PERIPHERAL_MAP 0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
304#define DMA5_CURR_X_COUNT 0xFFC00D70 /* DMA Channel 5 Current X Count Register */
305#define DMA5_CURR_Y_COUNT 0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
306
307#define DMA6_NEXT_DESC_PTR 0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
308#define DMA6_START_ADDR 0xFFC00D84 /* DMA Channel 6 Start Address Register */
309#define DMA6_CONFIG 0xFFC00D88 /* DMA Channel 6 Configuration Register */
310#define DMA6_X_COUNT 0xFFC00D90 /* DMA Channel 6 X Count Register */
311#define DMA6_X_MODIFY 0xFFC00D94 /* DMA Channel 6 X Modify Register */
312#define DMA6_Y_COUNT 0xFFC00D98 /* DMA Channel 6 Y Count Register */
313#define DMA6_Y_MODIFY 0xFFC00D9C /* DMA Channel 6 Y Modify Register */
314#define DMA6_CURR_DESC_PTR 0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
315#define DMA6_CURR_ADDR 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
316#define DMA6_IRQ_STATUS 0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
317#define DMA6_PERIPHERAL_MAP 0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
318#define DMA6_CURR_X_COUNT 0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
319#define DMA6_CURR_Y_COUNT 0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
320
321#define DMA7_NEXT_DESC_PTR 0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
322#define DMA7_START_ADDR 0xFFC00DC4 /* DMA Channel 7 Start Address Register */
323#define DMA7_CONFIG 0xFFC00DC8 /* DMA Channel 7 Configuration Register */
324#define DMA7_X_COUNT 0xFFC00DD0 /* DMA Channel 7 X Count Register */
325#define DMA7_X_MODIFY 0xFFC00DD4 /* DMA Channel 7 X Modify Register */
326#define DMA7_Y_COUNT 0xFFC00DD8 /* DMA Channel 7 Y Count Register */
327#define DMA7_Y_MODIFY 0xFFC00DDC /* DMA Channel 7 Y Modify Register */
328#define DMA7_CURR_DESC_PTR 0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
329#define DMA7_CURR_ADDR 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
330#define DMA7_IRQ_STATUS 0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
331#define DMA7_PERIPHERAL_MAP 0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
332#define DMA7_CURR_X_COUNT 0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
333#define DMA7_CURR_Y_COUNT 0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
334
335#define DMA8_NEXT_DESC_PTR 0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
336#define DMA8_START_ADDR 0xFFC00E04 /* DMA Channel 8 Start Address Register */
337#define DMA8_CONFIG 0xFFC00E08 /* DMA Channel 8 Configuration Register */
338#define DMA8_X_COUNT 0xFFC00E10 /* DMA Channel 8 X Count Register */
339#define DMA8_X_MODIFY 0xFFC00E14 /* DMA Channel 8 X Modify Register */
340#define DMA8_Y_COUNT 0xFFC00E18 /* DMA Channel 8 Y Count Register */
341#define DMA8_Y_MODIFY 0xFFC00E1C /* DMA Channel 8 Y Modify Register */
342#define DMA8_CURR_DESC_PTR 0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
343#define DMA8_CURR_ADDR 0xFFC00E24 /* DMA Channel 8 Current Address Register */
344#define DMA8_IRQ_STATUS 0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
345#define DMA8_PERIPHERAL_MAP 0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
346#define DMA8_CURR_X_COUNT 0xFFC00E30 /* DMA Channel 8 Current X Count Register */
347#define DMA8_CURR_Y_COUNT 0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
348
349#define DMA9_NEXT_DESC_PTR 0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
350#define DMA9_START_ADDR 0xFFC00E44 /* DMA Channel 9 Start Address Register */
351#define DMA9_CONFIG 0xFFC00E48 /* DMA Channel 9 Configuration Register */
352#define DMA9_X_COUNT 0xFFC00E50 /* DMA Channel 9 X Count Register */
353#define DMA9_X_MODIFY 0xFFC00E54 /* DMA Channel 9 X Modify Register */
354#define DMA9_Y_COUNT 0xFFC00E58 /* DMA Channel 9 Y Count Register */
355#define DMA9_Y_MODIFY 0xFFC00E5C /* DMA Channel 9 Y Modify Register */
356#define DMA9_CURR_DESC_PTR 0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
357#define DMA9_CURR_ADDR 0xFFC00E64 /* DMA Channel 9 Current Address Register */
358#define DMA9_IRQ_STATUS 0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
359#define DMA9_PERIPHERAL_MAP 0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
360#define DMA9_CURR_X_COUNT 0xFFC00E70 /* DMA Channel 9 Current X Count Register */
361#define DMA9_CURR_Y_COUNT 0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
362
363#define DMA10_NEXT_DESC_PTR 0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
364#define DMA10_START_ADDR 0xFFC00E84 /* DMA Channel 10 Start Address Register */
365#define DMA10_CONFIG 0xFFC00E88 /* DMA Channel 10 Configuration Register */
366#define DMA10_X_COUNT 0xFFC00E90 /* DMA Channel 10 X Count Register */
367#define DMA10_X_MODIFY 0xFFC00E94 /* DMA Channel 10 X Modify Register */
368#define DMA10_Y_COUNT 0xFFC00E98 /* DMA Channel 10 Y Count Register */
369#define DMA10_Y_MODIFY 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
370#define DMA10_CURR_DESC_PTR 0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
371#define DMA10_CURR_ADDR 0xFFC00EA4 /* DMA Channel 10 Current Address Register */
372#define DMA10_IRQ_STATUS 0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
373#define DMA10_PERIPHERAL_MAP 0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
374#define DMA10_CURR_X_COUNT 0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
375#define DMA10_CURR_Y_COUNT 0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
376
377#define DMA11_NEXT_DESC_PTR 0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
378#define DMA11_START_ADDR 0xFFC00EC4 /* DMA Channel 11 Start Address Register */
379#define DMA11_CONFIG 0xFFC00EC8 /* DMA Channel 11 Configuration Register */
380#define DMA11_X_COUNT 0xFFC00ED0 /* DMA Channel 11 X Count Register */
381#define DMA11_X_MODIFY 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
382#define DMA11_Y_COUNT 0xFFC00ED8 /* DMA Channel 11 Y Count Register */
383#define DMA11_Y_MODIFY 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
384#define DMA11_CURR_DESC_PTR 0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
385#define DMA11_CURR_ADDR 0xFFC00EE4 /* DMA Channel 11 Current Address Register */
386#define DMA11_IRQ_STATUS 0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
387#define DMA11_PERIPHERAL_MAP 0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
388#define DMA11_CURR_X_COUNT 0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
389#define DMA11_CURR_Y_COUNT 0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
390
391#define MDMA_D0_NEXT_DESC_PTR 0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
392#define MDMA_D0_START_ADDR 0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
393#define MDMA_D0_CONFIG 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
394#define MDMA_D0_X_COUNT 0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
395#define MDMA_D0_X_MODIFY 0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
396#define MDMA_D0_Y_COUNT 0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
397#define MDMA_D0_Y_MODIFY 0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
398#define MDMA_D0_CURR_DESC_PTR 0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
399#define MDMA_D0_CURR_ADDR 0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
400#define MDMA_D0_IRQ_STATUS 0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
401#define MDMA_D0_PERIPHERAL_MAP 0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
402#define MDMA_D0_CURR_X_COUNT 0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
403#define MDMA_D0_CURR_Y_COUNT 0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
404
405#define MDMA_S0_NEXT_DESC_PTR 0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
406#define MDMA_S0_START_ADDR 0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
407#define MDMA_S0_CONFIG 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
408#define MDMA_S0_X_COUNT 0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
409#define MDMA_S0_X_MODIFY 0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
410#define MDMA_S0_Y_COUNT 0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
411#define MDMA_S0_Y_MODIFY 0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
412#define MDMA_S0_CURR_DESC_PTR 0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
413#define MDMA_S0_CURR_ADDR 0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
414#define MDMA_S0_IRQ_STATUS 0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
415#define MDMA_S0_PERIPHERAL_MAP 0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
416#define MDMA_S0_CURR_X_COUNT 0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
417#define MDMA_S0_CURR_Y_COUNT 0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
418
419#define MDMA_D1_NEXT_DESC_PTR 0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
420#define MDMA_D1_START_ADDR 0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
421#define MDMA_D1_CONFIG 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
422#define MDMA_D1_X_COUNT 0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
423#define MDMA_D1_X_MODIFY 0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
424#define MDMA_D1_Y_COUNT 0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
425#define MDMA_D1_Y_MODIFY 0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
426#define MDMA_D1_CURR_DESC_PTR 0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
427#define MDMA_D1_CURR_ADDR 0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
428#define MDMA_D1_IRQ_STATUS 0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
429#define MDMA_D1_PERIPHERAL_MAP 0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
430#define MDMA_D1_CURR_X_COUNT 0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
431#define MDMA_D1_CURR_Y_COUNT 0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
432
433#define MDMA_S1_NEXT_DESC_PTR 0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
434#define MDMA_S1_START_ADDR 0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
435#define MDMA_S1_CONFIG 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
436#define MDMA_S1_X_COUNT 0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
437#define MDMA_S1_X_MODIFY 0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
438#define MDMA_S1_Y_COUNT 0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
439#define MDMA_S1_Y_MODIFY 0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
440#define MDMA_S1_CURR_DESC_PTR 0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
441#define MDMA_S1_CURR_ADDR 0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
442#define MDMA_S1_IRQ_STATUS 0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
443#define MDMA_S1_PERIPHERAL_MAP 0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
444#define MDMA_S1_CURR_X_COUNT 0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
445#define MDMA_S1_CURR_Y_COUNT 0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
446
447/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
448#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */
449#define PPI_STATUS 0xFFC01004 /* PPI Status Register */
450#define PPI_COUNT 0xFFC01008 /* PPI Transfer Count Register */
451#define PPI_DELAY 0xFFC0100C /* PPI Delay Count Register */
452#define PPI_FRAME 0xFFC01010 /* PPI Frame Length Register */
453
454/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
455#define TWI_CLKDIV 0xFFC01400 /* Serial Clock Divider Register */
456#define TWI_CONTROL 0xFFC01404 /* TWI Control Register */
457#define TWI_SLAVE_CTL 0xFFC01408 /* Slave Mode Control Register */
458#define TWI_SLAVE_STAT 0xFFC0140C /* Slave Mode Status Register */
459#define TWI_SLAVE_ADDR 0xFFC01410 /* Slave Mode Address Register */
460#define TWI_MASTER_CTL 0xFFC01414 /* Master Mode Control Register */
461#define TWI_MASTER_STAT 0xFFC01418 /* Master Mode Status Register */
462#define TWI_MASTER_ADDR 0xFFC0141C /* Master Mode Address Register */
463#define TWI_INT_STAT 0xFFC01420 /* TWI Interrupt Status Register */
464#define TWI_INT_MASK 0xFFC01424 /* TWI Master Interrupt Mask Register */
465#define TWI_FIFO_CTL 0xFFC01428 /* FIFO Control Register */
466#define TWI_FIFO_STAT 0xFFC0142C /* FIFO Status Register */
467#define TWI_XMT_DATA8 0xFFC01480 /* FIFO Transmit Data Single Byte Register */
468#define TWI_XMT_DATA16 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
469#define TWI_RCV_DATA8 0xFFC01488 /* FIFO Receive Data Single Byte Register */
470#define TWI_RCV_DATA16 0xFFC0148C /* FIFO Receive Data Double Byte Register */
471
472/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
473#define PORTGIO 0xFFC01500 /* Port G I/O Pin State Specify Register */
474#define PORTGIO_CLEAR 0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
475#define PORTGIO_SET 0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
476#define PORTGIO_TOGGLE 0xFFC0150C /* Port G I/O Pin State Toggle Register */
477#define PORTGIO_MASKA 0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
478#define PORTGIO_MASKA_CLEAR 0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
479#define PORTGIO_MASKA_SET 0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
480#define PORTGIO_MASKA_TOGGLE 0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
481#define PORTGIO_MASKB 0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
482#define PORTGIO_MASKB_CLEAR 0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
483#define PORTGIO_MASKB_SET 0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
484#define PORTGIO_MASKB_TOGGLE 0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
485#define PORTGIO_DIR 0xFFC01530 /* Port G I/O Direction Register */
486#define PORTGIO_POLAR 0xFFC01534 /* Port G I/O Source Polarity Register */
487#define PORTGIO_EDGE 0xFFC01538 /* Port G I/O Source Sensitivity Register */
488#define PORTGIO_BOTH 0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
489#define PORTGIO_INEN 0xFFC01540 /* Port G I/O Input Enable Register */
490
491/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
492#define PORTHIO 0xFFC01700 /* Port H I/O Pin State Specify Register */
493#define PORTHIO_CLEAR 0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
494#define PORTHIO_SET 0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
495#define PORTHIO_TOGGLE 0xFFC0170C /* Port H I/O Pin State Toggle Register */
496#define PORTHIO_MASKA 0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
497#define PORTHIO_MASKA_CLEAR 0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
498#define PORTHIO_MASKA_SET 0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
499#define PORTHIO_MASKA_TOGGLE 0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
500#define PORTHIO_MASKB 0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
501#define PORTHIO_MASKB_CLEAR 0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
502#define PORTHIO_MASKB_SET 0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
503#define PORTHIO_MASKB_TOGGLE 0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
504#define PORTHIO_DIR 0xFFC01730 /* Port H I/O Direction Register */
505#define PORTHIO_POLAR 0xFFC01734 /* Port H I/O Source Polarity Register */
506#define PORTHIO_EDGE 0xFFC01738 /* Port H I/O Source Sensitivity Register */
507#define PORTHIO_BOTH 0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
508#define PORTHIO_INEN 0xFFC01740 /* Port H I/O Input Enable Register */
509
510/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
511#define UART1_THR 0xFFC02000 /* Transmit Holding register */
512#define UART1_RBR 0xFFC02000 /* Receive Buffer register */
513#define UART1_DLL 0xFFC02000 /* Divisor Latch (Low-Byte) */
514#define UART1_IER 0xFFC02004 /* Interrupt Enable Register */
515#define UART1_DLH 0xFFC02004 /* Divisor Latch (High-Byte) */
516#define UART1_IIR 0xFFC02008 /* Interrupt Identification Register */
517#define UART1_LCR 0xFFC0200C /* Line Control Register */
518#define UART1_MCR 0xFFC02010 /* Modem Control Register */
519#define UART1_LSR 0xFFC02014 /* Line Status Register */
520#define UART1_MSR 0xFFC02018 /* Modem Status Register */
521#define UART1_SCR 0xFFC0201C /* SCR Scratch Register */
522#define UART1_GCTL 0xFFC02024 /* Global Control Register */
523
524/* CAN Controller (0xFFC02A00 - 0xFFC02FFF) */
525/* For Mailboxes 0-15 */
526#define CAN_MC1 0xFFC02A00 /* Mailbox config reg 1 */
527#define CAN_MD1 0xFFC02A04 /* Mailbox direction reg 1 */
528#define CAN_TRS1 0xFFC02A08 /* Transmit Request Set reg 1 */
529#define CAN_TRR1 0xFFC02A0C /* Transmit Request Reset reg 1 */
530#define CAN_TA1 0xFFC02A10 /* Transmit Acknowledge reg 1 */
531#define CAN_AA1 0xFFC02A14 /* Transmit Abort Acknowledge reg 1 */
532#define CAN_RMP1 0xFFC02A18 /* Receive Message Pending reg 1 */
533#define CAN_RML1 0xFFC02A1C /* Receive Message Lost reg 1 */
534#define CAN_MBTIF1 0xFFC02A20 /* Mailbox Transmit Interrupt Flag reg 1 */
535#define CAN_MBRIF1 0xFFC02A24 /* Mailbox Receive Interrupt Flag reg 1 */
536#define CAN_MBIM1 0xFFC02A28 /* Mailbox Interrupt Mask reg 1 */
537#define CAN_RFH1 0xFFC02A2C /* Remote Frame Handling reg 1 */
538#define CAN_OPSS1 0xFFC02A30 /* Overwrite Protection Single Shot Xmit reg 1 */
539
540/* For Mailboxes 16-31 */
541#define CAN_MC2 0xFFC02A40 /* Mailbox config reg 2 */
542#define CAN_MD2 0xFFC02A44 /* Mailbox direction reg 2 */
543#define CAN_TRS2 0xFFC02A48 /* Transmit Request Set reg 2 */
544#define CAN_TRR2 0xFFC02A4C /* Transmit Request Reset reg 2 */
545#define CAN_TA2 0xFFC02A50 /* Transmit Acknowledge reg 2 */
546#define CAN_AA2 0xFFC02A54 /* Transmit Abort Acknowledge reg 2 */
547#define CAN_RMP2 0xFFC02A58 /* Receive Message Pending reg 2 */
548#define CAN_RML2 0xFFC02A5C /* Receive Message Lost reg 2 */
549#define CAN_MBTIF2 0xFFC02A60 /* Mailbox Transmit Interrupt Flag reg 2 */
550#define CAN_MBRIF2 0xFFC02A64 /* Mailbox Receive Interrupt Flag reg 2 */
551#define CAN_MBIM2 0xFFC02A68 /* Mailbox Interrupt Mask reg 2 */
552#define CAN_RFH2 0xFFC02A6C /* Remote Frame Handling reg 2 */
553#define CAN_OPSS2 0xFFC02A70 /* Overwrite Protection Single Shot Xmit reg 2 */
554
555/* CAN Configuration, Control, and Status Registers */
556#define CAN_CLOCK 0xFFC02A80 /* Bit Timing Configuration register 0 */
557#define CAN_TIMING 0xFFC02A84 /* Bit Timing Configuration register 1 */
558#define CAN_DEBUG 0xFFC02A88 /* Debug Register */
559#define CAN_STATUS 0xFFC02A8C /* Global Status Register */
560#define CAN_CEC 0xFFC02A90 /* Error Counter Register */
561#define CAN_GIS 0xFFC02A94 /* Global Interrupt Status Register */
562#define CAN_GIM 0xFFC02A98 /* Global Interrupt Mask Register */
563#define CAN_GIF 0xFFC02A9C /* Global Interrupt Flag Register */
564#define CAN_CONTROL 0xFFC02AA0 /* Master Control Register */
565#define CAN_INTR 0xFFC02AA4 /* Interrupt Pending Register */
566#define CAN_SFCMVER 0xFFC02AA8 /* Version Code Register */
567#define CAN_MBTD 0xFFC02AAC /* Mailbox Temporary Disable Feature */
568#define CAN_EWR 0xFFC02AB0 /* Programmable Warning Level */
569#define CAN_ESR 0xFFC02AB4 /* Error Status Register */
570#define CAN_UCREG 0xFFC02AC0 /* Universal Counter Register/Capture Register */
571#define CAN_UCCNT 0xFFC02AC4 /* Universal Counter */
572#define CAN_UCRC 0xFFC02AC8 /* Universal Counter Force Reload Register */
573#define CAN_UCCNF 0xFFC02ACC /* Universal Counter Configuration Register */
574
575/* Mailbox Acceptance Masks */
576#define CAN_AM00L 0xFFC02B00 /* Mailbox 0 Low Acceptance Mask */
577#define CAN_AM00H 0xFFC02B04 /* Mailbox 0 High Acceptance Mask */
578#define CAN_AM01L 0xFFC02B08 /* Mailbox 1 Low Acceptance Mask */
579#define CAN_AM01H 0xFFC02B0C /* Mailbox 1 High Acceptance Mask */
580#define CAN_AM02L 0xFFC02B10 /* Mailbox 2 Low Acceptance Mask */
581#define CAN_AM02H 0xFFC02B14 /* Mailbox 2 High Acceptance Mask */
582#define CAN_AM03L 0xFFC02B18 /* Mailbox 3 Low Acceptance Mask */
583#define CAN_AM03H 0xFFC02B1C /* Mailbox 3 High Acceptance Mask */
584#define CAN_AM04L 0xFFC02B20 /* Mailbox 4 Low Acceptance Mask */
585#define CAN_AM04H 0xFFC02B24 /* Mailbox 4 High Acceptance Mask */
586#define CAN_AM05L 0xFFC02B28 /* Mailbox 5 Low Acceptance Mask */
587#define CAN_AM05H 0xFFC02B2C /* Mailbox 5 High Acceptance Mask */
588#define CAN_AM06L 0xFFC02B30 /* Mailbox 6 Low Acceptance Mask */
589#define CAN_AM06H 0xFFC02B34 /* Mailbox 6 High Acceptance Mask */
590#define CAN_AM07L 0xFFC02B38 /* Mailbox 7 Low Acceptance Mask */
591#define CAN_AM07H 0xFFC02B3C /* Mailbox 7 High Acceptance Mask */
592#define CAN_AM08L 0xFFC02B40 /* Mailbox 8 Low Acceptance Mask */
593#define CAN_AM08H 0xFFC02B44 /* Mailbox 8 High Acceptance Mask */
594#define CAN_AM09L 0xFFC02B48 /* Mailbox 9 Low Acceptance Mask */
595#define CAN_AM09H 0xFFC02B4C /* Mailbox 9 High Acceptance Mask */
596#define CAN_AM10L 0xFFC02B50 /* Mailbox 10 Low Acceptance Mask */
597#define CAN_AM10H 0xFFC02B54 /* Mailbox 10 High Acceptance Mask */
598#define CAN_AM11L 0xFFC02B58 /* Mailbox 11 Low Acceptance Mask */
599#define CAN_AM11H 0xFFC02B5C /* Mailbox 11 High Acceptance Mask */
600#define CAN_AM12L 0xFFC02B60 /* Mailbox 12 Low Acceptance Mask */
601#define CAN_AM12H 0xFFC02B64 /* Mailbox 12 High Acceptance Mask */
602#define CAN_AM13L 0xFFC02B68 /* Mailbox 13 Low Acceptance Mask */
603#define CAN_AM13H 0xFFC02B6C /* Mailbox 13 High Acceptance Mask */
604#define CAN_AM14L 0xFFC02B70 /* Mailbox 14 Low Acceptance Mask */
605#define CAN_AM14H 0xFFC02B74 /* Mailbox 14 High Acceptance Mask */
606#define CAN_AM15L 0xFFC02B78 /* Mailbox 15 Low Acceptance Mask */
607#define CAN_AM15H 0xFFC02B7C /* Mailbox 15 High Acceptance Mask */
608
609#define CAN_AM16L 0xFFC02B80 /* Mailbox 16 Low Acceptance Mask */
610#define CAN_AM16H 0xFFC02B84 /* Mailbox 16 High Acceptance Mask */
611#define CAN_AM17L 0xFFC02B88 /* Mailbox 17 Low Acceptance Mask */
612#define CAN_AM17H 0xFFC02B8C /* Mailbox 17 High Acceptance Mask */
613#define CAN_AM18L 0xFFC02B90 /* Mailbox 18 Low Acceptance Mask */
614#define CAN_AM18H 0xFFC02B94 /* Mailbox 18 High Acceptance Mask */
615#define CAN_AM19L 0xFFC02B98 /* Mailbox 19 Low Acceptance Mask */
616#define CAN_AM19H 0xFFC02B9C /* Mailbox 19 High Acceptance Mask */
617#define CAN_AM20L 0xFFC02BA0 /* Mailbox 20 Low Acceptance Mask */
618#define CAN_AM20H 0xFFC02BA4 /* Mailbox 20 High Acceptance Mask */
619#define CAN_AM21L 0xFFC02BA8 /* Mailbox 21 Low Acceptance Mask */
620#define CAN_AM21H 0xFFC02BAC /* Mailbox 21 High Acceptance Mask */
621#define CAN_AM22L 0xFFC02BB0 /* Mailbox 22 Low Acceptance Mask */
622#define CAN_AM22H 0xFFC02BB4 /* Mailbox 22 High Acceptance Mask */
623#define CAN_AM23L 0xFFC02BB8 /* Mailbox 23 Low Acceptance Mask */
624#define CAN_AM23H 0xFFC02BBC /* Mailbox 23 High Acceptance Mask */
625#define CAN_AM24L 0xFFC02BC0 /* Mailbox 24 Low Acceptance Mask */
626#define CAN_AM24H 0xFFC02BC4 /* Mailbox 24 High Acceptance Mask */
627#define CAN_AM25L 0xFFC02BC8 /* Mailbox 25 Low Acceptance Mask */
628#define CAN_AM25H 0xFFC02BCC /* Mailbox 25 High Acceptance Mask */
629#define CAN_AM26L 0xFFC02BD0 /* Mailbox 26 Low Acceptance Mask */
630#define CAN_AM26H 0xFFC02BD4 /* Mailbox 26 High Acceptance Mask */
631#define CAN_AM27L 0xFFC02BD8 /* Mailbox 27 Low Acceptance Mask */
632#define CAN_AM27H 0xFFC02BDC /* Mailbox 27 High Acceptance Mask */
633#define CAN_AM28L 0xFFC02BE0 /* Mailbox 28 Low Acceptance Mask */
634#define CAN_AM28H 0xFFC02BE4 /* Mailbox 28 High Acceptance Mask */
635#define CAN_AM29L 0xFFC02BE8 /* Mailbox 29 Low Acceptance Mask */
636#define CAN_AM29H 0xFFC02BEC /* Mailbox 29 High Acceptance Mask */
637#define CAN_AM30L 0xFFC02BF0 /* Mailbox 30 Low Acceptance Mask */
638#define CAN_AM30H 0xFFC02BF4 /* Mailbox 30 High Acceptance Mask */
639#define CAN_AM31L 0xFFC02BF8 /* Mailbox 31 Low Acceptance Mask */
640#define CAN_AM31H 0xFFC02BFC /* Mailbox 31 High Acceptance Mask */
641
642/* CAN Acceptance Mask Macros */
643#define CAN_AM_L(x) (CAN_AM00L+((x)*0x8))
644#define CAN_AM_H(x) (CAN_AM00H+((x)*0x8))
645
646/* Mailbox Registers */
647#define CAN_MB00_DATA0 0xFFC02C00 /* Mailbox 0 Data Word 0 [15:0] Register */
648#define CAN_MB00_DATA1 0xFFC02C04 /* Mailbox 0 Data Word 1 [31:16] Register */
649#define CAN_MB00_DATA2 0xFFC02C08 /* Mailbox 0 Data Word 2 [47:32] Register */
650#define CAN_MB00_DATA3 0xFFC02C0C /* Mailbox 0 Data Word 3 [63:48] Register */
651#define CAN_MB00_LENGTH 0xFFC02C10 /* Mailbox 0 Data Length Code Register */
652#define CAN_MB00_TIMESTAMP 0xFFC02C14 /* Mailbox 0 Time Stamp Value Register */
653#define CAN_MB00_ID0 0xFFC02C18 /* Mailbox 0 Identifier Low Register */
654#define CAN_MB00_ID1 0xFFC02C1C /* Mailbox 0 Identifier High Register */
655
656#define CAN_MB01_DATA0 0xFFC02C20 /* Mailbox 1 Data Word 0 [15:0] Register */
657#define CAN_MB01_DATA1 0xFFC02C24 /* Mailbox 1 Data Word 1 [31:16] Register */
658#define CAN_MB01_DATA2 0xFFC02C28 /* Mailbox 1 Data Word 2 [47:32] Register */
659#define CAN_MB01_DATA3 0xFFC02C2C /* Mailbox 1 Data Word 3 [63:48] Register */
660#define CAN_MB01_LENGTH 0xFFC02C30 /* Mailbox 1 Data Length Code Register */
661#define CAN_MB01_TIMESTAMP 0xFFC02C34 /* Mailbox 1 Time Stamp Value Register */
662#define CAN_MB01_ID0 0xFFC02C38 /* Mailbox 1 Identifier Low Register */
663#define CAN_MB01_ID1 0xFFC02C3C /* Mailbox 1 Identifier High Register */
664
665#define CAN_MB02_DATA0 0xFFC02C40 /* Mailbox 2 Data Word 0 [15:0] Register */
666#define CAN_MB02_DATA1 0xFFC02C44 /* Mailbox 2 Data Word 1 [31:16] Register */
667#define CAN_MB02_DATA2 0xFFC02C48 /* Mailbox 2 Data Word 2 [47:32] Register */
668#define CAN_MB02_DATA3 0xFFC02C4C /* Mailbox 2 Data Word 3 [63:48] Register */
669#define CAN_MB02_LENGTH 0xFFC02C50 /* Mailbox 2 Data Length Code Register */
670#define CAN_MB02_TIMESTAMP 0xFFC02C54 /* Mailbox 2 Time Stamp Value Register */
671#define CAN_MB02_ID0 0xFFC02C58 /* Mailbox 2 Identifier Low Register */
672#define CAN_MB02_ID1 0xFFC02C5C /* Mailbox 2 Identifier High Register */
673
674#define CAN_MB03_DATA0 0xFFC02C60 /* Mailbox 3 Data Word 0 [15:0] Register */
675#define CAN_MB03_DATA1 0xFFC02C64 /* Mailbox 3 Data Word 1 [31:16] Register */
676#define CAN_MB03_DATA2 0xFFC02C68 /* Mailbox 3 Data Word 2 [47:32] Register */
677#define CAN_MB03_DATA3 0xFFC02C6C /* Mailbox 3 Data Word 3 [63:48] Register */
678#define CAN_MB03_LENGTH 0xFFC02C70 /* Mailbox 3 Data Length Code Register */
679#define CAN_MB03_TIMESTAMP 0xFFC02C74 /* Mailbox 3 Time Stamp Value Register */
680#define CAN_MB03_ID0 0xFFC02C78 /* Mailbox 3 Identifier Low Register */
681#define CAN_MB03_ID1 0xFFC02C7C /* Mailbox 3 Identifier High Register */
682
683#define CAN_MB04_DATA0 0xFFC02C80 /* Mailbox 4 Data Word 0 [15:0] Register */
684#define CAN_MB04_DATA1 0xFFC02C84 /* Mailbox 4 Data Word 1 [31:16] Register */
685#define CAN_MB04_DATA2 0xFFC02C88 /* Mailbox 4 Data Word 2 [47:32] Register */
686#define CAN_MB04_DATA3 0xFFC02C8C /* Mailbox 4 Data Word 3 [63:48] Register */
687#define CAN_MB04_LENGTH 0xFFC02C90 /* Mailbox 4 Data Length Code Register */
688#define CAN_MB04_TIMESTAMP 0xFFC02C94 /* Mailbox 4 Time Stamp Value Register */
689#define CAN_MB04_ID0 0xFFC02C98 /* Mailbox 4 Identifier Low Register */
690#define CAN_MB04_ID1 0xFFC02C9C /* Mailbox 4 Identifier High Register */
691
692#define CAN_MB05_DATA0 0xFFC02CA0 /* Mailbox 5 Data Word 0 [15:0] Register */
693#define CAN_MB05_DATA1 0xFFC02CA4 /* Mailbox 5 Data Word 1 [31:16] Register */
694#define CAN_MB05_DATA2 0xFFC02CA8 /* Mailbox 5 Data Word 2 [47:32] Register */
695#define CAN_MB05_DATA3 0xFFC02CAC /* Mailbox 5 Data Word 3 [63:48] Register */
696#define CAN_MB05_LENGTH 0xFFC02CB0 /* Mailbox 5 Data Length Code Register */
697#define CAN_MB05_TIMESTAMP 0xFFC02CB4 /* Mailbox 5 Time Stamp Value Register */
698#define CAN_MB05_ID0 0xFFC02CB8 /* Mailbox 5 Identifier Low Register */
699#define CAN_MB05_ID1 0xFFC02CBC /* Mailbox 5 Identifier High Register */
700
701#define CAN_MB06_DATA0 0xFFC02CC0 /* Mailbox 6 Data Word 0 [15:0] Register */
702#define CAN_MB06_DATA1 0xFFC02CC4 /* Mailbox 6 Data Word 1 [31:16] Register */
703#define CAN_MB06_DATA2 0xFFC02CC8 /* Mailbox 6 Data Word 2 [47:32] Register */
704#define CAN_MB06_DATA3 0xFFC02CCC /* Mailbox 6 Data Word 3 [63:48] Register */
705#define CAN_MB06_LENGTH 0xFFC02CD0 /* Mailbox 6 Data Length Code Register */
706#define CAN_MB06_TIMESTAMP 0xFFC02CD4 /* Mailbox 6 Time Stamp Value Register */
707#define CAN_MB06_ID0 0xFFC02CD8 /* Mailbox 6 Identifier Low Register */
708#define CAN_MB06_ID1 0xFFC02CDC /* Mailbox 6 Identifier High Register */
709
710#define CAN_MB07_DATA0 0xFFC02CE0 /* Mailbox 7 Data Word 0 [15:0] Register */
711#define CAN_MB07_DATA1 0xFFC02CE4 /* Mailbox 7 Data Word 1 [31:16] Register */
712#define CAN_MB07_DATA2 0xFFC02CE8 /* Mailbox 7 Data Word 2 [47:32] Register */
713#define CAN_MB07_DATA3 0xFFC02CEC /* Mailbox 7 Data Word 3 [63:48] Register */
714#define CAN_MB07_LENGTH 0xFFC02CF0 /* Mailbox 7 Data Length Code Register */
715#define CAN_MB07_TIMESTAMP 0xFFC02CF4 /* Mailbox 7 Time Stamp Value Register */
716#define CAN_MB07_ID0 0xFFC02CF8 /* Mailbox 7 Identifier Low Register */
717#define CAN_MB07_ID1 0xFFC02CFC /* Mailbox 7 Identifier High Register */
718
719#define CAN_MB08_DATA0 0xFFC02D00 /* Mailbox 8 Data Word 0 [15:0] Register */
720#define CAN_MB08_DATA1 0xFFC02D04 /* Mailbox 8 Data Word 1 [31:16] Register */
721#define CAN_MB08_DATA2 0xFFC02D08 /* Mailbox 8 Data Word 2 [47:32] Register */
722#define CAN_MB08_DATA3 0xFFC02D0C /* Mailbox 8 Data Word 3 [63:48] Register */
723#define CAN_MB08_LENGTH 0xFFC02D10 /* Mailbox 8 Data Length Code Register */
724#define CAN_MB08_TIMESTAMP 0xFFC02D14 /* Mailbox 8 Time Stamp Value Register */
725#define CAN_MB08_ID0 0xFFC02D18 /* Mailbox 8 Identifier Low Register */
726#define CAN_MB08_ID1 0xFFC02D1C /* Mailbox 8 Identifier High Register */
727
728#define CAN_MB09_DATA0 0xFFC02D20 /* Mailbox 9 Data Word 0 [15:0] Register */
729#define CAN_MB09_DATA1 0xFFC02D24 /* Mailbox 9 Data Word 1 [31:16] Register */
730#define CAN_MB09_DATA2 0xFFC02D28 /* Mailbox 9 Data Word 2 [47:32] Register */
731#define CAN_MB09_DATA3 0xFFC02D2C /* Mailbox 9 Data Word 3 [63:48] Register */
732#define CAN_MB09_LENGTH 0xFFC02D30 /* Mailbox 9 Data Length Code Register */
733#define CAN_MB09_TIMESTAMP 0xFFC02D34 /* Mailbox 9 Time Stamp Value Register */
734#define CAN_MB09_ID0 0xFFC02D38 /* Mailbox 9 Identifier Low Register */
735#define CAN_MB09_ID1 0xFFC02D3C /* Mailbox 9 Identifier High Register */
736
737#define CAN_MB10_DATA0 0xFFC02D40 /* Mailbox 10 Data Word 0 [15:0] Register */
738#define CAN_MB10_DATA1 0xFFC02D44 /* Mailbox 10 Data Word 1 [31:16] Register */
739#define CAN_MB10_DATA2 0xFFC02D48 /* Mailbox 10 Data Word 2 [47:32] Register */
740#define CAN_MB10_DATA3 0xFFC02D4C /* Mailbox 10 Data Word 3 [63:48] Register */
741#define CAN_MB10_LENGTH 0xFFC02D50 /* Mailbox 10 Data Length Code Register */
742#define CAN_MB10_TIMESTAMP 0xFFC02D54 /* Mailbox 10 Time Stamp Value Register */
743#define CAN_MB10_ID0 0xFFC02D58 /* Mailbox 10 Identifier Low Register */
744#define CAN_MB10_ID1 0xFFC02D5C /* Mailbox 10 Identifier High Register */
745
746#define CAN_MB11_DATA0 0xFFC02D60 /* Mailbox 11 Data Word 0 [15:0] Register */
747#define CAN_MB11_DATA1 0xFFC02D64 /* Mailbox 11 Data Word 1 [31:16] Register */
748#define CAN_MB11_DATA2 0xFFC02D68 /* Mailbox 11 Data Word 2 [47:32] Register */
749#define CAN_MB11_DATA3 0xFFC02D6C /* Mailbox 11 Data Word 3 [63:48] Register */
750#define CAN_MB11_LENGTH 0xFFC02D70 /* Mailbox 11 Data Length Code Register */
751#define CAN_MB11_TIMESTAMP 0xFFC02D74 /* Mailbox 11 Time Stamp Value Register */
752#define CAN_MB11_ID0 0xFFC02D78 /* Mailbox 11 Identifier Low Register */
753#define CAN_MB11_ID1 0xFFC02D7C /* Mailbox 11 Identifier High Register */
754
755#define CAN_MB12_DATA0 0xFFC02D80 /* Mailbox 12 Data Word 0 [15:0] Register */
756#define CAN_MB12_DATA1 0xFFC02D84 /* Mailbox 12 Data Word 1 [31:16] Register */
757#define CAN_MB12_DATA2 0xFFC02D88 /* Mailbox 12 Data Word 2 [47:32] Register */
758#define CAN_MB12_DATA3 0xFFC02D8C /* Mailbox 12 Data Word 3 [63:48] Register */
759#define CAN_MB12_LENGTH 0xFFC02D90 /* Mailbox 12 Data Length Code Register */
760#define CAN_MB12_TIMESTAMP 0xFFC02D94 /* Mailbox 12 Time Stamp Value Register */
761#define CAN_MB12_ID0 0xFFC02D98 /* Mailbox 12 Identifier Low Register */
762#define CAN_MB12_ID1 0xFFC02D9C /* Mailbox 12 Identifier High Register */
763
764#define CAN_MB13_DATA0 0xFFC02DA0 /* Mailbox 13 Data Word 0 [15:0] Register */
765#define CAN_MB13_DATA1 0xFFC02DA4 /* Mailbox 13 Data Word 1 [31:16] Register */
766#define CAN_MB13_DATA2 0xFFC02DA8 /* Mailbox 13 Data Word 2 [47:32] Register */
767#define CAN_MB13_DATA3 0xFFC02DAC /* Mailbox 13 Data Word 3 [63:48] Register */
768#define CAN_MB13_LENGTH 0xFFC02DB0 /* Mailbox 13 Data Length Code Register */
769#define CAN_MB13_TIMESTAMP 0xFFC02DB4 /* Mailbox 13 Time Stamp Value Register */
770#define CAN_MB13_ID0 0xFFC02DB8 /* Mailbox 13 Identifier Low Register */
771#define CAN_MB13_ID1 0xFFC02DBC /* Mailbox 13 Identifier High Register */
772
773#define CAN_MB14_DATA0 0xFFC02DC0 /* Mailbox 14 Data Word 0 [15:0] Register */
774#define CAN_MB14_DATA1 0xFFC02DC4 /* Mailbox 14 Data Word 1 [31:16] Register */
775#define CAN_MB14_DATA2 0xFFC02DC8 /* Mailbox 14 Data Word 2 [47:32] Register */
776#define CAN_MB14_DATA3 0xFFC02DCC /* Mailbox 14 Data Word 3 [63:48] Register */
777#define CAN_MB14_LENGTH 0xFFC02DD0 /* Mailbox 14 Data Length Code Register */
778#define CAN_MB14_TIMESTAMP 0xFFC02DD4 /* Mailbox 14 Time Stamp Value Register */
779#define CAN_MB14_ID0 0xFFC02DD8 /* Mailbox 14 Identifier Low Register */
780#define CAN_MB14_ID1 0xFFC02DDC /* Mailbox 14 Identifier High Register */
781
782#define CAN_MB15_DATA0 0xFFC02DE0 /* Mailbox 15 Data Word 0 [15:0] Register */
783#define CAN_MB15_DATA1 0xFFC02DE4 /* Mailbox 15 Data Word 1 [31:16] Register */
784#define CAN_MB15_DATA2 0xFFC02DE8 /* Mailbox 15 Data Word 2 [47:32] Register */
785#define CAN_MB15_DATA3 0xFFC02DEC /* Mailbox 15 Data Word 3 [63:48] Register */
786#define CAN_MB15_LENGTH 0xFFC02DF0 /* Mailbox 15 Data Length Code Register */
787#define CAN_MB15_TIMESTAMP 0xFFC02DF4 /* Mailbox 15 Time Stamp Value Register */
788#define CAN_MB15_ID0 0xFFC02DF8 /* Mailbox 15 Identifier Low Register */
789#define CAN_MB15_ID1 0xFFC02DFC /* Mailbox 15 Identifier High Register */
790
791#define CAN_MB16_DATA0 0xFFC02E00 /* Mailbox 16 Data Word 0 [15:0] Register */
792#define CAN_MB16_DATA1 0xFFC02E04 /* Mailbox 16 Data Word 1 [31:16] Register */
793#define CAN_MB16_DATA2 0xFFC02E08 /* Mailbox 16 Data Word 2 [47:32] Register */
794#define CAN_MB16_DATA3 0xFFC02E0C /* Mailbox 16 Data Word 3 [63:48] Register */
795#define CAN_MB16_LENGTH 0xFFC02E10 /* Mailbox 16 Data Length Code Register */
796#define CAN_MB16_TIMESTAMP 0xFFC02E14 /* Mailbox 16 Time Stamp Value Register */
797#define CAN_MB16_ID0 0xFFC02E18 /* Mailbox 16 Identifier Low Register */
798#define CAN_MB16_ID1 0xFFC02E1C /* Mailbox 16 Identifier High Register */
799
800#define CAN_MB17_DATA0 0xFFC02E20 /* Mailbox 17 Data Word 0 [15:0] Register */
801#define CAN_MB17_DATA1 0xFFC02E24 /* Mailbox 17 Data Word 1 [31:16] Register */
802#define CAN_MB17_DATA2 0xFFC02E28 /* Mailbox 17 Data Word 2 [47:32] Register */
803#define CAN_MB17_DATA3 0xFFC02E2C /* Mailbox 17 Data Word 3 [63:48] Register */
804#define CAN_MB17_LENGTH 0xFFC02E30 /* Mailbox 17 Data Length Code Register */
805#define CAN_MB17_TIMESTAMP 0xFFC02E34 /* Mailbox 17 Time Stamp Value Register */
806#define CAN_MB17_ID0 0xFFC02E38 /* Mailbox 17 Identifier Low Register */
807#define CAN_MB17_ID1 0xFFC02E3C /* Mailbox 17 Identifier High Register */
808
809#define CAN_MB18_DATA0 0xFFC02E40 /* Mailbox 18 Data Word 0 [15:0] Register */
810#define CAN_MB18_DATA1 0xFFC02E44 /* Mailbox 18 Data Word 1 [31:16] Register */
811#define CAN_MB18_DATA2 0xFFC02E48 /* Mailbox 18 Data Word 2 [47:32] Register */
812#define CAN_MB18_DATA3 0xFFC02E4C /* Mailbox 18 Data Word 3 [63:48] Register */
813#define CAN_MB18_LENGTH 0xFFC02E50 /* Mailbox 18 Data Length Code Register */
814#define CAN_MB18_TIMESTAMP 0xFFC02E54 /* Mailbox 18 Time Stamp Value Register */
815#define CAN_MB18_ID0 0xFFC02E58 /* Mailbox 18 Identifier Low Register */
816#define CAN_MB18_ID1 0xFFC02E5C /* Mailbox 18 Identifier High Register */
817
818#define CAN_MB19_DATA0 0xFFC02E60 /* Mailbox 19 Data Word 0 [15:0] Register */
819#define CAN_MB19_DATA1 0xFFC02E64 /* Mailbox 19 Data Word 1 [31:16] Register */
820#define CAN_MB19_DATA2 0xFFC02E68 /* Mailbox 19 Data Word 2 [47:32] Register */
821#define CAN_MB19_DATA3 0xFFC02E6C /* Mailbox 19 Data Word 3 [63:48] Register */
822#define CAN_MB19_LENGTH 0xFFC02E70 /* Mailbox 19 Data Length Code Register */
823#define CAN_MB19_TIMESTAMP 0xFFC02E74 /* Mailbox 19 Time Stamp Value Register */
824#define CAN_MB19_ID0 0xFFC02E78 /* Mailbox 19 Identifier Low Register */
825#define CAN_MB19_ID1 0xFFC02E7C /* Mailbox 19 Identifier High Register */
826
827#define CAN_MB20_DATA0 0xFFC02E80 /* Mailbox 20 Data Word 0 [15:0] Register */
828#define CAN_MB20_DATA1 0xFFC02E84 /* Mailbox 20 Data Word 1 [31:16] Register */
829#define CAN_MB20_DATA2 0xFFC02E88 /* Mailbox 20 Data Word 2 [47:32] Register */
830#define CAN_MB20_DATA3 0xFFC02E8C /* Mailbox 20 Data Word 3 [63:48] Register */
831#define CAN_MB20_LENGTH 0xFFC02E90 /* Mailbox 20 Data Length Code Register */
832#define CAN_MB20_TIMESTAMP 0xFFC02E94 /* Mailbox 20 Time Stamp Value Register */
833#define CAN_MB20_ID0 0xFFC02E98 /* Mailbox 20 Identifier Low Register */
834#define CAN_MB20_ID1 0xFFC02E9C /* Mailbox 20 Identifier High Register */
835
836#define CAN_MB21_DATA0 0xFFC02EA0 /* Mailbox 21 Data Word 0 [15:0] Register */
837#define CAN_MB21_DATA1 0xFFC02EA4 /* Mailbox 21 Data Word 1 [31:16] Register */
838#define CAN_MB21_DATA2 0xFFC02EA8 /* Mailbox 21 Data Word 2 [47:32] Register */
839#define CAN_MB21_DATA3 0xFFC02EAC /* Mailbox 21 Data Word 3 [63:48] Register */
840#define CAN_MB21_LENGTH 0xFFC02EB0 /* Mailbox 21 Data Length Code Register */
841#define CAN_MB21_TIMESTAMP 0xFFC02EB4 /* Mailbox 21 Time Stamp Value Register */
842#define CAN_MB21_ID0 0xFFC02EB8 /* Mailbox 21 Identifier Low Register */
843#define CAN_MB21_ID1 0xFFC02EBC /* Mailbox 21 Identifier High Register */
844
845#define CAN_MB22_DATA0 0xFFC02EC0 /* Mailbox 22 Data Word 0 [15:0] Register */
846#define CAN_MB22_DATA1 0xFFC02EC4 /* Mailbox 22 Data Word 1 [31:16] Register */
847#define CAN_MB22_DATA2 0xFFC02EC8 /* Mailbox 22 Data Word 2 [47:32] Register */
848#define CAN_MB22_DATA3 0xFFC02ECC /* Mailbox 22 Data Word 3 [63:48] Register */
849#define CAN_MB22_LENGTH 0xFFC02ED0 /* Mailbox 22 Data Length Code Register */
850#define CAN_MB22_TIMESTAMP 0xFFC02ED4 /* Mailbox 22 Time Stamp Value Register */
851#define CAN_MB22_ID0 0xFFC02ED8 /* Mailbox 22 Identifier Low Register */
852#define CAN_MB22_ID1 0xFFC02EDC /* Mailbox 22 Identifier High Register */
853
854#define CAN_MB23_DATA0 0xFFC02EE0 /* Mailbox 23 Data Word 0 [15:0] Register */
855#define CAN_MB23_DATA1 0xFFC02EE4 /* Mailbox 23 Data Word 1 [31:16] Register */
856#define CAN_MB23_DATA2 0xFFC02EE8 /* Mailbox 23 Data Word 2 [47:32] Register */
857#define CAN_MB23_DATA3 0xFFC02EEC /* Mailbox 23 Data Word 3 [63:48] Register */
858#define CAN_MB23_LENGTH 0xFFC02EF0 /* Mailbox 23 Data Length Code Register */
859#define CAN_MB23_TIMESTAMP 0xFFC02EF4 /* Mailbox 23 Time Stamp Value Register */
860#define CAN_MB23_ID0 0xFFC02EF8 /* Mailbox 23 Identifier Low Register */
861#define CAN_MB23_ID1 0xFFC02EFC /* Mailbox 23 Identifier High Register */
862
863#define CAN_MB24_DATA0 0xFFC02F00 /* Mailbox 24 Data Word 0 [15:0] Register */
864#define CAN_MB24_DATA1 0xFFC02F04 /* Mailbox 24 Data Word 1 [31:16] Register */
865#define CAN_MB24_DATA2 0xFFC02F08 /* Mailbox 24 Data Word 2 [47:32] Register */
866#define CAN_MB24_DATA3 0xFFC02F0C /* Mailbox 24 Data Word 3 [63:48] Register */
867#define CAN_MB24_LENGTH 0xFFC02F10 /* Mailbox 24 Data Length Code Register */
868#define CAN_MB24_TIMESTAMP 0xFFC02F14 /* Mailbox 24 Time Stamp Value Register */
869#define CAN_MB24_ID0 0xFFC02F18 /* Mailbox 24 Identifier Low Register */
870#define CAN_MB24_ID1 0xFFC02F1C /* Mailbox 24 Identifier High Register */
871
872#define CAN_MB25_DATA0 0xFFC02F20 /* Mailbox 25 Data Word 0 [15:0] Register */
873#define CAN_MB25_DATA1 0xFFC02F24 /* Mailbox 25 Data Word 1 [31:16] Register */
874#define CAN_MB25_DATA2 0xFFC02F28 /* Mailbox 25 Data Word 2 [47:32] Register */
875#define CAN_MB25_DATA3 0xFFC02F2C /* Mailbox 25 Data Word 3 [63:48] Register */
876#define CAN_MB25_LENGTH 0xFFC02F30 /* Mailbox 25 Data Length Code Register */
877#define CAN_MB25_TIMESTAMP 0xFFC02F34 /* Mailbox 25 Time Stamp Value Register */
878#define CAN_MB25_ID0 0xFFC02F38 /* Mailbox 25 Identifier Low Register */
879#define CAN_MB25_ID1 0xFFC02F3C /* Mailbox 25 Identifier High Register */
880
881#define CAN_MB26_DATA0 0xFFC02F40 /* Mailbox 26 Data Word 0 [15:0] Register */
882#define CAN_MB26_DATA1 0xFFC02F44 /* Mailbox 26 Data Word 1 [31:16] Register */
883#define CAN_MB26_DATA2 0xFFC02F48 /* Mailbox 26 Data Word 2 [47:32] Register */
884#define CAN_MB26_DATA3 0xFFC02F4C /* Mailbox 26 Data Word 3 [63:48] Register */
885#define CAN_MB26_LENGTH 0xFFC02F50 /* Mailbox 26 Data Length Code Register */
886#define CAN_MB26_TIMESTAMP 0xFFC02F54 /* Mailbox 26 Time Stamp Value Register */
887#define CAN_MB26_ID0 0xFFC02F58 /* Mailbox 26 Identifier Low Register */
888#define CAN_MB26_ID1 0xFFC02F5C /* Mailbox 26 Identifier High Register */
889
890#define CAN_MB27_DATA0 0xFFC02F60 /* Mailbox 27 Data Word 0 [15:0] Register */
891#define CAN_MB27_DATA1 0xFFC02F64 /* Mailbox 27 Data Word 1 [31:16] Register */
892#define CAN_MB27_DATA2 0xFFC02F68 /* Mailbox 27 Data Word 2 [47:32] Register */
893#define CAN_MB27_DATA3 0xFFC02F6C /* Mailbox 27 Data Word 3 [63:48] Register */
894#define CAN_MB27_LENGTH 0xFFC02F70 /* Mailbox 27 Data Length Code Register */
895#define CAN_MB27_TIMESTAMP 0xFFC02F74 /* Mailbox 27 Time Stamp Value Register */
896#define CAN_MB27_ID0 0xFFC02F78 /* Mailbox 27 Identifier Low Register */
897#define CAN_MB27_ID1 0xFFC02F7C /* Mailbox 27 Identifier High Register */
898
899#define CAN_MB28_DATA0 0xFFC02F80 /* Mailbox 28 Data Word 0 [15:0] Register */
900#define CAN_MB28_DATA1 0xFFC02F84 /* Mailbox 28 Data Word 1 [31:16] Register */
901#define CAN_MB28_DATA2 0xFFC02F88 /* Mailbox 28 Data Word 2 [47:32] Register */
902#define CAN_MB28_DATA3 0xFFC02F8C /* Mailbox 28 Data Word 3 [63:48] Register */
903#define CAN_MB28_LENGTH 0xFFC02F90 /* Mailbox 28 Data Length Code Register */
904#define CAN_MB28_TIMESTAMP 0xFFC02F94 /* Mailbox 28 Time Stamp Value Register */
905#define CAN_MB28_ID0 0xFFC02F98 /* Mailbox 28 Identifier Low Register */
906#define CAN_MB28_ID1 0xFFC02F9C /* Mailbox 28 Identifier High Register */
907
908#define CAN_MB29_DATA0 0xFFC02FA0 /* Mailbox 29 Data Word 0 [15:0] Register */
909#define CAN_MB29_DATA1 0xFFC02FA4 /* Mailbox 29 Data Word 1 [31:16] Register */
910#define CAN_MB29_DATA2 0xFFC02FA8 /* Mailbox 29 Data Word 2 [47:32] Register */
911#define CAN_MB29_DATA3 0xFFC02FAC /* Mailbox 29 Data Word 3 [63:48] Register */
912#define CAN_MB29_LENGTH 0xFFC02FB0 /* Mailbox 29 Data Length Code Register */
913#define CAN_MB29_TIMESTAMP 0xFFC02FB4 /* Mailbox 29 Time Stamp Value Register */
914#define CAN_MB29_ID0 0xFFC02FB8 /* Mailbox 29 Identifier Low Register */
915#define CAN_MB29_ID1 0xFFC02FBC /* Mailbox 29 Identifier High Register */
916
917#define CAN_MB30_DATA0 0xFFC02FC0 /* Mailbox 30 Data Word 0 [15:0] Register */
918#define CAN_MB30_DATA1 0xFFC02FC4 /* Mailbox 30 Data Word 1 [31:16] Register */
919#define CAN_MB30_DATA2 0xFFC02FC8 /* Mailbox 30 Data Word 2 [47:32] Register */
920#define CAN_MB30_DATA3 0xFFC02FCC /* Mailbox 30 Data Word 3 [63:48] Register */
921#define CAN_MB30_LENGTH 0xFFC02FD0 /* Mailbox 30 Data Length Code Register */
922#define CAN_MB30_TIMESTAMP 0xFFC02FD4 /* Mailbox 30 Time Stamp Value Register */
923#define CAN_MB30_ID0 0xFFC02FD8 /* Mailbox 30 Identifier Low Register */
924#define CAN_MB30_ID1 0xFFC02FDC /* Mailbox 30 Identifier High Register */
925
926#define CAN_MB31_DATA0 0xFFC02FE0 /* Mailbox 31 Data Word 0 [15:0] Register */
927#define CAN_MB31_DATA1 0xFFC02FE4 /* Mailbox 31 Data Word 1 [31:16] Register */
928#define CAN_MB31_DATA2 0xFFC02FE8 /* Mailbox 31 Data Word 2 [47:32] Register */
929#define CAN_MB31_DATA3 0xFFC02FEC /* Mailbox 31 Data Word 3 [63:48] Register */
930#define CAN_MB31_LENGTH 0xFFC02FF0 /* Mailbox 31 Data Length Code Register */
931#define CAN_MB31_TIMESTAMP 0xFFC02FF4 /* Mailbox 31 Time Stamp Value Register */
932#define CAN_MB31_ID0 0xFFC02FF8 /* Mailbox 31 Identifier Low Register */
933#define CAN_MB31_ID1 0xFFC02FFC /* Mailbox 31 Identifier High Register */
934
935/* CAN Mailbox Area Macros */
936#define CAN_MB_ID1(x) (CAN_MB00_ID1+((x)*0x20))
937#define CAN_MB_ID0(x) (CAN_MB00_ID0+((x)*0x20))
938#define CAN_MB_TIMESTAMP(x) (CAN_MB00_TIMESTAMP+((x)*0x20))
939#define CAN_MB_LENGTH(x) (CAN_MB00_LENGTH+((x)*0x20))
940#define CAN_MB_DATA3(x) (CAN_MB00_DATA3+((x)*0x20))
941#define CAN_MB_DATA2(x) (CAN_MB00_DATA2+((x)*0x20))
942#define CAN_MB_DATA1(x) (CAN_MB00_DATA1+((x)*0x20))
943#define CAN_MB_DATA0(x) (CAN_MB00_DATA0+((x)*0x20))
944
945/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
946#define PORTF_FER 0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
947#define PORTG_FER 0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
948#define PORTH_FER 0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
949#define BFIN_PORT_MUX 0xFFC0320C /* Port Multiplexer Control Register */
950
951/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
952#define HMDMA0_CONTROL 0xFFC03300 /* Handshake MDMA0 Control Register */
953#define HMDMA0_ECINIT 0xFFC03304 /* HMDMA0 Initial Edge Count Register */
954#define HMDMA0_BCINIT 0xFFC03308 /* HMDMA0 Initial Block Count Register */
955#define HMDMA0_ECURGENT 0xFFC0330C /* HMDMA0 Urgent Edge Count Threshhold Register */
956#define HMDMA0_ECOVERFLOW 0xFFC03310 /* HMDMA0 Edge Count Overflow Interrupt Register */
957#define HMDMA0_ECOUNT 0xFFC03314 /* HMDMA0 Current Edge Count Register */
958#define HMDMA0_BCOUNT 0xFFC03318 /* HMDMA0 Current Block Count Register */
959
960#define HMDMA1_CONTROL 0xFFC03340 /* Handshake MDMA1 Control Register */
961#define HMDMA1_ECINIT 0xFFC03344 /* HMDMA1 Initial Edge Count Register */
962#define HMDMA1_BCINIT 0xFFC03348 /* HMDMA1 Initial Block Count Register */
963#define HMDMA1_ECURGENT 0xFFC0334C /* HMDMA1 Urgent Edge Count Threshhold Register */
964#define HMDMA1_ECOVERFLOW 0xFFC03350 /* HMDMA1 Edge Count Overflow Interrupt Register */
965#define HMDMA1_ECOUNT 0xFFC03354 /* HMDMA1 Current Edge Count Register */
966#define HMDMA1_BCOUNT 0xFFC03358 /* HMDMA1 Current Block Count Register */
967
968/***********************************************************************************
969** System MMR Register Bits And Macros
970**
971** Disclaimer: All macros are intended to make C and Assembly code more readable.
972** Use these macros carefully, as any that do left shifts for field
973** depositing will result in the lower order bits being destroyed. Any
974** macro that shifts left to properly position the bit-field should be
975** used as part of an OR to initialize a register and NOT as a dynamic
976** modifier UNLESS the lower order bits are saved and ORed back in when
977** the macro is used.
978*************************************************************************************/
979/*
980** ********************* PLL AND RESET MASKS ****************************************/
981/* PLL_CTL Masks */
982#define DF 0x0001 /* 0: PLL = CLKIN, 1: PLL = CLKIN/2 */
983#define PLL_OFF 0x0002 /* PLL Not Powered */
984#define STOPCK 0x0008 /* Core Clock Off */
985#define PDWN 0x0020 /* Enter Deep Sleep Mode */
986#define IN_DELAY 0x0040 /* Add 200ps Delay To EBIU Input Latches */
987#define OUT_DELAY 0x0080 /* Add 200ps Delay To EBIU Output Signals */
988#define BYPASS 0x0100 /* Bypass the PLL */
989#define MSEL 0x7E00 /* Multiplier Select For CCLK/VCO Factors */
990/* PLL_CTL Macros (Only Use With Logic OR While Setting Lower Order Bits) */
991#define SET_MSEL(x) (((x)&0x3F) << 0x9) /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
992
993/* PLL_DIV Masks */
994#define SSEL 0x000F /* System Select */
995#define CSEL 0x0030 /* Core Select */
996#define CSEL_DIV1 0x0000 /* CCLK = VCO / 1 */
997#define CSEL_DIV2 0x0010 /* CCLK = VCO / 2 */
998#define CSEL_DIV4 0x0020 /* CCLK = VCO / 4 */
999#define CSEL_DIV8 0x0030 /* CCLK = VCO / 8 */
1000/* PLL_DIV Macros */
1001#define SET_SSEL(x) ((x)&0xF) /* Set SSEL = 0-15 --> SCLK = VCO/SSEL */
1002
1003/* VR_CTL Masks */
1004#define FREQ 0x0003 /* Switching Oscillator Frequency For Regulator */
1005#define HIBERNATE 0x0000 /* Powerdown/Bypass On-Board Regulation */
1006#define FREQ_333 0x0001 /* Switching Frequency Is 333 kHz */
1007#define FREQ_667 0x0002 /* Switching Frequency Is 667 kHz */
1008#define FREQ_1000 0x0003 /* Switching Frequency Is 1 MHz */
1009
1010#define GAIN 0x000C /* Voltage Level Gain */
1011#define GAIN_5 0x0000 /* GAIN = 5 */
1012#define GAIN_10 0x0004 /* GAIN = 10 */
1013#define GAIN_20 0x0008 /* GAIN = 20 */
1014#define GAIN_50 0x000C /* GAIN = 50 */
1015
1016#define VLEV 0x00F0 /* Internal Voltage Level */
1017#define VLEV_085 0x0060 /* VLEV = 0.85 V (-5% - +10% Accuracy) */
1018#define VLEV_090 0x0070 /* VLEV = 0.90 V (-5% - +10% Accuracy) */
1019#define VLEV_095 0x0080 /* VLEV = 0.95 V (-5% - +10% Accuracy) */
1020#define VLEV_100 0x0090 /* VLEV = 1.00 V (-5% - +10% Accuracy) */
1021#define VLEV_105 0x00A0 /* VLEV = 1.05 V (-5% - +10% Accuracy) */
1022#define VLEV_110 0x00B0 /* VLEV = 1.10 V (-5% - +10% Accuracy) */
1023#define VLEV_115 0x00C0 /* VLEV = 1.15 V (-5% - +10% Accuracy) */
1024#define VLEV_120 0x00D0 /* VLEV = 1.20 V (-5% - +10% Accuracy) */
1025#define VLEV_125 0x00E0 /* VLEV = 1.25 V (-5% - +10% Accuracy) */
1026#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */
1027
1028#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
1029#define PHYWE 0x0200 /* Enable PHY Wakeup From Hibernate */
1030#define CANWE 0x0400 /* Enable CAN Wakeup From Hibernate */
1031#define PHYCLKOE 0x4000 /* PHY Clock Output Enable */
1032#define CKELOW 0x8000 /* Enable Drive CKE Low During Reset */
1033
1034/* PLL_STAT Masks */
1035#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
1036#define FULL_ON 0x0002 /* Processor In Full On Mode */
1037#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
1038#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
1039
1040/* CHIPID Masks */
1041#define CHIPID_VERSION 0xF0000000
1042#define CHIPID_FAMILY 0x0FFFF000
1043#define CHIPID_MANUFACTURE 0x00000FFE
1044
1045/* SWRST Masks */
1046#define SYSTEM_RESET 0x0007 /* Initiates A System Software Reset */
1047#define DOUBLE_FAULT 0x0008 /* Core Double Fault Causes Reset */
1048#define RESET_DOUBLE 0x2000 /* SW Reset Generated By Core Double-Fault */
1049#define RESET_WDOG 0x4000 /* SW Reset Generated By Watchdog Timer */
1050#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
1051
1052/* SYSCR Masks */
1053#define BMODE 0x0006 /* Boot Mode - Latched During HW Reset From Mode Pins */
1054#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */
1055
1056/* ************* SYSTEM INTERRUPT CONTROLLER MASKS *************************************/
1057
1058/* SIC_IAR0 Macros */
1059#define P0_IVG(x) (((x)&0xF)-7) /* Peripheral #0 assigned IVG #x */
1060#define P1_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #1 assigned IVG #x */
1061#define P2_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #2 assigned IVG #x */
1062#define P3_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #3 assigned IVG #x */
1063#define P4_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #4 assigned IVG #x */
1064#define P5_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #5 assigned IVG #x */
1065#define P6_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #6 assigned IVG #x */
1066#define P7_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #7 assigned IVG #x */
1067
1068/* SIC_IAR1 Macros */
1069#define P8_IVG(x) (((x)&0xF)-7) /* Peripheral #8 assigned IVG #x */
1070#define P9_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #9 assigned IVG #x */
1071#define P10_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #10 assigned IVG #x */
1072#define P11_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #11 assigned IVG #x */
1073#define P12_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #12 assigned IVG #x */
1074#define P13_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #13 assigned IVG #x */
1075#define P14_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #14 assigned IVG #x */
1076#define P15_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #15 assigned IVG #x */
1077
1078/* SIC_IAR2 Macros */
1079#define P16_IVG(x) (((x)&0xF)-7) /* Peripheral #16 assigned IVG #x */
1080#define P17_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #17 assigned IVG #x */
1081#define P18_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #18 assigned IVG #x */
1082#define P19_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #19 assigned IVG #x */
1083#define P20_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #20 assigned IVG #x */
1084#define P21_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #21 assigned IVG #x */
1085#define P22_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #22 assigned IVG #x */
1086#define P23_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #23 assigned IVG #x */
1087
1088/* SIC_IAR3 Macros */
1089#define P24_IVG(x) (((x)&0xF)-7) /* Peripheral #24 assigned IVG #x */
1090#define P25_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #25 assigned IVG #x */
1091#define P26_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #26 assigned IVG #x */
1092#define P27_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #27 assigned IVG #x */
1093#define P28_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #28 assigned IVG #x */
1094#define P29_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #29 assigned IVG #x */
1095#define P30_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #30 assigned IVG #x */
1096#define P31_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #31 assigned IVG #x */
1097
1098/* SIC_IMASK Masks */
1099#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
1100#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
1101#define SIC_MASK(x) (1 << ((x)&0x1F)) /* Mask Peripheral #x interrupt */
1102#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Unmask Peripheral #x interrupt */
1103
1104/* SIC_IWR Masks */
1105#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
1106#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
1107#define IWR_ENABLE(x) (1 << ((x)&0x1F)) /* Wakeup Enable Peripheral #x */
1108#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Wakeup Disable Peripheral #x */
1109
1110/* *************** WATCHDOG TIMER MASKS *******************************************/
1111/* WDOG_CTL Masks */
1112#define WDOG_RESET 0x0000 /* Generate Reset Event */
1113#define WDOG_NMI 0x0002 /* Generate Non-Maskable Interrupt (NMI) Event */
1114#define WDOG_GPI 0x0004 /* Generate General Purpose (GP) Interrupt */
1115#define WDOG_NONE 0x0006 /* Disable Watchdog Timer Interrupts */
1116#define TMR_EN 0x0FF0 /* Watchdog Counter Enable */
1117#define TMR_DIS 0x0AD0 /* Watchdog Counter Disable */
1118#define TRO 0x8000 /* Watchdog Expired */
1119
1120/* ************** UART CONTROLLER MASKS *************************/
1121/* UARTx_LCR Masks */
1122#define WLS(x) ((((x)&0x3)-5) & 0x03) /* Word Length Select */
1123#define STB 0x04 /* Stop Bits */
1124#define PEN 0x08 /* Parity Enable */
1125#define EPS 0x10 /* Even Parity Select */
1126#define STP 0x20 /* Stick Parity */
1127#define SB 0x40 /* Set Break */
1128#define DLAB 0x80 /* Divisor Latch Access */
1129
1130/* UARTx_MCR Mask */
1131#define LOOP 0x10 /* Loopback Mode Enable */
1132
1133/* UARTx_LSR Masks */
1134#define DR 0x01 /* Data Ready */
1135#define OE 0x02 /* Overrun Error */
1136#define PE 0x04 /* Parity Error */
1137#define FE 0x08 /* Framing Error */
1138#define BI 0x10 /* Break Interrupt */
1139#define THRE 0x20 /* THR Empty */
1140#define TEMT 0x40 /* TSR and UART_THR Empty */
1141
1142/* UARTx_IER Masks */
1143#define ERBFI 0x01 /* Enable Receive Buffer Full Interrupt */
1144#define ETBEI 0x02 /* Enable Transmit Buffer Empty Interrupt */
1145#define ELSI 0x04 /* Enable RX Status Interrupt */
1146
1147/* UARTx_IIR Masks */
1148#define NINT 0x01 /* Pending Interrupt */
1149#define IIR_TX_READY 0x02 /* UART_THR empty */
1150#define IIR_RX_READY 0x04 /* Receive data ready */
1151#define IIR_LINE_CHANGE 0x06 /* Receive line status */
1152#define IIR_STATUS 0x06
1153
1154/* UARTx_GCTL Masks */
1155#define UCEN 0x01 /* Enable UARTx Clocks */
1156#define IREN 0x02 /* Enable IrDA Mode */
1157#define TPOLC 0x04 /* IrDA TX Polarity Change */
1158#define RPOLC 0x08 /* IrDA RX Polarity Change */
1159#define FPE 0x10 /* Force Parity Error On Transmit */
1160#define FFE 0x20 /* Force Framing Error On Transmit */
1161
1162/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS ****************************/
1163/* SPI_CTL Masks */
1164#define TIMOD 0x0003 /* Transfer Initiate Mode */
1165#define RDBR_CORE 0x0000 /* RDBR Read Initiates, IRQ When RDBR Full */
1166#define TDBR_CORE 0x0001 /* TDBR Write Initiates, IRQ When TDBR Empty */
1167#define RDBR_DMA 0x0002 /* DMA Read, DMA Until FIFO Empty */
1168#define TDBR_DMA 0x0003 /* DMA Write, DMA Until FIFO Full */
1169#define SZ 0x0004 /* Send Zero (When TDBR Empty, Send Zero/Last*) */
1170#define GM 0x0008 /* Get More (When RDBR Full, Overwrite/Discard*) */
1171#define PSSE 0x0010 /* Slave-Select Input Enable */
1172#define EMISO 0x0020 /* Enable MISO As Output */
1173#define SPI_SIZE 0x0100 /* Size of Words (16/8* Bits) */
1174#define LSBF 0x0200 /* LSB First */
1175#define CPHA 0x0400 /* Clock Phase */
1176#define CPOL 0x0800 /* Clock Polarity */
1177#define MSTR 0x1000 /* Master/Slave* */
1178#define WOM 0x2000 /* Write Open Drain Master */
1179#define SPE 0x4000 /* SPI Enable */
1180
1181/* SPI_FLG Masks */
1182#define FLS1 0x0002 /* Enables SPI_FLOUT1 as SPI Slave-Select Output */
1183#define FLS2 0x0004 /* Enables SPI_FLOUT2 as SPI Slave-Select Output */
1184#define FLS3 0x0008 /* Enables SPI_FLOUT3 as SPI Slave-Select Output */
1185#define FLS4 0x0010 /* Enables SPI_FLOUT4 as SPI Slave-Select Output */
1186#define FLS5 0x0020 /* Enables SPI_FLOUT5 as SPI Slave-Select Output */
1187#define FLS6 0x0040 /* Enables SPI_FLOUT6 as SPI Slave-Select Output */
1188#define FLS7 0x0080 /* Enables SPI_FLOUT7 as SPI Slave-Select Output */
1189#define FLG1 0xFDFF /* Activates SPI_FLOUT1 */
1190#define FLG2 0xFBFF /* Activates SPI_FLOUT2 */
1191#define FLG3 0xF7FF /* Activates SPI_FLOUT3 */
1192#define FLG4 0xEFFF /* Activates SPI_FLOUT4 */
1193#define FLG5 0xDFFF /* Activates SPI_FLOUT5 */
1194#define FLG6 0xBFFF /* Activates SPI_FLOUT6 */
1195#define FLG7 0x7FFF /* Activates SPI_FLOUT7 */
1196
1197/* SPI_STAT Masks */
1198#define SPIF 0x0001 /* SPI Finished (Single-Word Transfer Complete) */
1199#define MODF 0x0002 /* Mode Fault Error (Another Device Tried To Become Master) */
1200#define TXE 0x0004 /* Transmission Error (Data Sent With No New Data In TDBR) */
1201#define TXS 0x0008 /* SPI_TDBR Data Buffer Status (Full/Empty*) */
1202#define RBSY 0x0010 /* Receive Error (Data Received With RDBR Full) */
1203#define RXS 0x0020 /* SPI_RDBR Data Buffer Status (Full/Empty*) */
1204#define TXCOL 0x0040 /* Transmit Collision Error (Corrupt Data May Have Been Sent) */
1205
1206/* **************** GENERAL PURPOSE TIMER MASKS **********************/
1207/* TIMER_ENABLE Masks */
1208#define TIMEN0 0x0001 /* Enable Timer 0 */
1209#define TIMEN1 0x0002 /* Enable Timer 1 */
1210#define TIMEN2 0x0004 /* Enable Timer 2 */
1211#define TIMEN3 0x0008 /* Enable Timer 3 */
1212#define TIMEN4 0x0010 /* Enable Timer 4 */
1213#define TIMEN5 0x0020 /* Enable Timer 5 */
1214#define TIMEN6 0x0040 /* Enable Timer 6 */
1215#define TIMEN7 0x0080 /* Enable Timer 7 */
1216
1217/* TIMER_DISABLE Masks */
1218#define TIMDIS0 TIMEN0 /* Disable Timer 0 */
1219#define TIMDIS1 TIMEN1 /* Disable Timer 1 */
1220#define TIMDIS2 TIMEN2 /* Disable Timer 2 */
1221#define TIMDIS3 TIMEN3 /* Disable Timer 3 */
1222#define TIMDIS4 TIMEN4 /* Disable Timer 4 */
1223#define TIMDIS5 TIMEN5 /* Disable Timer 5 */
1224#define TIMDIS6 TIMEN6 /* Disable Timer 6 */
1225#define TIMDIS7 TIMEN7 /* Disable Timer 7 */
1226
1227/* TIMER_STATUS Masks */
1228#define TIMIL0 0x00000001 /* Timer 0 Interrupt */
1229#define TIMIL1 0x00000002 /* Timer 1 Interrupt */
1230#define TIMIL2 0x00000004 /* Timer 2 Interrupt */
1231#define TIMIL3 0x00000008 /* Timer 3 Interrupt */
1232#define TOVL_ERR0 0x00000010 /* Timer 0 Counter Overflow */
1233#define TOVL_ERR1 0x00000020 /* Timer 1 Counter Overflow */
1234#define TOVL_ERR2 0x00000040 /* Timer 2 Counter Overflow */
1235#define TOVL_ERR3 0x00000080 /* Timer 3 Counter Overflow */
1236#define TRUN0 0x00001000 /* Timer 0 Slave Enable Status */
1237#define TRUN1 0x00002000 /* Timer 1 Slave Enable Status */
1238#define TRUN2 0x00004000 /* Timer 2 Slave Enable Status */
1239#define TRUN3 0x00008000 /* Timer 3 Slave Enable Status */
1240#define TIMIL4 0x00010000 /* Timer 4 Interrupt */
1241#define TIMIL5 0x00020000 /* Timer 5 Interrupt */
1242#define TIMIL6 0x00040000 /* Timer 6 Interrupt */
1243#define TIMIL7 0x00080000 /* Timer 7 Interrupt */
1244#define TOVL_ERR4 0x00100000 /* Timer 4 Counter Overflow */
1245#define TOVL_ERR5 0x00200000 /* Timer 5 Counter Overflow */
1246#define TOVL_ERR6 0x00400000 /* Timer 6 Counter Overflow */
1247#define TOVL_ERR7 0x00800000 /* Timer 7 Counter Overflow */
1248#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */
1249#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */
1250#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */
1251#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */
1252
1253/* TIMERx_CONFIG Masks */
1254#define PWM_OUT 0x0001 /* Pulse-Width Modulation Output Mode */
1255#define WDTH_CAP 0x0002 /* Width Capture Input Mode */
1256#define EXT_CLK 0x0003 /* External Clock Mode */
1257#define PULSE_HI 0x0004 /* Action Pulse (Positive/Negative*) */
1258#define PERIOD_CNT 0x0008 /* Period Count */
1259#define IRQ_ENA 0x0010 /* Interrupt Request Enable */
1260#define TIN_SEL 0x0020 /* Timer Input Select */
1261#define OUT_DIS 0x0040 /* Output Pad Disable */
1262#define CLK_SEL 0x0080 /* Timer Clock Select */
1263#define TOGGLE_HI 0x0100 /* PWM_OUT PULSE_HI Toggle Mode */
1264#define EMU_RUN 0x0200 /* Emulation Behavior Select */
1265#define ERR_TYP 0xC000 /* Error Type */
1266
1267/* ****************** GPIO PORTS F, G, H MASKS ***********************/
1268/* General Purpose IO (0xFFC00700 - 0xFFC007FF) Masks */
1269/* Port F Masks */
1270#define PF0 0x0001
1271#define PF1 0x0002
1272#define PF2 0x0004
1273#define PF3 0x0008
1274#define PF4 0x0010
1275#define PF5 0x0020
1276#define PF6 0x0040
1277#define PF7 0x0080
1278#define PF8 0x0100
1279#define PF9 0x0200
1280#define PF10 0x0400
1281#define PF11 0x0800
1282#define PF12 0x1000
1283#define PF13 0x2000
1284#define PF14 0x4000
1285#define PF15 0x8000
1286
1287/* Port G Masks */
1288#define PG0 0x0001
1289#define PG1 0x0002
1290#define PG2 0x0004
1291#define PG3 0x0008
1292#define PG4 0x0010
1293#define PG5 0x0020
1294#define PG6 0x0040
1295#define PG7 0x0080
1296#define PG8 0x0100
1297#define PG9 0x0200
1298#define PG10 0x0400
1299#define PG11 0x0800
1300#define PG12 0x1000
1301#define PG13 0x2000
1302#define PG14 0x4000
1303#define PG15 0x8000
1304
1305/* Port H Masks */
1306#define PH0 0x0001
1307#define PH1 0x0002
1308#define PH2 0x0004
1309#define PH3 0x0008
1310#define PH4 0x0010
1311#define PH5 0x0020
1312#define PH6 0x0040
1313#define PH7 0x0080
1314#define PH8 0x0100
1315#define PH9 0x0200
1316#define PH10 0x0400
1317#define PH11 0x0800
1318#define PH12 0x1000
1319#define PH13 0x2000
1320#define PH14 0x4000
1321#define PH15 0x8000
1322
1323/* ******************* SERIAL PORT MASKS **************************************/
1324/* SPORTx_TCR1 Masks */
1325#define TSPEN 0x0001 /* Transmit Enable */
1326#define ITCLK 0x0002 /* Internal Transmit Clock Select */
1327#define DTYPE_NORM 0x0004 /* Data Format Normal */
1328#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1329#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1330#define TLSBIT 0x0010 /* Transmit Bit Order */
1331#define ITFS 0x0200 /* Internal Transmit Frame Sync Select */
1332#define TFSR 0x0400 /* Transmit Frame Sync Required Select */
1333#define DITFS 0x0800 /* Data-Independent Transmit Frame Sync Select */
1334#define LTFS 0x1000 /* Low Transmit Frame Sync Select */
1335#define LATFS 0x2000 /* Late Transmit Frame Sync Select */
1336#define TCKFE 0x4000 /* Clock Falling Edge Select */
1337
1338/* SPORTx_TCR2 Masks and Macro */
1339#define SLEN(x) ((x)&0x1F) /* SPORT TX Word Length (2 - 31) */
1340#define TXSE 0x0100 /* TX Secondary Enable */
1341#define TSFSE 0x0200 /* Transmit Stereo Frame Sync Enable */
1342#define TRFST 0x0400 /* Left/Right Order (1 = Right Channel 1st) */
1343
1344/* SPORTx_RCR1 Masks */
1345#define RSPEN 0x0001 /* Receive Enable */
1346#define IRCLK 0x0002 /* Internal Receive Clock Select */
1347#define DTYPE_NORM 0x0004 /* Data Format Normal */
1348#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1349#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1350#define RLSBIT 0x0010 /* Receive Bit Order */
1351#define IRFS 0x0200 /* Internal Receive Frame Sync Select */
1352#define RFSR 0x0400 /* Receive Frame Sync Required Select */
1353#define LRFS 0x1000 /* Low Receive Frame Sync Select */
1354#define LARFS 0x2000 /* Late Receive Frame Sync Select */
1355#define RCKFE 0x4000 /* Clock Falling Edge Select */
1356
1357/* SPORTx_RCR2 Masks */
1358#define SLEN(x) ((x)&0x1F) /* SPORT RX Word Length (2 - 31) */
1359#define RXSE 0x0100 /* RX Secondary Enable */
1360#define RSFSE 0x0200 /* RX Stereo Frame Sync Enable */
1361#define RRFST 0x0400 /* Right-First Data Order */
1362
1363/* SPORTx_STAT Masks */
1364#define RXNE 0x0001 /* Receive FIFO Not Empty Status */
1365#define RUVF 0x0002 /* Sticky Receive Underflow Status */
1366#define ROVF 0x0004 /* Sticky Receive Overflow Status */
1367#define TXF 0x0008 /* Transmit FIFO Full Status */
1368#define TUVF 0x0010 /* Sticky Transmit Underflow Status */
1369#define TOVF 0x0020 /* Sticky Transmit Overflow Status */
1370#define TXHRE 0x0040 /* Transmit Hold Register Empty */
1371
1372/* SPORTx_MCMC1 Macros */
1373#define SP_WOFF(x) ((x) & 0x3FF) /* Multichannel Window Offset Field */
1374
1375/* Only use WSIZE Macro With Logic OR While Setting Lower Order Bits */
1376#define SP_WSIZE(x) (((((x)>>0x3)-1)&0xF) << 0xC) /* Multichannel Window Size = (x/8)-1 */
1377
1378/* SPORTx_MCMC2 Masks */
1379#define REC_BYPASS 0x0000 /* Bypass Mode (No Clock Recovery) */
1380#define REC_2FROM4 0x0002 /* Recover 2 MHz Clock from 4 MHz Clock */
1381#define REC_8FROM16 0x0003 /* Recover 8 MHz Clock from 16 MHz Clock */
1382#define MCDTXPE 0x0004 /* Multichannel DMA Transmit Packing */
1383#define MCDRXPE 0x0008 /* Multichannel DMA Receive Packing */
1384#define MCMEN 0x0010 /* Multichannel Frame Mode Enable */
1385#define FSDR 0x0080 /* Multichannel Frame Sync to Data Relationship */
1386#define MFD_0 0x0000 /* Multichannel Frame Delay = 0 */
1387#define MFD_1 0x1000 /* Multichannel Frame Delay = 1 */
1388#define MFD_2 0x2000 /* Multichannel Frame Delay = 2 */
1389#define MFD_3 0x3000 /* Multichannel Frame Delay = 3 */
1390#define MFD_4 0x4000 /* Multichannel Frame Delay = 4 */
1391#define MFD_5 0x5000 /* Multichannel Frame Delay = 5 */
1392#define MFD_6 0x6000 /* Multichannel Frame Delay = 6 */
1393#define MFD_7 0x7000 /* Multichannel Frame Delay = 7 */
1394#define MFD_8 0x8000 /* Multichannel Frame Delay = 8 */
1395#define MFD_9 0x9000 /* Multichannel Frame Delay = 9 */
1396#define MFD_10 0xA000 /* Multichannel Frame Delay = 10 */
1397#define MFD_11 0xB000 /* Multichannel Frame Delay = 11 */
1398#define MFD_12 0xC000 /* Multichannel Frame Delay = 12 */
1399#define MFD_13 0xD000 /* Multichannel Frame Delay = 13 */
1400#define MFD_14 0xE000 /* Multichannel Frame Delay = 14 */
1401#define MFD_15 0xF000 /* Multichannel Frame Delay = 15 */
1402
1403/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS *************************/
1404/* EBIU_AMGCTL Masks */
1405#define AMCKEN 0x0001 /* Enable CLKOUT */
1406#define AMBEN_NONE 0x0000 /* All Banks Disabled */
1407#define AMBEN_B0 0x0002 /* Enable Async Memory Bank 0 only */
1408#define AMBEN_B0_B1 0x0004 /* Enable Async Memory Banks 0 & 1 only */
1409#define AMBEN_B0_B1_B2 0x0006 /* Enable Async Memory Banks 0, 1, and 2 */
1410#define AMBEN_ALL 0x0008 /* Enable Async Memory Banks (all) 0, 1, 2, and 3 */
1411
1412/* EBIU_AMBCTL0 Masks */
1413#define B0RDYEN 0x00000001 /* Bank 0 (B0) RDY Enable */
1414#define B0RDYPOL 0x00000002 /* B0 RDY Active High */
1415#define B0TT_1 0x00000004 /* B0 Transition Time (Read to Write) = 1 cycle */
1416#define B0TT_2 0x00000008 /* B0 Transition Time (Read to Write) = 2 cycles */
1417#define B0TT_3 0x0000000C /* B0 Transition Time (Read to Write) = 3 cycles */
1418#define B0TT_4 0x00000000 /* B0 Transition Time (Read to Write) = 4 cycles */
1419#define B0ST_1 0x00000010 /* B0 Setup Time (AOE to Read/Write) = 1 cycle */
1420#define B0ST_2 0x00000020 /* B0 Setup Time (AOE to Read/Write) = 2 cycles */
1421#define B0ST_3 0x00000030 /* B0 Setup Time (AOE to Read/Write) = 3 cycles */
1422#define B0ST_4 0x00000000 /* B0 Setup Time (AOE to Read/Write) = 4 cycles */
1423#define B0HT_1 0x00000040 /* B0 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1424#define B0HT_2 0x00000080 /* B0 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1425#define B0HT_3 0x000000C0 /* B0 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1426#define B0HT_0 0x00000000 /* B0 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1427#define B0RAT_1 0x00000100 /* B0 Read Access Time = 1 cycle */
1428#define B0RAT_2 0x00000200 /* B0 Read Access Time = 2 cycles */
1429#define B0RAT_3 0x00000300 /* B0 Read Access Time = 3 cycles */
1430#define B0RAT_4 0x00000400 /* B0 Read Access Time = 4 cycles */
1431#define B0RAT_5 0x00000500 /* B0 Read Access Time = 5 cycles */
1432#define B0RAT_6 0x00000600 /* B0 Read Access Time = 6 cycles */
1433#define B0RAT_7 0x00000700 /* B0 Read Access Time = 7 cycles */
1434#define B0RAT_8 0x00000800 /* B0 Read Access Time = 8 cycles */
1435#define B0RAT_9 0x00000900 /* B0 Read Access Time = 9 cycles */
1436#define B0RAT_10 0x00000A00 /* B0 Read Access Time = 10 cycles */
1437#define B0RAT_11 0x00000B00 /* B0 Read Access Time = 11 cycles */
1438#define B0RAT_12 0x00000C00 /* B0 Read Access Time = 12 cycles */
1439#define B0RAT_13 0x00000D00 /* B0 Read Access Time = 13 cycles */
1440#define B0RAT_14 0x00000E00 /* B0 Read Access Time = 14 cycles */
1441#define B0RAT_15 0x00000F00 /* B0 Read Access Time = 15 cycles */
1442#define B0WAT_1 0x00001000 /* B0 Write Access Time = 1 cycle */
1443#define B0WAT_2 0x00002000 /* B0 Write Access Time = 2 cycles */
1444#define B0WAT_3 0x00003000 /* B0 Write Access Time = 3 cycles */
1445#define B0WAT_4 0x00004000 /* B0 Write Access Time = 4 cycles */
1446#define B0WAT_5 0x00005000 /* B0 Write Access Time = 5 cycles */
1447#define B0WAT_6 0x00006000 /* B0 Write Access Time = 6 cycles */
1448#define B0WAT_7 0x00007000 /* B0 Write Access Time = 7 cycles */
1449#define B0WAT_8 0x00008000 /* B0 Write Access Time = 8 cycles */
1450#define B0WAT_9 0x00009000 /* B0 Write Access Time = 9 cycles */
1451#define B0WAT_10 0x0000A000 /* B0 Write Access Time = 10 cycles */
1452#define B0WAT_11 0x0000B000 /* B0 Write Access Time = 11 cycles */
1453#define B0WAT_12 0x0000C000 /* B0 Write Access Time = 12 cycles */
1454#define B0WAT_13 0x0000D000 /* B0 Write Access Time = 13 cycles */
1455#define B0WAT_14 0x0000E000 /* B0 Write Access Time = 14 cycles */
1456#define B0WAT_15 0x0000F000 /* B0 Write Access Time = 15 cycles */
1457
1458#define B1RDYEN 0x00010000 /* Bank 1 (B1) RDY Enable */
1459#define B1RDYPOL 0x00020000 /* B1 RDY Active High */
1460#define B1TT_1 0x00040000 /* B1 Transition Time (Read to Write) = 1 cycle */
1461#define B1TT_2 0x00080000 /* B1 Transition Time (Read to Write) = 2 cycles */
1462#define B1TT_3 0x000C0000 /* B1 Transition Time (Read to Write) = 3 cycles */
1463#define B1TT_4 0x00000000 /* B1 Transition Time (Read to Write) = 4 cycles */
1464#define B1ST_1 0x00100000 /* B1 Setup Time (AOE to Read/Write) = 1 cycle */
1465#define B1ST_2 0x00200000 /* B1 Setup Time (AOE to Read/Write) = 2 cycles */
1466#define B1ST_3 0x00300000 /* B1 Setup Time (AOE to Read/Write) = 3 cycles */
1467#define B1ST_4 0x00000000 /* B1 Setup Time (AOE to Read/Write) = 4 cycles */
1468#define B1HT_1 0x00400000 /* B1 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1469#define B1HT_2 0x00800000 /* B1 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1470#define B1HT_3 0x00C00000 /* B1 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1471#define B1HT_0 0x00000000 /* B1 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1472#define B1RAT_1 0x01000000 /* B1 Read Access Time = 1 cycle */
1473#define B1RAT_2 0x02000000 /* B1 Read Access Time = 2 cycles */
1474#define B1RAT_3 0x03000000 /* B1 Read Access Time = 3 cycles */
1475#define B1RAT_4 0x04000000 /* B1 Read Access Time = 4 cycles */
1476#define B1RAT_5 0x05000000 /* B1 Read Access Time = 5 cycles */
1477#define B1RAT_6 0x06000000 /* B1 Read Access Time = 6 cycles */
1478#define B1RAT_7 0x07000000 /* B1 Read Access Time = 7 cycles */
1479#define B1RAT_8 0x08000000 /* B1 Read Access Time = 8 cycles */
1480#define B1RAT_9 0x09000000 /* B1 Read Access Time = 9 cycles */
1481#define B1RAT_10 0x0A000000 /* B1 Read Access Time = 10 cycles */
1482#define B1RAT_11 0x0B000000 /* B1 Read Access Time = 11 cycles */
1483#define B1RAT_12 0x0C000000 /* B1 Read Access Time = 12 cycles */
1484#define B1RAT_13 0x0D000000 /* B1 Read Access Time = 13 cycles */
1485#define B1RAT_14 0x0E000000 /* B1 Read Access Time = 14 cycles */
1486#define B1RAT_15 0x0F000000 /* B1 Read Access Time = 15 cycles */
1487#define B1WAT_1 0x10000000 /* B1 Write Access Time = 1 cycle */
1488#define B1WAT_2 0x20000000 /* B1 Write Access Time = 2 cycles */
1489#define B1WAT_3 0x30000000 /* B1 Write Access Time = 3 cycles */
1490#define B1WAT_4 0x40000000 /* B1 Write Access Time = 4 cycles */
1491#define B1WAT_5 0x50000000 /* B1 Write Access Time = 5 cycles */
1492#define B1WAT_6 0x60000000 /* B1 Write Access Time = 6 cycles */
1493#define B1WAT_7 0x70000000 /* B1 Write Access Time = 7 cycles */
1494#define B1WAT_8 0x80000000 /* B1 Write Access Time = 8 cycles */
1495#define B1WAT_9 0x90000000 /* B1 Write Access Time = 9 cycles */
1496#define B1WAT_10 0xA0000000 /* B1 Write Access Time = 10 cycles */
1497#define B1WAT_11 0xB0000000 /* B1 Write Access Time = 11 cycles */
1498#define B1WAT_12 0xC0000000 /* B1 Write Access Time = 12 cycles */
1499#define B1WAT_13 0xD0000000 /* B1 Write Access Time = 13 cycles */
1500#define B1WAT_14 0xE0000000 /* B1 Write Access Time = 14 cycles */
1501#define B1WAT_15 0xF0000000 /* B1 Write Access Time = 15 cycles */
1502
1503/* EBIU_AMBCTL1 Masks */
1504#define B2RDYEN 0x00000001 /* Bank 2 (B2) RDY Enable */
1505#define B2RDYPOL 0x00000002 /* B2 RDY Active High */
1506#define B2TT_1 0x00000004 /* B2 Transition Time (Read to Write) = 1 cycle */
1507#define B2TT_2 0x00000008 /* B2 Transition Time (Read to Write) = 2 cycles */
1508#define B2TT_3 0x0000000C /* B2 Transition Time (Read to Write) = 3 cycles */
1509#define B2TT_4 0x00000000 /* B2 Transition Time (Read to Write) = 4 cycles */
1510#define B2ST_1 0x00000010 /* B2 Setup Time (AOE to Read/Write) = 1 cycle */
1511#define B2ST_2 0x00000020 /* B2 Setup Time (AOE to Read/Write) = 2 cycles */
1512#define B2ST_3 0x00000030 /* B2 Setup Time (AOE to Read/Write) = 3 cycles */
1513#define B2ST_4 0x00000000 /* B2 Setup Time (AOE to Read/Write) = 4 cycles */
1514#define B2HT_1 0x00000040 /* B2 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1515#define B2HT_2 0x00000080 /* B2 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1516#define B2HT_3 0x000000C0 /* B2 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1517#define B2HT_0 0x00000000 /* B2 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1518#define B2RAT_1 0x00000100 /* B2 Read Access Time = 1 cycle */
1519#define B2RAT_2 0x00000200 /* B2 Read Access Time = 2 cycles */
1520#define B2RAT_3 0x00000300 /* B2 Read Access Time = 3 cycles */
1521#define B2RAT_4 0x00000400 /* B2 Read Access Time = 4 cycles */
1522#define B2RAT_5 0x00000500 /* B2 Read Access Time = 5 cycles */
1523#define B2RAT_6 0x00000600 /* B2 Read Access Time = 6 cycles */
1524#define B2RAT_7 0x00000700 /* B2 Read Access Time = 7 cycles */
1525#define B2RAT_8 0x00000800 /* B2 Read Access Time = 8 cycles */
1526#define B2RAT_9 0x00000900 /* B2 Read Access Time = 9 cycles */
1527#define B2RAT_10 0x00000A00 /* B2 Read Access Time = 10 cycles */
1528#define B2RAT_11 0x00000B00 /* B2 Read Access Time = 11 cycles */
1529#define B2RAT_12 0x00000C00 /* B2 Read Access Time = 12 cycles */
1530#define B2RAT_13 0x00000D00 /* B2 Read Access Time = 13 cycles */
1531#define B2RAT_14 0x00000E00 /* B2 Read Access Time = 14 cycles */
1532#define B2RAT_15 0x00000F00 /* B2 Read Access Time = 15 cycles */
1533#define B2WAT_1 0x00001000 /* B2 Write Access Time = 1 cycle */
1534#define B2WAT_2 0x00002000 /* B2 Write Access Time = 2 cycles */
1535#define B2WAT_3 0x00003000 /* B2 Write Access Time = 3 cycles */
1536#define B2WAT_4 0x00004000 /* B2 Write Access Time = 4 cycles */
1537#define B2WAT_5 0x00005000 /* B2 Write Access Time = 5 cycles */
1538#define B2WAT_6 0x00006000 /* B2 Write Access Time = 6 cycles */
1539#define B2WAT_7 0x00007000 /* B2 Write Access Time = 7 cycles */
1540#define B2WAT_8 0x00008000 /* B2 Write Access Time = 8 cycles */
1541#define B2WAT_9 0x00009000 /* B2 Write Access Time = 9 cycles */
1542#define B2WAT_10 0x0000A000 /* B2 Write Access Time = 10 cycles */
1543#define B2WAT_11 0x0000B000 /* B2 Write Access Time = 11 cycles */
1544#define B2WAT_12 0x0000C000 /* B2 Write Access Time = 12 cycles */
1545#define B2WAT_13 0x0000D000 /* B2 Write Access Time = 13 cycles */
1546#define B2WAT_14 0x0000E000 /* B2 Write Access Time = 14 cycles */
1547#define B2WAT_15 0x0000F000 /* B2 Write Access Time = 15 cycles */
1548
1549#define B3RDYEN 0x00010000 /* Bank 3 (B3) RDY Enable */
1550#define B3RDYPOL 0x00020000 /* B3 RDY Active High */
1551#define B3TT_1 0x00040000 /* B3 Transition Time (Read to Write) = 1 cycle */
1552#define B3TT_2 0x00080000 /* B3 Transition Time (Read to Write) = 2 cycles */
1553#define B3TT_3 0x000C0000 /* B3 Transition Time (Read to Write) = 3 cycles */
1554#define B3TT_4 0x00000000 /* B3 Transition Time (Read to Write) = 4 cycles */
1555#define B3ST_1 0x00100000 /* B3 Setup Time (AOE to Read/Write) = 1 cycle */
1556#define B3ST_2 0x00200000 /* B3 Setup Time (AOE to Read/Write) = 2 cycles */
1557#define B3ST_3 0x00300000 /* B3 Setup Time (AOE to Read/Write) = 3 cycles */
1558#define B3ST_4 0x00000000 /* B3 Setup Time (AOE to Read/Write) = 4 cycles */
1559#define B3HT_1 0x00400000 /* B3 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1560#define B3HT_2 0x00800000 /* B3 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1561#define B3HT_3 0x00C00000 /* B3 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1562#define B3HT_0 0x00000000 /* B3 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1563#define B3RAT_1 0x01000000 /* B3 Read Access Time = 1 cycle */
1564#define B3RAT_2 0x02000000 /* B3 Read Access Time = 2 cycles */
1565#define B3RAT_3 0x03000000 /* B3 Read Access Time = 3 cycles */
1566#define B3RAT_4 0x04000000 /* B3 Read Access Time = 4 cycles */
1567#define B3RAT_5 0x05000000 /* B3 Read Access Time = 5 cycles */
1568#define B3RAT_6 0x06000000 /* B3 Read Access Time = 6 cycles */
1569#define B3RAT_7 0x07000000 /* B3 Read Access Time = 7 cycles */
1570#define B3RAT_8 0x08000000 /* B3 Read Access Time = 8 cycles */
1571#define B3RAT_9 0x09000000 /* B3 Read Access Time = 9 cycles */
1572#define B3RAT_10 0x0A000000 /* B3 Read Access Time = 10 cycles */
1573#define B3RAT_11 0x0B000000 /* B3 Read Access Time = 11 cycles */
1574#define B3RAT_12 0x0C000000 /* B3 Read Access Time = 12 cycles */
1575#define B3RAT_13 0x0D000000 /* B3 Read Access Time = 13 cycles */
1576#define B3RAT_14 0x0E000000 /* B3 Read Access Time = 14 cycles */
1577#define B3RAT_15 0x0F000000 /* B3 Read Access Time = 15 cycles */
1578#define B3WAT_1 0x10000000 /* B3 Write Access Time = 1 cycle */
1579#define B3WAT_2 0x20000000 /* B3 Write Access Time = 2 cycles */
1580#define B3WAT_3 0x30000000 /* B3 Write Access Time = 3 cycles */
1581#define B3WAT_4 0x40000000 /* B3 Write Access Time = 4 cycles */
1582#define B3WAT_5 0x50000000 /* B3 Write Access Time = 5 cycles */
1583#define B3WAT_6 0x60000000 /* B3 Write Access Time = 6 cycles */
1584#define B3WAT_7 0x70000000 /* B3 Write Access Time = 7 cycles */
1585#define B3WAT_8 0x80000000 /* B3 Write Access Time = 8 cycles */
1586#define B3WAT_9 0x90000000 /* B3 Write Access Time = 9 cycles */
1587#define B3WAT_10 0xA0000000 /* B3 Write Access Time = 10 cycles */
1588#define B3WAT_11 0xB0000000 /* B3 Write Access Time = 11 cycles */
1589#define B3WAT_12 0xC0000000 /* B3 Write Access Time = 12 cycles */
1590#define B3WAT_13 0xD0000000 /* B3 Write Access Time = 13 cycles */
1591#define B3WAT_14 0xE0000000 /* B3 Write Access Time = 14 cycles */
1592#define B3WAT_15 0xF0000000 /* B3 Write Access Time = 15 cycles */
1593
1594/* ********************** SDRAM CONTROLLER MASKS **********************************************/
1595/* EBIU_SDGCTL Masks */
1596#define SCTLE 0x00000001 /* Enable SDRAM Signals */
1597#define CL_2 0x00000008 /* SDRAM CAS Latency = 2 cycles */
1598#define CL_3 0x0000000C /* SDRAM CAS Latency = 3 cycles */
1599#define PASR_ALL 0x00000000 /* All 4 SDRAM Banks Refreshed In Self-Refresh */
1600#define PASR_B0_B1 0x00000010 /* SDRAM Banks 0 and 1 Are Refreshed In Self-Refresh */
1601#define PASR_B0 0x00000020 /* Only SDRAM Bank 0 Is Refreshed In Self-Refresh */
1602#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1603#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1604#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
1605#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
1606#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
1607#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
1608#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
1609#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
1610#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
1611#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
1612#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
1613#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
1614#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
1615#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
1616#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
1617#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
1618#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
1619#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
1620#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
1621#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
1622#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
1623#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
1624#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
1625#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
1626#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
1627#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
1628#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
1629#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
1630#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
1631#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
1632#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
1633#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
1634#define PUPSD 0x00200000 /* Power-Up Start Delay (15 SCLK Cycles Delay) */
1635#define PSM 0x00400000 /* Power-Up Sequence (Mode Register Before/After* Refresh) */
1636#define PSS 0x00800000 /* Enable Power-Up Sequence on Next SDRAM Access */
1637#define SRFS 0x01000000 /* Enable SDRAM Self-Refresh Mode */
1638#define EBUFE 0x02000000 /* Enable External Buffering Timing */
1639#define FBBRW 0x04000000 /* Enable Fast Back-To-Back Read To Write */
1640#define EMREN 0x10000000 /* Extended Mode Register Enable */
1641#define TCSR 0x20000000 /* Temp-Compensated Self-Refresh Value (85/45* Deg C) */
1642#define CDDBG 0x40000000 /* Tristate SDRAM Controls During Bus Grant */
1643
1644/* EBIU_SDBCTL Masks */
1645#define EBE 0x0001 /* Enable SDRAM External Bank */
1646#define EBSZ_16 0x0000 /* SDRAM External Bank Size = 16MB */
1647#define EBSZ_32 0x0002 /* SDRAM External Bank Size = 32MB */
1648#define EBSZ_64 0x0004 /* SDRAM External Bank Size = 64MB */
1649#define EBSZ_128 0x0006 /* SDRAM External Bank Size = 128MB */
1650#define EBCAW_8 0x0000 /* SDRAM External Bank Column Address Width = 8 Bits */
1651#define EBCAW_9 0x0010 /* SDRAM External Bank Column Address Width = 9 Bits */
1652#define EBCAW_10 0x0020 /* SDRAM External Bank Column Address Width = 10 Bits */
1653#define EBCAW_11 0x0030 /* SDRAM External Bank Column Address Width = 11 Bits */
1654
1655/* EBIU_SDSTAT Masks */
1656#define SDCI 0x0001 /* SDRAM Controller Idle */
1657#define SDSRA 0x0002 /* SDRAM Self-Refresh Active */
1658#define SDPUA 0x0004 /* SDRAM Power-Up Active */
1659#define SDRS 0x0008 /* SDRAM Will Power-Up On Next Access */
1660#define SDEASE 0x0010 /* SDRAM EAB Sticky Error Status */
1661#define BGSTAT 0x0020 /* Bus Grant Status */
1662
1663/* ************************** DMA CONTROLLER MASKS ********************************/
1664/* DMAx_CONFIG, MDMA_yy_CONFIG Masks */
1665#define DMAEN 0x0001 /* DMA Channel Enable */
1666#define WNR 0x0002 /* Channel Direction (W/R*) */
1667#define WDSIZE_8 0x0000 /* Transfer Word Size = 8 */
1668#define WDSIZE_16 0x0004 /* Transfer Word Size = 16 */
1669#define WDSIZE_32 0x0008 /* Transfer Word Size = 32 */
1670#define DMA2D 0x0010 /* DMA Mode (2D/1D*) */
1671#define RESTART 0x0020 /* DMA Buffer Clear */
1672#define DI_SEL 0x0040 /* Data Interrupt Timing Select */
1673#define DI_EN 0x0080 /* Data Interrupt Enable */
1674#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
1675#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
1676#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
1677#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
1678#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
1679#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
1680#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
1681#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
1682#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
1683#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
1684#define NDSIZE 0x0900 /* Next Descriptor Size */
1685
1686#define DMAFLOW 0x7000 /* Flow Control */
1687#define DMAFLOW_STOP 0x0000 /* Stop Mode */
1688#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
1689#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
1690#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
1691#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
1692
1693/* DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP Masks */
1694#define CTYPE 0x0040 /* DMA Channel Type Indicator (Memory/Peripheral*) */
1695#define PMAP 0xF000 /* Peripheral Mapped To This Channel */
1696#define PMAP_PPI 0x0000 /* PPI Port DMA */
1697#define PMAP_EMACRX 0x1000 /* Ethernet Receive DMA */
1698#define PMAP_EMACTX 0x2000 /* Ethernet Transmit DMA */
1699#define PMAP_SPORT0RX 0x3000 /* SPORT0 Receive DMA */
1700#define PMAP_SPORT0TX 0x4000 /* SPORT0 Transmit DMA */
1701#define PMAP_SPORT1RX 0x5000 /* SPORT1 Receive DMA */
1702#define PMAP_SPORT1TX 0x6000 /* SPORT1 Transmit DMA */
1703#define PMAP_SPI 0x7000 /* SPI Port DMA */
1704#define PMAP_UART0RX 0x8000 /* UART0 Port Receive DMA */
1705#define PMAP_UART0TX 0x9000 /* UART0 Port Transmit DMA */
1706#define PMAP_UART1RX 0xA000 /* UART1 Port Receive DMA */
1707#define PMAP_UART1TX 0xB000 /* UART1 Port Transmit DMA */
1708
1709/* DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS Masks */
1710#define DMA_DONE 0x0001 /* DMA Completion Interrupt Status */
1711#define DMA_ERR 0x0002 /* DMA Error Interrupt Status */
1712#define DFETCH 0x0004 /* DMA Descriptor Fetch Indicator */
1713#define DMA_RUN 0x0008 /* DMA Channel Running Indicator */
1714
1715/* ************ PARALLEL PERIPHERAL INTERFACE (PPI) MASKS *************/
1716/* PPI_CONTROL Masks */
1717#define PORT_EN 0x0001 /* PPI Port Enable */
1718#define PORT_DIR 0x0002 /* PPI Port Direction */
1719#define XFR_TYPE 0x000C /* PPI Transfer Type */
1720#define PORT_CFG 0x0030 /* PPI Port Configuration */
1721#define FLD_SEL 0x0040 /* PPI Active Field Select */
1722#define PACK_EN 0x0080 /* PPI Packing Mode */
1723#define DMA32 0x0100 /* PPI 32-bit DMA Enable */
1724#define SKIP_EN 0x0200 /* PPI Skip Element Enable */
1725#define SKIP_EO 0x0400 /* PPI Skip Even/Odd Elements */
1726#define DLENGTH 0x3800 /* PPI Data Length */
1727#define DLEN_8 0x0000 /* Data Length = 8 Bits */
1728#define DLEN_10 0x0800 /* Data Length = 10 Bits */
1729#define DLEN_11 0x1000 /* Data Length = 11 Bits */
1730#define DLEN_12 0x1800 /* Data Length = 12 Bits */
1731#define DLEN_13 0x2000 /* Data Length = 13 Bits */
1732#define DLEN_14 0x2800 /* Data Length = 14 Bits */
1733#define DLEN_15 0x3000 /* Data Length = 15 Bits */
1734#define DLEN_16 0x3800 /* Data Length = 16 Bits */
1735#define POLC 0x4000 /* PPI Clock Polarity */
1736#define POLS 0x8000 /* PPI Frame Sync Polarity */
1737
1738/* PPI_STATUS Masks */
1739#define FLD 0x0400 /* Field Indicator */
1740#define FT_ERR 0x0800 /* Frame Track Error */
1741#define OVR 0x1000 /* FIFO Overflow Error */
1742#define UNDR 0x2000 /* FIFO Underrun Error */
1743#define ERR_DET 0x4000 /* Error Detected Indicator */
1744#define ERR_NCOR 0x8000 /* Error Not Corrected Indicator */
1745
1746/* ******************** TWO-WIRE INTERFACE (TWI) MASKS ***********************/
1747/* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */
1748#define CLKLOW(x) ((x) & 0xFF) /* Periods Clock Is Held Low */
1749#define CLKHI(y) (((y)&0xFF)<<0x8) /* Periods Before New Clock Low */
1750
1751/* TWI_PRESCALE Masks */
1752#define PRESCALE 0x007F /* SCLKs Per Internal Time Reference (10MHz) */
1753#define TWI_ENA 0x0080 /* TWI Enable */
1754#define SCCB 0x0200 /* SCCB Compatibility Enable */
1755
1756/* TWI_SLAVE_CTRL Masks */
1757#define SEN 0x0001 /* Slave Enable */
1758#define SADD_LEN 0x0002 /* Slave Address Length */
1759#define STDVAL 0x0004 /* Slave Transmit Data Valid */
1760#define NAK 0x0008 /* NAK/ACK* Generated At Conclusion Of Transfer */
1761#define GEN 0x0010 /* General Call Adrress Matching Enabled */
1762
1763/* TWI_SLAVE_STAT Masks */
1764#define SDIR 0x0001 /* Slave Transfer Direction (Transmit/Receive*) */
1765#define GCALL 0x0002 /* General Call Indicator */
1766
1767/* TWI_MASTER_CTRL Masks */
1768#define MEN 0x0001 /* Master Mode Enable */
1769#define MADD_LEN 0x0002 /* Master Address Length */
1770#define MDIR 0x0004 /* Master Transmit Direction (RX/TX*) */
1771#define FAST 0x0008 /* Use Fast Mode Timing Specs */
1772#define STOP 0x0010 /* Issue Stop Condition */
1773#define RSTART 0x0020 /* Repeat Start or Stop* At End Of Transfer */
1774#define DCNT 0x3FC0 /* Data Bytes To Transfer */
1775#define SDAOVR 0x4000 /* Serial Data Override */
1776#define SCLOVR 0x8000 /* Serial Clock Override */
1777
1778/* TWI_MASTER_STAT Masks */
1779#define MPROG 0x0001 /* Master Transfer In Progress */
1780#define LOSTARB 0x0002 /* Lost Arbitration Indicator (Xfer Aborted) */
1781#define ANAK 0x0004 /* Address Not Acknowledged */
1782#define DNAK 0x0008 /* Data Not Acknowledged */
1783#define BUFRDERR 0x0010 /* Buffer Read Error */
1784#define BUFWRERR 0x0020 /* Buffer Write Error */
1785#define SDASEN 0x0040 /* Serial Data Sense */
1786#define SCLSEN 0x0080 /* Serial Clock Sense */
1787#define BUSBUSY 0x0100 /* Bus Busy Indicator */
1788
1789/* TWI_INT_SRC and TWI_INT_ENABLE Masks */
1790#define SINIT 0x0001 /* Slave Transfer Initiated */
1791#define SCOMP 0x0002 /* Slave Transfer Complete */
1792#define SERR 0x0004 /* Slave Transfer Error */
1793#define SOVF 0x0008 /* Slave Overflow */
1794#define MCOMP 0x0010 /* Master Transfer Complete */
1795#define MERR 0x0020 /* Master Transfer Error */
1796#define XMTSERV 0x0040 /* Transmit FIFO Service */
1797#define RCVSERV 0x0080 /* Receive FIFO Service */
1798
1799/* TWI_FIFO_CTRL Masks */
1800#define XMTFLUSH 0x0001 /* Transmit Buffer Flush */
1801#define RCVFLUSH 0x0002 /* Receive Buffer Flush */
1802#define XMTINTLEN 0x0004 /* Transmit Buffer Interrupt Length */
1803#define RCVINTLEN 0x0008 /* Receive Buffer Interrupt Length */
1804
1805/* TWI_FIFO_STAT Masks */
1806#define XMTSTAT 0x0003 /* Transmit FIFO Status */
1807#define XMT_EMPTY 0x0000 /* Transmit FIFO Empty */
1808#define XMT_HALF 0x0001 /* Transmit FIFO Has 1 Byte To Write */
1809#define XMT_FULL 0x0003 /* Transmit FIFO Full (2 Bytes To Write) */
1810
1811#define RCVSTAT 0x000C /* Receive FIFO Status */
1812#define RCV_EMPTY 0x0000 /* Receive FIFO Empty */
1813#define RCV_HALF 0x0004 /* Receive FIFO Has 1 Byte To Read */
1814#define RCV_FULL 0x000C /* Receive FIFO Full (2 Bytes To Read) */
1815
1816/* ************ CONTROLLER AREA NETWORK (CAN) MASKS ***************/
1817/* CAN_CONTROL Masks */
1818#define SRS 0x0001 /* Software Reset */
1819#define DNM 0x0002 /* Device Net Mode */
1820#define ABO 0x0004 /* Auto-Bus On Enable */
1821#define TXPRIO 0x0008 /* TX Priority (Priority/Mailbox*) */
1822#define WBA 0x0010 /* Wake-Up On CAN Bus Activity Enable */
1823#define SMR 0x0020 /* Sleep Mode Request */
1824#define CSR 0x0040 /* CAN Suspend Mode Request */
1825#define CCR 0x0080 /* CAN Configuration Mode Request */
1826
1827/* CAN_STATUS Masks */
1828#define WT 0x0001 /* TX Warning Flag */
1829#define WR 0x0002 /* RX Warning Flag */
1830#define EP 0x0004 /* Error Passive Mode */
1831#define EBO 0x0008 /* Error Bus Off Mode */
1832#define SMA 0x0020 /* Sleep Mode Acknowledge */
1833#define CSA 0x0040 /* Suspend Mode Acknowledge */
1834#define CCA 0x0080 /* Configuration Mode Acknowledge */
1835#define MBPTR 0x1F00 /* Mailbox Pointer */
1836#define TRM 0x4000 /* Transmit Mode */
1837#define REC 0x8000 /* Receive Mode */
1838
1839/* CAN_CLOCK Masks */
1840#define BRP 0x03FF /* Bit-Rate Pre-Scaler */
1841
1842/* CAN_TIMING Masks */
1843#define TSEG1 0x000F /* Time Segment 1 */
1844#define TSEG2 0x0070 /* Time Segment 2 */
1845#define SAM 0x0080 /* Sampling */
1846#define SJW 0x0300 /* Synchronization Jump Width */
1847
1848/* CAN_DEBUG Masks */
1849#define DEC 0x0001 /* Disable CAN Error Counters */
1850#define DRI 0x0002 /* Disable CAN RX Input */
1851#define DTO 0x0004 /* Disable CAN TX Output */
1852#define DIL 0x0008 /* Disable CAN Internal Loop */
1853#define MAA 0x0010 /* Mode Auto-Acknowledge Enable */
1854#define MRB 0x0020 /* Mode Read Back Enable */
1855#define CDE 0x8000 /* CAN Debug Enable */
1856
1857/* CAN_CEC Masks */
1858#define RXECNT 0x00FF /* Receive Error Counter */
1859#define TXECNT 0xFF00 /* Transmit Error Counter */
1860
1861/* CAN_INTR Masks */
1862#define MBRIF 0x0001 /* Mailbox Receive Interrupt */
1863#define MBTIF 0x0002 /* Mailbox Transmit Interrupt */
1864#define GIRQ 0x0004 /* Global Interrupt */
1865#define SMACK 0x0008 /* Sleep Mode Acknowledge */
1866#define CANTX 0x0040 /* CAN TX Bus Value */
1867#define CANRX 0x0080 /* CAN RX Bus Value */
1868
1869/* CAN_MBxx_ID1 and CAN_MBxx_ID0 Masks */
1870#define DFC 0xFFFF /* Data Filtering Code (If Enabled) (ID0) */
1871#define EXTID_LO 0xFFFF /* Lower 16 Bits of Extended Identifier (ID0) */
1872#define EXTID_HI 0x0003 /* Upper 2 Bits of Extended Identifier (ID1) */
1873#define BASEID 0x1FFC /* Base Identifier */
1874#define IDE 0x2000 /* Identifier Extension */
1875#define RTR 0x4000 /* Remote Frame Transmission Request */
1876#define AME 0x8000 /* Acceptance Mask Enable */
1877
1878/* CAN_MBxx_TIMESTAMP Masks */
1879#define TSV 0xFFFF /* Timestamp */
1880
1881/* CAN_MBxx_LENGTH Masks */
1882#define DLC 0x000F /* Data Length Code */
1883
1884/* CAN_AMxxH and CAN_AMxxL Masks */
1885#define DFM 0xFFFF /* Data Field Mask (If Enabled) (CAN_AMxxL) */
1886#define EXTID_LO 0xFFFF /* Lower 16 Bits of Extended Identifier (CAN_AMxxL) */
1887#define EXTID_HI 0x0003 /* Upper 2 Bits of Extended Identifier (CAN_AMxxH) */
1888#define BASEID 0x1FFC /* Base Identifier */
1889#define AMIDE 0x2000 /* Acceptance Mask ID Extension Enable */
1890#define FMD 0x4000 /* Full Mask Data Field Enable */
1891#define FDF 0x8000 /* Filter On Data Field Enable */
1892
1893/* CAN_MC1 Masks */
1894#define MC0 0x0001 /* Enable Mailbox 0 */
1895#define MC1 0x0002 /* Enable Mailbox 1 */
1896#define MC2 0x0004 /* Enable Mailbox 2 */
1897#define MC3 0x0008 /* Enable Mailbox 3 */
1898#define MC4 0x0010 /* Enable Mailbox 4 */
1899#define MC5 0x0020 /* Enable Mailbox 5 */
1900#define MC6 0x0040 /* Enable Mailbox 6 */
1901#define MC7 0x0080 /* Enable Mailbox 7 */
1902#define MC8 0x0100 /* Enable Mailbox 8 */
1903#define MC9 0x0200 /* Enable Mailbox 9 */
1904#define MC10 0x0400 /* Enable Mailbox 10 */
1905#define MC11 0x0800 /* Enable Mailbox 11 */
1906#define MC12 0x1000 /* Enable Mailbox 12 */
1907#define MC13 0x2000 /* Enable Mailbox 13 */
1908#define MC14 0x4000 /* Enable Mailbox 14 */
1909#define MC15 0x8000 /* Enable Mailbox 15 */
1910
1911/* CAN_MC2 Masks */
1912#define MC16 0x0001 /* Enable Mailbox 16 */
1913#define MC17 0x0002 /* Enable Mailbox 17 */
1914#define MC18 0x0004 /* Enable Mailbox 18 */
1915#define MC19 0x0008 /* Enable Mailbox 19 */
1916#define MC20 0x0010 /* Enable Mailbox 20 */
1917#define MC21 0x0020 /* Enable Mailbox 21 */
1918#define MC22 0x0040 /* Enable Mailbox 22 */
1919#define MC23 0x0080 /* Enable Mailbox 23 */
1920#define MC24 0x0100 /* Enable Mailbox 24 */
1921#define MC25 0x0200 /* Enable Mailbox 25 */
1922#define MC26 0x0400 /* Enable Mailbox 26 */
1923#define MC27 0x0800 /* Enable Mailbox 27 */
1924#define MC28 0x1000 /* Enable Mailbox 28 */
1925#define MC29 0x2000 /* Enable Mailbox 29 */
1926#define MC30 0x4000 /* Enable Mailbox 30 */
1927#define MC31 0x8000 /* Enable Mailbox 31 */
1928
1929/* CAN_MD1 Masks */
1930#define MD0 0x0001 /* Enable Mailbox 0 For Receive */
1931#define MD1 0x0002 /* Enable Mailbox 1 For Receive */
1932#define MD2 0x0004 /* Enable Mailbox 2 For Receive */
1933#define MD3 0x0008 /* Enable Mailbox 3 For Receive */
1934#define MD4 0x0010 /* Enable Mailbox 4 For Receive */
1935#define MD5 0x0020 /* Enable Mailbox 5 For Receive */
1936#define MD6 0x0040 /* Enable Mailbox 6 For Receive */
1937#define MD7 0x0080 /* Enable Mailbox 7 For Receive */
1938#define MD8 0x0100 /* Enable Mailbox 8 For Receive */
1939#define MD9 0x0200 /* Enable Mailbox 9 For Receive */
1940#define MD10 0x0400 /* Enable Mailbox 10 For Receive */
1941#define MD11 0x0800 /* Enable Mailbox 11 For Receive */
1942#define MD12 0x1000 /* Enable Mailbox 12 For Receive */
1943#define MD13 0x2000 /* Enable Mailbox 13 For Receive */
1944#define MD14 0x4000 /* Enable Mailbox 14 For Receive */
1945#define MD15 0x8000 /* Enable Mailbox 15 For Receive */
1946
1947/* CAN_MD2 Masks */
1948#define MD16 0x0001 /* Enable Mailbox 16 For Receive */
1949#define MD17 0x0002 /* Enable Mailbox 17 For Receive */
1950#define MD18 0x0004 /* Enable Mailbox 18 For Receive */
1951#define MD19 0x0008 /* Enable Mailbox 19 For Receive */
1952#define MD20 0x0010 /* Enable Mailbox 20 For Receive */
1953#define MD21 0x0020 /* Enable Mailbox 21 For Receive */
1954#define MD22 0x0040 /* Enable Mailbox 22 For Receive */
1955#define MD23 0x0080 /* Enable Mailbox 23 For Receive */
1956#define MD24 0x0100 /* Enable Mailbox 24 For Receive */
1957#define MD25 0x0200 /* Enable Mailbox 25 For Receive */
1958#define MD26 0x0400 /* Enable Mailbox 26 For Receive */
1959#define MD27 0x0800 /* Enable Mailbox 27 For Receive */
1960#define MD28 0x1000 /* Enable Mailbox 28 For Receive */
1961#define MD29 0x2000 /* Enable Mailbox 29 For Receive */
1962#define MD30 0x4000 /* Enable Mailbox 30 For Receive */
1963#define MD31 0x8000 /* Enable Mailbox 31 For Receive */
1964
1965/* CAN_RMP1 Masks */
1966#define RMP0 0x0001 /* RX Message Pending In Mailbox 0 */
1967#define RMP1 0x0002 /* RX Message Pending In Mailbox 1 */
1968#define RMP2 0x0004 /* RX Message Pending In Mailbox 2 */
1969#define RMP3 0x0008 /* RX Message Pending In Mailbox 3 */
1970#define RMP4 0x0010 /* RX Message Pending In Mailbox 4 */
1971#define RMP5 0x0020 /* RX Message Pending In Mailbox 5 */
1972#define RMP6 0x0040 /* RX Message Pending In Mailbox 6 */
1973#define RMP7 0x0080 /* RX Message Pending In Mailbox 7 */
1974#define RMP8 0x0100 /* RX Message Pending In Mailbox 8 */
1975#define RMP9 0x0200 /* RX Message Pending In Mailbox 9 */
1976#define RMP10 0x0400 /* RX Message Pending In Mailbox 10 */
1977#define RMP11 0x0800 /* RX Message Pending In Mailbox 11 */
1978#define RMP12 0x1000 /* RX Message Pending In Mailbox 12 */
1979#define RMP13 0x2000 /* RX Message Pending In Mailbox 13 */
1980#define RMP14 0x4000 /* RX Message Pending In Mailbox 14 */
1981#define RMP15 0x8000 /* RX Message Pending In Mailbox 15 */
1982
1983/* CAN_RMP2 Masks */
1984#define RMP16 0x0001 /* RX Message Pending In Mailbox 16 */
1985#define RMP17 0x0002 /* RX Message Pending In Mailbox 17 */
1986#define RMP18 0x0004 /* RX Message Pending In Mailbox 18 */
1987#define RMP19 0x0008 /* RX Message Pending In Mailbox 19 */
1988#define RMP20 0x0010 /* RX Message Pending In Mailbox 20 */
1989#define RMP21 0x0020 /* RX Message Pending In Mailbox 21 */
1990#define RMP22 0x0040 /* RX Message Pending In Mailbox 22 */
1991#define RMP23 0x0080 /* RX Message Pending In Mailbox 23 */
1992#define RMP24 0x0100 /* RX Message Pending In Mailbox 24 */
1993#define RMP25 0x0200 /* RX Message Pending In Mailbox 25 */
1994#define RMP26 0x0400 /* RX Message Pending In Mailbox 26 */
1995#define RMP27 0x0800 /* RX Message Pending In Mailbox 27 */
1996#define RMP28 0x1000 /* RX Message Pending In Mailbox 28 */
1997#define RMP29 0x2000 /* RX Message Pending In Mailbox 29 */
1998#define RMP30 0x4000 /* RX Message Pending In Mailbox 30 */
1999#define RMP31 0x8000 /* RX Message Pending In Mailbox 31 */
2000
2001/* CAN_RML1 Masks */
2002#define RML0 0x0001 /* RX Message Lost In Mailbox 0 */
2003#define RML1 0x0002 /* RX Message Lost In Mailbox 1 */
2004#define RML2 0x0004 /* RX Message Lost In Mailbox 2 */
2005#define RML3 0x0008 /* RX Message Lost In Mailbox 3 */
2006#define RML4 0x0010 /* RX Message Lost In Mailbox 4 */
2007#define RML5 0x0020 /* RX Message Lost In Mailbox 5 */
2008#define RML6 0x0040 /* RX Message Lost In Mailbox 6 */
2009#define RML7 0x0080 /* RX Message Lost In Mailbox 7 */
2010#define RML8 0x0100 /* RX Message Lost In Mailbox 8 */
2011#define RML9 0x0200 /* RX Message Lost In Mailbox 9 */
2012#define RML10 0x0400 /* RX Message Lost In Mailbox 10 */
2013#define RML11 0x0800 /* RX Message Lost In Mailbox 11 */
2014#define RML12 0x1000 /* RX Message Lost In Mailbox 12 */
2015#define RML13 0x2000 /* RX Message Lost In Mailbox 13 */
2016#define RML14 0x4000 /* RX Message Lost In Mailbox 14 */
2017#define RML15 0x8000 /* RX Message Lost In Mailbox 15 */
2018
2019/* CAN_RML2 Masks */
2020#define RML16 0x0001 /* RX Message Lost In Mailbox 16 */
2021#define RML17 0x0002 /* RX Message Lost In Mailbox 17 */
2022#define RML18 0x0004 /* RX Message Lost In Mailbox 18 */
2023#define RML19 0x0008 /* RX Message Lost In Mailbox 19 */
2024#define RML20 0x0010 /* RX Message Lost In Mailbox 20 */
2025#define RML21 0x0020 /* RX Message Lost In Mailbox 21 */
2026#define RML22 0x0040 /* RX Message Lost In Mailbox 22 */
2027#define RML23 0x0080 /* RX Message Lost In Mailbox 23 */
2028#define RML24 0x0100 /* RX Message Lost In Mailbox 24 */
2029#define RML25 0x0200 /* RX Message Lost In Mailbox 25 */
2030#define RML26 0x0400 /* RX Message Lost In Mailbox 26 */
2031#define RML27 0x0800 /* RX Message Lost In Mailbox 27 */
2032#define RML28 0x1000 /* RX Message Lost In Mailbox 28 */
2033#define RML29 0x2000 /* RX Message Lost In Mailbox 29 */
2034#define RML30 0x4000 /* RX Message Lost In Mailbox 30 */
2035#define RML31 0x8000 /* RX Message Lost In Mailbox 31 */
2036
2037/* CAN_OPSS1 Masks */
2038#define OPSS0 0x0001 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 0 */
2039#define OPSS1 0x0002 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 1 */
2040#define OPSS2 0x0004 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 2 */
2041#define OPSS3 0x0008 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 3 */
2042#define OPSS4 0x0010 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 4 */
2043#define OPSS5 0x0020 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 5 */
2044#define OPSS6 0x0040 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 6 */
2045#define OPSS7 0x0080 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 7 */
2046#define OPSS8 0x0100 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 8 */
2047#define OPSS9 0x0200 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 9 */
2048#define OPSS10 0x0400 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 10 */
2049#define OPSS11 0x0800 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 11 */
2050#define OPSS12 0x1000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 12 */
2051#define OPSS13 0x2000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 13 */
2052#define OPSS14 0x4000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 14 */
2053#define OPSS15 0x8000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 15 */
2054
2055/* CAN_OPSS2 Masks */
2056#define OPSS16 0x0001 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 16 */
2057#define OPSS17 0x0002 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 17 */
2058#define OPSS18 0x0004 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 18 */
2059#define OPSS19 0x0008 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 19 */
2060#define OPSS20 0x0010 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 20 */
2061#define OPSS21 0x0020 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 21 */
2062#define OPSS22 0x0040 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 22 */
2063#define OPSS23 0x0080 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 23 */
2064#define OPSS24 0x0100 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 24 */
2065#define OPSS25 0x0200 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 25 */
2066#define OPSS26 0x0400 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 26 */
2067#define OPSS27 0x0800 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 27 */
2068#define OPSS28 0x1000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 28 */
2069#define OPSS29 0x2000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 29 */
2070#define OPSS30 0x4000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 30 */
2071#define OPSS31 0x8000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 31 */
2072
2073/* CAN_TRR1 Masks */
2074#define TRR0 0x0001 /* Deny But Don't Lock Access To Mailbox 0 */
2075#define TRR1 0x0002 /* Deny But Don't Lock Access To Mailbox 1 */
2076#define TRR2 0x0004 /* Deny But Don't Lock Access To Mailbox 2 */
2077#define TRR3 0x0008 /* Deny But Don't Lock Access To Mailbox 3 */
2078#define TRR4 0x0010 /* Deny But Don't Lock Access To Mailbox 4 */
2079#define TRR5 0x0020 /* Deny But Don't Lock Access To Mailbox 5 */
2080#define TRR6 0x0040 /* Deny But Don't Lock Access To Mailbox 6 */
2081#define TRR7 0x0080 /* Deny But Don't Lock Access To Mailbox 7 */
2082#define TRR8 0x0100 /* Deny But Don't Lock Access To Mailbox 8 */
2083#define TRR9 0x0200 /* Deny But Don't Lock Access To Mailbox 9 */
2084#define TRR10 0x0400 /* Deny But Don't Lock Access To Mailbox 10 */
2085#define TRR11 0x0800 /* Deny But Don't Lock Access To Mailbox 11 */
2086#define TRR12 0x1000 /* Deny But Don't Lock Access To Mailbox 12 */
2087#define TRR13 0x2000 /* Deny But Don't Lock Access To Mailbox 13 */
2088#define TRR14 0x4000 /* Deny But Don't Lock Access To Mailbox 14 */
2089#define TRR15 0x8000 /* Deny But Don't Lock Access To Mailbox 15 */
2090
2091/* CAN_TRR2 Masks */
2092#define TRR16 0x0001 /* Deny But Don't Lock Access To Mailbox 16 */
2093#define TRR17 0x0002 /* Deny But Don't Lock Access To Mailbox 17 */
2094#define TRR18 0x0004 /* Deny But Don't Lock Access To Mailbox 18 */
2095#define TRR19 0x0008 /* Deny But Don't Lock Access To Mailbox 19 */
2096#define TRR20 0x0010 /* Deny But Don't Lock Access To Mailbox 20 */
2097#define TRR21 0x0020 /* Deny But Don't Lock Access To Mailbox 21 */
2098#define TRR22 0x0040 /* Deny But Don't Lock Access To Mailbox 22 */
2099#define TRR23 0x0080 /* Deny But Don't Lock Access To Mailbox 23 */
2100#define TRR24 0x0100 /* Deny But Don't Lock Access To Mailbox 24 */
2101#define TRR25 0x0200 /* Deny But Don't Lock Access To Mailbox 25 */
2102#define TRR26 0x0400 /* Deny But Don't Lock Access To Mailbox 26 */
2103#define TRR27 0x0800 /* Deny But Don't Lock Access To Mailbox 27 */
2104#define TRR28 0x1000 /* Deny But Don't Lock Access To Mailbox 28 */
2105#define TRR29 0x2000 /* Deny But Don't Lock Access To Mailbox 29 */
2106#define TRR30 0x4000 /* Deny But Don't Lock Access To Mailbox 30 */
2107#define TRR31 0x8000 /* Deny But Don't Lock Access To Mailbox 31 */
2108
2109/* CAN_TRS1 Masks */
2110#define TRS0 0x0001 /* Remote Frame Request For Mailbox 0 */
2111#define TRS1 0x0002 /* Remote Frame Request For Mailbox 1 */
2112#define TRS2 0x0004 /* Remote Frame Request For Mailbox 2 */
2113#define TRS3 0x0008 /* Remote Frame Request For Mailbox 3 */
2114#define TRS4 0x0010 /* Remote Frame Request For Mailbox 4 */
2115#define TRS5 0x0020 /* Remote Frame Request For Mailbox 5 */
2116#define TRS6 0x0040 /* Remote Frame Request For Mailbox 6 */
2117#define TRS7 0x0080 /* Remote Frame Request For Mailbox 7 */
2118#define TRS8 0x0100 /* Remote Frame Request For Mailbox 8 */
2119#define TRS9 0x0200 /* Remote Frame Request For Mailbox 9 */
2120#define TRS10 0x0400 /* Remote Frame Request For Mailbox 10 */
2121#define TRS11 0x0800 /* Remote Frame Request For Mailbox 11 */
2122#define TRS12 0x1000 /* Remote Frame Request For Mailbox 12 */
2123#define TRS13 0x2000 /* Remote Frame Request For Mailbox 13 */
2124#define TRS14 0x4000 /* Remote Frame Request For Mailbox 14 */
2125#define TRS15 0x8000 /* Remote Frame Request For Mailbox 15 */
2126
2127/* CAN_TRS2 Masks */
2128#define TRS16 0x0001 /* Remote Frame Request For Mailbox 16 */
2129#define TRS17 0x0002 /* Remote Frame Request For Mailbox 17 */
2130#define TRS18 0x0004 /* Remote Frame Request For Mailbox 18 */
2131#define TRS19 0x0008 /* Remote Frame Request For Mailbox 19 */
2132#define TRS20 0x0010 /* Remote Frame Request For Mailbox 20 */
2133#define TRS21 0x0020 /* Remote Frame Request For Mailbox 21 */
2134#define TRS22 0x0040 /* Remote Frame Request For Mailbox 22 */
2135#define TRS23 0x0080 /* Remote Frame Request For Mailbox 23 */
2136#define TRS24 0x0100 /* Remote Frame Request For Mailbox 24 */
2137#define TRS25 0x0200 /* Remote Frame Request For Mailbox 25 */
2138#define TRS26 0x0400 /* Remote Frame Request For Mailbox 26 */
2139#define TRS27 0x0800 /* Remote Frame Request For Mailbox 27 */
2140#define TRS28 0x1000 /* Remote Frame Request For Mailbox 28 */
2141#define TRS29 0x2000 /* Remote Frame Request For Mailbox 29 */
2142#define TRS30 0x4000 /* Remote Frame Request For Mailbox 30 */
2143#define TRS31 0x8000 /* Remote Frame Request For Mailbox 31 */
2144
2145/* CAN_AA1 Masks */
2146#define AA0 0x0001 /* Aborted Message In Mailbox 0 */
2147#define AA1 0x0002 /* Aborted Message In Mailbox 1 */
2148#define AA2 0x0004 /* Aborted Message In Mailbox 2 */
2149#define AA3 0x0008 /* Aborted Message In Mailbox 3 */
2150#define AA4 0x0010 /* Aborted Message In Mailbox 4 */
2151#define AA5 0x0020 /* Aborted Message In Mailbox 5 */
2152#define AA6 0x0040 /* Aborted Message In Mailbox 6 */
2153#define AA7 0x0080 /* Aborted Message In Mailbox 7 */
2154#define AA8 0x0100 /* Aborted Message In Mailbox 8 */
2155#define AA9 0x0200 /* Aborted Message In Mailbox 9 */
2156#define AA10 0x0400 /* Aborted Message In Mailbox 10 */
2157#define AA11 0x0800 /* Aborted Message In Mailbox 11 */
2158#define AA12 0x1000 /* Aborted Message In Mailbox 12 */
2159#define AA13 0x2000 /* Aborted Message In Mailbox 13 */
2160#define AA14 0x4000 /* Aborted Message In Mailbox 14 */
2161#define AA15 0x8000 /* Aborted Message In Mailbox 15 */
2162
2163/* CAN_AA2 Masks */
2164#define AA16 0x0001 /* Aborted Message In Mailbox 16 */
2165#define AA17 0x0002 /* Aborted Message In Mailbox 17 */
2166#define AA18 0x0004 /* Aborted Message In Mailbox 18 */
2167#define AA19 0x0008 /* Aborted Message In Mailbox 19 */
2168#define AA20 0x0010 /* Aborted Message In Mailbox 20 */
2169#define AA21 0x0020 /* Aborted Message In Mailbox 21 */
2170#define AA22 0x0040 /* Aborted Message In Mailbox 22 */
2171#define AA23 0x0080 /* Aborted Message In Mailbox 23 */
2172#define AA24 0x0100 /* Aborted Message In Mailbox 24 */
2173#define AA25 0x0200 /* Aborted Message In Mailbox 25 */
2174#define AA26 0x0400 /* Aborted Message In Mailbox 26 */
2175#define AA27 0x0800 /* Aborted Message In Mailbox 27 */
2176#define AA28 0x1000 /* Aborted Message In Mailbox 28 */
2177#define AA29 0x2000 /* Aborted Message In Mailbox 29 */
2178#define AA30 0x4000 /* Aborted Message In Mailbox 30 */
2179#define AA31 0x8000 /* Aborted Message In Mailbox 31 */
2180
2181/* CAN_TA1 Masks */
2182#define TA0 0x0001 /* Transmit Successful From Mailbox 0 */
2183#define TA1 0x0002 /* Transmit Successful From Mailbox 1 */
2184#define TA2 0x0004 /* Transmit Successful From Mailbox 2 */
2185#define TA3 0x0008 /* Transmit Successful From Mailbox 3 */
2186#define TA4 0x0010 /* Transmit Successful From Mailbox 4 */
2187#define TA5 0x0020 /* Transmit Successful From Mailbox 5 */
2188#define TA6 0x0040 /* Transmit Successful From Mailbox 6 */
2189#define TA7 0x0080 /* Transmit Successful From Mailbox 7 */
2190#define TA8 0x0100 /* Transmit Successful From Mailbox 8 */
2191#define TA9 0x0200 /* Transmit Successful From Mailbox 9 */
2192#define TA10 0x0400 /* Transmit Successful From Mailbox 10 */
2193#define TA11 0x0800 /* Transmit Successful From Mailbox 11 */
2194#define TA12 0x1000 /* Transmit Successful From Mailbox 12 */
2195#define TA13 0x2000 /* Transmit Successful From Mailbox 13 */
2196#define TA14 0x4000 /* Transmit Successful From Mailbox 14 */
2197#define TA15 0x8000 /* Transmit Successful From Mailbox 15 */
2198
2199/* CAN_TA2 Masks */
2200#define TA16 0x0001 /* Transmit Successful From Mailbox 16 */
2201#define TA17 0x0002 /* Transmit Successful From Mailbox 17 */
2202#define TA18 0x0004 /* Transmit Successful From Mailbox 18 */
2203#define TA19 0x0008 /* Transmit Successful From Mailbox 19 */
2204#define TA20 0x0010 /* Transmit Successful From Mailbox 20 */
2205#define TA21 0x0020 /* Transmit Successful From Mailbox 21 */
2206#define TA22 0x0040 /* Transmit Successful From Mailbox 22 */
2207#define TA23 0x0080 /* Transmit Successful From Mailbox 23 */
2208#define TA24 0x0100 /* Transmit Successful From Mailbox 24 */
2209#define TA25 0x0200 /* Transmit Successful From Mailbox 25 */
2210#define TA26 0x0400 /* Transmit Successful From Mailbox 26 */
2211#define TA27 0x0800 /* Transmit Successful From Mailbox 27 */
2212#define TA28 0x1000 /* Transmit Successful From Mailbox 28 */
2213#define TA29 0x2000 /* Transmit Successful From Mailbox 29 */
2214#define TA30 0x4000 /* Transmit Successful From Mailbox 30 */
2215#define TA31 0x8000 /* Transmit Successful From Mailbox 31 */
2216
2217/* CAN_MBTD Masks */
2218#define TDPTR 0x001F /* Mailbox To Temporarily Disable */
2219#define TDA 0x0040 /* Temporary Disable Acknowledge */
2220#define TDR 0x0080 /* Temporary Disable Request */
2221
2222/* CAN_RFH1 Masks */
2223#define RFH0 0x0001 /* Enable Automatic Remote Frame Handling For Mailbox 0 */
2224#define RFH1 0x0002 /* Enable Automatic Remote Frame Handling For Mailbox 1 */
2225#define RFH2 0x0004 /* Enable Automatic Remote Frame Handling For Mailbox 2 */
2226#define RFH3 0x0008 /* Enable Automatic Remote Frame Handling For Mailbox 3 */
2227#define RFH4 0x0010 /* Enable Automatic Remote Frame Handling For Mailbox 4 */
2228#define RFH5 0x0020 /* Enable Automatic Remote Frame Handling For Mailbox 5 */
2229#define RFH6 0x0040 /* Enable Automatic Remote Frame Handling For Mailbox 6 */
2230#define RFH7 0x0080 /* Enable Automatic Remote Frame Handling For Mailbox 7 */
2231#define RFH8 0x0100 /* Enable Automatic Remote Frame Handling For Mailbox 8 */
2232#define RFH9 0x0200 /* Enable Automatic Remote Frame Handling For Mailbox 9 */
2233#define RFH10 0x0400 /* Enable Automatic Remote Frame Handling For Mailbox 10 */
2234#define RFH11 0x0800 /* Enable Automatic Remote Frame Handling For Mailbox 11 */
2235#define RFH12 0x1000 /* Enable Automatic Remote Frame Handling For Mailbox 12 */
2236#define RFH13 0x2000 /* Enable Automatic Remote Frame Handling For Mailbox 13 */
2237#define RFH14 0x4000 /* Enable Automatic Remote Frame Handling For Mailbox 14 */
2238#define RFH15 0x8000 /* Enable Automatic Remote Frame Handling For Mailbox 15 */
2239
2240/* CAN_RFH2 Masks */
2241#define RFH16 0x0001 /* Enable Automatic Remote Frame Handling For Mailbox 16 */
2242#define RFH17 0x0002 /* Enable Automatic Remote Frame Handling For Mailbox 17 */
2243#define RFH18 0x0004 /* Enable Automatic Remote Frame Handling For Mailbox 18 */
2244#define RFH19 0x0008 /* Enable Automatic Remote Frame Handling For Mailbox 19 */
2245#define RFH20 0x0010 /* Enable Automatic Remote Frame Handling For Mailbox 20 */
2246#define RFH21 0x0020 /* Enable Automatic Remote Frame Handling For Mailbox 21 */
2247#define RFH22 0x0040 /* Enable Automatic Remote Frame Handling For Mailbox 22 */
2248#define RFH23 0x0080 /* Enable Automatic Remote Frame Handling For Mailbox 23 */
2249#define RFH24 0x0100 /* Enable Automatic Remote Frame Handling For Mailbox 24 */
2250#define RFH25 0x0200 /* Enable Automatic Remote Frame Handling For Mailbox 25 */
2251#define RFH26 0x0400 /* Enable Automatic Remote Frame Handling For Mailbox 26 */
2252#define RFH27 0x0800 /* Enable Automatic Remote Frame Handling For Mailbox 27 */
2253#define RFH28 0x1000 /* Enable Automatic Remote Frame Handling For Mailbox 28 */
2254#define RFH29 0x2000 /* Enable Automatic Remote Frame Handling For Mailbox 29 */
2255#define RFH30 0x4000 /* Enable Automatic Remote Frame Handling For Mailbox 30 */
2256#define RFH31 0x8000 /* Enable Automatic Remote Frame Handling For Mailbox 31 */
2257
2258/* CAN_MBTIF1 Masks */
2259#define MBTIF0 0x0001 /* TX Interrupt Active In Mailbox 0 */
2260#define MBTIF1 0x0002 /* TX Interrupt Active In Mailbox 1 */
2261#define MBTIF2 0x0004 /* TX Interrupt Active In Mailbox 2 */
2262#define MBTIF3 0x0008 /* TX Interrupt Active In Mailbox 3 */
2263#define MBTIF4 0x0010 /* TX Interrupt Active In Mailbox 4 */
2264#define MBTIF5 0x0020 /* TX Interrupt Active In Mailbox 5 */
2265#define MBTIF6 0x0040 /* TX Interrupt Active In Mailbox 6 */
2266#define MBTIF7 0x0080 /* TX Interrupt Active In Mailbox 7 */
2267#define MBTIF8 0x0100 /* TX Interrupt Active In Mailbox 8 */
2268#define MBTIF9 0x0200 /* TX Interrupt Active In Mailbox 9 */
2269#define MBTIF10 0x0400 /* TX Interrupt Active In Mailbox 10 */
2270#define MBTIF11 0x0800 /* TX Interrupt Active In Mailbox 11 */
2271#define MBTIF12 0x1000 /* TX Interrupt Active In Mailbox 12 */
2272#define MBTIF13 0x2000 /* TX Interrupt Active In Mailbox 13 */
2273#define MBTIF14 0x4000 /* TX Interrupt Active In Mailbox 14 */
2274#define MBTIF15 0x8000 /* TX Interrupt Active In Mailbox 15 */
2275
2276/* CAN_MBTIF2 Masks */
2277#define MBTIF16 0x0001 /* TX Interrupt Active In Mailbox 16 */
2278#define MBTIF17 0x0002 /* TX Interrupt Active In Mailbox 17 */
2279#define MBTIF18 0x0004 /* TX Interrupt Active In Mailbox 18 */
2280#define MBTIF19 0x0008 /* TX Interrupt Active In Mailbox 19 */
2281#define MBTIF20 0x0010 /* TX Interrupt Active In Mailbox 20 */
2282#define MBTIF21 0x0020 /* TX Interrupt Active In Mailbox 21 */
2283#define MBTIF22 0x0040 /* TX Interrupt Active In Mailbox 22 */
2284#define MBTIF23 0x0080 /* TX Interrupt Active In Mailbox 23 */
2285#define MBTIF24 0x0100 /* TX Interrupt Active In Mailbox 24 */
2286#define MBTIF25 0x0200 /* TX Interrupt Active In Mailbox 25 */
2287#define MBTIF26 0x0400 /* TX Interrupt Active In Mailbox 26 */
2288#define MBTIF27 0x0800 /* TX Interrupt Active In Mailbox 27 */
2289#define MBTIF28 0x1000 /* TX Interrupt Active In Mailbox 28 */
2290#define MBTIF29 0x2000 /* TX Interrupt Active In Mailbox 29 */
2291#define MBTIF30 0x4000 /* TX Interrupt Active In Mailbox 30 */
2292#define MBTIF31 0x8000 /* TX Interrupt Active In Mailbox 31 */
2293
2294/* CAN_MBRIF1 Masks */
2295#define MBRIF0 0x0001 /* RX Interrupt Active In Mailbox 0 */
2296#define MBRIF1 0x0002 /* RX Interrupt Active In Mailbox 1 */
2297#define MBRIF2 0x0004 /* RX Interrupt Active In Mailbox 2 */
2298#define MBRIF3 0x0008 /* RX Interrupt Active In Mailbox 3 */
2299#define MBRIF4 0x0010 /* RX Interrupt Active In Mailbox 4 */
2300#define MBRIF5 0x0020 /* RX Interrupt Active In Mailbox 5 */
2301#define MBRIF6 0x0040 /* RX Interrupt Active In Mailbox 6 */
2302#define MBRIF7 0x0080 /* RX Interrupt Active In Mailbox 7 */
2303#define MBRIF8 0x0100 /* RX Interrupt Active In Mailbox 8 */
2304#define MBRIF9 0x0200 /* RX Interrupt Active In Mailbox 9 */
2305#define MBRIF10 0x0400 /* RX Interrupt Active In Mailbox 10 */
2306#define MBRIF11 0x0800 /* RX Interrupt Active In Mailbox 11 */
2307#define MBRIF12 0x1000 /* RX Interrupt Active In Mailbox 12 */
2308#define MBRIF13 0x2000 /* RX Interrupt Active In Mailbox 13 */
2309#define MBRIF14 0x4000 /* RX Interrupt Active In Mailbox 14 */
2310#define MBRIF15 0x8000 /* RX Interrupt Active In Mailbox 15 */
2311
2312/* CAN_MBRIF2 Masks */
2313#define MBRIF16 0x0001 /* RX Interrupt Active In Mailbox 16 */
2314#define MBRIF17 0x0002 /* RX Interrupt Active In Mailbox 17 */
2315#define MBRIF18 0x0004 /* RX Interrupt Active In Mailbox 18 */
2316#define MBRIF19 0x0008 /* RX Interrupt Active In Mailbox 19 */
2317#define MBRIF20 0x0010 /* RX Interrupt Active In Mailbox 20 */
2318#define MBRIF21 0x0020 /* RX Interrupt Active In Mailbox 21 */
2319#define MBRIF22 0x0040 /* RX Interrupt Active In Mailbox 22 */
2320#define MBRIF23 0x0080 /* RX Interrupt Active In Mailbox 23 */
2321#define MBRIF24 0x0100 /* RX Interrupt Active In Mailbox 24 */
2322#define MBRIF25 0x0200 /* RX Interrupt Active In Mailbox 25 */
2323#define MBRIF26 0x0400 /* RX Interrupt Active In Mailbox 26 */
2324#define MBRIF27 0x0800 /* RX Interrupt Active In Mailbox 27 */
2325#define MBRIF28 0x1000 /* RX Interrupt Active In Mailbox 28 */
2326#define MBRIF29 0x2000 /* RX Interrupt Active In Mailbox 29 */
2327#define MBRIF30 0x4000 /* RX Interrupt Active In Mailbox 30 */
2328#define MBRIF31 0x8000 /* RX Interrupt Active In Mailbox 31 */
2329
2330/* CAN_MBIM1 Masks */
2331#define MBIM0 0x0001 /* Enable Interrupt For Mailbox 0 */
2332#define MBIM1 0x0002 /* Enable Interrupt For Mailbox 1 */
2333#define MBIM2 0x0004 /* Enable Interrupt For Mailbox 2 */
2334#define MBIM3 0x0008 /* Enable Interrupt For Mailbox 3 */
2335#define MBIM4 0x0010 /* Enable Interrupt For Mailbox 4 */
2336#define MBIM5 0x0020 /* Enable Interrupt For Mailbox 5 */
2337#define MBIM6 0x0040 /* Enable Interrupt For Mailbox 6 */
2338#define MBIM7 0x0080 /* Enable Interrupt For Mailbox 7 */
2339#define MBIM8 0x0100 /* Enable Interrupt For Mailbox 8 */
2340#define MBIM9 0x0200 /* Enable Interrupt For Mailbox 9 */
2341#define MBIM10 0x0400 /* Enable Interrupt For Mailbox 10 */
2342#define MBIM11 0x0800 /* Enable Interrupt For Mailbox 11 */
2343#define MBIM12 0x1000 /* Enable Interrupt For Mailbox 12 */
2344#define MBIM13 0x2000 /* Enable Interrupt For Mailbox 13 */
2345#define MBIM14 0x4000 /* Enable Interrupt For Mailbox 14 */
2346#define MBIM15 0x8000 /* Enable Interrupt For Mailbox 15 */
2347
2348/* CAN_MBIM2 Masks */
2349#define MBIM16 0x0001 /* Enable Interrupt For Mailbox 16 */
2350#define MBIM17 0x0002 /* Enable Interrupt For Mailbox 17 */
2351#define MBIM18 0x0004 /* Enable Interrupt For Mailbox 18 */
2352#define MBIM19 0x0008 /* Enable Interrupt For Mailbox 19 */
2353#define MBIM20 0x0010 /* Enable Interrupt For Mailbox 20 */
2354#define MBIM21 0x0020 /* Enable Interrupt For Mailbox 21 */
2355#define MBIM22 0x0040 /* Enable Interrupt For Mailbox 22 */
2356#define MBIM23 0x0080 /* Enable Interrupt For Mailbox 23 */
2357#define MBIM24 0x0100 /* Enable Interrupt For Mailbox 24 */
2358#define MBIM25 0x0200 /* Enable Interrupt For Mailbox 25 */
2359#define MBIM26 0x0400 /* Enable Interrupt For Mailbox 26 */
2360#define MBIM27 0x0800 /* Enable Interrupt For Mailbox 27 */
2361#define MBIM28 0x1000 /* Enable Interrupt For Mailbox 28 */
2362#define MBIM29 0x2000 /* Enable Interrupt For Mailbox 29 */
2363#define MBIM30 0x4000 /* Enable Interrupt For Mailbox 30 */
2364#define MBIM31 0x8000 /* Enable Interrupt For Mailbox 31 */
2365
2366/* CAN_GIM Masks */
2367#define EWTIM 0x0001 /* Enable TX Error Count Interrupt */
2368#define EWRIM 0x0002 /* Enable RX Error Count Interrupt */
2369#define EPIM 0x0004 /* Enable Error-Passive Mode Interrupt */
2370#define BOIM 0x0008 /* Enable Bus Off Interrupt */
2371#define WUIM 0x0010 /* Enable Wake-Up Interrupt */
2372#define UIAIM 0x0020 /* Enable Access To Unimplemented Address Interrupt */
2373#define AAIM 0x0040 /* Enable Abort Acknowledge Interrupt */
2374#define RMLIM 0x0080 /* Enable RX Message Lost Interrupt */
2375#define UCEIM 0x0100 /* Enable Universal Counter Overflow Interrupt */
2376#define EXTIM 0x0200 /* Enable External Trigger Output Interrupt */
2377#define ADIM 0x0400 /* Enable Access Denied Interrupt */
2378
2379/* CAN_GIS Masks */
2380#define EWTIS 0x0001 /* TX Error Count IRQ Status */
2381#define EWRIS 0x0002 /* RX Error Count IRQ Status */
2382#define EPIS 0x0004 /* Error-Passive Mode IRQ Status */
2383#define BOIS 0x0008 /* Bus Off IRQ Status */
2384#define WUIS 0x0010 /* Wake-Up IRQ Status */
2385#define UIAIS 0x0020 /* Access To Unimplemented Address IRQ Status */
2386#define AAIS 0x0040 /* Abort Acknowledge IRQ Status */
2387#define RMLIS 0x0080 /* RX Message Lost IRQ Status */
2388#define UCEIS 0x0100 /* Universal Counter Overflow IRQ Status */
2389#define EXTIS 0x0200 /* External Trigger Output IRQ Status */
2390#define ADIS 0x0400 /* Access Denied IRQ Status */
2391
2392/* CAN_GIF Masks */
2393#define EWTIF 0x0001 /* TX Error Count IRQ Flag */
2394#define EWRIF 0x0002 /* RX Error Count IRQ Flag */
2395#define EPIF 0x0004 /* Error-Passive Mode IRQ Flag */
2396#define BOIF 0x0008 /* Bus Off IRQ Flag */
2397#define WUIF 0x0010 /* Wake-Up IRQ Flag */
2398#define UIAIF 0x0020 /* Access To Unimplemented Address IRQ Flag */
2399#define AAIF 0x0040 /* Abort Acknowledge IRQ Flag */
2400#define RMLIF 0x0080 /* RX Message Lost IRQ Flag */
2401#define UCEIF 0x0100 /* Universal Counter Overflow IRQ Flag */
2402#define EXTIF 0x0200 /* External Trigger Output IRQ Flag */
2403#define ADIF 0x0400 /* Access Denied IRQ Flag */
2404
2405/* CAN_UCCNF Masks */
2406#define UCCNF 0x000F /* Universal Counter Mode */
2407#define UC_STAMP 0x0001 /* Timestamp Mode */
2408#define UC_WDOG 0x0002 /* Watchdog Mode */
2409#define UC_AUTOTX 0x0003 /* Auto-Transmit Mode */
2410#define UC_ERROR 0x0006 /* CAN Error Frame Count */
2411#define UC_OVER 0x0007 /* CAN Overload Frame Count */
2412#define UC_LOST 0x0008 /* Arbitration Lost During TX Count */
2413#define UC_AA 0x0009 /* TX Abort Count */
2414#define UC_TA 0x000A /* TX Successful Count */
2415#define UC_REJECT 0x000B /* RX Message Rejected Count */
2416#define UC_RML 0x000C /* RX Message Lost Count */
2417#define UC_RX 0x000D /* Total Successful RX Messages Count */
2418#define UC_RMP 0x000E /* Successful RX W/Matching ID Count */
2419#define UC_ALL 0x000F /* Correct Message On CAN Bus Line Count */
2420#define UCRC 0x0020 /* Universal Counter Reload/Clear */
2421#define UCCT 0x0040 /* Universal Counter CAN Trigger */
2422#define UCE 0x0080 /* Universal Counter Enable */
2423
2424/* CAN_ESR Masks */
2425#define ACKE 0x0004 /* Acknowledge Error */
2426#define SER 0x0008 /* Stuff Error */
2427#define CRCE 0x0010 /* CRC Error */
2428#define SA0 0x0020 /* Stuck At Dominant Error */
2429#define BEF 0x0040 /* Bit Error Flag */
2430#define FER 0x0080 /* Form Error Flag */
2431
2432/* CAN_EWR Masks */
2433#define EWLREC 0x00FF /* RX Error Count Limit (For EWRIS) */
2434#define EWLTEC 0xFF00 /* TX Error Count Limit (For EWTIS) */
2435
2436/* ******************* PIN CONTROL REGISTER MASKS ************************/
2437/* PORT_MUX Masks */
2438#define PJSE 0x0001 /* Port J SPI/SPORT Enable */
2439#define PJSE_SPORT 0x0000 /* Enable TFS0/DT0PRI */
2440#define PJSE_SPI 0x0001 /* Enable SPI_SSEL3:2 */
2441
2442#define PJCE(x) (((x)&0x3)<<1) /* Port J CAN/SPI/SPORT Enable */
2443#define PJCE_SPORT 0x0000 /* Enable DR0SEC/DT0SEC */
2444#define PJCE_CAN 0x0002 /* Enable CAN RX/TX */
2445#define PJCE_SPI 0x0004 /* Enable SPI_SSEL7 */
2446
2447#define PFDE 0x0008 /* Port F DMA Request Enable */
2448#define PGDE_UART 0x0000 /* Enable UART0 RX/TX */
2449#define PGDE_DMA 0x0008 /* Enable DMAR1:0 */
2450
2451#define PFTE 0x0010 /* Port F Timer Enable */
2452#define PFTE_UART 0x0000 /* Enable UART1 RX/TX */
2453#define PFTE_TIMER 0x0010 /* Enable TMR7:6 */
2454
2455#define PFS6E 0x0020 /* Port F SPI SSEL 6 Enable */
2456#define PFS6E_TIMER 0x0000 /* Enable TMR5 */
2457#define PFS6E_SPI 0x0020 /* Enable SPI_SSEL6 */
2458
2459#define PFS5E 0x0040 /* Port F SPI SSEL 5 Enable */
2460#define PFS5E_TIMER 0x0000 /* Enable TMR4 */
2461#define PFS5E_SPI 0x0040 /* Enable SPI_SSEL5 */
2462
2463#define PFS4E 0x0080 /* Port F SPI SSEL 4 Enable */
2464#define PFS4E_TIMER 0x0000 /* Enable TMR3 */
2465#define PFS4E_SPI 0x0080 /* Enable SPI_SSEL4 */
2466
2467#define PFFE 0x0100 /* Port F PPI Frame Sync Enable */
2468#define PFFE_TIMER 0x0000 /* Enable TMR2 */
2469#define PFFE_PPI 0x0100 /* Enable PPI FS3 */
2470
2471#define PGSE 0x0200 /* Port G SPORT1 Secondary Enable */
2472#define PGSE_PPI 0x0000 /* Enable PPI D9:8 */
2473#define PGSE_SPORT 0x0200 /* Enable DR1SEC/DT1SEC */
2474
2475#define PGRE 0x0400 /* Port G SPORT1 Receive Enable */
2476#define PGRE_PPI 0x0000 /* Enable PPI D12:10 */
2477#define PGRE_SPORT 0x0400 /* Enable DR1PRI/RFS1/RSCLK1 */
2478
2479#define PGTE 0x0800 /* Port G SPORT1 Transmit Enable */
2480#define PGTE_PPI 0x0000 /* Enable PPI D15:13 */
2481#define PGTE_SPORT 0x0800 /* Enable DT1PRI/TFS1/TSCLK1 */
2482
2483/* ****************** HANDSHAKE DMA (HDMA) MASKS *********************/
2484/* HDMAx_CTL Masks */
2485#define HMDMAEN 0x0001 /* Enable Handshake DMA 0/1 */
2486#define REP 0x0002 /* HDMA Request Polarity */
2487#define UTE 0x0004 /* Urgency Threshold Enable */
2488#define OIE 0x0010 /* Overflow Interrupt Enable */
2489#define BDIE 0x0020 /* Block Done Interrupt Enable */
2490#define MBDI 0x0040 /* Mask Block Done IRQ If Pending ECNT */
2491#define DRQ 0x0300 /* HDMA Request Type */
2492#define DRQ_NONE 0x0000 /* No Request */
2493#define DRQ_SINGLE 0x0100 /* Channels Request Single */
2494#define DRQ_MULTI 0x0200 /* Channels Request Multi (Default) */
2495#define DRQ_URGENT 0x0300 /* Channels Request Multi Urgent */
2496#define RBC 0x1000 /* Reload BCNT With IBCNT */
2497#define PS 0x2000 /* HDMA Pin Status */
2498#define OI 0x4000 /* Overflow Interrupt Generated */
2499#define BDI 0x8000 /* Block Done Interrupt Generated */
2500
2501#endif /* _DEF_BF534_H */
diff --git a/include/asm-blackfin/mach-bf537/defBF537.h b/include/asm-blackfin/mach-bf537/defBF537.h
new file mode 100644
index 000000000000..26f9c02eb73c
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/defBF537.h
@@ -0,0 +1,404 @@
1/*
2 * file: include/asm-blackfin/mach-bf537/defbf537.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * system mmr register map
9 * rev:
10 *
11 * modified:
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */
31
32#ifndef _DEF_BF537_H
33#define _DEF_BF537_H
34
35/*include all Core registers and bit definitions*/
36#include "defBF537.h"
37
38/*include core specific register pointer definitions*/
39#include <asm/mach-common/cdef_LPBlackfin.h>
40
41/************************************************************************************
42** Define EMAC Section Unique to BF536/BF537
43*************************************************************************************/
44
45/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
46#define EMAC_OPMODE 0xFFC03000 /* Operating Mode Register */
47#define EMAC_ADDRLO 0xFFC03004 /* Address Low (32 LSBs) Register */
48#define EMAC_ADDRHI 0xFFC03008 /* Address High (16 MSBs) Register */
49#define EMAC_HASHLO 0xFFC0300C /* Multicast Hash Table Low (Bins 31-0) Register */
50#define EMAC_HASHHI 0xFFC03010 /* Multicast Hash Table High (Bins 63-32) Register */
51#define EMAC_STAADD 0xFFC03014 /* Station Management Address Register */
52#define EMAC_STADAT 0xFFC03018 /* Station Management Data Register */
53#define EMAC_FLC 0xFFC0301C /* Flow Control Register */
54#define EMAC_VLAN1 0xFFC03020 /* VLAN1 Tag Register */
55#define EMAC_VLAN2 0xFFC03024 /* VLAN2 Tag Register */
56#define EMAC_WKUP_CTL 0xFFC0302C /* Wake-Up Control/Status Register */
57#define EMAC_WKUP_FFMSK0 0xFFC03030 /* Wake-Up Frame Filter 0 Byte Mask Register */
58#define EMAC_WKUP_FFMSK1 0xFFC03034 /* Wake-Up Frame Filter 1 Byte Mask Register */
59#define EMAC_WKUP_FFMSK2 0xFFC03038 /* Wake-Up Frame Filter 2 Byte Mask Register */
60#define EMAC_WKUP_FFMSK3 0xFFC0303C /* Wake-Up Frame Filter 3 Byte Mask Register */
61#define EMAC_WKUP_FFCMD 0xFFC03040 /* Wake-Up Frame Filter Commands Register */
62#define EMAC_WKUP_FFOFF 0xFFC03044 /* Wake-Up Frame Filter Offsets Register */
63#define EMAC_WKUP_FFCRC0 0xFFC03048 /* Wake-Up Frame Filter 0,1 CRC-16 Register */
64#define EMAC_WKUP_FFCRC1 0xFFC0304C /* Wake-Up Frame Filter 2,3 CRC-16 Register */
65
66#define EMAC_SYSCTL 0xFFC03060 /* EMAC System Control Register */
67#define EMAC_SYSTAT 0xFFC03064 /* EMAC System Status Register */
68#define EMAC_RX_STAT 0xFFC03068 /* RX Current Frame Status Register */
69#define EMAC_RX_STKY 0xFFC0306C /* RX Sticky Frame Status Register */
70#define EMAC_RX_IRQE 0xFFC03070 /* RX Frame Status Interrupt Enables Register */
71#define EMAC_TX_STAT 0xFFC03074 /* TX Current Frame Status Register */
72#define EMAC_TX_STKY 0xFFC03078 /* TX Sticky Frame Status Register */
73#define EMAC_TX_IRQE 0xFFC0307C /* TX Frame Status Interrupt Enables Register */
74
75#define EMAC_MMC_CTL 0xFFC03080 /* MMC Counter Control Register */
76#define EMAC_MMC_RIRQS 0xFFC03084 /* MMC RX Interrupt Status Register */
77#define EMAC_MMC_RIRQE 0xFFC03088 /* MMC RX Interrupt Enables Register */
78#define EMAC_MMC_TIRQS 0xFFC0308C /* MMC TX Interrupt Status Register */
79#define EMAC_MMC_TIRQE 0xFFC03090 /* MMC TX Interrupt Enables Register */
80
81#define EMAC_RXC_OK 0xFFC03100 /* RX Frame Successful Count */
82#define EMAC_RXC_FCS 0xFFC03104 /* RX Frame FCS Failure Count */
83#define EMAC_RXC_ALIGN 0xFFC03108 /* RX Alignment Error Count */
84#define EMAC_RXC_OCTET 0xFFC0310C /* RX Octets Successfully Received Count */
85#define EMAC_RXC_DMAOVF 0xFFC03110 /* Internal MAC Sublayer Error RX Frame Count */
86#define EMAC_RXC_UNICST 0xFFC03114 /* Unicast RX Frame Count */
87#define EMAC_RXC_MULTI 0xFFC03118 /* Multicast RX Frame Count */
88#define EMAC_RXC_BROAD 0xFFC0311C /* Broadcast RX Frame Count */
89#define EMAC_RXC_LNERRI 0xFFC03120 /* RX Frame In Range Error Count */
90#define EMAC_RXC_LNERRO 0xFFC03124 /* RX Frame Out Of Range Error Count */
91#define EMAC_RXC_LONG 0xFFC03128 /* RX Frame Too Long Count */
92#define EMAC_RXC_MACCTL 0xFFC0312C /* MAC Control RX Frame Count */
93#define EMAC_RXC_OPCODE 0xFFC03130 /* Unsupported Op-Code RX Frame Count */
94#define EMAC_RXC_PAUSE 0xFFC03134 /* MAC Control Pause RX Frame Count */
95#define EMAC_RXC_ALLFRM 0xFFC03138 /* Overall RX Frame Count */
96#define EMAC_RXC_ALLOCT 0xFFC0313C /* Overall RX Octet Count */
97#define EMAC_RXC_TYPED 0xFFC03140 /* Type/Length Consistent RX Frame Count */
98#define EMAC_RXC_SHORT 0xFFC03144 /* RX Frame Fragment Count - Byte Count x < 64 */
99#define EMAC_RXC_EQ64 0xFFC03148 /* Good RX Frame Count - Byte Count x = 64 */
100#define EMAC_RXC_LT128 0xFFC0314C /* Good RX Frame Count - Byte Count 64 <= x < 128 */
101#define EMAC_RXC_LT256 0xFFC03150 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
102#define EMAC_RXC_LT512 0xFFC03154 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
103#define EMAC_RXC_LT1024 0xFFC03158 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
104#define EMAC_RXC_GE1024 0xFFC0315C /* Good RX Frame Count - Byte Count x >= 1024 */
105
106#define EMAC_TXC_OK 0xFFC03180 /* TX Frame Successful Count */
107#define EMAC_TXC_1COL 0xFFC03184 /* TX Frames Successful After Single Collision Count */
108#define EMAC_TXC_GT1COL 0xFFC03188 /* TX Frames Successful After Multiple Collisions Count */
109#define EMAC_TXC_OCTET 0xFFC0318C /* TX Octets Successfully Received Count */
110#define EMAC_TXC_DEFER 0xFFC03190 /* TX Frame Delayed Due To Busy Count */
111#define EMAC_TXC_LATECL 0xFFC03194 /* Late TX Collisions Count */
112#define EMAC_TXC_XS_COL 0xFFC03198 /* TX Frame Failed Due To Excessive Collisions Count */
113#define EMAC_TXC_DMAUND 0xFFC0319C /* Internal MAC Sublayer Error TX Frame Count */
114#define EMAC_TXC_CRSERR 0xFFC031A0 /* Carrier Sense Deasserted During TX Frame Count */
115#define EMAC_TXC_UNICST 0xFFC031A4 /* Unicast TX Frame Count */
116#define EMAC_TXC_MULTI 0xFFC031A8 /* Multicast TX Frame Count */
117#define EMAC_TXC_BROAD 0xFFC031AC /* Broadcast TX Frame Count */
118#define EMAC_TXC_XS_DFR 0xFFC031B0 /* TX Frames With Excessive Deferral Count */
119#define EMAC_TXC_MACCTL 0xFFC031B4 /* MAC Control TX Frame Count */
120#define EMAC_TXC_ALLFRM 0xFFC031B8 /* Overall TX Frame Count */
121#define EMAC_TXC_ALLOCT 0xFFC031BC /* Overall TX Octet Count */
122#define EMAC_TXC_EQ64 0xFFC031C0 /* Good TX Frame Count - Byte Count x = 64 */
123#define EMAC_TXC_LT128 0xFFC031C4 /* Good TX Frame Count - Byte Count 64 <= x < 128 */
124#define EMAC_TXC_LT256 0xFFC031C8 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
125#define EMAC_TXC_LT512 0xFFC031CC /* Good TX Frame Count - Byte Count 256 <= x < 512 */
126#define EMAC_TXC_LT1024 0xFFC031D0 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
127#define EMAC_TXC_GE1024 0xFFC031D4 /* Good TX Frame Count - Byte Count x >= 1024 */
128#define EMAC_TXC_ABORT 0xFFC031D8 /* Total TX Frames Aborted Count */
129
130/* Listing for IEEE-Supported Count Registers */
131#define FramesReceivedOK EMAC_RXC_OK /* RX Frame Successful Count */
132#define FrameCheckSequenceErrors EMAC_RXC_FCS /* RX Frame FCS Failure Count */
133#define AlignmentErrors EMAC_RXC_ALIGN /* RX Alignment Error Count */
134#define OctetsReceivedOK EMAC_RXC_OCTET /* RX Octets Successfully Received Count */
135#define FramesLostDueToIntMACRcvError EMAC_RXC_DMAOVF /* Internal MAC Sublayer Error RX Frame Count */
136#define UnicastFramesReceivedOK EMAC_RXC_UNICST /* Unicast RX Frame Count */
137#define MulticastFramesReceivedOK EMAC_RXC_MULTI /* Multicast RX Frame Count */
138#define BroadcastFramesReceivedOK EMAC_RXC_BROAD /* Broadcast RX Frame Count */
139#define InRangeLengthErrors EMAC_RXC_LNERRI /* RX Frame In Range Error Count */
140#define OutOfRangeLengthField EMAC_RXC_LNERRO /* RX Frame Out Of Range Error Count */
141#define FrameTooLongErrors EMAC_RXC_LONG /* RX Frame Too Long Count */
142#define MACControlFramesReceived EMAC_RXC_MACCTL /* MAC Control RX Frame Count */
143#define UnsupportedOpcodesReceived EMAC_RXC_OPCODE /* Unsupported Op-Code RX Frame Count */
144#define PAUSEMACCtrlFramesReceived EMAC_RXC_PAUSE /* MAC Control Pause RX Frame Count */
145#define FramesReceivedAll EMAC_RXC_ALLFRM /* Overall RX Frame Count */
146#define OctetsReceivedAll EMAC_RXC_ALLOCT /* Overall RX Octet Count */
147#define TypedFramesReceived EMAC_RXC_TYPED /* Type/Length Consistent RX Frame Count */
148#define FramesLenLt64Received EMAC_RXC_SHORT /* RX Frame Fragment Count - Byte Count x < 64 */
149#define FramesLenEq64Received EMAC_RXC_EQ64 /* Good RX Frame Count - Byte Count x = 64 */
150#define FramesLen65_127Received EMAC_RXC_LT128 /* Good RX Frame Count - Byte Count 64 <= x < 128 */
151#define FramesLen128_255Received EMAC_RXC_LT256 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
152#define FramesLen256_511Received EMAC_RXC_LT512 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
153#define FramesLen512_1023Received EMAC_RXC_LT1024 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
154#define FramesLen1024_MaxReceived EMAC_RXC_GE1024 /* Good RX Frame Count - Byte Count x >= 1024 */
155
156#define FramesTransmittedOK EMAC_TXC_OK /* TX Frame Successful Count */
157#define SingleCollisionFrames EMAC_TXC_1COL /* TX Frames Successful After Single Collision Count */
158#define MultipleCollisionFrames EMAC_TXC_GT1COL /* TX Frames Successful After Multiple Collisions Count */
159#define OctetsTransmittedOK EMAC_TXC_OCTET /* TX Octets Successfully Received Count */
160#define FramesWithDeferredXmissions EMAC_TXC_DEFER /* TX Frame Delayed Due To Busy Count */
161#define LateCollisions EMAC_TXC_LATECL /* Late TX Collisions Count */
162#define FramesAbortedDueToXSColls EMAC_TXC_XS_COL /* TX Frame Failed Due To Excessive Collisions Count */
163#define FramesLostDueToIntMacXmitError EMAC_TXC_DMAUND /* Internal MAC Sublayer Error TX Frame Count */
164#define CarrierSenseErrors EMAC_TXC_CRSERR /* Carrier Sense Deasserted During TX Frame Count */
165#define UnicastFramesXmittedOK EMAC_TXC_UNICST /* Unicast TX Frame Count */
166#define MulticastFramesXmittedOK EMAC_TXC_MULTI /* Multicast TX Frame Count */
167#define BroadcastFramesXmittedOK EMAC_TXC_BROAD /* Broadcast TX Frame Count */
168#define FramesWithExcessiveDeferral EMAC_TXC_XS_DFR /* TX Frames With Excessive Deferral Count */
169#define MACControlFramesTransmitted EMAC_TXC_MACCTL /* MAC Control TX Frame Count */
170#define FramesTransmittedAll EMAC_TXC_ALLFRM /* Overall TX Frame Count */
171#define OctetsTransmittedAll EMAC_TXC_ALLOCT /* Overall TX Octet Count */
172#define FramesLenEq64Transmitted EMAC_TXC_EQ64 /* Good TX Frame Count - Byte Count x = 64 */
173#define FramesLen65_127Transmitted EMAC_TXC_LT128 /* Good TX Frame Count - Byte Count 64 <= x < 128 */
174#define FramesLen128_255Transmitted EMAC_TXC_LT256 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
175#define FramesLen256_511Transmitted EMAC_TXC_LT512 /* Good TX Frame Count - Byte Count 256 <= x < 512 */
176#define FramesLen512_1023Transmitted EMAC_TXC_LT1024 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
177#define FramesLen1024_MaxTransmitted EMAC_TXC_GE1024 /* Good TX Frame Count - Byte Count x >= 1024 */
178#define TxAbortedFrames EMAC_TXC_ABORT /* Total TX Frames Aborted Count */
179
180/***********************************************************************************
181** System MMR Register Bits And Macros
182**
183** Disclaimer: All macros are intended to make C and Assembly code more readable.
184** Use these macros carefully, as any that do left shifts for field
185** depositing will result in the lower order bits being destroyed. Any
186** macro that shifts left to properly position the bit-field should be
187** used as part of an OR to initialize a register and NOT as a dynamic
188** modifier UNLESS the lower order bits are saved and ORed back in when
189** the macro is used.
190*************************************************************************************/
191/************************ ETHERNET 10/100 CONTROLLER MASKS ************************/
192/* EMAC_OPMODE Masks */
193#define RE 0x00000001 /* Receiver Enable */
194#define ASTP 0x00000002 /* Enable Automatic Pad Stripping On RX Frames */
195#define HU 0x00000010 /* Hash Filter Unicast Address */
196#define HM 0x00000020 /* Hash Filter Multicast Address */
197#define PAM 0x00000040 /* Pass-All-Multicast Mode Enable */
198#define PR 0x00000080 /* Promiscuous Mode Enable */
199#define IFE 0x00000100 /* Inverse Filtering Enable */
200#define DBF 0x00000200 /* Disable Broadcast Frame Reception */
201#define PBF 0x00000400 /* Pass Bad Frames Enable */
202#define PSF 0x00000800 /* Pass Short Frames Enable */
203#define RAF 0x00001000 /* Receive-All Mode */
204#define TE 0x00010000 /* Transmitter Enable */
205#define DTXPAD 0x00020000 /* Disable Automatic TX Padding */
206#define DTXCRC 0x00040000 /* Disable Automatic TX CRC Generation */
207#define DC 0x00080000 /* Deferral Check */
208#define BOLMT 0x00300000 /* Back-Off Limit */
209#define BOLMT_10 0x00000000 /* 10-bit range */
210#define BOLMT_8 0x00100000 /* 8-bit range */
211#define BOLMT_4 0x00200000 /* 4-bit range */
212#define BOLMT_1 0x00300000 /* 1-bit range */
213#define DRTY 0x00400000 /* Disable TX Retry On Collision */
214#define LCTRE 0x00800000 /* Enable TX Retry On Late Collision */
215#define RMII 0x01000000 /* RMII/MII* Mode */
216#define RMII_10 0x02000000 /* Speed Select for RMII Port (10MBit/100MBit*) */
217#define FDMODE 0x04000000 /* Duplex Mode Enable (Full/Half*) */
218#define LB 0x08000000 /* Internal Loopback Enable */
219#define DRO 0x10000000 /* Disable Receive Own Frames (Half-Duplex Mode) */
220
221/* EMAC_STAADD Masks */
222#define STABUSY 0x00000001 /* Initiate Station Mgt Reg Access / STA Busy Stat */
223#define STAOP 0x00000002 /* Station Management Operation Code (Write/Read*) */
224#define STADISPRE 0x00000004 /* Disable Preamble Generation */
225#define STAIE 0x00000008 /* Station Mgt. Transfer Done Interrupt Enable */
226#define REGAD 0x000007C0 /* STA Register Address */
227#define PHYAD 0x0000F800 /* PHY Device Address */
228
229#define SET_REGAD(x) (((x)&0x1F)<< 6 ) /* Set STA Register Address */
230#define SET_PHYAD(x) (((x)&0x1F)<< 11 ) /* Set PHY Device Address */
231
232/* EMAC_STADAT Mask */
233#define STADATA 0x0000FFFF /* Station Management Data */
234
235/* EMAC_FLC Masks */
236#define FLCBUSY 0x00000001 /* Send Flow Ctrl Frame / Flow Ctrl Busy Status */
237#define FLCE 0x00000002 /* Flow Control Enable */
238#define PCF 0x00000004 /* Pass Control Frames */
239#define BKPRSEN 0x00000008 /* Enable Backpressure */
240#define FLCPAUSE 0xFFFF0000 /* Pause Time */
241
242#define SET_FLCPAUSE(x) (((x)&0xFFFF)<< 16) /* Set Pause Time */
243
244/* EMAC_WKUP_CTL Masks */
245#define CAPWKFRM 0x00000001 /* Capture Wake-Up Frames */
246#define MPKE 0x00000002 /* Magic Packet Enable */
247#define RWKE 0x00000004 /* Remote Wake-Up Frame Enable */
248#define GUWKE 0x00000008 /* Global Unicast Wake Enable */
249#define MPKS 0x00000020 /* Magic Packet Received Status */
250#define RWKS 0x00000F00 /* Wake-Up Frame Received Status, Filters 3:0 */
251
252/* EMAC_WKUP_FFCMD Masks */
253#define WF0_E 0x00000001 /* Enable Wake-Up Filter 0 */
254#define WF0_T 0x00000008 /* Wake-Up Filter 0 Addr Type (Multicast/Unicast*) */
255#define WF1_E 0x00000100 /* Enable Wake-Up Filter 1 */
256#define WF1_T 0x00000800 /* Wake-Up Filter 1 Addr Type (Multicast/Unicast*) */
257#define WF2_E 0x00010000 /* Enable Wake-Up Filter 2 */
258#define WF2_T 0x00080000 /* Wake-Up Filter 2 Addr Type (Multicast/Unicast*) */
259#define WF3_E 0x01000000 /* Enable Wake-Up Filter 3 */
260#define WF3_T 0x08000000 /* Wake-Up Filter 3 Addr Type (Multicast/Unicast*) */
261
262/* EMAC_WKUP_FFOFF Masks */
263#define WF0_OFF 0x000000FF /* Wake-Up Filter 0 Pattern Offset */
264#define WF1_OFF 0x0000FF00 /* Wake-Up Filter 1 Pattern Offset */
265#define WF2_OFF 0x00FF0000 /* Wake-Up Filter 2 Pattern Offset */
266#define WF3_OFF 0xFF000000 /* Wake-Up Filter 3 Pattern Offset */
267
268#define SET_WF0_OFF(x) (((x)&0xFF)<< 0 ) /* Set Wake-Up Filter 0 Byte Offset */
269#define SET_WF1_OFF(x) (((x)&0xFF)<< 8 ) /* Set Wake-Up Filter 1 Byte Offset */
270#define SET_WF2_OFF(x) (((x)&0xFF)<< 16 ) /* Set Wake-Up Filter 2 Byte Offset */
271#define SET_WF3_OFF(x) (((x)&0xFF)<< 24 ) /* Set Wake-Up Filter 3 Byte Offset */
272/* Set ALL Offsets */
273#define SET_WF_OFFS(x0,x1,x2,x3) (SET_WF0_OFF((x0))|SET_WF1_OFF((x1))|SET_WF2_OFF((x2))|SET_WF3_OFF((x3)))
274
275/* EMAC_WKUP_FFCRC0 Masks */
276#define WF0_CRC 0x0000FFFF /* Wake-Up Filter 0 Pattern CRC */
277#define WF1_CRC 0xFFFF0000 /* Wake-Up Filter 1 Pattern CRC */
278
279#define SET_WF0_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 0 Target CRC */
280#define SET_WF1_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 1 Target CRC */
281
282/* EMAC_WKUP_FFCRC1 Masks */
283#define WF2_CRC 0x0000FFFF /* Wake-Up Filter 2 Pattern CRC */
284#define WF3_CRC 0xFFFF0000 /* Wake-Up Filter 3 Pattern CRC */
285
286#define SET_WF2_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 2 Target CRC */
287#define SET_WF3_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 3 Target CRC */
288
289/* EMAC_SYSCTL Masks */
290#define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */
291#define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */
292#define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */
293#define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */
294
295#define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */
296
297/* EMAC_SYSTAT Masks */
298#define PHYINT 0x00000001 /* PHY_INT Interrupt Status */
299#define MMCINT 0x00000002 /* MMC Counter Interrupt Status */
300#define RXFSINT 0x00000004 /* RX Frame-Status Interrupt Status */
301#define TXFSINT 0x00000008 /* TX Frame-Status Interrupt Status */
302#define WAKEDET 0x00000010 /* Wake-Up Detected Status */
303#define RXDMAERR 0x00000020 /* RX DMA Direction Error Status */
304#define TXDMAERR 0x00000040 /* TX DMA Direction Error Status */
305#define STMDONE 0x00000080 /* Station Mgt. Transfer Done Interrupt Status */
306
307/* EMAC_RX_STAT, EMAC_RX_STKY, and EMAC_RX_IRQE Masks */
308#define RX_FRLEN 0x000007FF /* Frame Length In Bytes */
309#define RX_COMP 0x00001000 /* RX Frame Complete */
310#define RX_OK 0x00002000 /* RX Frame Received With No Errors */
311#define RX_LONG 0x00004000 /* RX Frame Too Long Error */
312#define RX_ALIGN 0x00008000 /* RX Frame Alignment Error */
313#define RX_CRC 0x00010000 /* RX Frame CRC Error */
314#define RX_LEN 0x00020000 /* RX Frame Length Error */
315#define RX_FRAG 0x00040000 /* RX Frame Fragment Error */
316#define RX_ADDR 0x00080000 /* RX Frame Address Filter Failed Error */
317#define RX_DMAO 0x00100000 /* RX Frame DMA Overrun Error */
318#define RX_PHY 0x00200000 /* RX Frame PHY Error */
319#define RX_LATE 0x00400000 /* RX Frame Late Collision Error */
320#define RX_RANGE 0x00800000 /* RX Frame Length Field Out of Range Error */
321#define RX_MULTI 0x01000000 /* RX Multicast Frame Indicator */
322#define RX_BROAD 0x02000000 /* RX Broadcast Frame Indicator */
323#define RX_CTL 0x04000000 /* RX Control Frame Indicator */
324#define RX_UCTL 0x08000000 /* Unsupported RX Control Frame Indicator */
325#define RX_TYPE 0x10000000 /* RX Typed Frame Indicator */
326#define RX_VLAN1 0x20000000 /* RX VLAN1 Frame Indicator */
327#define RX_VLAN2 0x40000000 /* RX VLAN2 Frame Indicator */
328#define RX_ACCEPT 0x80000000 /* RX Frame Accepted Indicator */
329
330/* EMAC_TX_STAT, EMAC_TX_STKY, and EMAC_TX_IRQE Masks */
331#define TX_COMP 0x00000001 /* TX Frame Complete */
332#define TX_OK 0x00000002 /* TX Frame Sent With No Errors */
333#define TX_ECOLL 0x00000004 /* TX Frame Excessive Collision Error */
334#define TX_LATE 0x00000008 /* TX Frame Late Collision Error */
335#define TX_DMAU 0x00000010 /* TX Frame DMA Underrun Error (STAT) */
336#define TX_MACE 0x00000010 /* Internal MAC Error Detected (STKY and IRQE) */
337#define TX_EDEFER 0x00000020 /* TX Frame Excessive Deferral Error */
338#define TX_BROAD 0x00000040 /* TX Broadcast Frame Indicator */
339#define TX_MULTI 0x00000080 /* TX Multicast Frame Indicator */
340#define TX_CCNT 0x00000F00 /* TX Frame Collision Count */
341#define TX_DEFER 0x00001000 /* TX Frame Deferred Indicator */
342#define TX_CRS 0x00002000 /* TX Frame Carrier Sense Not Asserted Error */
343#define TX_LOSS 0x00004000 /* TX Frame Carrier Lost During TX Error */
344#define TX_RETRY 0x00008000 /* TX Frame Successful After Retry */
345#define TX_FRLEN 0x07FF0000 /* TX Frame Length (Bytes) */
346
347/* EMAC_MMC_CTL Masks */
348#define RSTC 0x00000001 /* Reset All Counters */
349#define CROLL 0x00000002 /* Counter Roll-Over Enable */
350#define CCOR 0x00000004 /* Counter Clear-On-Read Mode Enable */
351#define MMCE 0x00000008 /* Enable MMC Counter Operation */
352
353/* EMAC_MMC_RIRQS and EMAC_MMC_RIRQE Masks */
354#define RX_OK_CNT 0x00000001 /* RX Frames Received With No Errors */
355#define RX_FCS_CNT 0x00000002 /* RX Frames W/Frame Check Sequence Errors */
356#define RX_ALIGN_CNT 0x00000004 /* RX Frames With Alignment Errors */
357#define RX_OCTET_CNT 0x00000008 /* RX Octets Received OK */
358#define RX_LOST_CNT 0x00000010 /* RX Frames Lost Due To Internal MAC RX Error */
359#define RX_UNI_CNT 0x00000020 /* Unicast RX Frames Received OK */
360#define RX_MULTI_CNT 0x00000040 /* Multicast RX Frames Received OK */
361#define RX_BROAD_CNT 0x00000080 /* Broadcast RX Frames Received OK */
362#define RX_IRL_CNT 0x00000100 /* RX Frames With In-Range Length Errors */
363#define RX_ORL_CNT 0x00000200 /* RX Frames With Out-Of-Range Length Errors */
364#define RX_LONG_CNT 0x00000400 /* RX Frames With Frame Too Long Errors */
365#define RX_MACCTL_CNT 0x00000800 /* MAC Control RX Frames Received */
366#define RX_OPCODE_CTL 0x00001000 /* Unsupported Op-Code RX Frames Received */
367#define RX_PAUSE_CNT 0x00002000 /* PAUSEMAC Control RX Frames Received */
368#define RX_ALLF_CNT 0x00004000 /* All RX Frames Received */
369#define RX_ALLO_CNT 0x00008000 /* All RX Octets Received */
370#define RX_TYPED_CNT 0x00010000 /* Typed RX Frames Received */
371#define RX_SHORT_CNT 0x00020000 /* RX Frame Fragments (< 64 Bytes) Received */
372#define RX_EQ64_CNT 0x00040000 /* 64-Byte RX Frames Received */
373#define RX_LT128_CNT 0x00080000 /* 65-127-Byte RX Frames Received */
374#define RX_LT256_CNT 0x00100000 /* 128-255-Byte RX Frames Received */
375#define RX_LT512_CNT 0x00200000 /* 256-511-Byte RX Frames Received */
376#define RX_LT1024_CNT 0x00400000 /* 512-1023-Byte RX Frames Received */
377#define RX_GE1024_CNT 0x00800000 /* 1024-Max-Byte RX Frames Received */
378
379/* EMAC_MMC_TIRQS and EMAC_MMC_TIRQE Masks */
380#define TX_OK_CNT 0x00000001 /* TX Frames Sent OK */
381#define TX_SCOLL_CNT 0x00000002 /* TX Frames With Single Collisions */
382#define TX_MCOLL_CNT 0x00000004 /* TX Frames With Multiple Collisions */
383#define TX_OCTET_CNT 0x00000008 /* TX Octets Sent OK */
384#define TX_DEFER_CNT 0x00000010 /* TX Frames With Deferred Transmission */
385#define TX_LATE_CNT 0x00000020 /* TX Frames With Late Collisions */
386#define TX_ABORTC_CNT 0x00000040 /* TX Frames Aborted Due To Excess Collisions */
387#define TX_LOST_CNT 0x00000080 /* TX Frames Lost Due To Internal MAC TX Error */
388#define TX_CRS_CNT 0x00000100 /* TX Frames With Carrier Sense Errors */
389#define TX_UNI_CNT 0x00000200 /* Unicast TX Frames Sent */
390#define TX_MULTI_CNT 0x00000400 /* Multicast TX Frames Sent */
391#define TX_BROAD_CNT 0x00000800 /* Broadcast TX Frames Sent */
392#define TX_EXDEF_CTL 0x00001000 /* TX Frames With Excessive Deferral */
393#define TX_MACCTL_CNT 0x00002000 /* MAC Control TX Frames Sent */
394#define TX_ALLF_CNT 0x00004000 /* All TX Frames Sent */
395#define TX_ALLO_CNT 0x00008000 /* All TX Octets Sent */
396#define TX_EQ64_CNT 0x00010000 /* 64-Byte TX Frames Sent */
397#define TX_LT128_CNT 0x00020000 /* 65-127-Byte TX Frames Sent */
398#define TX_LT256_CNT 0x00040000 /* 128-255-Byte TX Frames Sent */
399#define TX_LT512_CNT 0x00080000 /* 256-511-Byte TX Frames Sent */
400#define TX_LT1024_CNT 0x00100000 /* 512-1023-Byte TX Frames Sent */
401#define TX_GE1024_CNT 0x00200000 /* 1024-Max-Byte TX Frames Sent */
402#define TX_ABORT_CNT 0x00400000 /* TX Frames Aborted */
403
404#endif /* _DEF_BF537_H */
diff --git a/include/asm-blackfin/mach-bf537/dma.h b/include/asm-blackfin/mach-bf537/dma.h
new file mode 100644
index 000000000000..7a964040870a
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/dma.h
@@ -0,0 +1,55 @@
1/*
2 * file: include/asm-blackfin/mach-bf537/dma.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * system mmr register map
9 * rev:
10 *
11 * modified:
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */
31
32#ifndef _MACH_DMA_H_
33#define _MACH_DMA_H_
34
35#define MAX_BLACKFIN_DMA_CHANNEL 16
36
37#define CH_PPI 0
38#define CH_EMAC_RX 1
39#define CH_EMAC_TX 2
40#define CH_SPORT0_RX 3
41#define CH_SPORT0_TX 4
42#define CH_SPORT1_RX 5
43#define CH_SPORT1_TX 6
44#define CH_SPI 7
45#define CH_UART0_RX 8
46#define CH_UART0_TX 9
47#define CH_UART1_RX 10
48#define CH_UART1_TX 11
49
50#define CH_MEM_STREAM0_DEST 12 /* TX */
51#define CH_MEM_STREAM0_SRC 13 /* RX */
52#define CH_MEM_STREAM1_DEST 14 /* TX */
53#define CH_MEM_STREAM1_SRC 15 /* RX */
54
55#endif
diff --git a/include/asm-blackfin/mach-bf537/irq.h b/include/asm-blackfin/mach-bf537/irq.h
new file mode 100644
index 000000000000..8af2a832ef6b
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/irq.h
@@ -0,0 +1,219 @@
1/*
2 * file: include/asm-blackfin/mach-bf537/irq.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * system mmr register map
9 * rev:
10 *
11 * modified:
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */
31
32#ifndef _BF537_IRQ_H_
33#define _BF537_IRQ_H_
34
35/*
36 * Interrupt source definitions
37 Event Source Core Event Name
38Core Emulation **
39 Events (highest priority) EMU 0
40 Reset RST 1
41 NMI NMI 2
42 Exception EVX 3
43 Reserved -- 4
44 Hardware Error IVHW 5
45 Core Timer IVTMR 6 *
46
47.....
48
49 Software Interrupt 1 IVG14 31
50 Software Interrupt 2 --
51 (lowest priority) IVG15 32 *
52 */
53
54#define SYS_IRQS 41
55#define NR_PERI_INTS 32
56
57/* The ABSTRACT IRQ definitions */
58/** the first seven of the following are fixed, the rest you change if you need to **/
59#define IRQ_EMU 0 /*Emulation */
60#define IRQ_RST 1 /*reset */
61#define IRQ_NMI 2 /*Non Maskable */
62#define IRQ_EVX 3 /*Exception */
63#define IRQ_UNUSED 4 /*- unused interrupt*/
64#define IRQ_HWERR 5 /*Hardware Error */
65#define IRQ_CORETMR 6 /*Core timer */
66
67#define IRQ_PLL_WAKEUP 7 /*PLL Wakeup Interrupt */
68#define IRQ_DMA_ERROR 8 /*DMA Error (general) */
69#define IRQ_GENERIC_ERROR 9 /*GENERIC Error Interrupt */
70#define IRQ_RTC 10 /*RTC Interrupt */
71#define IRQ_PPI 11 /*DMA0 Interrupt (PPI) */
72#define IRQ_SPORT0_RX 12 /*DMA3 Interrupt (SPORT0 RX) */
73#define IRQ_SPORT0_TX 13 /*DMA4 Interrupt (SPORT0 TX) */
74#define IRQ_SPORT1_RX 14 /*DMA5 Interrupt (SPORT1 RX) */
75#define IRQ_SPORT1_TX 15 /*DMA6 Interrupt (SPORT1 TX) */
76#define IRQ_TWI 16 /*TWI Interrupt */
77#define IRQ_SPI 17 /*DMA7 Interrupt (SPI) */
78#define IRQ_UART0_RX 18 /*DMA8 Interrupt (UART0 RX) */
79#define IRQ_UART0_TX 19 /*DMA9 Interrupt (UART0 TX) */
80#define IRQ_UART1_RX 20 /*DMA10 Interrupt (UART1 RX) */
81#define IRQ_UART1_TX 21 /*DMA11 Interrupt (UART1 TX) */
82#define IRQ_CAN_RX 22 /*CAN Receive Interrupt */
83#define IRQ_CAN_TX 23 /*CAN Transmit Interrupt */
84#define IRQ_MAC_RX 24 /*DMA1 (Ethernet RX) Interrupt */
85#define IRQ_MAC_TX 25 /*DMA2 (Ethernet TX) Interrupt */
86#define IRQ_TMR0 26 /*Timer 0 */
87#define IRQ_TMR1 27 /*Timer 1 */
88#define IRQ_TMR2 28 /*Timer 2 */
89#define IRQ_TMR3 29 /*Timer 3 */
90#define IRQ_TMR4 30 /*Timer 4 */
91#define IRQ_TMR5 31 /*Timer 5 */
92#define IRQ_TMR6 32 /*Timer 6 */
93#define IRQ_TMR7 33 /*Timer 7 */
94#define IRQ_PROG_INTA 34 /* PF Ports F&G (PF15:0) Interrupt A */
95#define IRQ_PORTG_INTB 35 /* PF Port G (PF15:0) Interrupt B */
96#define IRQ_MEM_DMA0 36 /*(Memory DMA Stream 0) */
97#define IRQ_MEM_DMA1 37 /*(Memory DMA Stream 1) */
98#define IRQ_PROG_INTB 38 /* PF Ports F (PF15:0) Interrupt B */
99#define IRQ_WATCH 38 /*Watch Dog Timer */
100#define IRQ_SW_INT1 40 /*Software Int 1 */
101#define IRQ_SW_INT2 41 /*Software Int 2 (reserved for SYSCALL) */
102
103#define IRQ_PPI_ERROR 42 /*PPI Error Interrupt */
104#define IRQ_CAN_ERROR 43 /*CAN Error Interrupt */
105#define IRQ_MAC_ERROR 44 /*PPI Error Interrupt */
106#define IRQ_SPORT0_ERROR 45 /*SPORT0 Error Interrupt */
107#define IRQ_SPORT1_ERROR 46 /*SPORT1 Error Interrupt */
108#define IRQ_SPI_ERROR 47 /*SPI Error Interrupt */
109#define IRQ_UART0_ERROR 48 /*UART Error Interrupt */
110#define IRQ_UART1_ERROR 49 /*UART Error Interrupt */
111
112#define IRQ_PF0 50
113#define IRQ_PF1 51
114#define IRQ_PF2 52
115#define IRQ_PF3 53
116#define IRQ_PF4 54
117#define IRQ_PF5 55
118#define IRQ_PF6 56
119#define IRQ_PF7 57
120#define IRQ_PF8 58
121#define IRQ_PF9 59
122#define IRQ_PF10 60
123#define IRQ_PF11 61
124#define IRQ_PF12 62
125#define IRQ_PF13 63
126#define IRQ_PF14 64
127#define IRQ_PF15 65
128
129#define IRQ_PG0 66
130#define IRQ_PG1 67
131#define IRQ_PG2 68
132#define IRQ_PG3 69
133#define IRQ_PG4 70
134#define IRQ_PG5 71
135#define IRQ_PG6 72
136#define IRQ_PG7 73
137#define IRQ_PG8 74
138#define IRQ_PG9 75
139#define IRQ_PG10 76
140#define IRQ_PG11 77
141#define IRQ_PG12 78
142#define IRQ_PG13 79
143#define IRQ_PG14 80
144#define IRQ_PG15 81
145
146#define IRQ_PH0 82
147#define IRQ_PH1 83
148#define IRQ_PH2 84
149#define IRQ_PH3 85
150#define IRQ_PH4 86
151#define IRQ_PH5 87
152#define IRQ_PH6 88
153#define IRQ_PH7 89
154#define IRQ_PH8 90
155#define IRQ_PH9 91
156#define IRQ_PH10 92
157#define IRQ_PH11 93
158#define IRQ_PH12 94
159#define IRQ_PH13 95
160#define IRQ_PH14 96
161#define IRQ_PH15 97
162
163#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
164#define NR_IRQS (IRQ_PH15+1)
165#else
166#define NR_IRQS (IRQ_UART1_ERROR+1)
167#endif
168
169#define IVG7 7
170#define IVG8 8
171#define IVG9 9
172#define IVG10 10
173#define IVG11 11
174#define IVG12 12
175#define IVG13 13
176#define IVG14 14
177#define IVG15 15
178
179/* IAR0 BIT FIELDS*/
180#define IRQ_PLL_WAKEUP_POS 0
181#define IRQ_DMA_ERROR_POS 4
182#define IRQ_ERROR_POS 8
183#define IRQ_RTC_POS 12
184#define IRQ_PPI_POS 16
185#define IRQ_SPORT0_RX_POS 20
186#define IRQ_SPORT0_TX_POS 24
187#define IRQ_SPORT1_RX_POS 28
188
189/* IAR1 BIT FIELDS*/
190#define IRQ_SPORT1_TX_POS 0
191#define IRQ_TWI_POS 4
192#define IRQ_SPI_POS 8
193#define IRQ_UART0_RX_POS 12
194#define IRQ_UART0_TX_POS 16
195#define IRQ_UART1_RX_POS 20
196#define IRQ_UART1_TX_POS 24
197#define IRQ_CAN_RX_POS 28
198
199/* IAR2 BIT FIELDS*/
200#define IRQ_CAN_TX_POS 0
201#define IRQ_MAC_RX_POS 4
202#define IRQ_MAC_TX_POS 8
203#define IRQ_TMR0_POS 12
204#define IRQ_TMR1_POS 16
205#define IRQ_TMR2_POS 20
206#define IRQ_TMR3_POS 24
207#define IRQ_TMR4_POS 28
208
209/* IAR3 BIT FIELDS*/
210#define IRQ_TMR5_POS 0
211#define IRQ_TMR6_POS 4
212#define IRQ_TMR7_POS 8
213#define IRQ_PROG_INTA_POS 12
214#define IRQ_PORTG_INTB_POS 16
215#define IRQ_MEM_DMA0_POS 20
216#define IRQ_MEM_DMA1_POS 24
217#define IRQ_WATCH_POS 28
218
219#endif /* _BF537_IRQ_H_ */
diff --git a/include/asm-blackfin/mach-bf537/mem_init.h b/include/asm-blackfin/mach-bf537/mem_init.h
new file mode 100644
index 000000000000..9ad979d416c6
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/mem_init.h
@@ -0,0 +1,330 @@
1/*
2 * File: include/asm-blackfin/mach-bf537/mem_init.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 * Copyright 2004-2006 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || CONFIG_MEM_MT48LC16M8A2TG_75 || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC32M8A2_75)
33#if (CONFIG_SCLK_HZ > 119402985)
34#define SDRAM_tRP TRP_2
35#define SDRAM_tRP_num 2
36#define SDRAM_tRAS TRAS_7
37#define SDRAM_tRAS_num 7
38#define SDRAM_tRCD TRCD_2
39#define SDRAM_tWR TWR_2
40#endif
41#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
42#define SDRAM_tRP TRP_2
43#define SDRAM_tRP_num 2
44#define SDRAM_tRAS TRAS_6
45#define SDRAM_tRAS_num 6
46#define SDRAM_tRCD TRCD_2
47#define SDRAM_tWR TWR_2
48#endif
49#if (CONFIG_SCLK_HZ > 89552239) && (CONFIG_SCLK_HZ <= 104477612)
50#define SDRAM_tRP TRP_2
51#define SDRAM_tRP_num 2
52#define SDRAM_tRAS TRAS_5
53#define SDRAM_tRAS_num 5
54#define SDRAM_tRCD TRCD_2
55#define SDRAM_tWR TWR_2
56#endif
57#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
58#define SDRAM_tRP TRP_2
59#define SDRAM_tRP_num 2
60#define SDRAM_tRAS TRAS_4
61#define SDRAM_tRAS_num 4
62#define SDRAM_tRCD TRCD_2
63#define SDRAM_tWR TWR_2
64#endif
65#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
66#define SDRAM_tRP TRP_2
67#define SDRAM_tRP_num 2
68#define SDRAM_tRAS TRAS_3
69#define SDRAM_tRAS_num 3
70#define SDRAM_tRCD TRCD_2
71#define SDRAM_tWR TWR_2
72#endif
73#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
74#define SDRAM_tRP TRP_1
75#define SDRAM_tRP_num 1
76#define SDRAM_tRAS TRAS_4
77#define SDRAM_tRAS_num 3
78#define SDRAM_tRCD TRCD_1
79#define SDRAM_tWR TWR_2
80#endif
81#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
82#define SDRAM_tRP TRP_1
83#define SDRAM_tRP_num 1
84#define SDRAM_tRAS TRAS_3
85#define SDRAM_tRAS_num 3
86#define SDRAM_tRCD TRCD_1
87#define SDRAM_tWR TWR_2
88#endif
89#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
90#define SDRAM_tRP TRP_1
91#define SDRAM_tRP_num 1
92#define SDRAM_tRAS TRAS_2
93#define SDRAM_tRAS_num 2
94#define SDRAM_tRCD TRCD_1
95#define SDRAM_tWR TWR_2
96#endif
97#if (CONFIG_SCLK_HZ <= 29850746)
98#define SDRAM_tRP TRP_1
99#define SDRAM_tRP_num 1
100#define SDRAM_tRAS TRAS_1
101#define SDRAM_tRAS_num 1
102#define SDRAM_tRCD TRCD_1
103#define SDRAM_tWR TWR_2
104#endif
105#endif
106
107#if (CONFIG_MEM_MT48LC16M16A2TG_75)
108 /*SDRAM INFORMATION: */
109#define SDRAM_Tref 64 /* Refresh period in milliseconds */
110#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
111#define SDRAM_CL CL_3
112#endif
113
114#if (CONFIG_MEM_MT48LC16M8A2TG_75)
115 /*SDRAM INFORMATION: */
116#define SDRAM_Tref 64 /* Refresh period in milliseconds */
117#define SDRAM_NRA 4096 /* Number of row addresses in SDRAM */
118#define SDRAM_CL CL_3
119#endif
120
121#if (CONFIG_MEM_MT48LC32M8A2_75)
122 /*SDRAM INFORMATION: */
123#define SDRAM_Tref 64 /* Refresh period in milliseconds */
124#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
125#define SDRAM_CL CL_3
126#endif
127
128#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
129 /*SDRAM INFORMATION: */
130#define SDRAM_Tref 64 /* Refresh period in milliseconds */
131#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
132#define SDRAM_CL CL_3
133#endif
134
135#if (CONFIG_MEM_GENERIC_BOARD)
136 /*SDRAM INFORMATION: Modify this for your board */
137#define SDRAM_Tref 64 /* Refresh period in milliseconds */
138#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
139#define SDRAM_CL CL_3
140#endif
141
142#if (CONFIG_MEM_SIZE == 128)
143#define SDRAM_SIZE EBSZ_128
144#endif
145#if (CONFIG_MEM_SIZE == 64)
146#define SDRAM_SIZE EBSZ_64
147#endif
148#if (CONFIG_MEM_SIZE == 32)
149#define SDRAM_SIZE EBSZ_32
150#endif
151#if (CONFIG_MEM_SIZE == 16)
152#define SDRAM_SIZE EBSZ_16
153#endif
154#if (CONFIG_MEM_ADD_WIDTH == 11)
155#define SDRAM_WIDTH EBCAW_11
156#endif
157#if (CONFIG_MEM_ADD_WIDTH == 10)
158#define SDRAM_WIDTH EBCAW_10
159#endif
160#if (CONFIG_MEM_ADD_WIDTH == 9)
161#define SDRAM_WIDTH EBCAW_9
162#endif
163#if (CONFIG_MEM_ADD_WIDTH == 8)
164#define SDRAM_WIDTH EBCAW_8
165#endif
166
167#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EBE)
168
169/* Equation from section 17 (p17-46) of BF533 HRM */
170#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
171
172/* Enable SCLK Out */
173#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
174
175#if defined CONFIG_CLKIN_HALF
176#define CLKIN_HALF 1
177#else
178#define CLKIN_HALF 0
179#endif
180
181#if defined CONFIG_PLL_BYPASS
182#define PLL_BYPASS 1
183#else
184#define PLL_BYPASS 0
185#endif
186
187/***************************************Currently Not Being Used *********************************/
188#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
189#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
190#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
191#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
192#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
193
194#if (flash_EBIU_AMBCTL_TT > 3)
195#define flash_EBIU_AMBCTL0_TT B0TT_4
196#endif
197#if (flash_EBIU_AMBCTL_TT == 3)
198#define flash_EBIU_AMBCTL0_TT B0TT_3
199#endif
200#if (flash_EBIU_AMBCTL_TT == 2)
201#define flash_EBIU_AMBCTL0_TT B0TT_2
202#endif
203#if (flash_EBIU_AMBCTL_TT < 2)
204#define flash_EBIU_AMBCTL0_TT B0TT_1
205#endif
206
207#if (flash_EBIU_AMBCTL_ST > 3)
208#define flash_EBIU_AMBCTL0_ST B0ST_4
209#endif
210#if (flash_EBIU_AMBCTL_ST == 3)
211#define flash_EBIU_AMBCTL0_ST B0ST_3
212#endif
213#if (flash_EBIU_AMBCTL_ST == 2)
214#define flash_EBIU_AMBCTL0_ST B0ST_2
215#endif
216#if (flash_EBIU_AMBCTL_ST < 2)
217#define flash_EBIU_AMBCTL0_ST B0ST_1
218#endif
219
220#if (flash_EBIU_AMBCTL_HT > 2)
221#define flash_EBIU_AMBCTL0_HT B0HT_3
222#endif
223#if (flash_EBIU_AMBCTL_HT == 2)
224#define flash_EBIU_AMBCTL0_HT B0HT_2
225#endif
226#if (flash_EBIU_AMBCTL_HT == 1)
227#define flash_EBIU_AMBCTL0_HT B0HT_1
228#endif
229#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
230#define flash_EBIU_AMBCTL0_HT B0HT_0
231#endif
232#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
233#define flash_EBIU_AMBCTL0_HT B0HT_1
234#endif
235
236#if (flash_EBIU_AMBCTL_WAT > 14)
237#define flash_EBIU_AMBCTL0_WAT B0WAT_15
238#endif
239#if (flash_EBIU_AMBCTL_WAT == 14)
240#define flash_EBIU_AMBCTL0_WAT B0WAT_14
241#endif
242#if (flash_EBIU_AMBCTL_WAT == 13)
243#define flash_EBIU_AMBCTL0_WAT B0WAT_13
244#endif
245#if (flash_EBIU_AMBCTL_WAT == 12)
246#define flash_EBIU_AMBCTL0_WAT B0WAT_12
247#endif
248#if (flash_EBIU_AMBCTL_WAT == 11)
249#define flash_EBIU_AMBCTL0_WAT B0WAT_11
250#endif
251#if (flash_EBIU_AMBCTL_WAT == 10)
252#define flash_EBIU_AMBCTL0_WAT B0WAT_10
253#endif
254#if (flash_EBIU_AMBCTL_WAT == 9)
255#define flash_EBIU_AMBCTL0_WAT B0WAT_9
256#endif
257#if (flash_EBIU_AMBCTL_WAT == 8)
258#define flash_EBIU_AMBCTL0_WAT B0WAT_8
259#endif
260#if (flash_EBIU_AMBCTL_WAT == 7)
261#define flash_EBIU_AMBCTL0_WAT B0WAT_7
262#endif
263#if (flash_EBIU_AMBCTL_WAT == 6)
264#define flash_EBIU_AMBCTL0_WAT B0WAT_6
265#endif
266#if (flash_EBIU_AMBCTL_WAT == 5)
267#define flash_EBIU_AMBCTL0_WAT B0WAT_5
268#endif
269#if (flash_EBIU_AMBCTL_WAT == 4)
270#define flash_EBIU_AMBCTL0_WAT B0WAT_4
271#endif
272#if (flash_EBIU_AMBCTL_WAT == 3)
273#define flash_EBIU_AMBCTL0_WAT B0WAT_3
274#endif
275#if (flash_EBIU_AMBCTL_WAT == 2)
276#define flash_EBIU_AMBCTL0_WAT B0WAT_2
277#endif
278#if (flash_EBIU_AMBCTL_WAT == 1)
279#define flash_EBIU_AMBCTL0_WAT B0WAT_1
280#endif
281
282#if (flash_EBIU_AMBCTL_RAT > 14)
283#define flash_EBIU_AMBCTL0_RAT B0RAT_15
284#endif
285#if (flash_EBIU_AMBCTL_RAT == 14)
286#define flash_EBIU_AMBCTL0_RAT B0RAT_14
287#endif
288#if (flash_EBIU_AMBCTL_RAT == 13)
289#define flash_EBIU_AMBCTL0_RAT B0RAT_13
290#endif
291#if (flash_EBIU_AMBCTL_RAT == 12)
292#define flash_EBIU_AMBCTL0_RAT B0RAT_12
293#endif
294#if (flash_EBIU_AMBCTL_RAT == 11)
295#define flash_EBIU_AMBCTL0_RAT B0RAT_11
296#endif
297#if (flash_EBIU_AMBCTL_RAT == 10)
298#define flash_EBIU_AMBCTL0_RAT B0RAT_10
299#endif
300#if (flash_EBIU_AMBCTL_RAT == 9)
301#define flash_EBIU_AMBCTL0_RAT B0RAT_9
302#endif
303#if (flash_EBIU_AMBCTL_RAT == 8)
304#define flash_EBIU_AMBCTL0_RAT B0RAT_8
305#endif
306#if (flash_EBIU_AMBCTL_RAT == 7)
307#define flash_EBIU_AMBCTL0_RAT B0RAT_7
308#endif
309#if (flash_EBIU_AMBCTL_RAT == 6)
310#define flash_EBIU_AMBCTL0_RAT B0RAT_6
311#endif
312#if (flash_EBIU_AMBCTL_RAT == 5)
313#define flash_EBIU_AMBCTL0_RAT B0RAT_5
314#endif
315#if (flash_EBIU_AMBCTL_RAT == 4)
316#define flash_EBIU_AMBCTL0_RAT B0RAT_4
317#endif
318#if (flash_EBIU_AMBCTL_RAT == 3)
319#define flash_EBIU_AMBCTL0_RAT B0RAT_3
320#endif
321#if (flash_EBIU_AMBCTL_RAT == 2)
322#define flash_EBIU_AMBCTL0_RAT B0RAT_2
323#endif
324#if (flash_EBIU_AMBCTL_RAT == 1)
325#define flash_EBIU_AMBCTL0_RAT B0RAT_1
326#endif
327
328#define flash_EBIU_AMBCTL0 \
329 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
330 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/include/asm-blackfin/mach-bf537/mem_map.h b/include/asm-blackfin/mach-bf537/mem_map.h
new file mode 100644
index 000000000000..2a808c1202bf
--- /dev/null
+++ b/include/asm-blackfin/mach-bf537/mem_map.h
@@ -0,0 +1,175 @@
1/*
2 * file: include/asm-blackfin/mach-bf537/mem_map.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * Memory MAP Common header file for blackfin BF537/6/4 of processors.
9 * rev:
10 *
11 * modified:
12 *
13 * bugs: enter bugs at http://blackfin.uclinux.org/
14 *
15 * this program is free software; you can redistribute it and/or modify
16 * it under the terms of the gnu general public license as published by
17 * the free software foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * this program is distributed in the hope that it will be useful,
21 * but without any warranty; without even the implied warranty of
22 * merchantability or fitness for a particular purpose. see the
23 * gnu general public license for more details.
24 *
25 * you should have received a copy of the gnu general public license
26 * along with this program; see the file copying.
27 * if not, write to the free software foundation,
28 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
29 */
30
31#ifndef _MEM_MAP_537_H_
32#define _MEM_MAP_537_H_
33
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
36
37/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
39#define ASYNC_BANK3_SIZE 0x00100000 /* 1M */
40#define ASYNC_BANK2_BASE 0x20200000 /* Async Bank 2 */
41#define ASYNC_BANK2_SIZE 0x00100000 /* 1M */
42#define ASYNC_BANK1_BASE 0x20100000 /* Async Bank 1 */
43#define ASYNC_BANK1_SIZE 0x00100000 /* 1M */
44#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
45#define ASYNC_BANK0_SIZE 0x00100000 /* 1M */
46
47/* Boot ROM Memory */
48
49#define BOOT_ROM_START 0xEF000000
50
51/* Level 1 Memory */
52
53/* Memory Map for ADSP-BF537 processors */
54
55#ifdef CONFIG_BLKFIN_CACHE
56#define BLKFIN_ICACHESIZE (16*1024)
57#else
58#define BLKFIN_ICACHESIZE (0*1024)
59#endif
60
61
62#ifdef CONFIG_BF537
63#define L1_CODE_START 0xFFA00000
64#define L1_DATA_A_START 0xFF800000
65#define L1_DATA_B_START 0xFF900000
66
67#define L1_CODE_LENGTH 0xC000
68
69#ifdef CONFIG_BLKFIN_DCACHE
70
71#ifdef CONFIG_BLKFIN_DCACHE_BANKA
72#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
73#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
74#define L1_DATA_B_LENGTH 0x8000
75#define BLKFIN_DCACHESIZE (16*1024)
76#define BLKFIN_DSUPBANKS 1
77#else
78#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
79#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
80#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
81#define BLKFIN_DCACHESIZE (32*1024)
82#define BLKFIN_DSUPBANKS 2
83#endif
84
85#else
86#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
87#define L1_DATA_A_LENGTH 0x8000
88#define L1_DATA_B_LENGTH 0x8000
89#define BLKFIN_DCACHESIZE (0*1024)
90#define BLKFIN_DSUPBANKS 0
91#endif /*CONFIG_BLKFIN_DCACHE*/
92
93#endif /*CONFIG_BF537*/
94
95/* Memory Map for ADSP-BF536 processors */
96
97#ifdef CONFIG_BF536
98#define L1_CODE_START 0xFFA00000
99#define L1_DATA_A_START 0xFF804000
100#define L1_DATA_B_START 0xFF904000
101
102#define L1_CODE_LENGTH 0xC000
103
104
105#ifdef CONFIG_BLKFIN_DCACHE
106
107#ifdef CONFIG_BLKFIN_DCACHE_BANKA
108#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
109#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
110#define L1_DATA_B_LENGTH 0x4000
111#define BLKFIN_DCACHESIZE (16*1024)
112#define BLKFIN_DSUPBANKS 1
113
114#else
115#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
116#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
117#define L1_DATA_B_LENGTH (0x4000 - 0x4000)
118#define BLKFIN_DCACHESIZE (32*1024)
119#define BLKFIN_DSUPBANKS 2
120#endif
121
122#else
123#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
124#define L1_DATA_A_LENGTH 0x4000
125#define L1_DATA_B_LENGTH 0x4000
126#define BLKFIN_DCACHESIZE (0*1024)
127#define BLKFIN_DSUPBANKS 0
128#endif /*CONFIG_BLKFIN_DCACHE*/
129
130#endif
131
132/* Memory Map for ADSP-BF534 processors */
133
134#ifdef CONFIG_BF534
135#define L1_CODE_START 0xFFA00000
136#define L1_DATA_A_START 0xFF800000
137#define L1_DATA_B_START 0xFF900000
138
139#define L1_CODE_LENGTH 0xC000
140
141#ifdef CONFIG_BLKFIN_DCACHE
142
143#ifdef CONFIG_BLKFIN_DCACHE_BANKA
144#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
145#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
146#define L1_DATA_B_LENGTH 0x8000
147#define BLKFIN_DCACHESIZE (16*1024)
148#define BLKFIN_DSUPBANKS 1
149
150#else
151#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
152#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
153#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
154#define BLKFIN_DCACHESIZE (32*1024)
155#define BLKFIN_DSUPBANKS 2
156#endif
157
158#else
159#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
160#define L1_DATA_A_LENGTH 0x8000
161#define L1_DATA_B_LENGTH 0x8000
162#define BLKFIN_DCACHESIZE (0*1024)
163#define BLKFIN_DSUPBANKS 0
164#endif /*CONFIG_BLKFIN_DCACHE*/
165
166#endif
167
168/* Scratch Pad Memory */
169
170#if defined(CONFIG_BF537) || defined(CONFIG_BF536) || defined(CONFIG_BF534)
171#define L1_SCRATCH_START 0xFFB00000
172#define L1_SCRATCH_LENGTH 0x1000
173#endif
174
175#endif /* _MEM_MAP_537_H_ */
diff --git a/include/asm-blackfin/mach-bf561/anomaly.h b/include/asm-blackfin/mach-bf561/anomaly.h
new file mode 100644
index 000000000000..f5b32d66517d
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/anomaly.h
@@ -0,0 +1,184 @@
1
2/*
3 * File: include/asm-blackfin/mach-bf561/anomaly.h
4 * Based on:
5 * Author:
6 *
7 * Created:
8 * Description:
9 *
10 * Rev:
11 *
12 * Modified:
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32/* This file shoule be up to date with:
33 * - Revision L, 10Aug2006; ADSP-BF561 Silicon Anomaly List
34 */
35
36#ifndef _MACH_ANOMALY_H_
37#define _MACH_ANOMALY_H_
38
39/* We do not support 0.1 or 0.4 silicon - sorry */
40#if (defined(CONFIG_BF_REV_0_1) || defined(CONFIG_BF_REV_0_2) || defined(CONFIG_BF_REV_0_4))
41#error Kernel will not work on BF561 Version 0.1, 0.2, or 0.4
42#endif
43
44/* Issues that are common to 0.5 and 0.3 silicon */
45#if (defined(CONFIG_BF_REV_0_5) || defined(CONFIG_BF_REV_0_3))
46#define ANOMALY_05000074 /* A multi issue instruction with dsp32shiftimm in
47 slot1 and store of a P register in slot 2 is not
48 supported */
49#define ANOMALY_05000099 /* UART Line Status Register (UART_LSR) bits are not
50 updated at the same time. */
51#define ANOMALY_05000120 /* Testset instructions restricted to 32-bit aligned
52 memory locations */
53#define ANOMALY_05000122 /* Rx.H cannot be used to access 16-bit System MMR
54 registers */
55#define ANOMALY_05000127 /* Signbits instruction not functional under certain
56 conditions */
57#define ANOMALY_05000149 /* IMDMA S1/D1 channel may stall */
58#define ANOMALY_05000166 /* PPI Data Lengths Between 8 and 16 do not zero out
59 upper bits */
60#define ANOMALY_05000167 /* Turning Serial Ports on With External Frame Syncs */
61#define ANOMALY_05000180 /* PPI_DELAY not functional in PPI modes with 0 frame
62 syncs */
63#define ANOMALY_05000182 /* IMDMA does not operate to full speed for 600MHz
64 and higher devices */
65#define ANOMALY_05000187 /* IMDMA Corrupted Data after a Halt */
66#define ANOMALY_05000190 /* PPI not functional at core voltage < 1Volt */
67#define ANOMALY_05000208 /* VSTAT status bit in PLL_STAT register is not
68 functional */
69#define ANOMALY_05000245 /* Spurious Hardware Error from an access in the
70 shadow of a conditional branch */
71#define ANOMALY_05000257 /* Interrupt/Exception during short hardware loop
72 may cause bad instruction fetches */
73#define ANOMALY_05000265 /* Sensitivity to noise with slow input edge rates on
74 external SPORT TX and RX clocks */
75#define ANOMALY_05000267 /* IMDMA may corrupt data under certain conditions */
76#define ANOMALY_05000269 /* High I/O activity causes output voltage of internal
77 voltage regulator (VDDint) to increase */
78#define ANOMALY_05000270 /* High I/O activity causes output voltage of internal
79 voltage regulator (VDDint) to decrease */
80#define ANOMALY_05000272 /* Certain data cache write through modes fail for
81 VDDint <=0.9V */
82#define ANOMALY_05000274 /* Data cache write back to external synchronous memory
83 may be lost */
84#define ANOMALY_05000275 /* PPI Timing and sampling informaton updates */
85#define ANOMALY_05000312 /* Errors when SSYNC, CSYNC, or loads to LT, LB and LC
86 registers are interrupted */
87
88#endif /* (defined(CONFIG_BF_REV_0_5) || defined(CONFIG_BF_REV_0_3)) */
89
90#if (defined(CONFIG_BF_REV_0_5))
91#define ANOMALY_05000254 /* Incorrect Timer Pulse Width in Single-Shot PWM_OUT
92 mode with external clock */
93#define ANOMALY_05000266 /* IMDMA destination IRQ status must be read prior to
94 using IMDMA */
95#endif
96
97#if (defined(CONFIG_BF_REV_0_3))
98#define ANOMALY_05000156 /* Timers in PWM-Out Mode with PPI GP Receive (Input)
99 Mode with 0 Frame Syncs */
100#define ANOMALY_05000168 /* SDRAM auto-refresh and subsequent Power Ups */
101#define ANOMALY_05000169 /* DATA CPLB page miss can result in lost write-through
102 cache data writes */
103#define ANOMALY_05000171 /* Boot-ROM code modifies SICA_IWRx wakeup registers */
104#define ANOMALY_05000174 /* Cache Fill Buffer Data lost */
105#define ANOMALY_05000175 /* Overlapping Sequencer and Memory Stalls */
106#define ANOMALY_05000176 /* Multiplication of (-1) by (-1) followed by an
107 accumulator saturation */
108#define ANOMALY_05000179 /* PPI_COUNT cannot be programmed to 0 in General
109 Purpose TX or RX modes */
110#define ANOMALY_05000181 /* Disabling the PPI resets the PPI configuration
111 registers */
112#define ANOMALY_05000184 /* Timer Pin limitations for PPI TX Modes with
113 External Frame Syncs */
114#define ANOMALY_05000185 /* PPI TX Mode with 2 External Frame Syncs */
115#define ANOMALY_05000186 /* PPI packing with Data Length greater than 8 bits
116 (not a meaningful mode) */
117#define ANOMALY_05000188 /* IMDMA Restrictions on Descriptor and Buffer
118 Placement in Memory */
119#define ANOMALY_05000189 /* False Protection Exception */
120#define ANOMALY_05000193 /* False Flag Pin Interrupts on Edge Sensitive Inputs
121 when polarity setting is changed */
122#define ANOMALY_05000194 /* Restarting SPORT in specific modes may cause data
123 corruption */
124#define ANOMALY_05000198 /* Failing MMR accesses when stalled by preceding
125 memory read */
126#define ANOMALY_05000199 /* DMA current address shows wrong value during carry
127 fix */
128#define ANOMALY_05000200 /* SPORT TFS and DT are incorrectly driven during
129 inactive channels in certain conditions */
130#define ANOMALY_05000202 /* Possible infinite stall with specific dual-DAG
131 situation */
132#define ANOMALY_05000204 /* Incorrect data read with write-through cache and
133 allocate cache lines on reads only mode */
134#define ANOMALY_05000205 /* Specific sequence that can cause DMA error or DMA
135 stopping */
136#define ANOMALY_05000207 /* Recovery from "brown-out" condition */
137#define ANOMALY_05000209 /* Speed-Path in computational unit affects certain
138 instructions */
139#define ANOMALY_05000215 /* UART TX Interrupt masked erroneously */
140#define ANOMALY_05000219 /* NMI event at boot time results in unpredictable
141 state */
142#define ANOMALY_05000220 /* Data Corruption with Cached External Memory and
143 Non-Cached On-Chip L2 Memory */
144#define ANOMALY_05000225 /* Incorrect pulse-width of UART start-bit */
145#define ANOMALY_05000227 /* Scratchpad memory bank reads may return incorrect
146 data */
147#define ANOMALY_05000230 /* UART Receiver is less robust against Baudrate
148 Differences in certain Conditions */
149#define ANOMALY_05000231 /* UART STB bit incorrectly affects receiver setting */
150#define ANOMALY_05000232 /* SPORT data transmit lines are incorrectly driven in
151 multichannel mode */
152#define ANOMALY_05000242 /* DF bit in PLL_CTL register does not respond to
153 hardware reset */
154#define ANOMALY_05000244 /* If i-cache is on, CSYNC/SSYNC/IDLE around Change of
155 Control causes failures */
156#define ANOMALY_05000248 /* TESTSET operation forces stall on the other core */
157#define ANOMALY_05000250 /* Incorrect Bit-Shift of Data Word in Multichannel
158 (TDM) mode in certain conditions */
159#define ANOMALY_05000251 /* Exception not generated for MMR accesses in
160 reserved region */
161#define ANOMALY_05000253 /* Maximum external clock speed for Timers */
162#define ANOMALY_05000258 /* Instruction Cache is corrupted when bits 9 and 12
163 of the ICPLB Data registers differ */
164#define ANOMALY_05000260 /* ICPLB_STATUS MMR register may be corrupted */
165#define ANOMALY_05000261 /* DCPLB_FAULT_ADDR MMR register may be corrupted */
166#define ANOMALY_05000262 /* Stores to data cache may be lost */
167#define ANOMALY_05000263 /* Hardware loop corrupted when taking an ICPLB
168 exception */
169#define ANOMALY_05000264 /* CSYNC/SSYNC/IDLE causes infinite stall in second
170 to last instruction in hardware loop */
171#define ANOMALY_05000276 /* Timing requirements change for External Frame
172 Sync PPI Modes with non-zero PPI_DELAY */
173#define ANOMALY_05000278 /* Disabling Peripherals with DMA running may cause
174 DMA system instability */
175#define ANOMALY_05000281 /* False Hardware Error Exception when ISR context is
176 not restored */
177#define ANOMALY_05000283 /* An MMR write is stalled indefinitely when killed
178 in a particular stage */
179#define ANOMALY_05000287 /* A read will receive incorrect data under certain
180 conditions */
181#define ANOMALY_05000288 /* SPORTs may receive bad data if FIFOs fill up */
182#endif
183
184#endif /* _MACH_ANOMALY_H_ */
diff --git a/include/asm-blackfin/mach-bf561/bf561.h b/include/asm-blackfin/mach-bf561/bf561.h
new file mode 100644
index 000000000000..96a5d3a47e45
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/bf561.h
@@ -0,0 +1,408 @@
1/*
2 * File: include/asm-blackfin/mach-bf561/bf561.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF561
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#ifndef __MACH_BF561_H__
31#define __MACH_BF561_H__
32
33#define SUPPORTED_REVID 0x3
34
35#define OFFSET_(x) ((x) & 0x0000FFFF)
36#define L1_ISRAM 0xFFA00000
37#define L1_ISRAM_END 0xFFA04000
38#define DATA_BANKA_SRAM 0xFF800000
39#define DATA_BANKA_SRAM_END 0xFF804000
40#define DATA_BANKB_SRAM 0xFF900000
41#define DATA_BANKB_SRAM_END 0xFF904000
42#define L1_DSRAMA 0xFF800000
43#define L1_DSRAMA_END 0xFF804000
44#define L1_DSRAMB 0xFF900000
45#define L1_DSRAMB_END 0xFF904000
46#define L2_SRAM 0xFEB00000
47#define L2_SRAM_END 0xFEB20000
48#define AMB_FLASH 0x20000000
49#define AMB_FLASH_END 0x21000000
50#define AMB_FLASH_LENGTH 0x01000000
51#define L1_ISRAM_LENGTH 0x4000
52#define L1_DSRAMA_LENGTH 0x4000
53#define L1_DSRAMB_LENGTH 0x4000
54#define L2_SRAM_LENGTH 0x20000
55
56/*some misc defines*/
57#define IMASK_IVG15 0x8000
58#define IMASK_IVG14 0x4000
59#define IMASK_IVG13 0x2000
60#define IMASK_IVG12 0x1000
61
62#define IMASK_IVG11 0x0800
63#define IMASK_IVG10 0x0400
64#define IMASK_IVG9 0x0200
65#define IMASK_IVG8 0x0100
66
67#define IMASK_IVG7 0x0080
68#define IMASK_IVGTMR 0x0040
69#define IMASK_IVGHW 0x0020
70
71/***************************
72 * Blackfin Cache setup
73 */
74
75
76#define BLKFIN_ISUBBANKS 4
77#define BLKFIN_IWAYS 4
78#define BLKFIN_ILINES 32
79
80#define BLKFIN_DSUBBANKS 4
81#define BLKFIN_DWAYS 2
82#define BLKFIN_DLINES 64
83
84#define WAY0_L 0x1
85#define WAY1_L 0x2
86#define WAY01_L 0x3
87#define WAY2_L 0x4
88#define WAY02_L 0x5
89#define WAY12_L 0x6
90#define WAY012_L 0x7
91
92#define WAY3_L 0x8
93#define WAY03_L 0x9
94#define WAY13_L 0xA
95#define WAY013_L 0xB
96
97#define WAY32_L 0xC
98#define WAY320_L 0xD
99#define WAY321_L 0xE
100#define WAYALL_L 0xF
101
102#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
103
104/* IAR0 BIT FIELDS */
105#define PLL_WAKEUP_BIT 0xFFFFFFFF
106#define DMA1_ERROR_BIT 0xFFFFFF0F
107#define DMA2_ERROR_BIT 0xFFFFF0FF
108#define IMDMA_ERROR_BIT 0xFFFF0FFF
109#define PPI1_ERROR_BIT 0xFFF0FFFF
110#define PPI2_ERROR_BIT 0xFF0FFFFF
111#define SPORT0_ERROR_BIT 0xF0FFFFFF
112#define SPORT1_ERROR_BIT 0x0FFFFFFF
113/* IAR1 BIT FIELDS */
114#define SPI_ERROR_BIT 0xFFFFFFFF
115#define UART_ERROR_BIT 0xFFFFFF0F
116#define RESERVED_ERROR_BIT 0xFFFFF0FF
117#define DMA1_0_BIT 0xFFFF0FFF
118#define DMA1_1_BIT 0xFFF0FFFF
119#define DMA1_2_BIT 0xFF0FFFFF
120#define DMA1_3_BIT 0xF0FFFFFF
121#define DMA1_4_BIT 0x0FFFFFFF
122/* IAR2 BIT FIELDS */
123#define DMA1_5_BIT 0xFFFFFFFF
124#define DMA1_6_BIT 0xFFFFFF0F
125#define DMA1_7_BIT 0xFFFFF0FF
126#define DMA1_8_BIT 0xFFFF0FFF
127#define DMA1_9_BIT 0xFFF0FFFF
128#define DMA1_10_BIT 0xFF0FFFFF
129#define DMA1_11_BIT 0xF0FFFFFF
130#define DMA2_0_BIT 0x0FFFFFFF
131/* IAR3 BIT FIELDS */
132#define DMA2_1_BIT 0xFFFFFFFF
133#define DMA2_2_BIT 0xFFFFFF0F
134#define DMA2_3_BIT 0xFFFFF0FF
135#define DMA2_4_BIT 0xFFFF0FFF
136#define DMA2_5_BIT 0xFFF0FFFF
137#define DMA2_6_BIT 0xFF0FFFFF
138#define DMA2_7_BIT 0xF0FFFFFF
139#define DMA2_8_BIT 0x0FFFFFFF
140/* IAR4 BIT FIELDS */
141#define DMA2_9_BIT 0xFFFFFFFF
142#define DMA2_10_BIT 0xFFFFFF0F
143#define DMA2_11_BIT 0xFFFFF0FF
144#define TIMER0_BIT 0xFFFF0FFF
145#define TIMER1_BIT 0xFFF0FFFF
146#define TIMER2_BIT 0xFF0FFFFF
147#define TIMER3_BIT 0xF0FFFFFF
148#define TIMER4_BIT 0x0FFFFFFF
149/* IAR5 BIT FIELDS */
150#define TIMER5_BIT 0xFFFFFFFF
151#define TIMER6_BIT 0xFFFFFF0F
152#define TIMER7_BIT 0xFFFFF0FF
153#define TIMER8_BIT 0xFFFF0FFF
154#define TIMER9_BIT 0xFFF0FFFF
155#define TIMER10_BIT 0xFF0FFFFF
156#define TIMER11_BIT 0xF0FFFFFF
157#define PROG0_INTA_BIT 0x0FFFFFFF
158/* IAR6 BIT FIELDS */
159#define PROG0_INTB_BIT 0xFFFFFFFF
160#define PROG1_INTA_BIT 0xFFFFFF0F
161#define PROG1_INTB_BIT 0xFFFFF0FF
162#define PROG2_INTA_BIT 0xFFFF0FFF
163#define PROG2_INTB_BIT 0xFFF0FFFF
164#define DMA1_WRRD0_BIT 0xFF0FFFFF
165#define DMA1_WRRD1_BIT 0xF0FFFFFF
166#define DMA2_WRRD0_BIT 0x0FFFFFFF
167/* IAR7 BIT FIELDS */
168#define DMA2_WRRD1_BIT 0xFFFFFFFF
169#define IMDMA_WRRD0_BIT 0xFFFFFF0F
170#define IMDMA_WRRD1_BIT 0xFFFFF0FF
171#define WATCH_BIT 0xFFFF0FFF
172#define RESERVED_1_BIT 0xFFF0FFFF
173#define RESERVED_2_BIT 0xFF0FFFFF
174#define SUPPLE_0_BIT 0xF0FFFFFF
175#define SUPPLE_1_BIT 0x0FFFFFFF
176
177/* Miscellaneous Values */
178
179/****************************** EBIU Settings ********************************/
180#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
181#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
182
183#if defined(CONFIG_C_AMBEN_ALL)
184#define V_AMBEN AMBEN_ALL
185#elif defined(CONFIG_C_AMBEN)
186#define V_AMBEN 0x0
187#elif defined(CONFIG_C_AMBEN_B0)
188#define V_AMBEN AMBEN_B0
189#elif defined(CONFIG_C_AMBEN_B0_B1)
190#define V_AMBEN AMBEN_B0_B1
191#elif defined(CONFIG_C_AMBEN_B0_B1_B2)
192#define V_AMBEN AMBEN_B0_B1_B2
193#endif
194
195#ifdef CONFIG_C_AMCKEN
196#define V_AMCKEN AMCKEN
197#else
198#define V_AMCKEN 0x0
199#endif
200
201#ifdef CONFIG_C_B0PEN
202#define V_B0PEN 0x10
203#else
204#define V_B0PEN 0x00
205#endif
206
207#ifdef CONFIG_C_B1PEN
208#define V_B1PEN 0x20
209#else
210#define V_B1PEN 0x00
211#endif
212
213#ifdef CONFIG_C_B2PEN
214#define V_B2PEN 0x40
215#else
216#define V_B2PEN 0x00
217#endif
218
219#ifdef CONFIG_C_B3PEN
220#define V_B3PEN 0x80
221#else
222#define V_B3PEN 0x00
223#endif
224
225#ifdef CONFIG_C_CDPRIO
226#define V_CDPRIO 0x100
227#else
228#define V_CDPRIO 0x0
229#endif
230
231#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO | V_B0PEN | V_B1PEN | V_B2PEN | V_B3PEN | 0x0002)
232
233#define MAX_VC 600000000
234#define MIN_VC 50000000
235
236/******************************* PLL Settings ********************************/
237#ifdef CONFIG_BFIN_KERNEL_CLOCK
238#if (CONFIG_VCO_MULT < 0)
239#error "VCO Multiplier is less than 0. Please select a different value"
240#endif
241
242#if (CONFIG_VCO_MULT == 0)
243#error "VCO Multiplier should be greater than 0. Please select a different value"
244#endif
245
246#ifndef CONFIG_CLKIN_HALF
247#define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
248#else
249#define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)/2)
250#endif
251
252#ifndef CONFIG_PLL_BYPASS
253#define CONFIG_CCLK_HZ (CONFIG_VCO_HZ/CONFIG_CCLK_DIV)
254#define CONFIG_SCLK_HZ (CONFIG_VCO_HZ/CONFIG_SCLK_DIV)
255#else
256#define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
257#define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
258#endif
259
260#if (CONFIG_SCLK_DIV < 1)
261#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
262#endif
263
264#if (CONFIG_SCLK_DIV > 15)
265#error "SCLK DIV cannot be less than 1 or more than 15. Please select a proper value"
266#endif
267
268#if (CONFIG_CCLK_DIV != 1)
269#if (CONFIG_CCLK_DIV != 2)
270#if (CONFIG_CCLK_DIV != 4)
271#if (CONFIG_CCLK_DIV != 8)
272#error "CCLK DIV can be 1,2,4 or 8 only. Please select a proper value"
273#endif
274#endif
275#endif
276#endif
277
278#if (CONFIG_VCO_HZ > MAX_VC)
279#error "VCO selected is more than maximum value. Please change the VCO multipler"
280#endif
281
282#if (CONFIG_SCLK_HZ > 133000000)
283#error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
284#endif
285
286#if (CONFIG_SCLK_HZ < 27000000)
287#error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
288#endif
289
290#if (CONFIG_SCLK_HZ >= CONFIG_CCLK_HZ)
291#if (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ)
292#if (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
293#error "Please select sclk less than cclk"
294#endif
295#endif
296#endif
297
298#if (CONFIG_CCLK_DIV == 1)
299#define CONFIG_CCLK_ACT_DIV CCLK_DIV1
300#endif
301#if (CONFIG_CCLK_DIV == 2)
302#define CONFIG_CCLK_ACT_DIV CCLK_DIV2
303#endif
304#if (CONFIG_CCLK_DIV == 4)
305#define CONFIG_CCLK_ACT_DIV CCLK_DIV4
306#endif
307#if (CONFIG_CCLK_DIV == 8)
308#define CONFIG_CCLK_ACT_DIV CCLK_DIV8
309#endif
310#ifndef CONFIG_CCLK_ACT_DIV
311#define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
312#endif
313
314#if defined(ANOMALY_05000273) && (CONFIG_CCLK_DIV == 1)
315#error ANOMALY 05000273, please make sure CCLK is at least 2x SCLK
316#endif
317
318#endif /* CONFIG_BFIN_KERNEL_CLOCK */
319
320#ifdef CONFIG_BF561
321#define CPU "BF561"
322#define CPUID 0x027bb000
323#endif
324#ifndef CPU
325#define CPU "UNKNOWN"
326#define CPUID 0x0
327#endif
328
329#if (CONFIG_MEM_SIZE % 4)
330#error "SDRAM memory size must be a multiple of 4MB!"
331#endif
332#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO)
333#define SDRAM_IKERNEL (SDRAM_IGENERIC | CPLB_LOCK)
334#define L1_IMEMORY ( CPLB_USER_RD | CPLB_VALID | CPLB_LOCK)
335#define SDRAM_INON_CHBL ( CPLB_USER_RD | CPLB_VALID)
336
337/*Use the menuconfig cache policy here - CONFIG_BLKFIN_WT/CONFIG_BLKFIN_WB*/
338
339#define ANOMALY_05000158_WORKAROUND 0x200
340#ifdef CONFIG_BLKFIN_WB /*Write Back Policy */
341#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_DIRTY \
342 | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
343#else /*Write Through */
344#define SDRAM_DGENERIC (CPLB_L1_CHBL | CPLB_WT | CPLB_L1_AOW | CPLB_DIRTY \
345 | CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND)
346#endif
347
348
349#define L1_DMEMORY (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
350#define SDRAM_DNON_CHBL (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
351#define SDRAM_EBIU (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
352#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
353
354#define L2_MEMORY (CPLB_SUPV_WR | CPLB_USER_WR | CPLB_USER_RD | CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_DIRTY)
355
356#define SIZE_1K 0x00000400 /* 1K */
357#define SIZE_4K 0x00001000 /* 4K */
358#define SIZE_1M 0x00100000 /* 1M */
359#define SIZE_4M 0x00400000 /* 4M */
360
361#define MAX_CPLBS (16 * 2)
362
363/*
364* Number of required data CPLB switchtable entries
365* MEMSIZE / 4 (we mostly install 4M page size CPLBs
366* approx 16 for smaller 1MB page size CPLBs for allignment purposes
367* 1 for L1 Data Memory
368* 1 for L2 Data Memory
369* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
370* 64 for ASYNC Memory
371*/
372
373
374#define MAX_SWITCH_D_CPLBS (((CONFIG_MEM_SIZE / 4) + 16 + 1 + 1 + 1 + 64) * 2)
375
376/*
377* Number of required instruction CPLB switchtable entries
378* MEMSIZE / 4 (we mostly install 4M page size CPLBs
379* approx 12 for smaller 1MB page size CPLBs for allignment purposes
380* 1 for L1 Instruction Memory
381* 1 for L2 Instruction Memory
382* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
383*/
384
385#define MAX_SWITCH_I_CPLBS (((CONFIG_MEM_SIZE / 4) + 12 + 1 + 1 + 1) * 2)
386
387#if 0 /* comment by mhfan */
388/* Event Vector Table Address */
389#define EVT_EMULATION_ADDR 0xffe02000
390#define EVT_RESET_ADDR 0xffe02004
391#define EVT_NMI_ADDR 0xffe02008
392#define EVT_EXCEPTION_ADDR 0xffe0200c
393#define EVT_GLOBAL_INT_ENB_ADDR 0xffe02010
394#define EVT_HARDWARE_ERROR_ADDR 0xffe02014
395#define EVT_TIMER_ADDR 0xffe02018
396#define EVT_IVG7_ADDR 0xffe0201c
397#define EVT_IVG8_ADDR 0xffe02020
398#define EVT_IVG9_ADDR 0xffe02024
399#define EVT_IVG10_ADDR 0xffe02028
400#define EVT_IVG11_ADDR 0xffe0202c
401#define EVT_IVG12_ADDR 0xffe02030
402#define EVT_IVG13_ADDR 0xffe02034
403#define EVT_IVG14_ADDR 0xffe02038
404#define EVT_IVG15_ADDR 0xffe0203c
405#define EVT_OVERRIDE_ADDR 0xffe02100
406#endif /* comment by mhfan */
407
408#endif /* __MACH_BF561_H__ */
diff --git a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
new file mode 100644
index 000000000000..23bf76aa3451
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h
@@ -0,0 +1,108 @@
1#include <linux/serial.h>
2#include <asm/dma.h>
3
4#define NR_PORTS 1
5
6#define OFFSET_THR 0x00 /* Transmit Holding register */
7#define OFFSET_RBR 0x00 /* Receive Buffer register */
8#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
9#define OFFSET_IER 0x04 /* Interrupt Enable Register */
10#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
11#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
12#define OFFSET_LCR 0x0C /* Line Control Register */
13#define OFFSET_MCR 0x10 /* Modem Control Register */
14#define OFFSET_LSR 0x14 /* Line Status Register */
15#define OFFSET_MSR 0x18 /* Modem Status Register */
16#define OFFSET_SCR 0x1C /* SCR Scratch Register */
17#define OFFSET_GCTL 0x24 /* Global Control Register */
18
19#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
20#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
21#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
22#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
23#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
24#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
25#define UART_GET_LSR(uart) bfin_read16(((uart)->port.membase + OFFSET_LSR))
26#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
27
28#define UART_PUT_CHAR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_THR),v)
29#define UART_PUT_DLL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLL),v)
30#define UART_PUT_IER(uart,v) bfin_write16(((uart)->port.membase + OFFSET_IER),v)
31#define UART_PUT_DLH(uart,v) bfin_write16(((uart)->port.membase + OFFSET_DLH),v)
32#define UART_PUT_LCR(uart,v) bfin_write16(((uart)->port.membase + OFFSET_LCR),v)
33#define UART_PUT_GCTL(uart,v) bfin_write16(((uart)->port.membase + OFFSET_GCTL),v)
34
35#ifdef CONFIG_BFIN_UART0_CTSRTS
36# define CONFIG_SERIAL_BFIN_CTSRTS
37# ifndef CONFIG_UART0_CTS_PIN
38# define CONFIG_UART0_CTS_PIN -1
39# endif
40# ifndef CONFIG_UART0_RTS_PIN
41# define CONFIG_UART0_RTS_PIN -1
42# endif
43#endif
44
45struct bfin_serial_port {
46 struct uart_port port;
47 unsigned int old_status;
48#ifdef CONFIG_SERIAL_BFIN_DMA
49 int tx_done;
50 int tx_count;
51 struct circ_buf rx_dma_buf;
52 struct timer_list rx_dma_timer;
53 int rx_dma_nrows;
54 unsigned int tx_dma_channel;
55 unsigned int rx_dma_channel;
56 struct work_struct tx_dma_workqueue;
57#else
58 struct work_struct cts_workqueue;
59#endif
60#ifdef CONFIG_SERIAL_BFIN_CTSRTS
61 int cts_pin;
62 int rts_pin;
63#endif
64};
65
66struct bfin_serial_port bfin_serial_ports[NR_PORTS];
67struct bfin_serial_res {
68 unsigned long uart_base_addr;
69 int uart_irq;
70#ifdef CONFIG_SERIAL_BFIN_DMA
71 unsigned int uart_tx_dma_channel;
72 unsigned int uart_rx_dma_channel;
73#endif
74#ifdef CONFIG_SERIAL_BFIN_CTSRTS
75 int uart_cts_pin;
76 int uart_rts_pin;
77#endif
78};
79
80struct bfin_serial_res bfin_serial_resource[] = {
81 0xFFC00400,
82 IRQ_UART_RX,
83#ifdef CONFIG_SERIAL_BFIN_DMA
84 CH_UART_TX,
85 CH_UART_RX,
86#endif
87#ifdef CONFIG_BFIN_UART0_CTSRTS
88 CONFIG_UART0_CTS_PIN,
89 CONFIG_UART0_RTS_PIN,
90#endif
91};
92
93
94int nr_ports = NR_PORTS;
95static void bfin_serial_hw_init(struct bfin_serial_port *uart)
96{
97
98#ifdef CONFIG_SERIAL_BFIN_CTSRTS
99 if (uart->cts_pin >= 0) {
100 gpio_request(uart->cts_pin, NULL);
101 gpio_direction_input(uart->cts_pin);
102 }
103 if (uart->rts_pin >= 0) {
104 gpio_request(uart->rts_pin, NULL);
105 gpio_direction_input(uart->rts_pin);
106 }
107#endif
108}
diff --git a/include/asm-blackfin/mach-bf561/blackfin.h b/include/asm-blackfin/mach-bf561/blackfin.h
new file mode 100644
index 000000000000..2537c845e8b0
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/blackfin.h
@@ -0,0 +1,52 @@
1/*
2 * File: include/asm-blackfin/mach-bf561/blackfin.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _MACH_BLACKFIN_H_
32#define _MACH_BLACKFIN_H_
33
34#define BF561_FAMILY
35
36#include "bf561.h"
37#include "mem_map.h"
38#include "defBF561.h"
39#include "anomaly.h"
40
41#if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
42#include "cdefBF561.h"
43#endif
44
45#define bfin_read_FIO_FLAG_D() bfin_read_FIO0_FLAG_D()
46#define bfin_write_FIO_FLAG_D(val) bfin_write_FIO0_FLAG_D(val)
47#define bfin_read_FIO_DIR() bfin_read_FIO0_DIR()
48#define bfin_write_FIO_DIR(val) bfin_write_FIO0_DIR(val)
49#define bfin_read_FIO_INEN() bfin_read_FIO0_INEN()
50#define bfin_write_FIO_INEN(val) bfin_write_FIO0_INEN(val)
51
52#endif /* _MACH_BLACKFIN_H_ */
diff --git a/include/asm-blackfin/mach-bf561/cdefBF561.h b/include/asm-blackfin/mach-bf561/cdefBF561.h
new file mode 100644
index 000000000000..5dc0ed835447
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/cdefBF561.h
@@ -0,0 +1,1543 @@
1/*
2 * File: include/asm-blackfin/mach-bf561/cdefBF561.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: C POINTERS TO SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF561
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _CDEF_BF561_H
32#define _CDEF_BF561_H
33
34/*
35#if !defined(__ADSPBF561__)
36#warning cdefBF561.h should only be included for BF561 chip.
37#endif
38*/
39/* include all Core registers and bit definitions */
40#include "defBF561.h"
41
42/*include core specific register pointer definitions*/
43#include <asm/mach-common/cdef_LPBlackfin.h>
44
45#include <asm/system.h>
46
47/*********************************************************************************** */
48/* System MMR Register Map */
49/*********************************************************************************** */
50
51/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
52#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
53#define bfin_write_PLL_CTL(val) bfin_write16(PLL_CTL,val)
54#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
55#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
56#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
57/* Writing to VR_CTL initiates a PLL relock sequence. */
58static __inline__ void bfin_write_VR_CTL(unsigned int val)
59{
60 unsigned long flags, iwr;
61
62 bfin_write16(VR_CTL, val);
63 __builtin_bfin_ssync();
64 /* Enable the PLL Wakeup bit in SIC IWR */
65 iwr = bfin_read32(SICA_IWR0);
66 /* Only allow PPL Wakeup) */
67 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
68 local_irq_save(flags);
69 asm("IDLE;");
70 local_irq_restore(flags);
71 bfin_write32(SICA_IWR0, iwr);
72}
73#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
74#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
75#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
76#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT,val)
77#define bfin_read_CHIPID() bfin_read32(CHIPID)
78
79/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */
80#define bfin_read_SICA_SWRST() bfin_read16(SICA_SWRST)
81#define bfin_write_SICA_SWRST(val) bfin_write16(SICA_SWRST,val)
82#define bfin_read_SICA_SYSCR() bfin_read16(SICA_SYSCR)
83#define bfin_write_SICA_SYSCR(val) bfin_write16(SICA_SYSCR,val)
84#define bfin_read_SICA_RVECT() bfin_read16(SICA_RVECT)
85#define bfin_write_SICA_RVECT(val) bfin_write16(SICA_RVECT,val)
86#define bfin_read_SICA_IMASK() bfin_read32(SICA_IMASK)
87#define bfin_write_SICA_IMASK(val) bfin_write32(SICA_IMASK,val)
88#define bfin_read_SICA_IMASK0() bfin_read32(SICA_IMASK0)
89#define bfin_write_SICA_IMASK0(val) bfin_write32(SICA_IMASK0,val)
90#define bfin_read_SICA_IMASK1() bfin_read32(SICA_IMASK1)
91#define bfin_write_SICA_IMASK1(val) bfin_write32(SICA_IMASK1,val)
92#define bfin_read_SICA_IAR0() bfin_read32(SICA_IAR0)
93#define bfin_write_SICA_IAR0(val) bfin_write32(SICA_IAR0,val)
94#define bfin_read_SICA_IAR1() bfin_read32(SICA_IAR1)
95#define bfin_write_SICA_IAR1(val) bfin_write32(SICA_IAR1,val)
96#define bfin_read_SICA_IAR2() bfin_read32(SICA_IAR2)
97#define bfin_write_SICA_IAR2(val) bfin_write32(SICA_IAR2,val)
98#define bfin_read_SICA_IAR3() bfin_read32(SICA_IAR3)
99#define bfin_write_SICA_IAR3(val) bfin_write32(SICA_IAR3,val)
100#define bfin_read_SICA_IAR4() bfin_read32(SICA_IAR4)
101#define bfin_write_SICA_IAR4(val) bfin_write32(SICA_IAR4,val)
102#define bfin_read_SICA_IAR5() bfin_read32(SICA_IAR5)
103#define bfin_write_SICA_IAR5(val) bfin_write32(SICA_IAR5,val)
104#define bfin_read_SICA_IAR6() bfin_read32(SICA_IAR6)
105#define bfin_write_SICA_IAR6(val) bfin_write32(SICA_IAR6,val)
106#define bfin_read_SICA_IAR7() bfin_read32(SICA_IAR7)
107#define bfin_write_SICA_IAR7(val) bfin_write32(SICA_IAR7,val)
108#define bfin_read_SICA_ISR0() bfin_read32(SICA_ISR0)
109#define bfin_write_SICA_ISR0(val) bfin_write32(SICA_ISR0,val)
110#define bfin_read_SICA_ISR1() bfin_read32(SICA_ISR1)
111#define bfin_write_SICA_ISR1(val) bfin_write32(SICA_ISR1,val)
112#define bfin_read_SICA_IWR0() bfin_read32(SICA_IWR0)
113#define bfin_write_SICA_IWR0(val) bfin_write32(SICA_IWR0,val)
114#define bfin_read_SICA_IWR1() bfin_read32(SICA_IWR1)
115#define bfin_write_SICA_IWR1(val) bfin_write32(SICA_IWR1,val)
116
117/* System Reset and Interrupt Controller registers for Core B (0xFFC0 1100-0xFFC0 11FF) */
118#define bfin_read_SICB_SWRST() bfin_read16(SICB_SWRST)
119#define bfin_write_SICB_SWRST(val) bfin_write16(SICB_SWRST,val)
120#define bfin_read_SICB_SYSCR() bfin_read16(SICB_SYSCR)
121#define bfin_write_SICB_SYSCR(val) bfin_write16(SICB_SYSCR,val)
122#define bfin_read_SICB_RVECT() bfin_read16(SICB_RVECT)
123#define bfin_write_SICB_RVECT(val) bfin_write16(SICB_RVECT,val)
124#define bfin_read_SICB_IMASK0() bfin_read32(SICB_IMASK0)
125#define bfin_write_SICB_IMASK0(val) bfin_write32(SICB_IMASK0,val)
126#define bfin_read_SICB_IMASK1() bfin_read32(SICB_IMASK1)
127#define bfin_write_SICB_IMASK1(val) bfin_write32(SICB_IMASK1,val)
128#define bfin_read_SICB_IAR0() bfin_read32(SICB_IAR0)
129#define bfin_write_SICB_IAR0(val) bfin_write32(SICB_IAR0,val)
130#define bfin_read_SICB_IAR1() bfin_read32(SICB_IAR1)
131#define bfin_write_SICB_IAR1(val) bfin_write32(SICB_IAR1,val)
132#define bfin_read_SICB_IAR2() bfin_read32(SICB_IAR2)
133#define bfin_write_SICB_IAR2(val) bfin_write32(SICB_IAR2,val)
134#define bfin_read_SICB_IAR3() bfin_read32(SICB_IAR3)
135#define bfin_write_SICB_IAR3(val) bfin_write32(SICB_IAR3,val)
136#define bfin_read_SICB_IAR4() bfin_read32(SICB_IAR4)
137#define bfin_write_SICB_IAR4(val) bfin_write32(SICB_IAR4,val)
138#define bfin_read_SICB_IAR5() bfin_read32(SICB_IAR5)
139#define bfin_write_SICB_IAR5(val) bfin_write32(SICB_IAR5,val)
140#define bfin_read_SICB_IAR6() bfin_read32(SICB_IAR6)
141#define bfin_write_SICB_IAR6(val) bfin_write32(SICB_IAR6,val)
142#define bfin_read_SICB_IAR7() bfin_read32(SICB_IAR7)
143#define bfin_write_SICB_IAR7(val) bfin_write32(SICB_IAR7,val)
144#define bfin_read_SICB_ISR0() bfin_read32(SICB_ISR0)
145#define bfin_write_SICB_ISR0(val) bfin_write32(SICB_ISR0,val)
146#define bfin_read_SICB_ISR1() bfin_read32(SICB_ISR1)
147#define bfin_write_SICB_ISR1(val) bfin_write32(SICB_ISR1,val)
148#define bfin_read_SICB_IWR0() bfin_read32(SICB_IWR0)
149#define bfin_write_SICB_IWR0(val) bfin_write32(SICB_IWR0,val)
150#define bfin_read_SICB_IWR1() bfin_read32(SICB_IWR1)
151#define bfin_write_SICB_IWR1(val) bfin_write32(SICB_IWR1,val)
152/* Watchdog Timer registers for Core A (0xFFC0 0200-0xFFC0 02FF) */
153#define bfin_read_WDOGA_CTL() bfin_read16(WDOGA_CTL)
154#define bfin_write_WDOGA_CTL(val) bfin_write16(WDOGA_CTL,val)
155#define bfin_read_WDOGA_CNT() bfin_read32(WDOGA_CNT)
156#define bfin_write_WDOGA_CNT(val) bfin_write32(WDOGA_CNT,val)
157#define bfin_read_WDOGA_STAT() bfin_read32(WDOGA_STAT)
158#define bfin_write_WDOGA_STAT(val) bfin_write32(WDOGA_STAT,val)
159
160/* Watchdog Timer registers for Core B (0xFFC0 1200-0xFFC0 12FF) */
161#define bfin_read_WDOGB_CTL() bfin_read16(WDOGB_CTL)
162#define bfin_write_WDOGB_CTL(val) bfin_write16(WDOGB_CTL,val)
163#define bfin_read_WDOGB_CNT() bfin_read32(WDOGB_CNT)
164#define bfin_write_WDOGB_CNT(val) bfin_write32(WDOGB_CNT,val)
165#define bfin_read_WDOGB_STAT() bfin_read32(WDOGB_STAT)
166#define bfin_write_WDOGB_STAT(val) bfin_write32(WDOGB_STAT,val)
167
168/* UART Controller (0xFFC00400 - 0xFFC004FF) */
169#define bfin_read_UART_THR() bfin_read16(UART_THR)
170#define bfin_write_UART_THR(val) bfin_write16(UART_THR,val)
171#define bfin_read_UART_RBR() bfin_read16(UART_RBR)
172#define bfin_write_UART_RBR(val) bfin_write16(UART_RBR,val)
173#define bfin_read_UART_DLL() bfin_read16(UART_DLL)
174#define bfin_write_UART_DLL(val) bfin_write16(UART_DLL,val)
175#define bfin_read_UART_IER() bfin_read16(UART_IER)
176#define bfin_write_UART_IER(val) bfin_write16(UART_IER,val)
177#define bfin_read_UART_DLH() bfin_read16(UART_DLH)
178#define bfin_write_UART_DLH(val) bfin_write16(UART_DLH,val)
179#define bfin_read_UART_IIR() bfin_read16(UART_IIR)
180#define bfin_write_UART_IIR(val) bfin_write16(UART_IIR,val)
181#define bfin_read_UART_LCR() bfin_read16(UART_LCR)
182#define bfin_write_UART_LCR(val) bfin_write16(UART_LCR,val)
183#define bfin_read_UART_MCR() bfin_read16(UART_MCR)
184#define bfin_write_UART_MCR(val) bfin_write16(UART_MCR,val)
185#define bfin_read_UART_LSR() bfin_read16(UART_LSR)
186#define bfin_write_UART_LSR(val) bfin_write16(UART_LSR,val)
187#define bfin_read_UART_MSR() bfin_read16(UART_MSR)
188#define bfin_write_UART_MSR(val) bfin_write16(UART_MSR,val)
189#define bfin_read_UART_SCR() bfin_read16(UART_SCR)
190#define bfin_write_UART_SCR(val) bfin_write16(UART_SCR,val)
191#define bfin_read_UART_GCTL() bfin_read16(UART_GCTL)
192#define bfin_write_UART_GCTL(val) bfin_write16(UART_GCTL,val)
193
194/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
195#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
196#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL,val)
197#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
198#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG,val)
199#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
200#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT,val)
201#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
202#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR,val)
203#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
204#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR,val)
205#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
206#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD,val)
207#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
208#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW,val)
209
210/* Timer 0-7 registers (0xFFC0 0600-0xFFC0 06FF) */
211#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
212#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG,val)
213#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
214#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER,val)
215#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
216#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD,val)
217#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
218#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH,val)
219#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
220#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG,val)
221#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
222#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER,val)
223#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
224#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD,val)
225#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
226#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH,val)
227#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
228#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG,val)
229#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
230#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER,val)
231#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
232#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD,val)
233#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
234#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH,val)
235#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
236#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG,val)
237#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
238#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER,val)
239#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
240#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD,val)
241#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
242#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH,val)
243#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
244#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG,val)
245#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
246#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER,val)
247#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
248#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD,val)
249#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
250#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH,val)
251#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
252#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG,val)
253#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
254#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER,val)
255#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
256#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD,val)
257#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
258#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH,val)
259#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
260#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG,val)
261#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
262#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER,val)
263#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
264#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD,val)
265#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
266#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH,val)
267#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
268#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG,val)
269#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
270#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER,val)
271#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
272#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD,val)
273#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
274#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH,val)
275
276/* Timer registers 8-11 (0xFFC0 1600-0xFFC0 16FF) */
277#define bfin_read_TMRS8_ENABLE() bfin_read16(TMRS8_ENABLE)
278#define bfin_write_TMRS8_ENABLE(val) bfin_write16(TMRS8_ENABLE,val)
279#define bfin_read_TMRS8_DISABLE() bfin_read16(TMRS8_DISABLE)
280#define bfin_write_TMRS8_DISABLE(val) bfin_write16(TMRS8_DISABLE,val)
281#define bfin_read_TMRS8_STATUS() bfin_read32(TMRS8_STATUS)
282#define bfin_write_TMRS8_STATUS(val) bfin_write32(TMRS8_STATUS,val)
283#define bfin_read_TIMER8_CONFIG() bfin_read16(TIMER8_CONFIG)
284#define bfin_write_TIMER8_CONFIG(val) bfin_write16(TIMER8_CONFIG,val)
285#define bfin_read_TIMER8_COUNTER() bfin_read32(TIMER8_COUNTER)
286#define bfin_write_TIMER8_COUNTER(val) bfin_write32(TIMER8_COUNTER,val)
287#define bfin_read_TIMER8_PERIOD() bfin_read32(TIMER8_PERIOD)
288#define bfin_write_TIMER8_PERIOD(val) bfin_write32(TIMER8_PERIOD,val)
289#define bfin_read_TIMER8_WIDTH() bfin_read32(TIMER8_WIDTH)
290#define bfin_write_TIMER8_WIDTH(val) bfin_write32(TIMER8_WIDTH,val)
291#define bfin_read_TIMER9_CONFIG() bfin_read16(TIMER9_CONFIG)
292#define bfin_write_TIMER9_CONFIG(val) bfin_write16(TIMER9_CONFIG,val)
293#define bfin_read_TIMER9_COUNTER() bfin_read32(TIMER9_COUNTER)
294#define bfin_write_TIMER9_COUNTER(val) bfin_write32(TIMER9_COUNTER,val)
295#define bfin_read_TIMER9_PERIOD() bfin_read32(TIMER9_PERIOD)
296#define bfin_write_TIMER9_PERIOD(val) bfin_write32(TIMER9_PERIOD,val)
297#define bfin_read_TIMER9_WIDTH() bfin_read32(TIMER9_WIDTH)
298#define bfin_write_TIMER9_WIDTH(val) bfin_write32(TIMER9_WIDTH,val)
299#define bfin_read_TIMER10_CONFIG() bfin_read16(TIMER10_CONFIG)
300#define bfin_write_TIMER10_CONFIG(val) bfin_write16(TIMER10_CONFIG,val)
301#define bfin_read_TIMER10_COUNTER() bfin_read32(TIMER10_COUNTER)
302#define bfin_write_TIMER10_COUNTER(val) bfin_write32(TIMER10_COUNTER,val)
303#define bfin_read_TIMER10_PERIOD() bfin_read32(TIMER10_PERIOD)
304#define bfin_write_TIMER10_PERIOD(val) bfin_write32(TIMER10_PERIOD,val)
305#define bfin_read_TIMER10_WIDTH() bfin_read32(TIMER10_WIDTH)
306#define bfin_write_TIMER10_WIDTH(val) bfin_write32(TIMER10_WIDTH,val)
307#define bfin_read_TIMER11_CONFIG() bfin_read16(TIMER11_CONFIG)
308#define bfin_write_TIMER11_CONFIG(val) bfin_write16(TIMER11_CONFIG,val)
309#define bfin_read_TIMER11_COUNTER() bfin_read32(TIMER11_COUNTER)
310#define bfin_write_TIMER11_COUNTER(val) bfin_write32(TIMER11_COUNTER,val)
311#define bfin_read_TIMER11_PERIOD() bfin_read32(TIMER11_PERIOD)
312#define bfin_write_TIMER11_PERIOD(val) bfin_write32(TIMER11_PERIOD,val)
313#define bfin_read_TIMER11_WIDTH() bfin_read32(TIMER11_WIDTH)
314#define bfin_write_TIMER11_WIDTH(val) bfin_write32(TIMER11_WIDTH,val)
315#define bfin_read_TMRS4_ENABLE() bfin_read16(TMRS4_ENABLE)
316#define bfin_write_TMRS4_ENABLE(val) bfin_write16(TMRS4_ENABLE,val)
317#define bfin_read_TMRS4_DISABLE() bfin_read16(TMRS4_DISABLE)
318#define bfin_write_TMRS4_DISABLE(val) bfin_write16(TMRS4_DISABLE,val)
319#define bfin_read_TMRS4_STATUS() bfin_read32(TMRS4_STATUS)
320#define bfin_write_TMRS4_STATUS(val) bfin_write32(TMRS4_STATUS,val)
321
322/* Programmable Flag 0 registers (0xFFC0 0700-0xFFC0 07FF) */
323#define bfin_read_FIO0_FLAG_D() bfin_read16(FIO0_FLAG_D)
324#define bfin_write_FIO0_FLAG_D(val) bfin_write16(FIO0_FLAG_D,val)
325#define bfin_read_FIO0_FLAG_C() bfin_read16(FIO0_FLAG_C)
326#define bfin_write_FIO0_FLAG_C(val) bfin_write16(FIO0_FLAG_C,val)
327#define bfin_read_FIO0_FLAG_S() bfin_read16(FIO0_FLAG_S)
328#define bfin_write_FIO0_FLAG_S(val) bfin_write16(FIO0_FLAG_S,val)
329#define bfin_read_FIO0_FLAG_T() bfin_read16(FIO0_FLAG_T)
330#define bfin_write_FIO0_FLAG_T(val) bfin_write16(FIO0_FLAG_T,val)
331#define bfin_read_FIO0_MASKA_D() bfin_read16(FIO0_MASKA_D)
332#define bfin_write_FIO0_MASKA_D(val) bfin_write16(FIO0_MASKA_D,val)
333#define bfin_read_FIO0_MASKA_C() bfin_read16(FIO0_MASKA_C)
334#define bfin_write_FIO0_MASKA_C(val) bfin_write16(FIO0_MASKA_C,val)
335#define bfin_read_FIO0_MASKA_S() bfin_read16(FIO0_MASKA_S)
336#define bfin_write_FIO0_MASKA_S(val) bfin_write16(FIO0_MASKA_S,val)
337#define bfin_read_FIO0_MASKA_T() bfin_read16(FIO0_MASKA_T)
338#define bfin_write_FIO0_MASKA_T(val) bfin_write16(FIO0_MASKA_T,val)
339#define bfin_read_FIO0_MASKB_D() bfin_read16(FIO0_MASKB_D)
340#define bfin_write_FIO0_MASKB_D(val) bfin_write16(FIO0_MASKB_D,val)
341#define bfin_read_FIO0_MASKB_C() bfin_read16(FIO0_MASKB_C)
342#define bfin_write_FIO0_MASKB_C(val) bfin_write16(FIO0_MASKB_C,val)
343#define bfin_read_FIO0_MASKB_S() bfin_read16(FIO0_MASKB_S)
344#define bfin_write_FIO0_MASKB_S(val) bfin_write16(FIO0_MASKB_S,val)
345#define bfin_read_FIO0_MASKB_T() bfin_read16(FIO0_MASKB_T)
346#define bfin_write_FIO0_MASKB_T(val) bfin_write16(FIO0_MASKB_T,val)
347#define bfin_read_FIO0_DIR() bfin_read16(FIO0_DIR)
348#define bfin_write_FIO0_DIR(val) bfin_write16(FIO0_DIR,val)
349#define bfin_read_FIO0_POLAR() bfin_read16(FIO0_POLAR)
350#define bfin_write_FIO0_POLAR(val) bfin_write16(FIO0_POLAR,val)
351#define bfin_read_FIO0_EDGE() bfin_read16(FIO0_EDGE)
352#define bfin_write_FIO0_EDGE(val) bfin_write16(FIO0_EDGE,val)
353#define bfin_read_FIO0_BOTH() bfin_read16(FIO0_BOTH)
354#define bfin_write_FIO0_BOTH(val) bfin_write16(FIO0_BOTH,val)
355#define bfin_read_FIO0_INEN() bfin_read16(FIO0_INEN)
356#define bfin_write_FIO0_INEN(val) bfin_write16(FIO0_INEN,val)
357/* Programmable Flag 1 registers (0xFFC0 1500-0xFFC0 15FF) */
358#define bfin_read_FIO1_FLAG_D() bfin_read16(FIO1_FLAG_D)
359#define bfin_write_FIO1_FLAG_D(val) bfin_write16(FIO1_FLAG_D,val)
360#define bfin_read_FIO1_FLAG_C() bfin_read16(FIO1_FLAG_C)
361#define bfin_write_FIO1_FLAG_C(val) bfin_write16(FIO1_FLAG_C,val)
362#define bfin_read_FIO1_FLAG_S() bfin_read16(FIO1_FLAG_S)
363#define bfin_write_FIO1_FLAG_S(val) bfin_write16(FIO1_FLAG_S,val)
364#define bfin_read_FIO1_FLAG_T() bfin_read16(FIO1_FLAG_T)
365#define bfin_write_FIO1_FLAG_T(val) bfin_write16(FIO1_FLAG_T,val)
366#define bfin_read_FIO1_MASKA_D() bfin_read16(FIO1_MASKA_D)
367#define bfin_write_FIO1_MASKA_D(val) bfin_write16(FIO1_MASKA_D,val)
368#define bfin_read_FIO1_MASKA_C() bfin_read16(FIO1_MASKA_C)
369#define bfin_write_FIO1_MASKA_C(val) bfin_write16(FIO1_MASKA_C,val)
370#define bfin_read_FIO1_MASKA_S() bfin_read16(FIO1_MASKA_S)
371#define bfin_write_FIO1_MASKA_S(val) bfin_write16(FIO1_MASKA_S,val)
372#define bfin_read_FIO1_MASKA_T() bfin_read16(FIO1_MASKA_T)
373#define bfin_write_FIO1_MASKA_T(val) bfin_write16(FIO1_MASKA_T,val)
374#define bfin_read_FIO1_MASKB_D() bfin_read16(FIO1_MASKB_D)
375#define bfin_write_FIO1_MASKB_D(val) bfin_write16(FIO1_MASKB_D,val)
376#define bfin_read_FIO1_MASKB_C() bfin_read16(FIO1_MASKB_C)
377#define bfin_write_FIO1_MASKB_C(val) bfin_write16(FIO1_MASKB_C,val)
378#define bfin_read_FIO1_MASKB_S() bfin_read16(FIO1_MASKB_S)
379#define bfin_write_FIO1_MASKB_S(val) bfin_write16(FIO1_MASKB_S,val)
380#define bfin_read_FIO1_MASKB_T() bfin_read16(FIO1_MASKB_T)
381#define bfin_write_FIO1_MASKB_T(val) bfin_write16(FIO1_MASKB_T,val)
382#define bfin_read_FIO1_DIR() bfin_read16(FIO1_DIR)
383#define bfin_write_FIO1_DIR(val) bfin_write16(FIO1_DIR,val)
384#define bfin_read_FIO1_POLAR() bfin_read16(FIO1_POLAR)
385#define bfin_write_FIO1_POLAR(val) bfin_write16(FIO1_POLAR,val)
386#define bfin_read_FIO1_EDGE() bfin_read16(FIO1_EDGE)
387#define bfin_write_FIO1_EDGE(val) bfin_write16(FIO1_EDGE,val)
388#define bfin_read_FIO1_BOTH() bfin_read16(FIO1_BOTH)
389#define bfin_write_FIO1_BOTH(val) bfin_write16(FIO1_BOTH,val)
390#define bfin_read_FIO1_INEN() bfin_read16(FIO1_INEN)
391#define bfin_write_FIO1_INEN(val) bfin_write16(FIO1_INEN,val)
392/* Programmable Flag registers (0xFFC0 1700-0xFFC0 17FF) */
393#define bfin_read_FIO2_FLAG_D() bfin_read16(FIO2_FLAG_D)
394#define bfin_write_FIO2_FLAG_D(val) bfin_write16(FIO2_FLAG_D,val)
395#define bfin_read_FIO2_FLAG_C() bfin_read16(FIO2_FLAG_C)
396#define bfin_write_FIO2_FLAG_C(val) bfin_write16(FIO2_FLAG_C,val)
397#define bfin_read_FIO2_FLAG_S() bfin_read16(FIO2_FLAG_S)
398#define bfin_write_FIO2_FLAG_S(val) bfin_write16(FIO2_FLAG_S,val)
399#define bfin_read_FIO2_FLAG_T() bfin_read16(FIO2_FLAG_T)
400#define bfin_write_FIO2_FLAG_T(val) bfin_write16(FIO2_FLAG_T,val)
401#define bfin_read_FIO2_MASKA_D() bfin_read16(FIO2_MASKA_D)
402#define bfin_write_FIO2_MASKA_D(val) bfin_write16(FIO2_MASKA_D,val)
403#define bfin_read_FIO2_MASKA_C() bfin_read16(FIO2_MASKA_C)
404#define bfin_write_FIO2_MASKA_C(val) bfin_write16(FIO2_MASKA_C,val)
405#define bfin_read_FIO2_MASKA_S() bfin_read16(FIO2_MASKA_S)
406#define bfin_write_FIO2_MASKA_S(val) bfin_write16(FIO2_MASKA_S,val)
407#define bfin_read_FIO2_MASKA_T() bfin_read16(FIO2_MASKA_T)
408#define bfin_write_FIO2_MASKA_T(val) bfin_write16(FIO2_MASKA_T,val)
409#define bfin_read_FIO2_MASKB_D() bfin_read16(FIO2_MASKB_D)
410#define bfin_write_FIO2_MASKB_D(val) bfin_write16(FIO2_MASKB_D,val)
411#define bfin_read_FIO2_MASKB_C() bfin_read16(FIO2_MASKB_C)
412#define bfin_write_FIO2_MASKB_C(val) bfin_write16(FIO2_MASKB_C,val)
413#define bfin_read_FIO2_MASKB_S() bfin_read16(FIO2_MASKB_S)
414#define bfin_write_FIO2_MASKB_S(val) bfin_write16(FIO2_MASKB_S,val)
415#define bfin_read_FIO2_MASKB_T() bfin_read16(FIO2_MASKB_T)
416#define bfin_write_FIO2_MASKB_T(val) bfin_write16(FIO2_MASKB_T,val)
417#define bfin_read_FIO2_DIR() bfin_read16(FIO2_DIR)
418#define bfin_write_FIO2_DIR(val) bfin_write16(FIO2_DIR,val)
419#define bfin_read_FIO2_POLAR() bfin_read16(FIO2_POLAR)
420#define bfin_write_FIO2_POLAR(val) bfin_write16(FIO2_POLAR,val)
421#define bfin_read_FIO2_EDGE() bfin_read16(FIO2_EDGE)
422#define bfin_write_FIO2_EDGE(val) bfin_write16(FIO2_EDGE,val)
423#define bfin_read_FIO2_BOTH() bfin_read16(FIO2_BOTH)
424#define bfin_write_FIO2_BOTH(val) bfin_write16(FIO2_BOTH,val)
425#define bfin_read_FIO2_INEN() bfin_read16(FIO2_INEN)
426#define bfin_write_FIO2_INEN(val) bfin_write16(FIO2_INEN,val)
427/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
428#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
429#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1,val)
430#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
431#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2,val)
432#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
433#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV,val)
434#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
435#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV,val)
436#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
437#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX,val)
438#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
439#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX,val)
440#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX)
441#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX,val)
442#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX)
443#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX,val)
444#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX)
445#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX,val)
446#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX)
447#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX,val)
448#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
449#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1,val)
450#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
451#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2,val)
452#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
453#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV,val)
454#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
455#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV,val)
456#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
457#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT,val)
458#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
459#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL,val)
460#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
461#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1,val)
462#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
463#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2,val)
464#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
465#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0,val)
466#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
467#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1,val)
468#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
469#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2,val)
470#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
471#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3,val)
472#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
473#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0,val)
474#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
475#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1,val)
476#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
477#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2,val)
478#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
479#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3,val)
480/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
481#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
482#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1,val)
483#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
484#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2,val)
485#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
486#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV,val)
487#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
488#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV,val)
489#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
490#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX,val)
491#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
492#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX,val)
493#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX)
494#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX,val)
495#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX)
496#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX,val)
497#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX)
498#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX,val)
499#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX)
500#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX,val)
501#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
502#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1,val)
503#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
504#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2,val)
505#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
506#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV,val)
507#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
508#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV,val)
509#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
510#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT,val)
511#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
512#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL,val)
513#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
514#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1,val)
515#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
516#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2,val)
517#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
518#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0,val)
519#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
520#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1,val)
521#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
522#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2,val)
523#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
524#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3,val)
525#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
526#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0,val)
527#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
528#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1,val)
529#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
530#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2,val)
531#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
532#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3,val)
533/* Asynchronous Memory Controller - External Bus Interface Unit */
534#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
535#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL,val)
536#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
537#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0,val)
538#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
539#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1,val)
540/* SDRAM Controller External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
541#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
542#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL,val)
543#define bfin_read_EBIU_SDBCTL() bfin_read32(EBIU_SDBCTL)
544#define bfin_write_EBIU_SDBCTL(val) bfin_write32(EBIU_SDBCTL,val)
545#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
546#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC,val)
547#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
548#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT,val)
549/* Parallel Peripheral Interface (PPI) 0 registers (0xFFC0 1000-0xFFC0 10FF) */
550#define bfin_read_PPI0_CONTROL() bfin_read16(PPI0_CONTROL)
551#define bfin_write_PPI0_CONTROL(val) bfin_write16(PPI0_CONTROL,val)
552#define bfin_read_PPI0_STATUS() bfin_read16(PPI0_STATUS)
553#define bfin_write_PPI0_STATUS(val) bfin_write16(PPI0_STATUS,val)
554#define bfin_read_PPI0_COUNT() bfin_read16(PPI0_COUNT)
555#define bfin_write_PPI0_COUNT(val) bfin_write16(PPI0_COUNT,val)
556#define bfin_read_PPI0_DELAY() bfin_read16(PPI0_DELAY)
557#define bfin_write_PPI0_DELAY(val) bfin_write16(PPI0_DELAY,val)
558#define bfin_read_PPI0_FRAME() bfin_read16(PPI0_FRAME)
559#define bfin_write_PPI0_FRAME(val) bfin_write16(PPI0_FRAME,val)
560/* Parallel Peripheral Interface (PPI) 1 registers (0xFFC0 1300-0xFFC0 13FF) */
561#define bfin_read_PPI1_CONTROL() bfin_read16(PPI1_CONTROL)
562#define bfin_write_PPI1_CONTROL(val) bfin_write16(PPI1_CONTROL,val)
563#define bfin_read_PPI1_STATUS() bfin_read16(PPI1_STATUS)
564#define bfin_write_PPI1_STATUS(val) bfin_write16(PPI1_STATUS,val)
565#define bfin_read_PPI1_COUNT() bfin_read16(PPI1_COUNT)
566#define bfin_write_PPI1_COUNT(val) bfin_write16(PPI1_COUNT,val)
567#define bfin_read_PPI1_DELAY() bfin_read16(PPI1_DELAY)
568#define bfin_write_PPI1_DELAY(val) bfin_write16(PPI1_DELAY,val)
569#define bfin_read_PPI1_FRAME() bfin_read16(PPI1_FRAME)
570#define bfin_write_PPI1_FRAME(val) bfin_write16(PPI1_FRAME,val)
571/*DMA traffic control registers */
572#define bfin_read_DMA1_TC_PER() bfin_read16(DMA1_TC_PER)
573#define bfin_write_DMA1_TC_PER(val) bfin_write16(DMA1_TC_PER,val)
574#define bfin_read_DMA1_TC_CNT() bfin_read16(DMA1_TC_CNT)
575#define bfin_write_DMA1_TC_CNT(val) bfin_write16(DMA1_TC_CNT,val)
576#define bfin_read_DMA2_TC_PER() bfin_read16(DMA2_TC_PER)
577#define bfin_write_DMA2_TC_PER(val) bfin_write16(DMA2_TC_PER,val)
578#define bfin_read_DMA2_TC_CNT() bfin_read16(DMA2_TC_CNT)
579#define bfin_write_DMA2_TC_CNT(val) bfin_write16(DMA2_TC_CNT,val)
580/* DMA1 Controller registers (0xFFC0 1C00-0xFFC0 1FFF) */
581#define bfin_read_DMA1_0_CONFIG() bfin_read16(DMA1_0_CONFIG)
582#define bfin_write_DMA1_0_CONFIG(val) bfin_write16(DMA1_0_CONFIG,val)
583#define bfin_read_DMA1_0_NEXT_DESC_PTR() bfin_read32(DMA1_0_NEXT_DESC_PTR)
584#define bfin_write_DMA1_0_NEXT_DESC_PTR(val) bfin_write32(DMA1_0_NEXT_DESC_PTR,val)
585#define bfin_read_DMA1_0_START_ADDR() bfin_read32(DMA1_0_START_ADDR)
586#define bfin_write_DMA1_0_START_ADDR(val) bfin_write32(DMA1_0_START_ADDR,val)
587#define bfin_read_DMA1_0_X_COUNT() bfin_read16(DMA1_0_X_COUNT)
588#define bfin_write_DMA1_0_X_COUNT(val) bfin_write16(DMA1_0_X_COUNT,val)
589#define bfin_read_DMA1_0_Y_COUNT() bfin_read16(DMA1_0_Y_COUNT)
590#define bfin_write_DMA1_0_Y_COUNT(val) bfin_write16(DMA1_0_Y_COUNT,val)
591#define bfin_read_DMA1_0_X_MODIFY() bfin_read16(DMA1_0_X_MODIFY)
592#define bfin_write_DMA1_0_X_MODIFY(val) bfin_write16(DMA1_0_X_MODIFY,val)
593#define bfin_read_DMA1_0_Y_MODIFY() bfin_read16(DMA1_0_Y_MODIFY)
594#define bfin_write_DMA1_0_Y_MODIFY(val) bfin_write16(DMA1_0_Y_MODIFY,val)
595#define bfin_read_DMA1_0_CURR_DESC_PTR() bfin_read32(DMA1_0_CURR_DESC_PTR)
596#define bfin_write_DMA1_0_CURR_DESC_PTR(val) bfin_write32(DMA1_0_CURR_DESC_PTR,val)
597#define bfin_read_DMA1_0_CURR_ADDR() bfin_read32(DMA1_0_CURR_ADDR)
598#define bfin_write_DMA1_0_CURR_ADDR(val) bfin_write32(DMA1_0_CURR_ADDR,val)
599#define bfin_read_DMA1_0_CURR_X_COUNT() bfin_read16(DMA1_0_CURR_X_COUNT)
600#define bfin_write_DMA1_0_CURR_X_COUNT(val) bfin_write16(DMA1_0_CURR_X_COUNT,val)
601#define bfin_read_DMA1_0_CURR_Y_COUNT() bfin_read16(DMA1_0_CURR_Y_COUNT)
602#define bfin_write_DMA1_0_CURR_Y_COUNT(val) bfin_write16(DMA1_0_CURR_Y_COUNT,val)
603#define bfin_read_DMA1_0_IRQ_STATUS() bfin_read16(DMA1_0_IRQ_STATUS)
604#define bfin_write_DMA1_0_IRQ_STATUS(val) bfin_write16(DMA1_0_IRQ_STATUS,val)
605#define bfin_read_DMA1_0_PERIPHERAL_MAP() bfin_read16(DMA1_0_PERIPHERAL_MAP)
606#define bfin_write_DMA1_0_PERIPHERAL_MAP(val) bfin_write16(DMA1_0_PERIPHERAL_MAP,val)
607#define bfin_read_DMA1_1_CONFIG() bfin_read16(DMA1_1_CONFIG)
608#define bfin_write_DMA1_1_CONFIG(val) bfin_write16(DMA1_1_CONFIG,val)
609#define bfin_read_DMA1_1_NEXT_DESC_PTR() bfin_read32(DMA1_1_NEXT_DESC_PTR)
610#define bfin_write_DMA1_1_NEXT_DESC_PTR(val) bfin_write32(DMA1_1_NEXT_DESC_PTR,val)
611#define bfin_read_DMA1_1_START_ADDR() bfin_read32(DMA1_1_START_ADDR)
612#define bfin_write_DMA1_1_START_ADDR(val) bfin_write32(DMA1_1_START_ADDR,val)
613#define bfin_read_DMA1_1_X_COUNT() bfin_read16(DMA1_1_X_COUNT)
614#define bfin_write_DMA1_1_X_COUNT(val) bfin_write16(DMA1_1_X_COUNT,val)
615#define bfin_read_DMA1_1_Y_COUNT() bfin_read16(DMA1_1_Y_COUNT)
616#define bfin_write_DMA1_1_Y_COUNT(val) bfin_write16(DMA1_1_Y_COUNT,val)
617#define bfin_read_DMA1_1_X_MODIFY() bfin_read16(DMA1_1_X_MODIFY)
618#define bfin_write_DMA1_1_X_MODIFY(val) bfin_write16(DMA1_1_X_MODIFY,val)
619#define bfin_read_DMA1_1_Y_MODIFY() bfin_read16(DMA1_1_Y_MODIFY)
620#define bfin_write_DMA1_1_Y_MODIFY(val) bfin_write16(DMA1_1_Y_MODIFY,val)
621#define bfin_read_DMA1_1_CURR_DESC_PTR() bfin_read32(DMA1_1_CURR_DESC_PTR)
622#define bfin_write_DMA1_1_CURR_DESC_PTR(val) bfin_write32(DMA1_1_CURR_DESC_PTR,val)
623#define bfin_read_DMA1_1_CURR_ADDR() bfin_read32(DMA1_1_CURR_ADDR)
624#define bfin_write_DMA1_1_CURR_ADDR(val) bfin_write32(DMA1_1_CURR_ADDR,val)
625#define bfin_read_DMA1_1_CURR_X_COUNT() bfin_read16(DMA1_1_CURR_X_COUNT)
626#define bfin_write_DMA1_1_CURR_X_COUNT(val) bfin_write16(DMA1_1_CURR_X_COUNT,val)
627#define bfin_read_DMA1_1_CURR_Y_COUNT() bfin_read16(DMA1_1_CURR_Y_COUNT)
628#define bfin_write_DMA1_1_CURR_Y_COUNT(val) bfin_write16(DMA1_1_CURR_Y_COUNT,val)
629#define bfin_read_DMA1_1_IRQ_STATUS() bfin_read16(DMA1_1_IRQ_STATUS)
630#define bfin_write_DMA1_1_IRQ_STATUS(val) bfin_write16(DMA1_1_IRQ_STATUS,val)
631#define bfin_read_DMA1_1_PERIPHERAL_MAP() bfin_read16(DMA1_1_PERIPHERAL_MAP)
632#define bfin_write_DMA1_1_PERIPHERAL_MAP(val) bfin_write16(DMA1_1_PERIPHERAL_MAP,val)
633#define bfin_read_DMA1_2_CONFIG() bfin_read16(DMA1_2_CONFIG)
634#define bfin_write_DMA1_2_CONFIG(val) bfin_write16(DMA1_2_CONFIG,val)
635#define bfin_read_DMA1_2_NEXT_DESC_PTR() bfin_read32(DMA1_2_NEXT_DESC_PTR)
636#define bfin_write_DMA1_2_NEXT_DESC_PTR(val) bfin_write32(DMA1_2_NEXT_DESC_PTR,val)
637#define bfin_read_DMA1_2_START_ADDR() bfin_read32(DMA1_2_START_ADDR)
638#define bfin_write_DMA1_2_START_ADDR(val) bfin_write32(DMA1_2_START_ADDR,val)
639#define bfin_read_DMA1_2_X_COUNT() bfin_read16(DMA1_2_X_COUNT)
640#define bfin_write_DMA1_2_X_COUNT(val) bfin_write16(DMA1_2_X_COUNT,val)
641#define bfin_read_DMA1_2_Y_COUNT() bfin_read16(DMA1_2_Y_COUNT)
642#define bfin_write_DMA1_2_Y_COUNT(val) bfin_write16(DMA1_2_Y_COUNT,val)
643#define bfin_read_DMA1_2_X_MODIFY() bfin_read16(DMA1_2_X_MODIFY)
644#define bfin_write_DMA1_2_X_MODIFY(val) bfin_write16(DMA1_2_X_MODIFY,val)
645#define bfin_read_DMA1_2_Y_MODIFY() bfin_read16(DMA1_2_Y_MODIFY)
646#define bfin_write_DMA1_2_Y_MODIFY(val) bfin_write16(DMA1_2_Y_MODIFY,val)
647#define bfin_read_DMA1_2_CURR_DESC_PTR() bfin_read32(DMA1_2_CURR_DESC_PTR)
648#define bfin_write_DMA1_2_CURR_DESC_PTR(val) bfin_write32(DMA1_2_CURR_DESC_PTR,val)
649#define bfin_read_DMA1_2_CURR_ADDR() bfin_read32(DMA1_2_CURR_ADDR)
650#define bfin_write_DMA1_2_CURR_ADDR(val) bfin_write32(DMA1_2_CURR_ADDR,val)
651#define bfin_read_DMA1_2_CURR_X_COUNT() bfin_read16(DMA1_2_CURR_X_COUNT)
652#define bfin_write_DMA1_2_CURR_X_COUNT(val) bfin_write16(DMA1_2_CURR_X_COUNT,val)
653#define bfin_read_DMA1_2_CURR_Y_COUNT() bfin_read16(DMA1_2_CURR_Y_COUNT)
654#define bfin_write_DMA1_2_CURR_Y_COUNT(val) bfin_write16(DMA1_2_CURR_Y_COUNT,val)
655#define bfin_read_DMA1_2_IRQ_STATUS() bfin_read16(DMA1_2_IRQ_STATUS)
656#define bfin_write_DMA1_2_IRQ_STATUS(val) bfin_write16(DMA1_2_IRQ_STATUS,val)
657#define bfin_read_DMA1_2_PERIPHERAL_MAP() bfin_read16(DMA1_2_PERIPHERAL_MAP)
658#define bfin_write_DMA1_2_PERIPHERAL_MAP(val) bfin_write16(DMA1_2_PERIPHERAL_MAP,val)
659#define bfin_read_DMA1_3_CONFIG() bfin_read16(DMA1_3_CONFIG)
660#define bfin_write_DMA1_3_CONFIG(val) bfin_write16(DMA1_3_CONFIG,val)
661#define bfin_read_DMA1_3_NEXT_DESC_PTR() bfin_read32(DMA1_3_NEXT_DESC_PTR)
662#define bfin_write_DMA1_3_NEXT_DESC_PTR(val) bfin_write32(DMA1_3_NEXT_DESC_PTR,val)
663#define bfin_read_DMA1_3_START_ADDR() bfin_read32(DMA1_3_START_ADDR)
664#define bfin_write_DMA1_3_START_ADDR(val) bfin_write32(DMA1_3_START_ADDR,val)
665#define bfin_read_DMA1_3_X_COUNT() bfin_read16(DMA1_3_X_COUNT)
666#define bfin_write_DMA1_3_X_COUNT(val) bfin_write16(DMA1_3_X_COUNT,val)
667#define bfin_read_DMA1_3_Y_COUNT() bfin_read16(DMA1_3_Y_COUNT)
668#define bfin_write_DMA1_3_Y_COUNT(val) bfin_write16(DMA1_3_Y_COUNT,val)
669#define bfin_read_DMA1_3_X_MODIFY() bfin_read16(DMA1_3_X_MODIFY)
670#define bfin_write_DMA1_3_X_MODIFY(val) bfin_write16(DMA1_3_X_MODIFY,val)
671#define bfin_read_DMA1_3_Y_MODIFY() bfin_read16(DMA1_3_Y_MODIFY)
672#define bfin_write_DMA1_3_Y_MODIFY(val) bfin_write16(DMA1_3_Y_MODIFY,val)
673#define bfin_read_DMA1_3_CURR_DESC_PTR() bfin_read32(DMA1_3_CURR_DESC_PTR)
674#define bfin_write_DMA1_3_CURR_DESC_PTR(val) bfin_write32(DMA1_3_CURR_DESC_PTR,val)
675#define bfin_read_DMA1_3_CURR_ADDR() bfin_read32(DMA1_3_CURR_ADDR)
676#define bfin_write_DMA1_3_CURR_ADDR(val) bfin_write32(DMA1_3_CURR_ADDR,val)
677#define bfin_read_DMA1_3_CURR_X_COUNT() bfin_read16(DMA1_3_CURR_X_COUNT)
678#define bfin_write_DMA1_3_CURR_X_COUNT(val) bfin_write16(DMA1_3_CURR_X_COUNT,val)
679#define bfin_read_DMA1_3_CURR_Y_COUNT() bfin_read16(DMA1_3_CURR_Y_COUNT)
680#define bfin_write_DMA1_3_CURR_Y_COUNT(val) bfin_write16(DMA1_3_CURR_Y_COUNT,val)
681#define bfin_read_DMA1_3_IRQ_STATUS() bfin_read16(DMA1_3_IRQ_STATUS)
682#define bfin_write_DMA1_3_IRQ_STATUS(val) bfin_write16(DMA1_3_IRQ_STATUS,val)
683#define bfin_read_DMA1_3_PERIPHERAL_MAP() bfin_read16(DMA1_3_PERIPHERAL_MAP)
684#define bfin_write_DMA1_3_PERIPHERAL_MAP(val) bfin_write16(DMA1_3_PERIPHERAL_MAP,val)
685#define bfin_read_DMA1_4_CONFIG() bfin_read16(DMA1_4_CONFIG)
686#define bfin_write_DMA1_4_CONFIG(val) bfin_write16(DMA1_4_CONFIG,val)
687#define bfin_read_DMA1_4_NEXT_DESC_PTR() bfin_read32(DMA1_4_NEXT_DESC_PTR)
688#define bfin_write_DMA1_4_NEXT_DESC_PTR(val) bfin_write32(DMA1_4_NEXT_DESC_PTR,val)
689#define bfin_read_DMA1_4_START_ADDR() bfin_read32(DMA1_4_START_ADDR)
690#define bfin_write_DMA1_4_START_ADDR(val) bfin_write32(DMA1_4_START_ADDR,val)
691#define bfin_read_DMA1_4_X_COUNT() bfin_read16(DMA1_4_X_COUNT)
692#define bfin_write_DMA1_4_X_COUNT(val) bfin_write16(DMA1_4_X_COUNT,val)
693#define bfin_read_DMA1_4_Y_COUNT() bfin_read16(DMA1_4_Y_COUNT)
694#define bfin_write_DMA1_4_Y_COUNT(val) bfin_write16(DMA1_4_Y_COUNT,val)
695#define bfin_read_DMA1_4_X_MODIFY() bfin_read16(DMA1_4_X_MODIFY)
696#define bfin_write_DMA1_4_X_MODIFY(val) bfin_write16(DMA1_4_X_MODIFY,val)
697#define bfin_read_DMA1_4_Y_MODIFY() bfin_read16(DMA1_4_Y_MODIFY)
698#define bfin_write_DMA1_4_Y_MODIFY(val) bfin_write16(DMA1_4_Y_MODIFY,val)
699#define bfin_read_DMA1_4_CURR_DESC_PTR() bfin_read32(DMA1_4_CURR_DESC_PTR)
700#define bfin_write_DMA1_4_CURR_DESC_PTR(val) bfin_write32(DMA1_4_CURR_DESC_PTR,val)
701#define bfin_read_DMA1_4_CURR_ADDR() bfin_read32(DMA1_4_CURR_ADDR)
702#define bfin_write_DMA1_4_CURR_ADDR(val) bfin_write32(DMA1_4_CURR_ADDR,val)
703#define bfin_read_DMA1_4_CURR_X_COUNT() bfin_read16(DMA1_4_CURR_X_COUNT)
704#define bfin_write_DMA1_4_CURR_X_COUNT(val) bfin_write16(DMA1_4_CURR_X_COUNT,val)
705#define bfin_read_DMA1_4_CURR_Y_COUNT() bfin_read16(DMA1_4_CURR_Y_COUNT)
706#define bfin_write_DMA1_4_CURR_Y_COUNT(val) bfin_write16(DMA1_4_CURR_Y_COUNT,val)
707#define bfin_read_DMA1_4_IRQ_STATUS() bfin_read16(DMA1_4_IRQ_STATUS)
708#define bfin_write_DMA1_4_IRQ_STATUS(val) bfin_write16(DMA1_4_IRQ_STATUS,val)
709#define bfin_read_DMA1_4_PERIPHERAL_MAP() bfin_read16(DMA1_4_PERIPHERAL_MAP)
710#define bfin_write_DMA1_4_PERIPHERAL_MAP(val) bfin_write16(DMA1_4_PERIPHERAL_MAP,val)
711#define bfin_read_DMA1_5_CONFIG() bfin_read16(DMA1_5_CONFIG)
712#define bfin_write_DMA1_5_CONFIG(val) bfin_write16(DMA1_5_CONFIG,val)
713#define bfin_read_DMA1_5_NEXT_DESC_PTR() bfin_read32(DMA1_5_NEXT_DESC_PTR)
714#define bfin_write_DMA1_5_NEXT_DESC_PTR(val) bfin_write32(DMA1_5_NEXT_DESC_PTR,val)
715#define bfin_read_DMA1_5_START_ADDR() bfin_read32(DMA1_5_START_ADDR)
716#define bfin_write_DMA1_5_START_ADDR(val) bfin_write32(DMA1_5_START_ADDR,val)
717#define bfin_read_DMA1_5_X_COUNT() bfin_read16(DMA1_5_X_COUNT)
718#define bfin_write_DMA1_5_X_COUNT(val) bfin_write16(DMA1_5_X_COUNT,val)
719#define bfin_read_DMA1_5_Y_COUNT() bfin_read16(DMA1_5_Y_COUNT)
720#define bfin_write_DMA1_5_Y_COUNT(val) bfin_write16(DMA1_5_Y_COUNT,val)
721#define bfin_read_DMA1_5_X_MODIFY() bfin_read16(DMA1_5_X_MODIFY)
722#define bfin_write_DMA1_5_X_MODIFY(val) bfin_write16(DMA1_5_X_MODIFY,val)
723#define bfin_read_DMA1_5_Y_MODIFY() bfin_read16(DMA1_5_Y_MODIFY)
724#define bfin_write_DMA1_5_Y_MODIFY(val) bfin_write16(DMA1_5_Y_MODIFY,val)
725#define bfin_read_DMA1_5_CURR_DESC_PTR() bfin_read32(DMA1_5_CURR_DESC_PTR)
726#define bfin_write_DMA1_5_CURR_DESC_PTR(val) bfin_write32(DMA1_5_CURR_DESC_PTR,val)
727#define bfin_read_DMA1_5_CURR_ADDR() bfin_read32(DMA1_5_CURR_ADDR)
728#define bfin_write_DMA1_5_CURR_ADDR(val) bfin_write32(DMA1_5_CURR_ADDR,val)
729#define bfin_read_DMA1_5_CURR_X_COUNT() bfin_read16(DMA1_5_CURR_X_COUNT)
730#define bfin_write_DMA1_5_CURR_X_COUNT(val) bfin_write16(DMA1_5_CURR_X_COUNT,val)
731#define bfin_read_DMA1_5_CURR_Y_COUNT() bfin_read16(DMA1_5_CURR_Y_COUNT)
732#define bfin_write_DMA1_5_CURR_Y_COUNT(val) bfin_write16(DMA1_5_CURR_Y_COUNT,val)
733#define bfin_read_DMA1_5_IRQ_STATUS() bfin_read16(DMA1_5_IRQ_STATUS)
734#define bfin_write_DMA1_5_IRQ_STATUS(val) bfin_write16(DMA1_5_IRQ_STATUS,val)
735#define bfin_read_DMA1_5_PERIPHERAL_MAP() bfin_read16(DMA1_5_PERIPHERAL_MAP)
736#define bfin_write_DMA1_5_PERIPHERAL_MAP(val) bfin_write16(DMA1_5_PERIPHERAL_MAP,val)
737#define bfin_read_DMA1_6_CONFIG() bfin_read16(DMA1_6_CONFIG)
738#define bfin_write_DMA1_6_CONFIG(val) bfin_write16(DMA1_6_CONFIG,val)
739#define bfin_read_DMA1_6_NEXT_DESC_PTR() bfin_read32(DMA1_6_NEXT_DESC_PTR)
740#define bfin_write_DMA1_6_NEXT_DESC_PTR(val) bfin_write32(DMA1_6_NEXT_DESC_PTR,val)
741#define bfin_read_DMA1_6_START_ADDR() bfin_read32(DMA1_6_START_ADDR)
742#define bfin_write_DMA1_6_START_ADDR(val) bfin_write32(DMA1_6_START_ADDR,val)
743#define bfin_read_DMA1_6_X_COUNT() bfin_read16(DMA1_6_X_COUNT)
744#define bfin_write_DMA1_6_X_COUNT(val) bfin_write16(DMA1_6_X_COUNT,val)
745#define bfin_read_DMA1_6_Y_COUNT() bfin_read16(DMA1_6_Y_COUNT)
746#define bfin_write_DMA1_6_Y_COUNT(val) bfin_write16(DMA1_6_Y_COUNT,val)
747#define bfin_read_DMA1_6_X_MODIFY() bfin_read16(DMA1_6_X_MODIFY)
748#define bfin_write_DMA1_6_X_MODIFY(val) bfin_write16(DMA1_6_X_MODIFY,val)
749#define bfin_read_DMA1_6_Y_MODIFY() bfin_read16(DMA1_6_Y_MODIFY)
750#define bfin_write_DMA1_6_Y_MODIFY(val) bfin_write16(DMA1_6_Y_MODIFY,val)
751#define bfin_read_DMA1_6_CURR_DESC_PTR() bfin_read32(DMA1_6_CURR_DESC_PTR)
752#define bfin_write_DMA1_6_CURR_DESC_PTR(val) bfin_write32(DMA1_6_CURR_DESC_PTR,val)
753#define bfin_read_DMA1_6_CURR_ADDR() bfin_read32(DMA1_6_CURR_ADDR)
754#define bfin_write_DMA1_6_CURR_ADDR(val) bfin_write32(DMA1_6_CURR_ADDR,val)
755#define bfin_read_DMA1_6_CURR_X_COUNT() bfin_read16(DMA1_6_CURR_X_COUNT)
756#define bfin_write_DMA1_6_CURR_X_COUNT(val) bfin_write16(DMA1_6_CURR_X_COUNT,val)
757#define bfin_read_DMA1_6_CURR_Y_COUNT() bfin_read16(DMA1_6_CURR_Y_COUNT)
758#define bfin_write_DMA1_6_CURR_Y_COUNT(val) bfin_write16(DMA1_6_CURR_Y_COUNT,val)
759#define bfin_read_DMA1_6_IRQ_STATUS() bfin_read16(DMA1_6_IRQ_STATUS)
760#define bfin_write_DMA1_6_IRQ_STATUS(val) bfin_write16(DMA1_6_IRQ_STATUS,val)
761#define bfin_read_DMA1_6_PERIPHERAL_MAP() bfin_read16(DMA1_6_PERIPHERAL_MAP)
762#define bfin_write_DMA1_6_PERIPHERAL_MAP(val) bfin_write16(DMA1_6_PERIPHERAL_MAP,val)
763#define bfin_read_DMA1_7_CONFIG() bfin_read16(DMA1_7_CONFIG)
764#define bfin_write_DMA1_7_CONFIG(val) bfin_write16(DMA1_7_CONFIG,val)
765#define bfin_read_DMA1_7_NEXT_DESC_PTR() bfin_read32(DMA1_7_NEXT_DESC_PTR)
766#define bfin_write_DMA1_7_NEXT_DESC_PTR(val) bfin_write32(DMA1_7_NEXT_DESC_PTR,val)
767#define bfin_read_DMA1_7_START_ADDR() bfin_read32(DMA1_7_START_ADDR)
768#define bfin_write_DMA1_7_START_ADDR(val) bfin_write32(DMA1_7_START_ADDR,val)
769#define bfin_read_DMA1_7_X_COUNT() bfin_read16(DMA1_7_X_COUNT)
770#define bfin_write_DMA1_7_X_COUNT(val) bfin_write16(DMA1_7_X_COUNT,val)
771#define bfin_read_DMA1_7_Y_COUNT() bfin_read16(DMA1_7_Y_COUNT)
772#define bfin_write_DMA1_7_Y_COUNT(val) bfin_write16(DMA1_7_Y_COUNT,val)
773#define bfin_read_DMA1_7_X_MODIFY() bfin_read16(DMA1_7_X_MODIFY)
774#define bfin_write_DMA1_7_X_MODIFY(val) bfin_write16(DMA1_7_X_MODIFY,val)
775#define bfin_read_DMA1_7_Y_MODIFY() bfin_read16(DMA1_7_Y_MODIFY)
776#define bfin_write_DMA1_7_Y_MODIFY(val) bfin_write16(DMA1_7_Y_MODIFY,val)
777#define bfin_read_DMA1_7_CURR_DESC_PTR() bfin_read32(DMA1_7_CURR_DESC_PTR)
778#define bfin_write_DMA1_7_CURR_DESC_PTR(val) bfin_write32(DMA1_7_CURR_DESC_PTR,val)
779#define bfin_read_DMA1_7_CURR_ADDR() bfin_read32(DMA1_7_CURR_ADDR)
780#define bfin_write_DMA1_7_CURR_ADDR(val) bfin_write32(DMA1_7_CURR_ADDR,val)
781#define bfin_read_DMA1_7_CURR_X_COUNT() bfin_read16(DMA1_7_CURR_X_COUNT)
782#define bfin_write_DMA1_7_CURR_X_COUNT(val) bfin_write16(DMA1_7_CURR_X_COUNT,val)
783#define bfin_read_DMA1_7_CURR_Y_COUNT() bfin_read16(DMA1_7_CURR_Y_COUNT)
784#define bfin_write_DMA1_7_CURR_Y_COUNT(val) bfin_write16(DMA1_7_CURR_Y_COUNT,val)
785#define bfin_read_DMA1_7_IRQ_STATUS() bfin_read16(DMA1_7_IRQ_STATUS)
786#define bfin_write_DMA1_7_IRQ_STATUS(val) bfin_write16(DMA1_7_IRQ_STATUS,val)
787#define bfin_read_DMA1_7_PERIPHERAL_MAP() bfin_read16(DMA1_7_PERIPHERAL_MAP)
788#define bfin_write_DMA1_7_PERIPHERAL_MAP(val) bfin_write16(DMA1_7_PERIPHERAL_MAP,val)
789#define bfin_read_DMA1_8_CONFIG() bfin_read16(DMA1_8_CONFIG)
790#define bfin_write_DMA1_8_CONFIG(val) bfin_write16(DMA1_8_CONFIG,val)
791#define bfin_read_DMA1_8_NEXT_DESC_PTR() bfin_read32(DMA1_8_NEXT_DESC_PTR)
792#define bfin_write_DMA1_8_NEXT_DESC_PTR(val) bfin_write32(DMA1_8_NEXT_DESC_PTR,val)
793#define bfin_read_DMA1_8_START_ADDR() bfin_read32(DMA1_8_START_ADDR)
794#define bfin_write_DMA1_8_START_ADDR(val) bfin_write32(DMA1_8_START_ADDR,val)
795#define bfin_read_DMA1_8_X_COUNT() bfin_read16(DMA1_8_X_COUNT)
796#define bfin_write_DMA1_8_X_COUNT(val) bfin_write16(DMA1_8_X_COUNT,val)
797#define bfin_read_DMA1_8_Y_COUNT() bfin_read16(DMA1_8_Y_COUNT)
798#define bfin_write_DMA1_8_Y_COUNT(val) bfin_write16(DMA1_8_Y_COUNT,val)
799#define bfin_read_DMA1_8_X_MODIFY() bfin_read16(DMA1_8_X_MODIFY)
800#define bfin_write_DMA1_8_X_MODIFY(val) bfin_write16(DMA1_8_X_MODIFY,val)
801#define bfin_read_DMA1_8_Y_MODIFY() bfin_read16(DMA1_8_Y_MODIFY)
802#define bfin_write_DMA1_8_Y_MODIFY(val) bfin_write16(DMA1_8_Y_MODIFY,val)
803#define bfin_read_DMA1_8_CURR_DESC_PTR() bfin_read32(DMA1_8_CURR_DESC_PTR)
804#define bfin_write_DMA1_8_CURR_DESC_PTR(val) bfin_write32(DMA1_8_CURR_DESC_PTR,val)
805#define bfin_read_DMA1_8_CURR_ADDR() bfin_read32(DMA1_8_CURR_ADDR)
806#define bfin_write_DMA1_8_CURR_ADDR(val) bfin_write32(DMA1_8_CURR_ADDR,val)
807#define bfin_read_DMA1_8_CURR_X_COUNT() bfin_read16(DMA1_8_CURR_X_COUNT)
808#define bfin_write_DMA1_8_CURR_X_COUNT(val) bfin_write16(DMA1_8_CURR_X_COUNT,val)
809#define bfin_read_DMA1_8_CURR_Y_COUNT() bfin_read16(DMA1_8_CURR_Y_COUNT)
810#define bfin_write_DMA1_8_CURR_Y_COUNT(val) bfin_write16(DMA1_8_CURR_Y_COUNT,val)
811#define bfin_read_DMA1_8_IRQ_STATUS() bfin_read16(DMA1_8_IRQ_STATUS)
812#define bfin_write_DMA1_8_IRQ_STATUS(val) bfin_write16(DMA1_8_IRQ_STATUS,val)
813#define bfin_read_DMA1_8_PERIPHERAL_MAP() bfin_read16(DMA1_8_PERIPHERAL_MAP)
814#define bfin_write_DMA1_8_PERIPHERAL_MAP(val) bfin_write16(DMA1_8_PERIPHERAL_MAP,val)
815#define bfin_read_DMA1_9_CONFIG() bfin_read16(DMA1_9_CONFIG)
816#define bfin_write_DMA1_9_CONFIG(val) bfin_write16(DMA1_9_CONFIG,val)
817#define bfin_read_DMA1_9_NEXT_DESC_PTR() bfin_read32(DMA1_9_NEXT_DESC_PTR)
818#define bfin_write_DMA1_9_NEXT_DESC_PTR(val) bfin_write32(DMA1_9_NEXT_DESC_PTR,val)
819#define bfin_read_DMA1_9_START_ADDR() bfin_read32(DMA1_9_START_ADDR)
820#define bfin_write_DMA1_9_START_ADDR(val) bfin_write32(DMA1_9_START_ADDR,val)
821#define bfin_read_DMA1_9_X_COUNT() bfin_read16(DMA1_9_X_COUNT)
822#define bfin_write_DMA1_9_X_COUNT(val) bfin_write16(DMA1_9_X_COUNT,val)
823#define bfin_read_DMA1_9_Y_COUNT() bfin_read16(DMA1_9_Y_COUNT)
824#define bfin_write_DMA1_9_Y_COUNT(val) bfin_write16(DMA1_9_Y_COUNT,val)
825#define bfin_read_DMA1_9_X_MODIFY() bfin_read16(DMA1_9_X_MODIFY)
826#define bfin_write_DMA1_9_X_MODIFY(val) bfin_write16(DMA1_9_X_MODIFY,val)
827#define bfin_read_DMA1_9_Y_MODIFY() bfin_read16(DMA1_9_Y_MODIFY)
828#define bfin_write_DMA1_9_Y_MODIFY(val) bfin_write16(DMA1_9_Y_MODIFY,val)
829#define bfin_read_DMA1_9_CURR_DESC_PTR() bfin_read32(DMA1_9_CURR_DESC_PTR)
830#define bfin_write_DMA1_9_CURR_DESC_PTR(val) bfin_write32(DMA1_9_CURR_DESC_PTR,val)
831#define bfin_read_DMA1_9_CURR_ADDR() bfin_read32(DMA1_9_CURR_ADDR)
832#define bfin_write_DMA1_9_CURR_ADDR(val) bfin_write32(DMA1_9_CURR_ADDR,val)
833#define bfin_read_DMA1_9_CURR_X_COUNT() bfin_read16(DMA1_9_CURR_X_COUNT)
834#define bfin_write_DMA1_9_CURR_X_COUNT(val) bfin_write16(DMA1_9_CURR_X_COUNT,val)
835#define bfin_read_DMA1_9_CURR_Y_COUNT() bfin_read16(DMA1_9_CURR_Y_COUNT)
836#define bfin_write_DMA1_9_CURR_Y_COUNT(val) bfin_write16(DMA1_9_CURR_Y_COUNT,val)
837#define bfin_read_DMA1_9_IRQ_STATUS() bfin_read16(DMA1_9_IRQ_STATUS)
838#define bfin_write_DMA1_9_IRQ_STATUS(val) bfin_write16(DMA1_9_IRQ_STATUS,val)
839#define bfin_read_DMA1_9_PERIPHERAL_MAP() bfin_read16(DMA1_9_PERIPHERAL_MAP)
840#define bfin_write_DMA1_9_PERIPHERAL_MAP(val) bfin_write16(DMA1_9_PERIPHERAL_MAP,val)
841#define bfin_read_DMA1_10_CONFIG() bfin_read16(DMA1_10_CONFIG)
842#define bfin_write_DMA1_10_CONFIG(val) bfin_write16(DMA1_10_CONFIG,val)
843#define bfin_read_DMA1_10_NEXT_DESC_PTR() bfin_read32(DMA1_10_NEXT_DESC_PTR)
844#define bfin_write_DMA1_10_NEXT_DESC_PTR(val) bfin_write32(DMA1_10_NEXT_DESC_PTR,val)
845#define bfin_read_DMA1_10_START_ADDR() bfin_read32(DMA1_10_START_ADDR)
846#define bfin_write_DMA1_10_START_ADDR(val) bfin_write32(DMA1_10_START_ADDR,val)
847#define bfin_read_DMA1_10_X_COUNT() bfin_read16(DMA1_10_X_COUNT)
848#define bfin_write_DMA1_10_X_COUNT(val) bfin_write16(DMA1_10_X_COUNT,val)
849#define bfin_read_DMA1_10_Y_COUNT() bfin_read16(DMA1_10_Y_COUNT)
850#define bfin_write_DMA1_10_Y_COUNT(val) bfin_write16(DMA1_10_Y_COUNT,val)
851#define bfin_read_DMA1_10_X_MODIFY() bfin_read16(DMA1_10_X_MODIFY)
852#define bfin_write_DMA1_10_X_MODIFY(val) bfin_write16(DMA1_10_X_MODIFY,val)
853#define bfin_read_DMA1_10_Y_MODIFY() bfin_read16(DMA1_10_Y_MODIFY)
854#define bfin_write_DMA1_10_Y_MODIFY(val) bfin_write16(DMA1_10_Y_MODIFY,val)
855#define bfin_read_DMA1_10_CURR_DESC_PTR() bfin_read32(DMA1_10_CURR_DESC_PTR)
856#define bfin_write_DMA1_10_CURR_DESC_PTR(val) bfin_write32(DMA1_10_CURR_DESC_PTR,val)
857#define bfin_read_DMA1_10_CURR_ADDR() bfin_read32(DMA1_10_CURR_ADDR)
858#define bfin_write_DMA1_10_CURR_ADDR(val) bfin_write32(DMA1_10_CURR_ADDR,val)
859#define bfin_read_DMA1_10_CURR_X_COUNT() bfin_read16(DMA1_10_CURR_X_COUNT)
860#define bfin_write_DMA1_10_CURR_X_COUNT(val) bfin_write16(DMA1_10_CURR_X_COUNT,val)
861#define bfin_read_DMA1_10_CURR_Y_COUNT() bfin_read16(DMA1_10_CURR_Y_COUNT)
862#define bfin_write_DMA1_10_CURR_Y_COUNT(val) bfin_write16(DMA1_10_CURR_Y_COUNT,val)
863#define bfin_read_DMA1_10_IRQ_STATUS() bfin_read16(DMA1_10_IRQ_STATUS)
864#define bfin_write_DMA1_10_IRQ_STATUS(val) bfin_write16(DMA1_10_IRQ_STATUS,val)
865#define bfin_read_DMA1_10_PERIPHERAL_MAP() bfin_read16(DMA1_10_PERIPHERAL_MAP)
866#define bfin_write_DMA1_10_PERIPHERAL_MAP(val) bfin_write16(DMA1_10_PERIPHERAL_MAP,val)
867#define bfin_read_DMA1_11_CONFIG() bfin_read16(DMA1_11_CONFIG)
868#define bfin_write_DMA1_11_CONFIG(val) bfin_write16(DMA1_11_CONFIG,val)
869#define bfin_read_DMA1_11_NEXT_DESC_PTR() bfin_read32(DMA1_11_NEXT_DESC_PTR)
870#define bfin_write_DMA1_11_NEXT_DESC_PTR(val) bfin_write32(DMA1_11_NEXT_DESC_PTR,val)
871#define bfin_read_DMA1_11_START_ADDR() bfin_read32(DMA1_11_START_ADDR)
872#define bfin_write_DMA1_11_START_ADDR(val) bfin_write32(DMA1_11_START_ADDR,val)
873#define bfin_read_DMA1_11_X_COUNT() bfin_read16(DMA1_11_X_COUNT)
874#define bfin_write_DMA1_11_X_COUNT(val) bfin_write16(DMA1_11_X_COUNT,val)
875#define bfin_read_DMA1_11_Y_COUNT() bfin_read16(DMA1_11_Y_COUNT)
876#define bfin_write_DMA1_11_Y_COUNT(val) bfin_write16(DMA1_11_Y_COUNT,val)
877#define bfin_read_DMA1_11_X_MODIFY() bfin_read16(DMA1_11_X_MODIFY)
878#define bfin_write_DMA1_11_X_MODIFY(val) bfin_write16(DMA1_11_X_MODIFY,val)
879#define bfin_read_DMA1_11_Y_MODIFY() bfin_read16(DMA1_11_Y_MODIFY)
880#define bfin_write_DMA1_11_Y_MODIFY(val) bfin_write16(DMA1_11_Y_MODIFY,val)
881#define bfin_read_DMA1_11_CURR_DESC_PTR() bfin_read32(DMA1_11_CURR_DESC_PTR)
882#define bfin_write_DMA1_11_CURR_DESC_PTR(val) bfin_write32(DMA1_11_CURR_DESC_PTR,val)
883#define bfin_read_DMA1_11_CURR_ADDR() bfin_read32(DMA1_11_CURR_ADDR)
884#define bfin_write_DMA1_11_CURR_ADDR(val) bfin_write32(DMA1_11_CURR_ADDR,val)
885#define bfin_read_DMA1_11_CURR_X_COUNT() bfin_read16(DMA1_11_CURR_X_COUNT)
886#define bfin_write_DMA1_11_CURR_X_COUNT(val) bfin_write16(DMA1_11_CURR_X_COUNT,val)
887#define bfin_read_DMA1_11_CURR_Y_COUNT() bfin_read16(DMA1_11_CURR_Y_COUNT)
888#define bfin_write_DMA1_11_CURR_Y_COUNT(val) bfin_write16(DMA1_11_CURR_Y_COUNT,val)
889#define bfin_read_DMA1_11_IRQ_STATUS() bfin_read16(DMA1_11_IRQ_STATUS)
890#define bfin_write_DMA1_11_IRQ_STATUS(val) bfin_write16(DMA1_11_IRQ_STATUS,val)
891#define bfin_read_DMA1_11_PERIPHERAL_MAP() bfin_read16(DMA1_11_PERIPHERAL_MAP)
892#define bfin_write_DMA1_11_PERIPHERAL_MAP(val) bfin_write16(DMA1_11_PERIPHERAL_MAP,val)
893/* Memory DMA1 Controller registers (0xFFC0 1E80-0xFFC0 1FFF) */
894#define bfin_read_MDMA1_D0_CONFIG() bfin_read16(MDMA1_D0_CONFIG)
895#define bfin_write_MDMA1_D0_CONFIG(val) bfin_write16(MDMA1_D0_CONFIG,val)
896#define bfin_read_MDMA1_D0_NEXT_DESC_PTR() bfin_read32(MDMA1_D0_NEXT_DESC_PTR)
897#define bfin_write_MDMA1_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA1_D0_NEXT_DESC_PTR,val)
898#define bfin_read_MDMA1_D0_START_ADDR() bfin_read32(MDMA1_D0_START_ADDR)
899#define bfin_write_MDMA1_D0_START_ADDR(val) bfin_write32(MDMA1_D0_START_ADDR,val)
900#define bfin_read_MDMA1_D0_X_COUNT() bfin_read16(MDMA1_D0_X_COUNT)
901#define bfin_write_MDMA1_D0_X_COUNT(val) bfin_write16(MDMA1_D0_X_COUNT,val)
902#define bfin_read_MDMA1_D0_Y_COUNT() bfin_read16(MDMA1_D0_Y_COUNT)
903#define bfin_write_MDMA1_D0_Y_COUNT(val) bfin_write16(MDMA1_D0_Y_COUNT,val)
904#define bfin_read_MDMA1_D0_X_MODIFY() bfin_read16(MDMA1_D0_X_MODIFY)
905#define bfin_write_MDMA1_D0_X_MODIFY(val) bfin_write16(MDMA1_D0_X_MODIFY,val)
906#define bfin_read_MDMA1_D0_Y_MODIFY() bfin_read16(MDMA1_D0_Y_MODIFY)
907#define bfin_write_MDMA1_D0_Y_MODIFY(val) bfin_write16(MDMA1_D0_Y_MODIFY,val)
908#define bfin_read_MDMA1_D0_CURR_DESC_PTR() bfin_read32(MDMA1_D0_CURR_DESC_PTR)
909#define bfin_write_MDMA1_D0_CURR_DESC_PTR(val) bfin_write32(MDMA1_D0_CURR_DESC_PTR,val)
910#define bfin_read_MDMA1_D0_CURR_ADDR() bfin_read32(MDMA1_D0_CURR_ADDR)
911#define bfin_write_MDMA1_D0_CURR_ADDR(val) bfin_write32(MDMA1_D0_CURR_ADDR,val)
912#define bfin_read_MDMA1_D0_CURR_X_COUNT() bfin_read16(MDMA1_D0_CURR_X_COUNT)
913#define bfin_write_MDMA1_D0_CURR_X_COUNT(val) bfin_write16(MDMA1_D0_CURR_X_COUNT,val)
914#define bfin_read_MDMA1_D0_CURR_Y_COUNT() bfin_read16(MDMA1_D0_CURR_Y_COUNT)
915#define bfin_write_MDMA1_D0_CURR_Y_COUNT(val) bfin_write16(MDMA1_D0_CURR_Y_COUNT,val)
916#define bfin_read_MDMA1_D0_IRQ_STATUS() bfin_read16(MDMA1_D0_IRQ_STATUS)
917#define bfin_write_MDMA1_D0_IRQ_STATUS(val) bfin_write16(MDMA1_D0_IRQ_STATUS,val)
918#define bfin_read_MDMA1_D0_PERIPHERAL_MAP() bfin_read16(MDMA1_D0_PERIPHERAL_MAP)
919#define bfin_write_MDMA1_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA1_D0_PERIPHERAL_MAP,val)
920#define bfin_read_MDMA1_S0_CONFIG() bfin_read16(MDMA1_S0_CONFIG)
921#define bfin_write_MDMA1_S0_CONFIG(val) bfin_write16(MDMA1_S0_CONFIG,val)
922#define bfin_read_MDMA1_S0_NEXT_DESC_PTR() bfin_read32(MDMA1_S0_NEXT_DESC_PTR)
923#define bfin_write_MDMA1_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA1_S0_NEXT_DESC_PTR,val)
924#define bfin_read_MDMA1_S0_START_ADDR() bfin_read32(MDMA1_S0_START_ADDR)
925#define bfin_write_MDMA1_S0_START_ADDR(val) bfin_write32(MDMA1_S0_START_ADDR,val)
926#define bfin_read_MDMA1_S0_X_COUNT() bfin_read16(MDMA1_S0_X_COUNT)
927#define bfin_write_MDMA1_S0_X_COUNT(val) bfin_write16(MDMA1_S0_X_COUNT,val)
928#define bfin_read_MDMA1_S0_Y_COUNT() bfin_read16(MDMA1_S0_Y_COUNT)
929#define bfin_write_MDMA1_S0_Y_COUNT(val) bfin_write16(MDMA1_S0_Y_COUNT,val)
930#define bfin_read_MDMA1_S0_X_MODIFY() bfin_read16(MDMA1_S0_X_MODIFY)
931#define bfin_write_MDMA1_S0_X_MODIFY(val) bfin_write16(MDMA1_S0_X_MODIFY,val)
932#define bfin_read_MDMA1_S0_Y_MODIFY() bfin_read16(MDMA1_S0_Y_MODIFY)
933#define bfin_write_MDMA1_S0_Y_MODIFY(val) bfin_write16(MDMA1_S0_Y_MODIFY,val)
934#define bfin_read_MDMA1_S0_CURR_DESC_PTR() bfin_read32(MDMA1_S0_CURR_DESC_PTR)
935#define bfin_write_MDMA1_S0_CURR_DESC_PTR(val) bfin_write32(MDMA1_S0_CURR_DESC_PTR,val)
936#define bfin_read_MDMA1_S0_CURR_ADDR() bfin_read32(MDMA1_S0_CURR_ADDR)
937#define bfin_write_MDMA1_S0_CURR_ADDR(val) bfin_write32(MDMA1_S0_CURR_ADDR,val)
938#define bfin_read_MDMA1_S0_CURR_X_COUNT() bfin_read16(MDMA1_S0_CURR_X_COUNT)
939#define bfin_write_MDMA1_S0_CURR_X_COUNT(val) bfin_write16(MDMA1_S0_CURR_X_COUNT,val)
940#define bfin_read_MDMA1_S0_CURR_Y_COUNT() bfin_read16(MDMA1_S0_CURR_Y_COUNT)
941#define bfin_write_MDMA1_S0_CURR_Y_COUNT(val) bfin_write16(MDMA1_S0_CURR_Y_COUNT,val)
942#define bfin_read_MDMA1_S0_IRQ_STATUS() bfin_read16(MDMA1_S0_IRQ_STATUS)
943#define bfin_write_MDMA1_S0_IRQ_STATUS(val) bfin_write16(MDMA1_S0_IRQ_STATUS,val)
944#define bfin_read_MDMA1_S0_PERIPHERAL_MAP() bfin_read16(MDMA1_S0_PERIPHERAL_MAP)
945#define bfin_write_MDMA1_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA1_S0_PERIPHERAL_MAP,val)
946#define bfin_read_MDMA1_D1_CONFIG() bfin_read16(MDMA1_D1_CONFIG)
947#define bfin_write_MDMA1_D1_CONFIG(val) bfin_write16(MDMA1_D1_CONFIG,val)
948#define bfin_read_MDMA1_D1_NEXT_DESC_PTR() bfin_read32(MDMA1_D1_NEXT_DESC_PTR)
949#define bfin_write_MDMA1_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA1_D1_NEXT_DESC_PTR,val)
950#define bfin_read_MDMA1_D1_START_ADDR() bfin_read32(MDMA1_D1_START_ADDR)
951#define bfin_write_MDMA1_D1_START_ADDR(val) bfin_write32(MDMA1_D1_START_ADDR,val)
952#define bfin_read_MDMA1_D1_X_COUNT() bfin_read16(MDMA1_D1_X_COUNT)
953#define bfin_write_MDMA1_D1_X_COUNT(val) bfin_write16(MDMA1_D1_X_COUNT,val)
954#define bfin_read_MDMA1_D1_Y_COUNT() bfin_read16(MDMA1_D1_Y_COUNT)
955#define bfin_write_MDMA1_D1_Y_COUNT(val) bfin_write16(MDMA1_D1_Y_COUNT,val)
956#define bfin_read_MDMA1_D1_X_MODIFY() bfin_read16(MDMA1_D1_X_MODIFY)
957#define bfin_write_MDMA1_D1_X_MODIFY(val) bfin_write16(MDMA1_D1_X_MODIFY,val)
958#define bfin_read_MDMA1_D1_Y_MODIFY() bfin_read16(MDMA1_D1_Y_MODIFY)
959#define bfin_write_MDMA1_D1_Y_MODIFY(val) bfin_write16(MDMA1_D1_Y_MODIFY,val)
960#define bfin_read_MDMA1_D1_CURR_DESC_PTR() bfin_read32(MDMA1_D1_CURR_DESC_PTR)
961#define bfin_write_MDMA1_D1_CURR_DESC_PTR(val) bfin_write32(MDMA1_D1_CURR_DESC_PTR,val)
962#define bfin_read_MDMA1_D1_CURR_ADDR() bfin_read32(MDMA1_D1_CURR_ADDR)
963#define bfin_write_MDMA1_D1_CURR_ADDR(val) bfin_write32(MDMA1_D1_CURR_ADDR,val)
964#define bfin_read_MDMA1_D1_CURR_X_COUNT() bfin_read16(MDMA1_D1_CURR_X_COUNT)
965#define bfin_write_MDMA1_D1_CURR_X_COUNT(val) bfin_write16(MDMA1_D1_CURR_X_COUNT,val)
966#define bfin_read_MDMA1_D1_CURR_Y_COUNT() bfin_read16(MDMA1_D1_CURR_Y_COUNT)
967#define bfin_write_MDMA1_D1_CURR_Y_COUNT(val) bfin_write16(MDMA1_D1_CURR_Y_COUNT,val)
968#define bfin_read_MDMA1_D1_IRQ_STATUS() bfin_read16(MDMA1_D1_IRQ_STATUS)
969#define bfin_write_MDMA1_D1_IRQ_STATUS(val) bfin_write16(MDMA1_D1_IRQ_STATUS,val)
970#define bfin_read_MDMA1_D1_PERIPHERAL_MAP() bfin_read16(MDMA1_D1_PERIPHERAL_MAP)
971#define bfin_write_MDMA1_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA1_D1_PERIPHERAL_MAP,val)
972#define bfin_read_MDMA1_S1_CONFIG() bfin_read16(MDMA1_S1_CONFIG)
973#define bfin_write_MDMA1_S1_CONFIG(val) bfin_write16(MDMA1_S1_CONFIG,val)
974#define bfin_read_MDMA1_S1_NEXT_DESC_PTR() bfin_read32(MDMA1_S1_NEXT_DESC_PTR)
975#define bfin_write_MDMA1_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA1_S1_NEXT_DESC_PTR,val)
976#define bfin_read_MDMA1_S1_START_ADDR() bfin_read32(MDMA1_S1_START_ADDR)
977#define bfin_write_MDMA1_S1_START_ADDR(val) bfin_write32(MDMA1_S1_START_ADDR,val)
978#define bfin_read_MDMA1_S1_X_COUNT() bfin_read16(MDMA1_S1_X_COUNT)
979#define bfin_write_MDMA1_S1_X_COUNT(val) bfin_write16(MDMA1_S1_X_COUNT,val)
980#define bfin_read_MDMA1_S1_Y_COUNT() bfin_read16(MDMA1_S1_Y_COUNT)
981#define bfin_write_MDMA1_S1_Y_COUNT(val) bfin_write16(MDMA1_S1_Y_COUNT,val)
982#define bfin_read_MDMA1_S1_X_MODIFY() bfin_read16(MDMA1_S1_X_MODIFY)
983#define bfin_write_MDMA1_S1_X_MODIFY(val) bfin_write16(MDMA1_S1_X_MODIFY,val)
984#define bfin_read_MDMA1_S1_Y_MODIFY() bfin_read16(MDMA1_S1_Y_MODIFY)
985#define bfin_write_MDMA1_S1_Y_MODIFY(val) bfin_write16(MDMA1_S1_Y_MODIFY,val)
986#define bfin_read_MDMA1_S1_CURR_DESC_PTR() bfin_read32(MDMA1_S1_CURR_DESC_PTR)
987#define bfin_write_MDMA1_S1_CURR_DESC_PTR(val) bfin_write32(MDMA1_S1_CURR_DESC_PTR,val)
988#define bfin_read_MDMA1_S1_CURR_ADDR() bfin_read32(MDMA1_S1_CURR_ADDR)
989#define bfin_write_MDMA1_S1_CURR_ADDR(val) bfin_write32(MDMA1_S1_CURR_ADDR,val)
990#define bfin_read_MDMA1_S1_CURR_X_COUNT() bfin_read16(MDMA1_S1_CURR_X_COUNT)
991#define bfin_write_MDMA1_S1_CURR_X_COUNT(val) bfin_write16(MDMA1_S1_CURR_X_COUNT,val)
992#define bfin_read_MDMA1_S1_CURR_Y_COUNT() bfin_read16(MDMA1_S1_CURR_Y_COUNT)
993#define bfin_write_MDMA1_S1_CURR_Y_COUNT(val) bfin_write16(MDMA1_S1_CURR_Y_COUNT,val)
994#define bfin_read_MDMA1_S1_IRQ_STATUS() bfin_read16(MDMA1_S1_IRQ_STATUS)
995#define bfin_write_MDMA1_S1_IRQ_STATUS(val) bfin_write16(MDMA1_S1_IRQ_STATUS,val)
996#define bfin_read_MDMA1_S1_PERIPHERAL_MAP() bfin_read16(MDMA1_S1_PERIPHERAL_MAP)
997#define bfin_write_MDMA1_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA1_S1_PERIPHERAL_MAP,val)
998/* DMA2 Controller registers (0xFFC0 0C00-0xFFC0 0DFF) */
999#define bfin_read_DMA2_0_CONFIG() bfin_read16(DMA2_0_CONFIG)
1000#define bfin_write_DMA2_0_CONFIG(val) bfin_write16(DMA2_0_CONFIG,val)
1001#define bfin_read_DMA2_0_NEXT_DESC_PTR() bfin_read32(DMA2_0_NEXT_DESC_PTR)
1002#define bfin_write_DMA2_0_NEXT_DESC_PTR(val) bfin_write32(DMA2_0_NEXT_DESC_PTR,val)
1003#define bfin_read_DMA2_0_START_ADDR() bfin_read32(DMA2_0_START_ADDR)
1004#define bfin_write_DMA2_0_START_ADDR(val) bfin_write32(DMA2_0_START_ADDR,val)
1005#define bfin_read_DMA2_0_X_COUNT() bfin_read16(DMA2_0_X_COUNT)
1006#define bfin_write_DMA2_0_X_COUNT(val) bfin_write16(DMA2_0_X_COUNT,val)
1007#define bfin_read_DMA2_0_Y_COUNT() bfin_read16(DMA2_0_Y_COUNT)
1008#define bfin_write_DMA2_0_Y_COUNT(val) bfin_write16(DMA2_0_Y_COUNT,val)
1009#define bfin_read_DMA2_0_X_MODIFY() bfin_read16(DMA2_0_X_MODIFY)
1010#define bfin_write_DMA2_0_X_MODIFY(val) bfin_write16(DMA2_0_X_MODIFY,val)
1011#define bfin_read_DMA2_0_Y_MODIFY() bfin_read16(DMA2_0_Y_MODIFY)
1012#define bfin_write_DMA2_0_Y_MODIFY(val) bfin_write16(DMA2_0_Y_MODIFY,val)
1013#define bfin_read_DMA2_0_CURR_DESC_PTR() bfin_read32(DMA2_0_CURR_DESC_PTR)
1014#define bfin_write_DMA2_0_CURR_DESC_PTR(val) bfin_write32(DMA2_0_CURR_DESC_PTR,val)
1015#define bfin_read_DMA2_0_CURR_ADDR() bfin_read32(DMA2_0_CURR_ADDR)
1016#define bfin_write_DMA2_0_CURR_ADDR(val) bfin_write32(DMA2_0_CURR_ADDR,val)
1017#define bfin_read_DMA2_0_CURR_X_COUNT() bfin_read16(DMA2_0_CURR_X_COUNT)
1018#define bfin_write_DMA2_0_CURR_X_COUNT(val) bfin_write16(DMA2_0_CURR_X_COUNT,val)
1019#define bfin_read_DMA2_0_CURR_Y_COUNT() bfin_read16(DMA2_0_CURR_Y_COUNT)
1020#define bfin_write_DMA2_0_CURR_Y_COUNT(val) bfin_write16(DMA2_0_CURR_Y_COUNT,val)
1021#define bfin_read_DMA2_0_IRQ_STATUS() bfin_read16(DMA2_0_IRQ_STATUS)
1022#define bfin_write_DMA2_0_IRQ_STATUS(val) bfin_write16(DMA2_0_IRQ_STATUS,val)
1023#define bfin_read_DMA2_0_PERIPHERAL_MAP() bfin_read16(DMA2_0_PERIPHERAL_MAP)
1024#define bfin_write_DMA2_0_PERIPHERAL_MAP(val) bfin_write16(DMA2_0_PERIPHERAL_MAP,val)
1025#define bfin_read_DMA2_1_CONFIG() bfin_read16(DMA2_1_CONFIG)
1026#define bfin_write_DMA2_1_CONFIG(val) bfin_write16(DMA2_1_CONFIG,val)
1027#define bfin_read_DMA2_1_NEXT_DESC_PTR() bfin_read32(DMA2_1_NEXT_DESC_PTR)
1028#define bfin_write_DMA2_1_NEXT_DESC_PTR(val) bfin_write32(DMA2_1_NEXT_DESC_PTR,val)
1029#define bfin_read_DMA2_1_START_ADDR() bfin_read32(DMA2_1_START_ADDR)
1030#define bfin_write_DMA2_1_START_ADDR(val) bfin_write32(DMA2_1_START_ADDR,val)
1031#define bfin_read_DMA2_1_X_COUNT() bfin_read16(DMA2_1_X_COUNT)
1032#define bfin_write_DMA2_1_X_COUNT(val) bfin_write16(DMA2_1_X_COUNT,val)
1033#define bfin_read_DMA2_1_Y_COUNT() bfin_read16(DMA2_1_Y_COUNT)
1034#define bfin_write_DMA2_1_Y_COUNT(val) bfin_write16(DMA2_1_Y_COUNT,val)
1035#define bfin_read_DMA2_1_X_MODIFY() bfin_read16(DMA2_1_X_MODIFY)
1036#define bfin_write_DMA2_1_X_MODIFY(val) bfin_write16(DMA2_1_X_MODIFY,val)
1037#define bfin_read_DMA2_1_Y_MODIFY() bfin_read16(DMA2_1_Y_MODIFY)
1038#define bfin_write_DMA2_1_Y_MODIFY(val) bfin_write16(DMA2_1_Y_MODIFY,val)
1039#define bfin_read_DMA2_1_CURR_DESC_PTR() bfin_read32(DMA2_1_CURR_DESC_PTR)
1040#define bfin_write_DMA2_1_CURR_DESC_PTR(val) bfin_write32(DMA2_1_CURR_DESC_PTR,val)
1041#define bfin_read_DMA2_1_CURR_ADDR() bfin_read32(DMA2_1_CURR_ADDR)
1042#define bfin_write_DMA2_1_CURR_ADDR(val) bfin_write32(DMA2_1_CURR_ADDR,val)
1043#define bfin_read_DMA2_1_CURR_X_COUNT() bfin_read16(DMA2_1_CURR_X_COUNT)
1044#define bfin_write_DMA2_1_CURR_X_COUNT(val) bfin_write16(DMA2_1_CURR_X_COUNT,val)
1045#define bfin_read_DMA2_1_CURR_Y_COUNT() bfin_read16(DMA2_1_CURR_Y_COUNT)
1046#define bfin_write_DMA2_1_CURR_Y_COUNT(val) bfin_write16(DMA2_1_CURR_Y_COUNT,val)
1047#define bfin_read_DMA2_1_IRQ_STATUS() bfin_read16(DMA2_1_IRQ_STATUS)
1048#define bfin_write_DMA2_1_IRQ_STATUS(val) bfin_write16(DMA2_1_IRQ_STATUS,val)
1049#define bfin_read_DMA2_1_PERIPHERAL_MAP() bfin_read16(DMA2_1_PERIPHERAL_MAP)
1050#define bfin_write_DMA2_1_PERIPHERAL_MAP(val) bfin_write16(DMA2_1_PERIPHERAL_MAP,val)
1051#define bfin_read_DMA2_2_CONFIG() bfin_read16(DMA2_2_CONFIG)
1052#define bfin_write_DMA2_2_CONFIG(val) bfin_write16(DMA2_2_CONFIG,val)
1053#define bfin_read_DMA2_2_NEXT_DESC_PTR() bfin_read32(DMA2_2_NEXT_DESC_PTR)
1054#define bfin_write_DMA2_2_NEXT_DESC_PTR(val) bfin_write32(DMA2_2_NEXT_DESC_PTR,val)
1055#define bfin_read_DMA2_2_START_ADDR() bfin_read32(DMA2_2_START_ADDR)
1056#define bfin_write_DMA2_2_START_ADDR(val) bfin_write32(DMA2_2_START_ADDR,val)
1057#define bfin_read_DMA2_2_X_COUNT() bfin_read16(DMA2_2_X_COUNT)
1058#define bfin_write_DMA2_2_X_COUNT(val) bfin_write16(DMA2_2_X_COUNT,val)
1059#define bfin_read_DMA2_2_Y_COUNT() bfin_read16(DMA2_2_Y_COUNT)
1060#define bfin_write_DMA2_2_Y_COUNT(val) bfin_write16(DMA2_2_Y_COUNT,val)
1061#define bfin_read_DMA2_2_X_MODIFY() bfin_read16(DMA2_2_X_MODIFY)
1062#define bfin_write_DMA2_2_X_MODIFY(val) bfin_write16(DMA2_2_X_MODIFY,val)
1063#define bfin_read_DMA2_2_Y_MODIFY() bfin_read16(DMA2_2_Y_MODIFY)
1064#define bfin_write_DMA2_2_Y_MODIFY(val) bfin_write16(DMA2_2_Y_MODIFY,val)
1065#define bfin_read_DMA2_2_CURR_DESC_PTR() bfin_read32(DMA2_2_CURR_DESC_PTR)
1066#define bfin_write_DMA2_2_CURR_DESC_PTR(val) bfin_write32(DMA2_2_CURR_DESC_PTR,val)
1067#define bfin_read_DMA2_2_CURR_ADDR() bfin_read32(DMA2_2_CURR_ADDR)
1068#define bfin_write_DMA2_2_CURR_ADDR(val) bfin_write32(DMA2_2_CURR_ADDR,val)
1069#define bfin_read_DMA2_2_CURR_X_COUNT() bfin_read16(DMA2_2_CURR_X_COUNT)
1070#define bfin_write_DMA2_2_CURR_X_COUNT(val) bfin_write16(DMA2_2_CURR_X_COUNT,val)
1071#define bfin_read_DMA2_2_CURR_Y_COUNT() bfin_read16(DMA2_2_CURR_Y_COUNT)
1072#define bfin_write_DMA2_2_CURR_Y_COUNT(val) bfin_write16(DMA2_2_CURR_Y_COUNT,val)
1073#define bfin_read_DMA2_2_IRQ_STATUS() bfin_read16(DMA2_2_IRQ_STATUS)
1074#define bfin_write_DMA2_2_IRQ_STATUS(val) bfin_write16(DMA2_2_IRQ_STATUS,val)
1075#define bfin_read_DMA2_2_PERIPHERAL_MAP() bfin_read16(DMA2_2_PERIPHERAL_MAP)
1076#define bfin_write_DMA2_2_PERIPHERAL_MAP(val) bfin_write16(DMA2_2_PERIPHERAL_MAP,val)
1077#define bfin_read_DMA2_3_CONFIG() bfin_read16(DMA2_3_CONFIG)
1078#define bfin_write_DMA2_3_CONFIG(val) bfin_write16(DMA2_3_CONFIG,val)
1079#define bfin_read_DMA2_3_NEXT_DESC_PTR() bfin_read32(DMA2_3_NEXT_DESC_PTR)
1080#define bfin_write_DMA2_3_NEXT_DESC_PTR(val) bfin_write32(DMA2_3_NEXT_DESC_PTR,val)
1081#define bfin_read_DMA2_3_START_ADDR() bfin_read32(DMA2_3_START_ADDR)
1082#define bfin_write_DMA2_3_START_ADDR(val) bfin_write32(DMA2_3_START_ADDR,val)
1083#define bfin_read_DMA2_3_X_COUNT() bfin_read16(DMA2_3_X_COUNT)
1084#define bfin_write_DMA2_3_X_COUNT(val) bfin_write16(DMA2_3_X_COUNT,val)
1085#define bfin_read_DMA2_3_Y_COUNT() bfin_read16(DMA2_3_Y_COUNT)
1086#define bfin_write_DMA2_3_Y_COUNT(val) bfin_write16(DMA2_3_Y_COUNT,val)
1087#define bfin_read_DMA2_3_X_MODIFY() bfin_read16(DMA2_3_X_MODIFY)
1088#define bfin_write_DMA2_3_X_MODIFY(val) bfin_write16(DMA2_3_X_MODIFY,val)
1089#define bfin_read_DMA2_3_Y_MODIFY() bfin_read16(DMA2_3_Y_MODIFY)
1090#define bfin_write_DMA2_3_Y_MODIFY(val) bfin_write16(DMA2_3_Y_MODIFY,val)
1091#define bfin_read_DMA2_3_CURR_DESC_PTR() bfin_read32(DMA2_3_CURR_DESC_PTR)
1092#define bfin_write_DMA2_3_CURR_DESC_PTR(val) bfin_write32(DMA2_3_CURR_DESC_PTR,val)
1093#define bfin_read_DMA2_3_CURR_ADDR() bfin_read32(DMA2_3_CURR_ADDR)
1094#define bfin_write_DMA2_3_CURR_ADDR(val) bfin_write32(DMA2_3_CURR_ADDR,val)
1095#define bfin_read_DMA2_3_CURR_X_COUNT() bfin_read16(DMA2_3_CURR_X_COUNT)
1096#define bfin_write_DMA2_3_CURR_X_COUNT(val) bfin_write16(DMA2_3_CURR_X_COUNT,val)
1097#define bfin_read_DMA2_3_CURR_Y_COUNT() bfin_read16(DMA2_3_CURR_Y_COUNT)
1098#define bfin_write_DMA2_3_CURR_Y_COUNT(val) bfin_write16(DMA2_3_CURR_Y_COUNT,val)
1099#define bfin_read_DMA2_3_IRQ_STATUS() bfin_read16(DMA2_3_IRQ_STATUS)
1100#define bfin_write_DMA2_3_IRQ_STATUS(val) bfin_write16(DMA2_3_IRQ_STATUS,val)
1101#define bfin_read_DMA2_3_PERIPHERAL_MAP() bfin_read16(DMA2_3_PERIPHERAL_MAP)
1102#define bfin_write_DMA2_3_PERIPHERAL_MAP(val) bfin_write16(DMA2_3_PERIPHERAL_MAP,val)
1103#define bfin_read_DMA2_4_CONFIG() bfin_read16(DMA2_4_CONFIG)
1104#define bfin_write_DMA2_4_CONFIG(val) bfin_write16(DMA2_4_CONFIG,val)
1105#define bfin_read_DMA2_4_NEXT_DESC_PTR() bfin_read32(DMA2_4_NEXT_DESC_PTR)
1106#define bfin_write_DMA2_4_NEXT_DESC_PTR(val) bfin_write32(DMA2_4_NEXT_DESC_PTR,val)
1107#define bfin_read_DMA2_4_START_ADDR() bfin_read32(DMA2_4_START_ADDR)
1108#define bfin_write_DMA2_4_START_ADDR(val) bfin_write32(DMA2_4_START_ADDR,val)
1109#define bfin_read_DMA2_4_X_COUNT() bfin_read16(DMA2_4_X_COUNT)
1110#define bfin_write_DMA2_4_X_COUNT(val) bfin_write16(DMA2_4_X_COUNT,val)
1111#define bfin_read_DMA2_4_Y_COUNT() bfin_read16(DMA2_4_Y_COUNT)
1112#define bfin_write_DMA2_4_Y_COUNT(val) bfin_write16(DMA2_4_Y_COUNT,val)
1113#define bfin_read_DMA2_4_X_MODIFY() bfin_read16(DMA2_4_X_MODIFY)
1114#define bfin_write_DMA2_4_X_MODIFY(val) bfin_write16(DMA2_4_X_MODIFY,val)
1115#define bfin_read_DMA2_4_Y_MODIFY() bfin_read16(DMA2_4_Y_MODIFY)
1116#define bfin_write_DMA2_4_Y_MODIFY(val) bfin_write16(DMA2_4_Y_MODIFY,val)
1117#define bfin_read_DMA2_4_CURR_DESC_PTR() bfin_read32(DMA2_4_CURR_DESC_PTR)
1118#define bfin_write_DMA2_4_CURR_DESC_PTR(val) bfin_write32(DMA2_4_CURR_DESC_PTR,val)
1119#define bfin_read_DMA2_4_CURR_ADDR() bfin_read32(DMA2_4_CURR_ADDR)
1120#define bfin_write_DMA2_4_CURR_ADDR(val) bfin_write32(DMA2_4_CURR_ADDR,val)
1121#define bfin_read_DMA2_4_CURR_X_COUNT() bfin_read16(DMA2_4_CURR_X_COUNT)
1122#define bfin_write_DMA2_4_CURR_X_COUNT(val) bfin_write16(DMA2_4_CURR_X_COUNT,val)
1123#define bfin_read_DMA2_4_CURR_Y_COUNT() bfin_read16(DMA2_4_CURR_Y_COUNT)
1124#define bfin_write_DMA2_4_CURR_Y_COUNT(val) bfin_write16(DMA2_4_CURR_Y_COUNT,val)
1125#define bfin_read_DMA2_4_IRQ_STATUS() bfin_read16(DMA2_4_IRQ_STATUS)
1126#define bfin_write_DMA2_4_IRQ_STATUS(val) bfin_write16(DMA2_4_IRQ_STATUS,val)
1127#define bfin_read_DMA2_4_PERIPHERAL_MAP() bfin_read16(DMA2_4_PERIPHERAL_MAP)
1128#define bfin_write_DMA2_4_PERIPHERAL_MAP(val) bfin_write16(DMA2_4_PERIPHERAL_MAP,val)
1129#define bfin_read_DMA2_5_CONFIG() bfin_read16(DMA2_5_CONFIG)
1130#define bfin_write_DMA2_5_CONFIG(val) bfin_write16(DMA2_5_CONFIG,val)
1131#define bfin_read_DMA2_5_NEXT_DESC_PTR() bfin_read32(DMA2_5_NEXT_DESC_PTR)
1132#define bfin_write_DMA2_5_NEXT_DESC_PTR(val) bfin_write32(DMA2_5_NEXT_DESC_PTR,val)
1133#define bfin_read_DMA2_5_START_ADDR() bfin_read32(DMA2_5_START_ADDR)
1134#define bfin_write_DMA2_5_START_ADDR(val) bfin_write32(DMA2_5_START_ADDR,val)
1135#define bfin_read_DMA2_5_X_COUNT() bfin_read16(DMA2_5_X_COUNT)
1136#define bfin_write_DMA2_5_X_COUNT(val) bfin_write16(DMA2_5_X_COUNT,val)
1137#define bfin_read_DMA2_5_Y_COUNT() bfin_read16(DMA2_5_Y_COUNT)
1138#define bfin_write_DMA2_5_Y_COUNT(val) bfin_write16(DMA2_5_Y_COUNT,val)
1139#define bfin_read_DMA2_5_X_MODIFY() bfin_read16(DMA2_5_X_MODIFY)
1140#define bfin_write_DMA2_5_X_MODIFY(val) bfin_write16(DMA2_5_X_MODIFY,val)
1141#define bfin_read_DMA2_5_Y_MODIFY() bfin_read16(DMA2_5_Y_MODIFY)
1142#define bfin_write_DMA2_5_Y_MODIFY(val) bfin_write16(DMA2_5_Y_MODIFY,val)
1143#define bfin_read_DMA2_5_CURR_DESC_PTR() bfin_read32(DMA2_5_CURR_DESC_PTR)
1144#define bfin_write_DMA2_5_CURR_DESC_PTR(val) bfin_write32(DMA2_5_CURR_DESC_PTR,val)
1145#define bfin_read_DMA2_5_CURR_ADDR() bfin_read32(DMA2_5_CURR_ADDR)
1146#define bfin_write_DMA2_5_CURR_ADDR(val) bfin_write32(DMA2_5_CURR_ADDR,val)
1147#define bfin_read_DMA2_5_CURR_X_COUNT() bfin_read16(DMA2_5_CURR_X_COUNT)
1148#define bfin_write_DMA2_5_CURR_X_COUNT(val) bfin_write16(DMA2_5_CURR_X_COUNT,val)
1149#define bfin_read_DMA2_5_CURR_Y_COUNT() bfin_read16(DMA2_5_CURR_Y_COUNT)
1150#define bfin_write_DMA2_5_CURR_Y_COUNT(val) bfin_write16(DMA2_5_CURR_Y_COUNT,val)
1151#define bfin_read_DMA2_5_IRQ_STATUS() bfin_read16(DMA2_5_IRQ_STATUS)
1152#define bfin_write_DMA2_5_IRQ_STATUS(val) bfin_write16(DMA2_5_IRQ_STATUS,val)
1153#define bfin_read_DMA2_5_PERIPHERAL_MAP() bfin_read16(DMA2_5_PERIPHERAL_MAP)
1154#define bfin_write_DMA2_5_PERIPHERAL_MAP(val) bfin_write16(DMA2_5_PERIPHERAL_MAP,val)
1155#define bfin_read_DMA2_6_CONFIG() bfin_read16(DMA2_6_CONFIG)
1156#define bfin_write_DMA2_6_CONFIG(val) bfin_write16(DMA2_6_CONFIG,val)
1157#define bfin_read_DMA2_6_NEXT_DESC_PTR() bfin_read32(DMA2_6_NEXT_DESC_PTR)
1158#define bfin_write_DMA2_6_NEXT_DESC_PTR(val) bfin_write32(DMA2_6_NEXT_DESC_PTR,val)
1159#define bfin_read_DMA2_6_START_ADDR() bfin_read32(DMA2_6_START_ADDR)
1160#define bfin_write_DMA2_6_START_ADDR(val) bfin_write32(DMA2_6_START_ADDR,val)
1161#define bfin_read_DMA2_6_X_COUNT() bfin_read16(DMA2_6_X_COUNT)
1162#define bfin_write_DMA2_6_X_COUNT(val) bfin_write16(DMA2_6_X_COUNT,val)
1163#define bfin_read_DMA2_6_Y_COUNT() bfin_read16(DMA2_6_Y_COUNT)
1164#define bfin_write_DMA2_6_Y_COUNT(val) bfin_write16(DMA2_6_Y_COUNT,val)
1165#define bfin_read_DMA2_6_X_MODIFY() bfin_read16(DMA2_6_X_MODIFY)
1166#define bfin_write_DMA2_6_X_MODIFY(val) bfin_write16(DMA2_6_X_MODIFY,val)
1167#define bfin_read_DMA2_6_Y_MODIFY() bfin_read16(DMA2_6_Y_MODIFY)
1168#define bfin_write_DMA2_6_Y_MODIFY(val) bfin_write16(DMA2_6_Y_MODIFY,val)
1169#define bfin_read_DMA2_6_CURR_DESC_PTR() bfin_read32(DMA2_6_CURR_DESC_PTR)
1170#define bfin_write_DMA2_6_CURR_DESC_PTR(val) bfin_write32(DMA2_6_CURR_DESC_PTR,val)
1171#define bfin_read_DMA2_6_CURR_ADDR() bfin_read32(DMA2_6_CURR_ADDR)
1172#define bfin_write_DMA2_6_CURR_ADDR(val) bfin_write32(DMA2_6_CURR_ADDR,val)
1173#define bfin_read_DMA2_6_CURR_X_COUNT() bfin_read16(DMA2_6_CURR_X_COUNT)
1174#define bfin_write_DMA2_6_CURR_X_COUNT(val) bfin_write16(DMA2_6_CURR_X_COUNT,val)
1175#define bfin_read_DMA2_6_CURR_Y_COUNT() bfin_read16(DMA2_6_CURR_Y_COUNT)
1176#define bfin_write_DMA2_6_CURR_Y_COUNT(val) bfin_write16(DMA2_6_CURR_Y_COUNT,val)
1177#define bfin_read_DMA2_6_IRQ_STATUS() bfin_read16(DMA2_6_IRQ_STATUS)
1178#define bfin_write_DMA2_6_IRQ_STATUS(val) bfin_write16(DMA2_6_IRQ_STATUS,val)
1179#define bfin_read_DMA2_6_PERIPHERAL_MAP() bfin_read16(DMA2_6_PERIPHERAL_MAP)
1180#define bfin_write_DMA2_6_PERIPHERAL_MAP(val) bfin_write16(DMA2_6_PERIPHERAL_MAP,val)
1181#define bfin_read_DMA2_7_CONFIG() bfin_read16(DMA2_7_CONFIG)
1182#define bfin_write_DMA2_7_CONFIG(val) bfin_write16(DMA2_7_CONFIG,val)
1183#define bfin_read_DMA2_7_NEXT_DESC_PTR() bfin_read32(DMA2_7_NEXT_DESC_PTR)
1184#define bfin_write_DMA2_7_NEXT_DESC_PTR(val) bfin_write32(DMA2_7_NEXT_DESC_PTR,val)
1185#define bfin_read_DMA2_7_START_ADDR() bfin_read32(DMA2_7_START_ADDR)
1186#define bfin_write_DMA2_7_START_ADDR(val) bfin_write32(DMA2_7_START_ADDR,val)
1187#define bfin_read_DMA2_7_X_COUNT() bfin_read16(DMA2_7_X_COUNT)
1188#define bfin_write_DMA2_7_X_COUNT(val) bfin_write16(DMA2_7_X_COUNT,val)
1189#define bfin_read_DMA2_7_Y_COUNT() bfin_read16(DMA2_7_Y_COUNT)
1190#define bfin_write_DMA2_7_Y_COUNT(val) bfin_write16(DMA2_7_Y_COUNT,val)
1191#define bfin_read_DMA2_7_X_MODIFY() bfin_read16(DMA2_7_X_MODIFY)
1192#define bfin_write_DMA2_7_X_MODIFY(val) bfin_write16(DMA2_7_X_MODIFY,val)
1193#define bfin_read_DMA2_7_Y_MODIFY() bfin_read16(DMA2_7_Y_MODIFY)
1194#define bfin_write_DMA2_7_Y_MODIFY(val) bfin_write16(DMA2_7_Y_MODIFY,val)
1195#define bfin_read_DMA2_7_CURR_DESC_PTR() bfin_read32(DMA2_7_CURR_DESC_PTR)
1196#define bfin_write_DMA2_7_CURR_DESC_PTR(val) bfin_write32(DMA2_7_CURR_DESC_PTR,val)
1197#define bfin_read_DMA2_7_CURR_ADDR() bfin_read32(DMA2_7_CURR_ADDR)
1198#define bfin_write_DMA2_7_CURR_ADDR(val) bfin_write32(DMA2_7_CURR_ADDR,val)
1199#define bfin_read_DMA2_7_CURR_X_COUNT() bfin_read16(DMA2_7_CURR_X_COUNT)
1200#define bfin_write_DMA2_7_CURR_X_COUNT(val) bfin_write16(DMA2_7_CURR_X_COUNT,val)
1201#define bfin_read_DMA2_7_CURR_Y_COUNT() bfin_read16(DMA2_7_CURR_Y_COUNT)
1202#define bfin_write_DMA2_7_CURR_Y_COUNT(val) bfin_write16(DMA2_7_CURR_Y_COUNT,val)
1203#define bfin_read_DMA2_7_IRQ_STATUS() bfin_read16(DMA2_7_IRQ_STATUS)
1204#define bfin_write_DMA2_7_IRQ_STATUS(val) bfin_write16(DMA2_7_IRQ_STATUS,val)
1205#define bfin_read_DMA2_7_PERIPHERAL_MAP() bfin_read16(DMA2_7_PERIPHERAL_MAP)
1206#define bfin_write_DMA2_7_PERIPHERAL_MAP(val) bfin_write16(DMA2_7_PERIPHERAL_MAP,val)
1207#define bfin_read_DMA2_8_CONFIG() bfin_read16(DMA2_8_CONFIG)
1208#define bfin_write_DMA2_8_CONFIG(val) bfin_write16(DMA2_8_CONFIG,val)
1209#define bfin_read_DMA2_8_NEXT_DESC_PTR() bfin_read32(DMA2_8_NEXT_DESC_PTR)
1210#define bfin_write_DMA2_8_NEXT_DESC_PTR(val) bfin_write32(DMA2_8_NEXT_DESC_PTR,val)
1211#define bfin_read_DMA2_8_START_ADDR() bfin_read32(DMA2_8_START_ADDR)
1212#define bfin_write_DMA2_8_START_ADDR(val) bfin_write32(DMA2_8_START_ADDR,val)
1213#define bfin_read_DMA2_8_X_COUNT() bfin_read16(DMA2_8_X_COUNT)
1214#define bfin_write_DMA2_8_X_COUNT(val) bfin_write16(DMA2_8_X_COUNT,val)
1215#define bfin_read_DMA2_8_Y_COUNT() bfin_read16(DMA2_8_Y_COUNT)
1216#define bfin_write_DMA2_8_Y_COUNT(val) bfin_write16(DMA2_8_Y_COUNT,val)
1217#define bfin_read_DMA2_8_X_MODIFY() bfin_read16(DMA2_8_X_MODIFY)
1218#define bfin_write_DMA2_8_X_MODIFY(val) bfin_write16(DMA2_8_X_MODIFY,val)
1219#define bfin_read_DMA2_8_Y_MODIFY() bfin_read16(DMA2_8_Y_MODIFY)
1220#define bfin_write_DMA2_8_Y_MODIFY(val) bfin_write16(DMA2_8_Y_MODIFY,val)
1221#define bfin_read_DMA2_8_CURR_DESC_PTR() bfin_read32(DMA2_8_CURR_DESC_PTR)
1222#define bfin_write_DMA2_8_CURR_DESC_PTR(val) bfin_write32(DMA2_8_CURR_DESC_PTR,val)
1223#define bfin_read_DMA2_8_CURR_ADDR() bfin_read32(DMA2_8_CURR_ADDR)
1224#define bfin_write_DMA2_8_CURR_ADDR(val) bfin_write32(DMA2_8_CURR_ADDR,val)
1225#define bfin_read_DMA2_8_CURR_X_COUNT() bfin_read16(DMA2_8_CURR_X_COUNT)
1226#define bfin_write_DMA2_8_CURR_X_COUNT(val) bfin_write16(DMA2_8_CURR_X_COUNT,val)
1227#define bfin_read_DMA2_8_CURR_Y_COUNT() bfin_read16(DMA2_8_CURR_Y_COUNT)
1228#define bfin_write_DMA2_8_CURR_Y_COUNT(val) bfin_write16(DMA2_8_CURR_Y_COUNT,val)
1229#define bfin_read_DMA2_8_IRQ_STATUS() bfin_read16(DMA2_8_IRQ_STATUS)
1230#define bfin_write_DMA2_8_IRQ_STATUS(val) bfin_write16(DMA2_8_IRQ_STATUS,val)
1231#define bfin_read_DMA2_8_PERIPHERAL_MAP() bfin_read16(DMA2_8_PERIPHERAL_MAP)
1232#define bfin_write_DMA2_8_PERIPHERAL_MAP(val) bfin_write16(DMA2_8_PERIPHERAL_MAP,val)
1233#define bfin_read_DMA2_9_CONFIG() bfin_read16(DMA2_9_CONFIG)
1234#define bfin_write_DMA2_9_CONFIG(val) bfin_write16(DMA2_9_CONFIG,val)
1235#define bfin_read_DMA2_9_NEXT_DESC_PTR() bfin_read32(DMA2_9_NEXT_DESC_PTR)
1236#define bfin_write_DMA2_9_NEXT_DESC_PTR(val) bfin_write32(DMA2_9_NEXT_DESC_PTR,val)
1237#define bfin_read_DMA2_9_START_ADDR() bfin_read32(DMA2_9_START_ADDR)
1238#define bfin_write_DMA2_9_START_ADDR(val) bfin_write32(DMA2_9_START_ADDR,val)
1239#define bfin_read_DMA2_9_X_COUNT() bfin_read16(DMA2_9_X_COUNT)
1240#define bfin_write_DMA2_9_X_COUNT(val) bfin_write16(DMA2_9_X_COUNT,val)
1241#define bfin_read_DMA2_9_Y_COUNT() bfin_read16(DMA2_9_Y_COUNT)
1242#define bfin_write_DMA2_9_Y_COUNT(val) bfin_write16(DMA2_9_Y_COUNT,val)
1243#define bfin_read_DMA2_9_X_MODIFY() bfin_read16(DMA2_9_X_MODIFY)
1244#define bfin_write_DMA2_9_X_MODIFY(val) bfin_write16(DMA2_9_X_MODIFY,val)
1245#define bfin_read_DMA2_9_Y_MODIFY() bfin_read16(DMA2_9_Y_MODIFY)
1246#define bfin_write_DMA2_9_Y_MODIFY(val) bfin_write16(DMA2_9_Y_MODIFY,val)
1247#define bfin_read_DMA2_9_CURR_DESC_PTR() bfin_read32(DMA2_9_CURR_DESC_PTR)
1248#define bfin_write_DMA2_9_CURR_DESC_PTR(val) bfin_write32(DMA2_9_CURR_DESC_PTR,val)
1249#define bfin_read_DMA2_9_CURR_ADDR() bfin_read32(DMA2_9_CURR_ADDR)
1250#define bfin_write_DMA2_9_CURR_ADDR(val) bfin_write32(DMA2_9_CURR_ADDR,val)
1251#define bfin_read_DMA2_9_CURR_X_COUNT() bfin_read16(DMA2_9_CURR_X_COUNT)
1252#define bfin_write_DMA2_9_CURR_X_COUNT(val) bfin_write16(DMA2_9_CURR_X_COUNT,val)
1253#define bfin_read_DMA2_9_CURR_Y_COUNT() bfin_read16(DMA2_9_CURR_Y_COUNT)
1254#define bfin_write_DMA2_9_CURR_Y_COUNT(val) bfin_write16(DMA2_9_CURR_Y_COUNT,val)
1255#define bfin_read_DMA2_9_IRQ_STATUS() bfin_read16(DMA2_9_IRQ_STATUS)
1256#define bfin_write_DMA2_9_IRQ_STATUS(val) bfin_write16(DMA2_9_IRQ_STATUS,val)
1257#define bfin_read_DMA2_9_PERIPHERAL_MAP() bfin_read16(DMA2_9_PERIPHERAL_MAP)
1258#define bfin_write_DMA2_9_PERIPHERAL_MAP(val) bfin_write16(DMA2_9_PERIPHERAL_MAP,val)
1259#define bfin_read_DMA2_10_CONFIG() bfin_read16(DMA2_10_CONFIG)
1260#define bfin_write_DMA2_10_CONFIG(val) bfin_write16(DMA2_10_CONFIG,val)
1261#define bfin_read_DMA2_10_NEXT_DESC_PTR() bfin_read32(DMA2_10_NEXT_DESC_PTR)
1262#define bfin_write_DMA2_10_NEXT_DESC_PTR(val) bfin_write32(DMA2_10_NEXT_DESC_PTR,val)
1263#define bfin_read_DMA2_10_START_ADDR() bfin_read32(DMA2_10_START_ADDR)
1264#define bfin_write_DMA2_10_START_ADDR(val) bfin_write32(DMA2_10_START_ADDR,val)
1265#define bfin_read_DMA2_10_X_COUNT() bfin_read16(DMA2_10_X_COUNT)
1266#define bfin_write_DMA2_10_X_COUNT(val) bfin_write16(DMA2_10_X_COUNT,val)
1267#define bfin_read_DMA2_10_Y_COUNT() bfin_read16(DMA2_10_Y_COUNT)
1268#define bfin_write_DMA2_10_Y_COUNT(val) bfin_write16(DMA2_10_Y_COUNT,val)
1269#define bfin_read_DMA2_10_X_MODIFY() bfin_read16(DMA2_10_X_MODIFY)
1270#define bfin_write_DMA2_10_X_MODIFY(val) bfin_write16(DMA2_10_X_MODIFY,val)
1271#define bfin_read_DMA2_10_Y_MODIFY() bfin_read16(DMA2_10_Y_MODIFY)
1272#define bfin_write_DMA2_10_Y_MODIFY(val) bfin_write16(DMA2_10_Y_MODIFY,val)
1273#define bfin_read_DMA2_10_CURR_DESC_PTR() bfin_read32(DMA2_10_CURR_DESC_PTR)
1274#define bfin_write_DMA2_10_CURR_DESC_PTR(val) bfin_write32(DMA2_10_CURR_DESC_PTR,val)
1275#define bfin_read_DMA2_10_CURR_ADDR() bfin_read32(DMA2_10_CURR_ADDR)
1276#define bfin_write_DMA2_10_CURR_ADDR(val) bfin_write32(DMA2_10_CURR_ADDR,val)
1277#define bfin_read_DMA2_10_CURR_X_COUNT() bfin_read16(DMA2_10_CURR_X_COUNT)
1278#define bfin_write_DMA2_10_CURR_X_COUNT(val) bfin_write16(DMA2_10_CURR_X_COUNT,val)
1279#define bfin_read_DMA2_10_CURR_Y_COUNT() bfin_read16(DMA2_10_CURR_Y_COUNT)
1280#define bfin_write_DMA2_10_CURR_Y_COUNT(val) bfin_write16(DMA2_10_CURR_Y_COUNT,val)
1281#define bfin_read_DMA2_10_IRQ_STATUS() bfin_read16(DMA2_10_IRQ_STATUS)
1282#define bfin_write_DMA2_10_IRQ_STATUS(val) bfin_write16(DMA2_10_IRQ_STATUS,val)
1283#define bfin_read_DMA2_10_PERIPHERAL_MAP() bfin_read16(DMA2_10_PERIPHERAL_MAP)
1284#define bfin_write_DMA2_10_PERIPHERAL_MAP(val) bfin_write16(DMA2_10_PERIPHERAL_MAP,val)
1285#define bfin_read_DMA2_11_CONFIG() bfin_read16(DMA2_11_CONFIG)
1286#define bfin_write_DMA2_11_CONFIG(val) bfin_write16(DMA2_11_CONFIG,val)
1287#define bfin_read_DMA2_11_NEXT_DESC_PTR() bfin_read32(DMA2_11_NEXT_DESC_PTR)
1288#define bfin_write_DMA2_11_NEXT_DESC_PTR(val) bfin_write32(DMA2_11_NEXT_DESC_PTR,val)
1289#define bfin_read_DMA2_11_START_ADDR() bfin_read32(DMA2_11_START_ADDR)
1290#define bfin_write_DMA2_11_START_ADDR(val) bfin_write32(DMA2_11_START_ADDR,val)
1291#define bfin_read_DMA2_11_X_COUNT() bfin_read16(DMA2_11_X_COUNT)
1292#define bfin_write_DMA2_11_X_COUNT(val) bfin_write16(DMA2_11_X_COUNT,val)
1293#define bfin_read_DMA2_11_Y_COUNT() bfin_read16(DMA2_11_Y_COUNT)
1294#define bfin_write_DMA2_11_Y_COUNT(val) bfin_write16(DMA2_11_Y_COUNT,val)
1295#define bfin_read_DMA2_11_X_MODIFY() bfin_read16(DMA2_11_X_MODIFY)
1296#define bfin_write_DMA2_11_X_MODIFY(val) bfin_write16(DMA2_11_X_MODIFY,val)
1297#define bfin_read_DMA2_11_Y_MODIFY() bfin_read16(DMA2_11_Y_MODIFY)
1298#define bfin_write_DMA2_11_Y_MODIFY(val) bfin_write16(DMA2_11_Y_MODIFY,val)
1299#define bfin_read_DMA2_11_CURR_DESC_PTR() bfin_read32(DMA2_11_CURR_DESC_PTR)
1300#define bfin_write_DMA2_11_CURR_DESC_PTR(val) bfin_write32(DMA2_11_CURR_DESC_PTR,val)
1301#define bfin_read_DMA2_11_CURR_ADDR() bfin_read32(DMA2_11_CURR_ADDR)
1302#define bfin_write_DMA2_11_CURR_ADDR(val) bfin_write32(DMA2_11_CURR_ADDR,val)
1303#define bfin_read_DMA2_11_CURR_X_COUNT() bfin_read16(DMA2_11_CURR_X_COUNT)
1304#define bfin_write_DMA2_11_CURR_X_COUNT(val) bfin_write16(DMA2_11_CURR_X_COUNT,val)
1305#define bfin_read_DMA2_11_CURR_Y_COUNT() bfin_read16(DMA2_11_CURR_Y_COUNT)
1306#define bfin_write_DMA2_11_CURR_Y_COUNT(val) bfin_write16(DMA2_11_CURR_Y_COUNT,val)
1307#define bfin_read_DMA2_11_IRQ_STATUS() bfin_read16(DMA2_11_IRQ_STATUS)
1308#define bfin_write_DMA2_11_IRQ_STATUS(val) bfin_write16(DMA2_11_IRQ_STATUS,val)
1309#define bfin_read_DMA2_11_PERIPHERAL_MAP() bfin_read16(DMA2_11_PERIPHERAL_MAP)
1310#define bfin_write_DMA2_11_PERIPHERAL_MAP(val) bfin_write16(DMA2_11_PERIPHERAL_MAP,val)
1311/* Memory DMA2 Controller registers (0xFFC0 0E80-0xFFC0 0FFF) */
1312#define bfin_read_MDMA2_D0_CONFIG() bfin_read16(MDMA2_D0_CONFIG)
1313#define bfin_write_MDMA2_D0_CONFIG(val) bfin_write16(MDMA2_D0_CONFIG,val)
1314#define bfin_read_MDMA2_D0_NEXT_DESC_PTR() bfin_read32(MDMA2_D0_NEXT_DESC_PTR)
1315#define bfin_write_MDMA2_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA2_D0_NEXT_DESC_PTR,val)
1316#define bfin_read_MDMA2_D0_START_ADDR() bfin_read32(MDMA2_D0_START_ADDR)
1317#define bfin_write_MDMA2_D0_START_ADDR(val) bfin_write32(MDMA2_D0_START_ADDR,val)
1318#define bfin_read_MDMA2_D0_X_COUNT() bfin_read16(MDMA2_D0_X_COUNT)
1319#define bfin_write_MDMA2_D0_X_COUNT(val) bfin_write16(MDMA2_D0_X_COUNT,val)
1320#define bfin_read_MDMA2_D0_Y_COUNT() bfin_read16(MDMA2_D0_Y_COUNT)
1321#define bfin_write_MDMA2_D0_Y_COUNT(val) bfin_write16(MDMA2_D0_Y_COUNT,val)
1322#define bfin_read_MDMA2_D0_X_MODIFY() bfin_read16(MDMA2_D0_X_MODIFY)
1323#define bfin_write_MDMA2_D0_X_MODIFY(val) bfin_write16(MDMA2_D0_X_MODIFY,val)
1324#define bfin_read_MDMA2_D0_Y_MODIFY() bfin_read16(MDMA2_D0_Y_MODIFY)
1325#define bfin_write_MDMA2_D0_Y_MODIFY(val) bfin_write16(MDMA2_D0_Y_MODIFY,val)
1326#define bfin_read_MDMA2_D0_CURR_DESC_PTR() bfin_read32(MDMA2_D0_CURR_DESC_PTR)
1327#define bfin_write_MDMA2_D0_CURR_DESC_PTR(val) bfin_write32(MDMA2_D0_CURR_DESC_PTR,val)
1328#define bfin_read_MDMA2_D0_CURR_ADDR() bfin_read32(MDMA2_D0_CURR_ADDR)
1329#define bfin_write_MDMA2_D0_CURR_ADDR(val) bfin_write32(MDMA2_D0_CURR_ADDR,val)
1330#define bfin_read_MDMA2_D0_CURR_X_COUNT() bfin_read16(MDMA2_D0_CURR_X_COUNT)
1331#define bfin_write_MDMA2_D0_CURR_X_COUNT(val) bfin_write16(MDMA2_D0_CURR_X_COUNT,val)
1332#define bfin_read_MDMA2_D0_CURR_Y_COUNT() bfin_read16(MDMA2_D0_CURR_Y_COUNT)
1333#define bfin_write_MDMA2_D0_CURR_Y_COUNT(val) bfin_write16(MDMA2_D0_CURR_Y_COUNT,val)
1334#define bfin_read_MDMA2_D0_IRQ_STATUS() bfin_read16(MDMA2_D0_IRQ_STATUS)
1335#define bfin_write_MDMA2_D0_IRQ_STATUS(val) bfin_write16(MDMA2_D0_IRQ_STATUS,val)
1336#define bfin_read_MDMA2_D0_PERIPHERAL_MAP() bfin_read16(MDMA2_D0_PERIPHERAL_MAP)
1337#define bfin_write_MDMA2_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA2_D0_PERIPHERAL_MAP,val)
1338#define bfin_read_MDMA2_S0_CONFIG() bfin_read16(MDMA2_S0_CONFIG)
1339#define bfin_write_MDMA2_S0_CONFIG(val) bfin_write16(MDMA2_S0_CONFIG,val)
1340#define bfin_read_MDMA2_S0_NEXT_DESC_PTR() bfin_read32(MDMA2_S0_NEXT_DESC_PTR)
1341#define bfin_write_MDMA2_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA2_S0_NEXT_DESC_PTR,val)
1342#define bfin_read_MDMA2_S0_START_ADDR() bfin_read32(MDMA2_S0_START_ADDR)
1343#define bfin_write_MDMA2_S0_START_ADDR(val) bfin_write32(MDMA2_S0_START_ADDR,val)
1344#define bfin_read_MDMA2_S0_X_COUNT() bfin_read16(MDMA2_S0_X_COUNT)
1345#define bfin_write_MDMA2_S0_X_COUNT(val) bfin_write16(MDMA2_S0_X_COUNT,val)
1346#define bfin_read_MDMA2_S0_Y_COUNT() bfin_read16(MDMA2_S0_Y_COUNT)
1347#define bfin_write_MDMA2_S0_Y_COUNT(val) bfin_write16(MDMA2_S0_Y_COUNT,val)
1348#define bfin_read_MDMA2_S0_X_MODIFY() bfin_read16(MDMA2_S0_X_MODIFY)
1349#define bfin_write_MDMA2_S0_X_MODIFY(val) bfin_write16(MDMA2_S0_X_MODIFY,val)
1350#define bfin_read_MDMA2_S0_Y_MODIFY() bfin_read16(MDMA2_S0_Y_MODIFY)
1351#define bfin_write_MDMA2_S0_Y_MODIFY(val) bfin_write16(MDMA2_S0_Y_MODIFY,val)
1352#define bfin_read_MDMA2_S0_CURR_DESC_PTR() bfin_read32(MDMA2_S0_CURR_DESC_PTR)
1353#define bfin_write_MDMA2_S0_CURR_DESC_PTR(val) bfin_write32(MDMA2_S0_CURR_DESC_PTR,val)
1354#define bfin_read_MDMA2_S0_CURR_ADDR() bfin_read32(MDMA2_S0_CURR_ADDR)
1355#define bfin_write_MDMA2_S0_CURR_ADDR(val) bfin_write32(MDMA2_S0_CURR_ADDR,val)
1356#define bfin_read_MDMA2_S0_CURR_X_COUNT() bfin_read16(MDMA2_S0_CURR_X_COUNT)
1357#define bfin_write_MDMA2_S0_CURR_X_COUNT(val) bfin_write16(MDMA2_S0_CURR_X_COUNT,val)
1358#define bfin_read_MDMA2_S0_CURR_Y_COUNT() bfin_read16(MDMA2_S0_CURR_Y_COUNT)
1359#define bfin_write_MDMA2_S0_CURR_Y_COUNT(val) bfin_write16(MDMA2_S0_CURR_Y_COUNT,val)
1360#define bfin_read_MDMA2_S0_IRQ_STATUS() bfin_read16(MDMA2_S0_IRQ_STATUS)
1361#define bfin_write_MDMA2_S0_IRQ_STATUS(val) bfin_write16(MDMA2_S0_IRQ_STATUS,val)
1362#define bfin_read_MDMA2_S0_PERIPHERAL_MAP() bfin_read16(MDMA2_S0_PERIPHERAL_MAP)
1363#define bfin_write_MDMA2_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA2_S0_PERIPHERAL_MAP,val)
1364#define bfin_read_MDMA2_D1_CONFIG() bfin_read16(MDMA2_D1_CONFIG)
1365#define bfin_write_MDMA2_D1_CONFIG(val) bfin_write16(MDMA2_D1_CONFIG,val)
1366#define bfin_read_MDMA2_D1_NEXT_DESC_PTR() bfin_read32(MDMA2_D1_NEXT_DESC_PTR)
1367#define bfin_write_MDMA2_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA2_D1_NEXT_DESC_PTR,val)
1368#define bfin_read_MDMA2_D1_START_ADDR() bfin_read32(MDMA2_D1_START_ADDR)
1369#define bfin_write_MDMA2_D1_START_ADDR(val) bfin_write32(MDMA2_D1_START_ADDR,val)
1370#define bfin_read_MDMA2_D1_X_COUNT() bfin_read16(MDMA2_D1_X_COUNT)
1371#define bfin_write_MDMA2_D1_X_COUNT(val) bfin_write16(MDMA2_D1_X_COUNT,val)
1372#define bfin_read_MDMA2_D1_Y_COUNT() bfin_read16(MDMA2_D1_Y_COUNT)
1373#define bfin_write_MDMA2_D1_Y_COUNT(val) bfin_write16(MDMA2_D1_Y_COUNT,val)
1374#define bfin_read_MDMA2_D1_X_MODIFY() bfin_read16(MDMA2_D1_X_MODIFY)
1375#define bfin_write_MDMA2_D1_X_MODIFY(val) bfin_write16(MDMA2_D1_X_MODIFY,val)
1376#define bfin_read_MDMA2_D1_Y_MODIFY() bfin_read16(MDMA2_D1_Y_MODIFY)
1377#define bfin_write_MDMA2_D1_Y_MODIFY(val) bfin_write16(MDMA2_D1_Y_MODIFY,val)
1378#define bfin_read_MDMA2_D1_CURR_DESC_PTR() bfin_read32(MDMA2_D1_CURR_DESC_PTR)
1379#define bfin_write_MDMA2_D1_CURR_DESC_PTR(val) bfin_write32(MDMA2_D1_CURR_DESC_PTR,val)
1380#define bfin_read_MDMA2_D1_CURR_ADDR() bfin_read32(MDMA2_D1_CURR_ADDR)
1381#define bfin_write_MDMA2_D1_CURR_ADDR(val) bfin_write32(MDMA2_D1_CURR_ADDR,val)
1382#define bfin_read_MDMA2_D1_CURR_X_COUNT() bfin_read16(MDMA2_D1_CURR_X_COUNT)
1383#define bfin_write_MDMA2_D1_CURR_X_COUNT(val) bfin_write16(MDMA2_D1_CURR_X_COUNT,val)
1384#define bfin_read_MDMA2_D1_CURR_Y_COUNT() bfin_read16(MDMA2_D1_CURR_Y_COUNT)
1385#define bfin_write_MDMA2_D1_CURR_Y_COUNT(val) bfin_write16(MDMA2_D1_CURR_Y_COUNT,val)
1386#define bfin_read_MDMA2_D1_IRQ_STATUS() bfin_read16(MDMA2_D1_IRQ_STATUS)
1387#define bfin_write_MDMA2_D1_IRQ_STATUS(val) bfin_write16(MDMA2_D1_IRQ_STATUS,val)
1388#define bfin_read_MDMA2_D1_PERIPHERAL_MAP() bfin_read16(MDMA2_D1_PERIPHERAL_MAP)
1389#define bfin_write_MDMA2_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA2_D1_PERIPHERAL_MAP,val)
1390#define bfin_read_MDMA2_S1_CONFIG() bfin_read16(MDMA2_S1_CONFIG)
1391#define bfin_write_MDMA2_S1_CONFIG(val) bfin_write16(MDMA2_S1_CONFIG,val)
1392#define bfin_read_MDMA2_S1_NEXT_DESC_PTR() bfin_read32(MDMA2_S1_NEXT_DESC_PTR)
1393#define bfin_write_MDMA2_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA2_S1_NEXT_DESC_PTR,val)
1394#define bfin_read_MDMA2_S1_START_ADDR() bfin_read32(MDMA2_S1_START_ADDR)
1395#define bfin_write_MDMA2_S1_START_ADDR(val) bfin_write32(MDMA2_S1_START_ADDR,val)
1396#define bfin_read_MDMA2_S1_X_COUNT() bfin_read16(MDMA2_S1_X_COUNT)
1397#define bfin_write_MDMA2_S1_X_COUNT(val) bfin_write16(MDMA2_S1_X_COUNT,val)
1398#define bfin_read_MDMA2_S1_Y_COUNT() bfin_read16(MDMA2_S1_Y_COUNT)
1399#define bfin_write_MDMA2_S1_Y_COUNT(val) bfin_write16(MDMA2_S1_Y_COUNT,val)
1400#define bfin_read_MDMA2_S1_X_MODIFY() bfin_read16(MDMA2_S1_X_MODIFY)
1401#define bfin_write_MDMA2_S1_X_MODIFY(val) bfin_write16(MDMA2_S1_X_MODIFY,val)
1402#define bfin_read_MDMA2_S1_Y_MODIFY() bfin_read16(MDMA2_S1_Y_MODIFY)
1403#define bfin_write_MDMA2_S1_Y_MODIFY(val) bfin_write16(MDMA2_S1_Y_MODIFY,val)
1404#define bfin_read_MDMA2_S1_CURR_DESC_PTR() bfin_read32(MDMA2_S1_CURR_DESC_PTR)
1405#define bfin_write_MDMA2_S1_CURR_DESC_PTR(val) bfin_write32(MDMA2_S1_CURR_DESC_PTR,val)
1406#define bfin_read_MDMA2_S1_CURR_ADDR() bfin_read32(MDMA2_S1_CURR_ADDR)
1407#define bfin_write_MDMA2_S1_CURR_ADDR(val) bfin_write32(MDMA2_S1_CURR_ADDR,val)
1408#define bfin_read_MDMA2_S1_CURR_X_COUNT() bfin_read16(MDMA2_S1_CURR_X_COUNT)
1409#define bfin_write_MDMA2_S1_CURR_X_COUNT(val) bfin_write16(MDMA2_S1_CURR_X_COUNT,val)
1410#define bfin_read_MDMA2_S1_CURR_Y_COUNT() bfin_read16(MDMA2_S1_CURR_Y_COUNT)
1411#define bfin_write_MDMA2_S1_CURR_Y_COUNT(val) bfin_write16(MDMA2_S1_CURR_Y_COUNT,val)
1412#define bfin_read_MDMA2_S1_IRQ_STATUS() bfin_read16(MDMA2_S1_IRQ_STATUS)
1413#define bfin_write_MDMA2_S1_IRQ_STATUS(val) bfin_write16(MDMA2_S1_IRQ_STATUS,val)
1414#define bfin_read_MDMA2_S1_PERIPHERAL_MAP() bfin_read16(MDMA2_S1_PERIPHERAL_MAP)
1415#define bfin_write_MDMA2_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA2_S1_PERIPHERAL_MAP,val)
1416/* Internal Memory DMA Registers (0xFFC0_1800 - 0xFFC0_19FF) */
1417#define bfin_read_IMDMA_D0_CONFIG() bfin_read16(IMDMA_D0_CONFIG)
1418#define bfin_write_IMDMA_D0_CONFIG(val) bfin_write16(IMDMA_D0_CONFIG,val)
1419#define bfin_read_IMDMA_D0_NEXT_DESC_PTR() bfin_read32(IMDMA_D0_NEXT_DESC_PTR)
1420#define bfin_write_IMDMA_D0_NEXT_DESC_PTR(val) bfin_write32(IMDMA_D0_NEXT_DESC_PTR,val)
1421#define bfin_read_IMDMA_D0_START_ADDR() bfin_read32(IMDMA_D0_START_ADDR)
1422#define bfin_write_IMDMA_D0_START_ADDR(val) bfin_write32(IMDMA_D0_START_ADDR,val)
1423#define bfin_read_IMDMA_D0_X_COUNT() bfin_read16(IMDMA_D0_X_COUNT)
1424#define bfin_write_IMDMA_D0_X_COUNT(val) bfin_write16(IMDMA_D0_X_COUNT,val)
1425#define bfin_read_IMDMA_D0_Y_COUNT() bfin_read16(IMDMA_D0_Y_COUNT)
1426#define bfin_write_IMDMA_D0_Y_COUNT(val) bfin_write16(IMDMA_D0_Y_COUNT,val)
1427#define bfin_read_IMDMA_D0_X_MODIFY() bfin_read16(IMDMA_D0_X_MODIFY)
1428#define bfin_write_IMDMA_D0_X_MODIFY(val) bfin_write16(IMDMA_D0_X_MODIFY,val)
1429#define bfin_read_IMDMA_D0_Y_MODIFY() bfin_read16(IMDMA_D0_Y_MODIFY)
1430#define bfin_write_IMDMA_D0_Y_MODIFY(val) bfin_write16(IMDMA_D0_Y_MODIFY,val)
1431#define bfin_read_IMDMA_D0_CURR_DESC_PTR() bfin_read32(IMDMA_D0_CURR_DESC_PTR)
1432#define bfin_write_IMDMA_D0_CURR_DESC_PTR(val) bfin_write32(IMDMA_D0_CURR_DESC_PTR,val)
1433#define bfin_read_IMDMA_D0_CURR_ADDR() bfin_read32(IMDMA_D0_CURR_ADDR)
1434#define bfin_write_IMDMA_D0_CURR_ADDR(val) bfin_write32(IMDMA_D0_CURR_ADDR,val)
1435#define bfin_read_IMDMA_D0_CURR_X_COUNT() bfin_read16(IMDMA_D0_CURR_X_COUNT)
1436#define bfin_write_IMDMA_D0_CURR_X_COUNT(val) bfin_write16(IMDMA_D0_CURR_X_COUNT,val)
1437#define bfin_read_IMDMA_D0_CURR_Y_COUNT() bfin_read16(IMDMA_D0_CURR_Y_COUNT)
1438#define bfin_write_IMDMA_D0_CURR_Y_COUNT(val) bfin_write16(IMDMA_D0_CURR_Y_COUNT,val)
1439#define bfin_read_IMDMA_D0_IRQ_STATUS() bfin_read16(IMDMA_D0_IRQ_STATUS)
1440#define bfin_write_IMDMA_D0_IRQ_STATUS(val) bfin_write16(IMDMA_D0_IRQ_STATUS,val)
1441#define bfin_read_IMDMA_S0_CONFIG() bfin_read16(IMDMA_S0_CONFIG)
1442#define bfin_write_IMDMA_S0_CONFIG(val) bfin_write16(IMDMA_S0_CONFIG,val)
1443#define bfin_read_IMDMA_S0_NEXT_DESC_PTR() bfin_read32(IMDMA_S0_NEXT_DESC_PTR)
1444#define bfin_write_IMDMA_S0_NEXT_DESC_PTR(val) bfin_write32(IMDMA_S0_NEXT_DESC_PTR,val)
1445#define bfin_read_IMDMA_S0_START_ADDR() bfin_read32(IMDMA_S0_START_ADDR)
1446#define bfin_write_IMDMA_S0_START_ADDR(val) bfin_write32(IMDMA_S0_START_ADDR,val)
1447#define bfin_read_IMDMA_S0_X_COUNT() bfin_read16(IMDMA_S0_X_COUNT)
1448#define bfin_write_IMDMA_S0_X_COUNT(val) bfin_write16(IMDMA_S0_X_COUNT,val)
1449#define bfin_read_IMDMA_S0_Y_COUNT() bfin_read16(IMDMA_S0_Y_COUNT)
1450#define bfin_write_IMDMA_S0_Y_COUNT(val) bfin_write16(IMDMA_S0_Y_COUNT,val)
1451#define bfin_read_IMDMA_S0_X_MODIFY() bfin_read16(IMDMA_S0_X_MODIFY)
1452#define bfin_write_IMDMA_S0_X_MODIFY(val) bfin_write16(IMDMA_S0_X_MODIFY,val)
1453#define bfin_read_IMDMA_S0_Y_MODIFY() bfin_read16(IMDMA_S0_Y_MODIFY)
1454#define bfin_write_IMDMA_S0_Y_MODIFY(val) bfin_write16(IMDMA_S0_Y_MODIFY,val)
1455#define bfin_read_IMDMA_S0_CURR_DESC_PTR() bfin_read32(IMDMA_S0_CURR_DESC_PTR)
1456#define bfin_write_IMDMA_S0_CURR_DESC_PTR(val) bfin_write32(IMDMA_S0_CURR_DESC_PTR,val)
1457#define bfin_read_IMDMA_S0_CURR_ADDR() bfin_read32(IMDMA_S0_CURR_ADDR)
1458#define bfin_write_IMDMA_S0_CURR_ADDR(val) bfin_write32(IMDMA_S0_CURR_ADDR,val)
1459#define bfin_read_IMDMA_S0_CURR_X_COUNT() bfin_read16(IMDMA_S0_CURR_X_COUNT)
1460#define bfin_write_IMDMA_S0_CURR_X_COUNT(val) bfin_write16(IMDMA_S0_CURR_X_COUNT,val)
1461#define bfin_read_IMDMA_S0_CURR_Y_COUNT() bfin_read16(IMDMA_S0_CURR_Y_COUNT)
1462#define bfin_write_IMDMA_S0_CURR_Y_COUNT(val) bfin_write16(IMDMA_S0_CURR_Y_COUNT,val)
1463#define bfin_read_IMDMA_S0_IRQ_STATUS() bfin_read16(IMDMA_S0_IRQ_STATUS)
1464#define bfin_write_IMDMA_S0_IRQ_STATUS(val) bfin_write16(IMDMA_S0_IRQ_STATUS,val)
1465#define bfin_read_IMDMA_D1_CONFIG() bfin_read16(IMDMA_D1_CONFIG)
1466#define bfin_write_IMDMA_D1_CONFIG(val) bfin_write16(IMDMA_D1_CONFIG,val)
1467#define bfin_read_IMDMA_D1_NEXT_DESC_PTR() bfin_read32(IMDMA_D1_NEXT_DESC_PTR)
1468#define bfin_write_IMDMA_D1_NEXT_DESC_PTR(val) bfin_write32(IMDMA_D1_NEXT_DESC_PTR,val)
1469#define bfin_read_IMDMA_D1_START_ADDR() bfin_read32(IMDMA_D1_START_ADDR)
1470#define bfin_write_IMDMA_D1_START_ADDR(val) bfin_write32(IMDMA_D1_START_ADDR,val)
1471#define bfin_read_IMDMA_D1_X_COUNT() bfin_read16(IMDMA_D1_X_COUNT)
1472#define bfin_write_IMDMA_D1_X_COUNT(val) bfin_write16(IMDMA_D1_X_COUNT,val)
1473#define bfin_read_IMDMA_D1_Y_COUNT() bfin_read16(IMDMA_D1_Y_COUNT)
1474#define bfin_write_IMDMA_D1_Y_COUNT(val) bfin_write16(IMDMA_D1_Y_COUNT,val)
1475#define bfin_read_IMDMA_D1_X_MODIFY() bfin_read16(IMDMA_D1_X_MODIFY)
1476#define bfin_write_IMDMA_D1_X_MODIFY(val) bfin_write16(IMDMA_D1_X_MODIFY,val)
1477#define bfin_read_IMDMA_D1_Y_MODIFY() bfin_read16(IMDMA_D1_Y_MODIFY)
1478#define bfin_write_IMDMA_D1_Y_MODIFY(val) bfin_write16(IMDMA_D1_Y_MODIFY,val)
1479#define bfin_read_IMDMA_D1_CURR_DESC_PTR() bfin_read32(IMDMA_D1_CURR_DESC_PTR)
1480#define bfin_write_IMDMA_D1_CURR_DESC_PTR(val) bfin_write32(IMDMA_D1_CURR_DESC_PTR,val)
1481#define bfin_read_IMDMA_D1_CURR_ADDR() bfin_read32(IMDMA_D1_CURR_ADDR)
1482#define bfin_write_IMDMA_D1_CURR_ADDR(val) bfin_write32(IMDMA_D1_CURR_ADDR,val)
1483#define bfin_read_IMDMA_D1_CURR_X_COUNT() bfin_read16(IMDMA_D1_CURR_X_COUNT)
1484#define bfin_write_IMDMA_D1_CURR_X_COUNT(val) bfin_write16(IMDMA_D1_CURR_X_COUNT,val)
1485#define bfin_read_IMDMA_D1_CURR_Y_COUNT() bfin_read16(IMDMA_D1_CURR_Y_COUNT)
1486#define bfin_write_IMDMA_D1_CURR_Y_COUNT(val) bfin_write16(IMDMA_D1_CURR_Y_COUNT,val)
1487#define bfin_read_IMDMA_D1_IRQ_STATUS() bfin_read16(IMDMA_D1_IRQ_STATUS)
1488#define bfin_write_IMDMA_D1_IRQ_STATUS(val) bfin_write16(IMDMA_D1_IRQ_STATUS,val)
1489#define bfin_read_IMDMA_S1_CONFIG() bfin_read16(IMDMA_S1_CONFIG)
1490#define bfin_write_IMDMA_S1_CONFIG(val) bfin_write16(IMDMA_S1_CONFIG,val)
1491#define bfin_read_IMDMA_S1_NEXT_DESC_PTR() bfin_read32(IMDMA_S1_NEXT_DESC_PTR)
1492#define bfin_write_IMDMA_S1_NEXT_DESC_PTR(val) bfin_write32(IMDMA_S1_NEXT_DESC_PTR,val)
1493#define bfin_read_IMDMA_S1_START_ADDR() bfin_read32(IMDMA_S1_START_ADDR)
1494#define bfin_write_IMDMA_S1_START_ADDR(val) bfin_write32(IMDMA_S1_START_ADDR,val)
1495#define bfin_read_IMDMA_S1_X_COUNT() bfin_read16(IMDMA_S1_X_COUNT)
1496#define bfin_write_IMDMA_S1_X_COUNT(val) bfin_write16(IMDMA_S1_X_COUNT,val)
1497#define bfin_read_IMDMA_S1_Y_COUNT() bfin_read16(IMDMA_S1_Y_COUNT)
1498#define bfin_write_IMDMA_S1_Y_COUNT(val) bfin_write16(IMDMA_S1_Y_COUNT,val)
1499#define bfin_read_IMDMA_S1_X_MODIFY() bfin_read16(IMDMA_S1_X_MODIFY)
1500#define bfin_write_IMDMA_S1_X_MODIFY(val) bfin_write16(IMDMA_S1_X_MODIFY,val)
1501#define bfin_read_IMDMA_S1_Y_MODIFY() bfin_read16(IMDMA_S1_Y_MODIFY)
1502#define bfin_write_IMDMA_S1_Y_MODIFY(val) bfin_write16(IMDMA_S1_Y_MODIFY,val)
1503#define bfin_read_IMDMA_S1_CURR_DESC_PTR() bfin_read32(IMDMA_S1_CURR_DESC_PTR)
1504#define bfin_write_IMDMA_S1_CURR_DESC_PTR(val) bfin_write32(IMDMA_S1_CURR_DESC_PTR,val)
1505#define bfin_read_IMDMA_S1_CURR_ADDR() bfin_read32(IMDMA_S1_CURR_ADDR)
1506#define bfin_write_IMDMA_S1_CURR_ADDR(val) bfin_write32(IMDMA_S1_CURR_ADDR,val)
1507#define bfin_read_IMDMA_S1_CURR_X_COUNT() bfin_read16(IMDMA_S1_CURR_X_COUNT)
1508#define bfin_write_IMDMA_S1_CURR_X_COUNT(val) bfin_write16(IMDMA_S1_CURR_X_COUNT,val)
1509#define bfin_read_IMDMA_S1_CURR_Y_COUNT() bfin_read16(IMDMA_S1_CURR_Y_COUNT)
1510#define bfin_write_IMDMA_S1_CURR_Y_COUNT(val) bfin_write16(IMDMA_S1_CURR_Y_COUNT,val)
1511#define bfin_read_IMDMA_S1_IRQ_STATUS() bfin_read16(IMDMA_S1_IRQ_STATUS)
1512#define bfin_write_IMDMA_S1_IRQ_STATUS(val) bfin_write16(IMDMA_S1_IRQ_STATUS,val)
1513
1514#define bfin_read_MDMA_S0_CONFIG() bfin_read_MDMA1_S0_CONFIG()
1515#define bfin_write_MDMA_S0_CONFIG(val) bfin_write_MDMA1_S0_CONFIG(val)
1516#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read_MDMA1_S0_IRQ_STATUS()
1517#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write_MDMA1_S0_IRQ_STATUS(val)
1518#define bfin_read_MDMA_S0_X_MODIFY() bfin_read_MDMA1_S0_X_MODIFY()
1519#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write_MDMA1_S0_X_MODIFY(val)
1520#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read_MDMA1_S0_Y_MODIFY()
1521#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write_MDMA1_S0_Y_MODIFY(val)
1522#define bfin_read_MDMA_S0_X_COUNT() bfin_read_MDMA1_S0_X_COUNT()
1523#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write_MDMA1_S0_X_COUNT(val)
1524#define bfin_read_MDMA_S0_Y_COUNT() bfin_read_MDMA1_S0_Y_COUNT()
1525#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write_MDMA1_S0_Y_COUNT(val)
1526#define bfin_read_MDMA_S0_START_ADDR() bfin_read_MDMA1_S0_START_ADDR()
1527#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write_MDMA1_S0_START_ADDR(val)
1528#define bfin_read_MDMA_D0_CONFIG() bfin_read_MDMA1_D0_CONFIG()
1529#define bfin_write_MDMA_D0_CONFIG(val) bfin_write_MDMA1_D0_CONFIG(val)
1530#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read_MDMA1_D0_IRQ_STATUS()
1531#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write_MDMA1_D0_IRQ_STATUS(val)
1532#define bfin_read_MDMA_D0_X_MODIFY() bfin_read_MDMA1_D0_X_MODIFY()
1533#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write_MDMA1_D0_X_MODIFY(val)
1534#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read_MDMA1_D0_Y_MODIFY()
1535#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write_MDMA1_D0_Y_MODIFY(val)
1536#define bfin_read_MDMA_D0_X_COUNT() bfin_read_MDMA1_D0_X_COUNT()
1537#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write_MDMA1_D0_X_COUNT(val)
1538#define bfin_read_MDMA_D0_Y_COUNT() bfin_read_MDMA1_D0_Y_COUNT()
1539#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write_MDMA1_D0_Y_COUNT(val)
1540#define bfin_read_MDMA_D0_START_ADDR() bfin_read_MDMA1_D0_START_ADDR()
1541#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA1_D0_START_ADDR(val)
1542
1543#endif /* _CDEF_BF561_H */
diff --git a/include/asm-blackfin/mach-bf561/defBF561.h b/include/asm-blackfin/mach-bf561/defBF561.h
new file mode 100644
index 000000000000..a6de4c69ba55
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/defBF561.h
@@ -0,0 +1,1717 @@
1
2/*
3 * File: include/asm-blackfin/mach-bf561/defBF561.h
4 * Based on:
5 * Author:
6 *
7 * Created:
8 * Description:
9 * SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF561
10 * Rev:
11 *
12 * Modified:
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _DEF_BF561_H
33#define _DEF_BF561_H
34/*
35#if !defined(__ADSPBF561__)
36#warning defBF561.h should only be included for BF561 chip.
37#endif
38*/
39/* include all Core registers and bit definitions */
40#include <asm/mach-common/def_LPBlackfin.h>
41
42/*********************************************************************************** */
43/* System MMR Register Map */
44/*********************************************************************************** */
45
46/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
47
48#define PLL_CTL 0xFFC00000 /* PLL Control register (16-bit) */
49#define PLL_DIV 0xFFC00004 /* PLL Divide Register (16-bit) */
50#define VR_CTL 0xFFC00008 /* Voltage Regulator Control Register (16-bit) */
51#define PLL_STAT 0xFFC0000C /* PLL Status register (16-bit) */
52#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */
53#define CHIPID 0xFFC00014 /* Chip ID Register */
54
55/* System Reset and Interrupt Controller registers for core A (0xFFC0 0100-0xFFC0 01FF) */
56#define SICA_SWRST 0xFFC00100 /* Software Reset register */
57#define SICA_SYSCR 0xFFC00104 /* System Reset Configuration register */
58#define SICA_RVECT 0xFFC00108 /* SIC Reset Vector Address Register */
59#define SICA_IMASK 0xFFC0010C /* SIC Interrupt Mask register 0 - hack to fix old tests */
60#define SICA_IMASK0 0xFFC0010C /* SIC Interrupt Mask register 0 */
61#define SICA_IMASK1 0xFFC00110 /* SIC Interrupt Mask register 1 */
62#define SICA_IAR0 0xFFC00124 /* SIC Interrupt Assignment Register 0 */
63#define SICA_IAR1 0xFFC00128 /* SIC Interrupt Assignment Register 1 */
64#define SICA_IAR2 0xFFC0012C /* SIC Interrupt Assignment Register 2 */
65#define SICA_IAR3 0xFFC00130 /* SIC Interrupt Assignment Register 3 */
66#define SICA_IAR4 0xFFC00134 /* SIC Interrupt Assignment Register 4 */
67#define SICA_IAR5 0xFFC00138 /* SIC Interrupt Assignment Register 5 */
68#define SICA_IAR6 0xFFC0013C /* SIC Interrupt Assignment Register 6 */
69#define SICA_IAR7 0xFFC00140 /* SIC Interrupt Assignment Register 7 */
70#define SICA_ISR0 0xFFC00114 /* SIC Interrupt Status register 0 */
71#define SICA_ISR1 0xFFC00118 /* SIC Interrupt Status register 1 */
72#define SICA_IWR0 0xFFC0011C /* SIC Interrupt Wakeup-Enable register 0 */
73#define SICA_IWR1 0xFFC00120 /* SIC Interrupt Wakeup-Enable register 1 */
74
75/* System Reset and Interrupt Controller registers for Core B (0xFFC0 1100-0xFFC0 11FF) */
76#define SICB_SWRST 0xFFC01100 /* reserved */
77#define SICB_SYSCR 0xFFC01104 /* reserved */
78#define SICB_RVECT 0xFFC01108 /* SIC Reset Vector Address Register */
79#define SICB_IMASK0 0xFFC0110C /* SIC Interrupt Mask register 0 */
80#define SICB_IMASK1 0xFFC01110 /* SIC Interrupt Mask register 1 */
81#define SICB_IAR0 0xFFC01124 /* SIC Interrupt Assignment Register 0 */
82#define SICB_IAR1 0xFFC01128 /* SIC Interrupt Assignment Register 1 */
83#define SICB_IAR2 0xFFC0112C /* SIC Interrupt Assignment Register 2 */
84#define SICB_IAR3 0xFFC01130 /* SIC Interrupt Assignment Register 3 */
85#define SICB_IAR4 0xFFC01134 /* SIC Interrupt Assignment Register 4 */
86#define SICB_IAR5 0xFFC01138 /* SIC Interrupt Assignment Register 5 */
87#define SICB_IAR6 0xFFC0113C /* SIC Interrupt Assignment Register 6 */
88#define SICB_IAR7 0xFFC01140 /* SIC Interrupt Assignment Register 7 */
89#define SICB_ISR0 0xFFC01114 /* SIC Interrupt Status register 0 */
90#define SICB_ISR1 0xFFC01118 /* SIC Interrupt Status register 1 */
91#define SICB_IWR0 0xFFC0111C /* SIC Interrupt Wakeup-Enable register 0 */
92#define SICB_IWR1 0xFFC01120 /* SIC Interrupt Wakeup-Enable register 1 */
93
94/* Watchdog Timer registers for Core A (0xFFC0 0200-0xFFC0 02FF) */
95#define WDOGA_CTL 0xFFC00200 /* Watchdog Control register */
96#define WDOGA_CNT 0xFFC00204 /* Watchdog Count register */
97#define WDOGA_STAT 0xFFC00208 /* Watchdog Status register */
98
99/* Watchdog Timer registers for Core B (0xFFC0 1200-0xFFC0 12FF) */
100#define WDOGB_CTL 0xFFC01200 /* Watchdog Control register */
101#define WDOGB_CNT 0xFFC01204 /* Watchdog Count register */
102#define WDOGB_STAT 0xFFC01208 /* Watchdog Status register */
103
104/* UART Controller (0xFFC00400 - 0xFFC004FF) */
105#define UART_THR 0xFFC00400 /* Transmit Holding register */
106#define UART_RBR 0xFFC00400 /* Receive Buffer register */
107#define UART_DLL 0xFFC00400 /* Divisor Latch (Low-Byte) */
108#define UART_IER 0xFFC00404 /* Interrupt Enable Register */
109#define UART_DLH 0xFFC00404 /* Divisor Latch (High-Byte) */
110#define UART_IIR 0xFFC00408 /* Interrupt Identification Register */
111#define UART_LCR 0xFFC0040C /* Line Control Register */
112#define UART_MCR 0xFFC00410 /* Modem Control Register */
113#define UART_LSR 0xFFC00414 /* Line Status Register */
114#define UART_MSR 0xFFC00418 /* Modem Status Register */
115#define UART_SCR 0xFFC0041C /* SCR Scratch Register */
116#define UART_GCTL 0xFFC00424 /* Global Control Register */
117
118/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
119#define SPI_CTL 0xFFC00500 /* SPI Control Register */
120#define SPI_FLG 0xFFC00504 /* SPI Flag register */
121#define SPI_STAT 0xFFC00508 /* SPI Status register */
122#define SPI_TDBR 0xFFC0050C /* SPI Transmit Data Buffer Register */
123#define SPI_RDBR 0xFFC00510 /* SPI Receive Data Buffer Register */
124#define SPI_BAUD 0xFFC00514 /* SPI Baud rate Register */
125#define SPI_SHADOW 0xFFC00518 /* SPI_RDBR Shadow Register */
126
127/* Timer 0-7 registers (0xFFC0 0600-0xFFC0 06FF) */
128#define TIMER0_CONFIG 0xFFC00600 /* Timer0 Configuration register */
129#define TIMER0_COUNTER 0xFFC00604 /* Timer0 Counter register */
130#define TIMER0_PERIOD 0xFFC00608 /* Timer0 Period register */
131#define TIMER0_WIDTH 0xFFC0060C /* Timer0 Width register */
132
133#define TIMER1_CONFIG 0xFFC00610 /* Timer1 Configuration register */
134#define TIMER1_COUNTER 0xFFC00614 /* Timer1 Counter register */
135#define TIMER1_PERIOD 0xFFC00618 /* Timer1 Period register */
136#define TIMER1_WIDTH 0xFFC0061C /* Timer1 Width register */
137
138#define TIMER2_CONFIG 0xFFC00620 /* Timer2 Configuration register */
139#define TIMER2_COUNTER 0xFFC00624 /* Timer2 Counter register */
140#define TIMER2_PERIOD 0xFFC00628 /* Timer2 Period register */
141#define TIMER2_WIDTH 0xFFC0062C /* Timer2 Width register */
142
143#define TIMER3_CONFIG 0xFFC00630 /* Timer3 Configuration register */
144#define TIMER3_COUNTER 0xFFC00634 /* Timer3 Counter register */
145#define TIMER3_PERIOD 0xFFC00638 /* Timer3 Period register */
146#define TIMER3_WIDTH 0xFFC0063C /* Timer3 Width register */
147
148#define TIMER4_CONFIG 0xFFC00640 /* Timer4 Configuration register */
149#define TIMER4_COUNTER 0xFFC00644 /* Timer4 Counter register */
150#define TIMER4_PERIOD 0xFFC00648 /* Timer4 Period register */
151#define TIMER4_WIDTH 0xFFC0064C /* Timer4 Width register */
152
153#define TIMER5_CONFIG 0xFFC00650 /* Timer5 Configuration register */
154#define TIMER5_COUNTER 0xFFC00654 /* Timer5 Counter register */
155#define TIMER5_PERIOD 0xFFC00658 /* Timer5 Period register */
156#define TIMER5_WIDTH 0xFFC0065C /* Timer5 Width register */
157
158#define TIMER6_CONFIG 0xFFC00660 /* Timer6 Configuration register */
159#define TIMER6_COUNTER 0xFFC00664 /* Timer6 Counter register */
160#define TIMER6_PERIOD 0xFFC00668 /* Timer6 Period register */
161#define TIMER6_WIDTH 0xFFC0066C /* Timer6 Width register */
162
163#define TIMER7_CONFIG 0xFFC00670 /* Timer7 Configuration register */
164#define TIMER7_COUNTER 0xFFC00674 /* Timer7 Counter register */
165#define TIMER7_PERIOD 0xFFC00678 /* Timer7 Period register */
166#define TIMER7_WIDTH 0xFFC0067C /* Timer7 Width register */
167
168#define TMRS8_ENABLE 0xFFC00680 /* Timer Enable Register */
169#define TMRS8_DISABLE 0xFFC00684 /* Timer Disable register */
170#define TMRS8_STATUS 0xFFC00688 /* Timer Status register */
171
172/* Timer registers 8-11 (0xFFC0 1600-0xFFC0 16FF) */
173#define TIMER8_CONFIG 0xFFC01600 /* Timer8 Configuration register */
174#define TIMER8_COUNTER 0xFFC01604 /* Timer8 Counter register */
175#define TIMER8_PERIOD 0xFFC01608 /* Timer8 Period register */
176#define TIMER8_WIDTH 0xFFC0160C /* Timer8 Width register */
177
178#define TIMER9_CONFIG 0xFFC01610 /* Timer9 Configuration register */
179#define TIMER9_COUNTER 0xFFC01614 /* Timer9 Counter register */
180#define TIMER9_PERIOD 0xFFC01618 /* Timer9 Period register */
181#define TIMER9_WIDTH 0xFFC0161C /* Timer9 Width register */
182
183#define TIMER10_CONFIG 0xFFC01620 /* Timer10 Configuration register */
184#define TIMER10_COUNTER 0xFFC01624 /* Timer10 Counter register */
185#define TIMER10_PERIOD 0xFFC01628 /* Timer10 Period register */
186#define TIMER10_WIDTH 0xFFC0162C /* Timer10 Width register */
187
188#define TIMER11_CONFIG 0xFFC01630 /* Timer11 Configuration register */
189#define TIMER11_COUNTER 0xFFC01634 /* Timer11 Counter register */
190#define TIMER11_PERIOD 0xFFC01638 /* Timer11 Period register */
191#define TIMER11_WIDTH 0xFFC0163C /* Timer11 Width register */
192
193#define TMRS4_ENABLE 0xFFC01640 /* Timer Enable Register */
194#define TMRS4_DISABLE 0xFFC01644 /* Timer Disable register */
195#define TMRS4_STATUS 0xFFC01648 /* Timer Status register */
196
197/* Programmable Flag 0 registers (0xFFC0 0700-0xFFC0 07FF) */
198#define FIO0_FLAG_D 0xFFC00700 /* Flag Data register */
199#define FIO0_FLAG_C 0xFFC00704 /* Flag Clear register */
200#define FIO0_FLAG_S 0xFFC00708 /* Flag Set register */
201#define FIO0_FLAG_T 0xFFC0070C /* Flag Toggle register */
202#define FIO0_MASKA_D 0xFFC00710 /* Flag Mask Interrupt A Data register */
203#define FIO0_MASKA_C 0xFFC00714 /* Flag Mask Interrupt A Clear register */
204#define FIO0_MASKA_S 0xFFC00718 /* Flag Mask Interrupt A Set register */
205#define FIO0_MASKA_T 0xFFC0071C /* Flag Mask Interrupt A Toggle register */
206#define FIO0_MASKB_D 0xFFC00720 /* Flag Mask Interrupt B Data register */
207#define FIO0_MASKB_C 0xFFC00724 /* Flag Mask Interrupt B Clear register */
208#define FIO0_MASKB_S 0xFFC00728 /* Flag Mask Interrupt B Set register */
209#define FIO0_MASKB_T 0xFFC0072C /* Flag Mask Interrupt B Toggle register */
210#define FIO0_DIR 0xFFC00730 /* Flag Direction register */
211#define FIO0_POLAR 0xFFC00734 /* Flag Polarity register */
212#define FIO0_EDGE 0xFFC00738 /* Flag Interrupt Sensitivity register */
213#define FIO0_BOTH 0xFFC0073C /* Flag Set on Both Edges register */
214#define FIO0_INEN 0xFFC00740 /* Flag Input Enable register */
215
216/* Programmable Flag 1 registers (0xFFC0 1500-0xFFC0 15FF) */
217#define FIO1_FLAG_D 0xFFC01500 /* Flag Data register (mask used to directly */
218#define FIO1_FLAG_C 0xFFC01504 /* Flag Clear register */
219#define FIO1_FLAG_S 0xFFC01508 /* Flag Set register */
220#define FIO1_FLAG_T 0xFFC0150C /* Flag Toggle register (mask used to */
221#define FIO1_MASKA_D 0xFFC01510 /* Flag Mask Interrupt A Data register */
222#define FIO1_MASKA_C 0xFFC01514 /* Flag Mask Interrupt A Clear register */
223#define FIO1_MASKA_S 0xFFC01518 /* Flag Mask Interrupt A Set register */
224#define FIO1_MASKA_T 0xFFC0151C /* Flag Mask Interrupt A Toggle register */
225#define FIO1_MASKB_D 0xFFC01520 /* Flag Mask Interrupt B Data register */
226#define FIO1_MASKB_C 0xFFC01524 /* Flag Mask Interrupt B Clear register */
227#define FIO1_MASKB_S 0xFFC01528 /* Flag Mask Interrupt B Set register */
228#define FIO1_MASKB_T 0xFFC0152C /* Flag Mask Interrupt B Toggle register */
229#define FIO1_DIR 0xFFC01530 /* Flag Direction register */
230#define FIO1_POLAR 0xFFC01534 /* Flag Polarity register */
231#define FIO1_EDGE 0xFFC01538 /* Flag Interrupt Sensitivity register */
232#define FIO1_BOTH 0xFFC0153C /* Flag Set on Both Edges register */
233#define FIO1_INEN 0xFFC01540 /* Flag Input Enable register */
234
235/* Programmable Flag registers (0xFFC0 1700-0xFFC0 17FF) */
236#define FIO2_FLAG_D 0xFFC01700 /* Flag Data register (mask used to directly */
237#define FIO2_FLAG_C 0xFFC01704 /* Flag Clear register */
238#define FIO2_FLAG_S 0xFFC01708 /* Flag Set register */
239#define FIO2_FLAG_T 0xFFC0170C /* Flag Toggle register (mask used to */
240#define FIO2_MASKA_D 0xFFC01710 /* Flag Mask Interrupt A Data register */
241#define FIO2_MASKA_C 0xFFC01714 /* Flag Mask Interrupt A Clear register */
242#define FIO2_MASKA_S 0xFFC01718 /* Flag Mask Interrupt A Set register */
243#define FIO2_MASKA_T 0xFFC0171C /* Flag Mask Interrupt A Toggle register */
244#define FIO2_MASKB_D 0xFFC01720 /* Flag Mask Interrupt B Data register */
245#define FIO2_MASKB_C 0xFFC01724 /* Flag Mask Interrupt B Clear register */
246#define FIO2_MASKB_S 0xFFC01728 /* Flag Mask Interrupt B Set register */
247#define FIO2_MASKB_T 0xFFC0172C /* Flag Mask Interrupt B Toggle register */
248#define FIO2_DIR 0xFFC01730 /* Flag Direction register */
249#define FIO2_POLAR 0xFFC01734 /* Flag Polarity register */
250#define FIO2_EDGE 0xFFC01738 /* Flag Interrupt Sensitivity register */
251#define FIO2_BOTH 0xFFC0173C /* Flag Set on Both Edges register */
252#define FIO2_INEN 0xFFC01740 /* Flag Input Enable register */
253
254/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
255#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
256#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
257#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
258#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
259#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
260#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
261#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
262#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
263#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
264#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
265#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
266#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
267#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
268#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
269#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
270#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
271#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
272#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
273#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
274#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
275#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
276#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
277
278/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
279#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
280#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
281#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
282#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
283#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
284#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
285#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
286#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
287#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
288#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
289#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
290#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
291#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
292#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
293#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
294#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
295#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
296#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
297#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
298#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
299#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
300#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
301
302/* Asynchronous Memory Controller - External Bus Interface Unit */
303#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
304#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
305#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
306
307/* SDRAM Controller External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
308#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
309#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
310#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
311#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
312
313/* Parallel Peripheral Interface (PPI) 0 registers (0xFFC0 1000-0xFFC0 10FF) */
314#define PPI0_CONTROL 0xFFC01000 /* PPI0 Control register */
315#define PPI0_STATUS 0xFFC01004 /* PPI0 Status register */
316#define PPI0_COUNT 0xFFC01008 /* PPI0 Transfer Count register */
317#define PPI0_DELAY 0xFFC0100C /* PPI0 Delay Count register */
318#define PPI0_FRAME 0xFFC01010 /* PPI0 Frame Length register */
319
320/*Parallel Peripheral Interface (PPI) 1 registers (0xFFC0 1300-0xFFC0 13FF) */
321#define PPI1_CONTROL 0xFFC01300 /* PPI1 Control register */
322#define PPI1_STATUS 0xFFC01304 /* PPI1 Status register */
323#define PPI1_COUNT 0xFFC01308 /* PPI1 Transfer Count register */
324#define PPI1_DELAY 0xFFC0130C /* PPI1 Delay Count register */
325#define PPI1_FRAME 0xFFC01310 /* PPI1 Frame Length register */
326
327/*DMA traffic control registers */
328#define DMA1_TC_PER 0xFFC01B0C /* Traffic control periods */
329#define DMA1_TC_CNT 0xFFC01B10 /* Traffic control current counts */
330#define DMA2_TC_PER 0xFFC00B0C /* Traffic control periods */
331#define DMA2_TC_CNT 0xFFC00B10 /* Traffic control current counts */
332
333/* DMA1 Controller registers (0xFFC0 1C00-0xFFC0 1FFF) */
334#define DMA1_0_CONFIG 0xFFC01C08 /* DMA1 Channel 0 Configuration register */
335#define DMA1_0_NEXT_DESC_PTR 0xFFC01C00 /* DMA1 Channel 0 Next Descripter Ptr Reg */
336#define DMA1_0_START_ADDR 0xFFC01C04 /* DMA1 Channel 0 Start Address */
337#define DMA1_0_X_COUNT 0xFFC01C10 /* DMA1 Channel 0 Inner Loop Count */
338#define DMA1_0_Y_COUNT 0xFFC01C18 /* DMA1 Channel 0 Outer Loop Count */
339#define DMA1_0_X_MODIFY 0xFFC01C14 /* DMA1 Channel 0 Inner Loop Addr Increment */
340#define DMA1_0_Y_MODIFY 0xFFC01C1C /* DMA1 Channel 0 Outer Loop Addr Increment */
341#define DMA1_0_CURR_DESC_PTR 0xFFC01C20 /* DMA1 Channel 0 Current Descriptor Pointer */
342#define DMA1_0_CURR_ADDR 0xFFC01C24 /* DMA1 Channel 0 Current Address Pointer */
343#define DMA1_0_CURR_X_COUNT 0xFFC01C30 /* DMA1 Channel 0 Current Inner Loop Count */
344#define DMA1_0_CURR_Y_COUNT 0xFFC01C38 /* DMA1 Channel 0 Current Outer Loop Count */
345#define DMA1_0_IRQ_STATUS 0xFFC01C28 /* DMA1 Channel 0 Interrupt/Status Register */
346#define DMA1_0_PERIPHERAL_MAP 0xFFC01C2C /* DMA1 Channel 0 Peripheral Map Register */
347
348#define DMA1_1_CONFIG 0xFFC01C48 /* DMA1 Channel 1 Configuration register */
349#define DMA1_1_NEXT_DESC_PTR 0xFFC01C40 /* DMA1 Channel 1 Next Descripter Ptr Reg */
350#define DMA1_1_START_ADDR 0xFFC01C44 /* DMA1 Channel 1 Start Address */
351#define DMA1_1_X_COUNT 0xFFC01C50 /* DMA1 Channel 1 Inner Loop Count */
352#define DMA1_1_Y_COUNT 0xFFC01C58 /* DMA1 Channel 1 Outer Loop Count */
353#define DMA1_1_X_MODIFY 0xFFC01C54 /* DMA1 Channel 1 Inner Loop Addr Increment */
354#define DMA1_1_Y_MODIFY 0xFFC01C5C /* DMA1 Channel 1 Outer Loop Addr Increment */
355#define DMA1_1_CURR_DESC_PTR 0xFFC01C60 /* DMA1 Channel 1 Current Descriptor Pointer */
356#define DMA1_1_CURR_ADDR 0xFFC01C64 /* DMA1 Channel 1 Current Address Pointer */
357#define DMA1_1_CURR_X_COUNT 0xFFC01C70 /* DMA1 Channel 1 Current Inner Loop Count */
358#define DMA1_1_CURR_Y_COUNT 0xFFC01C78 /* DMA1 Channel 1 Current Outer Loop Count */
359#define DMA1_1_IRQ_STATUS 0xFFC01C68 /* DMA1 Channel 1 Interrupt/Status Register */
360#define DMA1_1_PERIPHERAL_MAP 0xFFC01C6C /* DMA1 Channel 1 Peripheral Map Register */
361
362#define DMA1_2_CONFIG 0xFFC01C88 /* DMA1 Channel 2 Configuration register */
363#define DMA1_2_NEXT_DESC_PTR 0xFFC01C80 /* DMA1 Channel 2 Next Descripter Ptr Reg */
364#define DMA1_2_START_ADDR 0xFFC01C84 /* DMA1 Channel 2 Start Address */
365#define DMA1_2_X_COUNT 0xFFC01C90 /* DMA1 Channel 2 Inner Loop Count */
366#define DMA1_2_Y_COUNT 0xFFC01C98 /* DMA1 Channel 2 Outer Loop Count */
367#define DMA1_2_X_MODIFY 0xFFC01C94 /* DMA1 Channel 2 Inner Loop Addr Increment */
368#define DMA1_2_Y_MODIFY 0xFFC01C9C /* DMA1 Channel 2 Outer Loop Addr Increment */
369#define DMA1_2_CURR_DESC_PTR 0xFFC01CA0 /* DMA1 Channel 2 Current Descriptor Pointer */
370#define DMA1_2_CURR_ADDR 0xFFC01CA4 /* DMA1 Channel 2 Current Address Pointer */
371#define DMA1_2_CURR_X_COUNT 0xFFC01CB0 /* DMA1 Channel 2 Current Inner Loop Count */
372#define DMA1_2_CURR_Y_COUNT 0xFFC01CB8 /* DMA1 Channel 2 Current Outer Loop Count */
373#define DMA1_2_IRQ_STATUS 0xFFC01CA8 /* DMA1 Channel 2 Interrupt/Status Register */
374#define DMA1_2_PERIPHERAL_MAP 0xFFC01CAC /* DMA1 Channel 2 Peripheral Map Register */
375
376#define DMA1_3_CONFIG 0xFFC01CC8 /* DMA1 Channel 3 Configuration register */
377#define DMA1_3_NEXT_DESC_PTR 0xFFC01CC0 /* DMA1 Channel 3 Next Descripter Ptr Reg */
378#define DMA1_3_START_ADDR 0xFFC01CC4 /* DMA1 Channel 3 Start Address */
379#define DMA1_3_X_COUNT 0xFFC01CD0 /* DMA1 Channel 3 Inner Loop Count */
380#define DMA1_3_Y_COUNT 0xFFC01CD8 /* DMA1 Channel 3 Outer Loop Count */
381#define DMA1_3_X_MODIFY 0xFFC01CD4 /* DMA1 Channel 3 Inner Loop Addr Increment */
382#define DMA1_3_Y_MODIFY 0xFFC01CDC /* DMA1 Channel 3 Outer Loop Addr Increment */
383#define DMA1_3_CURR_DESC_PTR 0xFFC01CE0 /* DMA1 Channel 3 Current Descriptor Pointer */
384#define DMA1_3_CURR_ADDR 0xFFC01CE4 /* DMA1 Channel 3 Current Address Pointer */
385#define DMA1_3_CURR_X_COUNT 0xFFC01CF0 /* DMA1 Channel 3 Current Inner Loop Count */
386#define DMA1_3_CURR_Y_COUNT 0xFFC01CF8 /* DMA1 Channel 3 Current Outer Loop Count */
387#define DMA1_3_IRQ_STATUS 0xFFC01CE8 /* DMA1 Channel 3 Interrupt/Status Register */
388#define DMA1_3_PERIPHERAL_MAP 0xFFC01CEC /* DMA1 Channel 3 Peripheral Map Register */
389
390#define DMA1_4_CONFIG 0xFFC01D08 /* DMA1 Channel 4 Configuration register */
391#define DMA1_4_NEXT_DESC_PTR 0xFFC01D00 /* DMA1 Channel 4 Next Descripter Ptr Reg */
392#define DMA1_4_START_ADDR 0xFFC01D04 /* DMA1 Channel 4 Start Address */
393#define DMA1_4_X_COUNT 0xFFC01D10 /* DMA1 Channel 4 Inner Loop Count */
394#define DMA1_4_Y_COUNT 0xFFC01D18 /* DMA1 Channel 4 Outer Loop Count */
395#define DMA1_4_X_MODIFY 0xFFC01D14 /* DMA1 Channel 4 Inner Loop Addr Increment */
396#define DMA1_4_Y_MODIFY 0xFFC01D1C /* DMA1 Channel 4 Outer Loop Addr Increment */
397#define DMA1_4_CURR_DESC_PTR 0xFFC01D20 /* DMA1 Channel 4 Current Descriptor Pointer */
398#define DMA1_4_CURR_ADDR 0xFFC01D24 /* DMA1 Channel 4 Current Address Pointer */
399#define DMA1_4_CURR_X_COUNT 0xFFC01D30 /* DMA1 Channel 4 Current Inner Loop Count */
400#define DMA1_4_CURR_Y_COUNT 0xFFC01D38 /* DMA1 Channel 4 Current Outer Loop Count */
401#define DMA1_4_IRQ_STATUS 0xFFC01D28 /* DMA1 Channel 4 Interrupt/Status Register */
402#define DMA1_4_PERIPHERAL_MAP 0xFFC01D2C /* DMA1 Channel 4 Peripheral Map Register */
403
404#define DMA1_5_CONFIG 0xFFC01D48 /* DMA1 Channel 5 Configuration register */
405#define DMA1_5_NEXT_DESC_PTR 0xFFC01D40 /* DMA1 Channel 5 Next Descripter Ptr Reg */
406#define DMA1_5_START_ADDR 0xFFC01D44 /* DMA1 Channel 5 Start Address */
407#define DMA1_5_X_COUNT 0xFFC01D50 /* DMA1 Channel 5 Inner Loop Count */
408#define DMA1_5_Y_COUNT 0xFFC01D58 /* DMA1 Channel 5 Outer Loop Count */
409#define DMA1_5_X_MODIFY 0xFFC01D54 /* DMA1 Channel 5 Inner Loop Addr Increment */
410#define DMA1_5_Y_MODIFY 0xFFC01D5C /* DMA1 Channel 5 Outer Loop Addr Increment */
411#define DMA1_5_CURR_DESC_PTR 0xFFC01D60 /* DMA1 Channel 5 Current Descriptor Pointer */
412#define DMA1_5_CURR_ADDR 0xFFC01D64 /* DMA1 Channel 5 Current Address Pointer */
413#define DMA1_5_CURR_X_COUNT 0xFFC01D70 /* DMA1 Channel 5 Current Inner Loop Count */
414#define DMA1_5_CURR_Y_COUNT 0xFFC01D78 /* DMA1 Channel 5 Current Outer Loop Count */
415#define DMA1_5_IRQ_STATUS 0xFFC01D68 /* DMA1 Channel 5 Interrupt/Status Register */
416#define DMA1_5_PERIPHERAL_MAP 0xFFC01D6C /* DMA1 Channel 5 Peripheral Map Register */
417
418#define DMA1_6_CONFIG 0xFFC01D88 /* DMA1 Channel 6 Configuration register */
419#define DMA1_6_NEXT_DESC_PTR 0xFFC01D80 /* DMA1 Channel 6 Next Descripter Ptr Reg */
420#define DMA1_6_START_ADDR 0xFFC01D84 /* DMA1 Channel 6 Start Address */
421#define DMA1_6_X_COUNT 0xFFC01D90 /* DMA1 Channel 6 Inner Loop Count */
422#define DMA1_6_Y_COUNT 0xFFC01D98 /* DMA1 Channel 6 Outer Loop Count */
423#define DMA1_6_X_MODIFY 0xFFC01D94 /* DMA1 Channel 6 Inner Loop Addr Increment */
424#define DMA1_6_Y_MODIFY 0xFFC01D9C /* DMA1 Channel 6 Outer Loop Addr Increment */
425#define DMA1_6_CURR_DESC_PTR 0xFFC01DA0 /* DMA1 Channel 6 Current Descriptor Pointer */
426#define DMA1_6_CURR_ADDR 0xFFC01DA4 /* DMA1 Channel 6 Current Address Pointer */
427#define DMA1_6_CURR_X_COUNT 0xFFC01DB0 /* DMA1 Channel 6 Current Inner Loop Count */
428#define DMA1_6_CURR_Y_COUNT 0xFFC01DB8 /* DMA1 Channel 6 Current Outer Loop Count */
429#define DMA1_6_IRQ_STATUS 0xFFC01DA8 /* DMA1 Channel 6 Interrupt/Status Register */
430#define DMA1_6_PERIPHERAL_MAP 0xFFC01DAC /* DMA1 Channel 6 Peripheral Map Register */
431
432#define DMA1_7_CONFIG 0xFFC01DC8 /* DMA1 Channel 7 Configuration register */
433#define DMA1_7_NEXT_DESC_PTR 0xFFC01DC0 /* DMA1 Channel 7 Next Descripter Ptr Reg */
434#define DMA1_7_START_ADDR 0xFFC01DC4 /* DMA1 Channel 7 Start Address */
435#define DMA1_7_X_COUNT 0xFFC01DD0 /* DMA1 Channel 7 Inner Loop Count */
436#define DMA1_7_Y_COUNT 0xFFC01DD8 /* DMA1 Channel 7 Outer Loop Count */
437#define DMA1_7_X_MODIFY 0xFFC01DD4 /* DMA1 Channel 7 Inner Loop Addr Increment */
438#define DMA1_7_Y_MODIFY 0xFFC01DDC /* DMA1 Channel 7 Outer Loop Addr Increment */
439#define DMA1_7_CURR_DESC_PTR 0xFFC01DE0 /* DMA1 Channel 7 Current Descriptor Pointer */
440#define DMA1_7_CURR_ADDR 0xFFC01DE4 /* DMA1 Channel 7 Current Address Pointer */
441#define DMA1_7_CURR_X_COUNT 0xFFC01DF0 /* DMA1 Channel 7 Current Inner Loop Count */
442#define DMA1_7_CURR_Y_COUNT 0xFFC01DF8 /* DMA1 Channel 7 Current Outer Loop Count */
443#define DMA1_7_IRQ_STATUS 0xFFC01DE8 /* DMA1 Channel 7 Interrupt/Status Register */
444#define DMA1_7_PERIPHERAL_MAP 0xFFC01DEC /* DMA1 Channel 7 Peripheral Map Register */
445
446#define DMA1_8_CONFIG 0xFFC01E08 /* DMA1 Channel 8 Configuration register */
447#define DMA1_8_NEXT_DESC_PTR 0xFFC01E00 /* DMA1 Channel 8 Next Descripter Ptr Reg */
448#define DMA1_8_START_ADDR 0xFFC01E04 /* DMA1 Channel 8 Start Address */
449#define DMA1_8_X_COUNT 0xFFC01E10 /* DMA1 Channel 8 Inner Loop Count */
450#define DMA1_8_Y_COUNT 0xFFC01E18 /* DMA1 Channel 8 Outer Loop Count */
451#define DMA1_8_X_MODIFY 0xFFC01E14 /* DMA1 Channel 8 Inner Loop Addr Increment */
452#define DMA1_8_Y_MODIFY 0xFFC01E1C /* DMA1 Channel 8 Outer Loop Addr Increment */
453#define DMA1_8_CURR_DESC_PTR 0xFFC01E20 /* DMA1 Channel 8 Current Descriptor Pointer */
454#define DMA1_8_CURR_ADDR 0xFFC01E24 /* DMA1 Channel 8 Current Address Pointer */
455#define DMA1_8_CURR_X_COUNT 0xFFC01E30 /* DMA1 Channel 8 Current Inner Loop Count */
456#define DMA1_8_CURR_Y_COUNT 0xFFC01E38 /* DMA1 Channel 8 Current Outer Loop Count */
457#define DMA1_8_IRQ_STATUS 0xFFC01E28 /* DMA1 Channel 8 Interrupt/Status Register */
458#define DMA1_8_PERIPHERAL_MAP 0xFFC01E2C /* DMA1 Channel 8 Peripheral Map Register */
459
460#define DMA1_9_CONFIG 0xFFC01E48 /* DMA1 Channel 9 Configuration register */
461#define DMA1_9_NEXT_DESC_PTR 0xFFC01E40 /* DMA1 Channel 9 Next Descripter Ptr Reg */
462#define DMA1_9_START_ADDR 0xFFC01E44 /* DMA1 Channel 9 Start Address */
463#define DMA1_9_X_COUNT 0xFFC01E50 /* DMA1 Channel 9 Inner Loop Count */
464#define DMA1_9_Y_COUNT 0xFFC01E58 /* DMA1 Channel 9 Outer Loop Count */
465#define DMA1_9_X_MODIFY 0xFFC01E54 /* DMA1 Channel 9 Inner Loop Addr Increment */
466#define DMA1_9_Y_MODIFY 0xFFC01E5C /* DMA1 Channel 9 Outer Loop Addr Increment */
467#define DMA1_9_CURR_DESC_PTR 0xFFC01E60 /* DMA1 Channel 9 Current Descriptor Pointer */
468#define DMA1_9_CURR_ADDR 0xFFC01E64 /* DMA1 Channel 9 Current Address Pointer */
469#define DMA1_9_CURR_X_COUNT 0xFFC01E70 /* DMA1 Channel 9 Current Inner Loop Count */
470#define DMA1_9_CURR_Y_COUNT 0xFFC01E78 /* DMA1 Channel 9 Current Outer Loop Count */
471#define DMA1_9_IRQ_STATUS 0xFFC01E68 /* DMA1 Channel 9 Interrupt/Status Register */
472#define DMA1_9_PERIPHERAL_MAP 0xFFC01E6C /* DMA1 Channel 9 Peripheral Map Register */
473
474#define DMA1_10_CONFIG 0xFFC01E88 /* DMA1 Channel 10 Configuration register */
475#define DMA1_10_NEXT_DESC_PTR 0xFFC01E80 /* DMA1 Channel 10 Next Descripter Ptr Reg */
476#define DMA1_10_START_ADDR 0xFFC01E84 /* DMA1 Channel 10 Start Address */
477#define DMA1_10_X_COUNT 0xFFC01E90 /* DMA1 Channel 10 Inner Loop Count */
478#define DMA1_10_Y_COUNT 0xFFC01E98 /* DMA1 Channel 10 Outer Loop Count */
479#define DMA1_10_X_MODIFY 0xFFC01E94 /* DMA1 Channel 10 Inner Loop Addr Increment */
480#define DMA1_10_Y_MODIFY 0xFFC01E9C /* DMA1 Channel 10 Outer Loop Addr Increment */
481#define DMA1_10_CURR_DESC_PTR 0xFFC01EA0 /* DMA1 Channel 10 Current Descriptor Pointer */
482#define DMA1_10_CURR_ADDR 0xFFC01EA4 /* DMA1 Channel 10 Current Address Pointer */
483#define DMA1_10_CURR_X_COUNT 0xFFC01EB0 /* DMA1 Channel 10 Current Inner Loop Count */
484#define DMA1_10_CURR_Y_COUNT 0xFFC01EB8 /* DMA1 Channel 10 Current Outer Loop Count */
485#define DMA1_10_IRQ_STATUS 0xFFC01EA8 /* DMA1 Channel 10 Interrupt/Status Register */
486#define DMA1_10_PERIPHERAL_MAP 0xFFC01EAC /* DMA1 Channel 10 Peripheral Map Register */
487
488#define DMA1_11_CONFIG 0xFFC01EC8 /* DMA1 Channel 11 Configuration register */
489#define DMA1_11_NEXT_DESC_PTR 0xFFC01EC0 /* DMA1 Channel 11 Next Descripter Ptr Reg */
490#define DMA1_11_START_ADDR 0xFFC01EC4 /* DMA1 Channel 11 Start Address */
491#define DMA1_11_X_COUNT 0xFFC01ED0 /* DMA1 Channel 11 Inner Loop Count */
492#define DMA1_11_Y_COUNT 0xFFC01ED8 /* DMA1 Channel 11 Outer Loop Count */
493#define DMA1_11_X_MODIFY 0xFFC01ED4 /* DMA1 Channel 11 Inner Loop Addr Increment */
494#define DMA1_11_Y_MODIFY 0xFFC01EDC /* DMA1 Channel 11 Outer Loop Addr Increment */
495#define DMA1_11_CURR_DESC_PTR 0xFFC01EE0 /* DMA1 Channel 11 Current Descriptor Pointer */
496#define DMA1_11_CURR_ADDR 0xFFC01EE4 /* DMA1 Channel 11 Current Address Pointer */
497#define DMA1_11_CURR_X_COUNT 0xFFC01EF0 /* DMA1 Channel 11 Current Inner Loop Count */
498#define DMA1_11_CURR_Y_COUNT 0xFFC01EF8 /* DMA1 Channel 11 Current Outer Loop Count */
499#define DMA1_11_IRQ_STATUS 0xFFC01EE8 /* DMA1 Channel 11 Interrupt/Status Register */
500#define DMA1_11_PERIPHERAL_MAP 0xFFC01EEC /* DMA1 Channel 11 Peripheral Map Register */
501
502/* Memory DMA1 Controller registers (0xFFC0 1E80-0xFFC0 1FFF) */
503#define MDMA1_D0_CONFIG 0xFFC01F08 /*MemDMA1 Stream 0 Destination Configuration */
504#define MDMA1_D0_NEXT_DESC_PTR 0xFFC01F00 /*MemDMA1 Stream 0 Destination Next Descriptor Ptr Reg */
505#define MDMA1_D0_START_ADDR 0xFFC01F04 /*MemDMA1 Stream 0 Destination Start Address */
506#define MDMA1_D0_X_COUNT 0xFFC01F10 /*MemDMA1 Stream 0 Destination Inner-Loop Count */
507#define MDMA1_D0_Y_COUNT 0xFFC01F18 /*MemDMA1 Stream 0 Destination Outer-Loop Count */
508#define MDMA1_D0_X_MODIFY 0xFFC01F14 /*MemDMA1 Stream 0 Dest Inner-Loop Address-Increment */
509#define MDMA1_D0_Y_MODIFY 0xFFC01F1C /*MemDMA1 Stream 0 Dest Outer-Loop Address-Increment */
510#define MDMA1_D0_CURR_DESC_PTR 0xFFC01F20 /*MemDMA1 Stream 0 Dest Current Descriptor Ptr reg */
511#define MDMA1_D0_CURR_ADDR 0xFFC01F24 /*MemDMA1 Stream 0 Destination Current Address */
512#define MDMA1_D0_CURR_X_COUNT 0xFFC01F30 /*MemDMA1 Stream 0 Dest Current Inner-Loop Count */
513#define MDMA1_D0_CURR_Y_COUNT 0xFFC01F38 /*MemDMA1 Stream 0 Dest Current Outer-Loop Count */
514#define MDMA1_D0_IRQ_STATUS 0xFFC01F28 /*MemDMA1 Stream 0 Destination Interrupt/Status */
515#define MDMA1_D0_PERIPHERAL_MAP 0xFFC01F2C /*MemDMA1 Stream 0 Destination Peripheral Map */
516
517#define MDMA1_S0_CONFIG 0xFFC01F48 /*MemDMA1 Stream 0 Source Configuration */
518#define MDMA1_S0_NEXT_DESC_PTR 0xFFC01F40 /*MemDMA1 Stream 0 Source Next Descriptor Ptr Reg */
519#define MDMA1_S0_START_ADDR 0xFFC01F44 /*MemDMA1 Stream 0 Source Start Address */
520#define MDMA1_S0_X_COUNT 0xFFC01F50 /*MemDMA1 Stream 0 Source Inner-Loop Count */
521#define MDMA1_S0_Y_COUNT 0xFFC01F58 /*MemDMA1 Stream 0 Source Outer-Loop Count */
522#define MDMA1_S0_X_MODIFY 0xFFC01F54 /*MemDMA1 Stream 0 Source Inner-Loop Address-Increment */
523#define MDMA1_S0_Y_MODIFY 0xFFC01F5C /*MemDMA1 Stream 0 Source Outer-Loop Address-Increment */
524#define MDMA1_S0_CURR_DESC_PTR 0xFFC01F60 /*MemDMA1 Stream 0 Source Current Descriptor Ptr reg */
525#define MDMA1_S0_CURR_ADDR 0xFFC01F64 /*MemDMA1 Stream 0 Source Current Address */
526#define MDMA1_S0_CURR_X_COUNT 0xFFC01F70 /*MemDMA1 Stream 0 Source Current Inner-Loop Count */
527#define MDMA1_S0_CURR_Y_COUNT 0xFFC01F78 /*MemDMA1 Stream 0 Source Current Outer-Loop Count */
528#define MDMA1_S0_IRQ_STATUS 0xFFC01F68 /*MemDMA1 Stream 0 Source Interrupt/Status */
529#define MDMA1_S0_PERIPHERAL_MAP 0xFFC01F6C /*MemDMA1 Stream 0 Source Peripheral Map */
530
531#define MDMA1_D1_CONFIG 0xFFC01F88 /*MemDMA1 Stream 1 Destination Configuration */
532#define MDMA1_D1_NEXT_DESC_PTR 0xFFC01F80 /*MemDMA1 Stream 1 Destination Next Descriptor Ptr Reg */
533#define MDMA1_D1_START_ADDR 0xFFC01F84 /*MemDMA1 Stream 1 Destination Start Address */
534#define MDMA1_D1_X_COUNT 0xFFC01F90 /*MemDMA1 Stream 1 Destination Inner-Loop Count */
535#define MDMA1_D1_Y_COUNT 0xFFC01F98 /*MemDMA1 Stream 1 Destination Outer-Loop Count */
536#define MDMA1_D1_X_MODIFY 0xFFC01F94 /*MemDMA1 Stream 1 Dest Inner-Loop Address-Increment */
537#define MDMA1_D1_Y_MODIFY 0xFFC01F9C /*MemDMA1 Stream 1 Dest Outer-Loop Address-Increment */
538#define MDMA1_D1_CURR_DESC_PTR 0xFFC01FA0 /*MemDMA1 Stream 1 Dest Current Descriptor Ptr reg */
539#define MDMA1_D1_CURR_ADDR 0xFFC01FA4 /*MemDMA1 Stream 1 Dest Current Address */
540#define MDMA1_D1_CURR_X_COUNT 0xFFC01FB0 /*MemDMA1 Stream 1 Dest Current Inner-Loop Count */
541#define MDMA1_D1_CURR_Y_COUNT 0xFFC01FB8 /*MemDMA1 Stream 1 Dest Current Outer-Loop Count */
542#define MDMA1_D1_IRQ_STATUS 0xFFC01FA8 /*MemDMA1 Stream 1 Dest Interrupt/Status */
543#define MDMA1_D1_PERIPHERAL_MAP 0xFFC01FAC /*MemDMA1 Stream 1 Dest Peripheral Map */
544
545#define MDMA1_S1_CONFIG 0xFFC01FC8 /*MemDMA1 Stream 1 Source Configuration */
546#define MDMA1_S1_NEXT_DESC_PTR 0xFFC01FC0 /*MemDMA1 Stream 1 Source Next Descriptor Ptr Reg */
547#define MDMA1_S1_START_ADDR 0xFFC01FC4 /*MemDMA1 Stream 1 Source Start Address */
548#define MDMA1_S1_X_COUNT 0xFFC01FD0 /*MemDMA1 Stream 1 Source Inner-Loop Count */
549#define MDMA1_S1_Y_COUNT 0xFFC01FD8 /*MemDMA1 Stream 1 Source Outer-Loop Count */
550#define MDMA1_S1_X_MODIFY 0xFFC01FD4 /*MemDMA1 Stream 1 Source Inner-Loop Address-Increment */
551#define MDMA1_S1_Y_MODIFY 0xFFC01FDC /*MemDMA1 Stream 1 Source Outer-Loop Address-Increment */
552#define MDMA1_S1_CURR_DESC_PTR 0xFFC01FE0 /*MemDMA1 Stream 1 Source Current Descriptor Ptr reg */
553#define MDMA1_S1_CURR_ADDR 0xFFC01FE4 /*MemDMA1 Stream 1 Source Current Address */
554#define MDMA1_S1_CURR_X_COUNT 0xFFC01FF0 /*MemDMA1 Stream 1 Source Current Inner-Loop Count */
555#define MDMA1_S1_CURR_Y_COUNT 0xFFC01FF8 /*MemDMA1 Stream 1 Source Current Outer-Loop Count */
556#define MDMA1_S1_IRQ_STATUS 0xFFC01FE8 /*MemDMA1 Stream 1 Source Interrupt/Status */
557#define MDMA1_S1_PERIPHERAL_MAP 0xFFC01FEC /*MemDMA1 Stream 1 Source Peripheral Map */
558
559/* DMA2 Controller registers (0xFFC0 0C00-0xFFC0 0DFF) */
560#define DMA2_0_CONFIG 0xFFC00C08 /* DMA2 Channel 0 Configuration register */
561#define DMA2_0_NEXT_DESC_PTR 0xFFC00C00 /* DMA2 Channel 0 Next Descripter Ptr Reg */
562#define DMA2_0_START_ADDR 0xFFC00C04 /* DMA2 Channel 0 Start Address */
563#define DMA2_0_X_COUNT 0xFFC00C10 /* DMA2 Channel 0 Inner Loop Count */
564#define DMA2_0_Y_COUNT 0xFFC00C18 /* DMA2 Channel 0 Outer Loop Count */
565#define DMA2_0_X_MODIFY 0xFFC00C14 /* DMA2 Channel 0 Inner Loop Addr Increment */
566#define DMA2_0_Y_MODIFY 0xFFC00C1C /* DMA2 Channel 0 Outer Loop Addr Increment */
567#define DMA2_0_CURR_DESC_PTR 0xFFC00C20 /* DMA2 Channel 0 Current Descriptor Pointer */
568#define DMA2_0_CURR_ADDR 0xFFC00C24 /* DMA2 Channel 0 Current Address Pointer */
569#define DMA2_0_CURR_X_COUNT 0xFFC00C30 /* DMA2 Channel 0 Current Inner Loop Count */
570#define DMA2_0_CURR_Y_COUNT 0xFFC00C38 /* DMA2 Channel 0 Current Outer Loop Count */
571#define DMA2_0_IRQ_STATUS 0xFFC00C28 /* DMA2 Channel 0 Interrupt/Status Register */
572#define DMA2_0_PERIPHERAL_MAP 0xFFC00C2C /* DMA2 Channel 0 Peripheral Map Register */
573
574#define DMA2_1_CONFIG 0xFFC00C48 /* DMA2 Channel 1 Configuration register */
575#define DMA2_1_NEXT_DESC_PTR 0xFFC00C40 /* DMA2 Channel 1 Next Descripter Ptr Reg */
576#define DMA2_1_START_ADDR 0xFFC00C44 /* DMA2 Channel 1 Start Address */
577#define DMA2_1_X_COUNT 0xFFC00C50 /* DMA2 Channel 1 Inner Loop Count */
578#define DMA2_1_Y_COUNT 0xFFC00C58 /* DMA2 Channel 1 Outer Loop Count */
579#define DMA2_1_X_MODIFY 0xFFC00C54 /* DMA2 Channel 1 Inner Loop Addr Increment */
580#define DMA2_1_Y_MODIFY 0xFFC00C5C /* DMA2 Channel 1 Outer Loop Addr Increment */
581#define DMA2_1_CURR_DESC_PTR 0xFFC00C60 /* DMA2 Channel 1 Current Descriptor Pointer */
582#define DMA2_1_CURR_ADDR 0xFFC00C64 /* DMA2 Channel 1 Current Address Pointer */
583#define DMA2_1_CURR_X_COUNT 0xFFC00C70 /* DMA2 Channel 1 Current Inner Loop Count */
584#define DMA2_1_CURR_Y_COUNT 0xFFC00C78 /* DMA2 Channel 1 Current Outer Loop Count */
585#define DMA2_1_IRQ_STATUS 0xFFC00C68 /* DMA2 Channel 1 Interrupt/Status Register */
586#define DMA2_1_PERIPHERAL_MAP 0xFFC00C6C /* DMA2 Channel 1 Peripheral Map Register */
587
588#define DMA2_2_CONFIG 0xFFC00C88 /* DMA2 Channel 2 Configuration register */
589#define DMA2_2_NEXT_DESC_PTR 0xFFC00C80 /* DMA2 Channel 2 Next Descripter Ptr Reg */
590#define DMA2_2_START_ADDR 0xFFC00C84 /* DMA2 Channel 2 Start Address */
591#define DMA2_2_X_COUNT 0xFFC00C90 /* DMA2 Channel 2 Inner Loop Count */
592#define DMA2_2_Y_COUNT 0xFFC00C98 /* DMA2 Channel 2 Outer Loop Count */
593#define DMA2_2_X_MODIFY 0xFFC00C94 /* DMA2 Channel 2 Inner Loop Addr Increment */
594#define DMA2_2_Y_MODIFY 0xFFC00C9C /* DMA2 Channel 2 Outer Loop Addr Increment */
595#define DMA2_2_CURR_DESC_PTR 0xFFC00CA0 /* DMA2 Channel 2 Current Descriptor Pointer */
596#define DMA2_2_CURR_ADDR 0xFFC00CA4 /* DMA2 Channel 2 Current Address Pointer */
597#define DMA2_2_CURR_X_COUNT 0xFFC00CB0 /* DMA2 Channel 2 Current Inner Loop Count */
598#define DMA2_2_CURR_Y_COUNT 0xFFC00CB8 /* DMA2 Channel 2 Current Outer Loop Count */
599#define DMA2_2_IRQ_STATUS 0xFFC00CA8 /* DMA2 Channel 2 Interrupt/Status Register */
600#define DMA2_2_PERIPHERAL_MAP 0xFFC00CAC /* DMA2 Channel 2 Peripheral Map Register */
601
602#define DMA2_3_CONFIG 0xFFC00CC8 /* DMA2 Channel 3 Configuration register */
603#define DMA2_3_NEXT_DESC_PTR 0xFFC00CC0 /* DMA2 Channel 3 Next Descripter Ptr Reg */
604#define DMA2_3_START_ADDR 0xFFC00CC4 /* DMA2 Channel 3 Start Address */
605#define DMA2_3_X_COUNT 0xFFC00CD0 /* DMA2 Channel 3 Inner Loop Count */
606#define DMA2_3_Y_COUNT 0xFFC00CD8 /* DMA2 Channel 3 Outer Loop Count */
607#define DMA2_3_X_MODIFY 0xFFC00CD4 /* DMA2 Channel 3 Inner Loop Addr Increment */
608#define DMA2_3_Y_MODIFY 0xFFC00CDC /* DMA2 Channel 3 Outer Loop Addr Increment */
609#define DMA2_3_CURR_DESC_PTR 0xFFC00CE0 /* DMA2 Channel 3 Current Descriptor Pointer */
610#define DMA2_3_CURR_ADDR 0xFFC00CE4 /* DMA2 Channel 3 Current Address Pointer */
611#define DMA2_3_CURR_X_COUNT 0xFFC00CF0 /* DMA2 Channel 3 Current Inner Loop Count */
612#define DMA2_3_CURR_Y_COUNT 0xFFC00CF8 /* DMA2 Channel 3 Current Outer Loop Count */
613#define DMA2_3_IRQ_STATUS 0xFFC00CE8 /* DMA2 Channel 3 Interrupt/Status Register */
614#define DMA2_3_PERIPHERAL_MAP 0xFFC00CEC /* DMA2 Channel 3 Peripheral Map Register */
615
616#define DMA2_4_CONFIG 0xFFC00D08 /* DMA2 Channel 4 Configuration register */
617#define DMA2_4_NEXT_DESC_PTR 0xFFC00D00 /* DMA2 Channel 4 Next Descripter Ptr Reg */
618#define DMA2_4_START_ADDR 0xFFC00D04 /* DMA2 Channel 4 Start Address */
619#define DMA2_4_X_COUNT 0xFFC00D10 /* DMA2 Channel 4 Inner Loop Count */
620#define DMA2_4_Y_COUNT 0xFFC00D18 /* DMA2 Channel 4 Outer Loop Count */
621#define DMA2_4_X_MODIFY 0xFFC00D14 /* DMA2 Channel 4 Inner Loop Addr Increment */
622#define DMA2_4_Y_MODIFY 0xFFC00D1C /* DMA2 Channel 4 Outer Loop Addr Increment */
623#define DMA2_4_CURR_DESC_PTR 0xFFC00D20 /* DMA2 Channel 4 Current Descriptor Pointer */
624#define DMA2_4_CURR_ADDR 0xFFC00D24 /* DMA2 Channel 4 Current Address Pointer */
625#define DMA2_4_CURR_X_COUNT 0xFFC00D30 /* DMA2 Channel 4 Current Inner Loop Count */
626#define DMA2_4_CURR_Y_COUNT 0xFFC00D38 /* DMA2 Channel 4 Current Outer Loop Count */
627#define DMA2_4_IRQ_STATUS 0xFFC00D28 /* DMA2 Channel 4 Interrupt/Status Register */
628#define DMA2_4_PERIPHERAL_MAP 0xFFC00D2C /* DMA2 Channel 4 Peripheral Map Register */
629
630#define DMA2_5_CONFIG 0xFFC00D48 /* DMA2 Channel 5 Configuration register */
631#define DMA2_5_NEXT_DESC_PTR 0xFFC00D40 /* DMA2 Channel 5 Next Descripter Ptr Reg */
632#define DMA2_5_START_ADDR 0xFFC00D44 /* DMA2 Channel 5 Start Address */
633#define DMA2_5_X_COUNT 0xFFC00D50 /* DMA2 Channel 5 Inner Loop Count */
634#define DMA2_5_Y_COUNT 0xFFC00D58 /* DMA2 Channel 5 Outer Loop Count */
635#define DMA2_5_X_MODIFY 0xFFC00D54 /* DMA2 Channel 5 Inner Loop Addr Increment */
636#define DMA2_5_Y_MODIFY 0xFFC00D5C /* DMA2 Channel 5 Outer Loop Addr Increment */
637#define DMA2_5_CURR_DESC_PTR 0xFFC00D60 /* DMA2 Channel 5 Current Descriptor Pointer */
638#define DMA2_5_CURR_ADDR 0xFFC00D64 /* DMA2 Channel 5 Current Address Pointer */
639#define DMA2_5_CURR_X_COUNT 0xFFC00D70 /* DMA2 Channel 5 Current Inner Loop Count */
640#define DMA2_5_CURR_Y_COUNT 0xFFC00D78 /* DMA2 Channel 5 Current Outer Loop Count */
641#define DMA2_5_IRQ_STATUS 0xFFC00D68 /* DMA2 Channel 5 Interrupt/Status Register */
642#define DMA2_5_PERIPHERAL_MAP 0xFFC00D6C /* DMA2 Channel 5 Peripheral Map Register */
643
644#define DMA2_6_CONFIG 0xFFC00D88 /* DMA2 Channel 6 Configuration register */
645#define DMA2_6_NEXT_DESC_PTR 0xFFC00D80 /* DMA2 Channel 6 Next Descripter Ptr Reg */
646#define DMA2_6_START_ADDR 0xFFC00D84 /* DMA2 Channel 6 Start Address */
647#define DMA2_6_X_COUNT 0xFFC00D90 /* DMA2 Channel 6 Inner Loop Count */
648#define DMA2_6_Y_COUNT 0xFFC00D98 /* DMA2 Channel 6 Outer Loop Count */
649#define DMA2_6_X_MODIFY 0xFFC00D94 /* DMA2 Channel 6 Inner Loop Addr Increment */
650#define DMA2_6_Y_MODIFY 0xFFC00D9C /* DMA2 Channel 6 Outer Loop Addr Increment */
651#define DMA2_6_CURR_DESC_PTR 0xFFC00DA0 /* DMA2 Channel 6 Current Descriptor Pointer */
652#define DMA2_6_CURR_ADDR 0xFFC00DA4 /* DMA2 Channel 6 Current Address Pointer */
653#define DMA2_6_CURR_X_COUNT 0xFFC00DB0 /* DMA2 Channel 6 Current Inner Loop Count */
654#define DMA2_6_CURR_Y_COUNT 0xFFC00DB8 /* DMA2 Channel 6 Current Outer Loop Count */
655#define DMA2_6_IRQ_STATUS 0xFFC00DA8 /* DMA2 Channel 6 Interrupt/Status Register */
656#define DMA2_6_PERIPHERAL_MAP 0xFFC00DAC /* DMA2 Channel 6 Peripheral Map Register */
657
658#define DMA2_7_CONFIG 0xFFC00DC8 /* DMA2 Channel 7 Configuration register */
659#define DMA2_7_NEXT_DESC_PTR 0xFFC00DC0 /* DMA2 Channel 7 Next Descripter Ptr Reg */
660#define DMA2_7_START_ADDR 0xFFC00DC4 /* DMA2 Channel 7 Start Address */
661#define DMA2_7_X_COUNT 0xFFC00DD0 /* DMA2 Channel 7 Inner Loop Count */
662#define DMA2_7_Y_COUNT 0xFFC00DD8 /* DMA2 Channel 7 Outer Loop Count */
663#define DMA2_7_X_MODIFY 0xFFC00DD4 /* DMA2 Channel 7 Inner Loop Addr Increment */
664#define DMA2_7_Y_MODIFY 0xFFC00DDC /* DMA2 Channel 7 Outer Loop Addr Increment */
665#define DMA2_7_CURR_DESC_PTR 0xFFC00DE0 /* DMA2 Channel 7 Current Descriptor Pointer */
666#define DMA2_7_CURR_ADDR 0xFFC00DE4 /* DMA2 Channel 7 Current Address Pointer */
667#define DMA2_7_CURR_X_COUNT 0xFFC00DF0 /* DMA2 Channel 7 Current Inner Loop Count */
668#define DMA2_7_CURR_Y_COUNT 0xFFC00DF8 /* DMA2 Channel 7 Current Outer Loop Count */
669#define DMA2_7_IRQ_STATUS 0xFFC00DE8 /* DMA2 Channel 7 Interrupt/Status Register */
670#define DMA2_7_PERIPHERAL_MAP 0xFFC00DEC /* DMA2 Channel 7 Peripheral Map Register */
671
672#define DMA2_8_CONFIG 0xFFC00E08 /* DMA2 Channel 8 Configuration register */
673#define DMA2_8_NEXT_DESC_PTR 0xFFC00E00 /* DMA2 Channel 8 Next Descripter Ptr Reg */
674#define DMA2_8_START_ADDR 0xFFC00E04 /* DMA2 Channel 8 Start Address */
675#define DMA2_8_X_COUNT 0xFFC00E10 /* DMA2 Channel 8 Inner Loop Count */
676#define DMA2_8_Y_COUNT 0xFFC00E18 /* DMA2 Channel 8 Outer Loop Count */
677#define DMA2_8_X_MODIFY 0xFFC00E14 /* DMA2 Channel 8 Inner Loop Addr Increment */
678#define DMA2_8_Y_MODIFY 0xFFC00E1C /* DMA2 Channel 8 Outer Loop Addr Increment */
679#define DMA2_8_CURR_DESC_PTR 0xFFC00E20 /* DMA2 Channel 8 Current Descriptor Pointer */
680#define DMA2_8_CURR_ADDR 0xFFC00E24 /* DMA2 Channel 8 Current Address Pointer */
681#define DMA2_8_CURR_X_COUNT 0xFFC00E30 /* DMA2 Channel 8 Current Inner Loop Count */
682#define DMA2_8_CURR_Y_COUNT 0xFFC00E38 /* DMA2 Channel 8 Current Outer Loop Count */
683#define DMA2_8_IRQ_STATUS 0xFFC00E28 /* DMA2 Channel 8 Interrupt/Status Register */
684#define DMA2_8_PERIPHERAL_MAP 0xFFC00E2C /* DMA2 Channel 8 Peripheral Map Register */
685
686#define DMA2_9_CONFIG 0xFFC00E48 /* DMA2 Channel 9 Configuration register */
687#define DMA2_9_NEXT_DESC_PTR 0xFFC00E40 /* DMA2 Channel 9 Next Descripter Ptr Reg */
688#define DMA2_9_START_ADDR 0xFFC00E44 /* DMA2 Channel 9 Start Address */
689#define DMA2_9_X_COUNT 0xFFC00E50 /* DMA2 Channel 9 Inner Loop Count */
690#define DMA2_9_Y_COUNT 0xFFC00E58 /* DMA2 Channel 9 Outer Loop Count */
691#define DMA2_9_X_MODIFY 0xFFC00E54 /* DMA2 Channel 9 Inner Loop Addr Increment */
692#define DMA2_9_Y_MODIFY 0xFFC00E5C /* DMA2 Channel 9 Outer Loop Addr Increment */
693#define DMA2_9_CURR_DESC_PTR 0xFFC00E60 /* DMA2 Channel 9 Current Descriptor Pointer */
694#define DMA2_9_CURR_ADDR 0xFFC00E64 /* DMA2 Channel 9 Current Address Pointer */
695#define DMA2_9_CURR_X_COUNT 0xFFC00E70 /* DMA2 Channel 9 Current Inner Loop Count */
696#define DMA2_9_CURR_Y_COUNT 0xFFC00E78 /* DMA2 Channel 9 Current Outer Loop Count */
697#define DMA2_9_IRQ_STATUS 0xFFC00E68 /* DMA2 Channel 9 Interrupt/Status Register */
698#define DMA2_9_PERIPHERAL_MAP 0xFFC00E6C /* DMA2 Channel 9 Peripheral Map Register */
699
700#define DMA2_10_CONFIG 0xFFC00E88 /* DMA2 Channel 10 Configuration register */
701#define DMA2_10_NEXT_DESC_PTR 0xFFC00E80 /* DMA2 Channel 10 Next Descripter Ptr Reg */
702#define DMA2_10_START_ADDR 0xFFC00E84 /* DMA2 Channel 10 Start Address */
703#define DMA2_10_X_COUNT 0xFFC00E90 /* DMA2 Channel 10 Inner Loop Count */
704#define DMA2_10_Y_COUNT 0xFFC00E98 /* DMA2 Channel 10 Outer Loop Count */
705#define DMA2_10_X_MODIFY 0xFFC00E94 /* DMA2 Channel 10 Inner Loop Addr Increment */
706#define DMA2_10_Y_MODIFY 0xFFC00E9C /* DMA2 Channel 10 Outer Loop Addr Increment */
707#define DMA2_10_CURR_DESC_PTR 0xFFC00EA0 /* DMA2 Channel 10 Current Descriptor Pointer */
708#define DMA2_10_CURR_ADDR 0xFFC00EA4 /* DMA2 Channel 10 Current Address Pointer */
709#define DMA2_10_CURR_X_COUNT 0xFFC00EB0 /* DMA2 Channel 10 Current Inner Loop Count */
710#define DMA2_10_CURR_Y_COUNT 0xFFC00EB8 /* DMA2 Channel 10 Current Outer Loop Count */
711#define DMA2_10_IRQ_STATUS 0xFFC00EA8 /* DMA2 Channel 10 Interrupt/Status Register */
712#define DMA2_10_PERIPHERAL_MAP 0xFFC00EAC /* DMA2 Channel 10 Peripheral Map Register */
713
714#define DMA2_11_CONFIG 0xFFC00EC8 /* DMA2 Channel 11 Configuration register */
715#define DMA2_11_NEXT_DESC_PTR 0xFFC00EC0 /* DMA2 Channel 11 Next Descripter Ptr Reg */
716#define DMA2_11_START_ADDR 0xFFC00EC4 /* DMA2 Channel 11 Start Address */
717#define DMA2_11_X_COUNT 0xFFC00ED0 /* DMA2 Channel 11 Inner Loop Count */
718#define DMA2_11_Y_COUNT 0xFFC00ED8 /* DMA2 Channel 11 Outer Loop Count */
719#define DMA2_11_X_MODIFY 0xFFC00ED4 /* DMA2 Channel 11 Inner Loop Addr Increment */
720#define DMA2_11_Y_MODIFY 0xFFC00EDC /* DMA2 Channel 11 Outer Loop Addr Increment */
721#define DMA2_11_CURR_DESC_PTR 0xFFC00EE0 /* DMA2 Channel 11 Current Descriptor Pointer */
722#define DMA2_11_CURR_ADDR 0xFFC00EE4 /* DMA2 Channel 11 Current Address Pointer */
723#define DMA2_11_CURR_X_COUNT 0xFFC00EF0 /* DMA2 Channel 11 Current Inner Loop Count */
724#define DMA2_11_CURR_Y_COUNT 0xFFC00EF8 /* DMA2 Channel 11 Current Outer Loop Count */
725#define DMA2_11_IRQ_STATUS 0xFFC00EE8 /* DMA2 Channel 11 Interrupt/Status Register */
726#define DMA2_11_PERIPHERAL_MAP 0xFFC00EEC /* DMA2 Channel 11 Peripheral Map Register */
727
728/* Memory DMA2 Controller registers (0xFFC0 0E80-0xFFC0 0FFF) */
729#define MDMA2_D0_CONFIG 0xFFC00F08 /*MemDMA2 Stream 0 Destination Configuration register */
730#define MDMA2_D0_NEXT_DESC_PTR 0xFFC00F00 /*MemDMA2 Stream 0 Destination Next Descriptor Ptr Reg */
731#define MDMA2_D0_START_ADDR 0xFFC00F04 /*MemDMA2 Stream 0 Destination Start Address */
732#define MDMA2_D0_X_COUNT 0xFFC00F10 /*MemDMA2 Stream 0 Dest Inner-Loop Count register */
733#define MDMA2_D0_Y_COUNT 0xFFC00F18 /*MemDMA2 Stream 0 Dest Outer-Loop Count register */
734#define MDMA2_D0_X_MODIFY 0xFFC00F14 /*MemDMA2 Stream 0 Dest Inner-Loop Address-Increment */
735#define MDMA2_D0_Y_MODIFY 0xFFC00F1C /*MemDMA2 Stream 0 Dest Outer-Loop Address-Increment */
736#define MDMA2_D0_CURR_DESC_PTR 0xFFC00F20 /*MemDMA2 Stream 0 Dest Current Descriptor Ptr reg */
737#define MDMA2_D0_CURR_ADDR 0xFFC00F24 /*MemDMA2 Stream 0 Destination Current Address */
738#define MDMA2_D0_CURR_X_COUNT 0xFFC00F30 /*MemDMA2 Stream 0 Dest Current Inner-Loop Count reg */
739#define MDMA2_D0_CURR_Y_COUNT 0xFFC00F38 /*MemDMA2 Stream 0 Dest Current Outer-Loop Count reg */
740#define MDMA2_D0_IRQ_STATUS 0xFFC00F28 /*MemDMA2 Stream 0 Dest Interrupt/Status Register */
741#define MDMA2_D0_PERIPHERAL_MAP 0xFFC00F2C /*MemDMA2 Stream 0 Destination Peripheral Map register */
742
743#define MDMA2_S0_CONFIG 0xFFC00F48 /*MemDMA2 Stream 0 Source Configuration register */
744#define MDMA2_S0_NEXT_DESC_PTR 0xFFC00F40 /*MemDMA2 Stream 0 Source Next Descriptor Ptr Reg */
745#define MDMA2_S0_START_ADDR 0xFFC00F44 /*MemDMA2 Stream 0 Source Start Address */
746#define MDMA2_S0_X_COUNT 0xFFC00F50 /*MemDMA2 Stream 0 Source Inner-Loop Count register */
747#define MDMA2_S0_Y_COUNT 0xFFC00F58 /*MemDMA2 Stream 0 Source Outer-Loop Count register */
748#define MDMA2_S0_X_MODIFY 0xFFC00F54 /*MemDMA2 Stream 0 Src Inner-Loop Addr-Increment reg */
749#define MDMA2_S0_Y_MODIFY 0xFFC00F5C /*MemDMA2 Stream 0 Src Outer-Loop Addr-Increment reg */
750#define MDMA2_S0_CURR_DESC_PTR 0xFFC00F60 /*MemDMA2 Stream 0 Source Current Descriptor Ptr reg */
751#define MDMA2_S0_CURR_ADDR 0xFFC00F64 /*MemDMA2 Stream 0 Source Current Address */
752#define MDMA2_S0_CURR_X_COUNT 0xFFC00F70 /*MemDMA2 Stream 0 Src Current Inner-Loop Count reg */
753#define MDMA2_S0_CURR_Y_COUNT 0xFFC00F78 /*MemDMA2 Stream 0 Src Current Outer-Loop Count reg */
754#define MDMA2_S0_IRQ_STATUS 0xFFC00F68 /*MemDMA2 Stream 0 Source Interrupt/Status Register */
755#define MDMA2_S0_PERIPHERAL_MAP 0xFFC00F6C /*MemDMA2 Stream 0 Source Peripheral Map register */
756
757#define MDMA2_D1_CONFIG 0xFFC00F88 /*MemDMA2 Stream 1 Destination Configuration register */
758#define MDMA2_D1_NEXT_DESC_PTR 0xFFC00F80 /*MemDMA2 Stream 1 Destination Next Descriptor Ptr Reg */
759#define MDMA2_D1_START_ADDR 0xFFC00F84 /*MemDMA2 Stream 1 Destination Start Address */
760#define MDMA2_D1_X_COUNT 0xFFC00F90 /*MemDMA2 Stream 1 Dest Inner-Loop Count register */
761#define MDMA2_D1_Y_COUNT 0xFFC00F98 /*MemDMA2 Stream 1 Dest Outer-Loop Count register */
762#define MDMA2_D1_X_MODIFY 0xFFC00F94 /*MemDMA2 Stream 1 Dest Inner-Loop Address-Increment */
763#define MDMA2_D1_Y_MODIFY 0xFFC00F9C /*MemDMA2 Stream 1 Dest Outer-Loop Address-Increment */
764#define MDMA2_D1_CURR_DESC_PTR 0xFFC00FA0 /*MemDMA2 Stream 1 Destination Current Descriptor Ptr */
765#define MDMA2_D1_CURR_ADDR 0xFFC00FA4 /*MemDMA2 Stream 1 Destination Current Address reg */
766#define MDMA2_D1_CURR_X_COUNT 0xFFC00FB0 /*MemDMA2 Stream 1 Dest Current Inner-Loop Count reg */
767#define MDMA2_D1_CURR_Y_COUNT 0xFFC00FB8 /*MemDMA2 Stream 1 Dest Current Outer-Loop Count reg */
768#define MDMA2_D1_IRQ_STATUS 0xFFC00FA8 /*MemDMA2 Stream 1 Destination Interrupt/Status Reg */
769#define MDMA2_D1_PERIPHERAL_MAP 0xFFC00FAC /*MemDMA2 Stream 1 Destination Peripheral Map register */
770
771#define MDMA2_S1_CONFIG 0xFFC00FC8 /*MemDMA2 Stream 1 Source Configuration register */
772#define MDMA2_S1_NEXT_DESC_PTR 0xFFC00FC0 /*MemDMA2 Stream 1 Source Next Descriptor Ptr Reg */
773#define MDMA2_S1_START_ADDR 0xFFC00FC4 /*MemDMA2 Stream 1 Source Start Address */
774#define MDMA2_S1_X_COUNT 0xFFC00FD0 /*MemDMA2 Stream 1 Source Inner-Loop Count register */
775#define MDMA2_S1_Y_COUNT 0xFFC00FD8 /*MemDMA2 Stream 1 Source Outer-Loop Count register */
776#define MDMA2_S1_X_MODIFY 0xFFC00FD4 /*MemDMA2 Stream 1 Src Inner-Loop Address-Increment */
777#define MDMA2_S1_Y_MODIFY 0xFFC00FDC /*MemDMA2 Stream 1 Source Outer-Loop Address-Increment */
778#define MDMA2_S1_CURR_DESC_PTR 0xFFC00FE0 /*MemDMA2 Stream 1 Source Current Descriptor Ptr reg */
779#define MDMA2_S1_CURR_ADDR 0xFFC00FE4 /*MemDMA2 Stream 1 Source Current Address */
780#define MDMA2_S1_CURR_X_COUNT 0xFFC00FF0 /*MemDMA2 Stream 1 Source Current Inner-Loop Count */
781#define MDMA2_S1_CURR_Y_COUNT 0xFFC00FF8 /*MemDMA2 Stream 1 Source Current Outer-Loop Count */
782#define MDMA2_S1_IRQ_STATUS 0xFFC00FE8 /*MemDMA2 Stream 1 Source Interrupt/Status Register */
783#define MDMA2_S1_PERIPHERAL_MAP 0xFFC00FEC /*MemDMA2 Stream 1 Source Peripheral Map register */
784
785/* Internal Memory DMA Registers (0xFFC0_1800 - 0xFFC0_19FF) */
786#define IMDMA_D0_CONFIG 0xFFC01808 /*IMDMA Stream 0 Destination Configuration */
787#define IMDMA_D0_NEXT_DESC_PTR 0xFFC01800 /*IMDMA Stream 0 Destination Next Descriptor Ptr Reg */
788#define IMDMA_D0_START_ADDR 0xFFC01804 /*IMDMA Stream 0 Destination Start Address */
789#define IMDMA_D0_X_COUNT 0xFFC01810 /*IMDMA Stream 0 Destination Inner-Loop Count */
790#define IMDMA_D0_Y_COUNT 0xFFC01818 /*IMDMA Stream 0 Destination Outer-Loop Count */
791#define IMDMA_D0_X_MODIFY 0xFFC01814 /*IMDMA Stream 0 Dest Inner-Loop Address-Increment */
792#define IMDMA_D0_Y_MODIFY 0xFFC0181C /*IMDMA Stream 0 Dest Outer-Loop Address-Increment */
793#define IMDMA_D0_CURR_DESC_PTR 0xFFC01820 /*IMDMA Stream 0 Destination Current Descriptor Ptr */
794#define IMDMA_D0_CURR_ADDR 0xFFC01824 /*IMDMA Stream 0 Destination Current Address */
795#define IMDMA_D0_CURR_X_COUNT 0xFFC01830 /*IMDMA Stream 0 Destination Current Inner-Loop Count */
796#define IMDMA_D0_CURR_Y_COUNT 0xFFC01838 /*IMDMA Stream 0 Destination Current Outer-Loop Count */
797#define IMDMA_D0_IRQ_STATUS 0xFFC01828 /*IMDMA Stream 0 Destination Interrupt/Status */
798
799#define IMDMA_S0_CONFIG 0xFFC01848 /*IMDMA Stream 0 Source Configuration */
800#define IMDMA_S0_NEXT_DESC_PTR 0xFFC01840 /*IMDMA Stream 0 Source Next Descriptor Ptr Reg */
801#define IMDMA_S0_START_ADDR 0xFFC01844 /*IMDMA Stream 0 Source Start Address */
802#define IMDMA_S0_X_COUNT 0xFFC01850 /*IMDMA Stream 0 Source Inner-Loop Count */
803#define IMDMA_S0_Y_COUNT 0xFFC01858 /*IMDMA Stream 0 Source Outer-Loop Count */
804#define IMDMA_S0_X_MODIFY 0xFFC01854 /*IMDMA Stream 0 Source Inner-Loop Address-Increment */
805#define IMDMA_S0_Y_MODIFY 0xFFC0185C /*IMDMA Stream 0 Source Outer-Loop Address-Increment */
806#define IMDMA_S0_CURR_DESC_PTR 0xFFC01860 /*IMDMA Stream 0 Source Current Descriptor Ptr reg */
807#define IMDMA_S0_CURR_ADDR 0xFFC01864 /*IMDMA Stream 0 Source Current Address */
808#define IMDMA_S0_CURR_X_COUNT 0xFFC01870 /*IMDMA Stream 0 Source Current Inner-Loop Count */
809#define IMDMA_S0_CURR_Y_COUNT 0xFFC01878 /*IMDMA Stream 0 Source Current Outer-Loop Count */
810#define IMDMA_S0_IRQ_STATUS 0xFFC01868 /*IMDMA Stream 0 Source Interrupt/Status */
811
812#define IMDMA_D1_CONFIG 0xFFC01888 /*IMDMA Stream 1 Destination Configuration */
813#define IMDMA_D1_NEXT_DESC_PTR 0xFFC01880 /*IMDMA Stream 1 Destination Next Descriptor Ptr Reg */
814#define IMDMA_D1_START_ADDR 0xFFC01884 /*IMDMA Stream 1 Destination Start Address */
815#define IMDMA_D1_X_COUNT 0xFFC01890 /*IMDMA Stream 1 Destination Inner-Loop Count */
816#define IMDMA_D1_Y_COUNT 0xFFC01898 /*IMDMA Stream 1 Destination Outer-Loop Count */
817#define IMDMA_D1_X_MODIFY 0xFFC01894 /*IMDMA Stream 1 Dest Inner-Loop Address-Increment */
818#define IMDMA_D1_Y_MODIFY 0xFFC0189C /*IMDMA Stream 1 Dest Outer-Loop Address-Increment */
819#define IMDMA_D1_CURR_DESC_PTR 0xFFC018A0 /*IMDMA Stream 1 Destination Current Descriptor Ptr */
820#define IMDMA_D1_CURR_ADDR 0xFFC018A4 /*IMDMA Stream 1 Destination Current Address */
821#define IMDMA_D1_CURR_X_COUNT 0xFFC018B0 /*IMDMA Stream 1 Destination Current Inner-Loop Count */
822#define IMDMA_D1_CURR_Y_COUNT 0xFFC018B8 /*IMDMA Stream 1 Destination Current Outer-Loop Count */
823#define IMDMA_D1_IRQ_STATUS 0xFFC018A8 /*IMDMA Stream 1 Destination Interrupt/Status */
824
825#define IMDMA_S1_CONFIG 0xFFC018C8 /*IMDMA Stream 1 Source Configuration */
826#define IMDMA_S1_NEXT_DESC_PTR 0xFFC018C0 /*IMDMA Stream 1 Source Next Descriptor Ptr Reg */
827#define IMDMA_S1_START_ADDR 0xFFC018C4 /*IMDMA Stream 1 Source Start Address */
828#define IMDMA_S1_X_COUNT 0xFFC018D0 /*IMDMA Stream 1 Source Inner-Loop Count */
829#define IMDMA_S1_Y_COUNT 0xFFC018D8 /*IMDMA Stream 1 Source Outer-Loop Count */
830#define IMDMA_S1_X_MODIFY 0xFFC018D4 /*IMDMA Stream 1 Source Inner-Loop Address-Increment */
831#define IMDMA_S1_Y_MODIFY 0xFFC018DC /*IMDMA Stream 1 Source Outer-Loop Address-Increment */
832#define IMDMA_S1_CURR_DESC_PTR 0xFFC018E0 /*IMDMA Stream 1 Source Current Descriptor Ptr reg */
833#define IMDMA_S1_CURR_ADDR 0xFFC018E4 /*IMDMA Stream 1 Source Current Address */
834#define IMDMA_S1_CURR_X_COUNT 0xFFC018F0 /*IMDMA Stream 1 Source Current Inner-Loop Count */
835#define IMDMA_S1_CURR_Y_COUNT 0xFFC018F8 /*IMDMA Stream 1 Source Current Outer-Loop Count */
836#define IMDMA_S1_IRQ_STATUS 0xFFC018E8 /*IMDMA Stream 1 Source Interrupt/Status */
837
838/*********************************************************************************** */
839/* System MMR Register Bits */
840/******************************************************************************* */
841
842/* ********************* PLL AND RESET MASKS ************************ */
843
844/* PLL_CTL Masks */
845#define PLL_CLKIN 0x00000000 /* Pass CLKIN to PLL */
846#define PLL_CLKIN_DIV2 0x00000001 /* Pass CLKIN/2 to PLL */
847#define PLL_OFF 0x00000002 /* Shut off PLL clocks */
848#define STOPCK_OFF 0x00000008 /* Core clock off */
849#define PDWN 0x00000020 /* Put the PLL in a Deep Sleep state */
850#define BYPASS 0x00000100 /* Bypass the PLL */
851
852/* CHIPID Masks */
853#define CHIPID_VERSION 0xF0000000
854#define CHIPID_FAMILY 0x0FFFF000
855#define CHIPID_MANUFACTURE 0x00000FFE
856
857/* PLL_DIV Masks */
858#define SCLK_DIV(x) (x) /* SCLK = VCO / x */
859
860#define CCLK_DIV1 0x00000000 /* CCLK = VCO / 1 */
861#define CCLK_DIV2 0x00000010 /* CCLK = VCO / 2 */
862#define CCLK_DIV4 0x00000020 /* CCLK = VCO / 4 */
863#define CCLK_DIV8 0x00000030 /* CCLK = VCO / 8 */
864
865/* PLL_STAT Masks */
866#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
867#define FULL_ON 0x0002 /* Processor In Full On Mode */
868#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
869#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
870
871/* SWRST Mask */
872#define SYSTEM_RESET 0x00000007 /* Initiates a system software reset */
873#define SWRST_DBL_FAULT_B 0x00000800 /* SWRST Core B Double Fault */
874#define SWRST_DBL_FAULT_A 0x00001000 /* SWRST Core A Double Fault */
875#define SWRST_WDT_B 0x00002000 /* SWRST Watchdog B */
876#define SWRST_WDT_A 0x00004000 /* SWRST Watchdog A */
877#define SWRST_OCCURRED 0x00008000 /* SWRST Status */
878
879/* ************* SYSTEM INTERRUPT CONTROLLER MASKS ***************** */
880
881/* SICu_IARv Masks */
882/* u = A or B */
883/* v = 0 to 7 */
884/* w = 0 or 1 */
885
886/* Per_number = 0 to 63 */
887/* IVG_number = 7 to 15 */
888#define Peripheral_IVG(Per_number, IVG_number) \
889 ((IVG_number) - 7) << (((Per_number) % 8) * 4) /* Peripheral #Per_number assigned IVG #IVG_number */
890 /* Usage: r0.l = lo(Peripheral_IVG(62, 10)); */
891 /* r0.h = hi(Peripheral_IVG(62, 10)); */
892
893/* SICx_IMASKw Masks */
894/* masks are 32 bit wide, so two writes reguired for "64 bit" wide registers */
895#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
896#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
897#define SIC_MASK(x) (1 << (x)) /* Mask Peripheral #x interrupt */
898#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << (x))) /* Unmask Peripheral #x interrupt */
899
900/* SIC_IWR Masks */
901#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
902#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
903/* x = pos 0 to 31, for 32-63 use value-32 */
904#define IWR_ENABLE(x) (1 << (x)) /* Wakeup Enable Peripheral #x */
905#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << (x))) /* Wakeup Disable Peripheral #x */
906
907/* ********* WATCHDOG TIMER MASKS ********************8 */
908
909/* Watchdog Timer WDOG_CTL Register */
910#define ICTL(x) ((x<<1) & 0x0006)
911#define ENABLE_RESET 0x00000000 /* Set Watchdog Timer to generate reset */
912#define ENABLE_NMI 0x00000002 /* Set Watchdog Timer to generate non-maskable interrupt */
913#define ENABLE_GPI 0x00000004 /* Set Watchdog Timer to generate general-purpose interrupt */
914#define DISABLE_EVT 0x00000006 /* Disable Watchdog Timer interrupts */
915
916#define TMR_EN 0x0000
917#define TMR_DIS 0x0AD0
918#define TRO 0x8000
919
920#define ICTL_P0 0x01
921#define ICTL_P1 0x02
922#define TRO_P 0x0F
923
924/* ***************************** UART CONTROLLER MASKS ********************** */
925
926/* UART_LCR Register */
927
928#define DLAB 0x80
929#define SB 0x40
930#define STP 0x20
931#define EPS 0x10
932#define PEN 0x08
933#define STB 0x04
934#define WLS(x) ((x-5) & 0x03)
935
936#define DLAB_P 0x07
937#define SB_P 0x06
938#define STP_P 0x05
939#define EPS_P 0x04
940#define PEN_P 0x03
941#define STB_P 0x02
942#define WLS_P1 0x01
943#define WLS_P0 0x00
944
945/* UART_MCR Register */
946#define LOOP_ENA 0x10
947#define LOOP_ENA_P 0x04
948
949/* UART_LSR Register */
950#define TEMT 0x40
951#define THRE 0x20
952#define BI 0x10
953#define FE 0x08
954#define PE 0x04
955#define OE 0x02
956#define DR 0x01
957
958#define TEMP_P 0x06
959#define THRE_P 0x05
960#define BI_P 0x04
961#define FE_P 0x03
962#define PE_P 0x02
963#define OE_P 0x01
964#define DR_P 0x00
965
966/* UART_IER Register */
967#define ELSI 0x04
968#define ETBEI 0x02
969#define ERBFI 0x01
970
971#define ELSI_P 0x02
972#define ETBEI_P 0x01
973#define ERBFI_P 0x00
974
975/* UART_IIR Register */
976#define STATUS(x) ((x << 1) & 0x06)
977#define NINT 0x01
978#define STATUS_P1 0x02
979#define STATUS_P0 0x01
980#define NINT_P 0x00
981#define IIR_TX_READY 0x02 /* UART_THR empty */
982#define IIR_RX_READY 0x04 /* Receive data ready */
983#define IIR_LINE_CHANGE 0x06 /* Receive line status */
984#define IIR_STATUS 0x06
985
986/* UART_GCTL Register */
987#define FFE 0x20
988#define FPE 0x10
989#define RPOLC 0x08
990#define TPOLC 0x04
991#define IREN 0x02
992#define UCEN 0x01
993
994#define FFE_P 0x05
995#define FPE_P 0x04
996#define RPOLC_P 0x03
997#define TPOLC_P 0x02
998#define IREN_P 0x01
999#define UCEN_P 0x00
1000
1001/* ********** SERIAL PORT MASKS ********************** */
1002
1003/* SPORTx_TCR1 Masks */
1004#define TSPEN 0x0001 /* TX enable */
1005#define ITCLK 0x0002 /* Internal TX Clock Select */
1006#define TDTYPE 0x000C /* TX Data Formatting Select */
1007#define TLSBIT 0x0010 /* TX Bit Order */
1008#define ITFS 0x0200 /* Internal TX Frame Sync Select */
1009#define TFSR 0x0400 /* TX Frame Sync Required Select */
1010#define DITFS 0x0800 /* Data Independent TX Frame Sync Select */
1011#define LTFS 0x1000 /* Low TX Frame Sync Select */
1012#define LATFS 0x2000 /* Late TX Frame Sync Select */
1013#define TCKFE 0x4000 /* TX Clock Falling Edge Select */
1014
1015/* SPORTx_TCR2 Masks */
1016#define SLEN 0x001F /*TX Word Length */
1017#define TXSE 0x0100 /*TX Secondary Enable */
1018#define TSFSE 0x0200 /*TX Stereo Frame Sync Enable */
1019#define TRFST 0x0400 /*TX Right-First Data Order */
1020
1021/* SPORTx_RCR1 Masks */
1022#define RSPEN 0x0001 /* RX enable */
1023#define IRCLK 0x0002 /* Internal RX Clock Select */
1024#define RDTYPE 0x000C /* RX Data Formatting Select */
1025#define RULAW 0x0008 /* u-Law enable */
1026#define RALAW 0x000C /* A-Law enable */
1027#define RLSBIT 0x0010 /* RX Bit Order */
1028#define IRFS 0x0200 /* Internal RX Frame Sync Select */
1029#define RFSR 0x0400 /* RX Frame Sync Required Select */
1030#define LRFS 0x1000 /* Low RX Frame Sync Select */
1031#define LARFS 0x2000 /* Late RX Frame Sync Select */
1032#define RCKFE 0x4000 /* RX Clock Falling Edge Select */
1033
1034/* SPORTx_RCR2 Masks */
1035#define SLEN 0x001F /*RX Word Length */
1036#define RXSE 0x0100 /*RX Secondary Enable */
1037#define RSFSE 0x0200 /*RX Stereo Frame Sync Enable */
1038#define RRFST 0x0400 /*Right-First Data Order */
1039
1040/*SPORTx_STAT Masks */
1041#define RXNE 0x0001 /*RX FIFO Not Empty Status */
1042#define RUVF 0x0002 /*RX Underflow Status */
1043#define ROVF 0x0004 /*RX Overflow Status */
1044#define TXF 0x0008 /*TX FIFO Full Status */
1045#define TUVF 0x0010 /*TX Underflow Status */
1046#define TOVF 0x0020 /*TX Overflow Status */
1047#define TXHRE 0x0040 /*TX Hold Register Empty */
1048
1049/*SPORTx_MCMC1 Masks */
1050#define SP_WSIZE 0x0000F000 /*Multichannel Window Size Field */
1051#define SP_WOFF 0x000003FF /*Multichannel Window Offset Field */
1052
1053/*SPORTx_MCMC2 Masks */
1054#define MCCRM 0x00000003 /*Multichannel Clock Recovery Mode */
1055#define MCDTXPE 0x00000004 /*Multichannel DMA Transmit Packing */
1056#define MCDRXPE 0x00000008 /*Multichannel DMA Receive Packing */
1057#define MCMEN 0x00000010 /*Multichannel Frame Mode Enable */
1058#define FSDR 0x00000080 /*Multichannel Frame Sync to Data Relationship */
1059#define MFD 0x0000F000 /*Multichannel Frame Delay */
1060
1061/* ********* PARALLEL PERIPHERAL INTERFACE (PPI) MASKS **************** */
1062
1063/* PPI_CONTROL Masks */
1064#define PORT_EN 0x00000001 /* PPI Port Enable */
1065#define PORT_DIR 0x00000002 /* PPI Port Direction */
1066#define XFR_TYPE 0x0000000C /* PPI Transfer Type */
1067#define PORT_CFG 0x00000030 /* PPI Port Configuration */
1068#define FLD_SEL 0x00000040 /* PPI Active Field Select */
1069#define PACK_EN 0x00000080 /* PPI Packing Mode */
1070#define DMA32 0x00000100 /* PPI 32-bit DMA Enable */
1071#define SKIP_EN 0x00000200 /* PPI Skip Element Enable */
1072#define SKIP_EO 0x00000400 /* PPI Skip Even/Odd Elements */
1073#define DLENGTH 0x00003800 /* PPI Data Length */
1074#define DLEN_8 0x0 /* PPI Data Length mask for DLEN=8 */
1075#define DLEN(x) (((x-9) & 0x07) << 11) /* PPI Data Length (only works for x=10-->x=16) */
1076#define POL 0x0000C000 /* PPI Signal Polarities */
1077
1078/* PPI_STATUS Masks */
1079#define FLD 0x00000400 /* Field Indicator */
1080#define FT_ERR 0x00000800 /* Frame Track Error */
1081#define OVR 0x00001000 /* FIFO Overflow Error */
1082#define UNDR 0x00002000 /* FIFO Underrun Error */
1083#define ERR_DET 0x00004000 /* Error Detected Indicator */
1084#define ERR_NCOR 0x00008000 /* Error Not Corrected Indicator */
1085
1086/* ********** DMA CONTROLLER MASKS *********************8 */
1087
1088/* DMAx_CONFIG, MDMA_yy_CONFIG, IMDMA_yy_CONFIG Masks */
1089#define DMAEN 0x00000001 /* Channel Enable */
1090#define WNR 0x00000002 /* Channel Direction (W/R*) */
1091#define WDSIZE_8 0x00000000 /* Word Size 8 bits */
1092#define WDSIZE_16 0x00000004 /* Word Size 16 bits */
1093#define WDSIZE_32 0x00000008 /* Word Size 32 bits */
1094#define DMA2D 0x00000010 /* 2D/1D* Mode */
1095#define RESTART 0x00000020 /* Restart */
1096#define DI_SEL 0x00000040 /* Data Interrupt Select */
1097#define DI_EN 0x00000080 /* Data Interrupt Enable */
1098#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
1099#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
1100#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
1101#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
1102#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
1103#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
1104#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
1105#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
1106#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
1107#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
1108#define NDSIZE 0x00000900 /* Next Descriptor Size */
1109#define DMAFLOW 0x00007000 /* Flow Control */
1110#define DMAFLOW_STOP 0x0000 /* Stop Mode */
1111#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
1112#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
1113#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
1114#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
1115
1116#define DMAEN_P 0 /* Channel Enable */
1117#define WNR_P 1 /* Channel Direction (W/R*) */
1118#define DMA2D_P 4 /* 2D/1D* Mode */
1119#define RESTART_P 5 /* Restart */
1120#define DI_SEL_P 6 /* Data Interrupt Select */
1121#define DI_EN_P 7 /* Data Interrupt Enable */
1122
1123/* DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS, IMDMA_yy_IRQ_STATUS Masks */
1124
1125#define DMA_DONE 0x00000001 /* DMA Done Indicator */
1126#define DMA_ERR 0x00000002 /* DMA Error Indicator */
1127#define DFETCH 0x00000004 /* Descriptor Fetch Indicator */
1128#define DMA_RUN 0x00000008 /* DMA Running Indicator */
1129
1130#define DMA_DONE_P 0 /* DMA Done Indicator */
1131#define DMA_ERR_P 1 /* DMA Error Indicator */
1132#define DFETCH_P 2 /* Descriptor Fetch Indicator */
1133#define DMA_RUN_P 3 /* DMA Running Indicator */
1134
1135/* DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP, IMDMA_yy_PERIPHERAL_MAP Masks */
1136
1137#define CTYPE 0x00000040 /* DMA Channel Type Indicator */
1138#define CTYPE_P 6 /* DMA Channel Type Indicator BIT POSITION */
1139#define PCAP8 0x00000080 /* DMA 8-bit Operation Indicator */
1140#define PCAP16 0x00000100 /* DMA 16-bit Operation Indicator */
1141#define PCAP32 0x00000200 /* DMA 32-bit Operation Indicator */
1142#define PCAPWR 0x00000400 /* DMA Write Operation Indicator */
1143#define PCAPRD 0x00000800 /* DMA Read Operation Indicator */
1144#define PMAP 0x00007000 /* DMA Peripheral Map Field */
1145
1146/* ************* GENERAL PURPOSE TIMER MASKS ******************** */
1147
1148/* PWM Timer bit definitions */
1149
1150/* TIMER_ENABLE Register */
1151#define TIMEN0 0x0001
1152#define TIMEN1 0x0002
1153#define TIMEN2 0x0004
1154#define TIMEN3 0x0008
1155#define TIMEN4 0x0010
1156#define TIMEN5 0x0020
1157#define TIMEN6 0x0040
1158#define TIMEN7 0x0080
1159#define TIMEN8 0x0001
1160#define TIMEN9 0x0002
1161#define TIMEN10 0x0004
1162#define TIMEN11 0x0008
1163
1164#define TIMEN0_P 0x00
1165#define TIMEN1_P 0x01
1166#define TIMEN2_P 0x02
1167#define TIMEN3_P 0x03
1168#define TIMEN4_P 0x04
1169#define TIMEN5_P 0x05
1170#define TIMEN6_P 0x06
1171#define TIMEN7_P 0x07
1172#define TIMEN8_P 0x00
1173#define TIMEN9_P 0x01
1174#define TIMEN10_P 0x02
1175#define TIMEN11_P 0x03
1176
1177/* TIMER_DISABLE Register */
1178#define TIMDIS0 0x0001
1179#define TIMDIS1 0x0002
1180#define TIMDIS2 0x0004
1181#define TIMDIS3 0x0008
1182#define TIMDIS4 0x0010
1183#define TIMDIS5 0x0020
1184#define TIMDIS6 0x0040
1185#define TIMDIS7 0x0080
1186#define TIMDIS8 0x0001
1187#define TIMDIS9 0x0002
1188#define TIMDIS10 0x0004
1189#define TIMDIS11 0x0008
1190
1191#define TIMDIS0_P 0x00
1192#define TIMDIS1_P 0x01
1193#define TIMDIS2_P 0x02
1194#define TIMDIS3_P 0x03
1195#define TIMDIS4_P 0x04
1196#define TIMDIS5_P 0x05
1197#define TIMDIS6_P 0x06
1198#define TIMDIS7_P 0x07
1199#define TIMDIS8_P 0x00
1200#define TIMDIS9_P 0x01
1201#define TIMDIS10_P 0x02
1202#define TIMDIS11_P 0x03
1203
1204/* TIMER_STATUS Register */
1205#define TIMIL0 0x00000001
1206#define TIMIL1 0x00000002
1207#define TIMIL2 0x00000004
1208#define TIMIL3 0x00000008
1209#define TIMIL4 0x00010000
1210#define TIMIL5 0x00020000
1211#define TIMIL6 0x00040000
1212#define TIMIL7 0x00080000
1213#define TIMIL8 0x0001
1214#define TIMIL9 0x0002
1215#define TIMIL10 0x0004
1216#define TIMIL11 0x0008
1217#define TOVL_ERR0 0x00000010
1218#define TOVL_ERR1 0x00000020
1219#define TOVL_ERR2 0x00000040
1220#define TOVL_ERR3 0x00000080
1221#define TOVL_ERR4 0x00100000
1222#define TOVL_ERR5 0x00200000
1223#define TOVL_ERR6 0x00400000
1224#define TOVL_ERR7 0x00800000
1225#define TOVL_ERR8 0x0010
1226#define TOVL_ERR9 0x0020
1227#define TOVL_ERR10 0x0040
1228#define TOVL_ERR11 0x0080
1229#define TRUN0 0x00001000
1230#define TRUN1 0x00002000
1231#define TRUN2 0x00004000
1232#define TRUN3 0x00008000
1233#define TRUN4 0x10000000
1234#define TRUN5 0x20000000
1235#define TRUN6 0x40000000
1236#define TRUN7 0x80000000
1237#define TRUN8 0x1000
1238#define TRUN9 0x2000
1239#define TRUN10 0x4000
1240#define TRUN11 0x8000
1241
1242#define TIMIL0_P 0x00
1243#define TIMIL1_P 0x01
1244#define TIMIL2_P 0x02
1245#define TIMIL3_P 0x03
1246#define TIMIL4_P 0x10
1247#define TIMIL5_P 0x11
1248#define TIMIL6_P 0x12
1249#define TIMIL7_P 0x13
1250#define TIMIL8_P 0x00
1251#define TIMIL9_P 0x01
1252#define TIMIL10_P 0x02
1253#define TIMIL11_P 0x03
1254#define TOVL_ERR0_P 0x04
1255#define TOVL_ERR1_P 0x05
1256#define TOVL_ERR2_P 0x06
1257#define TOVL_ERR3_P 0x07
1258#define TOVL_ERR4_P 0x14
1259#define TOVL_ERR5_P 0x15
1260#define TOVL_ERR6_P 0x16
1261#define TOVL_ERR7_P 0x17
1262#define TOVL_ERR8_P 0x04
1263#define TOVL_ERR9_P 0x05
1264#define TOVL_ERR10_P 0x06
1265#define TOVL_ERR11_P 0x07
1266#define TRUN0_P 0x0C
1267#define TRUN1_P 0x0D
1268#define TRUN2_P 0x0E
1269#define TRUN3_P 0x0F
1270#define TRUN4_P 0x1C
1271#define TRUN5_P 0x1D
1272#define TRUN6_P 0x1E
1273#define TRUN7_P 0x1F
1274#define TRUN8_P 0x0C
1275#define TRUN9_P 0x0D
1276#define TRUN10_P 0x0E
1277#define TRUN11_P 0x0F
1278
1279/* TIMERx_CONFIG Registers */
1280#define PWM_OUT 0x0001
1281#define WDTH_CAP 0x0002
1282#define EXT_CLK 0x0003
1283#define PULSE_HI 0x0004
1284#define PERIOD_CNT 0x0008
1285#define IRQ_ENA 0x0010
1286#define TIN_SEL 0x0020
1287#define OUT_DIS 0x0040
1288#define CLK_SEL 0x0080
1289#define TOGGLE_HI 0x0100
1290#define EMU_RUN 0x0200
1291#define ERR_TYP(x) ((x & 0x03) << 14)
1292
1293#define TMODE_P0 0x00
1294#define TMODE_P1 0x01
1295#define PULSE_HI_P 0x02
1296#define PERIOD_CNT_P 0x03
1297#define IRQ_ENA_P 0x04
1298#define TIN_SEL_P 0x05
1299#define OUT_DIS_P 0x06
1300#define CLK_SEL_P 0x07
1301#define TOGGLE_HI_P 0x08
1302#define EMU_RUN_P 0x09
1303#define ERR_TYP_P0 0x0E
1304#define ERR_TYP_P1 0x0F
1305
1306/*/ ****************** PROGRAMMABLE FLAG MASKS ********************* */
1307
1308/* General Purpose IO (0xFFC00700 - 0xFFC007FF) Masks */
1309#define PF0 0x0001
1310#define PF1 0x0002
1311#define PF2 0x0004
1312#define PF3 0x0008
1313#define PF4 0x0010
1314#define PF5 0x0020
1315#define PF6 0x0040
1316#define PF7 0x0080
1317#define PF8 0x0100
1318#define PF9 0x0200
1319#define PF10 0x0400
1320#define PF11 0x0800
1321#define PF12 0x1000
1322#define PF13 0x2000
1323#define PF14 0x4000
1324#define PF15 0x8000
1325
1326/* General Purpose IO (0xFFC00700 - 0xFFC007FF) BIT POSITIONS */
1327#define PF0_P 0
1328#define PF1_P 1
1329#define PF2_P 2
1330#define PF3_P 3
1331#define PF4_P 4
1332#define PF5_P 5
1333#define PF6_P 6
1334#define PF7_P 7
1335#define PF8_P 8
1336#define PF9_P 9
1337#define PF10_P 10
1338#define PF11_P 11
1339#define PF12_P 12
1340#define PF13_P 13
1341#define PF14_P 14
1342#define PF15_P 15
1343
1344/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS **************** */
1345
1346/* SPI_CTL Masks */
1347#define TIMOD 0x00000003 /* Transfer initiation mode and interrupt generation */
1348#define SZ 0x00000004 /* Send Zero (=0) or last (=1) word when TDBR empty. */
1349#define GM 0x00000008 /* When RDBR full, get more (=1) data or discard (=0) incoming Data */
1350#define PSSE 0x00000010 /* Enable (=1) Slave-Select input for Master. */
1351#define EMISO 0x00000020 /* Enable (=1) MISO pin as an output. */
1352#define SIZE 0x00000100 /* Word length (0 => 8 bits, 1 => 16 bits) */
1353#define LSBF 0x00000200 /* Data format (0 => MSB sent/received first 1 => LSB sent/received first) */
1354#define CPHA 0x00000400 /* Clock phase (0 => SPICLK starts toggling in middle of xfer, 1 => SPICLK toggles at the beginning of xfer. */
1355#define CPOL 0x00000800 /* Clock polarity (0 => active-high, 1 => active-low) */
1356#define MSTR 0x00001000 /* Configures SPI as master (=1) or slave (=0) */
1357#define WOM 0x00002000 /* Open drain (=1) data output enable (for MOSI and MISO) */
1358#define SPE 0x00004000 /* SPI module enable (=1), disable (=0) */
1359
1360/* SPI_FLG Masks */
1361#define FLS1 0x00000002 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
1362#define FLS2 0x00000004 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
1363#define FLS3 0x00000008 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
1364#define FLS4 0x00000010 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
1365#define FLS5 0x00000020 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
1366#define FLS6 0x00000040 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
1367#define FLS7 0x00000080 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
1368#define FLG1 0x00000200 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
1369#define FLG2 0x00000400 /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
1370#define FLG3 0x00000800 /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
1371#define FLG4 0x00001000 /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
1372#define FLG5 0x00002000 /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
1373#define FLG6 0x00004000 /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
1374#define FLG7 0x00008000 /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
1375
1376/* SPI_FLG Bit Positions */
1377#define FLS1_P 0x00000001 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
1378#define FLS2_P 0x00000002 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
1379#define FLS3_P 0x00000003 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
1380#define FLS4_P 0x00000004 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
1381#define FLS5_P 0x00000005 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
1382#define FLS6_P 0x00000006 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
1383#define FLS7_P 0x00000007 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
1384#define FLG1_P 0x00000009 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
1385#define FLG2_P 0x0000000A /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
1386#define FLG3_P 0x0000000B /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
1387#define FLG4_P 0x0000000C /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
1388#define FLG5_P 0x0000000D /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
1389#define FLG6_P 0x0000000E /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
1390#define FLG7_P 0x0000000F /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
1391
1392/* SPI_STAT Masks */
1393#define SPIF 0x00000001 /* Set (=1) when SPI single-word transfer complete */
1394#define MODF 0x00000002 /* Set (=1) in a master device when some other device tries to become master */
1395#define TXE 0x00000004 /* Set (=1) when transmission occurs with no new data in SPI_TDBR */
1396#define TXS 0x00000008 /* SPI_TDBR Data Buffer Status (0=Empty, 1=Full) */
1397#define RBSY 0x00000010 /* Set (=1) when data is received with RDBR full */
1398#define RXS 0x00000020 /* SPI_RDBR Data Buffer Status (0=Empty, 1=Full) */
1399#define TXCOL 0x00000040 /* When set (=1), corrupt data may have been transmitted */
1400
1401/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS ************* */
1402
1403/* AMGCTL Masks */
1404#define AMCKEN 0x0001 /* Enable CLKOUT */
1405#define AMBEN_B0 0x0002 /* Enable Asynchronous Memory Bank 0 only */
1406#define AMBEN_B0_B1 0x0004 /* Enable Asynchronous Memory Banks 0 & 1 only */
1407#define AMBEN_B0_B1_B2 0x0006 /* Enable Asynchronous Memory Banks 0, 1, and 2 */
1408#define AMBEN_ALL 0x0008 /* Enable Asynchronous Memory Banks (all) 0, 1, 2, and 3 */
1409#define B0_PEN 0x0010 /* Enable 16-bit packing Bank 0 */
1410#define B1_PEN 0x0020 /* Enable 16-bit packing Bank 1 */
1411#define B2_PEN 0x0040 /* Enable 16-bit packing Bank 2 */
1412#define B3_PEN 0x0080 /* Enable 16-bit packing Bank 3 */
1413
1414/* AMGCTL Bit Positions */
1415#define AMCKEN_P 0x00000000 /* Enable CLKOUT */
1416#define AMBEN_P0 0x00000001 /* Asynchronous Memory Enable, 000 - banks 0-3 disabled, 001 - Bank 0 enabled */
1417#define AMBEN_P1 0x00000002 /* Asynchronous Memory Enable, 010 - banks 0&1 enabled, 011 - banks 0-3 enabled */
1418#define AMBEN_P2 0x00000003 /* Asynchronous Memory Enable, 1xx - All banks (bank 0, 1, 2, and 3) enabled */
1419#define B0_PEN_P 0x004 /* Enable 16-bit packing Bank 0 */
1420#define B1_PEN_P 0x005 /* Enable 16-bit packing Bank 1 */
1421#define B2_PEN_P 0x006 /* Enable 16-bit packing Bank 2 */
1422#define B3_PEN_P 0x007 /* Enable 16-bit packing Bank 3 */
1423
1424/* AMBCTL0 Masks */
1425#define B0RDYEN 0x00000001 /* Bank 0 RDY Enable, 0=disable, 1=enable */
1426#define B0RDYPOL 0x00000002 /* Bank 0 RDY Active high, 0=active low, 1=active high */
1427#define B0TT_1 0x00000004 /* Bank 0 Transition Time from Read to Write = 1 cycle */
1428#define B0TT_2 0x00000008 /* Bank 0 Transition Time from Read to Write = 2 cycles */
1429#define B0TT_3 0x0000000C /* Bank 0 Transition Time from Read to Write = 3 cycles */
1430#define B0TT_4 0x00000000 /* Bank 0 Transition Time from Read to Write = 4 cycles */
1431#define B0ST_1 0x00000010 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=1 cycle */
1432#define B0ST_2 0x00000020 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=2 cycles */
1433#define B0ST_3 0x00000030 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=3 cycles */
1434#define B0ST_4 0x00000000 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=4 cycles */
1435#define B0HT_1 0x00000040 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 1 cycle */
1436#define B0HT_2 0x00000080 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 2 cycles */
1437#define B0HT_3 0x000000C0 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 3 cycles */
1438#define B0HT_0 0x00000000 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 0 cycles */
1439#define B0RAT_1 0x00000100 /* Bank 0 Read Access Time = 1 cycle */
1440#define B0RAT_2 0x00000200 /* Bank 0 Read Access Time = 2 cycles */
1441#define B0RAT_3 0x00000300 /* Bank 0 Read Access Time = 3 cycles */
1442#define B0RAT_4 0x00000400 /* Bank 0 Read Access Time = 4 cycles */
1443#define B0RAT_5 0x00000500 /* Bank 0 Read Access Time = 5 cycles */
1444#define B0RAT_6 0x00000600 /* Bank 0 Read Access Time = 6 cycles */
1445#define B0RAT_7 0x00000700 /* Bank 0 Read Access Time = 7 cycles */
1446#define B0RAT_8 0x00000800 /* Bank 0 Read Access Time = 8 cycles */
1447#define B0RAT_9 0x00000900 /* Bank 0 Read Access Time = 9 cycles */
1448#define B0RAT_10 0x00000A00 /* Bank 0 Read Access Time = 10 cycles */
1449#define B0RAT_11 0x00000B00 /* Bank 0 Read Access Time = 11 cycles */
1450#define B0RAT_12 0x00000C00 /* Bank 0 Read Access Time = 12 cycles */
1451#define B0RAT_13 0x00000D00 /* Bank 0 Read Access Time = 13 cycles */
1452#define B0RAT_14 0x00000E00 /* Bank 0 Read Access Time = 14 cycles */
1453#define B0RAT_15 0x00000F00 /* Bank 0 Read Access Time = 15 cycles */
1454#define B0WAT_1 0x00001000 /* Bank 0 Write Access Time = 1 cycle */
1455#define B0WAT_2 0x00002000 /* Bank 0 Write Access Time = 2 cycles */
1456#define B0WAT_3 0x00003000 /* Bank 0 Write Access Time = 3 cycles */
1457#define B0WAT_4 0x00004000 /* Bank 0 Write Access Time = 4 cycles */
1458#define B0WAT_5 0x00005000 /* Bank 0 Write Access Time = 5 cycles */
1459#define B0WAT_6 0x00006000 /* Bank 0 Write Access Time = 6 cycles */
1460#define B0WAT_7 0x00007000 /* Bank 0 Write Access Time = 7 cycles */
1461#define B0WAT_8 0x00008000 /* Bank 0 Write Access Time = 8 cycles */
1462#define B0WAT_9 0x00009000 /* Bank 0 Write Access Time = 9 cycles */
1463#define B0WAT_10 0x0000A000 /* Bank 0 Write Access Time = 10 cycles */
1464#define B0WAT_11 0x0000B000 /* Bank 0 Write Access Time = 11 cycles */
1465#define B0WAT_12 0x0000C000 /* Bank 0 Write Access Time = 12 cycles */
1466#define B0WAT_13 0x0000D000 /* Bank 0 Write Access Time = 13 cycles */
1467#define B0WAT_14 0x0000E000 /* Bank 0 Write Access Time = 14 cycles */
1468#define B0WAT_15 0x0000F000 /* Bank 0 Write Access Time = 15 cycles */
1469#define B1RDYEN 0x00010000 /* Bank 1 RDY enable, 0=disable, 1=enable */
1470#define B1RDYPOL 0x00020000 /* Bank 1 RDY Active high, 0=active low, 1=active high */
1471#define B1TT_1 0x00040000 /* Bank 1 Transition Time from Read to Write = 1 cycle */
1472#define B1TT_2 0x00080000 /* Bank 1 Transition Time from Read to Write = 2 cycles */
1473#define B1TT_3 0x000C0000 /* Bank 1 Transition Time from Read to Write = 3 cycles */
1474#define B1TT_4 0x00000000 /* Bank 1 Transition Time from Read to Write = 4 cycles */
1475#define B1ST_1 0x00100000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1476#define B1ST_2 0x00200000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1477#define B1ST_3 0x00300000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1478#define B1ST_4 0x00000000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1479#define B1HT_1 0x00400000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1480#define B1HT_2 0x00800000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1481#define B1HT_3 0x00C00000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1482#define B1HT_0 0x00000000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1483#define B1RAT_1 0x01000000 /* Bank 1 Read Access Time = 1 cycle */
1484#define B1RAT_2 0x02000000 /* Bank 1 Read Access Time = 2 cycles */
1485#define B1RAT_3 0x03000000 /* Bank 1 Read Access Time = 3 cycles */
1486#define B1RAT_4 0x04000000 /* Bank 1 Read Access Time = 4 cycles */
1487#define B1RAT_5 0x05000000 /* Bank 1 Read Access Time = 5 cycles */
1488#define B1RAT_6 0x06000000 /* Bank 1 Read Access Time = 6 cycles */
1489#define B1RAT_7 0x07000000 /* Bank 1 Read Access Time = 7 cycles */
1490#define B1RAT_8 0x08000000 /* Bank 1 Read Access Time = 8 cycles */
1491#define B1RAT_9 0x09000000 /* Bank 1 Read Access Time = 9 cycles */
1492#define B1RAT_10 0x0A000000 /* Bank 1 Read Access Time = 10 cycles */
1493#define B1RAT_11 0x0B000000 /* Bank 1 Read Access Time = 11 cycles */
1494#define B1RAT_12 0x0C000000 /* Bank 1 Read Access Time = 12 cycles */
1495#define B1RAT_13 0x0D000000 /* Bank 1 Read Access Time = 13 cycles */
1496#define B1RAT_14 0x0E000000 /* Bank 1 Read Access Time = 14 cycles */
1497#define B1RAT_15 0x0F000000 /* Bank 1 Read Access Time = 15 cycles */
1498#define B1WAT_1 0x10000000 /* Bank 1 Write Access Time = 1 cycle */
1499#define B1WAT_2 0x20000000 /* Bank 1 Write Access Time = 2 cycles */
1500#define B1WAT_3 0x30000000 /* Bank 1 Write Access Time = 3 cycles */
1501#define B1WAT_4 0x40000000 /* Bank 1 Write Access Time = 4 cycles */
1502#define B1WAT_5 0x50000000 /* Bank 1 Write Access Time = 5 cycles */
1503#define B1WAT_6 0x60000000 /* Bank 1 Write Access Time = 6 cycles */
1504#define B1WAT_7 0x70000000 /* Bank 1 Write Access Time = 7 cycles */
1505#define B1WAT_8 0x80000000 /* Bank 1 Write Access Time = 8 cycles */
1506#define B1WAT_9 0x90000000 /* Bank 1 Write Access Time = 9 cycles */
1507#define B1WAT_10 0xA0000000 /* Bank 1 Write Access Time = 10 cycles */
1508#define B1WAT_11 0xB0000000 /* Bank 1 Write Access Time = 11 cycles */
1509#define B1WAT_12 0xC0000000 /* Bank 1 Write Access Time = 12 cycles */
1510#define B1WAT_13 0xD0000000 /* Bank 1 Write Access Time = 13 cycles */
1511#define B1WAT_14 0xE0000000 /* Bank 1 Write Access Time = 14 cycles */
1512#define B1WAT_15 0xF0000000 /* Bank 1 Write Access Time = 15 cycles */
1513
1514/* AMBCTL1 Masks */
1515#define B2RDYEN 0x00000001 /* Bank 2 RDY Enable, 0=disable, 1=enable */
1516#define B2RDYPOL 0x00000002 /* Bank 2 RDY Active high, 0=active low, 1=active high */
1517#define B2TT_1 0x00000004 /* Bank 2 Transition Time from Read to Write = 1 cycle */
1518#define B2TT_2 0x00000008 /* Bank 2 Transition Time from Read to Write = 2 cycles */
1519#define B2TT_3 0x0000000C /* Bank 2 Transition Time from Read to Write = 3 cycles */
1520#define B2TT_4 0x00000000 /* Bank 2 Transition Time from Read to Write = 4 cycles */
1521#define B2ST_1 0x00000010 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1522#define B2ST_2 0x00000020 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1523#define B2ST_3 0x00000030 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1524#define B2ST_4 0x00000000 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1525#define B2HT_1 0x00000040 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1526#define B2HT_2 0x00000080 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1527#define B2HT_3 0x000000C0 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1528#define B2HT_0 0x00000000 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1529#define B2RAT_1 0x00000100 /* Bank 2 Read Access Time = 1 cycle */
1530#define B2RAT_2 0x00000200 /* Bank 2 Read Access Time = 2 cycles */
1531#define B2RAT_3 0x00000300 /* Bank 2 Read Access Time = 3 cycles */
1532#define B2RAT_4 0x00000400 /* Bank 2 Read Access Time = 4 cycles */
1533#define B2RAT_5 0x00000500 /* Bank 2 Read Access Time = 5 cycles */
1534#define B2RAT_6 0x00000600 /* Bank 2 Read Access Time = 6 cycles */
1535#define B2RAT_7 0x00000700 /* Bank 2 Read Access Time = 7 cycles */
1536#define B2RAT_8 0x00000800 /* Bank 2 Read Access Time = 8 cycles */
1537#define B2RAT_9 0x00000900 /* Bank 2 Read Access Time = 9 cycles */
1538#define B2RAT_10 0x00000A00 /* Bank 2 Read Access Time = 10 cycles */
1539#define B2RAT_11 0x00000B00 /* Bank 2 Read Access Time = 11 cycles */
1540#define B2RAT_12 0x00000C00 /* Bank 2 Read Access Time = 12 cycles */
1541#define B2RAT_13 0x00000D00 /* Bank 2 Read Access Time = 13 cycles */
1542#define B2RAT_14 0x00000E00 /* Bank 2 Read Access Time = 14 cycles */
1543#define B2RAT_15 0x00000F00 /* Bank 2 Read Access Time = 15 cycles */
1544#define B2WAT_1 0x00001000 /* Bank 2 Write Access Time = 1 cycle */
1545#define B2WAT_2 0x00002000 /* Bank 2 Write Access Time = 2 cycles */
1546#define B2WAT_3 0x00003000 /* Bank 2 Write Access Time = 3 cycles */
1547#define B2WAT_4 0x00004000 /* Bank 2 Write Access Time = 4 cycles */
1548#define B2WAT_5 0x00005000 /* Bank 2 Write Access Time = 5 cycles */
1549#define B2WAT_6 0x00006000 /* Bank 2 Write Access Time = 6 cycles */
1550#define B2WAT_7 0x00007000 /* Bank 2 Write Access Time = 7 cycles */
1551#define B2WAT_8 0x00008000 /* Bank 2 Write Access Time = 8 cycles */
1552#define B2WAT_9 0x00009000 /* Bank 2 Write Access Time = 9 cycles */
1553#define B2WAT_10 0x0000A000 /* Bank 2 Write Access Time = 10 cycles */
1554#define B2WAT_11 0x0000B000 /* Bank 2 Write Access Time = 11 cycles */
1555#define B2WAT_12 0x0000C000 /* Bank 2 Write Access Time = 12 cycles */
1556#define B2WAT_13 0x0000D000 /* Bank 2 Write Access Time = 13 cycles */
1557#define B2WAT_14 0x0000E000 /* Bank 2 Write Access Time = 14 cycles */
1558#define B2WAT_15 0x0000F000 /* Bank 2 Write Access Time = 15 cycles */
1559#define B3RDYEN 0x00010000 /* Bank 3 RDY enable, 0=disable, 1=enable */
1560#define B3RDYPOL 0x00020000 /* Bank 3 RDY Active high, 0=active low, 1=active high */
1561#define B3TT_1 0x00040000 /* Bank 3 Transition Time from Read to Write = 1 cycle */
1562#define B3TT_2 0x00080000 /* Bank 3 Transition Time from Read to Write = 2 cycles */
1563#define B3TT_3 0x000C0000 /* Bank 3 Transition Time from Read to Write = 3 cycles */
1564#define B3TT_4 0x00000000 /* Bank 3 Transition Time from Read to Write = 4 cycles */
1565#define B3ST_1 0x00100000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
1566#define B3ST_2 0x00200000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
1567#define B3ST_3 0x00300000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
1568#define B3ST_4 0x00000000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
1569#define B3HT_1 0x00400000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
1570#define B3HT_2 0x00800000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
1571#define B3HT_3 0x00C00000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
1572#define B3HT_0 0x00000000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
1573#define B3RAT_1 0x01000000 /* Bank 3 Read Access Time = 1 cycle */
1574#define B3RAT_2 0x02000000 /* Bank 3 Read Access Time = 2 cycles */
1575#define B3RAT_3 0x03000000 /* Bank 3 Read Access Time = 3 cycles */
1576#define B3RAT_4 0x04000000 /* Bank 3 Read Access Time = 4 cycles */
1577#define B3RAT_5 0x05000000 /* Bank 3 Read Access Time = 5 cycles */
1578#define B3RAT_6 0x06000000 /* Bank 3 Read Access Time = 6 cycles */
1579#define B3RAT_7 0x07000000 /* Bank 3 Read Access Time = 7 cycles */
1580#define B3RAT_8 0x08000000 /* Bank 3 Read Access Time = 8 cycles */
1581#define B3RAT_9 0x09000000 /* Bank 3 Read Access Time = 9 cycles */
1582#define B3RAT_10 0x0A000000 /* Bank 3 Read Access Time = 10 cycles */
1583#define B3RAT_11 0x0B000000 /* Bank 3 Read Access Time = 11 cycles */
1584#define B3RAT_12 0x0C000000 /* Bank 3 Read Access Time = 12 cycles */
1585#define B3RAT_13 0x0D000000 /* Bank 3 Read Access Time = 13 cycles */
1586#define B3RAT_14 0x0E000000 /* Bank 3 Read Access Time = 14 cycles */
1587#define B3RAT_15 0x0F000000 /* Bank 3 Read Access Time = 15 cycles */
1588#define B3WAT_1 0x10000000 /* Bank 3 Write Access Time = 1 cycle */
1589#define B3WAT_2 0x20000000 /* Bank 3 Write Access Time = 2 cycles */
1590#define B3WAT_3 0x30000000 /* Bank 3 Write Access Time = 3 cycles */
1591#define B3WAT_4 0x40000000 /* Bank 3 Write Access Time = 4 cycles */
1592#define B3WAT_5 0x50000000 /* Bank 3 Write Access Time = 5 cycles */
1593#define B3WAT_6 0x60000000 /* Bank 3 Write Access Time = 6 cycles */
1594#define B3WAT_7 0x70000000 /* Bank 3 Write Access Time = 7 cycles */
1595#define B3WAT_8 0x80000000 /* Bank 3 Write Access Time = 8 cycles */
1596#define B3WAT_9 0x90000000 /* Bank 3 Write Access Time = 9 cycles */
1597#define B3WAT_10 0xA0000000 /* Bank 3 Write Access Time = 10 cycles */
1598#define B3WAT_11 0xB0000000 /* Bank 3 Write Access Time = 11 cycles */
1599#define B3WAT_12 0xC0000000 /* Bank 3 Write Access Time = 12 cycles */
1600#define B3WAT_13 0xD0000000 /* Bank 3 Write Access Time = 13 cycles */
1601#define B3WAT_14 0xE0000000 /* Bank 3 Write Access Time = 14 cycles */
1602#define B3WAT_15 0xF0000000 /* Bank 3 Write Access Time = 15 cycles */
1603
1604/* ********************** SDRAM CONTROLLER MASKS *************************** */
1605
1606/* EBIU_SDGCTL Masks */
1607#define SCTLE 0x00000001 /* Enable SCLK[0], /SRAS, /SCAS, /SWE, SDQM[3:0] */
1608#define CL_2 0x00000008 /* SDRAM CAS latency = 2 cycles */
1609#define CL_3 0x0000000C /* SDRAM CAS latency = 3 cycles */
1610#define PFE 0x00000010 /* Enable SDRAM prefetch */
1611#define PFP 0x00000020 /* Prefetch has priority over AMC requests */
1612#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1613#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1614#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
1615#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
1616#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
1617#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
1618#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
1619#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
1620#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
1621#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
1622#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
1623#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
1624#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
1625#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
1626#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
1627#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
1628#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
1629#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
1630#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
1631#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
1632#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
1633#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
1634#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
1635#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
1636#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
1637#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
1638#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
1639#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
1640#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
1641#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
1642#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
1643#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
1644#define PUPSD 0x00200000 /*Power-up start delay */
1645#define PSM 0x00400000 /* SDRAM power-up sequence = Precharge, mode register set, 8 CBR refresh cycles */
1646#define PSS 0x00800000 /* enable SDRAM power-up sequence on next SDRAM access */
1647#define SRFS 0x01000000 /* Start SDRAM self-refresh mode */
1648#define EBUFE 0x02000000 /* Enable external buffering timing */
1649#define FBBRW 0x04000000 /* Fast back-to-back read write enable */
1650#define EMREN 0x10000000 /* Extended mode register enable */
1651#define TCSR 0x20000000 /* Temp compensated self refresh value 85 deg C */
1652#define CDDBG 0x40000000 /* Tristate SDRAM controls during bus grant */
1653
1654/* EBIU_SDBCTL Masks */
1655#define EB0_E 0x00000001 /* Enable SDRAM external bank 0 */
1656#define EB0_SZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1657#define EB0_SZ_32 0x00000002 /* SDRAM external bank size = 32MB */
1658#define EB0_SZ_64 0x00000004 /* SDRAM external bank size = 64MB */
1659#define EB0_SZ_128 0x00000006 /* SDRAM external bank size = 128MB */
1660#define EB0_CAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1661#define EB0_CAW_9 0x00000010 /* SDRAM external bank column address width = 9 bits */
1662#define EB0_CAW_10 0x00000020 /* SDRAM external bank column address width = 9 bits */
1663#define EB0_CAW_11 0x00000030 /* SDRAM external bank column address width = 9 bits */
1664
1665#define EB1_E 0x00000100 /* Enable SDRAM external bank 1 */
1666#define EB1__SZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1667#define EB1__SZ_32 0x00000200 /* SDRAM external bank size = 32MB */
1668#define EB1__SZ_64 0x00000400 /* SDRAM external bank size = 64MB */
1669#define EB1__SZ_128 0x00000600 /* SDRAM external bank size = 128MB */
1670#define EB1__CAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1671#define EB1__CAW_9 0x00001000 /* SDRAM external bank column address width = 9 bits */
1672#define EB1__CAW_10 0x00002000 /* SDRAM external bank column address width = 9 bits */
1673#define EB1__CAW_11 0x00003000 /* SDRAM external bank column address width = 9 bits */
1674
1675#define EB2__E 0x00010000 /* Enable SDRAM external bank 2 */
1676#define EB2__SZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1677#define EB2__SZ_32 0x00020000 /* SDRAM external bank size = 32MB */
1678#define EB2__SZ_64 0x00040000 /* SDRAM external bank size = 64MB */
1679#define EB2__SZ_128 0x00060000 /* SDRAM external bank size = 128MB */
1680#define EB2__CAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1681#define EB2__CAW_9 0x00100000 /* SDRAM external bank column address width = 9 bits */
1682#define EB2__CAW_10 0x00200000 /* SDRAM external bank column address width = 9 bits */
1683#define EB2__CAW_11 0x00300000 /* SDRAM external bank column address width = 9 bits */
1684
1685#define EB3__E 0x01000000 /* Enable SDRAM external bank 3 */
1686#define EB3__SZ_16 0x00000000 /* SDRAM external bank size = 16MB */
1687#define EB3__SZ_32 0x02000000 /* SDRAM external bank size = 32MB */
1688#define EB3__SZ_64 0x04000000 /* SDRAM external bank size = 64MB */
1689#define EB3__SZ_128 0x06000000 /* SDRAM external bank size = 128MB */
1690#define EB3__CAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
1691#define EB3__CAW_9 0x10000000 /* SDRAM external bank column address width = 9 bits */
1692#define EB3__CAW_10 0x20000000 /* SDRAM external bank column address width = 9 bits */
1693#define EB3__CAW_11 0x30000000 /* SDRAM external bank column address width = 9 bits */
1694
1695/* EBIU_SDSTAT Masks */
1696#define SDCI 0x00000001 /* SDRAM controller is idle */
1697#define SDSRA 0x00000002 /* SDRAM SDRAM self refresh is active */
1698#define SDPUA 0x00000004 /* SDRAM power up active */
1699#define SDRS 0x00000008 /* SDRAM is in reset state */
1700#define SDEASE 0x00000010 /* SDRAM EAB sticky error status - W1C */
1701#define BGSTAT 0x00000020 /* Bus granted */
1702
1703/*VR_CTL Masks*/
1704#define WAKE 0x100
1705#define VLEV_6 0x60
1706#define VLEV_7 0x70
1707#define VLEV_8 0x80
1708#define VLEV_9 0x90
1709#define VLEV_10 0xA0
1710#define VLEV_11 0xB0
1711#define VLEV_12 0xC0
1712#define VLEV_13 0xD0
1713#define VLEV_14 0xE0
1714#define VLEV_15 0xF0
1715#define FREQ_3 0x03
1716
1717#endif /* _DEF_BF561_H */
diff --git a/include/asm-blackfin/mach-bf561/dma.h b/include/asm-blackfin/mach-bf561/dma.h
new file mode 100644
index 000000000000..21d982003e75
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/dma.h
@@ -0,0 +1,35 @@
1/*****************************************************************************
2*
3* BF-533/2/1 Specific Declarations
4*
5****************************************************************************/
6
7#ifndef _MACH_DMA_H_
8#define _MACH_DMA_H_
9
10#define MAX_BLACKFIN_DMA_CHANNEL 36
11
12#define CH_PPI0 0
13#define CH_PPI (CH_PPI0)
14#define CH_PPI1 1
15#define CH_SPORT0_RX 12
16#define CH_SPORT0_TX 13
17#define CH_SPORT1_RX 14
18#define CH_SPORT1_TX 15
19#define CH_SPI 16
20#define CH_UART_RX 17
21#define CH_UART_TX 18
22#define CH_MEM_STREAM0_DEST 24 /* TX */
23#define CH_MEM_STREAM0_SRC 25 /* RX */
24#define CH_MEM_STREAM1_DEST 26 /* TX */
25#define CH_MEM_STREAM1_SRC 27 /* RX */
26#define CH_MEM_STREAM2_DEST 28
27#define CH_MEM_STREAM2_SRC 29
28#define CH_MEM_STREAM3_SRC 30
29#define CH_MEM_STREAM3_DEST 31
30#define CH_IMEM_STREAM0_DEST 32
31#define CH_IMEM_STREAM0_SRC 33
32#define CH_IMEM_STREAM1_SRC 34
33#define CH_IMEM_STREAM1_DEST 35
34
35#endif
diff --git a/include/asm-blackfin/mach-bf561/irq.h b/include/asm-blackfin/mach-bf561/irq.h
new file mode 100644
index 000000000000..a753ce720d74
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/irq.h
@@ -0,0 +1,450 @@
1
2/*
3 * File: include/asm-blackfin/mach-bf561/irq.h
4 * Based on:
5 * Author:
6 *
7 * Created:
8 * Description:
9 *
10 * Rev:
11 *
12 * Modified:
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _BF561_IRQ_H_
33#define _BF561_IRQ_H_
34
35/***********************************************************************
36 * Interrupt source definitions:
37 Event Source Core Event Name IRQ No
38 (highest priority)
39 Emulation Events EMU 0
40 Reset RST 1
41 NMI NMI 2
42 Exception EVX 3
43 Reserved -- 4
44 Hardware Error IVHW 5
45 Core Timer IVTMR 6 *
46
47 PLL Wakeup Interrupt IVG7 7
48 DMA1 Error (generic) IVG7 8
49 DMA2 Error (generic) IVG7 9
50 IMDMA Error (generic) IVG7 10
51 PPI1 Error Interrupt IVG7 11
52 PPI2 Error Interrupt IVG7 12
53 SPORT0 Error Interrupt IVG7 13
54 SPORT1 Error Interrupt IVG7 14
55 SPI Error Interrupt IVG7 15
56 UART Error Interrupt IVG7 16
57 Reserved Interrupt IVG7 17
58
59 DMA1 0 Interrupt(PPI1) IVG8 18
60 DMA1 1 Interrupt(PPI2) IVG8 19
61 DMA1 2 Interrupt IVG8 20
62 DMA1 3 Interrupt IVG8 21
63 DMA1 4 Interrupt IVG8 22
64 DMA1 5 Interrupt IVG8 23
65 DMA1 6 Interrupt IVG8 24
66 DMA1 7 Interrupt IVG8 25
67 DMA1 8 Interrupt IVG8 26
68 DMA1 9 Interrupt IVG8 27
69 DMA1 10 Interrupt IVG8 28
70 DMA1 11 Interrupt IVG8 29
71
72 DMA2 0 (SPORT0 RX) IVG9 30
73 DMA2 1 (SPORT0 TX) IVG9 31
74 DMA2 2 (SPORT1 RX) IVG9 32
75 DMA2 3 (SPORT2 TX) IVG9 33
76 DMA2 4 (SPI) IVG9 34
77 DMA2 5 (UART RX) IVG9 35
78 DMA2 6 (UART TX) IVG9 36
79 DMA2 7 Interrupt IVG9 37
80 DMA2 8 Interrupt IVG9 38
81 DMA2 9 Interrupt IVG9 39
82 DMA2 10 Interrupt IVG9 40
83 DMA2 11 Interrupt IVG9 41
84
85 TIMER 0 Interrupt IVG10 42
86 TIMER 1 Interrupt IVG10 43
87 TIMER 2 Interrupt IVG10 44
88 TIMER 3 Interrupt IVG10 45
89 TIMER 4 Interrupt IVG10 46
90 TIMER 5 Interrupt IVG10 47
91 TIMER 6 Interrupt IVG10 48
92 TIMER 7 Interrupt IVG10 49
93 TIMER 8 Interrupt IVG10 50
94 TIMER 9 Interrupt IVG10 51
95 TIMER 10 Interrupt IVG10 52
96 TIMER 11 Interrupt IVG10 53
97
98 Programmable Flags0 A (8) IVG11 54
99 Programmable Flags0 B (8) IVG11 55
100 Programmable Flags1 A (8) IVG11 56
101 Programmable Flags1 B (8) IVG11 57
102 Programmable Flags2 A (8) IVG11 58
103 Programmable Flags2 B (8) IVG11 59
104
105 MDMA1 0 write/read INT IVG8 60
106 MDMA1 1 write/read INT IVG8 61
107
108 MDMA2 0 write/read INT IVG9 62
109 MDMA2 1 write/read INT IVG9 63
110
111 IMDMA 0 write/read INT IVG12 64
112 IMDMA 1 write/read INT IVG12 65
113
114 Watch Dog Timer IVG13 66
115
116 Reserved interrupt IVG7 67
117 Reserved interrupt IVG7 68
118 Supplemental interrupt 0 IVG7 69
119 supplemental interrupt 1 IVG7 70
120
121 Software Interrupt 1 IVG14 71
122 Software Interrupt 2 IVG15 72 *
123 (lowest priority)
124 **********************************************************************/
125
126#define SYS_IRQS 72
127#define NR_PERI_INTS 64
128
129/*
130 * The ABSTRACT IRQ definitions
131 * the first seven of the following are fixed,
132 * the rest you change if you need to.
133 */
134/* IVG 0-6*/
135#define IRQ_EMU 0 /* Emulation */
136#define IRQ_RST 1 /* Reset */
137#define IRQ_NMI 2 /* Non Maskable Interrupt */
138#define IRQ_EVX 3 /* Exception */
139#define IRQ_UNUSED 4 /* Reserved interrupt */
140#define IRQ_HWERR 5 /* Hardware Error */
141#define IRQ_CORETMR 6 /* Core timer */
142
143#define IVG_BASE 7
144/* IVG 7 */
145#define IRQ_PLL_WAKEUP (IVG_BASE + 0) /* PLL Wakeup Interrupt */
146#define IRQ_DMA1_ERROR (IVG_BASE + 1) /* DMA1 Error (general) */
147#define IRQ_DMA_ERROR IRQ_DMA1_ERROR /* DMA1 Error (general) */
148#define IRQ_DMA2_ERROR (IVG_BASE + 2) /* DMA2 Error (general) */
149#define IRQ_IMDMA_ERROR (IVG_BASE + 3) /* IMDMA Error Interrupt */
150#define IRQ_PPI1_ERROR (IVG_BASE + 4) /* PPI1 Error Interrupt */
151#define IRQ_PPI_ERROR IRQ_PPI1_ERROR /* PPI1 Error Interrupt */
152#define IRQ_PPI2_ERROR (IVG_BASE + 5) /* PPI2 Error Interrupt */
153#define IRQ_SPORT0_ERROR (IVG_BASE + 6) /* SPORT0 Error Interrupt */
154#define IRQ_SPORT1_ERROR (IVG_BASE + 7) /* SPORT1 Error Interrupt */
155#define IRQ_SPI_ERROR (IVG_BASE + 8) /* SPI Error Interrupt */
156#define IRQ_UART_ERROR (IVG_BASE + 9) /* UART Error Interrupt */
157#define IRQ_RESERVED_ERROR (IVG_BASE + 10) /* Reversed Interrupt */
158/* IVG 8 */
159#define IRQ_DMA1_0 (IVG_BASE + 11) /* DMA1 0 Interrupt(PPI1) */
160#define IRQ_PPI IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */
161#define IRQ_PPI0 IRQ_DMA1_0 /* DMA1 0 Interrupt(PPI1) */
162#define IRQ_DMA1_1 (IVG_BASE + 12) /* DMA1 1 Interrupt(PPI2) */
163#define IRQ_PPI1 IRQ_DMA1_1 /* DMA1 1 Interrupt(PPI2) */
164#define IRQ_DMA1_2 (IVG_BASE + 13) /* DMA1 2 Interrupt */
165#define IRQ_DMA1_3 (IVG_BASE + 14) /* DMA1 3 Interrupt */
166#define IRQ_DMA1_4 (IVG_BASE + 15) /* DMA1 4 Interrupt */
167#define IRQ_DMA1_5 (IVG_BASE + 16) /* DMA1 5 Interrupt */
168#define IRQ_DMA1_6 (IVG_BASE + 17) /* DMA1 6 Interrupt */
169#define IRQ_DMA1_7 (IVG_BASE + 18) /* DMA1 7 Interrupt */
170#define IRQ_DMA1_8 (IVG_BASE + 19) /* DMA1 8 Interrupt */
171#define IRQ_DMA1_9 (IVG_BASE + 20) /* DMA1 9 Interrupt */
172#define IRQ_DMA1_10 (IVG_BASE + 21) /* DMA1 10 Interrupt */
173#define IRQ_DMA1_11 (IVG_BASE + 22) /* DMA1 11 Interrupt */
174/* IVG 9 */
175#define IRQ_DMA2_0 (IVG_BASE + 23) /* DMA2 0 (SPORT0 RX) */
176#define IRQ_SPORT0_RX IRQ_DMA2_0 /* DMA2 0 (SPORT0 RX) */
177#define IRQ_DMA2_1 (IVG_BASE + 24) /* DMA2 1 (SPORT0 TX) */
178#define IRQ_SPORT0_TX IRQ_DMA2_1 /* DMA2 1 (SPORT0 TX) */
179#define IRQ_DMA2_2 (IVG_BASE + 25) /* DMA2 2 (SPORT1 RX) */
180#define IRQ_SPORT1_RX IRQ_DMA2_2 /* DMA2 2 (SPORT1 RX) */
181#define IRQ_DMA2_3 (IVG_BASE + 26) /* DMA2 3 (SPORT2 TX) */
182#define IRQ_SPORT1_TX IRQ_DMA2_3 /* DMA2 3 (SPORT2 TX) */
183#define IRQ_DMA2_4 (IVG_BASE + 27) /* DMA2 4 (SPI) */
184#define IRQ_SPI IRQ_DMA2_4 /* DMA2 4 (SPI) */
185#define IRQ_DMA2_5 (IVG_BASE + 28) /* DMA2 5 (UART RX) */
186#define IRQ_UART_RX IRQ_DMA2_5 /* DMA2 5 (UART RX) */
187#define IRQ_DMA2_6 (IVG_BASE + 29) /* DMA2 6 (UART TX) */
188#define IRQ_UART_TX IRQ_DMA2_6 /* DMA2 6 (UART TX) */
189#define IRQ_DMA2_7 (IVG_BASE + 30) /* DMA2 7 Interrupt */
190#define IRQ_DMA2_8 (IVG_BASE + 31) /* DMA2 8 Interrupt */
191#define IRQ_DMA2_9 (IVG_BASE + 32) /* DMA2 9 Interrupt */
192#define IRQ_DMA2_10 (IVG_BASE + 33) /* DMA2 10 Interrupt */
193#define IRQ_DMA2_11 (IVG_BASE + 34) /* DMA2 11 Interrupt */
194/* IVG 10 */
195#define IRQ_TIMER0 (IVG_BASE + 35) /* TIMER 0 Interrupt */
196#define IRQ_TIMER1 (IVG_BASE + 36) /* TIMER 1 Interrupt */
197#define IRQ_TIMER2 (IVG_BASE + 37) /* TIMER 2 Interrupt */
198#define IRQ_TIMER3 (IVG_BASE + 38) /* TIMER 3 Interrupt */
199#define IRQ_TIMER4 (IVG_BASE + 39) /* TIMER 4 Interrupt */
200#define IRQ_TIMER5 (IVG_BASE + 40) /* TIMER 5 Interrupt */
201#define IRQ_TIMER6 (IVG_BASE + 41) /* TIMER 6 Interrupt */
202#define IRQ_TIMER7 (IVG_BASE + 42) /* TIMER 7 Interrupt */
203#define IRQ_TIMER8 (IVG_BASE + 43) /* TIMER 8 Interrupt */
204#define IRQ_TIMER9 (IVG_BASE + 44) /* TIMER 9 Interrupt */
205#define IRQ_TIMER10 (IVG_BASE + 45) /* TIMER 10 Interrupt */
206#define IRQ_TIMER11 (IVG_BASE + 46) /* TIMER 11 Interrupt */
207/* IVG 11 */
208#define IRQ_PROG0_INTA (IVG_BASE + 47) /* Programmable Flags0 A (8) */
209#define IRQ_PROG_INTA IRQ_PROG0_INTA /* Programmable Flags0 A (8) */
210#define IRQ_PROG0_INTB (IVG_BASE + 48) /* Programmable Flags0 B (8) */
211#define IRQ_PROG_INTB IRQ_PROG0_INTB /* Programmable Flags0 B (8) */
212#define IRQ_PROG1_INTA (IVG_BASE + 49) /* Programmable Flags1 A (8) */
213#define IRQ_PROG1_INTB (IVG_BASE + 50) /* Programmable Flags1 B (8) */
214#define IRQ_PROG2_INTA (IVG_BASE + 51) /* Programmable Flags2 A (8) */
215#define IRQ_PROG2_INTB (IVG_BASE + 52) /* Programmable Flags2 B (8) */
216/* IVG 8 */
217#define IRQ_DMA1_WRRD0 (IVG_BASE + 53) /* MDMA1 0 write/read INT */
218#define IRQ_DMA_WRRD0 IRQ_DMA1_WRRD0 /* MDMA1 0 write/read INT */
219#define IRQ_MEM_DMA0 IRQ_DMA1_WRRD0
220#define IRQ_DMA1_WRRD1 (IVG_BASE + 54) /* MDMA1 1 write/read INT */
221#define IRQ_DMA_WRRD1 IRQ_DMA1_WRRD1 /* MDMA1 1 write/read INT */
222#define IRQ_MEM_DMA1 IRQ_DMA1_WRRD1
223/* IVG 9 */
224#define IRQ_DMA2_WRRD0 (IVG_BASE + 55) /* MDMA2 0 write/read INT */
225#define IRQ_MEM_DMA2 IRQ_DMA2_WRRD0
226#define IRQ_DMA2_WRRD1 (IVG_BASE + 56) /* MDMA2 1 write/read INT */
227#define IRQ_MEM_DMA3 IRQ_DMA2_WRRD1
228/* IVG 12 */
229#define IRQ_IMDMA_WRRD0 (IVG_BASE + 57) /* IMDMA 0 write/read INT */
230#define IRQ_IMEM_DMA0 IRQ_IMDMA_WRRD0
231#define IRQ_IMDMA_WRRD1 (IVG_BASE + 58) /* IMDMA 1 write/read INT */
232#define IRQ_IMEM_DMA1 IRQ_IMDMA_WRRD1
233/* IVG 13 */
234#define IRQ_WATCH (IVG_BASE + 59) /* Watch Dog Timer */
235/* IVG 7 */
236#define IRQ_RESERVED_1 (IVG_BASE + 60) /* Reserved interrupt */
237#define IRQ_RESERVED_2 (IVG_BASE + 61) /* Reserved interrupt */
238#define IRQ_SUPPLE_0 (IVG_BASE + 62) /* Supplemental interrupt 0 */
239#define IRQ_SUPPLE_1 (IVG_BASE + 63) /* supplemental interrupt 1 */
240#define IRQ_SW_INT1 71 /* Software Interrupt 1 */
241#define IRQ_SW_INT2 72 /* Software Interrupt 2 */
242 /* reserved for SYSCALL */
243#define IRQ_PF0 73
244#define IRQ_PF1 74
245#define IRQ_PF2 75
246#define IRQ_PF3 76
247#define IRQ_PF4 77
248#define IRQ_PF5 78
249#define IRQ_PF6 79
250#define IRQ_PF7 80
251#define IRQ_PF8 81
252#define IRQ_PF9 82
253#define IRQ_PF10 83
254#define IRQ_PF11 84
255#define IRQ_PF12 85
256#define IRQ_PF13 86
257#define IRQ_PF14 87
258#define IRQ_PF15 88
259#define IRQ_PF16 89
260#define IRQ_PF17 90
261#define IRQ_PF18 91
262#define IRQ_PF19 92
263#define IRQ_PF20 93
264#define IRQ_PF21 94
265#define IRQ_PF22 95
266#define IRQ_PF23 96
267#define IRQ_PF24 97
268#define IRQ_PF25 98
269#define IRQ_PF26 99
270#define IRQ_PF27 100
271#define IRQ_PF28 101
272#define IRQ_PF29 102
273#define IRQ_PF30 103
274#define IRQ_PF31 104
275#define IRQ_PF32 105
276#define IRQ_PF33 106
277#define IRQ_PF34 107
278#define IRQ_PF35 108
279#define IRQ_PF36 109
280#define IRQ_PF37 110
281#define IRQ_PF38 111
282#define IRQ_PF39 112
283#define IRQ_PF40 113
284#define IRQ_PF41 114
285#define IRQ_PF42 115
286#define IRQ_PF43 116
287#define IRQ_PF44 117
288#define IRQ_PF45 118
289#define IRQ_PF46 119
290#define IRQ_PF47 120
291
292#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
293#define NR_IRQS (IRQ_PF47 + 1)
294#else
295#define NR_IRQS SYS_IRQS
296#endif
297
298#define IVG7 7
299#define IVG8 8
300#define IVG9 9
301#define IVG10 10
302#define IVG11 11
303#define IVG12 12
304#define IVG13 13
305#define IVG14 14
306#define IVG15 15
307
308/*
309 * DEFAULT PRIORITIES:
310 */
311
312#define CONFIG_DEF_PLL_WAKEUP 7
313#define CONFIG_DEF_DMA1_ERROR 7
314#define CONFIG_DEF_DMA2_ERROR 7
315#define CONFIG_DEF_IMDMA_ERROR 7
316#define CONFIG_DEF_PPI1_ERROR 7
317#define CONFIG_DEF_PPI2_ERROR 7
318#define CONFIG_DEF_SPORT0_ERROR 7
319#define CONFIG_DEF_SPORT1_ERROR 7
320#define CONFIG_DEF_SPI_ERROR 7
321#define CONFIG_DEF_UART_ERROR 7
322#define CONFIG_DEF_RESERVED_ERROR 7
323#define CONFIG_DEF_DMA1_0 8
324#define CONFIG_DEF_DMA1_1 8
325#define CONFIG_DEF_DMA1_2 8
326#define CONFIG_DEF_DMA1_3 8
327#define CONFIG_DEF_DMA1_4 8
328#define CONFIG_DEF_DMA1_5 8
329#define CONFIG_DEF_DMA1_6 8
330#define CONFIG_DEF_DMA1_7 8
331#define CONFIG_DEF_DMA1_8 8
332#define CONFIG_DEF_DMA1_9 8
333#define CONFIG_DEF_DMA1_10 8
334#define CONFIG_DEF_DMA1_11 8
335#define CONFIG_DEF_DMA2_0 9
336#define CONFIG_DEF_DMA2_1 9
337#define CONFIG_DEF_DMA2_2 9
338#define CONFIG_DEF_DMA2_3 9
339#define CONFIG_DEF_DMA2_4 9
340#define CONFIG_DEF_DMA2_5 9
341#define CONFIG_DEF_DMA2_6 9
342#define CONFIG_DEF_DMA2_7 9
343#define CONFIG_DEF_DMA2_8 9
344#define CONFIG_DEF_DMA2_9 9
345#define CONFIG_DEF_DMA2_10 9
346#define CONFIG_DEF_DMA2_11 9
347#define CONFIG_DEF_TIMER0 10
348#define CONFIG_DEF_TIMER1 10
349#define CONFIG_DEF_TIMER2 10
350#define CONFIG_DEF_TIMER3 10
351#define CONFIG_DEF_TIMER4 10
352#define CONFIG_DEF_TIMER5 10
353#define CONFIG_DEF_TIMER6 10
354#define CONFIG_DEF_TIMER7 10
355#define CONFIG_DEF_TIMER8 10
356#define CONFIG_DEF_TIMER9 10
357#define CONFIG_DEF_TIMER10 10
358#define CONFIG_DEF_TIMER11 10
359#define CONFIG_DEF_PROG0_INTA 11
360#define CONFIG_DEF_PROG0_INTB 11
361#define CONFIG_DEF_PROG1_INTA 11
362#define CONFIG_DEF_PROG1_INTB 11
363#define CONFIG_DEF_PROG2_INTA 11
364#define CONFIG_DEF_PROG2_INTB 11
365#define CONFIG_DEF_DMA1_WRRD0 8
366#define CONFIG_DEF_DMA1_WRRD1 8
367#define CONFIG_DEF_DMA2_WRRD0 9
368#define CONFIG_DEF_DMA2_WRRD1 9
369#define CONFIG_DEF_IMDMA_WRRD0 12
370#define CONFIG_DEF_IMDMA_WRRD1 12
371#define CONFIG_DEF_WATCH 13
372#define CONFIG_DEF_RESERVED_1 7
373#define CONFIG_DEF_RESERVED_2 7
374#define CONFIG_DEF_SUPPLE_0 7
375#define CONFIG_DEF_SUPPLE_1 7
376
377/* IAR0 BIT FIELDS */
378#define IRQ_PLL_WAKEUP_POS 0
379#define IRQ_DMA1_ERROR_POS 4
380#define IRQ_DMA2_ERROR_POS 8
381#define IRQ_IMDMA_ERROR_POS 12
382#define IRQ_PPI0_ERROR_POS 16
383#define IRQ_PPI1_ERROR_POS 20
384#define IRQ_SPORT0_ERROR_POS 24
385#define IRQ_SPORT1_ERROR_POS 28
386/* IAR1 BIT FIELDS */
387#define IRQ_SPI_ERROR_POS 0
388#define IRQ_UART_ERROR_POS 4
389#define IRQ_RESERVED_ERROR_POS 8
390#define IRQ_DMA1_0_POS 12
391#define IRQ_DMA1_1_POS 16
392#define IRQ_DMA1_2_POS 20
393#define IRQ_DMA1_3_POS 24
394#define IRQ_DMA1_4_POS 28
395/* IAR2 BIT FIELDS */
396#define IRQ_DMA1_5_POS 0
397#define IRQ_DMA1_6_POS 4
398#define IRQ_DMA1_7_POS 8
399#define IRQ_DMA1_8_POS 12
400#define IRQ_DMA1_9_POS 16
401#define IRQ_DMA1_10_POS 20
402#define IRQ_DMA1_11_POS 24
403#define IRQ_DMA2_0_POS 28
404/* IAR3 BIT FIELDS */
405#define IRQ_DMA2_1_POS 0
406#define IRQ_DMA2_2_POS 4
407#define IRQ_DMA2_3_POS 8
408#define IRQ_DMA2_4_POS 12
409#define IRQ_DMA2_5_POS 16
410#define IRQ_DMA2_6_POS 20
411#define IRQ_DMA2_7_POS 24
412#define IRQ_DMA2_8_POS 28
413/* IAR4 BIT FIELDS */
414#define IRQ_DMA2_9_POS 0
415#define IRQ_DMA2_10_POS 4
416#define IRQ_DMA2_11_POS 8
417#define IRQ_TIMER0_POS 12
418#define IRQ_TIMER1_POS 16
419#define IRQ_TIMER2_POS 20
420#define IRQ_TIMER3_POS 24
421#define IRQ_TIMER4_POS 28
422/* IAR5 BIT FIELDS */
423#define IRQ_TIMER5_POS 0
424#define IRQ_TIMER6_POS 4
425#define IRQ_TIMER7_POS 8
426#define IRQ_TIMER8_POS 12
427#define IRQ_TIMER9_POS 16
428#define IRQ_TIMER10_POS 20
429#define IRQ_TIMER11_POS 24
430#define IRQ_PROG0_INTA_POS 28
431/* IAR6 BIT FIELDS */
432#define IRQ_PROG0_INTB_POS 0
433#define IRQ_PROG1_INTA_POS 4
434#define IRQ_PROG1_INTB_POS 8
435#define IRQ_PROG2_INTA_POS 12
436#define IRQ_PROG2_INTB_POS 16
437#define IRQ_DMA1_WRRD0_POS 20
438#define IRQ_DMA1_WRRD1_POS 24
439#define IRQ_DMA2_WRRD0_POS 28
440/* IAR7 BIT FIELDS */
441#define IRQ_DMA2_WRRD1_POS 0
442#define IRQ_IMDMA_WRRD0_POS 4
443#define IRQ_IMDMA_WRRD1_POS 8
444#define IRQ_WDTIMER_POS 12
445#define IRQ_RESERVED_1_POS 16
446#define IRQ_RESERVED_2_POS 20
447#define IRQ_SUPPLE_0_POS 24
448#define IRQ_SUPPLE_1_POS 28
449
450#endif /* _BF561_IRQ_H_ */
diff --git a/include/asm-blackfin/mach-bf561/mem_init.h b/include/asm-blackfin/mach-bf561/mem_init.h
new file mode 100644
index 000000000000..439a5895b346
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/mem_init.h
@@ -0,0 +1,322 @@
1/*
2 * File: include/asm-blackfin/mach-bf561/mem_init.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC8M32B2B5_7)
32#if (CONFIG_SCLK_HZ > 119402985)
33#define SDRAM_tRP TRP_2
34#define SDRAM_tRP_num 2
35#define SDRAM_tRAS TRAS_7
36#define SDRAM_tRAS_num 7
37#define SDRAM_tRCD TRCD_2
38#define SDRAM_tWR TWR_2
39#endif
40#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
41#define SDRAM_tRP TRP_2
42#define SDRAM_tRP_num 2
43#define SDRAM_tRAS TRAS_6
44#define SDRAM_tRAS_num 6
45#define SDRAM_tRCD TRCD_2
46#define SDRAM_tWR TWR_2
47#endif
48#if (CONFIG_SCLK_HZ > 89552239) && (CONFIG_SCLK_HZ <= 104477612)
49#define SDRAM_tRP TRP_2
50#define SDRAM_tRP_num 2
51#define SDRAM_tRAS TRAS_5
52#define SDRAM_tRAS_num 5
53#define SDRAM_tRCD TRCD_2
54#define SDRAM_tWR TWR_2
55#endif
56#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
57#define SDRAM_tRP TRP_2
58#define SDRAM_tRP_num 2
59#define SDRAM_tRAS TRAS_4
60#define SDRAM_tRAS_num 4
61#define SDRAM_tRCD TRCD_2
62#define SDRAM_tWR TWR_2
63#endif
64#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
65#define SDRAM_tRP TRP_2
66#define SDRAM_tRP_num 2
67#define SDRAM_tRAS TRAS_3
68#define SDRAM_tRAS_num 3
69#define SDRAM_tRCD TRCD_2
70#define SDRAM_tWR TWR_2
71#endif
72#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
73#define SDRAM_tRP TRP_1
74#define SDRAM_tRP_num 1
75#define SDRAM_tRAS TRAS_4
76#define SDRAM_tRAS_num 3
77#define SDRAM_tRCD TRCD_1
78#define SDRAM_tWR TWR_2
79#endif
80#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
81#define SDRAM_tRP TRP_1
82#define SDRAM_tRP_num 1
83#define SDRAM_tRAS TRAS_3
84#define SDRAM_tRAS_num 3
85#define SDRAM_tRCD TRCD_1
86#define SDRAM_tWR TWR_2
87#endif
88#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
89#define SDRAM_tRP TRP_1
90#define SDRAM_tRP_num 1
91#define SDRAM_tRAS TRAS_2
92#define SDRAM_tRAS_num 2
93#define SDRAM_tRCD TRCD_1
94#define SDRAM_tWR TWR_2
95#endif
96#if (CONFIG_SCLK_HZ <= 29850746)
97#define SDRAM_tRP TRP_1
98#define SDRAM_tRP_num 1
99#define SDRAM_tRAS TRAS_1
100#define SDRAM_tRAS_num 1
101#define SDRAM_tRCD TRCD_1
102#define SDRAM_tWR TWR_2
103#endif
104#endif
105
106#if (CONFIG_MEM_MT48LC16M16A2TG_75)
107 /*SDRAM INFORMATION: */
108#define SDRAM_Tref 64 /* Refresh period in milliseconds */
109#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
110#define SDRAM_CL CL_3
111#endif
112
113#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
114 /*SDRAM INFORMATION: */
115#define SDRAM_Tref 64 /* Refresh period in milliseconds */
116#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
117#define SDRAM_CL CL_3
118#endif
119
120#if (CONFIG_MEM_MT48LC8M32B2B5_7)
121 /*SDRAM INFORMATION: */
122#define SDRAM_Tref 64 /* Refresh period in milliseconds */
123#define SDRAM_NRA 4096 /* Number of row addresses in SDRAM */
124#define SDRAM_CL CL_3
125#endif
126
127#if (CONFIG_MEM_GENERIC_BOARD)
128 /*SDRAM INFORMATION: Modify this for your board */
129#define SDRAM_Tref 64 /* Refresh period in milliseconds */
130#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
131#define SDRAM_CL CL_3
132#endif
133
134#if (CONFIG_MEM_SIZE == 128)
135#define SDRAM_SIZE EB0_SZ_128
136#endif
137#if (CONFIG_MEM_SIZE == 64)
138#define SDRAM_SIZE EB0_SZ_64
139#endif
140#if ( CONFIG_MEM_SIZE == 32)
141#define SDRAM_SIZE EB0_SZ_32
142#endif
143#if (CONFIG_MEM_SIZE == 16)
144#define SDRAM_SIZE EB0_SZ_16
145#endif
146#if (CONFIG_MEM_ADD_WIDTH == 11)
147#define SDRAM_WIDTH EB0_CAW_11
148#endif
149#if (CONFIG_MEM_ADD_WIDTH == 10)
150#define SDRAM_WIDTH EB0_CAW_10
151#endif
152#if (CONFIG_MEM_ADD_WIDTH == 9)
153#define SDRAM_WIDTH EB0_CAW_9
154#endif
155#if (CONFIG_MEM_ADD_WIDTH == 8)
156#define SDRAM_WIDTH EB0_CAW_8
157#endif
158
159#define mem_SDBCTL (SDRAM_WIDTH | SDRAM_SIZE | EB0_E)
160
161/* Equation from section 17 (p17-46) of BF533 HRM */
162#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
163
164/* Enable SCLK Out */
165#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
166
167#if defined CONFIG_CLKIN_HALF
168#define CLKIN_HALF 1
169#else
170#define CLKIN_HALF 0
171#endif
172
173#if defined CONFIG_PLL_BYPASS
174#define PLL_BYPASS 1
175#else
176#define PLL_BYPASS 0
177#endif
178
179/***************************************Currently Not Being Used *********************************/
180#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
181#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
182#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
183#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
184#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
185
186#if (flash_EBIU_AMBCTL_TT > 3)
187#define flash_EBIU_AMBCTL0_TT B0TT_4
188#endif
189#if (flash_EBIU_AMBCTL_TT == 3)
190#define flash_EBIU_AMBCTL0_TT B0TT_3
191#endif
192#if (flash_EBIU_AMBCTL_TT == 2)
193#define flash_EBIU_AMBCTL0_TT B0TT_2
194#endif
195#if (flash_EBIU_AMBCTL_TT < 2)
196#define flash_EBIU_AMBCTL0_TT B0TT_1
197#endif
198
199#if (flash_EBIU_AMBCTL_ST > 3)
200#define flash_EBIU_AMBCTL0_ST B0ST_4
201#endif
202#if (flash_EBIU_AMBCTL_ST == 3)
203#define flash_EBIU_AMBCTL0_ST B0ST_3
204#endif
205#if (flash_EBIU_AMBCTL_ST == 2)
206#define flash_EBIU_AMBCTL0_ST B0ST_2
207#endif
208#if (flash_EBIU_AMBCTL_ST < 2)
209#define flash_EBIU_AMBCTL0_ST B0ST_1
210#endif
211
212#if (flash_EBIU_AMBCTL_HT > 2)
213#define flash_EBIU_AMBCTL0_HT B0HT_3
214#endif
215#if (flash_EBIU_AMBCTL_HT == 2)
216#define flash_EBIU_AMBCTL0_HT B0HT_2
217#endif
218#if (flash_EBIU_AMBCTL_HT == 1)
219#define flash_EBIU_AMBCTL0_HT B0HT_1
220#endif
221#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
222#define flash_EBIU_AMBCTL0_HT B0HT_0
223#endif
224#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
225#define flash_EBIU_AMBCTL0_HT B0HT_1
226#endif
227
228#if (flash_EBIU_AMBCTL_WAT > 14)
229#define flash_EBIU_AMBCTL0_WAT B0WAT_15
230#endif
231#if (flash_EBIU_AMBCTL_WAT == 14)
232#define flash_EBIU_AMBCTL0_WAT B0WAT_14
233#endif
234#if (flash_EBIU_AMBCTL_WAT == 13)
235#define flash_EBIU_AMBCTL0_WAT B0WAT_13
236#endif
237#if (flash_EBIU_AMBCTL_WAT == 12)
238#define flash_EBIU_AMBCTL0_WAT B0WAT_12
239#endif
240#if (flash_EBIU_AMBCTL_WAT == 11)
241#define flash_EBIU_AMBCTL0_WAT B0WAT_11
242#endif
243#if (flash_EBIU_AMBCTL_WAT == 10)
244#define flash_EBIU_AMBCTL0_WAT B0WAT_10
245#endif
246#if (flash_EBIU_AMBCTL_WAT == 9)
247#define flash_EBIU_AMBCTL0_WAT B0WAT_9
248#endif
249#if (flash_EBIU_AMBCTL_WAT == 8)
250#define flash_EBIU_AMBCTL0_WAT B0WAT_8
251#endif
252#if (flash_EBIU_AMBCTL_WAT == 7)
253#define flash_EBIU_AMBCTL0_WAT B0WAT_7
254#endif
255#if (flash_EBIU_AMBCTL_WAT == 6)
256#define flash_EBIU_AMBCTL0_WAT B0WAT_6
257#endif
258#if (flash_EBIU_AMBCTL_WAT == 5)
259#define flash_EBIU_AMBCTL0_WAT B0WAT_5
260#endif
261#if (flash_EBIU_AMBCTL_WAT == 4)
262#define flash_EBIU_AMBCTL0_WAT B0WAT_4
263#endif
264#if (flash_EBIU_AMBCTL_WAT == 3)
265#define flash_EBIU_AMBCTL0_WAT B0WAT_3
266#endif
267#if (flash_EBIU_AMBCTL_WAT == 2)
268#define flash_EBIU_AMBCTL0_WAT B0WAT_2
269#endif
270#if (flash_EBIU_AMBCTL_WAT == 1)
271#define flash_EBIU_AMBCTL0_WAT B0WAT_1
272#endif
273
274#if (flash_EBIU_AMBCTL_RAT > 14)
275#define flash_EBIU_AMBCTL0_RAT B0RAT_15
276#endif
277#if (flash_EBIU_AMBCTL_RAT == 14)
278#define flash_EBIU_AMBCTL0_RAT B0RAT_14
279#endif
280#if (flash_EBIU_AMBCTL_RAT == 13)
281#define flash_EBIU_AMBCTL0_RAT B0RAT_13
282#endif
283#if (flash_EBIU_AMBCTL_RAT == 12)
284#define flash_EBIU_AMBCTL0_RAT B0RAT_12
285#endif
286#if (flash_EBIU_AMBCTL_RAT == 11)
287#define flash_EBIU_AMBCTL0_RAT B0RAT_11
288#endif
289#if (flash_EBIU_AMBCTL_RAT == 10)
290#define flash_EBIU_AMBCTL0_RAT B0RAT_10
291#endif
292#if (flash_EBIU_AMBCTL_RAT == 9)
293#define flash_EBIU_AMBCTL0_RAT B0RAT_9
294#endif
295#if (flash_EBIU_AMBCTL_RAT == 8)
296#define flash_EBIU_AMBCTL0_RAT B0RAT_8
297#endif
298#if (flash_EBIU_AMBCTL_RAT == 7)
299#define flash_EBIU_AMBCTL0_RAT B0RAT_7
300#endif
301#if (flash_EBIU_AMBCTL_RAT == 6)
302#define flash_EBIU_AMBCTL0_RAT B0RAT_6
303#endif
304#if (flash_EBIU_AMBCTL_RAT == 5)
305#define flash_EBIU_AMBCTL0_RAT B0RAT_5
306#endif
307#if (flash_EBIU_AMBCTL_RAT == 4)
308#define flash_EBIU_AMBCTL0_RAT B0RAT_4
309#endif
310#if (flash_EBIU_AMBCTL_RAT == 3)
311#define flash_EBIU_AMBCTL0_RAT B0RAT_3
312#endif
313#if (flash_EBIU_AMBCTL_RAT == 2)
314#define flash_EBIU_AMBCTL0_RAT B0RAT_2
315#endif
316#if (flash_EBIU_AMBCTL_RAT == 1)
317#define flash_EBIU_AMBCTL0_RAT B0RAT_1
318#endif
319
320#define flash_EBIU_AMBCTL0 \
321 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
322 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/include/asm-blackfin/mach-bf561/mem_map.h b/include/asm-blackfin/mach-bf561/mem_map.h
new file mode 100644
index 000000000000..ebac9a8d838d
--- /dev/null
+++ b/include/asm-blackfin/mach-bf561/mem_map.h
@@ -0,0 +1,75 @@
1/*
2 * Memory MAP
3 * Common header file for blackfin BF561 of processors.
4 */
5
6#ifndef _MEM_MAP_561_H_
7#define _MEM_MAP_561_H_
8
9#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
10#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
11
12/* Async Memory Banks */
13#define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */
14#define ASYNC_BANK3_SIZE 0x04000000 /* 64M */
15#define ASYNC_BANK2_BASE 0x28000000 /* Async Bank 2 */
16#define ASYNC_BANK2_SIZE 0x04000000 /* 64M */
17#define ASYNC_BANK1_BASE 0x24000000 /* Async Bank 1 */
18#define ASYNC_BANK1_SIZE 0x04000000 /* 64M */
19#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
20#define ASYNC_BANK0_SIZE 0x04000000 /* 64M */
21
22/* Level 1 Memory */
23
24#ifdef CONFIG_BLKFIN_CACHE
25#define BLKFIN_ICACHESIZE (16*1024)
26#else
27#define BLKFIN_ICACHESIZE (0*1024)
28#endif
29
30/* Memory Map for ADSP-BF561 processors */
31
32#ifdef CONFIG_BF561
33#define L1_CODE_START 0xFFA00000
34#define L1_DATA_A_START 0xFF800000
35#define L1_DATA_B_START 0xFF900000
36
37#define L1_CODE_LENGTH 0x4000
38
39#ifdef CONFIG_BLKFIN_DCACHE
40
41#ifdef CONFIG_BLKFIN_DCACHE_BANKA
42#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
43#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
44#define L1_DATA_B_LENGTH 0x8000
45#define BLKFIN_DCACHESIZE (16*1024)
46#define BLKFIN_DSUPBANKS 1
47#else
48#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
49#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
50#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
51#define BLKFIN_DCACHESIZE (32*1024)
52#define BLKFIN_DSUPBANKS 2
53#endif
54
55#else
56#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
57#define L1_DATA_A_LENGTH 0x8000
58#define L1_DATA_B_LENGTH 0x8000
59#define BLKFIN_DCACHESIZE (0*1024)
60#define BLKFIN_DSUPBANKS 0
61#endif /*CONFIG_BLKFIN_DCACHE*/
62#endif
63
64/* Level 2 Memory */
65#define L2_START 0xFEB00000
66#define L2_LENGTH 0x20000
67
68/* Scratch Pad Memory */
69
70#if defined(CONFIG_BF561)
71#define L1_SCRATCH_START 0xFFB00000
72#define L1_SCRATCH_LENGTH 0x1000
73#endif
74
75#endif /* _MEM_MAP_533_H_ */
diff --git a/include/asm-blackfin/mach-common/cdef_LPBlackfin.h b/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
new file mode 100644
index 000000000000..22aa5e637993
--- /dev/null
+++ b/include/asm-blackfin/mach-common/cdef_LPBlackfin.h
@@ -0,0 +1,471 @@
1 /*
2 * File: include/asm-blackfin/mach-common/cdef_LPBlackfin.h
3 * Based on:
4 * Author: unknown
5 * COPYRIGHT 2005 Analog Devices
6 * Created: ?
7 * Description:
8 *
9 * Modified:
10 *
11 * Bugs: Enter bugs at http://blackfin.uclinux.org/
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; see the file COPYING.
25 * If not, write to the Free Software Foundation,
26 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */
28
29#ifndef _CDEF_LPBLACKFIN_H
30#define _CDEF_LPBLACKFIN_H
31
32/*#if !defined(__ADSPLPBLACKFIN__)
33#warning cdef_LPBlackfin.h should only be included for 532 compatible chips.
34#endif
35*/
36#include <asm/mach-common/def_LPBlackfin.h>
37
38/*Cache & SRAM Memory*/
39#define pSRAM_BASE_ADDRESS ((volatile void **)SRAM_BASE_ADDRESS)
40#define bfin_read_SRAM_BASE_ADDRESS() bfin_read32(SRAM_BASE_ADDRESS)
41#define bfin_write_SRAM_BASE_ADDRESS(val) bfin_write32(SRAM_BASE_ADDRESS,val)
42#define pDMEM_CONTROL ((volatile unsigned long *)DMEM_CONTROL)
43#define bfin_read_DMEM_CONTROL() bfin_read32(DMEM_CONTROL)
44#define bfin_write_DMEM_CONTROL(val) bfin_write32(DMEM_CONTROL,val)
45#define pDCPLB_STATUS ((volatile unsigned long *)DCPLB_STATUS)
46#define bfin_read_DCPLB_STATUS() bfin_read32(DCPLB_STATUS)
47#define bfin_write_DCPLB_STATUS(val) bfin_write32(DCPLB_STATUS,val)
48#define pDCPLB_FAULT_ADDR ((volatile void **)DCPLB_FAULT_ADDR)
49#define bfin_read_DCPLB_FAULT_ADDR() bfin_read32(DCPLB_FAULT_ADDR)
50#define bfin_write_DCPLB_FAULT_ADDR(val) bfin_write32(DCPLB_FAULT_ADDR,val)
51/*
52#define MMR_TIMEOUT 0xFFE00010
53*/
54#define pDCPLB_ADDR0 ((volatile void **)DCPLB_ADDR0)
55#define bfin_read_DCPLB_ADDR0() bfin_read32(DCPLB_ADDR0)
56#define bfin_write_DCPLB_ADDR0(val) bfin_write32(DCPLB_ADDR0,val)
57#define pDCPLB_ADDR1 ((volatile void **)DCPLB_ADDR1)
58#define bfin_read_DCPLB_ADDR1() bfin_read32(DCPLB_ADDR1)
59#define bfin_write_DCPLB_ADDR1(val) bfin_write32(DCPLB_ADDR1,val)
60#define pDCPLB_ADDR2 ((volatile void **)DCPLB_ADDR2)
61#define bfin_read_DCPLB_ADDR2() bfin_read32(DCPLB_ADDR2)
62#define bfin_write_DCPLB_ADDR2(val) bfin_write32(DCPLB_ADDR2,val)
63#define pDCPLB_ADDR3 ((volatile void **)DCPLB_ADDR3)
64#define bfin_read_DCPLB_ADDR3() bfin_read32(DCPLB_ADDR3)
65#define bfin_write_DCPLB_ADDR3(val) bfin_write32(DCPLB_ADDR3,val)
66#define pDCPLB_ADDR4 ((volatile void **)DCPLB_ADDR4)
67#define bfin_read_DCPLB_ADDR4() bfin_read32(DCPLB_ADDR4)
68#define bfin_write_DCPLB_ADDR4(val) bfin_write32(DCPLB_ADDR4,val)
69#define pDCPLB_ADDR5 ((volatile void **)DCPLB_ADDR5)
70#define bfin_read_DCPLB_ADDR5() bfin_read32(DCPLB_ADDR5)
71#define bfin_write_DCPLB_ADDR5(val) bfin_write32(DCPLB_ADDR5,val)
72#define pDCPLB_ADDR6 ((volatile void **)DCPLB_ADDR6)
73#define bfin_read_DCPLB_ADDR6() bfin_read32(DCPLB_ADDR6)
74#define bfin_write_DCPLB_ADDR6(val) bfin_write32(DCPLB_ADDR6,val)
75#define pDCPLB_ADDR7 ((volatile void **)DCPLB_ADDR7)
76#define bfin_read_DCPLB_ADDR7() bfin_read32(DCPLB_ADDR7)
77#define bfin_write_DCPLB_ADDR7(val) bfin_write32(DCPLB_ADDR7,val)
78#define pDCPLB_ADDR8 ((volatile void **)DCPLB_ADDR8)
79#define bfin_read_DCPLB_ADDR8() bfin_read32(DCPLB_ADDR8)
80#define bfin_write_DCPLB_ADDR8(val) bfin_write32(DCPLB_ADDR8,val)
81#define pDCPLB_ADDR9 ((volatile void **)DCPLB_ADDR9)
82#define bfin_read_DCPLB_ADDR9() bfin_read32(DCPLB_ADDR9)
83#define bfin_write_DCPLB_ADDR9(val) bfin_write32(DCPLB_ADDR9,val)
84#define pDCPLB_ADDR10 ((volatile void **)DCPLB_ADDR10)
85#define bfin_read_DCPLB_ADDR10() bfin_read32(DCPLB_ADDR10)
86#define bfin_write_DCPLB_ADDR10(val) bfin_write32(DCPLB_ADDR10,val)
87#define pDCPLB_ADDR11 ((volatile void **)DCPLB_ADDR11)
88#define bfin_read_DCPLB_ADDR11() bfin_read32(DCPLB_ADDR11)
89#define bfin_write_DCPLB_ADDR11(val) bfin_write32(DCPLB_ADDR11,val)
90#define pDCPLB_ADDR12 ((volatile void **)DCPLB_ADDR12)
91#define bfin_read_DCPLB_ADDR12() bfin_read32(DCPLB_ADDR12)
92#define bfin_write_DCPLB_ADDR12(val) bfin_write32(DCPLB_ADDR12,val)
93#define pDCPLB_ADDR13 ((volatile void **)DCPLB_ADDR13)
94#define bfin_read_DCPLB_ADDR13() bfin_read32(DCPLB_ADDR13)
95#define bfin_write_DCPLB_ADDR13(val) bfin_write32(DCPLB_ADDR13,val)
96#define pDCPLB_ADDR14 ((volatile void **)DCPLB_ADDR14)
97#define bfin_read_DCPLB_ADDR14() bfin_read32(DCPLB_ADDR14)
98#define bfin_write_DCPLB_ADDR14(val) bfin_write32(DCPLB_ADDR14,val)
99#define pDCPLB_ADDR15 ((volatile void **)DCPLB_ADDR15)
100#define bfin_read_DCPLB_ADDR15() bfin_read32(DCPLB_ADDR15)
101#define bfin_write_DCPLB_ADDR15(val) bfin_write32(DCPLB_ADDR15,val)
102#define pDCPLB_DATA0 ((volatile unsigned long *)DCPLB_DATA0)
103#define bfin_read_DCPLB_DATA0() bfin_read32(DCPLB_DATA0)
104#define bfin_write_DCPLB_DATA0(val) bfin_write32(DCPLB_DATA0,val)
105#define pDCPLB_DATA1 ((volatile unsigned long *)DCPLB_DATA1)
106#define bfin_read_DCPLB_DATA1() bfin_read32(DCPLB_DATA1)
107#define bfin_write_DCPLB_DATA1(val) bfin_write32(DCPLB_DATA1,val)
108#define pDCPLB_DATA2 ((volatile unsigned long *)DCPLB_DATA2)
109#define bfin_read_DCPLB_DATA2() bfin_read32(DCPLB_DATA2)
110#define bfin_write_DCPLB_DATA2(val) bfin_write32(DCPLB_DATA2,val)
111#define pDCPLB_DATA3 ((volatile unsigned long *)DCPLB_DATA3)
112#define bfin_read_DCPLB_DATA3() bfin_read32(DCPLB_DATA3)
113#define bfin_write_DCPLB_DATA3(val) bfin_write32(DCPLB_DATA3,val)
114#define pDCPLB_DATA4 ((volatile unsigned long *)DCPLB_DATA4)
115#define bfin_read_DCPLB_DATA4() bfin_read32(DCPLB_DATA4)
116#define bfin_write_DCPLB_DATA4(val) bfin_write32(DCPLB_DATA4,val)
117#define pDCPLB_DATA5 ((volatile unsigned long *)DCPLB_DATA5)
118#define bfin_read_DCPLB_DATA5() bfin_read32(DCPLB_DATA5)
119#define bfin_write_DCPLB_DATA5(val) bfin_write32(DCPLB_DATA5,val)
120#define pDCPLB_DATA6 ((volatile unsigned long *)DCPLB_DATA6)
121#define bfin_read_DCPLB_DATA6() bfin_read32(DCPLB_DATA6)
122#define bfin_write_DCPLB_DATA6(val) bfin_write32(DCPLB_DATA6,val)
123#define pDCPLB_DATA7 ((volatile unsigned long *)DCPLB_DATA7)
124#define bfin_read_DCPLB_DATA7() bfin_read32(DCPLB_DATA7)
125#define bfin_write_DCPLB_DATA7(val) bfin_write32(DCPLB_DATA7,val)
126#define pDCPLB_DATA8 ((volatile unsigned long *)DCPLB_DATA8)
127#define bfin_read_DCPLB_DATA8() bfin_read32(DCPLB_DATA8)
128#define bfin_write_DCPLB_DATA8(val) bfin_write32(DCPLB_DATA8,val)
129#define pDCPLB_DATA9 ((volatile unsigned long *)DCPLB_DATA9)
130#define bfin_read_DCPLB_DATA9() bfin_read32(DCPLB_DATA9)
131#define bfin_write_DCPLB_DATA9(val) bfin_write32(DCPLB_DATA9,val)
132#define pDCPLB_DATA10 ((volatile unsigned long *)DCPLB_DATA10)
133#define bfin_read_DCPLB_DATA10() bfin_read32(DCPLB_DATA10)
134#define bfin_write_DCPLB_DATA10(val) bfin_write32(DCPLB_DATA10,val)
135#define pDCPLB_DATA11 ((volatile unsigned long *)DCPLB_DATA11)
136#define bfin_read_DCPLB_DATA11() bfin_read32(DCPLB_DATA11)
137#define bfin_write_DCPLB_DATA11(val) bfin_write32(DCPLB_DATA11,val)
138#define pDCPLB_DATA12 ((volatile unsigned long *)DCPLB_DATA12)
139#define bfin_read_DCPLB_DATA12() bfin_read32(DCPLB_DATA12)
140#define bfin_write_DCPLB_DATA12(val) bfin_write32(DCPLB_DATA12,val)
141#define pDCPLB_DATA13 ((volatile unsigned long *)DCPLB_DATA13)
142#define bfin_read_DCPLB_DATA13() bfin_read32(DCPLB_DATA13)
143#define bfin_write_DCPLB_DATA13(val) bfin_write32(DCPLB_DATA13,val)
144#define pDCPLB_DATA14 ((volatile unsigned long *)DCPLB_DATA14)
145#define bfin_read_DCPLB_DATA14() bfin_read32(DCPLB_DATA14)
146#define bfin_write_DCPLB_DATA14(val) bfin_write32(DCPLB_DATA14,val)
147#define pDCPLB_DATA15 ((volatile unsigned long *)DCPLB_DATA15)
148#define bfin_read_DCPLB_DATA15() bfin_read32(DCPLB_DATA15)
149#define bfin_write_DCPLB_DATA15(val) bfin_write32(DCPLB_DATA15,val)
150#define pDTEST_COMMAND ((volatile unsigned long *)DTEST_COMMAND)
151#define bfin_read_DTEST_COMMAND() bfin_read32(DTEST_COMMAND)
152#define bfin_write_DTEST_COMMAND(val) bfin_write32(DTEST_COMMAND,val)
153/*
154#define DTEST_INDEX 0xFFE00304
155*/
156#define pDTEST_DATA0 ((volatile unsigned long *)DTEST_DATA0)
157#define bfin_read_DTEST_DATA0() bfin_read32(DTEST_DATA0)
158#define bfin_write_DTEST_DATA0(val) bfin_write32(DTEST_DATA0,val)
159#define pDTEST_DATA1 ((volatile unsigned long *)DTEST_DATA1)
160#define bfin_read_DTEST_DATA1() bfin_read32(DTEST_DATA1)
161#define bfin_write_DTEST_DATA1(val) bfin_write32(DTEST_DATA1,val)
162/*
163#define DTEST_DATA2 0xFFE00408
164#define DTEST_DATA3 0xFFE0040C
165*/
166#define pIMEM_CONTROL ((volatile unsigned long *)IMEM_CONTROL)
167#define bfin_read_IMEM_CONTROL() bfin_read32(IMEM_CONTROL)
168#define bfin_write_IMEM_CONTROL(val) bfin_write32(IMEM_CONTROL,val)
169#define pICPLB_STATUS ((volatile unsigned long *)ICPLB_STATUS)
170#define bfin_read_ICPLB_STATUS() bfin_read32(ICPLB_STATUS)
171#define bfin_write_ICPLB_STATUS(val) bfin_write32(ICPLB_STATUS,val)
172#define pICPLB_FAULT_ADDR ((volatile void **)ICPLB_FAULT_ADDR)
173#define bfin_read_ICPLB_FAULT_ADDR() bfin_read32(ICPLB_FAULT_ADDR)
174#define bfin_write_ICPLB_FAULT_ADDR(val) bfin_write32(ICPLB_FAULT_ADDR,val)
175#define pICPLB_ADDR0 ((volatile void **)ICPLB_ADDR0)
176#define bfin_read_ICPLB_ADDR0() bfin_read32(ICPLB_ADDR0)
177#define bfin_write_ICPLB_ADDR0(val) bfin_write32(ICPLB_ADDR0,val)
178#define pICPLB_ADDR1 ((volatile void **)ICPLB_ADDR1)
179#define bfin_read_ICPLB_ADDR1() bfin_read32(ICPLB_ADDR1)
180#define bfin_write_ICPLB_ADDR1(val) bfin_write32(ICPLB_ADDR1,val)
181#define pICPLB_ADDR2 ((volatile void **)ICPLB_ADDR2)
182#define bfin_read_ICPLB_ADDR2() bfin_read32(ICPLB_ADDR2)
183#define bfin_write_ICPLB_ADDR2(val) bfin_write32(ICPLB_ADDR2,val)
184#define pICPLB_ADDR3 ((volatile void **)ICPLB_ADDR3)
185#define bfin_read_ICPLB_ADDR3() bfin_read32(ICPLB_ADDR3)
186#define bfin_write_ICPLB_ADDR3(val) bfin_write32(ICPLB_ADDR3,val)
187#define pICPLB_ADDR4 ((volatile void **)ICPLB_ADDR4)
188#define bfin_read_ICPLB_ADDR4() bfin_read32(ICPLB_ADDR4)
189#define bfin_write_ICPLB_ADDR4(val) bfin_write32(ICPLB_ADDR4,val)
190#define pICPLB_ADDR5 ((volatile void **)ICPLB_ADDR5)
191#define bfin_read_ICPLB_ADDR5() bfin_read32(ICPLB_ADDR5)
192#define bfin_write_ICPLB_ADDR5(val) bfin_write32(ICPLB_ADDR5,val)
193#define pICPLB_ADDR6 ((volatile void **)ICPLB_ADDR6)
194#define bfin_read_ICPLB_ADDR6() bfin_read32(ICPLB_ADDR6)
195#define bfin_write_ICPLB_ADDR6(val) bfin_write32(ICPLB_ADDR6,val)
196#define pICPLB_ADDR7 ((volatile void **)ICPLB_ADDR7)
197#define bfin_read_ICPLB_ADDR7() bfin_read32(ICPLB_ADDR7)
198#define bfin_write_ICPLB_ADDR7(val) bfin_write32(ICPLB_ADDR7,val)
199#define pICPLB_ADDR8 ((volatile void **)ICPLB_ADDR8)
200#define bfin_read_ICPLB_ADDR8() bfin_read32(ICPLB_ADDR8)
201#define bfin_write_ICPLB_ADDR8(val) bfin_write32(ICPLB_ADDR8,val)
202#define pICPLB_ADDR9 ((volatile void **)ICPLB_ADDR9)
203#define bfin_read_ICPLB_ADDR9() bfin_read32(ICPLB_ADDR9)
204#define bfin_write_ICPLB_ADDR9(val) bfin_write32(ICPLB_ADDR9,val)
205#define pICPLB_ADDR10 ((volatile void **)ICPLB_ADDR10)
206#define bfin_read_ICPLB_ADDR10() bfin_read32(ICPLB_ADDR10)
207#define bfin_write_ICPLB_ADDR10(val) bfin_write32(ICPLB_ADDR10,val)
208#define pICPLB_ADDR11 ((volatile void **)ICPLB_ADDR11)
209#define bfin_read_ICPLB_ADDR11() bfin_read32(ICPLB_ADDR11)
210#define bfin_write_ICPLB_ADDR11(val) bfin_write32(ICPLB_ADDR11,val)
211#define pICPLB_ADDR12 ((volatile void **)ICPLB_ADDR12)
212#define bfin_read_ICPLB_ADDR12() bfin_read32(ICPLB_ADDR12)
213#define bfin_write_ICPLB_ADDR12(val) bfin_write32(ICPLB_ADDR12,val)
214#define pICPLB_ADDR13 ((volatile void **)ICPLB_ADDR13)
215#define bfin_read_ICPLB_ADDR13() bfin_read32(ICPLB_ADDR13)
216#define bfin_write_ICPLB_ADDR13(val) bfin_write32(ICPLB_ADDR13,val)
217#define pICPLB_ADDR14 ((volatile void **)ICPLB_ADDR14)
218#define bfin_read_ICPLB_ADDR14() bfin_read32(ICPLB_ADDR14)
219#define bfin_write_ICPLB_ADDR14(val) bfin_write32(ICPLB_ADDR14,val)
220#define pICPLB_ADDR15 ((volatile void **)ICPLB_ADDR15)
221#define bfin_read_ICPLB_ADDR15() bfin_read32(ICPLB_ADDR15)
222#define bfin_write_ICPLB_ADDR15(val) bfin_write32(ICPLB_ADDR15,val)
223#define pICPLB_DATA0 ((volatile unsigned long *)ICPLB_DATA0)
224#define bfin_read_ICPLB_DATA0() bfin_read32(ICPLB_DATA0)
225#define bfin_write_ICPLB_DATA0(val) bfin_write32(ICPLB_DATA0,val)
226#define pICPLB_DATA1 ((volatile unsigned long *)ICPLB_DATA1)
227#define bfin_read_ICPLB_DATA1() bfin_read32(ICPLB_DATA1)
228#define bfin_write_ICPLB_DATA1(val) bfin_write32(ICPLB_DATA1,val)
229#define pICPLB_DATA2 ((volatile unsigned long *)ICPLB_DATA2)
230#define bfin_read_ICPLB_DATA2() bfin_read32(ICPLB_DATA2)
231#define bfin_write_ICPLB_DATA2(val) bfin_write32(ICPLB_DATA2,val)
232#define pICPLB_DATA3 ((volatile unsigned long *)ICPLB_DATA3)
233#define bfin_read_ICPLB_DATA3() bfin_read32(ICPLB_DATA3)
234#define bfin_write_ICPLB_DATA3(val) bfin_write32(ICPLB_DATA3,val)
235#define pICPLB_DATA4 ((volatile unsigned long *)ICPLB_DATA4)
236#define bfin_read_ICPLB_DATA4() bfin_read32(ICPLB_DATA4)
237#define bfin_write_ICPLB_DATA4(val) bfin_write32(ICPLB_DATA4,val)
238#define pICPLB_DATA5 ((volatile unsigned long *)ICPLB_DATA5)
239#define bfin_read_ICPLB_DATA5() bfin_read32(ICPLB_DATA5)
240#define bfin_write_ICPLB_DATA5(val) bfin_write32(ICPLB_DATA5,val)
241#define pICPLB_DATA6 ((volatile unsigned long *)ICPLB_DATA6)
242#define bfin_read_ICPLB_DATA6() bfin_read32(ICPLB_DATA6)
243#define bfin_write_ICPLB_DATA6(val) bfin_write32(ICPLB_DATA6,val)
244#define pICPLB_DATA7 ((volatile unsigned long *)ICPLB_DATA7)
245#define bfin_read_ICPLB_DATA7() bfin_read32(ICPLB_DATA7)
246#define bfin_write_ICPLB_DATA7(val) bfin_write32(ICPLB_DATA7,val)
247#define pICPLB_DATA8 ((volatile unsigned long *)ICPLB_DATA8)
248#define bfin_read_ICPLB_DATA8() bfin_read32(ICPLB_DATA8)
249#define bfin_write_ICPLB_DATA8(val) bfin_write32(ICPLB_DATA8,val)
250#define pICPLB_DATA9 ((volatile unsigned long *)ICPLB_DATA9)
251#define bfin_read_ICPLB_DATA9() bfin_read32(ICPLB_DATA9)
252#define bfin_write_ICPLB_DATA9(val) bfin_write32(ICPLB_DATA9,val)
253#define pICPLB_DATA10 ((volatile unsigned long *)ICPLB_DATA10)
254#define bfin_read_ICPLB_DATA10() bfin_read32(ICPLB_DATA10)
255#define bfin_write_ICPLB_DATA10(val) bfin_write32(ICPLB_DATA10,val)
256#define pICPLB_DATA11 ((volatile unsigned long *)ICPLB_DATA11)
257#define bfin_read_ICPLB_DATA11() bfin_read32(ICPLB_DATA11)
258#define bfin_write_ICPLB_DATA11(val) bfin_write32(ICPLB_DATA11,val)
259#define pICPLB_DATA12 ((volatile unsigned long *)ICPLB_DATA12)
260#define bfin_read_ICPLB_DATA12() bfin_read32(ICPLB_DATA12)
261#define bfin_write_ICPLB_DATA12(val) bfin_write32(ICPLB_DATA12,val)
262#define pICPLB_DATA13 ((volatile unsigned long *)ICPLB_DATA13)
263#define bfin_read_ICPLB_DATA13() bfin_read32(ICPLB_DATA13)
264#define bfin_write_ICPLB_DATA13(val) bfin_write32(ICPLB_DATA13,val)
265#define pICPLB_DATA14 ((volatile unsigned long *)ICPLB_DATA14)
266#define bfin_read_ICPLB_DATA14() bfin_read32(ICPLB_DATA14)
267#define bfin_write_ICPLB_DATA14(val) bfin_write32(ICPLB_DATA14,val)
268#define pICPLB_DATA15 ((volatile unsigned long *)ICPLB_DATA15)
269#define bfin_read_ICPLB_DATA15() bfin_read32(ICPLB_DATA15)
270#define bfin_write_ICPLB_DATA15(val) bfin_write32(ICPLB_DATA15,val)
271#define pITEST_COMMAND ((volatile unsigned long *)ITEST_COMMAND)
272#define bfin_read_ITEST_COMMAND() bfin_read32(ITEST_COMMAND)
273#define bfin_write_ITEST_COMMAND(val) bfin_write32(ITEST_COMMAND,val)
274#if 0
275#define ITEST_INDEX 0xFFE01304 /* Instruction Test Index Register */
276#endif
277#define pITEST_DATA0 ((volatile unsigned long *)ITEST_DATA0)
278#define bfin_read_ITEST_DATA0() bfin_read32(ITEST_DATA0)
279#define bfin_write_ITEST_DATA0(val) bfin_write32(ITEST_DATA0,val)
280#define pITEST_DATA1 ((volatile unsigned long *)ITEST_DATA1)
281#define bfin_read_ITEST_DATA1() bfin_read32(ITEST_DATA1)
282#define bfin_write_ITEST_DATA1(val) bfin_write32(ITEST_DATA1,val)
283
284/* Event/Interrupt Registers*/
285
286#define pEVT0 ((volatile void **)EVT0)
287#define bfin_read_EVT0() bfin_read32(EVT0)
288#define bfin_write_EVT0(val) bfin_write32(EVT0,val)
289#define pEVT1 ((volatile void **)EVT1)
290#define bfin_read_EVT1() bfin_read32(EVT1)
291#define bfin_write_EVT1(val) bfin_write32(EVT1,val)
292#define pEVT2 ((volatile void **)EVT2)
293#define bfin_read_EVT2() bfin_read32(EVT2)
294#define bfin_write_EVT2(val) bfin_write32(EVT2,val)
295#define pEVT3 ((volatile void **)EVT3)
296#define bfin_read_EVT3() bfin_read32(EVT3)
297#define bfin_write_EVT3(val) bfin_write32(EVT3,val)
298#define pEVT4 ((volatile void **)EVT4)
299#define bfin_read_EVT4() bfin_read32(EVT4)
300#define bfin_write_EVT4(val) bfin_write32(EVT4,val)
301#define pEVT5 ((volatile void **)EVT5)
302#define bfin_read_EVT5() bfin_read32(EVT5)
303#define bfin_write_EVT5(val) bfin_write32(EVT5,val)
304#define pEVT6 ((volatile void **)EVT6)
305#define bfin_read_EVT6() bfin_read32(EVT6)
306#define bfin_write_EVT6(val) bfin_write32(EVT6,val)
307#define pEVT7 ((volatile void **)EVT7)
308#define bfin_read_EVT7() bfin_read32(EVT7)
309#define bfin_write_EVT7(val) bfin_write32(EVT7,val)
310#define pEVT8 ((volatile void **)EVT8)
311#define bfin_read_EVT8() bfin_read32(EVT8)
312#define bfin_write_EVT8(val) bfin_write32(EVT8,val)
313#define pEVT9 ((volatile void **)EVT9)
314#define bfin_read_EVT9() bfin_read32(EVT9)
315#define bfin_write_EVT9(val) bfin_write32(EVT9,val)
316#define pEVT10 ((volatile void **)EVT10)
317#define bfin_read_EVT10() bfin_read32(EVT10)
318#define bfin_write_EVT10(val) bfin_write32(EVT10,val)
319#define pEVT11 ((volatile void **)EVT11)
320#define bfin_read_EVT11() bfin_read32(EVT11)
321#define bfin_write_EVT11(val) bfin_write32(EVT11,val)
322#define pEVT12 ((volatile void **)EVT12)
323#define bfin_read_EVT12() bfin_read32(EVT12)
324#define bfin_write_EVT12(val) bfin_write32(EVT12,val)
325#define pEVT13 ((volatile void **)EVT13)
326#define bfin_read_EVT13() bfin_read32(EVT13)
327#define bfin_write_EVT13(val) bfin_write32(EVT13,val)
328#define pEVT14 ((volatile void **)EVT14)
329#define bfin_read_EVT14() bfin_read32(EVT14)
330#define bfin_write_EVT14(val) bfin_write32(EVT14,val)
331#define pEVT15 ((volatile void **)EVT15)
332#define bfin_read_EVT15() bfin_read32(EVT15)
333#define bfin_write_EVT15(val) bfin_write32(EVT15,val)
334#define pIMASK ((volatile unsigned long *)IMASK)
335#define bfin_read_IMASK() bfin_read32(IMASK)
336#define bfin_write_IMASK(val) bfin_write32(IMASK,val)
337#define pIPEND ((volatile unsigned long *)IPEND)
338#define bfin_read_IPEND() bfin_read32(IPEND)
339#define bfin_write_IPEND(val) bfin_write32(IPEND,val)
340#define pILAT ((volatile unsigned long *)ILAT)
341#define bfin_read_ILAT() bfin_read32(ILAT)
342#define bfin_write_ILAT(val) bfin_write32(ILAT,val)
343
344/*Core Timer Registers*/
345#define pTCNTL ((volatile unsigned long *)TCNTL)
346#define bfin_read_TCNTL() bfin_read32(TCNTL)
347#define bfin_write_TCNTL(val) bfin_write32(TCNTL,val)
348#define pTPERIOD ((volatile unsigned long *)TPERIOD)
349#define bfin_read_TPERIOD() bfin_read32(TPERIOD)
350#define bfin_write_TPERIOD(val) bfin_write32(TPERIOD,val)
351#define pTSCALE ((volatile unsigned long *)TSCALE)
352#define bfin_read_TSCALE() bfin_read32(TSCALE)
353#define bfin_write_TSCALE(val) bfin_write32(TSCALE,val)
354#define pTCOUNT ((volatile unsigned long *)TCOUNT)
355#define bfin_read_TCOUNT() bfin_read32(TCOUNT)
356#define bfin_write_TCOUNT(val) bfin_write32(TCOUNT,val)
357
358/*Debug/MP/Emulation Registers*/
359#define pDSPID ((volatile unsigned long *)DSPID)
360#define bfin_read_DSPID() bfin_read32(DSPID)
361#define bfin_write_DSPID(val) bfin_write32(DSPID,val)
362#define pDBGCTL ((volatile unsigned long *)DBGCTL)
363#define bfin_read_DBGCTL() bfin_read32(DBGCTL)
364#define bfin_write_DBGCTL(val) bfin_write32(DBGCTL,val)
365#define pDBGSTAT ((volatile unsigned long *)DBGSTAT)
366#define bfin_read_DBGSTAT() bfin_read32(DBGSTAT)
367#define bfin_write_DBGSTAT(val) bfin_write32(DBGSTAT,val)
368#define pEMUDAT ((volatile unsigned long *)EMUDAT)
369#define bfin_read_EMUDAT() bfin_read32(EMUDAT)
370#define bfin_write_EMUDAT(val) bfin_write32(EMUDAT,val)
371
372/*Trace Buffer Registers*/
373#define pTBUFCTL ((volatile unsigned long *)TBUFCTL)
374#define bfin_read_TBUFCTL() bfin_read32(TBUFCTL)
375#define bfin_write_TBUFCTL(val) bfin_write32(TBUFCTL,val)
376#define pTBUFSTAT ((volatile unsigned long *)TBUFSTAT)
377#define bfin_read_TBUFSTAT() bfin_read32(TBUFSTAT)
378#define bfin_write_TBUFSTAT(val) bfin_write32(TBUFSTAT,val)
379#define pTBUF ((volatile void **)TBUF)
380#define bfin_read_TBUF() bfin_read32(TBUF)
381#define bfin_write_TBUF(val) bfin_write32(TBUF,val)
382
383/*Watch Point Control Registers*/
384#define pWPIACTL ((volatile unsigned long *)WPIACTL)
385#define bfin_read_WPIACTL() bfin_read32(WPIACTL)
386#define bfin_write_WPIACTL(val) bfin_write32(WPIACTL,val)
387#define pWPIA0 ((volatile void **)WPIA0)
388#define bfin_read_WPIA0() bfin_read32(WPIA0)
389#define bfin_write_WPIA0(val) bfin_write32(WPIA0,val)
390#define pWPIA1 ((volatile void **)WPIA1)
391#define bfin_read_WPIA1() bfin_read32(WPIA1)
392#define bfin_write_WPIA1(val) bfin_write32(WPIA1,val)
393#define pWPIA2 ((volatile void **)WPIA2)
394#define bfin_read_WPIA2() bfin_read32(WPIA2)
395#define bfin_write_WPIA2(val) bfin_write32(WPIA2,val)
396#define pWPIA3 ((volatile void **)WPIA3)
397#define bfin_read_WPIA3() bfin_read32(WPIA3)
398#define bfin_write_WPIA3(val) bfin_write32(WPIA3,val)
399#define pWPIA4 ((volatile void **)WPIA4)
400#define bfin_read_WPIA4() bfin_read32(WPIA4)
401#define bfin_write_WPIA4(val) bfin_write32(WPIA4,val)
402#define pWPIA5 ((volatile void **)WPIA5)
403#define bfin_read_WPIA5() bfin_read32(WPIA5)
404#define bfin_write_WPIA5(val) bfin_write32(WPIA5,val)
405#define pWPIACNT0 ((volatile unsigned long *)WPIACNT0)
406#define bfin_read_WPIACNT0() bfin_read32(WPIACNT0)
407#define bfin_write_WPIACNT0(val) bfin_write32(WPIACNT0,val)
408#define pWPIACNT1 ((volatile unsigned long *)WPIACNT1)
409#define bfin_read_WPIACNT1() bfin_read32(WPIACNT1)
410#define bfin_write_WPIACNT1(val) bfin_write32(WPIACNT1,val)
411#define pWPIACNT2 ((volatile unsigned long *)WPIACNT2)
412#define bfin_read_WPIACNT2() bfin_read32(WPIACNT2)
413#define bfin_write_WPIACNT2(val) bfin_write32(WPIACNT2,val)
414#define pWPIACNT3 ((volatile unsigned long *)WPIACNT3)
415#define bfin_read_WPIACNT3() bfin_read32(WPIACNT3)
416#define bfin_write_WPIACNT3(val) bfin_write32(WPIACNT3,val)
417#define pWPIACNT4 ((volatile unsigned long *)WPIACNT4)
418#define bfin_read_WPIACNT4() bfin_read32(WPIACNT4)
419#define bfin_write_WPIACNT4(val) bfin_write32(WPIACNT4,val)
420#define pWPIACNT5 ((volatile unsigned long *)WPIACNT5)
421#define bfin_read_WPIACNT5() bfin_read32(WPIACNT5)
422#define bfin_write_WPIACNT5(val) bfin_write32(WPIACNT5,val)
423#define pWPDACTL ((volatile unsigned long *)WPDACTL)
424#define bfin_read_WPDACTL() bfin_read32(WPDACTL)
425#define bfin_write_WPDACTL(val) bfin_write32(WPDACTL,val)
426#define pWPDA0 ((volatile void **)WPDA0)
427#define bfin_read_WPDA0() bfin_read32(WPDA0)
428#define bfin_write_WPDA0(val) bfin_write32(WPDA0,val)
429#define pWPDA1 ((volatile void **)WPDA1)
430#define bfin_read_WPDA1() bfin_read32(WPDA1)
431#define bfin_write_WPDA1(val) bfin_write32(WPDA1,val)
432#define pWPDACNT0 ((volatile unsigned long *)WPDACNT0)
433#define bfin_read_WPDACNT0() bfin_read32(WPDACNT0)
434#define bfin_write_WPDACNT0(val) bfin_write32(WPDACNT0,val)
435#define pWPDACNT1 ((volatile unsigned long *)WPDACNT1)
436#define bfin_read_WPDACNT1() bfin_read32(WPDACNT1)
437#define bfin_write_WPDACNT1(val) bfin_write32(WPDACNT1,val)
438#define pWPSTAT ((volatile unsigned long *)WPSTAT)
439#define bfin_read_WPSTAT() bfin_read32(WPSTAT)
440#define bfin_write_WPSTAT(val) bfin_write32(WPSTAT,val)
441
442/*Performance Monitor Registers*/
443#define pPFCTL ((volatile unsigned long *)PFCTL)
444#define bfin_read_PFCTL() bfin_read32(PFCTL)
445#define bfin_write_PFCTL(val) bfin_write32(PFCTL,val)
446#define pPFCNTR0 ((volatile unsigned long *)PFCNTR0)
447#define bfin_read_PFCNTR0() bfin_read32(PFCNTR0)
448#define bfin_write_PFCNTR0(val) bfin_write32(PFCNTR0,val)
449#define pPFCNTR1 ((volatile unsigned long *)PFCNTR1)
450#define bfin_read_PFCNTR1() bfin_read32(PFCNTR1)
451#define bfin_write_PFCNTR1(val) bfin_write32(PFCNTR1,val)
452
453/*
454#define IPRIO 0xFFE02110
455*/
456
457#if defined(CONFIG_BFIN_ALIVE_LED)
458#define pCONFIG_BFIN_ALIVE_LED_DPORT \
459 (volatile unsigned short *)CONFIG_BFIN_ALIVE_LED_DPORT
460#define pCONFIG_BFIN_ALIVE_LED_PORT \
461 (volatile unsigned short *)CONFIG_BFIN_ALIVE_LED_PORT
462#endif
463
464#if defined(CONFIG_BFIN_IDLE_LED)
465#define pCONFIG_BFIN_IDLE_LED_DPORT \
466 (volatile unsigned short *)CONFIG_BFIN_IDLE_LED_DPORT
467#define pCONFIG_BFIN_IDLE_LED_PORT \
468 (volatile unsigned short *)CONFIG_BFIN_IDLE_LED_PORT
469#endif
470
471#endif /* _CDEF_LPBLACKFIN_H */
diff --git a/include/asm-blackfin/mach-common/context.S b/include/asm-blackfin/mach-common/context.S
new file mode 100644
index 000000000000..fd0ebe1862b8
--- /dev/null
+++ b/include/asm-blackfin/mach-common/context.S
@@ -0,0 +1,350 @@
1/*
2 * File: arch/blackfin/kernel/context.S
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30/*
31 * Code to save processor context.
32 * We even save the register which are preserved by a function call
33 * - r4, r5, r6, r7, p3, p4, p5
34 */
35.macro save_context_with_interrupts
36 [--sp] = SYSCFG;
37
38 [--sp] = P0; /*orig_p0*/
39 [--sp] = R0; /*orig_r0*/
40
41 [--sp] = ( R7:0, P5:0 );
42 [--sp] = fp;
43 [--sp] = usp;
44
45 [--sp] = i0;
46 [--sp] = i1;
47 [--sp] = i2;
48 [--sp] = i3;
49
50 [--sp] = m0;
51 [--sp] = m1;
52 [--sp] = m2;
53 [--sp] = m3;
54
55 [--sp] = l0;
56 [--sp] = l1;
57 [--sp] = l2;
58 [--sp] = l3;
59
60 [--sp] = b0;
61 [--sp] = b1;
62 [--sp] = b2;
63 [--sp] = b3;
64 [--sp] = a0.x;
65 [--sp] = a0.w;
66 [--sp] = a1.x;
67 [--sp] = a1.w;
68
69 [--sp] = LC0;
70 [--sp] = LC1;
71 [--sp] = LT0;
72 [--sp] = LT1;
73 [--sp] = LB0;
74 [--sp] = LB1;
75
76 [--sp] = ASTAT;
77
78 [--sp] = r0; /* Skip reserved */
79 [--sp] = RETS;
80 r0 = RETI;
81 [--sp] = r0;
82 [--sp] = RETX;
83 [--sp] = RETN;
84 [--sp] = RETE;
85 [--sp] = SEQSTAT;
86 [--sp] = r0; /* Skip IPEND as well. */
87 /* Switch to other method of keeping interrupts disabled. */
88#ifdef CONFIG_DEBUG_HWERR
89 r0 = 0x3f;
90 sti r0;
91#else
92 cli r0;
93#endif
94 [--sp] = RETI; /*orig_pc*/
95 /* Clear all L registers. */
96 r0 = 0 (x);
97 l0 = r0;
98 l1 = r0;
99 l2 = r0;
100 l3 = r0;
101.endm
102
103.macro save_context_syscall
104 [--sp] = SYSCFG;
105
106 [--sp] = P0; /*orig_p0*/
107 [--sp] = R0; /*orig_r0*/
108 [--sp] = ( R7:0, P5:0 );
109 [--sp] = fp;
110 [--sp] = usp;
111
112 [--sp] = i0;
113 [--sp] = i1;
114 [--sp] = i2;
115 [--sp] = i3;
116
117 [--sp] = m0;
118 [--sp] = m1;
119 [--sp] = m2;
120 [--sp] = m3;
121
122 [--sp] = l0;
123 [--sp] = l1;
124 [--sp] = l2;
125 [--sp] = l3;
126
127 [--sp] = b0;
128 [--sp] = b1;
129 [--sp] = b2;
130 [--sp] = b3;
131 [--sp] = a0.x;
132 [--sp] = a0.w;
133 [--sp] = a1.x;
134 [--sp] = a1.w;
135
136 [--sp] = LC0;
137 [--sp] = LC1;
138 [--sp] = LT0;
139 [--sp] = LT1;
140 [--sp] = LB0;
141 [--sp] = LB1;
142
143 [--sp] = ASTAT;
144
145 [--sp] = r0; /* Skip reserved */
146 [--sp] = RETS;
147 r0 = RETI;
148 [--sp] = r0;
149 [--sp] = RETX;
150 [--sp] = RETN;
151 [--sp] = RETE;
152 [--sp] = SEQSTAT;
153 [--sp] = r0; /* Skip IPEND as well. */
154 [--sp] = RETI; /*orig_pc*/
155 /* Clear all L registers. */
156 r0 = 0 (x);
157 l0 = r0;
158 l1 = r0;
159 l2 = r0;
160 l3 = r0;
161.endm
162
163.macro save_context_no_interrupts
164 [--sp] = SYSCFG;
165 [--sp] = P0; /* orig_p0 */
166 [--sp] = R0; /* orig_r0 */
167 [--sp] = ( R7:0, P5:0 );
168 [--sp] = fp;
169 [--sp] = usp;
170
171 [--sp] = i0;
172 [--sp] = i1;
173 [--sp] = i2;
174 [--sp] = i3;
175
176 [--sp] = m0;
177 [--sp] = m1;
178 [--sp] = m2;
179 [--sp] = m3;
180
181 [--sp] = l0;
182 [--sp] = l1;
183 [--sp] = l2;
184 [--sp] = l3;
185
186 [--sp] = b0;
187 [--sp] = b1;
188 [--sp] = b2;
189 [--sp] = b3;
190 [--sp] = a0.x;
191 [--sp] = a0.w;
192 [--sp] = a1.x;
193 [--sp] = a1.w;
194
195 [--sp] = LC0;
196 [--sp] = LC1;
197 [--sp] = LT0;
198 [--sp] = LT1;
199 [--sp] = LB0;
200 [--sp] = LB1;
201
202 [--sp] = ASTAT;
203
204#ifdef CONFIG_KGDB
205 fp = 0(Z);
206 r1 = sp;
207 r1 += 60;
208 r1 += 60;
209 r1 += 60;
210 [--sp] = r1;
211#else
212 [--sp] = r0; /* Skip reserved */
213#endif
214 [--sp] = RETS;
215 r0 = RETI;
216 [--sp] = r0;
217 [--sp] = RETX;
218 [--sp] = RETN;
219 [--sp] = RETE;
220 [--sp] = SEQSTAT;
221#ifdef CONFIG_KGDB
222 r1.l = lo(IPEND);
223 r1.h = hi(IPEND);
224 [--sp] = r1;
225#else
226 [--sp] = r0; /* Skip IPEND as well. */
227#endif
228 [--sp] = r0; /*orig_pc*/
229 /* Clear all L registers. */
230 r0 = 0 (x);
231 l0 = r0;
232 l1 = r0;
233 l2 = r0;
234 l3 = r0;
235.endm
236
237.macro restore_context_no_interrupts
238 sp += 4; /* Skip orig_pc */
239 sp += 4; /* Skip IPEND */
240 SEQSTAT = [sp++];
241 RETE = [sp++];
242 RETN = [sp++];
243 RETX = [sp++];
244 r0 = [sp++];
245 RETI = r0; /* Restore RETI indirectly when in exception */
246 RETS = [sp++];
247
248 sp += 4; /* Skip Reserved */
249
250 ASTAT = [sp++];
251
252 LB1 = [sp++];
253 LB0 = [sp++];
254 LT1 = [sp++];
255 LT0 = [sp++];
256 LC1 = [sp++];
257 LC0 = [sp++];
258
259 a1.w = [sp++];
260 a1.x = [sp++];
261 a0.w = [sp++];
262 a0.x = [sp++];
263 b3 = [sp++];
264 b2 = [sp++];
265 b1 = [sp++];
266 b0 = [sp++];
267
268 l3 = [sp++];
269 l2 = [sp++];
270 l1 = [sp++];
271 l0 = [sp++];
272
273 m3 = [sp++];
274 m2 = [sp++];
275 m1 = [sp++];
276 m0 = [sp++];
277
278 i3 = [sp++];
279 i2 = [sp++];
280 i1 = [sp++];
281 i0 = [sp++];
282
283 sp += 4;
284 fp = [sp++];
285
286 ( R7 : 0, P5 : 0) = [ SP ++ ];
287 sp += 8; /* Skip orig_r0/orig_p0 */
288 SYSCFG = [sp++];
289.endm
290
291.macro restore_context_with_interrupts
292 sp += 4; /* Skip orig_pc */
293 sp += 4; /* Skip IPEND */
294 SEQSTAT = [sp++];
295 RETE = [sp++];
296 RETN = [sp++];
297 RETX = [sp++];
298 RETI = [sp++];
299 RETS = [sp++];
300
301 p0.h = _irq_flags;
302 p0.l = _irq_flags;
303 r0 = [p0];
304 sti r0;
305
306 sp += 4; /* Skip Reserved */
307
308 ASTAT = [sp++];
309
310 LB1 = [sp++];
311 LB0 = [sp++];
312 LT1 = [sp++];
313 LT0 = [sp++];
314 LC1 = [sp++];
315 LC0 = [sp++];
316
317 a1.w = [sp++];
318 a1.x = [sp++];
319 a0.w = [sp++];
320 a0.x = [sp++];
321 b3 = [sp++];
322 b2 = [sp++];
323 b1 = [sp++];
324 b0 = [sp++];
325
326 l3 = [sp++];
327 l2 = [sp++];
328 l1 = [sp++];
329 l0 = [sp++];
330
331 m3 = [sp++];
332 m2 = [sp++];
333 m1 = [sp++];
334 m0 = [sp++];
335
336 i3 = [sp++];
337 i2 = [sp++];
338 i1 = [sp++];
339 i0 = [sp++];
340
341 sp += 4;
342 fp = [sp++];
343
344 ( R7 : 0, P5 : 0) = [ SP ++ ];
345 sp += 8; /* Skip orig_r0/orig_p0 */
346 csync;
347 SYSCFG = [sp++];
348 csync;
349.endm
350
diff --git a/include/asm-blackfin/mach-common/def_LPBlackfin.h b/include/asm-blackfin/mach-common/def_LPBlackfin.h
new file mode 100644
index 000000000000..76103526aec1
--- /dev/null
+++ b/include/asm-blackfin/mach-common/def_LPBlackfin.h
@@ -0,0 +1,691 @@
1 /*
2 * File: include/asm-blackfin/mach-common/def_LPBlackfin.h
3 * Based on:
4 * Author: unknown
5 * COPYRIGHT 2005 Analog Devices
6 * Created: ?
7 * Description:
8 *
9 * Modified:
10 *
11 * Bugs: Enter bugs at http://blackfin.uclinux.org/
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; see the file COPYING.
25 * If not, write to the Free Software Foundation,
26 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */
28
29/* LP Blackfin CORE REGISTER BIT & ADDRESS DEFINITIONS FOR ADSP-BF532/33 */
30
31#ifndef _DEF_LPBLACKFIN_H
32#define _DEF_LPBLACKFIN_H
33
34#include <asm/mach/anomaly.h>
35
36/*#if !defined(__ADSPLPBLACKFIN__)
37#warning def_LPBlackfin.h should only be included for 532 compatible chips.
38#endif
39*/
40
41#define MK_BMSK_(x) (1<<x)
42
43#if defined(ANOMALY_05000198)
44
45#define bfin_read16(addr) ({ unsigned __v; \
46 __asm__ __volatile__ ("NOP;\n\t"\
47 "%0 = w[%1] (z);\n\t"\
48 : "=d"(__v) : "a"(addr)); (unsigned short)__v; })
49
50#define bfin_read32(addr) ({ unsigned __v; \
51 __asm__ __volatile__ ("NOP;\n\t"\
52 "%0 = [%1];\n\t"\
53 : "=d"(__v) : "a"(addr)); __v; })
54
55#define bfin_write16(addr,val) ({\
56 __asm__ __volatile__ ("NOP;\n\t"\
57 "w[%0] = %1;\n\t"\
58 : : "a"(addr) , "d"(val) : "memory");})
59
60#define bfin_write32(addr,val) ({\
61 __asm__ __volatile__ ("NOP;\n\t"\
62 "[%0] = %1;\n\t"\
63 : : "a"(addr) , "d"(val) : "memory");})
64
65#else
66
67#define bfin_read16(addr) ({ unsigned __v; \
68 __asm__ __volatile__ (\
69 "%0 = w[%1] (z);\n\t"\
70 : "=d"(__v) : "a"(addr)); (unsigned short)__v; })
71
72#define bfin_read32(addr) ({ unsigned __v; \
73 __asm__ __volatile__ (\
74 "%0 = [%1];\n\t"\
75 : "=d"(__v) : "a"(addr)); __v; })
76
77#define bfin_write16(addr,val) ({\
78 __asm__ __volatile__ (\
79 "w[%0] = %1;\n\t"\
80 : : "a"(addr) , "d"(val) : "memory");})
81
82#define bfin_write32(addr,val) ({\
83 __asm__ __volatile__ (\
84 "[%0] = %1;\n\t"\
85 : : "a"(addr) , "d"(val) : "memory");})
86
87#endif
88
89/**************************************************
90 * System Register Bits
91 **************************************************/
92
93/**************************************************
94 * ASTAT register
95 **************************************************/
96
97/* definitions of ASTAT bit positions*/
98
99/*Result of last ALU0 or shifter operation is zero*/
100#define ASTAT_AZ_P 0x00000000
101/*Result of last ALU0 or shifter operation is negative*/
102#define ASTAT_AN_P 0x00000001
103/*Condition Code, used for holding comparison results*/
104#define ASTAT_CC_P 0x00000005
105/*Quotient Bit*/
106#define ASTAT_AQ_P 0x00000006
107/*Rounding mode, set for biased, clear for unbiased*/
108#define ASTAT_RND_MOD_P 0x00000008
109/*Result of last ALU0 operation generated a carry*/
110#define ASTAT_AC0_P 0x0000000C
111/*Result of last ALU0 operation generated a carry*/
112#define ASTAT_AC0_COPY_P 0x00000002
113/*Result of last ALU1 operation generated a carry*/
114#define ASTAT_AC1_P 0x0000000D
115/*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/
116#define ASTAT_AV0_P 0x00000010
117/*Sticky version of ASTAT_AV0 */
118#define ASTAT_AV0S_P 0x00000011
119/*Result of last MAC1 operation overflowed, sticky for MAC*/
120#define ASTAT_AV1_P 0x00000012
121/*Sticky version of ASTAT_AV1 */
122#define ASTAT_AV1S_P 0x00000013
123/*Result of last ALU0 or MAC0 operation overflowed*/
124#define ASTAT_V_P 0x00000018
125/*Result of last ALU0 or MAC0 operation overflowed*/
126#define ASTAT_V_COPY_P 0x00000003
127/*Sticky version of ASTAT_V*/
128#define ASTAT_VS_P 0x00000019
129
130/* Masks */
131
132/*Result of last ALU0 or shifter operation is zero*/
133#define ASTAT_AZ MK_BMSK_(ASTAT_AZ_P)
134/*Result of last ALU0 or shifter operation is negative*/
135#define ASTAT_AN MK_BMSK_(ASTAT_AN_P)
136/*Result of last ALU0 operation generated a carry*/
137#define ASTAT_AC0 MK_BMSK_(ASTAT_AC0_P)
138/*Result of last ALU0 operation generated a carry*/
139#define ASTAT_AC0_COPY MK_BMSK_(ASTAT_AC0_COPY_P)
140/*Result of last ALU0 operation generated a carry*/
141#define ASTAT_AC1 MK_BMSK_(ASTAT_AC1_P)
142/*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/
143#define ASTAT_AV0 MK_BMSK_(ASTAT_AV0_P)
144/*Result of last MAC1 operation overflowed, sticky for MAC*/
145#define ASTAT_AV1 MK_BMSK_(ASTAT_AV1_P)
146/*Condition Code, used for holding comparison results*/
147#define ASTAT_CC MK_BMSK_(ASTAT_CC_P)
148/*Quotient Bit*/
149#define ASTAT_AQ MK_BMSK_(ASTAT_AQ_P)
150/*Rounding mode, set for biased, clear for unbiased*/
151#define ASTAT_RND_MOD MK_BMSK_(ASTAT_RND_MOD_P)
152/*Overflow Bit*/
153#define ASTAT_V MK_BMSK_(ASTAT_V_P)
154/*Overflow Bit*/
155#define ASTAT_V_COPY MK_BMSK_(ASTAT_V_COPY_P)
156
157/**************************************************
158 * SEQSTAT register
159 **************************************************/
160
161/* Bit Positions */
162#define SEQSTAT_EXCAUSE0_P 0x00000000 /* Last exception cause bit 0 */
163#define SEQSTAT_EXCAUSE1_P 0x00000001 /* Last exception cause bit 1 */
164#define SEQSTAT_EXCAUSE2_P 0x00000002 /* Last exception cause bit 2 */
165#define SEQSTAT_EXCAUSE3_P 0x00000003 /* Last exception cause bit 3 */
166#define SEQSTAT_EXCAUSE4_P 0x00000004 /* Last exception cause bit 4 */
167#define SEQSTAT_EXCAUSE5_P 0x00000005 /* Last exception cause bit 5 */
168#define SEQSTAT_IDLE_REQ_P 0x0000000C /* Pending idle mode request,
169 * set by IDLE instruction.
170 */
171#define SEQSTAT_SFTRESET_P 0x0000000D /* Indicates whether the last
172 * reset was a software reset
173 * (=1)
174 */
175#define SEQSTAT_HWERRCAUSE0_P 0x0000000E /* Last hw error cause bit 0 */
176#define SEQSTAT_HWERRCAUSE1_P 0x0000000F /* Last hw error cause bit 1 */
177#define SEQSTAT_HWERRCAUSE2_P 0x00000010 /* Last hw error cause bit 2 */
178#define SEQSTAT_HWERRCAUSE3_P 0x00000011 /* Last hw error cause bit 3 */
179#define SEQSTAT_HWERRCAUSE4_P 0x00000012 /* Last hw error cause bit 4 */
180/* Masks */
181/* Exception cause */
182#define SEQSTAT_EXCAUSE (MK_BMSK_(SEQSTAT_EXCAUSE0_P) | \
183 MK_BMSK_(SEQSTAT_EXCAUSE1_P) | \
184 MK_BMSK_(SEQSTAT_EXCAUSE2_P) | \
185 MK_BMSK_(SEQSTAT_EXCAUSE3_P) | \
186 MK_BMSK_(SEQSTAT_EXCAUSE4_P) | \
187 MK_BMSK_(SEQSTAT_EXCAUSE5_P) | \
188 0)
189
190/* Indicates whether the last reset was a software reset (=1) */
191#define SEQSTAT_SFTRESET (MK_BMSK_(SEQSTAT_SFTRESET_P))
192
193/* Last hw error cause */
194#define SEQSTAT_HWERRCAUSE (MK_BMSK_(SEQSTAT_HWERRCAUSE0_P) | \
195 MK_BMSK_(SEQSTAT_HWERRCAUSE1_P) | \
196 MK_BMSK_(SEQSTAT_HWERRCAUSE2_P) | \
197 MK_BMSK_(SEQSTAT_HWERRCAUSE3_P) | \
198 MK_BMSK_(SEQSTAT_HWERRCAUSE4_P) | \
199 0)
200
201/* Translate bits to something useful */
202
203/* Last hw error cause */
204#define SEQSTAT_HWERRCAUSE_SHIFT (14)
205#define SEQSTAT_HWERRCAUSE_SYSTEM_MMR (0x02 << SEQSTAT_HWERRCAUSE_SHIFT)
206#define SEQSTAT_HWERRCAUSE_EXTERN_ADDR (0x03 << SEQSTAT_HWERRCAUSE_SHIFT)
207#define SEQSTAT_HWERRCAUSE_PERF_FLOW (0x12 << SEQSTAT_HWERRCAUSE_SHIFT)
208#define SEQSTAT_HWERRCAUSE_RAISE_5 (0x18 << SEQSTAT_HWERRCAUSE_SHIFT)
209
210/**************************************************
211 * SYSCFG register
212 **************************************************/
213
214/* Bit Positions */
215#define SYSCFG_SSSTEP_P 0x00000000 /* Supervisor single step, when
216 * set it forces an exception
217 * for each instruction executed
218 */
219#define SYSCFG_CCEN_P 0x00000001 /* Enable cycle counter (=1) */
220#define SYSCFG_SNEN_P 0x00000002 /* Self nesting Interrupt Enable */
221
222/* Masks */
223
224/* Supervisor single step, when set it forces an exception for each
225 *instruction executed
226 */
227#define SYSCFG_SSSTEP MK_BMSK_(SYSCFG_SSSTEP_P )
228/* Enable cycle counter (=1) */
229#define SYSCFG_CCEN MK_BMSK_(SYSCFG_CCEN_P )
230/* Self Nesting Interrupt Enable */
231#define SYSCFG_SNEN MK_BMSK_(SYSCFG_SNEN_P)
232/* Backward-compatibility for typos in prior releases */
233#define SYSCFG_SSSSTEP SYSCFG_SSSTEP
234#define SYSCFG_CCCEN SYSCFG_CCEN
235
236/****************************************************
237 * Core MMR Register Map
238 ****************************************************/
239
240/* Data Cache & SRAM Memory (0xFFE00000 - 0xFFE00404) */
241
242#define SRAM_BASE_ADDRESS 0xFFE00000 /* SRAM Base Address Register */
243#define DMEM_CONTROL 0xFFE00004 /* Data memory control */
244#define DCPLB_STATUS 0xFFE00008 /* Data Cache Programmable Look-Aside
245 * Buffer Status
246 */
247#define DCPLB_FAULT_STATUS 0xFFE00008 /* "" (older define) */
248#define DCPLB_FAULT_ADDR 0xFFE0000C /* Data Cache Programmable Look-Aside
249 * Buffer Fault Address
250 */
251#define DCPLB_ADDR0 0xFFE00100 /* Data Cache Protection Lookaside
252 * Buffer 0
253 */
254#define DCPLB_ADDR1 0xFFE00104 /* Data Cache Protection Lookaside
255 * Buffer 1
256 */
257#define DCPLB_ADDR2 0xFFE00108 /* Data Cache Protection Lookaside
258 * Buffer 2
259 */
260#define DCPLB_ADDR3 0xFFE0010C /* Data Cacheability Protection
261 * Lookaside Buffer 3
262 */
263#define DCPLB_ADDR4 0xFFE00110 /* Data Cacheability Protection
264 * Lookaside Buffer 4
265 */
266#define DCPLB_ADDR5 0xFFE00114 /* Data Cacheability Protection
267 * Lookaside Buffer 5
268 */
269#define DCPLB_ADDR6 0xFFE00118 /* Data Cacheability Protection
270 * Lookaside Buffer 6
271 */
272#define DCPLB_ADDR7 0xFFE0011C /* Data Cacheability Protection
273 * Lookaside Buffer 7
274 */
275#define DCPLB_ADDR8 0xFFE00120 /* Data Cacheability Protection
276 * Lookaside Buffer 8
277 */
278#define DCPLB_ADDR9 0xFFE00124 /* Data Cacheability Protection
279 * Lookaside Buffer 9
280 */
281#define DCPLB_ADDR10 0xFFE00128 /* Data Cacheability Protection
282 * Lookaside Buffer 10
283 */
284#define DCPLB_ADDR11 0xFFE0012C /* Data Cacheability Protection
285 * Lookaside Buffer 11
286 */
287#define DCPLB_ADDR12 0xFFE00130 /* Data Cacheability Protection
288 * Lookaside Buffer 12
289 */
290#define DCPLB_ADDR13 0xFFE00134 /* Data Cacheability Protection
291 * Lookaside Buffer 13
292 */
293#define DCPLB_ADDR14 0xFFE00138 /* Data Cacheability Protection
294 * Lookaside Buffer 14
295 */
296#define DCPLB_ADDR15 0xFFE0013C /* Data Cacheability Protection
297 * Lookaside Buffer 15
298 */
299#define DCPLB_DATA0 0xFFE00200 /* Data Cache 0 Status */
300#define DCPLB_DATA1 0xFFE00204 /* Data Cache 1 Status */
301#define DCPLB_DATA2 0xFFE00208 /* Data Cache 2 Status */
302#define DCPLB_DATA3 0xFFE0020C /* Data Cache 3 Status */
303#define DCPLB_DATA4 0xFFE00210 /* Data Cache 4 Status */
304#define DCPLB_DATA5 0xFFE00214 /* Data Cache 5 Status */
305#define DCPLB_DATA6 0xFFE00218 /* Data Cache 6 Status */
306#define DCPLB_DATA7 0xFFE0021C /* Data Cache 7 Status */
307#define DCPLB_DATA8 0xFFE00220 /* Data Cache 8 Status */
308#define DCPLB_DATA9 0xFFE00224 /* Data Cache 9 Status */
309#define DCPLB_DATA10 0xFFE00228 /* Data Cache 10 Status */
310#define DCPLB_DATA11 0xFFE0022C /* Data Cache 11 Status */
311#define DCPLB_DATA12 0xFFE00230 /* Data Cache 12 Status */
312#define DCPLB_DATA13 0xFFE00234 /* Data Cache 13 Status */
313#define DCPLB_DATA14 0xFFE00238 /* Data Cache 14 Status */
314#define DCPLB_DATA15 0xFFE0023C /* Data Cache 15 Status */
315#define DCPLB_DATA16 0xFFE00240 /* Extra Dummy entry */
316
317#define DTEST_COMMAND 0xFFE00300 /* Data Test Command Register */
318#define DTEST_DATA0 0xFFE00400 /* Data Test Data Register */
319#define DTEST_DATA1 0xFFE00404 /* Data Test Data Register */
320
321/* Instruction Cache & SRAM Memory (0xFFE01004 - 0xFFE01404) */
322
323#define IMEM_CONTROL 0xFFE01004 /* Instruction Memory Control */
324#define ICPLB_STATUS 0xFFE01008 /* Instruction Cache miss status */
325#define CODE_FAULT_STATUS 0xFFE01008 /* "" (older define) */
326#define ICPLB_FAULT_ADDR 0xFFE0100C /* Instruction Cache miss address */
327#define CODE_FAULT_ADDR 0xFFE0100C /* "" (older define) */
328#define ICPLB_ADDR0 0xFFE01100 /* Instruction Cacheability
329 * Protection Lookaside Buffer 0
330 */
331#define ICPLB_ADDR1 0xFFE01104 /* Instruction Cacheability
332 * Protection Lookaside Buffer 1
333 */
334#define ICPLB_ADDR2 0xFFE01108 /* Instruction Cacheability
335 * Protection Lookaside Buffer 2
336 */
337#define ICPLB_ADDR3 0xFFE0110C /* Instruction Cacheability
338 * Protection Lookaside Buffer 3
339 */
340#define ICPLB_ADDR4 0xFFE01110 /* Instruction Cacheability
341 * Protection Lookaside Buffer 4
342 */
343#define ICPLB_ADDR5 0xFFE01114 /* Instruction Cacheability
344 * Protection Lookaside Buffer 5
345 */
346#define ICPLB_ADDR6 0xFFE01118 /* Instruction Cacheability
347 * Protection Lookaside Buffer 6
348 */
349#define ICPLB_ADDR7 0xFFE0111C /* Instruction Cacheability
350 * Protection Lookaside Buffer 7
351 */
352#define ICPLB_ADDR8 0xFFE01120 /* Instruction Cacheability
353 * Protection Lookaside Buffer 8
354 */
355#define ICPLB_ADDR9 0xFFE01124 /* Instruction Cacheability
356 * Protection Lookaside Buffer 9
357 */
358#define ICPLB_ADDR10 0xFFE01128 /* Instruction Cacheability
359 * Protection Lookaside Buffer 10
360 */
361#define ICPLB_ADDR11 0xFFE0112C /* Instruction Cacheability
362 * Protection Lookaside Buffer 11
363 */
364#define ICPLB_ADDR12 0xFFE01130 /* Instruction Cacheability
365 * Protection Lookaside Buffer 12
366 */
367#define ICPLB_ADDR13 0xFFE01134 /* Instruction Cacheability
368 * Protection Lookaside Buffer 13
369 */
370#define ICPLB_ADDR14 0xFFE01138 /* Instruction Cacheability
371 * Protection Lookaside Buffer 14
372 */
373#define ICPLB_ADDR15 0xFFE0113C /* Instruction Cacheability
374 * Protection Lookaside Buffer 15
375 */
376#define ICPLB_DATA0 0xFFE01200 /* Instruction Cache 0 Status */
377#define ICPLB_DATA1 0xFFE01204 /* Instruction Cache 1 Status */
378#define ICPLB_DATA2 0xFFE01208 /* Instruction Cache 2 Status */
379#define ICPLB_DATA3 0xFFE0120C /* Instruction Cache 3 Status */
380#define ICPLB_DATA4 0xFFE01210 /* Instruction Cache 4 Status */
381#define ICPLB_DATA5 0xFFE01214 /* Instruction Cache 5 Status */
382#define ICPLB_DATA6 0xFFE01218 /* Instruction Cache 6 Status */
383#define ICPLB_DATA7 0xFFE0121C /* Instruction Cache 7 Status */
384#define ICPLB_DATA8 0xFFE01220 /* Instruction Cache 8 Status */
385#define ICPLB_DATA9 0xFFE01224 /* Instruction Cache 9 Status */
386#define ICPLB_DATA10 0xFFE01228 /* Instruction Cache 10 Status */
387#define ICPLB_DATA11 0xFFE0122C /* Instruction Cache 11 Status */
388#define ICPLB_DATA12 0xFFE01230 /* Instruction Cache 12 Status */
389#define ICPLB_DATA13 0xFFE01234 /* Instruction Cache 13 Status */
390#define ICPLB_DATA14 0xFFE01238 /* Instruction Cache 14 Status */
391#define ICPLB_DATA15 0xFFE0123C /* Instruction Cache 15 Status */
392#define ITEST_COMMAND 0xFFE01300 /* Instruction Test Command Register */
393#define ITEST_DATA0 0xFFE01400 /* Instruction Test Data Register */
394#define ITEST_DATA1 0xFFE01404 /* Instruction Test Data Register */
395
396/* Event/Interrupt Controller Registers (0xFFE02000 - 0xFFE02110) */
397
398#define EVT0 0xFFE02000 /* Event Vector 0 ESR Address */
399#define EVT1 0xFFE02004 /* Event Vector 1 ESR Address */
400#define EVT2 0xFFE02008 /* Event Vector 2 ESR Address */
401#define EVT3 0xFFE0200C /* Event Vector 3 ESR Address */
402#define EVT4 0xFFE02010 /* Event Vector 4 ESR Address */
403#define EVT5 0xFFE02014 /* Event Vector 5 ESR Address */
404#define EVT6 0xFFE02018 /* Event Vector 6 ESR Address */
405#define EVT7 0xFFE0201C /* Event Vector 7 ESR Address */
406#define EVT8 0xFFE02020 /* Event Vector 8 ESR Address */
407#define EVT9 0xFFE02024 /* Event Vector 9 ESR Address */
408#define EVT10 0xFFE02028 /* Event Vector 10 ESR Address */
409#define EVT11 0xFFE0202C /* Event Vector 11 ESR Address */
410#define EVT12 0xFFE02030 /* Event Vector 12 ESR Address */
411#define EVT13 0xFFE02034 /* Event Vector 13 ESR Address */
412#define EVT14 0xFFE02038 /* Event Vector 14 ESR Address */
413#define EVT15 0xFFE0203C /* Event Vector 15 ESR Address */
414#define IMASK 0xFFE02104 /* Interrupt Mask Register */
415#define IPEND 0xFFE02108 /* Interrupt Pending Register */
416#define ILAT 0xFFE0210C /* Interrupt Latch Register */
417#define IPRIO 0xFFE02110 /* Core Interrupt Priority Register */
418
419/* Core Timer Registers (0xFFE03000 - 0xFFE0300C) */
420
421#define TCNTL 0xFFE03000 /* Core Timer Control Register */
422#define TPERIOD 0xFFE03004 /* Core Timer Period Register */
423#define TSCALE 0xFFE03008 /* Core Timer Scale Register */
424#define TCOUNT 0xFFE0300C /* Core Timer Count Register */
425
426/* Debug/MP/Emulation Registers (0xFFE05000 - 0xFFE05008) */
427#define DSPID 0xFFE05000 /* DSP Processor ID Register for
428 * MP implementations
429 */
430
431#define DBGSTAT 0xFFE05008 /* Debug Status Register */
432
433/* Trace Buffer Registers (0xFFE06000 - 0xFFE06100) */
434
435#define TBUFCTL 0xFFE06000 /* Trace Buffer Control Register */
436#define TBUFSTAT 0xFFE06004 /* Trace Buffer Status Register */
437#define TBUF 0xFFE06100 /* Trace Buffer */
438
439/* Watchpoint Control Registers (0xFFE07000 - 0xFFE07200) */
440
441/* Watchpoint Instruction Address Control Register */
442#define WPIACTL 0xFFE07000
443/* Watchpoint Instruction Address Register 0 */
444#define WPIA0 0xFFE07040
445/* Watchpoint Instruction Address Register 1 */
446#define WPIA1 0xFFE07044
447/* Watchpoint Instruction Address Register 2 */
448#define WPIA2 0xFFE07048
449/* Watchpoint Instruction Address Register 3 */
450#define WPIA3 0xFFE0704C
451/* Watchpoint Instruction Address Register 4 */
452#define WPIA4 0xFFE07050
453/* Watchpoint Instruction Address Register 5 */
454#define WPIA5 0xFFE07054
455/* Watchpoint Instruction Address Count Register 0 */
456#define WPIACNT0 0xFFE07080
457/* Watchpoint Instruction Address Count Register 1 */
458#define WPIACNT1 0xFFE07084
459/* Watchpoint Instruction Address Count Register 2 */
460#define WPIACNT2 0xFFE07088
461/* Watchpoint Instruction Address Count Register 3 */
462#define WPIACNT3 0xFFE0708C
463/* Watchpoint Instruction Address Count Register 4 */
464#define WPIACNT4 0xFFE07090
465/* Watchpoint Instruction Address Count Register 5 */
466#define WPIACNT5 0xFFE07094
467/* Watchpoint Data Address Control Register */
468#define WPDACTL 0xFFE07100
469/* Watchpoint Data Address Register 0 */
470#define WPDA0 0xFFE07140
471/* Watchpoint Data Address Register 1 */
472#define WPDA1 0xFFE07144
473/* Watchpoint Data Address Count Value Register 0 */
474#define WPDACNT0 0xFFE07180
475/* Watchpoint Data Address Count Value Register 1 */
476#define WPDACNT1 0xFFE07184
477/* Watchpoint Status Register */
478#define WPSTAT 0xFFE07200
479
480/* Performance Monitor Registers (0xFFE08000 - 0xFFE08104) */
481
482/* Performance Monitor Control Register */
483#define PFCTL 0xFFE08000
484/* Performance Monitor Counter Register 0 */
485#define PFCNTR0 0xFFE08100
486/* Performance Monitor Counter Register 1 */
487#define PFCNTR1 0xFFE08104
488
489/****************************************************
490 * Core MMR Register Bits
491 ****************************************************/
492
493/**************************************************
494 * EVT registers (ILAT, IMASK, and IPEND).
495 **************************************************/
496
497/* Bit Positions */
498#define EVT_EMU_P 0x00000000 /* Emulator interrupt bit position */
499#define EVT_RST_P 0x00000001 /* Reset interrupt bit position */
500#define EVT_NMI_P 0x00000002 /* Non Maskable interrupt bit position */
501#define EVT_EVX_P 0x00000003 /* Exception bit position */
502#define EVT_IRPTEN_P 0x00000004 /* Global interrupt enable bit position */
503#define EVT_IVHW_P 0x00000005 /* Hardware Error interrupt bit position */
504#define EVT_IVTMR_P 0x00000006 /* Timer interrupt bit position */
505#define EVT_IVG7_P 0x00000007 /* IVG7 interrupt bit position */
506#define EVT_IVG8_P 0x00000008 /* IVG8 interrupt bit position */
507#define EVT_IVG9_P 0x00000009 /* IVG9 interrupt bit position */
508#define EVT_IVG10_P 0x0000000a /* IVG10 interrupt bit position */
509#define EVT_IVG11_P 0x0000000b /* IVG11 interrupt bit position */
510#define EVT_IVG12_P 0x0000000c /* IVG12 interrupt bit position */
511#define EVT_IVG13_P 0x0000000d /* IVG13 interrupt bit position */
512#define EVT_IVG14_P 0x0000000e /* IVG14 interrupt bit position */
513#define EVT_IVG15_P 0x0000000f /* IVG15 interrupt bit position */
514
515/* Masks */
516#define EVT_EMU MK_BMSK_(EVT_EMU_P ) /* Emulator interrupt mask */
517#define EVT_RST MK_BMSK_(EVT_RST_P ) /* Reset interrupt mask */
518#define EVT_NMI MK_BMSK_(EVT_NMI_P ) /* Non Maskable interrupt mask */
519#define EVT_EVX MK_BMSK_(EVT_EVX_P ) /* Exception mask */
520#define EVT_IRPTEN MK_BMSK_(EVT_IRPTEN_P) /* Global interrupt enable mask */
521#define EVT_IVHW MK_BMSK_(EVT_IVHW_P ) /* Hardware Error interrupt mask */
522#define EVT_IVTMR MK_BMSK_(EVT_IVTMR_P ) /* Timer interrupt mask */
523#define EVT_IVG7 MK_BMSK_(EVT_IVG7_P ) /* IVG7 interrupt mask */
524#define EVT_IVG8 MK_BMSK_(EVT_IVG8_P ) /* IVG8 interrupt mask */
525#define EVT_IVG9 MK_BMSK_(EVT_IVG9_P ) /* IVG9 interrupt mask */
526#define EVT_IVG10 MK_BMSK_(EVT_IVG10_P ) /* IVG10 interrupt mask */
527#define EVT_IVG11 MK_BMSK_(EVT_IVG11_P ) /* IVG11 interrupt mask */
528#define EVT_IVG12 MK_BMSK_(EVT_IVG12_P ) /* IVG12 interrupt mask */
529#define EVT_IVG13 MK_BMSK_(EVT_IVG13_P ) /* IVG13 interrupt mask */
530#define EVT_IVG14 MK_BMSK_(EVT_IVG14_P ) /* IVG14 interrupt mask */
531#define EVT_IVG15 MK_BMSK_(EVT_IVG15_P ) /* IVG15 interrupt mask */
532
533/**************************************************
534 * DMEM_CONTROL Register
535 **************************************************/
536/* Bit Positions */
537#define ENDM_P 0x00 /* (doesn't really exist) Enable
538 *Data Memory L1
539 */
540#define DMCTL_ENDM_P ENDM_P /* "" (older define) */
541
542#define ENDCPLB_P 0x01 /* Enable DCPLBS */
543#define DMCTL_ENDCPLB_P ENDCPLB_P /* "" (older define) */
544#define DMC0_P 0x02 /* L1 Data Memory Configure bit 0 */
545#define DMCTL_DMC0_P DMC0_P /* "" (older define) */
546#define DMC1_P 0x03 /* L1 Data Memory Configure bit 1 */
547#define DMCTL_DMC1_P DMC1_P /* "" (older define) */
548#define DCBS_P 0x04 /* L1 Data Cache Bank Select */
549#define PORT_PREF0_P 0x12 /* DAG0 Port Preference */
550#define PORT_PREF1_P 0x13 /* DAG1 Port Preference */
551
552/* Masks */
553#define ENDM 0x00000001 /* (doesn't really exist) Enable
554 * Data Memory L1
555 */
556#define ENDCPLB 0x00000002 /* Enable DCPLB */
557#define ASRAM_BSRAM 0x00000000
558#define ACACHE_BSRAM 0x00000008
559#define ACACHE_BCACHE 0x0000000C
560#define DCBS 0x00000010 /* L1 Data Cache Bank Select */
561#define PORT_PREF0 0x00001000 /* DAG0 Port Preference */
562#define PORT_PREF1 0x00002000 /* DAG1 Port Preference */
563
564/* IMEM_CONTROL Register */
565/* Bit Positions */
566#define ENIM_P 0x00 /* Enable L1 Code Memory */
567#define IMCTL_ENIM_P 0x00 /* "" (older define) */
568#define ENICPLB_P 0x01 /* Enable ICPLB */
569#define IMCTL_ENICPLB_P 0x01 /* "" (older define) */
570#define IMC_P 0x02 /* Enable */
571#define IMCTL_IMC_P 0x02 /* Configure L1 code memory as
572 * cache (0=SRAM)
573 */
574#define ILOC0_P 0x03 /* Lock Way 0 */
575#define ILOC1_P 0x04 /* Lock Way 1 */
576#define ILOC2_P 0x05 /* Lock Way 2 */
577#define ILOC3_P 0x06 /* Lock Way 3 */
578#define LRUPRIORST_P 0x0D /* Least Recently Used Replacement
579 * Priority
580 */
581/* Masks */
582#define ENIM 0x00000001 /* Enable L1 Code Memory */
583#define ENICPLB 0x00000002 /* Enable ICPLB */
584#define IMC 0x00000004 /* Configure L1 code memory as
585 * cache (0=SRAM)
586 */
587#define ILOC0 0x00000008 /* Lock Way 0 */
588#define ILOC1 0x00000010 /* Lock Way 1 */
589#define ILOC2 0x00000020 /* Lock Way 2 */
590#define ILOC3 0x00000040 /* Lock Way 3 */
591#define LRUPRIORST 0x00002000 /* Least Recently Used Replacement
592 * Priority
593 */
594
595/* TCNTL Masks */
596#define TMPWR 0x00000001 /* Timer Low Power Control,
597 * 0=low power mode, 1=active state
598 */
599#define TMREN 0x00000002 /* Timer enable, 0=disable, 1=enable */
600#define TAUTORLD 0x00000004 /* Timer auto reload */
601#define TINT 0x00000008 /* Timer generated interrupt 0=no
602 * interrupt has been generated,
603 * 1=interrupt has been generated
604 * (sticky)
605 */
606
607/* DCPLB_DATA and ICPLB_DATA Registers */
608/* Bit Positions */
609#define CPLB_VALID_P 0x00000000 /* 0=invalid entry, 1=valid entry */
610#define CPLB_LOCK_P 0x00000001 /* 0=entry may be replaced, 1=entry
611 * locked
612 */
613#define CPLB_USER_RD_P 0x00000002 /* 0=no read access, 1=read access
614 * allowed (user mode)
615 */
616/* Masks */
617#define CPLB_VALID 0x00000001 /* 0=invalid entry, 1=valid entry */
618#define CPLB_LOCK 0x00000002 /* 0=entry may be replaced, 1=entry
619 * locked
620 */
621#define CPLB_USER_RD 0x00000004 /* 0=no read access, 1=read access
622 * allowed (user mode)
623 */
624#define PAGE_SIZE_1KB 0x00000000 /* 1 KB page size */
625#define PAGE_SIZE_4KB 0x00010000 /* 4 KB page size */
626#define PAGE_SIZE_1MB 0x00020000 /* 1 MB page size */
627#define PAGE_SIZE_4MB 0x00030000 /* 4 MB page size */
628#define CPLB_L1SRAM 0x00000020 /* 0=SRAM mapped in L1, 0=SRAM not
629 * mapped to L1
630 */
631#define CPLB_PORTPRIO 0x00000200 /* 0=low priority port, 1= high
632 * priority port
633 */
634#define CPLB_L1_CHBL 0x00001000 /* 0=non-cacheable in L1, 1=cacheable
635 * in L1
636 */
637/* ICPLB_DATA only */
638#define CPLB_LRUPRIO 0x00000100 /* 0=can be replaced by any line,
639 * 1=priority for non-replacement
640 */
641/* DCPLB_DATA only */
642#define CPLB_USER_WR 0x00000008 /* 0=no write access, 0=write
643 * access allowed (user mode)
644 */
645#define CPLB_SUPV_WR 0x00000010 /* 0=no write access, 0=write
646 * access allowed (supervisor mode)
647 */
648#define CPLB_DIRTY 0x00000080 /* 1=dirty, 0=clean */
649#define CPLB_L1_AOW 0x00008000 /* 0=do not allocate cache lines on
650 * write-through writes,
651 * 1= allocate cache lines on
652 * write-through writes.
653 */
654#define CPLB_WT 0x00004000 /* 0=write-back, 1=write-through */
655
656/* TBUFCTL Masks */
657#define TBUFPWR 0x0001
658#define TBUFEN 0x0002
659#define TBUFOVF 0x0004
660#define TBUFCMPLP_SINGLE 0x0008
661#define TBUFCMPLP_DOUBLE 0x0010
662#define TBUFCMPLP (TBUFCMPLP_SINGLE | TBUFCMPLP_DOUBLE)
663
664/* TBUFSTAT Masks */
665#define TBUFCNT 0x001F
666
667/* ITEST_COMMAND and DTEST_COMMAND Registers */
668/* Masks */
669#define TEST_READ 0x00000000 /* Read Access */
670#define TEST_WRITE 0x00000002 /* Write Access */
671#define TEST_TAG 0x00000000 /* Access TAG */
672#define TEST_DATA 0x00000004 /* Access DATA */
673#define TEST_DW0 0x00000000 /* Select Double Word 0 */
674#define TEST_DW1 0x00000008 /* Select Double Word 1 */
675#define TEST_DW2 0x00000010 /* Select Double Word 2 */
676#define TEST_DW3 0x00000018 /* Select Double Word 3 */
677#define TEST_MB0 0x00000000 /* Select Mini-Bank 0 */
678#define TEST_MB1 0x00010000 /* Select Mini-Bank 1 */
679#define TEST_MB2 0x00020000 /* Select Mini-Bank 2 */
680#define TEST_MB3 0x00030000 /* Select Mini-Bank 3 */
681#define TEST_SET(x) ((x << 5) & 0x03E0) /* Set Index 0->31 */
682#define TEST_WAY0 0x00000000 /* Access Way0 */
683#define TEST_WAY1 0x04000000 /* Access Way1 */
684/* ITEST_COMMAND only */
685#define TEST_WAY2 0x08000000 /* Access Way2 */
686#define TEST_WAY3 0x0C000000 /* Access Way3 */
687/* DTEST_COMMAND only */
688#define TEST_BNKSELA 0x00000000 /* Access SuperBank A */
689#define TEST_BNKSELB 0x00800000 /* Access SuperBank B */
690
691#endif /* _DEF_LPBLACKFIN_H */
diff --git a/include/asm-blackfin/macros.h b/include/asm-blackfin/macros.h
new file mode 100644
index 000000000000..c0c04a2f2dd5
--- /dev/null
+++ b/include/asm-blackfin/macros.h
@@ -0,0 +1,95 @@
1/************************************************************************
2 *
3 * macros.h
4 *
5 * (c) Copyright 2001-2003 Analog Devices, Inc. All rights reserved.
6 *
7 ************************************************************************/
8
9/* Defines various assembly macros. */
10
11#ifndef _MACROS_H
12#define _MACROS_H
13
14#define LO(con32) ((con32) & 0xFFFF)
15#define lo(con32) ((con32) & 0xFFFF)
16#define HI(con32) (((con32) >> 16) & 0xFFFF)
17#define hi(con32) (((con32) >> 16) & 0xFFFF)
18
19/*
20 * Set the corresponding bits in a System Register (SR);
21 * All bits set in "mask" will be set in the system register
22 * specified by "sys_reg" bitset_SR(sys_reg, mask), where
23 * sys_reg is the system register and mask are the bits to be set.
24 */
25#define bitset_SR(sys_reg, mask)\
26 [--SP] = (R7:6);\
27 r7 = sys_reg;\
28 r6.l = (mask) & 0xffff;\
29 r6.h = (mask) >> 16;\
30 r7 = r7 | r6;\
31 sys_reg = r7;\
32 csync;\
33 (R7:6) = [SP++]
34
35/*
36 * Clear the corresponding bits in a System Register (SR);
37 * All bits set in "mask" will be cleared in the SR
38 * specified by "sys_reg" bitclr_SR(sys_reg, mask), where
39 * sys_reg is the SR and mask are the bits to be cleared.
40 */
41#define bitclr_SR(sys_reg, mask)\
42 [--SP] = (R7:6);\
43 r7 = sys_reg;\
44 r7 =~ r7;\
45 r6.l = (mask) & 0xffff;\
46 r6.h = (mask) >> 16;\
47 r7 = r7 | r6;\
48 r7 =~ r7;\
49 sys_reg = r7;\
50 csync;\
51 (R7:6) = [SP++]
52
53/*
54 * Set the corresponding bits in a Memory Mapped Register (MMR);
55 * All bits set in "mask" will be set in the MMR specified by "mmr_reg"
56 * bitset_MMR(mmr_reg, mask), where mmr_reg is the MMR and mask are
57 * the bits to be set.
58 */
59#define bitset_MMR(mmr_reg, mask)\
60 [--SP] = (R7:6);\
61 [--SP] = P5;\
62 p5.l = mmr_reg & 0xffff;\
63 p5.h = mmr_reg >> 16;\
64 r7 = [p5];\
65 r6.l = (mask) & 0xffff;\
66 r6.h = (mask) >> 16;\
67 r7 = r7 | r6;\
68 [p5] = r7;\
69 csync;\
70 p5 = [SP++];\
71 (R7:6) = [SP++]
72
73/*
74 * Clear the corresponding bits in a Memory Mapped Register (MMR);
75 * All bits set in "mask" will be cleared in the MMR specified by "mmr_reg"
76 * bitclr_MMRreg(mmr_reg, mask), where sys_reg is the MMR and mask are
77 * the bits to be cleared.
78 */
79#define bitclr_MMR(mmr_reg, mask)\
80 [--SP] = (R7:6);\
81 [--SP] = P5;\
82 p5.l = mmr_reg & 0xffff;\
83 p5.h = mmr_reg >> 16;\
84 r7 = [p5];\
85 r7 =~ r7;\
86 r6.l = (mask) & 0xffff;\
87 r6.h = (mask) >> 16;\
88 r7 = r7 | r6;\
89 r7 =~ r7;\
90 [p5] = r7;\
91 csync;\
92 p5 = [SP++];\
93 (R7:6) = [SP++]
94
95#endif /* _MACROS_H */
diff --git a/include/asm-blackfin/mem_map.h b/include/asm-blackfin/mem_map.h
new file mode 100644
index 000000000000..42d1f37f6d9c
--- /dev/null
+++ b/include/asm-blackfin/mem_map.h
@@ -0,0 +1,12 @@
1/*
2 * mem_map.h
3 * Common header file for blackfin family of processors.
4 *
5 */
6
7#ifndef _MEM_MAP_H_
8#define _MEM_MAP_H_
9
10#include <asm/mach/mem_map.h>
11
12#endif /* _MEM_MAP_H_ */
diff --git a/include/asm-blackfin/mman.h b/include/asm-blackfin/mman.h
new file mode 100644
index 000000000000..4d504f908c0c
--- /dev/null
+++ b/include/asm-blackfin/mman.h
@@ -0,0 +1,45 @@
1#ifndef __BFIN_MMAN_H__
2#define __BFIN_MMAN_H__
3
4#define PROT_READ 0x1 /* page can be read */
5#define PROT_WRITE 0x2 /* page can be written */
6#define PROT_EXEC 0x4 /* page can be executed */
7#define PROT_SEM 0x8 /* page may be used for atomic ops */
8#define PROT_NONE 0x0 /* page can not be accessed */
9#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
10#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
11
12#define MAP_SHARED 0x01 /* Share changes */
13#define MAP_PRIVATE 0x02 /* Changes are private */
14#define MAP_TYPE 0x0f /* Mask for type of mapping */
15#define MAP_FIXED 0x10 /* Interpret addr exactly */
16#define MAP_ANONYMOUS 0x20 /* don't use a file */
17
18#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
19#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
20#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
21#define MAP_LOCKED 0x2000 /* pages are locked */
22#define MAP_NORESERVE 0x4000 /* don't check for reservations */
23#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
24#define MAP_NONBLOCK 0x10000 /* do not block on IO */
25#define MAP_UNINITIALIZE 0x4000000 /* For anonymous mmap, memory could
26 be uninitialized. */
27
28#define MS_ASYNC 1 /* sync memory asynchronously */
29#define MS_INVALIDATE 2 /* invalidate the caches */
30#define MS_SYNC 4 /* synchronous memory sync */
31
32#define MCL_CURRENT 1 /* lock all current mappings */
33#define MCL_FUTURE 2 /* lock all future mappings */
34
35#define MADV_NORMAL 0x0 /* default page-in behavior */
36#define MADV_RANDOM 0x1 /* page-in minimum required */
37#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
38#define MADV_WILLNEED 0x3 /* pre-fault pages */
39#define MADV_DONTNEED 0x4 /* discard these pages */
40
41/* compatibility flags */
42#define MAP_ANON MAP_ANONYMOUS
43#define MAP_FILE 0
44
45#endif /* __BFIN_MMAN_H__ */
diff --git a/include/asm-blackfin/mmu.h b/include/asm-blackfin/mmu.h
new file mode 100644
index 000000000000..11d52f1167d0
--- /dev/null
+++ b/include/asm-blackfin/mmu.h
@@ -0,0 +1,30 @@
1#ifndef __MMU_H
2#define __MMU_H
3
4/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
5
6struct sram_list_struct {
7 struct sram_list_struct *next;
8 void *addr;
9 size_t length;
10};
11
12typedef struct {
13 struct vm_list_struct *vmlist;
14 unsigned long end_brk;
15 unsigned long stack_start;
16
17 /* Points to the location in SDRAM where the L1 stack is normally
18 saved, or NULL if the stack is always in SDRAM. */
19 void *l1_stack_save;
20
21 struct sram_list_struct *sram_list;
22
23#ifdef CONFIG_BINFMT_ELF_FDPIC
24 unsigned long exec_fdpic_loadmap;
25 unsigned long interp_fdpic_loadmap;
26#endif
27
28} mm_context_t;
29
30#endif
diff --git a/include/asm-blackfin/mmu_context.h b/include/asm-blackfin/mmu_context.h
new file mode 100644
index 000000000000..c5c71a6aaf19
--- /dev/null
+++ b/include/asm-blackfin/mmu_context.h
@@ -0,0 +1,129 @@
1/*
2 * File: include/asm-blackfin/mmu_context.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#ifndef __BLACKFIN_MMU_CONTEXT_H__
31#define __BLACKFIN_MMU_CONTEXT_H__
32
33#include <asm/setup.h>
34#include <asm/page.h>
35#include <asm/pgalloc.h>
36
37extern void *current_l1_stack_save;
38extern int nr_l1stack_tasks;
39extern void *l1_stack_base;
40extern unsigned long l1_stack_len;
41
42extern int l1sram_free(const void*);
43extern void *l1sram_alloc_max(void*);
44
45static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
46{
47}
48
49/* Called when creating a new context during fork() or execve(). */
50static inline int
51init_new_context(struct task_struct *tsk, struct mm_struct *mm)
52{
53 return 0;
54}
55
56static inline void free_l1stack(void)
57{
58 nr_l1stack_tasks--;
59 if (nr_l1stack_tasks == 0)
60 l1sram_free(l1_stack_base);
61}
62static inline void destroy_context(struct mm_struct *mm)
63{
64 struct sram_list_struct *tmp;
65
66 if (current_l1_stack_save == mm->context.l1_stack_save)
67 current_l1_stack_save = 0;
68 if (mm->context.l1_stack_save)
69 free_l1stack();
70
71 while ((tmp = mm->context.sram_list)) {
72 mm->context.sram_list = tmp->next;
73 sram_free(tmp->addr);
74 kfree(tmp);
75 }
76}
77
78static inline unsigned long
79alloc_l1stack(unsigned long length, unsigned long *stack_base)
80{
81 if (nr_l1stack_tasks == 0) {
82 l1_stack_base = l1sram_alloc_max(&l1_stack_len);
83 if (!l1_stack_base)
84 return 0;
85 }
86
87 if (l1_stack_len < length) {
88 if (nr_l1stack_tasks == 0)
89 l1sram_free(l1_stack_base);
90 return 0;
91 }
92 *stack_base = (unsigned long)l1_stack_base;
93 nr_l1stack_tasks++;
94 return l1_stack_len;
95}
96
97static inline int
98activate_l1stack(struct mm_struct *mm, unsigned long sp_base)
99{
100 if (current_l1_stack_save)
101 memcpy(current_l1_stack_save, l1_stack_base, l1_stack_len);
102 mm->context.l1_stack_save = current_l1_stack_save = (void*)sp_base;
103 memcpy(l1_stack_base, current_l1_stack_save, l1_stack_len);
104 return 1;
105}
106
107#define deactivate_mm(tsk,mm) do { } while (0)
108
109static inline void activate_mm(struct mm_struct *prev_mm,
110 struct mm_struct *next_mm)
111{
112 if (!next_mm->context.l1_stack_save)
113 return;
114 if (next_mm->context.l1_stack_save == current_l1_stack_save)
115 return;
116 if (current_l1_stack_save) {
117 memcpy(current_l1_stack_save, l1_stack_base, l1_stack_len);
118 }
119 current_l1_stack_save = next_mm->context.l1_stack_save;
120 memcpy(l1_stack_base, current_l1_stack_save, l1_stack_len);
121}
122
123static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
124 struct task_struct *tsk)
125{
126 activate_mm(prev, next);
127}
128
129#endif
diff --git a/include/asm-blackfin/module.h b/include/asm-blackfin/module.h
new file mode 100644
index 000000000000..3c7ce1644280
--- /dev/null
+++ b/include/asm-blackfin/module.h
@@ -0,0 +1,19 @@
1#ifndef _ASM_BFIN_MODULE_H
2#define _ASM_BFIN_MODULE_H
3
4#define MODULE_SYMBOL_PREFIX "_"
5
6#define Elf_Shdr Elf32_Shdr
7#define Elf_Sym Elf32_Sym
8#define Elf_Ehdr Elf32_Ehdr
9#define FLG_CODE_IN_L1 0x10
10#define FLG_DATA_IN_L1 0x20
11
12struct mod_arch_specific {
13 Elf_Shdr *text_l1;
14 Elf_Shdr *data_a_l1;
15 Elf_Shdr *bss_a_l1;
16 Elf_Shdr *data_b_l1;
17 Elf_Shdr *bss_b_l1;
18};
19#endif /* _ASM_BFIN_MODULE_H */
diff --git a/include/asm-blackfin/msgbuf.h b/include/asm-blackfin/msgbuf.h
new file mode 100644
index 000000000000..6fcbe8cd801d
--- /dev/null
+++ b/include/asm-blackfin/msgbuf.h
@@ -0,0 +1,31 @@
1#ifndef _BFIN_MSGBUF_H
2#define _BFIN_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for bfin architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _BFIN_MSGBUF_H */
diff --git a/include/asm-blackfin/mutex.h b/include/asm-blackfin/mutex.h
new file mode 100644
index 000000000000..458c1f7fbc18
--- /dev/null
+++ b/include/asm-blackfin/mutex.h
@@ -0,0 +1,9 @@
1/*
2 * Pull in the generic implementation for the mutex fastpath.
3 *
4 * TODO: implement optimized primitives instead, or leave the generic
5 * implementation in place, or pick the atomic_xchg() based generic
6 * implementation. (see asm-generic/mutex-xchg.h for details)
7 */
8
9#include <asm-generic/mutex-dec.h>
diff --git a/include/asm-blackfin/namei.h b/include/asm-blackfin/namei.h
new file mode 100644
index 000000000000..8b89a2d65cb4
--- /dev/null
+++ b/include/asm-blackfin/namei.h
@@ -0,0 +1,19 @@
1/*
2 * linux/include/asm/namei.h
3 *
4 * Included from linux/fs/namei.c
5 *
6 * Changes made by Lineo Inc. May 2001
7 */
8
9#ifndef __BFIN_NAMEI_H
10#define __BFIN_NAMEI_H
11
12/* This dummy routine maybe changed to something useful
13 * for /usr/gnemul/ emulation stuff.
14 * Look at asm-sparc/namei.h for details.
15 */
16
17#define __emul_prefix() NULL
18
19#endif
diff --git a/include/asm-blackfin/page.h b/include/asm-blackfin/page.h
new file mode 100644
index 000000000000..ffad947f1b2a
--- /dev/null
+++ b/include/asm-blackfin/page.h
@@ -0,0 +1,89 @@
1#ifndef _BLACKFIN_PAGE_H
2#define _BLACKFIN_PAGE_H
3
4/* PAGE_SHIFT determines the page size */
5
6#define PAGE_SHIFT 12
7#define PAGE_SIZE (1UL << PAGE_SHIFT)
8#define PAGE_MASK (~(PAGE_SIZE-1))
9
10#ifdef __KERNEL__
11
12#include <asm/setup.h>
13
14#ifndef __ASSEMBLY__
15
16#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
17#define free_user_page(page, addr) free_page(addr)
18
19#define clear_page(page) memset((page), 0, PAGE_SIZE)
20#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
21
22#define clear_user_page(page, vaddr,pg) clear_page(page)
23#define copy_user_page(to, from, vaddr,pg) copy_page(to, from)
24
25/*
26 * These are used to make use of C type-checking..
27 */
28typedef struct {
29 unsigned long pte;
30} pte_t;
31typedef struct {
32 unsigned long pmd[16];
33} pmd_t;
34typedef struct {
35 unsigned long pgd;
36} pgd_t;
37typedef struct {
38 unsigned long pgprot;
39} pgprot_t;
40
41#define pte_val(x) ((x).pte)
42#define pmd_val(x) ((&x)->pmd[0])
43#define pgd_val(x) ((x).pgd)
44#define pgprot_val(x) ((x).pgprot)
45
46#define __pte(x) ((pte_t) { (x) } )
47#define __pmd(x) ((pmd_t) { (x) } )
48#define __pgd(x) ((pgd_t) { (x) } )
49#define __pgprot(x) ((pgprot_t) { (x) } )
50
51/* to align the pointer to the (next) page boundary */
52#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
53
54extern unsigned long memory_start;
55extern unsigned long memory_end;
56
57#endif /* !__ASSEMBLY__ */
58
59#include <asm/page_offset.h>
60#include <asm/io.h>
61
62#define PAGE_OFFSET (PAGE_OFFSET_RAW)
63
64#ifndef __ASSEMBLY__
65
66#define __pa(vaddr) virt_to_phys((void *)(vaddr))
67#define __va(paddr) phys_to_virt((unsigned long)(paddr))
68
69#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)
70
71#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
72#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
73#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
74#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
75#define VALID_PAGE(page) ((page - mem_map) < max_mapnr)
76
77#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn))
78#define page_to_pfn(page) virt_to_pfn(page_to_virt(page))
79#define pfn_valid(pfn) ((pfn) < max_mapnr)
80
81#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
82 ((void *)(kaddr) < (void *)memory_end))
83
84#include <asm-generic/page.h>
85
86#endif /* __ASSEMBLY__ */
87#endif /* __KERNEL__ */
88
89#endif /* _BLACKFIN_PAGE_H */
diff --git a/include/asm-blackfin/page_offset.h b/include/asm-blackfin/page_offset.h
new file mode 100644
index 000000000000..3b671d5fd70d
--- /dev/null
+++ b/include/asm-blackfin/page_offset.h
@@ -0,0 +1,6 @@
1
2/* This handles the memory map.. */
3
4#ifdef CONFIG_BFIN
5#define PAGE_OFFSET_RAW 0x00000000
6#endif
diff --git a/include/asm-blackfin/param.h b/include/asm-blackfin/param.h
new file mode 100644
index 000000000000..41564a6347f8
--- /dev/null
+++ b/include/asm-blackfin/param.h
@@ -0,0 +1,22 @@
1#ifndef _BLACKFIN_PARAM_H
2#define _BLACKFIN_PARAM_H
3
4#ifdef __KERNEL__
5#define HZ CONFIG_HZ
6#define USER_HZ 100
7#define CLOCKS_PER_SEC (USER_HZ)
8#endif
9
10#ifndef HZ
11#define HZ 100
12#endif
13
14#define EXEC_PAGESIZE 4096
15
16#ifndef NOGROUP
17#define NOGROUP (-1)
18#endif
19
20#define MAXHOSTNAMELEN 64 /* max length of hostname */
21
22#endif /* _BLACKFIN_PARAM_H */
diff --git a/include/asm-blackfin/pci.h b/include/asm-blackfin/pci.h
new file mode 100644
index 000000000000..61277358c865
--- /dev/null
+++ b/include/asm-blackfin/pci.h
@@ -0,0 +1,148 @@
1/* Changed from asm-m68k version, Lineo Inc. May 2001 */
2
3#ifndef _ASM_BFIN_PCI_H
4#define _ASM_BFIN_PCI_H
5
6#include <asm/scatterlist.h>
7
8/*
9 *
10 * Written by Wout Klaren.
11 */
12
13/* Added by Chang Junxiao */
14#define PCIBIOS_MIN_IO 0x00001000
15#define PCIBIOS_MIN_MEM 0x10000000
16
17#define PCI_DMA_BUS_IS_PHYS (1)
18struct pci_ops;
19
20/*
21 * Structure with hardware dependent information and functions of the
22 * PCI bus.
23 */
24struct pci_bus_info {
25
26 /*
27 * Resources of the PCI bus.
28 */
29 struct resource mem_space;
30 struct resource io_space;
31
32 /*
33 * System dependent functions.
34 */
35 struct pci_ops *bfin_pci_ops;
36 void (*fixup) (int pci_modify);
37 void (*conf_device) (unsigned char bus, unsigned char device_fn);
38};
39
40#define pcibios_assign_all_busses() 0
41static inline void pcibios_set_master(struct pci_dev *dev)
42{
43
44 /* No special bus mastering setup handling */
45}
46static inline void pcibios_penalize_isa_irq(int irq)
47{
48
49 /* We don't do dynamic PCI IRQ allocation */
50}
51static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
52 size_t size, int direction)
53{
54 if (direction == PCI_DMA_NONE)
55 BUG();
56
57 /* return virt_to_bus(ptr); */
58 return (dma_addr_t) ptr;
59}
60
61/* Unmap a single streaming mode DMA translation. The dma_addr and size
62 * must match what was provided for in a previous pci_map_single call. All
63 * other usages are undefined.
64 *
65 * After this call, reads by the cpu to the buffer are guarenteed to see
66 * whatever the device wrote there.
67 */
68static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
69 size_t size, int direction)
70{
71 if (direction == PCI_DMA_NONE)
72 BUG();
73
74 /* Nothing to do */
75}
76
77/* Map a set of buffers described by scatterlist in streaming
78 * mode for DMA. This is the scather-gather version of the
79 * above pci_map_single interface. Here the scatter gather list
80 * elements are each tagged with the appropriate dma address
81 * and length. They are obtained via sg_dma_{address,length}(SG).
82 *
83 * NOTE: An implementation may be able to use a smaller number of
84 * DMA address/length pairs than there are SG table elements.
85 * (for example via virtual mapping capabilities)
86 * The routine returns the number of addr/length pairs actually
87 * used, at most nents.
88 *
89 * Device ownership issues as mentioned above for pci_map_single are
90 * the same here.
91 */
92static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
93 int nents, int direction)
94{
95 if (direction == PCI_DMA_NONE)
96 BUG();
97 return nents;
98}
99
100/* Unmap a set of streaming mode DMA translations.
101 * Again, cpu read rules concerning calls here are the same as for
102 * pci_unmap_single() above.
103 */
104static inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
105 int nents, int direction)
106{
107 if (direction == PCI_DMA_NONE)
108 BUG();
109
110 /* Nothing to do */
111}
112
113/* Make physical memory consistent for a single
114 * streaming mode DMA translation after a transfer.
115 *
116 * If you perform a pci_map_single() but wish to interrogate the
117 * buffer using the cpu, yet do not wish to teardown the PCI dma
118 * mapping, you must call this function before doing so. At the
119 * next point you give the PCI dma address back to the card, the
120 * device again owns the buffer.
121 */
122static inline void pci_dma_sync_single(struct pci_dev *hwdev,
123 dma_addr_t dma_handle, size_t size,
124 int direction)
125{
126 if (direction == PCI_DMA_NONE)
127 BUG();
128
129 /* Nothing to do */
130}
131
132/* Make physical memory consistent for a set of streaming
133 * mode DMA translations after a transfer.
134 *
135 * The same as pci_dma_sync_single but for a scatter-gather list,
136 * same rules and usage.
137 */
138static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
139 struct scatterlist *sg, int nelems,
140 int direction)
141{
142 if (direction == PCI_DMA_NONE)
143 BUG();
144
145 /* Nothing to do */
146}
147
148#endif /* _ASM_BFIN_PCI_H */
diff --git a/include/asm-blackfin/percpu.h b/include/asm-blackfin/percpu.h
new file mode 100644
index 000000000000..78dd61f6b39f
--- /dev/null
+++ b/include/asm-blackfin/percpu.h
@@ -0,0 +1,6 @@
1#ifndef __ARCH_BLACKFIN_PERCPU__
2#define __ARCH_BLACKFIN_PERCPU__
3
4#include <asm-generic/percpu.h>
5
6#endif /* __ARCH_BLACKFIN_PERCPU__ */
diff --git a/include/asm-blackfin/pgalloc.h b/include/asm-blackfin/pgalloc.h
new file mode 100644
index 000000000000..c686e0542fd0
--- /dev/null
+++ b/include/asm-blackfin/pgalloc.h
@@ -0,0 +1,8 @@
1#ifndef _BLACKFIN_PGALLOC_H
2#define _BLACKFIN_PGALLOC_H
3
4#include <asm/setup.h>
5
6#define check_pgt_cache() do { } while (0)
7
8#endif /* _BLACKFIN_PGALLOC_H */
diff --git a/include/asm-blackfin/pgtable.h b/include/asm-blackfin/pgtable.h
new file mode 100644
index 000000000000..5a8f9e431c40
--- /dev/null
+++ b/include/asm-blackfin/pgtable.h
@@ -0,0 +1,96 @@
1#ifndef _BLACKFIN_PGTABLE_H
2#define _BLACKFIN_PGTABLE_H
3
4#include <asm-generic/4level-fixup.h>
5
6#include <asm/page.h>
7#include <asm/cplb.h>
8
9typedef pte_t *pte_addr_t;
10/*
11* Trivial page table functions.
12*/
13#define pgd_present(pgd) (1)
14#define pgd_none(pgd) (0)
15#define pgd_bad(pgd) (0)
16#define pgd_clear(pgdp)
17#define kern_addr_valid(addr) (1)
18
19#define pmd_offset(a, b) ((void *)0)
20#define pmd_none(x) (!pmd_val(x))
21#define pmd_present(x) (pmd_val(x))
22#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
23#define pmd_bad(x) (pmd_val(x) & ~PAGE_MASK)
24
25#define kern_addr_valid(addr) (1)
26
27#define PAGE_NONE __pgprot(0) /* these mean nothing to NO_MM */
28#define PAGE_SHARED __pgprot(0) /* these mean nothing to NO_MM */
29#define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */
30#define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */
31#define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */
32
33extern void paging_init(void);
34
35#define __swp_type(x) (0)
36#define __swp_offset(x) (0)
37#define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
38#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
39#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
40
41static inline int pte_file(pte_t pte)
42{
43 return 0;
44}
45
46#define set_pte(pteptr, pteval) (*(pteptr) = pteval)
47#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
48
49/*
50 * Page assess control based on Blackfin CPLB management
51 */
52#define _PAGE_RD (CPLB_USER_RD)
53#define _PAGE_WR (CPLB_USER_WR)
54#define _PAGE_USER (CPLB_USER_RD | CPLB_USER_WR)
55#define _PAGE_ACCESSED CPLB_ALL_ACCESS
56#define _PAGE_DIRTY (CPLB_DIRTY)
57
58#define PTE_BIT_FUNC(fn, op) \
59 static inline pte_t pte_##fn(pte_t _pte) { _pte.pte op; return _pte; }
60
61PTE_BIT_FUNC(rdprotect, &= ~_PAGE_RD);
62PTE_BIT_FUNC(mkread, |= _PAGE_RD);
63PTE_BIT_FUNC(wrprotect, &= ~_PAGE_WR);
64PTE_BIT_FUNC(mkwrite, |= _PAGE_WR);
65PTE_BIT_FUNC(exprotect, &= ~_PAGE_USER);
66PTE_BIT_FUNC(mkexec, |= _PAGE_USER);
67PTE_BIT_FUNC(mkclean, &= ~_PAGE_DIRTY);
68PTE_BIT_FUNC(mkdirty, |= _PAGE_DIRTY);
69PTE_BIT_FUNC(mkold, &= ~_PAGE_ACCESSED);
70PTE_BIT_FUNC(mkyoung, |= _PAGE_ACCESSED);
71
72/*
73 * ZERO_PAGE is a global shared page that is always zero: used
74 * for zero-mapped memory areas etc..
75 */
76#define ZERO_PAGE(vaddr) (virt_to_page(0))
77
78extern unsigned int kobjsize(const void *objp);
79
80#define swapper_pg_dir ((pgd_t *) 0)
81/*
82 * No page table caches to initialise.
83 */
84#define pgtable_cache_init() do { } while (0)
85#define io_remap_pfn_range remap_pfn_range
86
87/*
88 * All 32bit addresses are effectively valid for vmalloc...
89 * Sort of meaningless for non-VM targets.
90 */
91#define VMALLOC_START 0
92#define VMALLOC_END 0xffffffff
93
94#include <asm-generic/pgtable.h>
95
96#endif /* _BLACKFIN_PGTABLE_H */
diff --git a/include/asm-blackfin/poll.h b/include/asm-blackfin/poll.h
new file mode 100644
index 000000000000..94cc2636e0e2
--- /dev/null
+++ b/include/asm-blackfin/poll.h
@@ -0,0 +1,24 @@
1#ifndef __BFIN_POLL_H
2#define __BFIN_POLL_H
3
4#define POLLIN 1
5#define POLLPRI 2
6#define POLLOUT 4
7#define POLLERR 8
8#define POLLHUP 16
9#define POLLNVAL 32
10#define POLLRDNORM 64
11#define POLLWRNORM POLLOUT
12#define POLLRDBAND 128
13#define POLLWRBAND 256
14#define POLLMSG 0x0400
15#define POLLREMOVE 0x1000
16#define POLLRDHUP 0x2000
17
18struct pollfd {
19 int fd;
20 short events;
21 short revents;
22};
23
24#endif /* __BFIN_POLL_H */
diff --git a/include/asm-blackfin/posix_types.h b/include/asm-blackfin/posix_types.h
new file mode 100644
index 000000000000..c3fa50fa50b8
--- /dev/null
+++ b/include/asm-blackfin/posix_types.h
@@ -0,0 +1,65 @@
1#ifndef __ARCH_BFIN_POSIX_TYPES_H
2#define __ARCH_BFIN_POSIX_TYPES_H
3
4/*
5 * This file is generally used by user-level software, so you need to
6 * be a little careful about namespace pollution etc. Also, we cannot
7 * assume GCC is being used.
8 */
9
10typedef unsigned long __kernel_ino_t;
11typedef unsigned short __kernel_mode_t;
12typedef unsigned short __kernel_nlink_t;
13typedef long __kernel_off_t;
14typedef int __kernel_pid_t;
15typedef unsigned int __kernel_ipc_pid_t;
16typedef unsigned int __kernel_uid_t;
17typedef unsigned int __kernel_gid_t;
18typedef unsigned long __kernel_size_t;
19typedef long __kernel_ssize_t;
20typedef int __kernel_ptrdiff_t;
21typedef long __kernel_time_t;
22typedef long __kernel_suseconds_t;
23typedef long __kernel_clock_t;
24typedef int __kernel_timer_t;
25typedef int __kernel_clockid_t;
26typedef int __kernel_daddr_t;
27typedef char *__kernel_caddr_t;
28typedef unsigned short __kernel_uid16_t;
29typedef unsigned short __kernel_gid16_t;
30typedef unsigned int __kernel_uid32_t;
31typedef unsigned int __kernel_gid32_t;
32
33typedef unsigned short __kernel_old_uid_t;
34typedef unsigned short __kernel_old_gid_t;
35typedef unsigned short __kernel_old_dev_t;
36
37#ifdef __GNUC__
38typedef long long __kernel_loff_t;
39#endif
40
41typedef struct {
42#if defined(__KERNEL__) || defined(__USE_ALL)
43 int val[2];
44#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
45 int __val[2];
46#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
47} __kernel_fsid_t;
48
49#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
50
51#undef __FD_SET
52#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
53
54#undef __FD_CLR
55#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
56
57#undef __FD_ISSET
58#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
59
60#undef __FD_ZERO
61#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
62
63#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
64
65#endif
diff --git a/include/asm-blackfin/processor.h b/include/asm-blackfin/processor.h
new file mode 100644
index 000000000000..997465c93e82
--- /dev/null
+++ b/include/asm-blackfin/processor.h
@@ -0,0 +1,130 @@
1#ifndef __ASM_BFIN_PROCESSOR_H
2#define __ASM_BFIN_PROCESSOR_H
3
4/*
5 * Default implementation of macro that returns current
6 * instruction pointer ("program counter").
7 */
8#define current_text_addr() ({ __label__ _l; _l: &&_l;})
9
10#include <asm/blackfin.h>
11#include <asm/segment.h>
12#include <linux/compiler.h>
13
14static inline unsigned long rdusp(void)
15{
16 unsigned long usp;
17
18 __asm__ __volatile__("%0 = usp;\n\t":"=da"(usp));
19 return usp;
20}
21
22static inline void wrusp(unsigned long usp)
23{
24 __asm__ __volatile__("usp = %0;\n\t"::"da"(usp));
25}
26
27/*
28 * User space process size: 1st byte beyond user address space.
29 */
30extern unsigned long memory_end;
31#define TASK_SIZE (memory_end)
32
33#define TASK_UNMAPPED_BASE 0
34
35struct thread_struct {
36 unsigned long ksp; /* kernel stack pointer */
37 unsigned long usp; /* user stack pointer */
38 unsigned short seqstat; /* saved status register */
39 unsigned long esp0; /* points to SR of stack frame pt_regs */
40 unsigned long pc; /* instruction pointer */
41 void * debuggerinfo;
42};
43
44#define INIT_THREAD { \
45 sizeof(init_stack) + (unsigned long) init_stack, 0, \
46 PS_S, 0, 0 \
47}
48
49/*
50 * Do necessary setup to start up a newly executed thread.
51 *
52 * pass the data segment into user programs if it exists,
53 * it can't hurt anything as far as I can tell
54 */
55#define start_thread(_regs, _pc, _usp) \
56do { \
57 set_fs(USER_DS); \
58 (_regs)->pc = (_pc); \
59 if (current->mm) \
60 (_regs)->p5 = current->mm->start_data; \
61 current->thread_info->l1_task_info.stack_start \
62 = (void *)current->mm->context.stack_start; \
63 current->thread_info->l1_task_info.lowest_sp = (void *)(_usp); \
64 memcpy(L1_SCRATCH_TASK_INFO, &current->thread_info->l1_task_info, \
65 sizeof(*L1_SCRATCH_TASK_INFO)); \
66 wrusp(_usp); \
67} while(0)
68
69/* Forward declaration, a strange C thing */
70struct task_struct;
71
72/* Free all resources held by a thread. */
73static inline void release_thread(struct task_struct *dead_task)
74{
75}
76
77#define prepare_to_copy(tsk) do { } while (0)
78
79extern int kernel_thread(int (*fn) (void *), void *arg, unsigned long flags);
80
81/*
82 * Free current thread data structures etc..
83 */
84static inline void exit_thread(void)
85{
86}
87
88/*
89 * Return saved PC of a blocked thread.
90 */
91#define thread_saved_pc(tsk) (tsk->thread.pc)
92
93unsigned long get_wchan(struct task_struct *p);
94
95#define KSTK_EIP(tsk) \
96 ({ \
97 unsigned long eip = 0; \
98 if ((tsk)->thread.esp0 > PAGE_SIZE && \
99 MAP_NR((tsk)->thread.esp0) < max_mapnr) \
100 eip = ((struct pt_regs *) (tsk)->thread.esp0)->pc; \
101 eip; })
102#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
103
104#define cpu_relax() barrier()
105
106/* Get the Silicon Revision of the chip */
107static inline uint32_t bfin_revid(void)
108{
109 /* stored in the upper 4 bits */
110 return bfin_read_CHIPID() >> 28;
111}
112
113static inline uint32_t bfin_compiled_revid(void)
114{
115#if defined(CONFIG_BF_REV_0_0)
116 return 0;
117#elif defined(CONFIG_BF_REV_0_1)
118 return 1;
119#elif defined(CONFIG_BF_REV_0_2)
120 return 2;
121#elif defined(CONFIG_BF_REV_0_3)
122 return 3;
123#elif defined(CONFIG_BF_REV_0_4)
124 return 4;
125#elif defined(CONFIG_BF_REV_0_5)
126 return 5;
127#endif
128}
129
130#endif
diff --git a/include/asm-blackfin/ptrace.h b/include/asm-blackfin/ptrace.h
new file mode 100644
index 000000000000..b8346cd3a6f6
--- /dev/null
+++ b/include/asm-blackfin/ptrace.h
@@ -0,0 +1,166 @@
1#ifndef _BFIN_PTRACE_H
2#define _BFIN_PTRACE_H
3
4/*
5 * GCC defines register number like this:
6 * -----------------------------
7 * 0 - 7 are data registers R0-R7
8 * 8 - 15 are address registers P0-P7
9 * 16 - 31 dsp registers I/B/L0 -- I/B/L3 & M0--M3
10 * 32 - 33 A registers A0 & A1
11 * 34 - status register
12 * -----------------------------
13 *
14 * We follows above, except:
15 * 32-33 --- Low 32-bit of A0&1
16 * 34-35 --- High 8-bit of A0&1
17 */
18
19#ifndef __ASSEMBLY__
20
21/* this struct defines the way the registers are stored on the
22 stack during a system call. */
23
24struct pt_regs {
25 long orig_pc;
26 long ipend;
27 long seqstat;
28 long rete;
29 long retn;
30 long retx;
31 long pc; /* PC == RETI */
32 long rets;
33 long reserved; /* Used as scratch during system calls */
34 long astat;
35 long lb1;
36 long lb0;
37 long lt1;
38 long lt0;
39 long lc1;
40 long lc0;
41 long a1w;
42 long a1x;
43 long a0w;
44 long a0x;
45 long b3;
46 long b2;
47 long b1;
48 long b0;
49 long l3;
50 long l2;
51 long l1;
52 long l0;
53 long m3;
54 long m2;
55 long m1;
56 long m0;
57 long i3;
58 long i2;
59 long i1;
60 long i0;
61 long usp;
62 long fp;
63 long p5;
64 long p4;
65 long p3;
66 long p2;
67 long p1;
68 long p0;
69 long r7;
70 long r6;
71 long r5;
72 long r4;
73 long r3;
74 long r2;
75 long r1;
76 long r0;
77 long orig_r0;
78 long orig_p0;
79 long syscfg;
80};
81
82/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
83#define PTRACE_GETREGS 12
84#define PTRACE_SETREGS 13 /* ptrace signal */
85
86#ifdef CONFIG_BINFMT_ELF_FDPIC
87#define PTRACE_GETFDPIC 31
88#define PTRACE_GETFDPIC_EXEC 0
89#define PTRACE_GETFDPIC_INTERP 1
90#endif
91
92#define PS_S (0x0002)
93
94/* user_mode returns true if only one bit is set in IPEND, other than the
95 master interrupt enable. */
96#define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1)))
97#define instruction_pointer(regs) ((regs)->pc)
98#define profile_pc(regs) instruction_pointer(regs)
99extern void show_regs(struct pt_regs *);
100
101#endif /* __ASSEMBLY__ */
102
103/*
104 * Offsets used by 'ptrace' system call interface.
105 */
106
107#define PT_R0 204
108#define PT_R1 200
109#define PT_R2 196
110#define PT_R3 192
111#define PT_R4 188
112#define PT_R5 184
113#define PT_R6 180
114#define PT_R7 176
115#define PT_P0 172
116#define PT_P1 168
117#define PT_P2 164
118#define PT_P3 160
119#define PT_P4 156
120#define PT_P5 152
121#define PT_FP 148
122#define PT_USP 144
123#define PT_I0 140
124#define PT_I1 136
125#define PT_I2 132
126#define PT_I3 128
127#define PT_M0 124
128#define PT_M1 120
129#define PT_M2 116
130#define PT_M3 112
131#define PT_L0 108
132#define PT_L1 104
133#define PT_L2 100
134#define PT_L3 96
135#define PT_B0 92
136#define PT_B1 88
137#define PT_B2 84
138#define PT_B3 80
139#define PT_A0X 76
140#define PT_A0W 72
141#define PT_A1X 68
142#define PT_A1W 64
143#define PT_LC0 60
144#define PT_LC1 56
145#define PT_LT0 52
146#define PT_LT1 48
147#define PT_LB0 44
148#define PT_LB1 40
149#define PT_ASTAT 36
150#define PT_RESERVED 32
151#define PT_RETS 28
152#define PT_PC 24
153#define PT_RETX 20
154#define PT_RETN 16
155#define PT_RETE 12
156#define PT_SEQSTAT 8
157#define PT_IPEND 4
158
159#define PT_SYSCFG 216
160#define PT_TEXT_ADDR 220
161#define PT_TEXT_END_ADDR 224
162#define PT_DATA_ADDR 228
163#define PT_FDPIC_EXEC 232
164#define PT_FDPIC_INTERP 236
165
166#endif /* _BFIN_PTRACE_H */
diff --git a/include/asm-blackfin/resource.h b/include/asm-blackfin/resource.h
new file mode 100644
index 000000000000..091355ab3495
--- /dev/null
+++ b/include/asm-blackfin/resource.h
@@ -0,0 +1,6 @@
1#ifndef _BFIN_RESOURCE_H
2#define _BFIN_RESOURCE_H
3
4#include <asm-generic/resource.h>
5
6#endif /* _BFIN_RESOURCE_H */
diff --git a/include/asm-blackfin/scatterlist.h b/include/asm-blackfin/scatterlist.h
new file mode 100644
index 000000000000..60e07b92044c
--- /dev/null
+++ b/include/asm-blackfin/scatterlist.h
@@ -0,0 +1,26 @@
1#ifndef _BLACKFIN_SCATTERLIST_H
2#define _BLACKFIN_SCATTERLIST_H
3
4#include <linux/mm.h>
5
6struct scatterlist {
7 struct page *page;
8 unsigned int offset;
9 dma_addr_t dma_address;
10 unsigned int length;
11};
12
13/*
14 * These macros should be used after a pci_map_sg call has been done
15 * to get bus addresses of each of the SG entries and their lengths.
16 * You should only work with the number of sg entries pci_map_sg
17 * returns, or alternatively stop on the first sg_dma_len(sg) which
18 * is 0.
19 */
20#define sg_address(sg) (page_address((sg)->page) + (sg)->offset)
21#define sg_dma_address(sg) ((sg)->dma_address)
22#define sg_dma_len(sg) ((sg)->length)
23
24#define ISA_DMA_THRESHOLD (0xffffffff)
25
26#endif /* !(_BLACKFIN_SCATTERLIST_H) */
diff --git a/include/asm-blackfin/sections.h b/include/asm-blackfin/sections.h
new file mode 100644
index 000000000000..1443c3353a8c
--- /dev/null
+++ b/include/asm-blackfin/sections.h
@@ -0,0 +1,7 @@
1#ifndef _BLACKFIN_SECTIONS_H
2#define _BLACKFIN_SECTIONS_H
3
4/* nothing to see, move along */
5#include <asm-generic/sections.h>
6
7#endif
diff --git a/include/asm-blackfin/segment.h b/include/asm-blackfin/segment.h
new file mode 100644
index 000000000000..02cfd09b5a99
--- /dev/null
+++ b/include/asm-blackfin/segment.h
@@ -0,0 +1,7 @@
1#ifndef _BFIN_SEGMENT_H
2#define _BFIN_SEGMENT_H
3
4#define KERNEL_DS (0x5)
5#define USER_DS (0x1)
6
7#endif /* _BFIN_SEGMENT_H */
diff --git a/include/asm-blackfin/semaphore-helper.h b/include/asm-blackfin/semaphore-helper.h
new file mode 100644
index 000000000000..9082b0dc3eb5
--- /dev/null
+++ b/include/asm-blackfin/semaphore-helper.h
@@ -0,0 +1,82 @@
1/* Based on M68K version, Lineo Inc. May 2001 */
2
3#ifndef _BFIN_SEMAPHORE_HELPER_H
4#define _BFIN_SEMAPHORE_HELPER_H
5
6/*
7 * SMP- and interrupt-safe semaphores helper functions.
8 *
9 * (C) Copyright 1996 Linus Torvalds
10 *
11 */
12
13#include <asm/errno.h>
14
15/*
16 * These two _must_ execute atomically wrt each other.
17 */
18static inline void wake_one_more(struct semaphore *sem)
19{
20 atomic_inc(&sem->waking);
21}
22
23static inline int waking_non_zero(struct semaphore *sem)
24{
25 int ret;
26 unsigned long flags = 0;
27
28 spin_lock_irqsave(&semaphore_wake_lock, flags);
29 ret = 0;
30 if (atomic_read(&sem->waking) > 0) {
31 atomic_dec(&sem->waking);
32 ret = 1;
33 }
34 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
35 return ret;
36}
37
38/*
39 * waking_non_zero_interruptible:
40 * 1 got the lock
41 * 0 go to sleep
42 * -EINTR interrupted
43 */
44static inline int waking_non_zero_interruptible(struct semaphore *sem,
45 struct task_struct *tsk)
46{
47 int ret = 0;
48 unsigned long flags = 0;
49
50 spin_lock_irqsave(&semaphore_wake_lock, flags);
51 if (atomic_read(&sem->waking) > 0) {
52 atomic_dec(&sem->waking);
53 ret = 1;
54 } else if (signal_pending(tsk)) {
55 atomic_inc(&sem->count);
56 ret = -EINTR;
57 }
58 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
59 return ret;
60}
61
62/*
63 * waking_non_zero_trylock:
64 * 1 failed to lock
65 * 0 got the lock
66 */
67static inline int waking_non_zero_trylock(struct semaphore *sem)
68{
69 int ret = 1;
70 unsigned long flags = 0;
71
72 spin_lock_irqsave(&semaphore_wake_lock, flags);
73 if (atomic_read(&sem->waking) > 0) {
74 atomic_dec(&sem->waking);
75 ret = 0;
76 } else
77 atomic_inc(&sem->count);
78 spin_unlock_irqrestore(&semaphore_wake_lock, flags);
79 return ret;
80}
81
82#endif /* _BFIN_SEMAPHORE_HELPER_H */
diff --git a/include/asm-blackfin/semaphore.h b/include/asm-blackfin/semaphore.h
new file mode 100644
index 000000000000..94c04d7ab23e
--- /dev/null
+++ b/include/asm-blackfin/semaphore.h
@@ -0,0 +1,106 @@
1#ifndef _BFIN_SEMAPHORE_H
2#define _BFIN_SEMAPHORE_H
3
4#ifndef __ASSEMBLY__
5
6#include <linux/linkage.h>
7#include <linux/wait.h>
8#include <linux/spinlock.h>
9#include <linux/rwsem.h>
10#include <asm/atomic.h>
11
12/*
13 * Interrupt-safe semaphores..
14 *
15 * (C) Copyright 1996 Linus Torvalds
16 *
17 * BFIN version by akbar hussain Lineo Inc April 2001
18 *
19 */
20
21struct semaphore {
22 atomic_t count;
23 int sleepers;
24 wait_queue_head_t wait;
25};
26
27#define __SEMAPHORE_INITIALIZER(name, n) \
28{ \
29 .count = ATOMIC_INIT(n), \
30 .sleepers = 0, \
31 .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
32}
33
34#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
35 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
36
37#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
38#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
39
40static inline void sema_init(struct semaphore *sem, int val)
41{
42 *sem = (struct semaphore)__SEMAPHORE_INITIALIZER(*sem, val);
43}
44
45static inline void init_MUTEX(struct semaphore *sem)
46{
47 sema_init(sem, 1);
48}
49
50static inline void init_MUTEX_LOCKED(struct semaphore *sem)
51{
52 sema_init(sem, 0);
53}
54
55asmlinkage void __down(struct semaphore *sem);
56asmlinkage int __down_interruptible(struct semaphore *sem);
57asmlinkage int __down_trylock(struct semaphore *sem);
58asmlinkage void __up(struct semaphore *sem);
59
60extern spinlock_t semaphore_wake_lock;
61
62/*
63 * This is ugly, but we want the default case to fall through.
64 * "down_failed" is a special asm handler that calls the C
65 * routine that actually waits.
66 */
67static inline void down(struct semaphore *sem)
68{
69 might_sleep();
70 if (atomic_dec_return(&sem->count) < 0)
71 __down(sem);
72}
73
74static inline int down_interruptible(struct semaphore *sem)
75{
76 int ret = 0;
77
78 might_sleep();
79 if (atomic_dec_return(&sem->count) < 0)
80 ret = __down_interruptible(sem);
81 return (ret);
82}
83
84static inline int down_trylock(struct semaphore *sem)
85{
86 int ret = 0;
87
88 if (atomic_dec_return(&sem->count) < 0)
89 ret = __down_trylock(sem);
90 return ret;
91}
92
93/*
94 * Note! This is subtle. We jump to wake people up only if
95 * the semaphore was negative (== somebody was waiting on it).
96 * The default case (no contention) will result in NO
97 * jumps for both down() and up().
98 */
99static inline void up(struct semaphore *sem)
100{
101 if (atomic_inc_return(&sem->count) <= 0)
102 __up(sem);
103}
104
105#endif /* __ASSEMBLY__ */
106#endif /* _BFIN_SEMAPHORE_H */
diff --git a/include/asm-blackfin/sembuf.h b/include/asm-blackfin/sembuf.h
new file mode 100644
index 000000000000..18deb5c7fa5d
--- /dev/null
+++ b/include/asm-blackfin/sembuf.h
@@ -0,0 +1,25 @@
1#ifndef _BFIN_SEMBUF_H
2#define _BFIN_SEMBUF_H
3
4/*
5 * The semid64_ds structure for bfin architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct semid64_ds {
15 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
16 __kernel_time_t sem_otime; /* last semop time */
17 unsigned long __unused1;
18 __kernel_time_t sem_ctime; /* last change time */
19 unsigned long __unused2;
20 unsigned long sem_nsems; /* no. of semaphores in array */
21 unsigned long __unused3;
22 unsigned long __unused4;
23};
24
25#endif /* _BFIN_SEMBUF_H */
diff --git a/include/asm-blackfin/setup.h b/include/asm-blackfin/setup.h
new file mode 100644
index 000000000000..01c8c6cbe6fc
--- /dev/null
+++ b/include/asm-blackfin/setup.h
@@ -0,0 +1,17 @@
1/*
2** asm/setup.h -- Definition of the Linux/bfin setup information
3**
4** This file is subject to the terms and conditions of the GNU General Public
5** License. See the file COPYING in the main directory of this archive
6** for more details.
7**
8** Copyright Lineo, Inc 2001 Tony Kou
9**
10*/
11
12#ifndef _BFIN_SETUP_H
13#define _BFIN_SETUP_H
14
15#define COMMAND_LINE_SIZE 512
16
17#endif /* _BFIN_SETUP_H */
diff --git a/include/asm-blackfin/shmbuf.h b/include/asm-blackfin/shmbuf.h
new file mode 100644
index 000000000000..612436303e89
--- /dev/null
+++ b/include/asm-blackfin/shmbuf.h
@@ -0,0 +1,42 @@
1#ifndef _BFIN_SHMBUF_H
2#define _BFIN_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for bfin architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _BFIN_SHMBUF_H */
diff --git a/include/asm-blackfin/shmparam.h b/include/asm-blackfin/shmparam.h
new file mode 100644
index 000000000000..3c03906b7664
--- /dev/null
+++ b/include/asm-blackfin/shmparam.h
@@ -0,0 +1,6 @@
1#ifndef _BFIN_SHMPARAM_H
2#define _BFIN_SHMPARAM_H
3
4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
5
6#endif /* _BFIN_SHMPARAM_H */
diff --git a/include/asm-blackfin/sigcontext.h b/include/asm-blackfin/sigcontext.h
new file mode 100644
index 000000000000..ce00b03c2775
--- /dev/null
+++ b/include/asm-blackfin/sigcontext.h
@@ -0,0 +1,55 @@
1#ifndef _ASM_BLACKFIN_SIGCONTEXT_H
2#define _ASM_BLACKFIN_SIGCONTEXT_H
3
4/* Add new entries at the end of the structure only. */
5struct sigcontext {
6 unsigned long sc_r0;
7 unsigned long sc_r1;
8 unsigned long sc_r2;
9 unsigned long sc_r3;
10 unsigned long sc_r4;
11 unsigned long sc_r5;
12 unsigned long sc_r6;
13 unsigned long sc_r7;
14 unsigned long sc_p0;
15 unsigned long sc_p1;
16 unsigned long sc_p2;
17 unsigned long sc_p3;
18 unsigned long sc_p4;
19 unsigned long sc_p5;
20 unsigned long sc_usp;
21 unsigned long sc_a0w;
22 unsigned long sc_a1w;
23 unsigned long sc_a0x;
24 unsigned long sc_a1x;
25 unsigned long sc_astat;
26 unsigned long sc_rets;
27 unsigned long sc_pc;
28 unsigned long sc_retx;
29 unsigned long sc_fp;
30 unsigned long sc_i0;
31 unsigned long sc_i1;
32 unsigned long sc_i2;
33 unsigned long sc_i3;
34 unsigned long sc_m0;
35 unsigned long sc_m1;
36 unsigned long sc_m2;
37 unsigned long sc_m3;
38 unsigned long sc_l0;
39 unsigned long sc_l1;
40 unsigned long sc_l2;
41 unsigned long sc_l3;
42 unsigned long sc_b0;
43 unsigned long sc_b1;
44 unsigned long sc_b2;
45 unsigned long sc_b3;
46 unsigned long sc_lc0;
47 unsigned long sc_lc1;
48 unsigned long sc_lt0;
49 unsigned long sc_lt1;
50 unsigned long sc_lb0;
51 unsigned long sc_lb1;
52 unsigned long sc_seqstat;
53};
54
55#endif
diff --git a/include/asm-blackfin/siginfo.h b/include/asm-blackfin/siginfo.h
new file mode 100644
index 000000000000..eca4565cea37
--- /dev/null
+++ b/include/asm-blackfin/siginfo.h
@@ -0,0 +1,35 @@
1#ifndef _BFIN_SIGINFO_H
2#define _BFIN_SIGINFO_H
3
4#include <linux/types.h>
5#include <asm-generic/siginfo.h>
6
7#define UID16_SIGINFO_COMPAT_NEEDED
8
9#define si_uid16 _sifields._kill._uid
10
11#define ILL_ILLPARAOP (__SI_FAULT|2) /* illegal opcode combine ********** */
12#define ILL_ILLEXCPT (__SI_FAULT|4) /* unrecoverable exception ********** */
13#define ILL_CPLB_VI (__SI_FAULT|9) /* D/I CPLB protect violation ******** */
14#define ILL_CPLB_MISS (__SI_FAULT|10) /* D/I CPLB miss ******** */
15#define ILL_CPLB_MULHIT (__SI_FAULT|11) /* D/I CPLB multiple hit ******** */
16
17/*
18 * SIGBUS si_codes
19 */
20#define BUS_OPFETCH (__SI_FAULT|4) /* error from instruction fetch ******** */
21
22/*
23 * SIGTRAP si_codes
24 */
25#define TRAP_STEP (__SI_FAULT|1) /* single-step breakpoint************* */
26#define TRAP_TRACEFLOW (__SI_FAULT|2) /* trace buffer overflow ************* */
27#define TRAP_WATCHPT (__SI_FAULT|3) /* watchpoint match ************* */
28#define TRAP_ILLTRAP (__SI_FAULT|4) /* illegal trap ************* */
29
30/*
31 * SIGSEGV si_codes
32 */
33#define SEGV_STACKFLOW (__SI_FAULT|3) /* stack overflow */
34
35#endif
diff --git a/include/asm-blackfin/signal.h b/include/asm-blackfin/signal.h
new file mode 100644
index 000000000000..0250429b736a
--- /dev/null
+++ b/include/asm-blackfin/signal.h
@@ -0,0 +1,160 @@
1#ifndef _BLACKFIN_SIGNAL_H
2#define _BLACKFIN_SIGNAL_H
3
4#include <linux/types.h>
5
6/* Avoid too many header ordering problems. */
7struct siginfo;
8
9#ifdef __KERNEL__
10/* Most things should be clean enough to redefine this at will, if care
11 is taken to make libc match. */
12
13#define _NSIG 64
14#define _NSIG_BPW 32
15#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
16
17typedef unsigned long old_sigset_t; /* at least 32 bits */
18
19typedef struct {
20 unsigned long sig[_NSIG_WORDS];
21} sigset_t;
22
23#else
24/* Here we must cater to libcs that poke about in kernel headers. */
25
26#define NSIG 32
27typedef unsigned long sigset_t;
28
29#endif /* __KERNEL__ */
30
31#define SIGHUP 1
32#define SIGINT 2
33#define SIGQUIT 3
34#define SIGILL 4
35#define SIGTRAP 5
36#define SIGABRT 6
37#define SIGIOT 6
38#define SIGBUS 7
39#define SIGFPE 8
40#define SIGKILL 9
41#define SIGUSR1 10
42#define SIGSEGV 11
43#define SIGUSR2 12
44#define SIGPIPE 13
45#define SIGALRM 14
46#define SIGTERM 15
47#define SIGSTKFLT 16
48#define SIGCHLD 17
49#define SIGCONT 18
50#define SIGSTOP 19
51#define SIGTSTP 20
52#define SIGTTIN 21
53#define SIGTTOU 22
54#define SIGURG 23
55#define SIGXCPU 24
56#define SIGXFSZ 25
57#define SIGVTALRM 26
58#define SIGPROF 27
59#define SIGWINCH 28
60#define SIGIO 29
61#define SIGPOLL SIGIO
62/*
63#define SIGLOST 29
64*/
65#define SIGPWR 30
66#define SIGSYS 31
67#define SIGUNUSED 31
68
69/* These should not be considered constants from userland. */
70#define SIGRTMIN 32
71#define SIGRTMAX _NSIG
72
73/*
74 * SA_FLAGS values:
75 *
76 * SA_ONSTACK indicates that a registered stack_t will be used.
77 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
78 * SA_RESTART flag to get restarting signals (which were the default long ago)
79 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
80 * SA_RESETHAND clears the handler when the signal is delivered.
81 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
82 * SA_NODEFER prevents the current signal from being masked in the handler.
83 *
84 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
85 * Unix names RESETHAND and NODEFER respectively.
86 */
87#define SA_NOCLDSTOP 0x00000001
88#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
89#define SA_SIGINFO 0x00000004
90#define SA_ONSTACK 0x08000000
91#define SA_RESTART 0x10000000
92#define SA_NODEFER 0x40000000
93#define SA_RESETHAND 0x80000000
94
95#define SA_NOMASK SA_NODEFER
96#define SA_ONESHOT SA_RESETHAND
97
98/*
99 * sigaltstack controls
100 */
101#define SS_ONSTACK 1
102#define SS_DISABLE 2
103
104#define MINSIGSTKSZ 2048
105#define SIGSTKSZ 8192
106
107#include <asm-generic/signal.h>
108
109#ifdef __KERNEL__
110struct old_sigaction {
111 __sighandler_t sa_handler;
112 old_sigset_t sa_mask;
113 unsigned long sa_flags;
114 void (*sa_restorer) (void);
115};
116
117struct sigaction {
118 __sighandler_t sa_handler;
119 unsigned long sa_flags;
120 void (*sa_restorer) (void);
121 sigset_t sa_mask; /* mask last for extensibility */
122};
123
124struct k_sigaction {
125 struct sigaction sa;
126};
127#else
128/* Here we must cater to libcs that poke about in kernel headers. */
129
130struct sigaction {
131 union {
132 __sighandler_t _sa_handler;
133 void (*_sa_sigaction) (int, struct siginfo *, void *);
134 } _u;
135 sigset_t sa_mask;
136 unsigned long sa_flags;
137 void (*sa_restorer) (void);
138};
139
140#define sa_handler _u._sa_handler
141#define sa_sigaction _u._sa_sigaction
142
143#endif /* __KERNEL__ */
144
145typedef struct sigaltstack {
146 void *ss_sp;
147 int ss_flags;
148 size_t ss_size;
149} stack_t;
150
151#ifdef __KERNEL__
152
153#include <asm/sigcontext.h>
154#undef __HAVE_ARCH_SIG_BITOPS
155
156#define ptrace_signal_deliver(regs, cookie) do { } while (0)
157
158#endif /* __KERNEL__ */
159
160#endif /* _BLACKFIN_SIGNAL_H */
diff --git a/include/asm-blackfin/socket.h b/include/asm-blackfin/socket.h
new file mode 100644
index 000000000000..5213c9652186
--- /dev/null
+++ b/include/asm-blackfin/socket.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_SOCKET_H
2#define _ASM_SOCKET_H
3
4#include <asm/sockios.h>
5
6/* For setsockoptions(2) */
7#define SOL_SOCKET 1
8
9#define SO_DEBUG 1
10#define SO_REUSEADDR 2
11#define SO_TYPE 3
12#define SO_ERROR 4
13#define SO_DONTROUTE 5
14#define SO_BROADCAST 6
15#define SO_SNDBUF 7
16#define SO_RCVBUF 8
17#define SO_SNDBUFFORCE 32
18#define SO_RCVBUFFORCE 33
19#define SO_KEEPALIVE 9
20#define SO_OOBINLINE 10
21#define SO_NO_CHECK 11
22#define SO_PRIORITY 12
23#define SO_LINGER 13
24#define SO_BSDCOMPAT 14
25/* To add :#define SO_REUSEPORT 15 */
26#define SO_PASSCRED 16
27#define SO_PEERCRED 17
28#define SO_RCVLOWAT 18
29#define SO_SNDLOWAT 19
30#define SO_RCVTIMEO 20
31#define SO_SNDTIMEO 21
32
33/* Security levels - as per NRL IPv6 - don't actually do anything */
34#define SO_SECURITY_AUTHENTICATION 22
35#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
36#define SO_SECURITY_ENCRYPTION_NETWORK 24
37
38#define SO_BINDTODEVICE 25
39
40/* Socket filtering */
41#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 27
43
44#define SO_PEERNAME 28
45#define SO_TIMESTAMP 29
46#define SCM_TIMESTAMP SO_TIMESTAMP
47
48#define SO_ACCEPTCONN 30
49#define SO_PEERSEC 31
50#define SO_PASSSEC 34
51#define SO_TIMESTAMPNS 35
52#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
53#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-blackfin/sockios.h b/include/asm-blackfin/sockios.h
new file mode 100644
index 000000000000..426b89bfaa8b
--- /dev/null
+++ b/include/asm-blackfin/sockios.h
@@ -0,0 +1,13 @@
1#ifndef __ARCH_BFIN_SOCKIOS__
2#define __ARCH_BFIN_SOCKIOS__
3
4/* Socket-level I/O control calls. */
5#define FIOSETOWN 0x8901
6#define SIOCSPGRP 0x8902
7#define FIOGETOWN 0x8903
8#define SIOCGPGRP 0x8904
9#define SIOCATMARK 0x8905
10#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
11#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
12
13#endif /* __ARCH_BFIN_SOCKIOS__ */
diff --git a/include/asm-blackfin/spinlock.h b/include/asm-blackfin/spinlock.h
new file mode 100644
index 000000000000..64e908a50646
--- /dev/null
+++ b/include/asm-blackfin/spinlock.h
@@ -0,0 +1,6 @@
1#ifndef __BFIN_SPINLOCK_H
2#define __BFIN_SPINLOCK_H
3
4#error blackfin architecture does not support SMP spin lock yet
5
6#endif
diff --git a/include/asm-blackfin/stat.h b/include/asm-blackfin/stat.h
new file mode 100644
index 000000000000..d2b6f11ec231
--- /dev/null
+++ b/include/asm-blackfin/stat.h
@@ -0,0 +1,63 @@
1#ifndef _BFIN_STAT_H
2#define _BFIN_STAT_H
3
4struct stat {
5 unsigned short st_dev;
6 unsigned short __pad1;
7 unsigned long st_ino;
8 unsigned short st_mode;
9 unsigned short st_nlink;
10 unsigned short st_uid;
11 unsigned short st_gid;
12 unsigned short st_rdev;
13 unsigned short __pad2;
14 unsigned long st_size;
15 unsigned long st_blksize;
16 unsigned long st_blocks;
17 unsigned long st_atime;
18 unsigned long __unused1;
19 unsigned long st_mtime;
20 unsigned long __unused2;
21 unsigned long st_ctime;
22 unsigned long __unused3;
23 unsigned long __unused4;
24 unsigned long __unused5;
25};
26
27/* This matches struct stat64 in glibc2.1, hence the absolutely
28 * insane amounts of padding around dev_t's.
29 */
30struct stat64 {
31 unsigned long long st_dev;
32 unsigned char __pad1[4];
33
34#define STAT64_HAS_BROKEN_ST_INO 1
35 unsigned long __st_ino;
36
37 unsigned int st_mode;
38 unsigned int st_nlink;
39
40 unsigned long st_uid;
41 unsigned long st_gid;
42
43 unsigned long long st_rdev;
44 unsigned char __pad2[4];
45
46 long long st_size;
47 unsigned long st_blksize;
48
49 long long st_blocks; /* Number 512-byte blocks allocated. */
50
51 unsigned long st_atime;
52 unsigned long st_atime_nsec;
53
54 unsigned long st_mtime;
55 unsigned long st_mtime_nsec;
56
57 unsigned long st_ctime;
58 unsigned long st_ctime_nsec;
59
60 unsigned long long st_ino;
61};
62
63#endif /* _BFIN_STAT_H */
diff --git a/include/asm-blackfin/statfs.h b/include/asm-blackfin/statfs.h
new file mode 100644
index 000000000000..350672091ba3
--- /dev/null
+++ b/include/asm-blackfin/statfs.h
@@ -0,0 +1,6 @@
1#ifndef _BFIN_STATFS_H
2#define _BFIN_STATFS_H
3
4#include <asm-generic/statfs.h>
5
6#endif /* _BFIN_STATFS_H */
diff --git a/include/asm-blackfin/string.h b/include/asm-blackfin/string.h
new file mode 100644
index 000000000000..6f1eb7d6d3cb
--- /dev/null
+++ b/include/asm-blackfin/string.h
@@ -0,0 +1,104 @@
1#ifndef _BLACKFIN_STRING_H_
2#define _BLACKFIN_STRING_H_
3
4#ifdef __KERNEL__ /* only set these up for kernel code */
5
6#define __HAVE_ARCH_STRCPY
7extern inline char *strcpy(char *dest, const char *src)
8{
9 char *xdest = dest;
10 char temp = 0;
11
12 __asm__ __volatile__
13 ("1:\t%2 = B [%1++] (Z);\n\t"
14 "B [%0++] = %2;\n\t"
15 "CC = %2;\n\t"
16 "if cc jump 1b (bp);\n"
17 : "+&a" (dest), "+&a" (src), "=&d" (temp)
18 ::"memory", "CC");
19 return xdest;
20}
21
22#define __HAVE_ARCH_STRNCPY
23extern inline char *strncpy(char *dest, const char *src, size_t n)
24{
25 char *xdest = dest;
26 char temp = 0;
27
28 if (n == 0)
29 return xdest;
30
31 __asm__ __volatile__
32 ("1:\t%3 = B [%1++] (Z);\n\t"
33 "B [%0++] = %3;\n\t"
34 "CC = %3;\n\t"
35 "if ! cc jump 2f;\n\t"
36 "%2 += -1;\n\t"
37 "CC = %2 == 0;\n\t"
38 "if ! cc jump 1b (bp);\n"
39 "2:\n"
40 : "+&a" (dest), "+&a" (src), "+&da" (n), "=&d" (temp)
41 ::"memory", "CC");
42 return xdest;
43}
44
45#define __HAVE_ARCH_STRCMP
46extern inline int strcmp(const char *cs, const char *ct)
47{
48 char __res1, __res2;
49
50 __asm__
51 ("1:\t%2 = B[%0++] (Z);\n\t" /* get *cs */
52 "%3 = B[%1++] (Z);\n\t" /* get *ct */
53 "CC = %2 == %3;\n\t" /* compare a byte */
54 "if ! cc jump 2f;\n\t" /* not equal, break out */
55 "CC = %2;\n\t" /* at end of cs? */
56 "if cc jump 1b (bp);\n\t" /* no, keep going */
57 "jump.s 3f;\n" /* strings are equal */
58 "2:\t%2 = %2 - %3;\n" /* *cs - *ct */
59 "3:\n"
60 : "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2)
61 : : "CC");
62
63 return __res1;
64}
65
66#define __HAVE_ARCH_STRNCMP
67extern inline int strncmp(const char *cs, const char *ct, size_t count)
68{
69 char __res1, __res2;
70
71 if (!count)
72 return 0;
73 __asm__
74 ("1:\t%3 = B[%0++] (Z);\n\t" /* get *cs */
75 "%4 = B[%1++] (Z);\n\t" /* get *ct */
76 "CC = %3 == %4;\n\t" /* compare a byte */
77 "if ! cc jump 3f;\n\t" /* not equal, break out */
78 "CC = %3;\n\t" /* at end of cs? */
79 "if ! cc jump 4f;\n\t" /* yes, all done */
80 "%2 += -1;\n\t" /* no, adjust count */
81 "CC = %2 == 0;\n\t"
82 "if ! cc jump 1b;\n" /* more to do, keep going */
83 "2:\t%3 = 0;\n\t" /* strings are equal */
84 "jump.s 4f;\n"
85 "3:\t%3 = %3 - %4;\n" /* *cs - *ct */
86 "4:"
87 : "+&a" (cs), "+&a" (ct), "+&da" (count), "=&d" (__res1), "=&d" (__res2)
88 : : "CC");
89 return __res1;
90}
91
92#define __HAVE_ARCH_MEMSET
93extern void *memset(void *s, int c, size_t count);
94#define __HAVE_ARCH_MEMCPY
95extern void *memcpy(void *d, const void *s, size_t count);
96#define __HAVE_ARCH_MEMCMP
97extern int memcmp(const void *, const void *, __kernel_size_t);
98#define __HAVE_ARCH_MEMCHR
99extern void *memchr(const void *s, int c, size_t n);
100#define __HAVE_ARCH_MEMMOVE
101extern void *memmove(void *dest, const void *src, size_t count);
102
103#endif /*__KERNEL__*/
104#endif /* _BLACKFIN_STRING_H_ */
diff --git a/include/asm-blackfin/system.h b/include/asm-blackfin/system.h
new file mode 100644
index 000000000000..b5bf6e7cb5e8
--- /dev/null
+++ b/include/asm-blackfin/system.h
@@ -0,0 +1,249 @@
1/*
2 * File: include/asm/system.h
3 * Based on:
4 * Author: Tony Kou (tonyko@lineo.ca)
5 * Copyright (c) 2002 Arcturus Networks Inc.
6 * (www.arcturusnetworks.com)
7 * Copyright (c) 2003 Metrowerks (www.metrowerks.com)
8 * Copyright (c) 2004 Analog Device Inc.
9 * Created: 25Jan2001 - Tony Kou
10 * Description: system.h include file
11 *
12 * Modified: 22Sep2006 - Robin Getz
13 * - move include blackfin.h down, so I can get access to
14 * irq functions in other include files.
15 *
16 * Bugs: Enter bugs at http://blackfin.uclinux.org/
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2, or (at your option)
21 * any later version.
22 *
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with this program; see the file COPYING.
30 * If not, write to the Free Software Foundation,
31 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 */
33
34#ifndef _BLACKFIN_SYSTEM_H
35#define _BLACKFIN_SYSTEM_H
36
37#include <linux/linkage.h>
38#include <linux/compiler.h>
39
40/*
41 * Interrupt configuring macros.
42 */
43
44extern unsigned long irq_flags;
45
46#define local_irq_enable() do { \
47 __asm__ __volatile__ ( \
48 "sti %0;" \
49 ::"d"(irq_flags)); \
50} while (0)
51
52#define local_irq_disable() do { \
53 int _tmp_dummy; \
54 __asm__ __volatile__ ( \
55 "cli %0;" \
56 :"=d" (_tmp_dummy):); \
57} while (0)
58
59#if defined(ANOMALY_05000244) && defined (CONFIG_BLKFIN_CACHE)
60#define idle_with_irq_disabled() do { \
61 __asm__ __volatile__ ( \
62 "nop; nop;\n" \
63 ".align 8;\n" \
64 "sti %0; idle;\n" \
65 ::"d" (irq_flags)); \
66} while (0)
67#else
68#define idle_with_irq_disabled() do { \
69 __asm__ __volatile__ ( \
70 ".align 8;\n" \
71 "sti %0; idle;\n" \
72 ::"d" (irq_flags)); \
73} while (0)
74#endif
75
76#ifdef CONFIG_DEBUG_HWERR
77#define __save_and_cli(x) do { \
78 __asm__ __volatile__ ( \
79 "cli %0;\n\tsti %1;" \
80 :"=&d"(x): "d" (0x3F)); \
81} while (0)
82#else
83#define __save_and_cli(x) do { \
84 __asm__ __volatile__ ( \
85 "cli %0;" \
86 :"=&d"(x):); \
87} while (0)
88#endif
89
90#define local_save_flags(x) asm volatile ("cli %0;" \
91 "sti %0;" \
92 :"=d"(x):);
93
94#ifdef CONFIG_DEBUG_HWERR
95#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0)
96#else
97#define irqs_enabled_from_flags(x) ((x) != 0x1f)
98#endif
99
100#define local_irq_restore(x) do { \
101 if (irqs_enabled_from_flags(x)) \
102 local_irq_enable (); \
103} while (0)
104
105/* For spinlocks etc */
106#define local_irq_save(x) __save_and_cli(x)
107
108#define irqs_disabled() \
109({ \
110 unsigned long flags; \
111 local_save_flags(flags); \
112 !irqs_enabled_from_flags(flags); \
113})
114
115/*
116 * Force strict CPU ordering.
117 */
118#define nop() asm volatile ("nop;\n\t"::)
119#define mb() asm volatile ("" : : :"memory")
120#define rmb() asm volatile ("" : : :"memory")
121#define wmb() asm volatile ("" : : :"memory")
122#define set_rmb(var, value) do { (void) xchg(&var, value); } while (0)
123#define set_mb(var, value) set_rmb(var, value)
124#define set_wmb(var, value) do { var = value; wmb(); } while (0)
125
126#define read_barrier_depends() do { } while(0)
127
128#ifdef CONFIG_SMP
129#define smp_mb() mb()
130#define smp_rmb() rmb()
131#define smp_wmb() wmb()
132#define smp_read_barrier_depends() read_barrier_depends()
133#else
134#define smp_mb() barrier()
135#define smp_rmb() barrier()
136#define smp_wmb() barrier()
137#define smp_read_barrier_depends() do { } while(0)
138#endif
139
140#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
141
142struct __xchg_dummy {
143 unsigned long a[100];
144};
145#define __xg(x) ((volatile struct __xchg_dummy *)(x))
146
147static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
148 int size)
149{
150 unsigned long tmp = 0;
151 unsigned long flags = 0;
152
153 local_irq_save(flags);
154
155 switch (size) {
156 case 1:
157 __asm__ __volatile__
158 ("%0 = b%2 (z);\n\t"
159 "b%2 = %1;\n\t"
160 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
161 break;
162 case 2:
163 __asm__ __volatile__
164 ("%0 = w%2 (z);\n\t"
165 "w%2 = %1;\n\t"
166 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
167 break;
168 case 4:
169 __asm__ __volatile__
170 ("%0 = %2;\n\t"
171 "%2 = %1;\n\t"
172 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
173 break;
174 }
175 local_irq_restore(flags);
176 return tmp;
177}
178
179/*
180 * Atomic compare and exchange. Compare OLD with MEM, if identical,
181 * store NEW in MEM. Return the initial value in MEM. Success is
182 * indicated by comparing RETURN with OLD.
183 */
184static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
185 unsigned long new, int size)
186{
187 unsigned long tmp = 0;
188 unsigned long flags = 0;
189
190 local_irq_save(flags);
191
192 switch (size) {
193 case 1:
194 __asm__ __volatile__
195 ("%0 = b%3 (z);\n\t"
196 "CC = %1 == %0;\n\t"
197 "IF !CC JUMP 1f;\n\t"
198 "b%3 = %2;\n\t"
199 "1:\n\t"
200 : "=&d" (tmp) : "d" (old), "d" (new), "m" (*__xg(ptr)) : "memory");
201 break;
202 case 2:
203 __asm__ __volatile__
204 ("%0 = w%3 (z);\n\t"
205 "CC = %1 == %0;\n\t"
206 "IF !CC JUMP 1f;\n\t"
207 "w%3 = %2;\n\t"
208 "1:\n\t"
209 : "=&d" (tmp) : "d" (old), "d" (new), "m" (*__xg(ptr)) : "memory");
210 break;
211 case 4:
212 __asm__ __volatile__
213 ("%0 = %3;\n\t"
214 "CC = %1 == %0;\n\t"
215 "IF !CC JUMP 1f;\n\t"
216 "%3 = %2;\n\t"
217 "1:\n\t"
218 : "=&d" (tmp) : "d" (old), "d" (new), "m" (*__xg(ptr)) : "memory");
219 break;
220 }
221 local_irq_restore(flags);
222 return tmp;
223}
224
225#define cmpxchg(ptr,o,n)\
226 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
227 (unsigned long)(n),sizeof(*(ptr))))
228
229#define prepare_to_switch() do { } while(0)
230
231/*
232 * switch_to(n) should switch tasks to task ptr, first checking that
233 * ptr isn't the current task, in which case it does nothing.
234 */
235
236#include <asm/blackfin.h>
237
238asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next);
239
240#define switch_to(prev,next,last) \
241do { \
242 memcpy (&prev->thread_info->l1_task_info, L1_SCRATCH_TASK_INFO, \
243 sizeof *L1_SCRATCH_TASK_INFO); \
244 memcpy (L1_SCRATCH_TASK_INFO, &next->thread_info->l1_task_info, \
245 sizeof *L1_SCRATCH_TASK_INFO); \
246 (last) = resume (prev, next); \
247} while (0)
248
249#endif /* _BLACKFIN_SYSTEM_H */
diff --git a/include/asm-blackfin/termbits.h b/include/asm-blackfin/termbits.h
new file mode 100644
index 000000000000..2fd9dabdba77
--- /dev/null
+++ b/include/asm-blackfin/termbits.h
@@ -0,0 +1,184 @@
1#ifndef __ARCH_BFIN_TERMBITS_H__
2#define __ARCH_BFIN_TERMBITS_H__
3
4#include <linux/posix_types.h>
5
6typedef unsigned char cc_t;
7typedef unsigned int speed_t;
8typedef unsigned int tcflag_t;
9
10#define NCCS 19
11struct termios {
12 tcflag_t c_iflag; /* input mode flags */
13 tcflag_t c_oflag; /* output mode flags */
14 tcflag_t c_cflag; /* control mode flags */
15 tcflag_t c_lflag; /* local mode flags */
16 cc_t c_line; /* line discipline */
17 cc_t c_cc[NCCS]; /* control characters */
18};
19
20struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
31/* c_cc characters */
32#define VINTR 0
33#define VQUIT 1
34#define VERASE 2
35#define VKILL 3
36#define VEOF 4
37#define VTIME 5
38#define VMIN 6
39#define VSWTC 7
40#define VSTART 8
41#define VSTOP 9
42#define VSUSP 10
43#define VEOL 11
44#define VREPRINT 12
45#define VDISCARD 13
46#define VWERASE 14
47#define VLNEXT 15
48#define VEOL2 16
49
50/* c_iflag bits */
51#define IGNBRK 0000001
52#define BRKINT 0000002
53#define IGNPAR 0000004
54#define PARMRK 0000010
55#define INPCK 0000020
56#define ISTRIP 0000040
57#define INLCR 0000100
58#define IGNCR 0000200
59#define ICRNL 0000400
60#define IUCLC 0001000
61#define IXON 0002000
62#define IXANY 0004000
63#define IXOFF 0010000
64#define IMAXBEL 0020000
65#define IUTF8 0040000
66
67/* c_oflag bits */
68#define OPOST 0000001
69#define OLCUC 0000002
70#define ONLCR 0000004
71#define OCRNL 0000010
72#define ONOCR 0000020
73#define ONLRET 0000040
74#define OFILL 0000100
75#define OFDEL 0000200
76#define NLDLY 0000400
77#define NL0 0000000
78#define NL1 0000400
79#define CRDLY 0003000
80#define CR0 0000000
81#define CR1 0001000
82#define CR2 0002000
83#define CR3 0003000
84#define TABDLY 0014000
85#define TAB0 0000000
86#define TAB1 0004000
87#define TAB2 0010000
88#define TAB3 0014000
89#define XTABS 0014000
90#define BSDLY 0020000
91#define BS0 0000000
92#define BS1 0020000
93#define VTDLY 0040000
94#define VT0 0000000
95#define VT1 0040000
96#define FFDLY 0100000
97#define FF0 0000000
98#define FF1 0100000
99
100/* c_cflag bit meaning */
101#define CBAUD 0010017
102#define B0 0000000 /* hang up */
103#define B50 0000001
104#define B75 0000002
105#define B110 0000003
106#define B134 0000004
107#define B150 0000005
108#define B200 0000006
109#define B300 0000007
110#define B600 0000010
111#define B1200 0000011
112#define B1800 0000012
113#define B2400 0000013
114#define B4800 0000014
115#define B9600 0000015
116#define B19200 0000016
117#define B38400 0000017
118#define EXTA B19200
119#define EXTB B38400
120#define CSIZE 0000060
121#define CS5 0000000
122#define CS6 0000020
123#define CS7 0000040
124#define CS8 0000060
125#define CSTOPB 0000100
126#define CREAD 0000200
127#define PARENB 0000400
128#define PARODD 0001000
129#define HUPCL 0002000
130#define CLOCAL 0004000
131#define CBAUDEX 0010000
132#define B57600 0010001
133#define B115200 0010002
134#define B230400 0010003
135#define B460800 0010004
136#define B500000 0010005
137#define B576000 0010006
138#define B921600 0010007
139#define B1000000 0010010
140#define B1152000 0010011
141#define B1500000 0010012
142#define B2000000 0010013
143#define B2500000 0010014
144#define B3000000 0010015
145#define B3500000 0010016
146#define B4000000 0010017
147#define CIBAUD 002003600000 /* input baud rate (not used) */
148#define CMSPAR 010000000000 /* mark or space (stick) parity */
149#define CRTSCTS 020000000000 /* flow control */
150
151/* c_lflag bits */
152#define ISIG 0000001
153#define ICANON 0000002
154#define XCASE 0000004
155#define ECHO 0000010
156#define ECHOE 0000020
157#define ECHOK 0000040
158#define ECHONL 0000100
159#define NOFLSH 0000200
160#define TOSTOP 0000400
161#define ECHOCTL 0001000
162#define ECHOPRT 0002000
163#define ECHOKE 0004000
164#define FLUSHO 0010000
165#define PENDIN 0040000
166#define IEXTEN 0100000
167
168/* tcflow() and TCXONC use these */
169#define TCOOFF 0
170#define TCOON 1
171#define TCIOFF 2
172#define TCION 3
173
174/* tcflush() and TCFLSH use these */
175#define TCIFLUSH 0
176#define TCOFLUSH 1
177#define TCIOFLUSH 2
178
179/* tcsetattr uses these */
180#define TCSANOW 0
181#define TCSADRAIN 1
182#define TCSAFLUSH 2
183
184#endif /* __ARCH_BFIN_TERMBITS_H__ */
diff --git a/include/asm-blackfin/termios.h b/include/asm-blackfin/termios.h
new file mode 100644
index 000000000000..5c41478a51c6
--- /dev/null
+++ b/include/asm-blackfin/termios.h
@@ -0,0 +1,106 @@
1#ifndef __BFIN_TERMIOS_H__
2#define __BFIN_TERMIOS_H__
3
4#include <asm/termbits.h>
5#include <asm/ioctls.h>
6
7struct winsize {
8 unsigned short ws_row;
9 unsigned short ws_col;
10 unsigned short ws_xpixel;
11 unsigned short ws_ypixel;
12};
13
14#define NCC 8
15struct termio {
16 unsigned short c_iflag; /* input mode flags */
17 unsigned short c_oflag; /* output mode flags */
18 unsigned short c_cflag; /* control mode flags */
19 unsigned short c_lflag; /* local mode flags */
20 unsigned char c_line; /* line discipline */
21 unsigned char c_cc[NCC]; /* control characters */
22};
23
24/* modem lines */
25#define TIOCM_LE 0x001
26#define TIOCM_DTR 0x002
27#define TIOCM_RTS 0x004
28#define TIOCM_ST 0x008
29#define TIOCM_SR 0x010
30#define TIOCM_CTS 0x020
31#define TIOCM_CAR 0x040
32#define TIOCM_RNG 0x080
33#define TIOCM_DSR 0x100
34#define TIOCM_CD TIOCM_CAR
35#define TIOCM_RI TIOCM_RNG
36#define TIOCM_OUT1 0x2000
37#define TIOCM_OUT2 0x4000
38#define TIOCM_LOOP 0x8000
39
40/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
41
42/* line disciplines */
43#define N_TTY 0
44#define N_SLIP 1
45#define N_MOUSE 2
46#define N_PPP 3
47#define N_STRIP 4
48#define N_AX25 5
49#define N_X25 6 /* X.25 async */
50#define N_6PACK 7
51#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
52#define N_R3964 9 /* Reserved for Simatic R3964 module */
53#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
54#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
55#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
56#define N_HDLC 13 /* synchronous HDLC */
57#define N_SYNC_PPP 14 /* synchronous PPP */
58#define N_HCI 15 /* Bluetooth HCI UART */
59
60#ifdef __KERNEL__
61
62/* intr=^C quit=^\ erase=del kill=^U
63 eof=^D vtime=\0 vmin=\1 sxtc=\0
64 start=^Q stop=^S susp=^Z eol=\0
65 reprint=^R discard=^U werase=^W lnext=^V
66 eol2=\0
67*/
68#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
69
70/*
71 * Translate a "termio" structure into a "termios". Ugh.
72 */
73#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
74 unsigned short __tmp; \
75 get_user(__tmp,&(termio)->x); \
76 *(unsigned short *) &(termios)->x = __tmp; \
77}
78
79#define user_termio_to_kernel_termios(termios, termio) \
80({ \
81 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
82 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
83 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
84 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
85 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
86})
87
88/*
89 * Translate a "termios" structure into a "termio". Ugh.
90 */
91#define kernel_termios_to_user_termio(termio, termios) \
92({ \
93 put_user((termios)->c_iflag, &(termio)->c_iflag); \
94 put_user((termios)->c_oflag, &(termio)->c_oflag); \
95 put_user((termios)->c_cflag, &(termio)->c_cflag); \
96 put_user((termios)->c_lflag, &(termio)->c_lflag); \
97 put_user((termios)->c_line, &(termio)->c_line); \
98 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
99})
100
101#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
102#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
103
104#endif /* __KERNEL__ */
105
106#endif /* __BFIN_TERMIOS_H__ */
diff --git a/include/asm-blackfin/thread_info.h b/include/asm-blackfin/thread_info.h
new file mode 100644
index 000000000000..fa8f08cf283e
--- /dev/null
+++ b/include/asm-blackfin/thread_info.h
@@ -0,0 +1,143 @@
1/*
2 * File: include/asm-blackfin/thread_info.h
3 * Based on: include/asm-m68knommu/thread_info.h
4 * Author: LG Soft India
5 * Copyright (C) 2004-2005 Analog Devices Inc.
6 * Created: Tue Sep 21 2004
7 * Description: Blackfin low-level thread information
8 * Modified:
9 * Bugs: Enter bugs at http://blackfin.uclinux.org/
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2, or (at your option)
14 * any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; see the file COPYING.
23 * If not, write to the Free Software Foundation,
24 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 */
26
27#ifndef _ASM_THREAD_INFO_H
28#define _ASM_THREAD_INFO_H
29
30#include <asm/page.h>
31#include <asm/entry.h>
32#include <asm/l1layout.h>
33#include <linux/compiler.h>
34
35#ifdef __KERNEL__
36
37/* Thread Align Mask to reach to the top of the stack
38 * for any process
39 */
40#define ALIGN_PAGE_MASK 0xffffe000
41
42#ifndef __ASSEMBLY__
43
44typedef unsigned long mm_segment_t;
45
46/*
47 * low level task data.
48 * If you change this, change the TI_* offsets below to match.
49 */
50
51struct thread_info {
52 struct task_struct *task; /* main task structure */
53 struct exec_domain *exec_domain; /* execution domain */
54 unsigned long flags; /* low level flags */
55 int cpu; /* cpu we're on */
56 int preempt_count; /* 0 => preemptable, <0 => BUG */
57 mm_segment_t addr_limit; /* address limit */
58 struct restart_block restart_block;
59 struct l1_scratch_task_info l1_task_info;
60};
61
62/*
63 * macros/functions for gaining access to the thread information structure
64 */
65#define INIT_THREAD_INFO(tsk) \
66{ \
67 .task = &tsk, \
68 .exec_domain = &default_exec_domain, \
69 .flags = 0, \
70 .cpu = 0, \
71 .preempt_count = 1, \
72 .restart_block = { \
73 .fn = do_no_restart_syscall, \
74 }, \
75}
76#define init_thread_info (init_thread_union.thread_info)
77#define init_stack (init_thread_union.stack)
78
79/*
80 * Size of kernel stack for each process. This must be a power of 2...
81 */
82#define THREAD_SIZE 8192 /* 2 pages */
83
84/* How to get the thread information struct from C */
85
86static inline struct thread_info *current_thread_info(void)
87 __attribute__ ((__const__));
88
89/* Given a task stack pointer, you can find it's task structure
90 * just by masking it to the 8K boundary.
91 */
92static inline struct thread_info *current_thread_info(void)
93{
94 struct thread_info *ti;
95 __asm__("%0 = sp;": "=&d"(ti):
96 );
97 return (struct thread_info *)((long)ti & ~8191UL);
98}
99
100/* thread information allocation */
101#define alloc_thread_info(tsk) ((struct thread_info *) \
102 __get_free_pages(GFP_KERNEL, 1))
103#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
104#endif /* __ASSEMBLY__ */
105
106/*
107 * Offsets in thread_info structure, used in assembly code
108 */
109#define TI_TASK 0
110#define TI_EXECDOMAIN 4
111#define TI_FLAGS 8
112#define TI_CPU 12
113#define TI_PREEMPT 16
114
115#define PREEMPT_ACTIVE 0x4000000
116
117/*
118 * thread information flag bit numbers
119 */
120#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
121#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
122#define TIF_SIGPENDING 2 /* signal pending */
123#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
124#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
125 TIF_NEED_RESCHED */
126#define TIF_MEMDIE 5
127#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
128#define TIF_FREEZE 7 /* is freezing for suspend */
129
130/* as above, but as bit values */
131#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
132#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
133#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
134#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
135#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
136#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
137#define _TIF_FREEZE (1<<TIF_FREEZE)
138
139#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
140
141#endif /* __KERNEL__ */
142
143#endif /* _ASM_THREAD_INFO_H */
diff --git a/include/asm-blackfin/timex.h b/include/asm-blackfin/timex.h
new file mode 100644
index 000000000000..828590117f51
--- /dev/null
+++ b/include/asm-blackfin/timex.h
@@ -0,0 +1,18 @@
1/* blackfin architecture timex specifications: Lineo Inc. 2001
2 *
3 * Based on: include/asm-m68knommu/timex.h
4 */
5
6#ifndef _ASMBLACKFIN_TIMEX_H
7#define _ASMBLACKFIN_TIMEX_H
8
9#define CLOCK_TICK_RATE 1000000 /* Underlying HZ */
10
11typedef unsigned long cycles_t;
12
13static inline cycles_t get_cycles(void)
14{
15 return 0;
16}
17
18#endif
diff --git a/include/asm-blackfin/tlb.h b/include/asm-blackfin/tlb.h
new file mode 100644
index 000000000000..89a12ee916d8
--- /dev/null
+++ b/include/asm-blackfin/tlb.h
@@ -0,0 +1,16 @@
1#ifndef _BLACKFIN_TLB_H
2#define _BLACKFIN_TLB_H
3
4#define tlb_start_vma(tlb, vma) do { } while (0)
5#define tlb_end_vma(tlb, vma) do { } while (0)
6#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
7
8/*
9 * .. because we flush the whole mm when it
10 * fills up.
11 */
12#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
13
14#include <asm-generic/tlb.h>
15
16#endif /* _BLACKFIN_TLB_H */
diff --git a/include/asm-blackfin/tlbflush.h b/include/asm-blackfin/tlbflush.h
new file mode 100644
index 000000000000..10a07ba1e011
--- /dev/null
+++ b/include/asm-blackfin/tlbflush.h
@@ -0,0 +1,62 @@
1#ifndef _BLACKFIN_TLBFLUSH_H
2#define _BLACKFIN_TLBFLUSH_H
3
4/*
5 * Copyright (C) 2000 Lineo, David McCullough <davidm@uclinux.org>
6 * Copyright (C) 2000-2002, Greg Ungerer <gerg@snapgear.com>
7 */
8
9#include <asm/setup.h>
10
11/*
12 * flush all user-space atc entries.
13 */
14static inline void __flush_tlb(void)
15{
16 BUG();
17}
18
19static inline void __flush_tlb_one(unsigned long addr)
20{
21 BUG();
22}
23
24#define flush_tlb() __flush_tlb()
25
26/*
27 * flush all atc entries (both kernel and user-space entries).
28 */
29static inline void flush_tlb_all(void)
30{
31 BUG();
32}
33
34static inline void flush_tlb_mm(struct mm_struct *mm)
35{
36 BUG();
37}
38
39static inline void flush_tlb_page(struct vm_area_struct *vma,
40 unsigned long addr)
41{
42 BUG();
43}
44
45static inline void flush_tlb_range(struct mm_struct *mm,
46 unsigned long start, unsigned long end)
47{
48 BUG();
49}
50
51static inline void flush_tlb_kernel_page(unsigned long addr)
52{
53 BUG();
54}
55
56static inline void flush_tlb_pgtables(struct mm_struct *mm,
57 unsigned long start, unsigned long end)
58{
59 BUG();
60}
61
62#endif
diff --git a/include/asm-blackfin/topology.h b/include/asm-blackfin/topology.h
new file mode 100644
index 000000000000..acee23987897
--- /dev/null
+++ b/include/asm-blackfin/topology.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_BLACKFIN_TOPOLOGY_H
2#define _ASM_BLACKFIN_TOPOLOGY_H
3
4#include <asm-generic/topology.h>
5
6#endif /* _ASM_BLACKFIN_TOPOLOGY_H */
diff --git a/include/asm-blackfin/traps.h b/include/asm-blackfin/traps.h
new file mode 100644
index 000000000000..fe365b1b7ca8
--- /dev/null
+++ b/include/asm-blackfin/traps.h
@@ -0,0 +1,75 @@
1/*
2 * linux/include/asm/traps.h
3 *
4 * Copyright (C) 1993 Hamish Macdonald
5 *
6 * Lineo, Inc Jul 2001 Tony Kou
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file COPYING in the main directory of this archive
10 * for more details.
11 */
12
13#ifndef _BFIN_TRAPS_H
14#define _BFIN_TRAPS_H
15
16#define VEC_SYS (0)
17#define VEC_EXCPT01 (1)
18#define VEC_EXCPT02 (2)
19#define VEC_EXCPT03 (3)
20#define VEC_EXCPT04 (4)
21#define VEC_EXCPT05 (5)
22#define VEC_EXCPT06 (6)
23#define VEC_EXCPT07 (7)
24#define VEC_EXCPT08 (8)
25#define VEC_EXCPT09 (9)
26#define VEC_EXCPT10 (10)
27#define VEC_EXCPT11 (11)
28#define VEC_EXCPT12 (12)
29#define VEC_EXCPT13 (13)
30#define VEC_EXCPT14 (14)
31#define VEC_EXCPT15 (15)
32#define VEC_STEP (16)
33#define VEC_OVFLOW (17)
34#define VEC_UNDEF_I (33)
35#define VEC_ILGAL_I (34)
36#define VEC_CPLB_VL (35)
37#define VEC_MISALI_D (36)
38#define VEC_UNCOV (37)
39#define VEC_CPLB_M (38)
40#define VEC_CPLB_MHIT (39)
41#define VEC_WATCH (40)
42#define VEC_ISTRU_VL (41) /*ADSP-BF535 only (MH) */
43#define VEC_MISALI_I (42)
44#define VEC_CPLB_I_VL (43)
45#define VEC_CPLB_I_M (44)
46#define VEC_CPLB_I_MHIT (45)
47#define VEC_ILL_RES (46) /* including unvalid supervisor mode insn */
48
49#ifndef __ASSEMBLY__
50
51#define HWC_x2 "System MMR Error\nAn error occurred due to an invalid access to an System MMR location\nPossible reason: a 32-bit register is accessed with a 16-bit instruction,\nor a 16-bit register is accessed with a 32-bit instruction.\n"
52#define HWC_x3 "External Memory Addressing Error\n"
53#define HWC_x12 "Performance Monitor Overflow\n"
54#define HWC_x18 "RAISE 5 instruction\n Software issued a RAISE 5 instruction to invoke the Hardware\n"
55#define HWC_default "Reserved\n"
56
57#define EXC_0x03 "Application stack overflow\n - Please increase the stack size of the application using elf2flt -s option,\n and/or reduce the stack use of the application.\n"
58#define EXC_0x10 "Single step\n - When the processor is in single step mode, every instruction\n generates an exception. Primarily used for debugging.\n"
59#define EXC_0x11 "Exception caused by a trace buffer full condition\n - The processor takes this exception when the trace\n buffer overflows (only when enabled by the Trace Unit Control register).\n"
60#define EXC_0x21 "Undefined instruction\n - May be used to emulate instructions that are not defined for\n a particular processor implementation.\n"
61#define EXC_0x22 "Illegal instruction combination\n - See section for multi-issue rules in the ADSP-BF53x Blackfin\n Processor Instruction Set Reference.\n"
62#define EXC_0x23 "Data access CPLB protection violation\n - Attempted read or write to Supervisor resource,\n or illegal data memory access. \n"
63#define EXC_0x24 "Data access misaligned address violation\n - Attempted misaligned data memory or data cache access.\n"
64#define EXC_0x25 "Unrecoverable event\n - For example, an exception generated while processing a previous exception.\n"
65#define EXC_0x26 "Data access CPLB miss\n - Used by the MMU to signal a CPLB miss on a data access.\n"
66#define EXC_0x27 "Data access multiple CPLB hits\n - More than one CPLB entry matches data fetch address.\n"
67#define EXC_0x28 "Program Sequencer Exception caused by an emulation watchpoint match\n - There is a watchpoint match, and one of the EMUSW\n bits in the Watchpoint Instruction Address Control register (WPIACTL) is set.\n"
68#define EXC_0x2A "Instruction fetch misaligned address violation\n - Attempted misaligned instruction cache fetch. On a misaligned instruction fetch exception,\n the return address provided in RETX is the destination address which is misaligned, rather than the address of the offending instruction.\n"
69#define EXC_0x2B "CPLB protection violation\n - Illegal instruction fetch access (memory protection violation).\n"
70#define EXC_0x2C "Instruction fetch CPLB miss\n - CPLB miss on an instruction fetch.\n"
71#define EXC_0x2D "Instruction fetch multiple CPLB hits\n - More than one CPLB entry matches instruction fetch address.\n"
72#define EXC_0x2E "Illegal use of supervisor resource\n - Attempted to use a Supervisor register or instruction from User mode.\n Supervisor resources are registers and instructions that are reserved\n for Supervisor use: Supervisor only registers, all MMRs, and Supervisor\n only instructions.\n"
73
74#endif /* __ASSEMBLY__ */
75#endif /* _BFIN_TRAPS_H */
diff --git a/include/asm-blackfin/types.h b/include/asm-blackfin/types.h
new file mode 100644
index 000000000000..36f8dc8c52ba
--- /dev/null
+++ b/include/asm-blackfin/types.h
@@ -0,0 +1,66 @@
1#ifndef _BFIN_TYPES_H
2#define _BFIN_TYPES_H
3
4/*
5 * This file is never included by application software unless
6 * explicitly requested (e.g., via linux/types.h) in which case the
7 * application is Linux specific so (user-) name space pollution is
8 * not a major issue. However, for interoperability, libraries still
9 * need to be careful to avoid a name clashes.
10 */
11#ifndef __ASSEMBLY__
12
13typedef unsigned short umode_t;
14
15/*
16 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
17 * header files exported to user space
18 */
19
20typedef __signed__ char __s8;
21typedef unsigned char __u8;
22
23typedef __signed__ short __s16;
24typedef unsigned short __u16;
25
26typedef __signed__ int __s32;
27typedef unsigned int __u32;
28
29/* HK0617 -- Changes to unsigned long temporarily */
30#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
31typedef __signed__ long long __s64;
32typedef unsigned long long __u64;
33#endif
34
35#endif /* __ASSEMBLY__ */
36/*
37 * These aren't exported outside the kernel to avoid name space clashes
38 */
39#ifdef __KERNEL__
40
41#define BITS_PER_LONG 32
42
43#ifndef __ASSEMBLY__
44
45typedef signed char s8;
46typedef unsigned char u8;
47
48typedef signed short s16;
49typedef unsigned short u16;
50
51typedef signed int s32;
52typedef unsigned int u32;
53
54typedef signed long long s64;
55typedef unsigned long long u64;
56
57/* Dma addresses are 32-bits wide. */
58
59typedef u32 dma_addr_t;
60typedef u64 dma64_addr_t;
61
62#endif /* __ASSEMBLY__ */
63
64#endif /* __KERNEL__ */
65
66#endif /* _BFIN_TYPES_H */
diff --git a/include/asm-blackfin/uaccess.h b/include/asm-blackfin/uaccess.h
new file mode 100644
index 000000000000..bfcb6794c672
--- /dev/null
+++ b/include/asm-blackfin/uaccess.h
@@ -0,0 +1,271 @@
1/* Changes made by Lineo Inc. May 2001
2 *
3 * Based on: include/asm-m68knommu/uaccess.h
4 */
5
6#ifndef __BLACKFIN_UACCESS_H
7#define __BLACKFIN_UACCESS_H
8
9/*
10 * User space memory access functions
11 */
12#include <linux/sched.h>
13#include <linux/mm.h>
14#include <linux/string.h>
15
16#include <asm/segment.h>
17#ifndef CONFIG_NO_ACCESS_CHECK
18# include <asm/bfin-global.h>
19#endif
20
21#define get_ds() (KERNEL_DS)
22#define get_fs() (current_thread_info()->addr_limit)
23
24static inline void set_fs(mm_segment_t fs)
25{
26 current_thread_info()->addr_limit = fs;
27}
28
29#define segment_eq(a,b) ((a) == (b))
30
31#define VERIFY_READ 0
32#define VERIFY_WRITE 1
33
34#define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size))
35
36static inline int is_in_rom(unsigned long addr)
37{
38 /*
39 * What we are really trying to do is determine if addr is
40 * in an allocated kernel memory region. If not then assume
41 * we cannot free it or otherwise de-allocate it. Ideally
42 * we could restrict this to really being in a ROM or flash,
43 * but that would need to be done on a board by board basis,
44 * not globally.
45 */
46 if ((addr < _ramstart) || (addr >= _ramend))
47 return (1);
48
49 /* Default case, not in ROM */
50 return (0);
51}
52
53/*
54 * The fs value determines whether argument validity checking should be
55 * performed or not. If get_fs() == USER_DS, checking is performed, with
56 * get_fs() == KERNEL_DS, checking is bypassed.
57 */
58
59#ifdef CONFIG_NO_ACCESS_CHECK
60static inline int _access_ok(unsigned long addr, unsigned long size) { return 1; }
61#else
62#ifdef CONFIG_ACCESS_OK_L1
63extern int _access_ok(unsigned long addr, unsigned long size)__attribute__((l1_text));
64#else
65extern int _access_ok(unsigned long addr, unsigned long size);
66#endif
67#endif
68
69/*
70 * The exception table consists of pairs of addresses: the first is the
71 * address of an instruction that is allowed to fault, and the second is
72 * the address at which the program should continue. No registers are
73 * modified, so it is entirely up to the continuation code to figure out
74 * what to do.
75 *
76 * All the routines below use bits of fixup code that are out of line
77 * with the main instruction path. This means when everything is well,
78 * we don't even have to jump over them. Further, they do not intrude
79 * on our cache or tlb entries.
80 */
81
82struct exception_table_entry {
83 unsigned long insn, fixup;
84};
85
86/* Returns 0 if exception not found and fixup otherwise. */
87extern unsigned long search_exception_table(unsigned long);
88
89/*
90 * These are the main single-value transfer routines. They automatically
91 * use the right size if we just have the right pointer type.
92 */
93
94#define put_user(x,p) \
95 ({ \
96 int _err = 0; \
97 typeof(*(p)) _x = (x); \
98 typeof(*(p)) *_p = (p); \
99 if (!access_ok(VERIFY_WRITE, _p, sizeof(*(_p)))) {\
100 _err = -EFAULT; \
101 } \
102 else { \
103 switch (sizeof (*(_p))) { \
104 case 1: \
105 __put_user_asm(_x, _p, B); \
106 break; \
107 case 2: \
108 __put_user_asm(_x, _p, W); \
109 break; \
110 case 4: \
111 __put_user_asm(_x, _p, ); \
112 break; \
113 case 8: { \
114 long _xl, _xh; \
115 _xl = ((long *)&_x)[0]; \
116 _xh = ((long *)&_x)[1]; \
117 __put_user_asm(_xl, ((long *)_p)+0, ); \
118 __put_user_asm(_xh, ((long *)_p)+1, ); \
119 } break; \
120 default: \
121 _err = __put_user_bad(); \
122 break; \
123 } \
124 } \
125 _err; \
126 })
127
128#define __put_user(x,p) put_user(x,p)
129static inline int bad_user_access_length(void)
130{
131 panic("bad_user_access_length");
132 return -1;
133}
134
135#define __put_user_bad() (printk(KERN_INFO "put_user_bad %s:%d %s\n",\
136 __FILE__, __LINE__, __FUNCTION__),\
137 bad_user_access_length(), (-EFAULT))
138
139/*
140 * Tell gcc we read from memory instead of writing: this is because
141 * we do not write to any memory gcc knows about, so there are no
142 * aliasing issues.
143 */
144
145#define __ptr(x) ((unsigned long *)(x))
146
147#define __put_user_asm(x,p,bhw) \
148 __asm__ (#bhw"[%1] = %0;\n\t" \
149 : /* no outputs */ \
150 :"d" (x),"a" (__ptr(p)) : "memory")
151
152#define get_user(x,p) \
153 ({ \
154 int _err = 0; \
155 typeof(*(p)) *_p = (p); \
156 if (!access_ok(VERIFY_READ, _p, sizeof(*(_p)))) { \
157 _err = -EFAULT; \
158 } \
159 else { \
160 switch (sizeof(*(_p))) { \
161 case 1: \
162 __get_user_asm(x, _p, B,(Z)); \
163 break; \
164 case 2: \
165 __get_user_asm(x, _p, W,(Z)); \
166 break; \
167 case 4: \
168 __get_user_asm(x, _p, , ); \
169 break; \
170 case 8: { \
171 unsigned long _xl, _xh; \
172 __get_user_asm(_xl, ((unsigned long *)_p)+0, , ); \
173 __get_user_asm(_xh, ((unsigned long *)_p)+1, , ); \
174 ((unsigned long *)&x)[0] = _xl; \
175 ((unsigned long *)&x)[1] = _xh; \
176 } break; \
177 default: \
178 x = 0; \
179 printk(KERN_INFO "get_user_bad: %s:%d %s\n", \
180 __FILE__, __LINE__, __FUNCTION__); \
181 _err = __get_user_bad(); \
182 break; \
183 } \
184 } \
185 _err; \
186 })
187
188#define __get_user(x,p) get_user(x,p)
189
190#define __get_user_bad() (bad_user_access_length(), (-EFAULT))
191
192#define __get_user_asm(x,p,bhw,option) \
193 { \
194 unsigned long _tmp; \
195 __asm__ ("%0 =" #bhw "[%1]"#option";\n\t" \
196 : "=d" (_tmp) \
197 : "a" (__ptr(p))); \
198 (x) = (__typeof__(*(p))) _tmp; \
199 }
200
201#define __copy_from_user(to, from, n) copy_from_user(to, from, n)
202#define __copy_to_user(to, from, n) copy_to_user(to, from, n)
203#define __copy_to_user_inatomic __copy_to_user
204#define __copy_from_user_inatomic __copy_from_user
205
206#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n))\
207 return retval; })
208
209#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n))\
210 return retval; })
211
212static inline long copy_from_user(void *to,
213 const void __user * from, unsigned long n)
214{
215 if (access_ok(VERIFY_READ, from, n))
216 memcpy(to, from, n);
217 else
218 return n;
219 return 0;
220}
221
222static inline long copy_to_user(void *to,
223 const void __user * from, unsigned long n)
224{
225 if (access_ok(VERIFY_WRITE, to, n))
226 memcpy(to, from, n);
227 else
228 return n;
229 return 0;
230}
231
232/*
233 * Copy a null terminated string from userspace.
234 */
235
236static inline long strncpy_from_user(char *dst,
237 const char *src, long count)
238{
239 char *tmp;
240 if (!access_ok(VERIFY_READ, src, 1))
241 return -EFAULT;
242 strncpy(dst, src, count);
243 for (tmp = dst; *tmp && count > 0; tmp++, count--) ;
244 return (tmp - dst);
245}
246
247/*
248 * Return the size of a string (including the ending 0)
249 *
250 * Return 0 on exception, a value greater than N if too long
251 */
252static inline long strnlen_user(const char *src, long n)
253{
254 return (strlen(src) + 1);
255}
256
257#define strlen_user(str) strnlen_user(str, 32767)
258
259/*
260 * Zero Userspace
261 */
262
263static inline unsigned long __clear_user(void *to, unsigned long n)
264{
265 memset(to, 0, n);
266 return 0;
267}
268
269#define clear_user(to, n) __clear_user(to, n)
270
271#endif /* _BLACKFIN_UACCESS_H */
diff --git a/include/asm-blackfin/ucontext.h b/include/asm-blackfin/ucontext.h
new file mode 100644
index 000000000000..4a4e3856beba
--- /dev/null
+++ b/include/asm-blackfin/ucontext.h
@@ -0,0 +1,17 @@
1/** Changes made by Tony Kou Lineo Inc. May 2001
2 *
3 * Based on: include/m68knommu/ucontext.h
4 */
5
6#ifndef _BLACKFIN_UCONTEXT_H
7#define _BLACKFIN_UCONTEXT_H
8
9struct ucontext {
10 unsigned long uc_flags; /* the others are necessary */
11 struct ucontext *uc_link;
12 stack_t uc_stack;
13 struct sigcontext uc_mcontext;
14 sigset_t uc_sigmask; /* mask last for extensibility */
15};
16
17#endif /* _BLACKFIN_UCONTEXT_H */
diff --git a/include/asm-blackfin/unaligned.h b/include/asm-blackfin/unaligned.h
new file mode 100644
index 000000000000..10081dc241ef
--- /dev/null
+++ b/include/asm-blackfin/unaligned.h
@@ -0,0 +1,6 @@
1#ifndef __BFIN_UNALIGNED_H
2#define __BFIN_UNALIGNED_H
3
4#include <asm-generic/unaligned.h>
5
6#endif /* __BFIN_UNALIGNED_H */
diff --git a/include/asm-blackfin/unistd.h b/include/asm-blackfin/unistd.h
new file mode 100644
index 000000000000..4df8790a67d5
--- /dev/null
+++ b/include/asm-blackfin/unistd.h
@@ -0,0 +1,382 @@
1#ifndef __ASM_BFIN_UNISTD_H
2#define __ASM_BFIN_UNISTD_H
3/*
4 * This file contains the system call numbers.
5 */
6#define __NR_exit 1
7#define __NR_fork 2
8#define __NR_read 3
9#define __NR_write 4
10#define __NR_open 5
11#define __NR_close 6
12 /* 7 __NR_waitpid obsolete */
13#define __NR_creat 8
14#define __NR_link 9
15#define __NR_unlink 10
16#define __NR_execve 11
17#define __NR_chdir 12
18#define __NR_time 13
19#define __NR_mknod 14
20#define __NR_chmod 15
21#define __NR_chown 16
22 /* 17 __NR_break obsolete */
23 /* 18 __NR_oldstat obsolete */
24#define __NR_lseek 19
25#define __NR_getpid 20
26#define __NR_mount 21
27 /* 22 __NR_umount obsolete */
28#define __NR_setuid 23
29#define __NR_getuid 24
30#define __NR_stime 25
31#define __NR_ptrace 26
32#define __NR_alarm 27
33 /* 28 __NR_oldfstat obsolete */
34#define __NR_pause 29
35 /* 30 __NR_utime obsolete */
36 /* 31 __NR_stty obsolete */
37 /* 32 __NR_gtty obsolete */
38#define __NR_access 33
39#define __NR_nice 34
40 /* 35 __NR_ftime obsolete */
41#define __NR_sync 36
42#define __NR_kill 37
43#define __NR_rename 38
44#define __NR_mkdir 39
45#define __NR_rmdir 40
46#define __NR_dup 41
47#define __NR_pipe 42
48#define __NR_times 43
49 /* 44 __NR_prof obsolete */
50#define __NR_brk 45
51#define __NR_setgid 46
52#define __NR_getgid 47
53 /* 48 __NR_signal obsolete */
54#define __NR_geteuid 49
55#define __NR_getegid 50
56#define __NR_acct 51
57#define __NR_umount2 52
58 /* 53 __NR_lock obsolete */
59#define __NR_ioctl 54
60#define __NR_fcntl 55
61 /* 56 __NR_mpx obsolete */
62#define __NR_setpgid 57
63 /* 58 __NR_ulimit obsolete */
64 /* 59 __NR_oldolduname obsolete */
65#define __NR_umask 60
66#define __NR_chroot 61
67#define __NR_ustat 62
68#define __NR_dup2 63
69#define __NR_getppid 64
70#define __NR_getpgrp 65
71#define __NR_setsid 66
72 /* 67 __NR_sigaction obsolete */
73#define __NR_sgetmask 68
74#define __NR_ssetmask 69
75#define __NR_setreuid 70
76#define __NR_setregid 71
77 /* 72 __NR_sigsuspend obsolete */
78 /* 73 __NR_sigpending obsolete */
79#define __NR_sethostname 74
80#define __NR_setrlimit 75
81 /* 76 __NR_old_getrlimit obsolete */
82#define __NR_getrusage 77
83#define __NR_gettimeofday 78
84#define __NR_settimeofday 79
85#define __NR_getgroups 80
86#define __NR_setgroups 81
87 /* 82 __NR_select obsolete */
88#define __NR_symlink 83
89 /* 84 __NR_oldlstat obsolete */
90#define __NR_readlink 85
91 /* 86 __NR_uselib obsolete */
92 /* 87 __NR_swapon obsolete */
93#define __NR_reboot 88
94 /* 89 __NR_readdir obsolete */
95 /* 90 __NR_mmap obsolete */
96#define __NR_munmap 91
97#define __NR_truncate 92
98#define __NR_ftruncate 93
99#define __NR_fchmod 94
100#define __NR_fchown 95
101#define __NR_getpriority 96
102#define __NR_setpriority 97
103 /* 98 __NR_profil obsolete */
104#define __NR_statfs 99
105#define __NR_fstatfs 100
106 /* 101 __NR_ioperm */
107 /* 102 __NR_socketcall obsolete */
108#define __NR_syslog 103
109#define __NR_setitimer 104
110#define __NR_getitimer 105
111#define __NR_stat 106
112#define __NR_lstat 107
113#define __NR_fstat 108
114 /* 109 __NR_olduname obsolete */
115 /* 110 __NR_iopl obsolete */
116#define __NR_vhangup 111
117 /* 112 __NR_idle obsolete */
118 /* 113 __NR_vm86old */
119#define __NR_wait4 114
120 /* 115 __NR_swapoff obsolete */
121#define __NR_sysinfo 116
122 /* 117 __NR_ipc oboslete */
123#define __NR_fsync 118
124 /* 119 __NR_sigreturn obsolete */
125#define __NR_clone 120
126#define __NR_setdomainname 121
127#define __NR_uname 122
128 /* 123 __NR_modify_ldt obsolete */
129#define __NR_adjtimex 124
130#define __NR_mprotect 125
131 /* 126 __NR_sigprocmask obsolete */
132 /* 127 __NR_create_module obsolete */
133#define __NR_init_module 128
134#define __NR_delete_module 129
135 /* 130 __NR_get_kernel_syms obsolete */
136#define __NR_quotactl 131
137#define __NR_getpgid 132
138#define __NR_fchdir 133
139#define __NR_bdflush 134
140 /* 135 was sysfs */
141#define __NR_personality 136
142 /* 137 __NR_afs_syscall */
143#define __NR_setfsuid 138
144#define __NR_setfsgid 139
145#define __NR__llseek 140
146#define __NR_getdents 141
147 /* 142 __NR__newselect obsolete */
148#define __NR_flock 143
149 /* 144 __NR_msync obsolete */
150#define __NR_readv 145
151#define __NR_writev 146
152#define __NR_getsid 147
153#define __NR_fdatasync 148
154#define __NR__sysctl 149
155 /* 150 __NR_mlock */
156 /* 151 __NR_munlock */
157 /* 152 __NR_mlockall */
158 /* 153 __NR_munlockall */
159#define __NR_sched_setparam 154
160#define __NR_sched_getparam 155
161#define __NR_sched_setscheduler 156
162#define __NR_sched_getscheduler 157
163#define __NR_sched_yield 158
164#define __NR_sched_get_priority_max 159
165#define __NR_sched_get_priority_min 160
166#define __NR_sched_rr_get_interval 161
167#define __NR_nanosleep 162
168 /* 163 __NR_mremap */
169#define __NR_setresuid 164
170#define __NR_getresuid 165
171 /* 166 __NR_vm86 */
172 /* 167 __NR_query_module */
173 /* 168 __NR_poll */
174 /* 169 __NR_nfsservctl */
175#define __NR_setresgid 170
176#define __NR_getresgid 171
177#define __NR_prctl 172
178#define __NR_rt_sigreturn 173
179#define __NR_rt_sigaction 174
180#define __NR_rt_sigprocmask 175
181#define __NR_rt_sigpending 176
182#define __NR_rt_sigtimedwait 177
183#define __NR_rt_sigqueueinfo 178
184#define __NR_rt_sigsuspend 179
185#define __NR_pread 180
186#define __NR_pwrite 181
187#define __NR_lchown 182
188#define __NR_getcwd 183
189#define __NR_capget 184
190#define __NR_capset 185
191#define __NR_sigaltstack 186
192#define __NR_sendfile 187
193 /* 188 __NR_getpmsg */
194 /* 189 __NR_putpmsg */
195#define __NR_vfork 190
196#define __NR_getrlimit 191
197#define __NR_mmap2 192
198#define __NR_truncate64 193
199#define __NR_ftruncate64 194
200#define __NR_stat64 195
201#define __NR_lstat64 196
202#define __NR_fstat64 197
203#define __NR_chown32 198
204#define __NR_getuid32 199
205#define __NR_getgid32 200
206#define __NR_geteuid32 201
207#define __NR_getegid32 202
208#define __NR_setreuid32 203
209#define __NR_setregid32 204
210#define __NR_getgroups32 205
211#define __NR_setgroups32 206
212#define __NR_fchown32 207
213#define __NR_setresuid32 208
214#define __NR_getresuid32 209
215#define __NR_setresgid32 210
216#define __NR_getresgid32 211
217#define __NR_lchown32 212
218#define __NR_setuid32 213
219#define __NR_setgid32 214
220#define __NR_setfsuid32 215
221#define __NR_setfsgid32 216
222#define __NR_pivot_root 217
223 /* 218 __NR_mincore */
224 /* 219 __NR_madvise */
225#define __NR_getdents64 220
226#define __NR_fcntl64 221
227 /* 222 reserved for TUX */
228 /* 223 reserved for TUX */
229#define __NR_gettid 224
230 /* 225 __NR_readahead */
231#define __NR_setxattr 226
232#define __NR_lsetxattr 227
233#define __NR_fsetxattr 228
234#define __NR_getxattr 229
235#define __NR_lgetxattr 230
236#define __NR_fgetxattr 231
237#define __NR_listxattr 232
238#define __NR_llistxattr 233
239#define __NR_flistxattr 234
240#define __NR_removexattr 235
241#define __NR_lremovexattr 236
242#define __NR_fremovexattr 237
243#define __NR_tkill 238
244#define __NR_sendfile64 239
245#define __NR_futex 240
246#define __NR_sched_setaffinity 241
247#define __NR_sched_getaffinity 242
248 /* 243 __NR_set_thread_area */
249 /* 244 __NR_get_thread_area */
250#define __NR_io_setup 245
251#define __NR_io_destroy 246
252#define __NR_io_getevents 247
253#define __NR_io_submit 248
254#define __NR_io_cancel 249
255 /* 250 __NR_alloc_hugepages */
256 /* 251 __NR_free_hugepages */
257#define __NR_exit_group 252
258#define __NR_lookup_dcookie 253
259#define __NR_bfin_spinlock 254
260
261#define __NR_epoll_create 255
262#define __NR_epoll_ctl 256
263#define __NR_epoll_wait 257
264 /* 258 __NR_remap_file_pages */
265#define __NR_set_tid_address 259
266#define __NR_timer_create 260
267#define __NR_timer_settime (__NR_timer_create+1)
268#define __NR_timer_gettime (__NR_timer_create+2)
269#define __NR_timer_getoverrun (__NR_timer_create+3)
270#define __NR_timer_delete (__NR_timer_create+4)
271#define __NR_clock_settime (__NR_timer_create+5)
272#define __NR_clock_gettime (__NR_timer_create+6)
273#define __NR_clock_getres (__NR_timer_create+7)
274#define __NR_clock_nanosleep (__NR_timer_create+8)
275#define __NR_statfs64 269
276#define __NR_fstatfs64 270
277#define __NR_tgkill 271
278#define __NR_utimes 272
279#define __NR_fadvise64_64 273
280 /* 274 __NR_vserver */
281 /* 275 __NR_mbind */
282 /* 276 __NR_get_mempolicy */
283 /* 277 __NR_set_mempolicy */
284#define __NR_mq_open 278
285#define __NR_mq_unlink (__NR_mq_open+1)
286#define __NR_mq_timedsend (__NR_mq_open+2)
287#define __NR_mq_timedreceive (__NR_mq_open+3)
288#define __NR_mq_notify (__NR_mq_open+4)
289#define __NR_mq_getsetattr (__NR_mq_open+5)
290 /* 284 __NR_sys_kexec_load */
291#define __NR_waitid 285
292#define __NR_add_key 286
293#define __NR_request_key 287
294#define __NR_keyctl 288
295#define __NR_ioprio_set 289
296#define __NR_ioprio_get 290
297#define __NR_inotify_init 291
298#define __NR_inotify_add_watch 292
299#define __NR_inotify_rm_watch 293
300 /* 294 __NR_migrate_pages */
301#define __NR_openat 295
302#define __NR_mkdirat 296
303#define __NR_mknodat 297
304#define __NR_fchownat 298
305#define __NR_futimesat 299
306#define __NR_fstatat64 300
307#define __NR_unlinkat 301
308#define __NR_renameat 302
309#define __NR_linkat 303
310#define __NR_symlinkat 304
311#define __NR_readlinkat 305
312#define __NR_fchmodat 306
313#define __NR_faccessat 307
314#define __NR_pselect6 308
315#define __NR_ppoll 309
316#define __NR_unshare 310
317
318/* Blackfin private syscalls */
319#define __NR_sram_alloc 311
320#define __NR_sram_free 312
321#define __NR_dma_memcpy 313
322
323/* socket syscalls */
324#define __NR_accept 314
325#define __NR_bind 315
326#define __NR_connect 316
327#define __NR_getpeername 317
328#define __NR_getsockname 318
329#define __NR_getsockopt 319
330#define __NR_listen 320
331#define __NR_recv 321
332#define __NR_recvfrom 322
333#define __NR_recvmsg 323
334#define __NR_send 324
335#define __NR_sendmsg 325
336#define __NR_sendto 326
337#define __NR_setsockopt 327
338#define __NR_shutdown 328
339#define __NR_socket 329
340#define __NR_socketpair 330
341
342/* sysv ipc syscalls */
343#define __NR_semctl 331
344#define __NR_semget 332
345#define __NR_semop 333
346#define __NR_msgctl 334
347#define __NR_msgget 335
348#define __NR_msgrcv 336
349#define __NR_msgsnd 337
350#define __NR_shmat 338
351#define __NR_shmctl 339
352#define __NR_shmdt 340
353#define __NR_shmget 341
354
355#define __NR_syscall 342
356#define NR_syscalls __NR_syscall
357
358#ifdef __KERNEL__
359#define __ARCH_WANT_IPC_PARSE_VERSION
360#define __ARCH_WANT_STAT64
361#define __ARCH_WANT_SYS_ALARM
362#define __ARCH_WANT_SYS_GETHOSTNAME
363#define __ARCH_WANT_SYS_PAUSE
364#define __ARCH_WANT_SYS_SGETMASK
365#define __ARCH_WANT_SYS_TIME
366#define __ARCH_WANT_SYS_FADVISE64
367#define __ARCH_WANT_SYS_GETPGRP
368#define __ARCH_WANT_SYS_LLSEEK
369#define __ARCH_WANT_SYS_NICE
370#define __ARCH_WANT_SYS_RT_SIGACTION
371#define __ARCH_WANT_SYS_RT_SIGSUSPEND
372#endif
373
374/*
375 * "Conditional" syscalls
376 *
377 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
378 * but it doesn't work on all toolchains, so we just do it by hand
379 */
380#define cond_syscall(x) asm(".weak\t_" #x "\n\t.set\t_" #x ",_sys_ni_syscall");
381
382#endif /* __ASM_BFIN_UNISTD_H */
diff --git a/include/asm-blackfin/user.h b/include/asm-blackfin/user.h
new file mode 100644
index 000000000000..abc34629bd59
--- /dev/null
+++ b/include/asm-blackfin/user.h
@@ -0,0 +1,89 @@
1#ifndef _BFIN_USER_H
2#define _BFIN_USER_H
3
4/* Changes by Tony Kou Lineo, Inc. July, 2001
5 *
6 * Based include/asm-m68knommu/user.h
7 *
8 */
9
10/* Core file format: The core file is written in such a way that gdb
11 can understand it and provide useful information to the user (under
12 linux we use the 'trad-core' bfd). There are quite a number of
13 obstacles to being able to view the contents of the floating point
14 registers, and until these are solved you will not be able to view the
15 contents of them. Actually, you can read in the core file and look at
16 the contents of the user struct to find out what the floating point
17 registers contain.
18 The actual file contents are as follows:
19 UPAGE: 1 page consisting of a user struct that tells gdb what is present
20 in the file. Directly after this is a copy of the task_struct, which
21 is currently not used by gdb, but it may come in useful at some point.
22 All of the registers are stored as part of the upage. The upage should
23 always be only one page.
24 DATA: The data area is stored. We use current->end_text to
25 current->brk to pick up all of the user variables, plus any memory
26 that may have been malloced. No attempt is made to determine if a page
27 is demand-zero or if a page is totally unused, we just cover the entire
28 range. All of the addresses are rounded in such a way that an integral
29 number of pages is written.
30 STACK: We need the stack information in order to get a meaningful
31 backtrace. We need to write the data from (esp) to
32 current->start_stack, so we round each of these off in order to be able
33 to write an integer number of pages.
34 The minimum core file size is 3 pages, or 12288 bytes.
35*/
36struct user_bfinfp_struct {
37};
38
39/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
40 is still the layout used by user (the new pt_regs doesn't have
41 all registers). */
42struct user_regs_struct {
43 long r0, r1, r2, r3, r4, r5, r6, r7;
44 long p0, p1, p2, p3, p4, p5, usp, fp;
45 long i0, i1, i2, i3;
46 long l0, l1, l2, l3;
47 long b0, b1, b2, b3;
48 long m0, m1, m2, m3;
49 long a0w, a1w;
50 long a0x, a1x;
51 unsigned long rets;
52 unsigned long astat;
53 unsigned long pc;
54 unsigned long orig_p0;
55};
56
57/* When the kernel dumps core, it starts by dumping the user struct -
58 this will be used by gdb to figure out where the data and stack segments
59 are within the file, and what virtual addresses to use. */
60
61struct user {
62/* We start with the registers, to mimic the way that "memory" is returned
63 from the ptrace(3,...) function. */
64
65 struct user_regs_struct regs; /* Where the registers are actually stored */
66
67/* The rest of this junk is to help gdb figure out what goes where */
68 unsigned long int u_tsize; /* Text segment size (pages). */
69 unsigned long int u_dsize; /* Data segment size (pages). */
70 unsigned long int u_ssize; /* Stack segment size (pages). */
71 unsigned long start_code; /* Starting virtual address of text. */
72 unsigned long start_stack; /* Starting virtual address of stack area.
73 This is actually the bottom of the stack,
74 the top of the stack is always found in the
75 esp register. */
76 long int signal; /* Signal that caused the core dump. */
77 int reserved; /* No longer used */
78 struct user_regs_struct *u_ar0;
79 /* Used by gdb to help find the values for */
80 /* the registers. */
81 unsigned long magic; /* To uniquely identify a core file */
82 char u_comm[32]; /* User command that was responsible */
83};
84#define NBPG PAGE_SIZE
85#define UPAGES 1
86#define HOST_TEXT_START_ADDR (u.start_code)
87#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
88
89#endif
diff --git a/include/asm-cris/kdebug.h b/include/asm-cris/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-cris/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h
index 066386ac238e..d425d8d0ad77 100644
--- a/include/asm-frv/atomic.h
+++ b/include/asm-frv/atomic.h
@@ -16,6 +16,7 @@
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18#include <asm/spr-regs.h> 18#include <asm/spr-regs.h>
19#include <asm/system.h>
19 20
20#ifdef CONFIG_SMP 21#ifdef CONFIG_SMP
21#error not SMP safe 22#error not SMP safe
@@ -258,85 +259,23 @@ extern uint32_t __xchg_32(uint32_t i, volatile void *v);
258 259
259#define tas(ptr) (xchg((ptr), 1)) 260#define tas(ptr) (xchg((ptr), 1))
260 261
261/*****************************************************************************/
262/*
263 * compare and conditionally exchange value with memory
264 * - if (*ptr == test) then orig = *ptr; *ptr = test;
265 * - if (*ptr != test) then orig = *ptr;
266 */
267#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
268
269#define cmpxchg(ptr, test, new) \
270({ \
271 __typeof__(ptr) __xg_ptr = (ptr); \
272 __typeof__(*(ptr)) __xg_orig, __xg_tmp; \
273 __typeof__(*(ptr)) __xg_test = (test); \
274 __typeof__(*(ptr)) __xg_new = (new); \
275 \
276 switch (sizeof(__xg_orig)) { \
277 case 4: \
278 asm volatile( \
279 "0: \n" \
280 " orcc gr0,gr0,gr0,icc3 \n" \
281 " ckeq icc3,cc7 \n" \
282 " ld.p %M0,%1 \n" \
283 " orcr cc7,cc7,cc3 \n" \
284 " sub%I4cc %1,%4,%2,icc0 \n" \
285 " bne icc0,#0,1f \n" \
286 " cst.p %3,%M0 ,cc3,#1 \n" \
287 " corcc gr29,gr29,gr0 ,cc3,#1 \n" \
288 " beq icc3,#0,0b \n" \
289 "1: \n" \
290 : "+U"(*__xg_ptr), "=&r"(__xg_orig), "=&r"(__xg_tmp) \
291 : "r"(__xg_new), "NPr"(__xg_test) \
292 : "memory", "cc7", "cc3", "icc3", "icc0" \
293 ); \
294 break; \
295 \
296 default: \
297 __xg_orig = 0; \
298 asm volatile("break"); \
299 break; \
300 } \
301 \
302 __xg_orig; \
303})
304
305#else
306
307extern uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new);
308
309#define cmpxchg(ptr, test, new) \
310({ \
311 __typeof__(ptr) __xg_ptr = (ptr); \
312 __typeof__(*(ptr)) __xg_orig; \
313 __typeof__(*(ptr)) __xg_test = (test); \
314 __typeof__(*(ptr)) __xg_new = (new); \
315 \
316 switch (sizeof(__xg_orig)) { \
317 case 4: __xg_orig = __cmpxchg_32(__xg_ptr, __xg_test, __xg_new); break; \
318 default: \
319 __xg_orig = 0; \
320 asm volatile("break"); \
321 break; \
322 } \
323 \
324 __xg_orig; \
325})
326
327#endif
328
329#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) 262#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
330#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 263#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
331 264
332#define atomic_add_unless(v, a, u) \ 265static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
333({ \ 266{
334 int c, old; \ 267 int c, old;
335 c = atomic_read(v); \ 268 c = atomic_read(v);
336 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ 269 for (;;) {
337 c = old; \ 270 if (unlikely(c == (u)))
338 c != (u); \ 271 break;
339}) 272 old = atomic_cmpxchg((v), c, c + (a));
273 if (likely(old == c))
274 break;
275 c = old;
276 }
277 return c != (u);
278}
340 279
341#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 280#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
342 281
diff --git a/include/asm-frv/kdebug.h b/include/asm-frv/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-frv/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h
index 8a05aa168616..2687c7715120 100644
--- a/include/asm-frv/pgtable.h
+++ b/include/asm-frv/pgtable.h
@@ -509,10 +509,6 @@ static inline int pte_file(pte_t pte)
509#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 509#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
510 remap_pfn_range(vma, vaddr, pfn, size, prot) 510 remap_pfn_range(vma, vaddr, pfn, size, prot)
511 511
512#define MK_IOSPACE_PFN(space, pfn) (pfn)
513#define GET_IOSPACE(pfn) 0
514#define GET_PFN(pfn) (pfn)
515
516#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 512#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
517#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 513#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
518#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 514#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
diff --git a/include/asm-frv/semaphore.h b/include/asm-frv/semaphore.h
index 907c5c3643cc..09586528e007 100644
--- a/include/asm-frv/semaphore.h
+++ b/include/asm-frv/semaphore.h
@@ -20,8 +20,6 @@
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/rwsem.h> 21#include <linux/rwsem.h>
22 22
23#define SEMAPHORE_DEBUG 0
24
25/* 23/*
26 * the semaphore definition 24 * the semaphore definition
27 * - if counter is >0 then there are tokens available on the semaphore for down to collect 25 * - if counter is >0 then there are tokens available on the semaphore for down to collect
@@ -32,12 +30,12 @@ struct semaphore {
32 unsigned counter; 30 unsigned counter;
33 spinlock_t wait_lock; 31 spinlock_t wait_lock;
34 struct list_head wait_list; 32 struct list_head wait_list;
35#if SEMAPHORE_DEBUG 33#ifdef CONFIG_DEBUG_SEMAPHORE
36 unsigned __magic; 34 unsigned __magic;
37#endif 35#endif
38}; 36};
39 37
40#if SEMAPHORE_DEBUG 38#ifdef CONFIG_DEBUG_SEMAPHORE
41# define __SEM_DEBUG_INIT(name) , (long)&(name).__magic 39# define __SEM_DEBUG_INIT(name) , (long)&(name).__magic
42#else 40#else
43# define __SEM_DEBUG_INIT(name) 41# define __SEM_DEBUG_INIT(name)
@@ -76,7 +74,7 @@ static inline void down(struct semaphore *sem)
76{ 74{
77 unsigned long flags; 75 unsigned long flags;
78 76
79#if SEMAPHORE_DEBUG 77#ifdef CONFIG_DEBUG_SEMAPHORE
80 CHECK_MAGIC(sem->__magic); 78 CHECK_MAGIC(sem->__magic);
81#endif 79#endif
82 80
@@ -95,7 +93,7 @@ static inline int down_interruptible(struct semaphore *sem)
95 unsigned long flags; 93 unsigned long flags;
96 int ret = 0; 94 int ret = 0;
97 95
98#if SEMAPHORE_DEBUG 96#ifdef CONFIG_DEBUG_SEMAPHORE
99 CHECK_MAGIC(sem->__magic); 97 CHECK_MAGIC(sem->__magic);
100#endif 98#endif
101 99
@@ -119,7 +117,7 @@ static inline int down_trylock(struct semaphore *sem)
119 unsigned long flags; 117 unsigned long flags;
120 int success = 0; 118 int success = 0;
121 119
122#if SEMAPHORE_DEBUG 120#ifdef CONFIG_DEBUG_SEMAPHORE
123 CHECK_MAGIC(sem->__magic); 121 CHECK_MAGIC(sem->__magic);
124#endif 122#endif
125 123
@@ -136,7 +134,7 @@ static inline void up(struct semaphore *sem)
136{ 134{
137 unsigned long flags; 135 unsigned long flags;
138 136
139#if SEMAPHORE_DEBUG 137#ifdef CONFIG_DEBUG_SEMAPHORE
140 CHECK_MAGIC(sem->__magic); 138 CHECK_MAGIC(sem->__magic);
141#endif 139#endif
142 140
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index 1166899317d7..be303b3eef40 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -13,7 +13,6 @@
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/linkage.h> 15#include <linux/linkage.h>
16#include <asm/atomic.h>
17 16
18struct thread_struct; 17struct thread_struct;
19 18
@@ -197,4 +196,73 @@ extern void free_initmem(void);
197 196
198#define arch_align_stack(x) (x) 197#define arch_align_stack(x) (x)
199 198
199/*****************************************************************************/
200/*
201 * compare and conditionally exchange value with memory
202 * - if (*ptr == test) then orig = *ptr; *ptr = test;
203 * - if (*ptr != test) then orig = *ptr;
204 */
205#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
206
207#define cmpxchg(ptr, test, new) \
208({ \
209 __typeof__(ptr) __xg_ptr = (ptr); \
210 __typeof__(*(ptr)) __xg_orig, __xg_tmp; \
211 __typeof__(*(ptr)) __xg_test = (test); \
212 __typeof__(*(ptr)) __xg_new = (new); \
213 \
214 switch (sizeof(__xg_orig)) { \
215 case 4: \
216 asm volatile( \
217 "0: \n" \
218 " orcc gr0,gr0,gr0,icc3 \n" \
219 " ckeq icc3,cc7 \n" \
220 " ld.p %M0,%1 \n" \
221 " orcr cc7,cc7,cc3 \n" \
222 " sub%I4cc %1,%4,%2,icc0 \n" \
223 " bne icc0,#0,1f \n" \
224 " cst.p %3,%M0 ,cc3,#1 \n" \
225 " corcc gr29,gr29,gr0 ,cc3,#1 \n" \
226 " beq icc3,#0,0b \n" \
227 "1: \n" \
228 : "+U"(*__xg_ptr), "=&r"(__xg_orig), "=&r"(__xg_tmp) \
229 : "r"(__xg_new), "NPr"(__xg_test) \
230 : "memory", "cc7", "cc3", "icc3", "icc0" \
231 ); \
232 break; \
233 \
234 default: \
235 __xg_orig = 0; \
236 asm volatile("break"); \
237 break; \
238 } \
239 \
240 __xg_orig; \
241})
242
243#else
244
245extern uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new);
246
247#define cmpxchg(ptr, test, new) \
248({ \
249 __typeof__(ptr) __xg_ptr = (ptr); \
250 __typeof__(*(ptr)) __xg_orig; \
251 __typeof__(*(ptr)) __xg_test = (test); \
252 __typeof__(*(ptr)) __xg_new = (new); \
253 \
254 switch (sizeof(__xg_orig)) { \
255 case 4: __xg_orig = __cmpxchg_32(__xg_ptr, __xg_test, __xg_new); break; \
256 default: \
257 __xg_orig = 0; \
258 asm volatile("break"); \
259 break; \
260 } \
261 \
262 __xg_orig; \
263})
264
265#endif
266
267
200#endif /* _ASM_SYSTEM_H */ 268#endif /* _ASM_SYSTEM_H */
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index b7e4a0467cb1..85fd0aa27a8c 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -66,6 +66,76 @@ static inline void atomic_long_sub(long i, atomic_long_t *l)
66 atomic64_sub(i, v); 66 atomic64_sub(i, v);
67} 67}
68 68
69static inline int atomic_long_sub_and_test(long i, atomic_long_t *l)
70{
71 atomic64_t *v = (atomic64_t *)l;
72
73 return atomic64_sub_and_test(i, v);
74}
75
76static inline int atomic_long_dec_and_test(atomic_long_t *l)
77{
78 atomic64_t *v = (atomic64_t *)l;
79
80 return atomic64_dec_and_test(v);
81}
82
83static inline int atomic_long_inc_and_test(atomic_long_t *l)
84{
85 atomic64_t *v = (atomic64_t *)l;
86
87 return atomic64_inc_and_test(v);
88}
89
90static inline int atomic_long_add_negative(long i, atomic_long_t *l)
91{
92 atomic64_t *v = (atomic64_t *)l;
93
94 return atomic64_add_negative(i, v);
95}
96
97static inline long atomic_long_add_return(long i, atomic_long_t *l)
98{
99 atomic64_t *v = (atomic64_t *)l;
100
101 return (long)atomic64_add_return(i, v);
102}
103
104static inline long atomic_long_sub_return(long i, atomic_long_t *l)
105{
106 atomic64_t *v = (atomic64_t *)l;
107
108 return (long)atomic64_sub_return(i, v);
109}
110
111static inline long atomic_long_inc_return(atomic_long_t *l)
112{
113 atomic64_t *v = (atomic64_t *)l;
114
115 return (long)atomic64_inc_return(v);
116}
117
118static inline long atomic_long_dec_return(atomic_long_t *l)
119{
120 atomic64_t *v = (atomic64_t *)l;
121
122 return (long)atomic64_dec_return(v);
123}
124
125static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
126{
127 atomic64_t *v = (atomic64_t *)l;
128
129 return (long)atomic64_add_unless(v, a, u);
130}
131
132#define atomic_long_inc_not_zero(l) atomic64_inc_not_zero((atomic64_t *)(l))
133
134#define atomic_long_cmpxchg(l, old, new) \
135 (atomic_cmpxchg((atomic64_t *)(l), (old), (new)))
136#define atomic_long_xchg(v, new) \
137 (atomic_xchg((atomic64_t *)(l), (new)))
138
69#else /* BITS_PER_LONG == 64 */ 139#else /* BITS_PER_LONG == 64 */
70 140
71typedef atomic_t atomic_long_t; 141typedef atomic_t atomic_long_t;
@@ -113,6 +183,76 @@ static inline void atomic_long_sub(long i, atomic_long_t *l)
113 atomic_sub(i, v); 183 atomic_sub(i, v);
114} 184}
115 185
186static inline int atomic_long_sub_and_test(long i, atomic_long_t *l)
187{
188 atomic_t *v = (atomic_t *)l;
189
190 return atomic_sub_and_test(i, v);
191}
192
193static inline int atomic_long_dec_and_test(atomic_long_t *l)
194{
195 atomic_t *v = (atomic_t *)l;
196
197 return atomic_dec_and_test(v);
198}
199
200static inline int atomic_long_inc_and_test(atomic_long_t *l)
201{
202 atomic_t *v = (atomic_t *)l;
203
204 return atomic_inc_and_test(v);
205}
206
207static inline int atomic_long_add_negative(long i, atomic_long_t *l)
208{
209 atomic_t *v = (atomic_t *)l;
210
211 return atomic_add_negative(i, v);
212}
213
214static inline long atomic_long_add_return(long i, atomic_long_t *l)
215{
216 atomic_t *v = (atomic_t *)l;
217
218 return (long)atomic_add_return(i, v);
219}
220
221static inline long atomic_long_sub_return(long i, atomic_long_t *l)
222{
223 atomic_t *v = (atomic_t *)l;
224
225 return (long)atomic_sub_return(i, v);
226}
227
228static inline long atomic_long_inc_return(atomic_long_t *l)
229{
230 atomic_t *v = (atomic_t *)l;
231
232 return (long)atomic_inc_return(v);
233}
234
235static inline long atomic_long_dec_return(atomic_long_t *l)
236{
237 atomic_t *v = (atomic_t *)l;
238
239 return (long)atomic_dec_return(v);
240}
241
242static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
243{
244 atomic_t *v = (atomic_t *)l;
245
246 return (long)atomic_add_unless(v, a, u);
247}
248
249#define atomic_long_inc_not_zero(l) atomic_inc_not_zero((atomic_t *)(l))
250
251#define atomic_long_cmpxchg(l, old, new) \
252 (atomic_cmpxchg((atomic_t *)(l), (old), (new)))
253#define atomic_long_xchg(v, new) \
254 (atomic_xchg((atomic_t *)(l), (new)))
255
116#endif /* BITS_PER_LONG == 64 */ 256#endif /* BITS_PER_LONG == 64 */
117 257
118#endif /* _ASM_GENERIC_ATOMIC_H */ 258#endif /* _ASM_GENERIC_ATOMIC_H */
diff --git a/include/asm-generic/kdebug.h b/include/asm-generic/kdebug.h
new file mode 100644
index 000000000000..2b799c90b2d4
--- /dev/null
+++ b/include/asm-generic/kdebug.h
@@ -0,0 +1,8 @@
1#ifndef _ASM_GENERIC_KDEBUG_H
2#define _ASM_GENERIC_KDEBUG_H
3
4enum die_val {
5 DIE_UNUSED,
6};
7
8#endif /* _ASM_GENERIC_KDEBUG_H */
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
index ab469297272c..33d7d04e4119 100644
--- a/include/asm-generic/local.h
+++ b/include/asm-generic/local.h
@@ -33,6 +33,19 @@ typedef struct
33#define local_add(i,l) atomic_long_add((i),(&(l)->a)) 33#define local_add(i,l) atomic_long_add((i),(&(l)->a))
34#define local_sub(i,l) atomic_long_sub((i),(&(l)->a)) 34#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
35 35
36#define local_sub_and_test(i, l) atomic_long_sub_and_test((i), (&(l)->a))
37#define local_dec_and_test(l) atomic_long_dec_and_test(&(l)->a)
38#define local_inc_and_test(l) atomic_long_inc_and_test(&(l)->a)
39#define local_add_negative(i, l) atomic_long_add_negative((i), (&(l)->a))
40#define local_add_return(i, l) atomic_long_add_return((i), (&(l)->a))
41#define local_sub_return(i, l) atomic_long_sub_return((i), (&(l)->a))
42#define local_inc_return(l) atomic_long_inc_return(&(l)->a)
43
44#define local_cmpxchg(l, o, n) atomic_long_cmpxchg((&(l)->a), (o), (n))
45#define local_xchg(l, n) atomic_long_xchg((&(l)->a), (n))
46#define local_add_unless(l, a, u) atomic_long_add_unless((&(l)->a), (a), (u))
47#define local_inc_not_zero(l) atomic_long_inc_not_zero(&(l)->a)
48
36/* Non-atomic variants, ie. preemption disabled and won't be touched 49/* Non-atomic variants, ie. preemption disabled and won't be touched
37 * in interrupt, etc. Some archs can optimize this case well. */ 50 * in interrupt, etc. Some archs can optimize this case well. */
38#define __local_inc(l) local_set((l), local_read(l) + 1) 51#define __local_inc(l) local_set((l), local_read(l) + 1)
@@ -44,19 +57,19 @@ typedef struct
44 * much more efficient than these naive implementations. Note they take 57 * much more efficient than these naive implementations. Note they take
45 * a variable (eg. mystruct.foo), not an address. 58 * a variable (eg. mystruct.foo), not an address.
46 */ 59 */
47#define cpu_local_read(v) local_read(&__get_cpu_var(v)) 60#define cpu_local_read(l) local_read(&__get_cpu_var(l))
48#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i)) 61#define cpu_local_set(l, i) local_set(&__get_cpu_var(l), (i))
49#define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) 62#define cpu_local_inc(l) local_inc(&__get_cpu_var(l))
50#define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) 63#define cpu_local_dec(l) local_dec(&__get_cpu_var(l))
51#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) 64#define cpu_local_add(i, l) local_add((i), &__get_cpu_var(l))
52#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) 65#define cpu_local_sub(i, l) local_sub((i), &__get_cpu_var(l))
53 66
54/* Non-atomic increments, ie. preemption disabled and won't be touched 67/* Non-atomic increments, ie. preemption disabled and won't be touched
55 * in interrupt, etc. Some archs can optimize this case well. 68 * in interrupt, etc. Some archs can optimize this case well.
56 */ 69 */
57#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v)) 70#define __cpu_local_inc(l) __local_inc(&__get_cpu_var(l))
58#define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v)) 71#define __cpu_local_dec(l) __local_dec(&__get_cpu_var(l))
59#define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v)) 72#define __cpu_local_add(i, l) __local_add((i), &__get_cpu_var(l))
60#define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v)) 73#define __cpu_local_sub(i, l) __local_sub((i), &__get_cpu_var(l))
61 74
62#endif /* _ASM_GENERIC_LOCAL_H */ 75#endif /* _ASM_GENERIC_LOCAL_H */
diff --git a/include/asm-h8300/irq.h b/include/asm-h8300/irq.h
index 42a3ac424a9e..41be646c3514 100644
--- a/include/asm-h8300/irq.h
+++ b/include/asm-h8300/irq.h
@@ -61,6 +61,5 @@ static __inline__ int irq_canonicalize(int irq)
61 61
62extern void enable_irq(unsigned int); 62extern void enable_irq(unsigned int);
63extern void disable_irq(unsigned int); 63extern void disable_irq(unsigned int);
64#define disable_irq_nosync(x) disable_irq(x)
65 64
66#endif /* _H8300_IRQ_H_ */ 65#endif /* _H8300_IRQ_H_ */
diff --git a/include/asm-h8300/irq_regs.h b/include/asm-h8300/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/include/asm-h8300/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/include/asm-h8300/kdebug.h b/include/asm-h8300/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-h8300/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-h8300/pgtable.h b/include/asm-h8300/pgtable.h
index 8b7c6857998b..a09230a08e02 100644
--- a/include/asm-h8300/pgtable.h
+++ b/include/asm-h8300/pgtable.h
@@ -55,10 +55,6 @@ extern int is_in_rom(unsigned long);
55#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 55#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
56 remap_pfn_range(vma, vaddr, pfn, size, prot) 56 remap_pfn_range(vma, vaddr, pfn, size, prot)
57 57
58#define MK_IOSPACE_PFN(space, pfn) (pfn)
59#define GET_IOSPACE(pfn) 0
60#define GET_PFN(pfn) (pfn)
61
62/* 58/*
63 * All 32bit addresses are effectively valid for vmalloc... 59 * All 32bit addresses are effectively valid for vmalloc...
64 * Sort of meaningless for non-VM targets. 60 * Sort of meaningless for non-VM targets.
@@ -73,4 +69,5 @@ extern int is_in_rom(unsigned long);
73#define VMALLOC_START 0 69#define VMALLOC_START 0
74#define VMALLOC_END 0xffffffff 70#define VMALLOC_END 0xffffffff
75 71
72#define arch_enter_lazy_cpu_mode() do {} while (0)
76#endif /* _H8300_PGTABLE_H */ 73#endif /* _H8300_PGTABLE_H */
diff --git a/include/asm-h8300/system.h b/include/asm-h8300/system.h
index 5084a9d42922..7807018f8500 100644
--- a/include/asm-h8300/system.h
+++ b/include/asm-h8300/system.h
@@ -98,7 +98,6 @@ asmlinkage void resume(void);
98#endif 98#endif
99 99
100#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 100#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
101#define tas(ptr) (xchg((ptr),1))
102 101
103struct __xchg_dummy { unsigned long a[100]; }; 102struct __xchg_dummy { unsigned long a[100]; };
104#define __xg(x) ((volatile struct __xchg_dummy *)(x)) 103#define __xg(x) ((volatile struct __xchg_dummy *)(x))
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 4dd272331361..0baa2f89463c 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <asm/processor.h> 5#include <asm/processor.h>
6#include <asm/cmpxchg.h>
6 7
7/* 8/*
8 * Atomic operations that C can't guarantee us. Useful for 9 * Atomic operations that C can't guarantee us. Useful for
@@ -51,7 +52,7 @@ static __inline__ void atomic_add(int i, atomic_t *v)
51} 52}
52 53
53/** 54/**
54 * atomic_sub - subtract the atomic variable 55 * atomic_sub - subtract integer from atomic variable
55 * @i: integer value to subtract 56 * @i: integer value to subtract
56 * @v: pointer of type atomic_t 57 * @v: pointer of type atomic_t
57 * 58 *
@@ -170,7 +171,7 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v)
170} 171}
171 172
172/** 173/**
173 * atomic_add_return - add and return 174 * atomic_add_return - add integer and return
174 * @v: pointer of type atomic_t 175 * @v: pointer of type atomic_t
175 * @i: integer value to add 176 * @i: integer value to add
176 * 177 *
@@ -202,13 +203,20 @@ no_xadd: /* Legacy 386 processor */
202#endif 203#endif
203} 204}
204 205
206/**
207 * atomic_sub_return - subtract integer and return
208 * @v: pointer of type atomic_t
209 * @i: integer value to subtract
210 *
211 * Atomically subtracts @i from @v and returns @v - @i
212 */
205static __inline__ int atomic_sub_return(int i, atomic_t *v) 213static __inline__ int atomic_sub_return(int i, atomic_t *v)
206{ 214{
207 return atomic_add_return(-i,v); 215 return atomic_add_return(-i,v);
208} 216}
209 217
210#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) 218#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
211#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 219#define atomic_xchg(v, new) (xchg(&((v)->counter), (new)))
212 220
213/** 221/**
214 * atomic_add_unless - add unless the number is already a given value 222 * atomic_add_unless - add unless the number is already a given value
@@ -219,20 +227,21 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v)
219 * Atomically adds @a to @v, so long as @v was not already @u. 227 * Atomically adds @a to @v, so long as @v was not already @u.
220 * Returns non-zero if @v was not @u, and zero otherwise. 228 * Returns non-zero if @v was not @u, and zero otherwise.
221 */ 229 */
222#define atomic_add_unless(v, a, u) \ 230static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
223({ \ 231{
224 int c, old; \ 232 int c, old;
225 c = atomic_read(v); \ 233 c = atomic_read(v);
226 for (;;) { \ 234 for (;;) {
227 if (unlikely(c == (u))) \ 235 if (unlikely(c == (u)))
228 break; \ 236 break;
229 old = atomic_cmpxchg((v), c, c + (a)); \ 237 old = atomic_cmpxchg((v), c, c + (a));
230 if (likely(old == c)) \ 238 if (likely(old == c))
231 break; \ 239 break;
232 c = old; \ 240 c = old;
233 } \ 241 }
234 c != (u); \ 242 return c != (u);
235}) 243}
244
236#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 245#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
237 246
238#define atomic_inc_return(v) (atomic_add_return(1,v)) 247#define atomic_inc_return(v) (atomic_add_return(1,v))
diff --git a/include/asm-i386/cmpxchg.h b/include/asm-i386/cmpxchg.h
new file mode 100644
index 000000000000..7adcef0cd53b
--- /dev/null
+++ b/include/asm-i386/cmpxchg.h
@@ -0,0 +1,293 @@
1#ifndef __ASM_CMPXCHG_H
2#define __ASM_CMPXCHG_H
3
4#include <linux/bitops.h> /* for LOCK_PREFIX */
5
6#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
7
8struct __xchg_dummy { unsigned long a[100]; };
9#define __xg(x) ((struct __xchg_dummy *)(x))
10
11
12#ifdef CONFIG_X86_CMPXCHG64
13
14/*
15 * The semantics of XCHGCMP8B are a bit strange, this is why
16 * there is a loop and the loading of %%eax and %%edx has to
17 * be inside. This inlines well in most cases, the cached
18 * cost is around ~38 cycles. (in the future we might want
19 * to do an SIMD/3DNOW!/MMX/FPU 64-bit store here, but that
20 * might have an implicit FPU-save as a cost, so it's not
21 * clear which path to go.)
22 *
23 * cmpxchg8b must be used with the lock prefix here to allow
24 * the instruction to be executed atomically, see page 3-102
25 * of the instruction set reference 24319102.pdf. We need
26 * the reader side to see the coherent 64bit value.
27 */
28static inline void __set_64bit (unsigned long long * ptr,
29 unsigned int low, unsigned int high)
30{
31 __asm__ __volatile__ (
32 "\n1:\t"
33 "movl (%0), %%eax\n\t"
34 "movl 4(%0), %%edx\n\t"
35 "lock cmpxchg8b (%0)\n\t"
36 "jnz 1b"
37 : /* no outputs */
38 : "D"(ptr),
39 "b"(low),
40 "c"(high)
41 : "ax","dx","memory");
42}
43
44static inline void __set_64bit_constant (unsigned long long *ptr,
45 unsigned long long value)
46{
47 __set_64bit(ptr,(unsigned int)(value), (unsigned int)((value)>>32ULL));
48}
49#define ll_low(x) *(((unsigned int*)&(x))+0)
50#define ll_high(x) *(((unsigned int*)&(x))+1)
51
52static inline void __set_64bit_var (unsigned long long *ptr,
53 unsigned long long value)
54{
55 __set_64bit(ptr,ll_low(value), ll_high(value));
56}
57
58#define set_64bit(ptr,value) \
59(__builtin_constant_p(value) ? \
60 __set_64bit_constant(ptr, value) : \
61 __set_64bit_var(ptr, value) )
62
63#define _set_64bit(ptr,value) \
64(__builtin_constant_p(value) ? \
65 __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \
66 __set_64bit(ptr, ll_low(value), ll_high(value)) )
67
68#endif
69
70/*
71 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
72 * Note 2: xchg has side effect, so that attribute volatile is necessary,
73 * but generally the primitive is invalid, *ptr is output argument. --ANK
74 */
75static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
76{
77 switch (size) {
78 case 1:
79 __asm__ __volatile__("xchgb %b0,%1"
80 :"=q" (x)
81 :"m" (*__xg(ptr)), "0" (x)
82 :"memory");
83 break;
84 case 2:
85 __asm__ __volatile__("xchgw %w0,%1"
86 :"=r" (x)
87 :"m" (*__xg(ptr)), "0" (x)
88 :"memory");
89 break;
90 case 4:
91 __asm__ __volatile__("xchgl %0,%1"
92 :"=r" (x)
93 :"m" (*__xg(ptr)), "0" (x)
94 :"memory");
95 break;
96 }
97 return x;
98}
99
100/*
101 * Atomic compare and exchange. Compare OLD with MEM, if identical,
102 * store NEW in MEM. Return the initial value in MEM. Success is
103 * indicated by comparing RETURN with OLD.
104 */
105
106#ifdef CONFIG_X86_CMPXCHG
107#define __HAVE_ARCH_CMPXCHG 1
108#define cmpxchg(ptr,o,n)\
109 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
110 (unsigned long)(n),sizeof(*(ptr))))
111#define sync_cmpxchg(ptr,o,n)\
112 ((__typeof__(*(ptr)))__sync_cmpxchg((ptr),(unsigned long)(o),\
113 (unsigned long)(n),sizeof(*(ptr))))
114#define cmpxchg_local(ptr,o,n)\
115 ((__typeof__(*(ptr)))__cmpxchg_local((ptr),(unsigned long)(o),\
116 (unsigned long)(n),sizeof(*(ptr))))
117#endif
118
119static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
120 unsigned long new, int size)
121{
122 unsigned long prev;
123 switch (size) {
124 case 1:
125 __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
126 : "=a"(prev)
127 : "q"(new), "m"(*__xg(ptr)), "0"(old)
128 : "memory");
129 return prev;
130 case 2:
131 __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
132 : "=a"(prev)
133 : "r"(new), "m"(*__xg(ptr)), "0"(old)
134 : "memory");
135 return prev;
136 case 4:
137 __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
138 : "=a"(prev)
139 : "r"(new), "m"(*__xg(ptr)), "0"(old)
140 : "memory");
141 return prev;
142 }
143 return old;
144}
145
146/*
147 * Always use locked operations when touching memory shared with a
148 * hypervisor, since the system may be SMP even if the guest kernel
149 * isn't.
150 */
151static inline unsigned long __sync_cmpxchg(volatile void *ptr,
152 unsigned long old,
153 unsigned long new, int size)
154{
155 unsigned long prev;
156 switch (size) {
157 case 1:
158 __asm__ __volatile__("lock; cmpxchgb %b1,%2"
159 : "=a"(prev)
160 : "q"(new), "m"(*__xg(ptr)), "0"(old)
161 : "memory");
162 return prev;
163 case 2:
164 __asm__ __volatile__("lock; cmpxchgw %w1,%2"
165 : "=a"(prev)
166 : "r"(new), "m"(*__xg(ptr)), "0"(old)
167 : "memory");
168 return prev;
169 case 4:
170 __asm__ __volatile__("lock; cmpxchgl %1,%2"
171 : "=a"(prev)
172 : "r"(new), "m"(*__xg(ptr)), "0"(old)
173 : "memory");
174 return prev;
175 }
176 return old;
177}
178
179static inline unsigned long __cmpxchg_local(volatile void *ptr,
180 unsigned long old, unsigned long new, int size)
181{
182 unsigned long prev;
183 switch (size) {
184 case 1:
185 __asm__ __volatile__("cmpxchgb %b1,%2"
186 : "=a"(prev)
187 : "q"(new), "m"(*__xg(ptr)), "0"(old)
188 : "memory");
189 return prev;
190 case 2:
191 __asm__ __volatile__("cmpxchgw %w1,%2"
192 : "=a"(prev)
193 : "r"(new), "m"(*__xg(ptr)), "0"(old)
194 : "memory");
195 return prev;
196 case 4:
197 __asm__ __volatile__("cmpxchgl %1,%2"
198 : "=a"(prev)
199 : "r"(new), "m"(*__xg(ptr)), "0"(old)
200 : "memory");
201 return prev;
202 }
203 return old;
204}
205
206#ifndef CONFIG_X86_CMPXCHG
207/*
208 * Building a kernel capable running on 80386. It may be necessary to
209 * simulate the cmpxchg on the 80386 CPU. For that purpose we define
210 * a function for each of the sizes we support.
211 */
212
213extern unsigned long cmpxchg_386_u8(volatile void *, u8, u8);
214extern unsigned long cmpxchg_386_u16(volatile void *, u16, u16);
215extern unsigned long cmpxchg_386_u32(volatile void *, u32, u32);
216
217static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
218 unsigned long new, int size)
219{
220 switch (size) {
221 case 1:
222 return cmpxchg_386_u8(ptr, old, new);
223 case 2:
224 return cmpxchg_386_u16(ptr, old, new);
225 case 4:
226 return cmpxchg_386_u32(ptr, old, new);
227 }
228 return old;
229}
230
231#define cmpxchg(ptr,o,n) \
232({ \
233 __typeof__(*(ptr)) __ret; \
234 if (likely(boot_cpu_data.x86 > 3)) \
235 __ret = __cmpxchg((ptr), (unsigned long)(o), \
236 (unsigned long)(n), sizeof(*(ptr))); \
237 else \
238 __ret = cmpxchg_386((ptr), (unsigned long)(o), \
239 (unsigned long)(n), sizeof(*(ptr))); \
240 __ret; \
241})
242#define cmpxchg_local(ptr,o,n) \
243({ \
244 __typeof__(*(ptr)) __ret; \
245 if (likely(boot_cpu_data.x86 > 3)) \
246 __ret = __cmpxchg_local((ptr), (unsigned long)(o), \
247 (unsigned long)(n), sizeof(*(ptr))); \
248 else \
249 __ret = cmpxchg_386((ptr), (unsigned long)(o), \
250 (unsigned long)(n), sizeof(*(ptr))); \
251 __ret; \
252})
253#endif
254
255#ifdef CONFIG_X86_CMPXCHG64
256
257static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old,
258 unsigned long long new)
259{
260 unsigned long long prev;
261 __asm__ __volatile__(LOCK_PREFIX "cmpxchg8b %3"
262 : "=A"(prev)
263 : "b"((unsigned long)new),
264 "c"((unsigned long)(new >> 32)),
265 "m"(*__xg(ptr)),
266 "0"(old)
267 : "memory");
268 return prev;
269}
270
271static inline unsigned long long __cmpxchg64_local(volatile void *ptr,
272 unsigned long long old, unsigned long long new)
273{
274 unsigned long long prev;
275 __asm__ __volatile__("cmpxchg8b %3"
276 : "=A"(prev)
277 : "b"((unsigned long)new),
278 "c"((unsigned long)(new >> 32)),
279 "m"(*__xg(ptr)),
280 "0"(old)
281 : "memory");
282 return prev;
283}
284
285#define cmpxchg64(ptr,o,n)\
286 ((__typeof__(*(ptr)))__cmpxchg64((ptr),(unsigned long long)(o),\
287 (unsigned long long)(n)))
288#define cmpxchg64_local(ptr,o,n)\
289 ((__typeof__(*(ptr)))__cmpxchg64_local((ptr),(unsigned long long)(o),\
290 (unsigned long long)(n)))
291#endif
292
293#endif
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index d304ab4161ff..b32df3a332da 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -9,8 +9,6 @@
9#include <asm/user.h> 9#include <asm/user.h>
10#include <asm/auxvec.h> 10#include <asm/auxvec.h>
11 11
12#include <linux/utsname.h>
13
14#define R_386_NONE 0 12#define R_386_NONE 0
15#define R_386_32 1 13#define R_386_32 1
16#define R_386_PC32 2 14#define R_386_PC32 2
diff --git a/include/asm-i386/ioctls.h b/include/asm-i386/ioctls.h
index f962fadab0fa..ef5878762dc9 100644
--- a/include/asm-i386/ioctls.h
+++ b/include/asm-i386/ioctls.h
@@ -47,6 +47,10 @@
47#define TIOCSBRK 0x5427 /* BSD compatibility */ 47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */ 48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */ 49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TCGETS2 _IOR('T',0x2A, struct termios2)
51#define TCSETS2 _IOW('T',0x2B, struct termios2)
52#define TCSETSW2 _IOW('T',0x2C, struct termios2)
53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
50#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
51#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
52 56
diff --git a/include/asm-i386/kdebug.h b/include/asm-i386/kdebug.h
index d18cdb9fc9a6..05c3117788b9 100644
--- a/include/asm-i386/kdebug.h
+++ b/include/asm-i386/kdebug.h
@@ -9,19 +9,8 @@
9 9
10struct pt_regs; 10struct pt_regs;
11 11
12struct die_args {
13 struct pt_regs *regs;
14 const char *str;
15 long err;
16 int trapnr;
17 int signr;
18};
19
20extern int register_die_notifier(struct notifier_block *);
21extern int unregister_die_notifier(struct notifier_block *);
22extern int register_page_fault_notifier(struct notifier_block *); 12extern int register_page_fault_notifier(struct notifier_block *);
23extern int unregister_page_fault_notifier(struct notifier_block *); 13extern int unregister_page_fault_notifier(struct notifier_block *);
24extern struct atomic_notifier_head i386die_chain;
25 14
26 15
27/* Grossly misnamed. */ 16/* Grossly misnamed. */
@@ -38,20 +27,8 @@ enum die_val {
38 DIE_GPF, 27 DIE_GPF,
39 DIE_CALL, 28 DIE_CALL,
40 DIE_NMI_IPI, 29 DIE_NMI_IPI,
30 DIE_NMI_POST,
41 DIE_PAGE_FAULT, 31 DIE_PAGE_FAULT,
42}; 32};
43 33
44static inline int notify_die(enum die_val val, const char *str,
45 struct pt_regs *regs, long err, int trap, int sig)
46{
47 struct die_args args = {
48 .regs = regs,
49 .str = str,
50 .err = err,
51 .trapnr = trap,
52 .signr = sig
53 };
54 return atomic_notifier_call_chain(&i386die_chain, val, &args);
55}
56
57#endif 34#endif
diff --git a/include/asm-i386/kexec.h b/include/asm-i386/kexec.h
index bcb5b21de2d2..4b9dc9e6b701 100644
--- a/include/asm-i386/kexec.h
+++ b/include/asm-i386/kexec.h
@@ -45,8 +45,6 @@
45/* We can also handle crash dumps from 64 bit kernel. */ 45/* We can also handle crash dumps from 64 bit kernel. */
46#define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64) 46#define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64)
47 47
48#define MAX_NOTE_BYTES 1024
49
50/* CPU does not save ss and esp on stack if execution is already 48/* CPU does not save ss and esp on stack if execution is already
51 * running in kernel mode at the time of NMI occurrence. This code 49 * running in kernel mode at the time of NMI occurrence. This code
52 * fixes it. 50 * fixes it.
diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h
index 12060e22f7e2..e13d3e98823f 100644
--- a/include/asm-i386/local.h
+++ b/include/asm-i386/local.h
@@ -2,47 +2,198 @@
2#define _ARCH_I386_LOCAL_H 2#define _ARCH_I386_LOCAL_H
3 3
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5#include <asm/system.h>
6#include <asm/atomic.h>
5 7
6typedef struct 8typedef struct
7{ 9{
8 volatile long counter; 10 atomic_long_t a;
9} local_t; 11} local_t;
10 12
11#define LOCAL_INIT(i) { (i) } 13#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
12 14
13#define local_read(v) ((v)->counter) 15#define local_read(l) atomic_long_read(&(l)->a)
14#define local_set(v,i) (((v)->counter) = (i)) 16#define local_set(l,i) atomic_long_set(&(l)->a, (i))
15 17
16static __inline__ void local_inc(local_t *v) 18static __inline__ void local_inc(local_t *l)
17{ 19{
18 __asm__ __volatile__( 20 __asm__ __volatile__(
19 "incl %0" 21 "incl %0"
20 :"+m" (v->counter)); 22 :"+m" (l->a.counter));
21} 23}
22 24
23static __inline__ void local_dec(local_t *v) 25static __inline__ void local_dec(local_t *l)
24{ 26{
25 __asm__ __volatile__( 27 __asm__ __volatile__(
26 "decl %0" 28 "decl %0"
27 :"+m" (v->counter)); 29 :"+m" (l->a.counter));
28} 30}
29 31
30static __inline__ void local_add(long i, local_t *v) 32static __inline__ void local_add(long i, local_t *l)
31{ 33{
32 __asm__ __volatile__( 34 __asm__ __volatile__(
33 "addl %1,%0" 35 "addl %1,%0"
34 :"+m" (v->counter) 36 :"+m" (l->a.counter)
35 :"ir" (i)); 37 :"ir" (i));
36} 38}
37 39
38static __inline__ void local_sub(long i, local_t *v) 40static __inline__ void local_sub(long i, local_t *l)
39{ 41{
40 __asm__ __volatile__( 42 __asm__ __volatile__(
41 "subl %1,%0" 43 "subl %1,%0"
42 :"+m" (v->counter) 44 :"+m" (l->a.counter)
43 :"ir" (i)); 45 :"ir" (i));
44} 46}
45 47
48/**
49 * local_sub_and_test - subtract value from variable and test result
50 * @i: integer value to subtract
51 * @l: pointer of type local_t
52 *
53 * Atomically subtracts @i from @l and returns
54 * true if the result is zero, or false for all
55 * other cases.
56 */
57static __inline__ int local_sub_and_test(long i, local_t *l)
58{
59 unsigned char c;
60
61 __asm__ __volatile__(
62 "subl %2,%0; sete %1"
63 :"+m" (l->a.counter), "=qm" (c)
64 :"ir" (i) : "memory");
65 return c;
66}
67
68/**
69 * local_dec_and_test - decrement and test
70 * @l: pointer of type local_t
71 *
72 * Atomically decrements @l by 1 and
73 * returns true if the result is 0, or false for all other
74 * cases.
75 */
76static __inline__ int local_dec_and_test(local_t *l)
77{
78 unsigned char c;
79
80 __asm__ __volatile__(
81 "decl %0; sete %1"
82 :"+m" (l->a.counter), "=qm" (c)
83 : : "memory");
84 return c != 0;
85}
86
87/**
88 * local_inc_and_test - increment and test
89 * @l: pointer of type local_t
90 *
91 * Atomically increments @l by 1
92 * and returns true if the result is zero, or false for all
93 * other cases.
94 */
95static __inline__ int local_inc_and_test(local_t *l)
96{
97 unsigned char c;
98
99 __asm__ __volatile__(
100 "incl %0; sete %1"
101 :"+m" (l->a.counter), "=qm" (c)
102 : : "memory");
103 return c != 0;
104}
105
106/**
107 * local_add_negative - add and test if negative
108 * @l: pointer of type local_t
109 * @i: integer value to add
110 *
111 * Atomically adds @i to @l and returns true
112 * if the result is negative, or false when
113 * result is greater than or equal to zero.
114 */
115static __inline__ int local_add_negative(long i, local_t *l)
116{
117 unsigned char c;
118
119 __asm__ __volatile__(
120 "addl %2,%0; sets %1"
121 :"+m" (l->a.counter), "=qm" (c)
122 :"ir" (i) : "memory");
123 return c;
124}
125
126/**
127 * local_add_return - add and return
128 * @l: pointer of type local_t
129 * @i: integer value to add
130 *
131 * Atomically adds @i to @l and returns @i + @l
132 */
133static __inline__ long local_add_return(long i, local_t *l)
134{
135 long __i;
136#ifdef CONFIG_M386
137 unsigned long flags;
138 if(unlikely(boot_cpu_data.x86==3))
139 goto no_xadd;
140#endif
141 /* Modern 486+ processor */
142 __i = i;
143 __asm__ __volatile__(
144 "xaddl %0, %1;"
145 :"+r" (i), "+m" (l->a.counter)
146 : : "memory");
147 return i + __i;
148
149#ifdef CONFIG_M386
150no_xadd: /* Legacy 386 processor */
151 local_irq_save(flags);
152 __i = local_read(l);
153 local_set(l, i + __i);
154 local_irq_restore(flags);
155 return i + __i;
156#endif
157}
158
159static __inline__ long local_sub_return(long i, local_t *l)
160{
161 return local_add_return(-i,l);
162}
163
164#define local_inc_return(l) (local_add_return(1,l))
165#define local_dec_return(l) (local_sub_return(1,l))
166
167#define local_cmpxchg(l, o, n) \
168 (cmpxchg_local(&((l)->a.counter), (o), (n)))
169/* Always has a lock prefix */
170#define local_xchg(l, n) (xchg(&((l)->a.counter), (n)))
171
172/**
173 * local_add_unless - add unless the number is a given value
174 * @l: pointer of type local_t
175 * @a: the amount to add to l...
176 * @u: ...unless l is equal to u.
177 *
178 * Atomically adds @a to @l, so long as it was not @u.
179 * Returns non-zero if @l was not @u, and zero otherwise.
180 */
181#define local_add_unless(l, a, u) \
182({ \
183 long c, old; \
184 c = local_read(l); \
185 for (;;) { \
186 if (unlikely(c == (u))) \
187 break; \
188 old = local_cmpxchg((l), c, c + (a)); \
189 if (likely(old == c)) \
190 break; \
191 c = old; \
192 } \
193 c != (u); \
194})
195#define local_inc_not_zero(l) local_add_unless((l), 1, 0)
196
46/* On x86, these are no better than the atomic variants. */ 197/* On x86, these are no better than the atomic variants. */
47#define __local_inc(l) local_inc(l) 198#define __local_inc(l) local_inc(l)
48#define __local_dec(l) local_dec(l) 199#define __local_dec(l) local_dec(l)
@@ -56,27 +207,27 @@ static __inline__ void local_sub(long i, local_t *v)
56 207
57/* Need to disable preemption for the cpu local counters otherwise we could 208/* Need to disable preemption for the cpu local counters otherwise we could
58 still access a variable of a previous CPU in a non atomic way. */ 209 still access a variable of a previous CPU in a non atomic way. */
59#define cpu_local_wrap_v(v) \ 210#define cpu_local_wrap_v(l) \
60 ({ local_t res__; \ 211 ({ local_t res__; \
61 preempt_disable(); \ 212 preempt_disable(); \
62 res__ = (v); \ 213 res__ = (l); \
63 preempt_enable(); \ 214 preempt_enable(); \
64 res__; }) 215 res__; })
65#define cpu_local_wrap(v) \ 216#define cpu_local_wrap(l) \
66 ({ preempt_disable(); \ 217 ({ preempt_disable(); \
67 v; \ 218 l; \
68 preempt_enable(); }) \ 219 preempt_enable(); }) \
69 220
70#define cpu_local_read(v) cpu_local_wrap_v(local_read(&__get_cpu_var(v))) 221#define cpu_local_read(l) cpu_local_wrap_v(local_read(&__get_cpu_var(l)))
71#define cpu_local_set(v, i) cpu_local_wrap(local_set(&__get_cpu_var(v), (i))) 222#define cpu_local_set(l, i) cpu_local_wrap(local_set(&__get_cpu_var(l), (i)))
72#define cpu_local_inc(v) cpu_local_wrap(local_inc(&__get_cpu_var(v))) 223#define cpu_local_inc(l) cpu_local_wrap(local_inc(&__get_cpu_var(l)))
73#define cpu_local_dec(v) cpu_local_wrap(local_dec(&__get_cpu_var(v))) 224#define cpu_local_dec(l) cpu_local_wrap(local_dec(&__get_cpu_var(l)))
74#define cpu_local_add(i, v) cpu_local_wrap(local_add((i), &__get_cpu_var(v))) 225#define cpu_local_add(i, l) cpu_local_wrap(local_add((i), &__get_cpu_var(l)))
75#define cpu_local_sub(i, v) cpu_local_wrap(local_sub((i), &__get_cpu_var(v))) 226#define cpu_local_sub(i, l) cpu_local_wrap(local_sub((i), &__get_cpu_var(l)))
76 227
77#define __cpu_local_inc(v) cpu_local_inc(v) 228#define __cpu_local_inc(l) cpu_local_inc(l)
78#define __cpu_local_dec(v) cpu_local_dec(v) 229#define __cpu_local_dec(l) cpu_local_dec(l)
79#define __cpu_local_add(i, v) cpu_local_add((i), (v)) 230#define __cpu_local_add(i, l) cpu_local_add((i), (l))
80#define __cpu_local_sub(i, v) cpu_local_sub((i), (v)) 231#define __cpu_local_sub(i, l) cpu_local_sub((i), (l))
81 232
82#endif /* _ARCH_I386_LOCAL_H */ 233#endif /* _ARCH_I386_LOCAL_H */
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h
index 9559894c7658..26861df52cc4 100644
--- a/include/asm-i386/msr.h
+++ b/include/asm-i386/msr.h
@@ -77,7 +77,7 @@ static inline unsigned long long native_read_pmc(void)
77#ifdef CONFIG_PARAVIRT 77#ifdef CONFIG_PARAVIRT
78#include <asm/paravirt.h> 78#include <asm/paravirt.h>
79#else 79#else
80 80#include <linux/errno.h>
81/* 81/*
82 * Access to machine-specific registers (available on 586 and better only) 82 * Access to machine-specific registers (available on 586 and better only)
83 * Note: the rd* operations modify the parameters directly (without using 83 * Note: the rd* operations modify the parameters directly (without using
@@ -148,6 +148,8 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
148#ifdef CONFIG_SMP 148#ifdef CONFIG_SMP
149void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 149void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
150void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 150void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
151int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
152int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
151#else /* CONFIG_SMP */ 153#else /* CONFIG_SMP */
152static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) 154static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
153{ 155{
@@ -157,6 +159,14 @@ static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
157{ 159{
158 wrmsr(msr_no, l, h); 160 wrmsr(msr_no, l, h);
159} 161}
162static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
163{
164 return rdmsr_safe(msr_no, l, h);
165}
166static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
167{
168 return wrmsr_safe(msr_no, l, h);
169}
160#endif /* CONFIG_SMP */ 170#endif /* CONFIG_SMP */
161#endif 171#endif
162#endif 172#endif
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index c6b8b944120c..edce9d51a676 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -243,8 +243,6 @@ static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; re
243static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } 243static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; }
244static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return pte; } 244static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return pte; }
245 245
246extern void vmalloc_sync_all(void);
247
248#ifdef CONFIG_X86_PAE 246#ifdef CONFIG_X86_PAE
249# include <asm/pgtable-3level.h> 247# include <asm/pgtable-3level.h>
250#else 248#else
@@ -296,12 +294,25 @@ do { \
296 } \ 294 } \
297} while (0) 295} while (0)
298 296
299/*
300 * We don't actually have these, but we want to advertise them so that
301 * we can encompass the flush here.
302 */
303#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 297#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
298#define ptep_test_and_clear_dirty(vma, addr, ptep) ({ \
299 int ret = 0; \
300 if (pte_dirty(*ptep)) \
301 ret = test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low); \
302 if (ret) \
303 pte_update_defer(vma->vm_mm, addr, ptep); \
304 ret; \
305})
306
304#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 307#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
308#define ptep_test_and_clear_young(vma, addr, ptep) ({ \
309 int ret = 0; \
310 if (pte_young(*ptep)) \
311 ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); \
312 if (ret) \
313 pte_update_defer(vma->vm_mm, addr, ptep); \
314 ret; \
315})
305 316
306/* 317/*
307 * Rules for using ptep_establish: the pte MUST be a user pte, and 318 * Rules for using ptep_establish: the pte MUST be a user pte, and
@@ -318,12 +329,9 @@ do { \
318#define ptep_clear_flush_dirty(vma, address, ptep) \ 329#define ptep_clear_flush_dirty(vma, address, ptep) \
319({ \ 330({ \
320 int __dirty; \ 331 int __dirty; \
321 __dirty = pte_dirty(*(ptep)); \ 332 __dirty = ptep_test_and_clear_dirty((vma), (address), (ptep)); \
322 if (__dirty) { \ 333 if (__dirty) \
323 clear_bit(_PAGE_BIT_DIRTY, &(ptep)->pte_low); \
324 pte_update_defer((vma)->vm_mm, (address), (ptep)); \
325 flush_tlb_page(vma, address); \ 334 flush_tlb_page(vma, address); \
326 } \
327 __dirty; \ 335 __dirty; \
328}) 336})
329 337
@@ -331,12 +339,9 @@ do { \
331#define ptep_clear_flush_young(vma, address, ptep) \ 339#define ptep_clear_flush_young(vma, address, ptep) \
332({ \ 340({ \
333 int __young; \ 341 int __young; \
334 __young = pte_young(*(ptep)); \ 342 __young = ptep_test_and_clear_young((vma), (address), (ptep)); \
335 if (__young) { \ 343 if (__young) \
336 clear_bit(_PAGE_BIT_ACCESSED, &(ptep)->pte_low); \
337 pte_update_defer((vma)->vm_mm, (address), (ptep)); \
338 flush_tlb_page(vma, address); \ 344 flush_tlb_page(vma, address); \
339 } \
340 __young; \ 345 __young; \
341}) 346})
342 347
@@ -537,10 +542,6 @@ static inline void paravirt_pagetable_setup_done(pgd_t *base)
537#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 542#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
538 remap_pfn_range(vma, vaddr, pfn, size, prot) 543 remap_pfn_range(vma, vaddr, pfn, size, prot)
539 544
540#define MK_IOSPACE_PFN(space, pfn) (pfn)
541#define GET_IOSPACE(pfn) 0
542#define GET_PFN(pfn) (pfn)
543
544#include <asm-generic/pgtable.h> 545#include <asm-generic/pgtable.h>
545 546
546#endif /* _I386_PGTABLE_H */ 547#endif /* _I386_PGTABLE_H */
diff --git a/include/asm-i386/serial.h b/include/asm-i386/serial.h
index bd67480ca109..57a4306cdf63 100644
--- a/include/asm-i386/serial.h
+++ b/include/asm-i386/serial.h
@@ -11,19 +11,3 @@
11 * megabits/second; but this requires the faster clock. 11 * megabits/second; but this requires the faster clock.
12 */ 12 */
13#define BASE_BAUD ( 1843200 / 16 ) 13#define BASE_BAUD ( 1843200 / 16 )
14
15/* Standard COM flags (except for COM4, because of the 8514 problem) */
16#ifdef CONFIG_SERIAL_DETECT_IRQ
17#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
18#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
19#else
20#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
21#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
22#endif
23
24#define SERIAL_PORT_DFNS \
25 /* UART CLK PORT IRQ FLAGS */ \
26 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
27 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
28 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
29 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index c3a58c08c495..94ed3686a5f3 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -4,7 +4,7 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <asm/segment.h> 5#include <asm/segment.h>
6#include <asm/cpufeature.h> 6#include <asm/cpufeature.h>
7#include <linux/bitops.h> /* for LOCK_PREFIX */ 7#include <asm/cmpxchg.h>
8 8
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10 10
@@ -195,238 +195,6 @@ static inline unsigned long get_limit(unsigned long segment)
195 195
196#define nop() __asm__ __volatile__ ("nop") 196#define nop() __asm__ __volatile__ ("nop")
197 197
198#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
199
200#define tas(ptr) (xchg((ptr),1))
201
202struct __xchg_dummy { unsigned long a[100]; };
203#define __xg(x) ((struct __xchg_dummy *)(x))
204
205
206#ifdef CONFIG_X86_CMPXCHG64
207
208/*
209 * The semantics of XCHGCMP8B are a bit strange, this is why
210 * there is a loop and the loading of %%eax and %%edx has to
211 * be inside. This inlines well in most cases, the cached
212 * cost is around ~38 cycles. (in the future we might want
213 * to do an SIMD/3DNOW!/MMX/FPU 64-bit store here, but that
214 * might have an implicit FPU-save as a cost, so it's not
215 * clear which path to go.)
216 *
217 * cmpxchg8b must be used with the lock prefix here to allow
218 * the instruction to be executed atomically, see page 3-102
219 * of the instruction set reference 24319102.pdf. We need
220 * the reader side to see the coherent 64bit value.
221 */
222static inline void __set_64bit (unsigned long long * ptr,
223 unsigned int low, unsigned int high)
224{
225 __asm__ __volatile__ (
226 "\n1:\t"
227 "movl (%0), %%eax\n\t"
228 "movl 4(%0), %%edx\n\t"
229 "lock cmpxchg8b (%0)\n\t"
230 "jnz 1b"
231 : /* no outputs */
232 : "D"(ptr),
233 "b"(low),
234 "c"(high)
235 : "ax","dx","memory");
236}
237
238static inline void __set_64bit_constant (unsigned long long *ptr,
239 unsigned long long value)
240{
241 __set_64bit(ptr,(unsigned int)(value), (unsigned int)((value)>>32ULL));
242}
243#define ll_low(x) *(((unsigned int*)&(x))+0)
244#define ll_high(x) *(((unsigned int*)&(x))+1)
245
246static inline void __set_64bit_var (unsigned long long *ptr,
247 unsigned long long value)
248{
249 __set_64bit(ptr,ll_low(value), ll_high(value));
250}
251
252#define set_64bit(ptr,value) \
253(__builtin_constant_p(value) ? \
254 __set_64bit_constant(ptr, value) : \
255 __set_64bit_var(ptr, value) )
256
257#define _set_64bit(ptr,value) \
258(__builtin_constant_p(value) ? \
259 __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \
260 __set_64bit(ptr, ll_low(value), ll_high(value)) )
261
262#endif
263
264/*
265 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
266 * Note 2: xchg has side effect, so that attribute volatile is necessary,
267 * but generally the primitive is invalid, *ptr is output argument. --ANK
268 */
269static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
270{
271 switch (size) {
272 case 1:
273 __asm__ __volatile__("xchgb %b0,%1"
274 :"=q" (x)
275 :"m" (*__xg(ptr)), "0" (x)
276 :"memory");
277 break;
278 case 2:
279 __asm__ __volatile__("xchgw %w0,%1"
280 :"=r" (x)
281 :"m" (*__xg(ptr)), "0" (x)
282 :"memory");
283 break;
284 case 4:
285 __asm__ __volatile__("xchgl %0,%1"
286 :"=r" (x)
287 :"m" (*__xg(ptr)), "0" (x)
288 :"memory");
289 break;
290 }
291 return x;
292}
293
294/*
295 * Atomic compare and exchange. Compare OLD with MEM, if identical,
296 * store NEW in MEM. Return the initial value in MEM. Success is
297 * indicated by comparing RETURN with OLD.
298 */
299
300#ifdef CONFIG_X86_CMPXCHG
301#define __HAVE_ARCH_CMPXCHG 1
302#define cmpxchg(ptr,o,n)\
303 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
304 (unsigned long)(n),sizeof(*(ptr))))
305#define sync_cmpxchg(ptr,o,n)\
306 ((__typeof__(*(ptr)))__sync_cmpxchg((ptr),(unsigned long)(o),\
307 (unsigned long)(n),sizeof(*(ptr))))
308#endif
309
310static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
311 unsigned long new, int size)
312{
313 unsigned long prev;
314 switch (size) {
315 case 1:
316 __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
317 : "=a"(prev)
318 : "q"(new), "m"(*__xg(ptr)), "0"(old)
319 : "memory");
320 return prev;
321 case 2:
322 __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
323 : "=a"(prev)
324 : "r"(new), "m"(*__xg(ptr)), "0"(old)
325 : "memory");
326 return prev;
327 case 4:
328 __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
329 : "=a"(prev)
330 : "r"(new), "m"(*__xg(ptr)), "0"(old)
331 : "memory");
332 return prev;
333 }
334 return old;
335}
336
337/*
338 * Always use locked operations when touching memory shared with a
339 * hypervisor, since the system may be SMP even if the guest kernel
340 * isn't.
341 */
342static inline unsigned long __sync_cmpxchg(volatile void *ptr,
343 unsigned long old,
344 unsigned long new, int size)
345{
346 unsigned long prev;
347 switch (size) {
348 case 1:
349 __asm__ __volatile__("lock; cmpxchgb %b1,%2"
350 : "=a"(prev)
351 : "q"(new), "m"(*__xg(ptr)), "0"(old)
352 : "memory");
353 return prev;
354 case 2:
355 __asm__ __volatile__("lock; cmpxchgw %w1,%2"
356 : "=a"(prev)
357 : "r"(new), "m"(*__xg(ptr)), "0"(old)
358 : "memory");
359 return prev;
360 case 4:
361 __asm__ __volatile__("lock; cmpxchgl %1,%2"
362 : "=a"(prev)
363 : "r"(new), "m"(*__xg(ptr)), "0"(old)
364 : "memory");
365 return prev;
366 }
367 return old;
368}
369
370#ifndef CONFIG_X86_CMPXCHG
371/*
372 * Building a kernel capable running on 80386. It may be necessary to
373 * simulate the cmpxchg on the 80386 CPU. For that purpose we define
374 * a function for each of the sizes we support.
375 */
376
377extern unsigned long cmpxchg_386_u8(volatile void *, u8, u8);
378extern unsigned long cmpxchg_386_u16(volatile void *, u16, u16);
379extern unsigned long cmpxchg_386_u32(volatile void *, u32, u32);
380
381static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
382 unsigned long new, int size)
383{
384 switch (size) {
385 case 1:
386 return cmpxchg_386_u8(ptr, old, new);
387 case 2:
388 return cmpxchg_386_u16(ptr, old, new);
389 case 4:
390 return cmpxchg_386_u32(ptr, old, new);
391 }
392 return old;
393}
394
395#define cmpxchg(ptr,o,n) \
396({ \
397 __typeof__(*(ptr)) __ret; \
398 if (likely(boot_cpu_data.x86 > 3)) \
399 __ret = __cmpxchg((ptr), (unsigned long)(o), \
400 (unsigned long)(n), sizeof(*(ptr))); \
401 else \
402 __ret = cmpxchg_386((ptr), (unsigned long)(o), \
403 (unsigned long)(n), sizeof(*(ptr))); \
404 __ret; \
405})
406#endif
407
408#ifdef CONFIG_X86_CMPXCHG64
409
410static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old,
411 unsigned long long new)
412{
413 unsigned long long prev;
414 __asm__ __volatile__(LOCK_PREFIX "cmpxchg8b %3"
415 : "=A"(prev)
416 : "b"((unsigned long)new),
417 "c"((unsigned long)(new >> 32)),
418 "m"(*__xg(ptr)),
419 "0"(old)
420 : "memory");
421 return prev;
422}
423
424#define cmpxchg64(ptr,o,n)\
425 ((__typeof__(*(ptr)))__cmpxchg64((ptr),(unsigned long long)(o),\
426 (unsigned long long)(n)))
427
428#endif
429
430/* 198/*
431 * Force strict CPU ordering. 199 * Force strict CPU ordering.
432 * And yes, this is required on UP too when we're talking 200 * And yes, this is required on UP too when we're talking
diff --git a/include/asm-i386/termbits.h b/include/asm-i386/termbits.h
index 2e6237693814..a21700352e7b 100644
--- a/include/asm-i386/termbits.h
+++ b/include/asm-i386/termbits.h
@@ -17,6 +17,17 @@ struct termios {
17 cc_t c_cc[NCCS]; /* control characters */ 17 cc_t c_cc[NCCS]; /* control characters */
18}; 18};
19 19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
20struct ktermios { 31struct ktermios {
21 tcflag_t c_iflag; /* input mode flags */ 32 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */ 33 tcflag_t c_oflag; /* output mode flags */
@@ -129,6 +140,7 @@ struct ktermios {
129#define HUPCL 0002000 140#define HUPCL 0002000
130#define CLOCAL 0004000 141#define CLOCAL 0004000
131#define CBAUDEX 0010000 142#define CBAUDEX 0010000
143#define BOTHER 0010000
132#define B57600 0010001 144#define B57600 0010001
133#define B115200 0010002 145#define B115200 0010002
134#define B230400 0010003 146#define B230400 0010003
@@ -148,6 +160,8 @@ struct ktermios {
148#define CMSPAR 010000000000 /* mark or space (stick) parity */ 160#define CMSPAR 010000000000 /* mark or space (stick) parity */
149#define CRTSCTS 020000000000 /* flow control */ 161#define CRTSCTS 020000000000 /* flow control */
150 162
163#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
164
151/* c_lflag bits */ 165/* c_lflag bits */
152#define ISIG 0000001 166#define ISIG 0000001
153#define ICANON 0000002 167#define ICANON 0000002
diff --git a/include/asm-i386/termios.h b/include/asm-i386/termios.h
index 7c99678a8f86..f520b7c16fa2 100644
--- a/include/asm-i386/termios.h
+++ b/include/asm-i386/termios.h
@@ -81,8 +81,10 @@ struct termio {
81 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 81 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
82}) 82})
83 83
84#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) 84#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
85#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) 85#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
86#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
87#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
86 88
87#endif /* __KERNEL__ */ 89#endif /* __KERNEL__ */
88 90
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 4b187bb377b4..bf01d4b342bd 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -95,12 +95,14 @@ static inline struct thread_info *current_thread_info(void)
95 95
96/* thread information allocation */ 96/* thread information allocation */
97#ifdef CONFIG_DEBUG_STACK_USAGE 97#ifdef CONFIG_DEBUG_STACK_USAGE
98#define alloc_thread_info(tsk) kzalloc(THREAD_SIZE, GFP_KERNEL) 98#define alloc_thread_info(tsk) ((struct thread_info *) \
99 __get_free_pages(GFP_KERNEL| __GFP_ZERO, get_order(THREAD_SIZE)))
99#else 100#else
100#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL) 101#define alloc_thread_info(tsk) ((struct thread_info *) \
102 __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE)))
101#endif 103#endif
102 104
103#define free_thread_info(info) kfree(info) 105#define free_thread_info(info) free_pages((unsigned long)(info), get_order(THREAD_SIZE))
104 106
105#else /* !__ASSEMBLY__ */ 107#else /* !__ASSEMBLY__ */
106 108
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 833fa1704ff9..bd21e795197c 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -325,10 +325,11 @@
325#define __NR_move_pages 317 325#define __NR_move_pages 317
326#define __NR_getcpu 318 326#define __NR_getcpu 318
327#define __NR_epoll_pwait 319 327#define __NR_epoll_pwait 319
328#define __NR_utimensat 320
328 329
329#ifdef __KERNEL__ 330#ifdef __KERNEL__
330 331
331#define NR_syscalls 320 332#define NR_syscalls 321
332 333
333#define __ARCH_WANT_IPC_PARSE_VERSION 334#define __ARCH_WANT_IPC_PARSE_VERSION
334#define __ARCH_WANT_OLD_READDIR 335#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-ia64/asmmacro.h b/include/asm-ia64/asmmacro.h
index c22b4658fc61..c1642fd64029 100644
--- a/include/asm-ia64/asmmacro.h
+++ b/include/asm-ia64/asmmacro.h
@@ -104,6 +104,16 @@ name:
104#endif 104#endif
105 105
106/* 106/*
107 * If physical stack register size is different from DEF_NUM_STACK_REG,
108 * dynamically patch the kernel for correct size.
109 */
110 .section ".data.patch.phys_stack_reg", "a"
111 .previous
112#define LOAD_PHYS_STACK_REG_SIZE(reg) \
113[1:] adds reg=IA64_NUM_PHYS_STACK_REG*8+8,r0; \
114 .xdata4 ".data.patch.phys_stack_reg", 1b-.
115
116/*
107 * Up until early 2004, use of .align within a function caused bad unwind info. 117 * Up until early 2004, use of .align within a function caused bad unwind info.
108 * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing 118 * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing
109 * otherwise. 119 * otherwise.
diff --git a/include/asm-ia64/atomic.h b/include/asm-ia64/atomic.h
index 569ec7574baf..1fc3b83325da 100644
--- a/include/asm-ia64/atomic.h
+++ b/include/asm-ia64/atomic.h
@@ -15,6 +15,7 @@
15#include <linux/types.h> 15#include <linux/types.h>
16 16
17#include <asm/intrinsics.h> 17#include <asm/intrinsics.h>
18#include <asm/system.h>
18 19
19/* 20/*
20 * On IA-64, counter must always be volatile to ensure that that the 21 * On IA-64, counter must always be volatile to ensure that that the
@@ -88,25 +89,47 @@ ia64_atomic64_sub (__s64 i, atomic64_t *v)
88 return new; 89 return new;
89} 90}
90 91
91#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) 92#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
92#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 93#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
93 94
94#define atomic_add_unless(v, a, u) \ 95#define atomic64_cmpxchg(v, old, new) \
95({ \ 96 (cmpxchg(&((v)->counter), old, new))
96 int c, old; \ 97#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
97 c = atomic_read(v); \ 98
98 for (;;) { \ 99static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
99 if (unlikely(c == (u))) \ 100{
100 break; \ 101 int c, old;
101 old = atomic_cmpxchg((v), c, c + (a)); \ 102 c = atomic_read(v);
102 if (likely(old == c)) \ 103 for (;;) {
103 break; \ 104 if (unlikely(c == (u)))
104 c = old; \ 105 break;
105 } \ 106 old = atomic_cmpxchg((v), c, c + (a));
106 c != (u); \ 107 if (likely(old == c))
107}) 108 break;
109 c = old;
110 }
111 return c != (u);
112}
113
108#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 114#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
109 115
116static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
117{
118 long c, old;
119 c = atomic64_read(v);
120 for (;;) {
121 if (unlikely(c == (u)))
122 break;
123 old = atomic64_cmpxchg((v), c, c + (a));
124 if (likely(old == c))
125 break;
126 c = old;
127 }
128 return c != (u);
129}
130
131#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
132
110#define atomic_add_return(i,v) \ 133#define atomic_add_return(i,v) \
111({ \ 134({ \
112 int __ia64_aar_i = (i); \ 135 int __ia64_aar_i = (i); \
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
index 6311e168cd34..eb17a8692967 100644
--- a/include/asm-ia64/io.h
+++ b/include/asm-ia64/io.h
@@ -421,11 +421,7 @@ __writeq (unsigned long val, volatile void __iomem *addr)
421 421
422extern void __iomem * ioremap(unsigned long offset, unsigned long size); 422extern void __iomem * ioremap(unsigned long offset, unsigned long size);
423extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); 423extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size);
424 424extern void iounmap (volatile void __iomem *addr);
425static inline void
426iounmap (volatile void __iomem *addr)
427{
428}
429 425
430/* Use normal IO mappings for DMI */ 426/* Use normal IO mappings for DMI */
431#define dmi_ioremap ioremap 427#define dmi_ioremap ioremap
diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h
index aed7142f9e4a..ba211e011a1d 100644
--- a/include/asm-ia64/kdebug.h
+++ b/include/asm-ia64/kdebug.h
@@ -28,21 +28,8 @@
28 */ 28 */
29#include <linux/notifier.h> 29#include <linux/notifier.h>
30 30
31struct pt_regs;
32
33struct die_args {
34 struct pt_regs *regs;
35 const char *str;
36 long err;
37 int trapnr;
38 int signr;
39};
40
41extern int register_die_notifier(struct notifier_block *);
42extern int unregister_die_notifier(struct notifier_block *);
43extern int register_page_fault_notifier(struct notifier_block *); 31extern int register_page_fault_notifier(struct notifier_block *);
44extern int unregister_page_fault_notifier(struct notifier_block *); 32extern int unregister_page_fault_notifier(struct notifier_block *);
45extern struct atomic_notifier_head ia64die_chain;
46 33
47enum die_val { 34enum die_val {
48 DIE_BREAK = 1, 35 DIE_BREAK = 1,
@@ -74,18 +61,4 @@ enum die_val {
74 DIE_KDUMP_LEAVE, 61 DIE_KDUMP_LEAVE,
75}; 62};
76 63
77static inline int notify_die(enum die_val val, char *str, struct pt_regs *regs,
78 long err, int trap, int sig)
79{
80 struct die_args args = {
81 .regs = regs,
82 .str = str,
83 .err = err,
84 .trapnr = trap,
85 .signr = sig
86 };
87
88 return atomic_notifier_call_chain(&ia64die_chain, val, &args);
89}
90
91#endif 64#endif
diff --git a/include/asm-ia64/kexec.h b/include/asm-ia64/kexec.h
index 41299ddfee30..541be835fc5a 100644
--- a/include/asm-ia64/kexec.h
+++ b/include/asm-ia64/kexec.h
@@ -14,8 +14,6 @@
14/* The native architecture */ 14/* The native architecture */
15#define KEXEC_ARCH KEXEC_ARCH_IA_64 15#define KEXEC_ARCH KEXEC_ARCH_IA_64
16 16
17#define MAX_NOTE_BYTES 1024
18
19#define kexec_flush_icache_page(page) do { \ 17#define kexec_flush_icache_page(page) do { \
20 unsigned long page_addr = (unsigned long)page_address(page); \ 18 unsigned long page_addr = (unsigned long)page_address(page); \
21 flush_icache_range(page_addr, page_addr + PAGE_SIZE); \ 19 flush_icache_range(page_addr, page_addr + PAGE_SIZE); \
diff --git a/include/asm-ia64/kregs.h b/include/asm-ia64/kregs.h
index 221b5cb564b2..7e55a584975c 100644
--- a/include/asm-ia64/kregs.h
+++ b/include/asm-ia64/kregs.h
@@ -29,8 +29,7 @@
29 */ 29 */
30#define IA64_TR_KERNEL 0 /* itr0, dtr0: maps kernel image (code & data) */ 30#define IA64_TR_KERNEL 0 /* itr0, dtr0: maps kernel image (code & data) */
31#define IA64_TR_PALCODE 1 /* itr1: maps PALcode as required by EFI */ 31#define IA64_TR_PALCODE 1 /* itr1: maps PALcode as required by EFI */
32#define IA64_TR_PERCPU_DATA 1 /* dtr1: percpu data */ 32#define IA64_TR_CURRENT_STACK 1 /* dtr1: maps kernel's memory- & register-stacks */
33#define IA64_TR_CURRENT_STACK 2 /* dtr2: maps kernel's memory- & register-stacks */
34 33
35/* Processor status register bits: */ 34/* Processor status register bits: */
36#define IA64_PSR_BE_BIT 1 35#define IA64_PSR_BE_BIT 1
diff --git a/include/asm-ia64/local.h b/include/asm-ia64/local.h
index dc519092ef4d..c11c530f74d0 100644
--- a/include/asm-ia64/local.h
+++ b/include/asm-ia64/local.h
@@ -1,50 +1 @@
1#ifndef _ASM_IA64_LOCAL_H #include <asm-generic/local.h>
2#define _ASM_IA64_LOCAL_H
3
4/*
5 * Copyright (C) 2003 Hewlett-Packard Co
6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */
8
9#include <linux/percpu.h>
10
11typedef struct {
12 atomic64_t val;
13} local_t;
14
15#define LOCAL_INIT(i) ((local_t) { { (i) } })
16#define local_read(l) atomic64_read(&(l)->val)
17#define local_set(l, i) atomic64_set(&(l)->val, i)
18#define local_inc(l) atomic64_inc(&(l)->val)
19#define local_dec(l) atomic64_dec(&(l)->val)
20#define local_add(i, l) atomic64_add((i), &(l)->val)
21#define local_sub(i, l) atomic64_sub((i), &(l)->val)
22
23/* Non-atomic variants, i.e., preemption disabled and won't be touched in interrupt, etc. */
24
25#define __local_inc(l) (++(l)->val.counter)
26#define __local_dec(l) (--(l)->val.counter)
27#define __local_add(i,l) ((l)->val.counter += (i))
28#define __local_sub(i,l) ((l)->val.counter -= (i))
29
30/*
31 * Use these for per-cpu local_t variables. Note they take a variable (eg. mystruct.foo),
32 * not an address.
33 */
34#define cpu_local_read(v) local_read(&__ia64_per_cpu_var(v))
35#define cpu_local_set(v, i) local_set(&__ia64_per_cpu_var(v), (i))
36#define cpu_local_inc(v) local_inc(&__ia64_per_cpu_var(v))
37#define cpu_local_dec(v) local_dec(&__ia64_per_cpu_var(v))
38#define cpu_local_add(i, v) local_add((i), &__ia64_per_cpu_var(v))
39#define cpu_local_sub(i, v) local_sub((i), &__ia64_per_cpu_var(v))
40
41/*
42 * Non-atomic increments, i.e., preemption disabled and won't be touched in interrupt,
43 * etc.
44 */
45#define __cpu_local_inc(v) __local_inc(&__ia64_per_cpu_var(v))
46#define __cpu_local_dec(v) __local_dec(&__ia64_per_cpu_var(v))
47#define __cpu_local_add(i, v) __local_add((i), &__ia64_per_cpu_var(v))
48#define __cpu_local_sub(i, v) __local_sub((i), &__ia64_per_cpu_var(v))
49
50#endif /* _ASM_IA64_LOCAL_H */
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index 67656ce767c2..abfcb3a2588f 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -89,6 +89,8 @@
89#define PAL_GET_PSTATE_TYPE_AVGNORESET 2 89#define PAL_GET_PSTATE_TYPE_AVGNORESET 2
90#define PAL_GET_PSTATE_TYPE_INSTANT 3 90#define PAL_GET_PSTATE_TYPE_INSTANT 3
91 91
92#define PAL_MC_ERROR_INJECT 276 /* Injects processor error or returns injection capabilities */
93
92#ifndef __ASSEMBLY__ 94#ifndef __ASSEMBLY__
93 95
94#include <linux/types.h> 96#include <linux/types.h>
@@ -1235,6 +1237,37 @@ ia64_pal_mc_error_info (u64 info_index, u64 type_index, u64 *size, u64 *error_in
1235 return iprv.status; 1237 return iprv.status;
1236} 1238}
1237 1239
1240/* Injects the requested processor error or returns info on
1241 * supported injection capabilities for current processor implementation
1242 */
1243static inline s64
1244ia64_pal_mc_error_inject_phys (u64 err_type_info, u64 err_struct_info,
1245 u64 err_data_buffer, u64 *capabilities, u64 *resources)
1246{
1247 struct ia64_pal_retval iprv;
1248 PAL_CALL_PHYS_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
1249 err_struct_info, err_data_buffer);
1250 if (capabilities)
1251 *capabilities= iprv.v0;
1252 if (resources)
1253 *resources= iprv.v1;
1254 return iprv.status;
1255}
1256
1257static inline s64
1258ia64_pal_mc_error_inject_virt (u64 err_type_info, u64 err_struct_info,
1259 u64 err_data_buffer, u64 *capabilities, u64 *resources)
1260{
1261 struct ia64_pal_retval iprv;
1262 PAL_CALL_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
1263 err_struct_info, err_data_buffer);
1264 if (capabilities)
1265 *capabilities= iprv.v0;
1266 if (resources)
1267 *resources= iprv.v1;
1268 return iprv.status;
1269}
1270
1238/* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot 1271/* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot
1239 * attempt to correct any expected machine checks. 1272 * attempt to correct any expected machine checks.
1240 */ 1273 */
diff --git a/include/asm-ia64/patch.h b/include/asm-ia64/patch.h
index 4797f3535e6d..a71543084fb4 100644
--- a/include/asm-ia64/patch.h
+++ b/include/asm-ia64/patch.h
@@ -20,6 +20,7 @@ extern void ia64_patch_imm60 (u64 insn_addr, u64 val); /* patch "brl" w/ip-rel
20 20
21extern void ia64_patch_mckinley_e9 (unsigned long start, unsigned long end); 21extern void ia64_patch_mckinley_e9 (unsigned long start, unsigned long end);
22extern void ia64_patch_vtop (unsigned long start, unsigned long end); 22extern void ia64_patch_vtop (unsigned long start, unsigned long end);
23extern void ia64_patch_phys_stack_reg(unsigned long val);
23extern void ia64_patch_gate (void); 24extern void ia64_patch_gate (void);
24 25
25#endif /* _ASM_IA64_PATCH_H */ 26#endif /* _ASM_IA64_PATCH_H */
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index 553182747722..670b706411b8 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -485,10 +485,6 @@ extern void paging_init (void);
485#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 485#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
486 remap_pfn_range(vma, vaddr, pfn, size, prot) 486 remap_pfn_range(vma, vaddr, pfn, size, prot)
487 487
488#define MK_IOSPACE_PFN(space, pfn) (pfn)
489#define GET_IOSPACE(pfn) 0
490#define GET_PFN(pfn) (pfn)
491
492/* 488/*
493 * ZERO_PAGE is a global shared page that is always zero: used 489 * ZERO_PAGE is a global shared page that is always zero: used
494 * for zero-mapped memory areas etc.. 490 * for zero-mapped memory areas etc..
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 4f4ee1c2db2f..db81ba406cef 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -19,6 +19,7 @@
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/ustack.h> 20#include <asm/ustack.h>
21 21
22#define IA64_NUM_PHYS_STACK_REG 96
22#define IA64_NUM_DBG_REGS 8 23#define IA64_NUM_DBG_REGS 8
23 24
24#define DEFAULT_MAP_BASE __IA64_UL_CONST(0x2000000000000000) 25#define DEFAULT_MAP_BASE __IA64_UL_CONST(0x2000000000000000)
diff --git a/include/asm-ia64/sections.h b/include/asm-ia64/sections.h
index e9eb7f62d32b..dc42a359894f 100644
--- a/include/asm-ia64/sections.h
+++ b/include/asm-ia64/sections.h
@@ -11,6 +11,7 @@
11extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[]; 11extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[];
12extern char __start___vtop_patchlist[], __end___vtop_patchlist[]; 12extern char __start___vtop_patchlist[], __end___vtop_patchlist[];
13extern char __start___mckinley_e9_bundles[], __end___mckinley_e9_bundles[]; 13extern char __start___mckinley_e9_bundles[], __end___mckinley_e9_bundles[];
14extern char __start___phys_stack_reg_patchlist[], __end___phys_stack_reg_patchlist[];
14extern char __start_gate_section[]; 15extern char __start_gate_section[];
15extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchlist[]; 16extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchlist[];
16extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[]; 17extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[];
diff --git a/include/asm-m32r/atomic.h b/include/asm-m32r/atomic.h
index f5a7d7301c72..3a38ffe4a4f4 100644
--- a/include/asm-m32r/atomic.h
+++ b/include/asm-m32r/atomic.h
@@ -253,14 +253,21 @@ static __inline__ int atomic_dec_return(atomic_t *v)
253 * Atomically adds @a to @v, so long as it was not @u. 253 * Atomically adds @a to @v, so long as it was not @u.
254 * Returns non-zero if @v was not @u, and zero otherwise. 254 * Returns non-zero if @v was not @u, and zero otherwise.
255 */ 255 */
256#define atomic_add_unless(v, a, u) \ 256static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
257({ \ 257{
258 int c, old; \ 258 int c, old;
259 c = atomic_read(v); \ 259 c = atomic_read(v);
260 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ 260 for (;;) {
261 c = old; \ 261 if (unlikely(c == (u)))
262 c != (u); \ 262 break;
263}) 263 old = atomic_cmpxchg((v), c, c + (a));
264 if (likely(old == c))
265 break;
266 c = old;
267 }
268 return c != (u);
269}
270
264#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 271#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
265 272
266static __inline__ void atomic_clear_mask(unsigned long mask, atomic_t *addr) 273static __inline__ void atomic_clear_mask(unsigned long mask, atomic_t *addr)
diff --git a/include/asm-m32r/kdebug.h b/include/asm-m32r/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-m32r/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-m32r/pgtable.h b/include/asm-m32r/pgtable.h
index 1c15ba7ce319..8b2a2f17e695 100644
--- a/include/asm-m32r/pgtable.h
+++ b/include/asm-m32r/pgtable.h
@@ -381,10 +381,6 @@ static inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
381#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 381#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
382 remap_pfn_range(vma, vaddr, pfn, size, prot) 382 remap_pfn_range(vma, vaddr, pfn, size, prot)
383 383
384#define MK_IOSPACE_PFN(space, pfn) (pfn)
385#define GET_IOSPACE(pfn) 0
386#define GET_PFN(pfn) (pfn)
387
388#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 384#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
389#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 385#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
390#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 386#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index 99ee09889ff7..06cdece35865 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -122,8 +122,6 @@ static inline void local_irq_disable(void)
122#define xchg(ptr,x) \ 122#define xchg(ptr,x) \
123 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 123 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
124 124
125#define tas(ptr) (xchg((ptr),1))
126
127#ifdef CONFIG_SMP 125#ifdef CONFIG_SMP
128extern void __xchg_called_with_bad_pointer(void); 126extern void __xchg_called_with_bad_pointer(void);
129#endif 127#endif
diff --git a/include/asm-m68k/atomic.h b/include/asm-m68k/atomic.h
index d5eed64cb833..4915294fea63 100644
--- a/include/asm-m68k/atomic.h
+++ b/include/asm-m68k/atomic.h
@@ -2,7 +2,7 @@
2#define __ARCH_M68K_ATOMIC__ 2#define __ARCH_M68K_ATOMIC__
3 3
4 4
5#include <asm/system.h> /* local_irq_XXX() */ 5#include <asm/system.h>
6 6
7/* 7/*
8 * Atomic operations that C can't guarantee us. Useful for 8 * Atomic operations that C can't guarantee us. Useful for
@@ -170,20 +170,21 @@ static inline void atomic_set_mask(unsigned long mask, unsigned long *v)
170 __asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask)); 170 __asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask));
171} 171}
172 172
173#define atomic_add_unless(v, a, u) \ 173static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
174({ \ 174{
175 int c, old; \ 175 int c, old;
176 c = atomic_read(v); \ 176 c = atomic_read(v);
177 for (;;) { \ 177 for (;;) {
178 if (unlikely(c == (u))) \ 178 if (unlikely(c == (u)))
179 break; \ 179 break;
180 old = atomic_cmpxchg((v), c, c + (a)); \ 180 old = atomic_cmpxchg((v), c, c + (a));
181 if (likely(old == c)) \ 181 if (likely(old == c))
182 break; \ 182 break;
183 c = old; \ 183 c = old;
184 } \ 184 }
185 c != (u); \ 185 return c != (u);
186}) 186}
187
187#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 188#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
188 189
189/* Atomic operations are already serializing */ 190/* Atomic operations are already serializing */
diff --git a/include/asm-m68k/kdebug.h b/include/asm-m68k/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-m68k/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h
index f3aa05377987..555b87a1f7e3 100644
--- a/include/asm-m68k/pgtable.h
+++ b/include/asm-m68k/pgtable.h
@@ -143,10 +143,6 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
143#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 143#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
144 remap_pfn_range(vma, vaddr, pfn, size, prot) 144 remap_pfn_range(vma, vaddr, pfn, size, prot)
145 145
146#define MK_IOSPACE_PFN(space, pfn) (pfn)
147#define GET_IOSPACE(pfn) 0
148#define GET_PFN(pfn) (pfn)
149
150/* MMU-specific headers */ 146/* MMU-specific headers */
151 147
152#ifdef CONFIG_SUN3 148#ifdef CONFIG_SUN3
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index 243dd13e6bfc..198878b53a61 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -88,7 +88,6 @@ static inline int irqs_disabled(void)
88 88
89 89
90#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 90#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
91#define tas(ptr) (xchg((ptr),1))
92 91
93struct __xchg_dummy { unsigned long a[100]; }; 92struct __xchg_dummy { unsigned long a[100]; };
94#define __xg(x) ((volatile struct __xchg_dummy *)(x)) 93#define __xg(x) ((volatile struct __xchg_dummy *)(x))
diff --git a/include/asm-m68knommu/atomic.h b/include/asm-m68knommu/atomic.h
index 6c4e4b63e454..d5632a305dae 100644
--- a/include/asm-m68knommu/atomic.h
+++ b/include/asm-m68knommu/atomic.h
@@ -1,7 +1,7 @@
1#ifndef __ARCH_M68KNOMMU_ATOMIC__ 1#ifndef __ARCH_M68KNOMMU_ATOMIC__
2#define __ARCH_M68KNOMMU_ATOMIC__ 2#define __ARCH_M68KNOMMU_ATOMIC__
3 3
4#include <asm/system.h> /* local_irq_XXX() */ 4#include <asm/system.h>
5 5
6/* 6/*
7 * Atomic operations that C can't guarantee us. Useful for 7 * Atomic operations that C can't guarantee us. Useful for
@@ -131,14 +131,21 @@ static inline int atomic_sub_return(int i, atomic_t * v)
131#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) 131#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
132#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 132#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
133 133
134#define atomic_add_unless(v, a, u) \ 134static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
135({ \ 135{
136 int c, old; \ 136 int c, old;
137 c = atomic_read(v); \ 137 c = atomic_read(v);
138 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ 138 for (;;) {
139 c = old; \ 139 if (unlikely(c == (u)))
140 c != (u); \ 140 break;
141}) 141 old = atomic_cmpxchg((v), c, c + (a));
142 if (likely(old == c))
143 break;
144 c = old;
145 }
146 return c != (u);
147}
148
142#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 149#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
143 150
144#define atomic_dec_return(v) atomic_sub_return(1,(v)) 151#define atomic_dec_return(v) atomic_sub_return(1,(v))
diff --git a/include/asm-m68knommu/kdebug.h b/include/asm-m68knommu/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-m68knommu/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-m68knommu/pgtable.h b/include/asm-m68knommu/pgtable.h
index 549ad231efad..9dfbbc24aa71 100644
--- a/include/asm-m68knommu/pgtable.h
+++ b/include/asm-m68knommu/pgtable.h
@@ -59,10 +59,6 @@ extern int is_in_rom(unsigned long);
59#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 59#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
60 remap_pfn_range(vma, vaddr, pfn, size, prot) 60 remap_pfn_range(vma, vaddr, pfn, size, prot)
61 61
62#define MK_IOSPACE_PFN(space, pfn) (pfn)
63#define GET_IOSPACE(pfn) 0
64#define GET_PFN(pfn) (pfn)
65
66/* 62/*
67 * All 32bit addresses are effectively valid for vmalloc... 63 * All 32bit addresses are effectively valid for vmalloc...
68 * Sort of meaningless for non-VM targets. 64 * Sort of meaningless for non-VM targets.
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
index 2a814498672d..5e5ed18bb78f 100644
--- a/include/asm-m68knommu/system.h
+++ b/include/asm-m68knommu/system.h
@@ -120,7 +120,6 @@ asmlinkage void resume(void);
120#endif 120#endif
121 121
122#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 122#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
123#define tas(ptr) (xchg((ptr),1))
124 123
125struct __xchg_dummy { unsigned long a[100]; }; 124struct __xchg_dummy { unsigned long a[100]; };
126#define __xg(x) ((volatile struct __xchg_dummy *)(x)) 125#define __xg(x) ((volatile struct __xchg_dummy *)(x))
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 1ac50b6c47ad..62daa746a9c9 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -18,6 +18,7 @@
18#include <asm/barrier.h> 18#include <asm/barrier.h>
19#include <asm/cpu-features.h> 19#include <asm/cpu-features.h>
20#include <asm/war.h> 20#include <asm/war.h>
21#include <asm/system.h>
21 22
22typedef struct { volatile int counter; } atomic_t; 23typedef struct { volatile int counter; } atomic_t;
23 24
@@ -306,8 +307,8 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
306 return result; 307 return result;
307} 308}
308 309
309#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) 310#define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
310#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 311#define atomic_xchg(v, new) (xchg(&((v)->counter), (new)))
311 312
312/** 313/**
313 * atomic_add_unless - add unless the number is a given value 314 * atomic_add_unless - add unless the number is a given value
@@ -318,14 +319,20 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
318 * Atomically adds @a to @v, so long as it was not @u. 319 * Atomically adds @a to @v, so long as it was not @u.
319 * Returns non-zero if @v was not @u, and zero otherwise. 320 * Returns non-zero if @v was not @u, and zero otherwise.
320 */ 321 */
321#define atomic_add_unless(v, a, u) \ 322static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
322({ \ 323{
323 int c, old; \ 324 int c, old;
324 c = atomic_read(v); \ 325 c = atomic_read(v);
325 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ 326 for (;;) {
326 c = old; \ 327 if (unlikely(c == (u)))
327 c != (u); \ 328 break;
328}) 329 old = atomic_cmpxchg((v), c, c + (a));
330 if (likely(old == c))
331 break;
332 c = old;
333 }
334 return c != (u);
335}
329#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 336#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
330 337
331#define atomic_dec_return(v) atomic_sub_return(1,(v)) 338#define atomic_dec_return(v) atomic_sub_return(1,(v))
@@ -681,6 +688,36 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
681 return result; 688 return result;
682} 689}
683 690
691#define atomic64_cmpxchg(v, o, n) \
692 (((__typeof__((v)->counter)))cmpxchg(&((v)->counter), (o), (n)))
693#define atomic64_xchg(v, new) (xchg(&((v)->counter), (new)))
694
695/**
696 * atomic64_add_unless - add unless the number is a given value
697 * @v: pointer of type atomic64_t
698 * @a: the amount to add to v...
699 * @u: ...unless v is equal to u.
700 *
701 * Atomically adds @a to @v, so long as it was not @u.
702 * Returns non-zero if @v was not @u, and zero otherwise.
703 */
704static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
705{
706 long c, old;
707 c = atomic64_read(v);
708 for (;;) {
709 if (unlikely(c == (u)))
710 break;
711 old = atomic64_cmpxchg((v), c, c + (a));
712 if (likely(old == c))
713 break;
714 c = old;
715 }
716 return c != (u);
717}
718
719#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
720
684#define atomic64_dec_return(v) atomic64_sub_return(1,(v)) 721#define atomic64_dec_return(v) atomic64_sub_return(1,(v))
685#define atomic64_inc_return(v) atomic64_add_return(1,(v)) 722#define atomic64_inc_return(v) atomic64_add_return(1,(v))
686 723
diff --git a/include/asm-mips/kdebug.h b/include/asm-mips/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-mips/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-mips/kexec.h b/include/asm-mips/kexec.h
index b25267ebcb09..cdbab43b7d3a 100644
--- a/include/asm-mips/kexec.h
+++ b/include/asm-mips/kexec.h
@@ -21,8 +21,6 @@
21/* The native architecture */ 21/* The native architecture */
22#define KEXEC_ARCH KEXEC_ARCH_MIPS 22#define KEXEC_ARCH KEXEC_ARCH_MIPS
23 23
24#define MAX_NOTE_BYTES 1024
25
26static inline void crash_setup_regs(struct pt_regs *newregs, 24static inline void crash_setup_regs(struct pt_regs *newregs,
27 struct pt_regs *oldregs) 25 struct pt_regs *oldregs)
28{ 26{
diff --git a/include/asm-mips/local.h b/include/asm-mips/local.h
index 9e2d43bae388..ed882c88e0ca 100644
--- a/include/asm-mips/local.h
+++ b/include/asm-mips/local.h
@@ -1,60 +1,288 @@
1#ifndef _ASM_LOCAL_H 1#ifndef _ARCH_MIPS_LOCAL_H
2#define _ASM_LOCAL_H 2#define _ARCH_MIPS_LOCAL_H
3 3
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5#include <linux/bitops.h>
5#include <asm/atomic.h> 6#include <asm/atomic.h>
7#include <asm/war.h>
6 8
7#ifdef CONFIG_32BIT 9typedef struct
10{
11 atomic_long_t a;
12} local_t;
8 13
9typedef atomic_t local_t; 14#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
10 15
11#define LOCAL_INIT(i) ATOMIC_INIT(i) 16#define local_read(l) atomic_long_read(&(l)->a)
12#define local_read(v) atomic_read(v) 17#define local_set(l,i) atomic_long_set(&(l)->a, (i))
13#define local_set(v,i) atomic_set(v,i)
14 18
15#define local_inc(v) atomic_inc(v) 19#define local_add(i,l) atomic_long_add((i),(&(l)->a))
16#define local_dec(v) atomic_dec(v) 20#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
17#define local_add(i, v) atomic_add(i, v) 21#define local_inc(l) atomic_long_inc(&(l)->a)
18#define local_sub(i, v) atomic_sub(i, v) 22#define local_dec(l) atomic_long_dec(&(l)->a)
19 23
20#endif 24/*
25 * Same as above, but return the result value
26 */
27static __inline__ long local_add_return(long i, local_t * l)
28{
29 unsigned long result;
30
31 if (cpu_has_llsc && R10000_LLSC_WAR) {
32 unsigned long temp;
33
34 __asm__ __volatile__(
35 " .set mips3 \n"
36 "1:" __LL "%1, %2 # local_add_return \n"
37 " addu %0, %1, %3 \n"
38 __SC "%0, %2 \n"
39 " beqzl %0, 1b \n"
40 " addu %0, %1, %3 \n"
41 " .set mips0 \n"
42 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
43 : "Ir" (i), "m" (l->a.counter)
44 : "memory");
45 } else if (cpu_has_llsc) {
46 unsigned long temp;
47
48 __asm__ __volatile__(
49 " .set mips3 \n"
50 "1:" __LL "%1, %2 # local_add_return \n"
51 " addu %0, %1, %3 \n"
52 __SC "%0, %2 \n"
53 " beqz %0, 1b \n"
54 " addu %0, %1, %3 \n"
55 " .set mips0 \n"
56 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
57 : "Ir" (i), "m" (l->a.counter)
58 : "memory");
59 } else {
60 unsigned long flags;
21 61
22#ifdef CONFIG_64BIT 62 local_irq_save(flags);
63 result = l->a.counter;
64 result += i;
65 l->a.counter = result;
66 local_irq_restore(flags);
67 }
23 68
24typedef atomic64_t local_t; 69 return result;
70}
25 71
26#define LOCAL_INIT(i) ATOMIC64_INIT(i) 72static __inline__ long local_sub_return(long i, local_t * l)
27#define local_read(v) atomic64_read(v) 73{
28#define local_set(v,i) atomic64_set(v,i) 74 unsigned long result;
29 75
30#define local_inc(v) atomic64_inc(v) 76 if (cpu_has_llsc && R10000_LLSC_WAR) {
31#define local_dec(v) atomic64_dec(v) 77 unsigned long temp;
32#define local_add(i, v) atomic64_add(i, v)
33#define local_sub(i, v) atomic64_sub(i, v)
34 78
35#endif 79 __asm__ __volatile__(
80 " .set mips3 \n"
81 "1:" __LL "%1, %2 # local_sub_return \n"
82 " subu %0, %1, %3 \n"
83 __SC "%0, %2 \n"
84 " beqzl %0, 1b \n"
85 " subu %0, %1, %3 \n"
86 " .set mips0 \n"
87 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
88 : "Ir" (i), "m" (l->a.counter)
89 : "memory");
90 } else if (cpu_has_llsc) {
91 unsigned long temp;
36 92
37#define __local_inc(v) ((v)->counter++) 93 __asm__ __volatile__(
38#define __local_dec(v) ((v)->counter--) 94 " .set mips3 \n"
39#define __local_add(i,v) ((v)->counter+=(i)) 95 "1:" __LL "%1, %2 # local_sub_return \n"
40#define __local_sub(i,v) ((v)->counter-=(i)) 96 " subu %0, %1, %3 \n"
97 __SC "%0, %2 \n"
98 " beqz %0, 1b \n"
99 " subu %0, %1, %3 \n"
100 " .set mips0 \n"
101 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
102 : "Ir" (i), "m" (l->a.counter)
103 : "memory");
104 } else {
105 unsigned long flags;
106
107 local_irq_save(flags);
108 result = l->a.counter;
109 result -= i;
110 l->a.counter = result;
111 local_irq_restore(flags);
112 }
113
114 return result;
115}
41 116
42/* 117/*
43 * Use these for per-cpu local_t variables: on some archs they are 118 * local_sub_if_positive - conditionally subtract integer from atomic variable
119 * @i: integer value to subtract
120 * @l: pointer of type local_t
121 *
122 * Atomically test @l and subtract @i if @l is greater or equal than @i.
123 * The function returns the old value of @l minus @i.
124 */
125static __inline__ long local_sub_if_positive(long i, local_t * l)
126{
127 unsigned long result;
128
129 if (cpu_has_llsc && R10000_LLSC_WAR) {
130 unsigned long temp;
131
132 __asm__ __volatile__(
133 " .set mips3 \n"
134 "1:" __LL "%1, %2 # local_sub_if_positive\n"
135 " dsubu %0, %1, %3 \n"
136 " bltz %0, 1f \n"
137 __SC "%0, %2 \n"
138 " .set noreorder \n"
139 " beqzl %0, 1b \n"
140 " dsubu %0, %1, %3 \n"
141 " .set reorder \n"
142 "1: \n"
143 " .set mips0 \n"
144 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
145 : "Ir" (i), "m" (l->a.counter)
146 : "memory");
147 } else if (cpu_has_llsc) {
148 unsigned long temp;
149
150 __asm__ __volatile__(
151 " .set mips3 \n"
152 "1:" __LL "%1, %2 # local_sub_if_positive\n"
153 " dsubu %0, %1, %3 \n"
154 " bltz %0, 1f \n"
155 __SC "%0, %2 \n"
156 " .set noreorder \n"
157 " beqz %0, 1b \n"
158 " dsubu %0, %1, %3 \n"
159 " .set reorder \n"
160 "1: \n"
161 " .set mips0 \n"
162 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
163 : "Ir" (i), "m" (l->a.counter)
164 : "memory");
165 } else {
166 unsigned long flags;
167
168 local_irq_save(flags);
169 result = l->a.counter;
170 result -= i;
171 if (result >= 0)
172 l->a.counter = result;
173 local_irq_restore(flags);
174 }
175
176 return result;
177}
178
179#define local_cmpxchg(l, o, n) \
180 ((long)cmpxchg_local(&((l)->a.counter), (o), (n)))
181#define local_xchg(l, n) (xchg_local(&((l)->a.counter),(n)))
182
183/**
184 * local_add_unless - add unless the number is a given value
185 * @l: pointer of type local_t
186 * @a: the amount to add to l...
187 * @u: ...unless l is equal to u.
188 *
189 * Atomically adds @a to @l, so long as it was not @u.
190 * Returns non-zero if @l was not @u, and zero otherwise.
191 */
192#define local_add_unless(l, a, u) \
193({ \
194 long c, old; \
195 c = local_read(l); \
196 while (c != (u) && (old = local_cmpxchg((l), c, c + (a))) != c) \
197 c = old; \
198 c != (u); \
199})
200#define local_inc_not_zero(l) local_add_unless((l), 1, 0)
201
202#define local_dec_return(l) local_sub_return(1,(l))
203#define local_inc_return(l) local_add_return(1,(l))
204
205/*
206 * local_sub_and_test - subtract value from variable and test result
207 * @i: integer value to subtract
208 * @l: pointer of type local_t
209 *
210 * Atomically subtracts @i from @l and returns
211 * true if the result is zero, or false for all
212 * other cases.
213 */
214#define local_sub_and_test(i,l) (local_sub_return((i), (l)) == 0)
215
216/*
217 * local_inc_and_test - increment and test
218 * @l: pointer of type local_t
219 *
220 * Atomically increments @l by 1
221 * and returns true if the result is zero, or false for all
222 * other cases.
223 */
224#define local_inc_and_test(l) (local_inc_return(l) == 0)
225
226/*
227 * local_dec_and_test - decrement by 1 and test
228 * @l: pointer of type local_t
229 *
230 * Atomically decrements @l by 1 and
231 * returns true if the result is 0, or false for all other
232 * cases.
233 */
234#define local_dec_and_test(l) (local_sub_return(1, (l)) == 0)
235
236/*
237 * local_dec_if_positive - decrement by 1 if old value positive
238 * @l: pointer of type local_t
239 */
240#define local_dec_if_positive(l) local_sub_if_positive(1, l)
241
242/*
243 * local_add_negative - add and test if negative
244 * @l: pointer of type local_t
245 * @i: integer value to add
246 *
247 * Atomically adds @i to @l and returns true
248 * if the result is negative, or false when
249 * result is greater than or equal to zero.
250 */
251#define local_add_negative(i,l) (local_add_return(i, (l)) < 0)
252
253/* Use these for per-cpu local_t variables: on some archs they are
44 * much more efficient than these naive implementations. Note they take 254 * much more efficient than these naive implementations. Note they take
45 * a variable, not an address. 255 * a variable, not an address.
46 */ 256 */
47#define cpu_local_read(v) local_read(&__get_cpu_var(v))
48#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i))
49 257
50#define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) 258#define __local_inc(l) ((l)->a.counter++)
51#define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) 259#define __local_dec(l) ((l)->a.counter++)
52#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) 260#define __local_add(i,l) ((l)->a.counter+=(i))
53#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) 261#define __local_sub(i,l) ((l)->a.counter-=(i))
262
263/* Need to disable preemption for the cpu local counters otherwise we could
264 still access a variable of a previous CPU in a non atomic way. */
265#define cpu_local_wrap_v(l) \
266 ({ local_t res__; \
267 preempt_disable(); \
268 res__ = (l); \
269 preempt_enable(); \
270 res__; })
271#define cpu_local_wrap(l) \
272 ({ preempt_disable(); \
273 l; \
274 preempt_enable(); }) \
275
276#define cpu_local_read(l) cpu_local_wrap_v(local_read(&__get_cpu_var(l)))
277#define cpu_local_set(l, i) cpu_local_wrap(local_set(&__get_cpu_var(l), (i)))
278#define cpu_local_inc(l) cpu_local_wrap(local_inc(&__get_cpu_var(l)))
279#define cpu_local_dec(l) cpu_local_wrap(local_dec(&__get_cpu_var(l)))
280#define cpu_local_add(i, l) cpu_local_wrap(local_add((i), &__get_cpu_var(l)))
281#define cpu_local_sub(i, l) cpu_local_wrap(local_sub((i), &__get_cpu_var(l)))
54 282
55#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v)) 283#define __cpu_local_inc(l) cpu_local_inc(l)
56#define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v)) 284#define __cpu_local_dec(l) cpu_local_dec(l)
57#define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v)) 285#define __cpu_local_add(i, l) cpu_local_add((i), (l))
58#define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v)) 286#define __cpu_local_sub(i, l) cpu_local_sub((i), (l))
59 287
60#endif /* _ASM_LOCAL_H */ 288#endif /* _ARCH_MIPS_LOCAL_H */
diff --git a/include/asm-mips/mach-au1x00/au1550_spi.h b/include/asm-mips/mach-au1x00/au1550_spi.h
new file mode 100644
index 000000000000..c2f0466523ec
--- /dev/null
+++ b/include/asm-mips/mach-au1x00/au1550_spi.h
@@ -0,0 +1,16 @@
1/*
2 * au1550_spi.h - au1550 psc spi controller driver - platform data struct
3 */
4
5#ifndef _AU1550_SPI_H_
6#define _AU1550_SPI_H_
7
8struct au1550_spi_info {
9 s16 bus_num; /* defines which PSC and IRQ to use */
10 u32 mainclk_hz; /* main input clock frequency of PSC */
11 u16 num_chipselect; /* number of chipselects supported */
12 void (*activate_cs)(struct au1550_spi_info *spi, int cs, int polarity);
13 void (*deactivate_cs)(struct au1550_spi_info *spi, int cs, int polarity);
14};
15
16#endif
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 0d3295f57a95..27d77d981937 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -387,10 +387,6 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma,
387 remap_pfn_range(vma, vaddr, pfn, size, prot) 387 remap_pfn_range(vma, vaddr, pfn, size, prot)
388#endif 388#endif
389 389
390#define MK_IOSPACE_PFN(space, pfn) (pfn)
391#define GET_IOSPACE(pfn) 0
392#define GET_PFN(pfn) (pfn)
393
394#include <asm-generic/pgtable.h> 390#include <asm-generic/pgtable.h>
395 391
396/* 392/*
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 290887077e44..30f23a2b46ca 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -201,7 +201,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
201} 201}
202 202
203#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 203#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
204#define tas(ptr) (xchg((ptr),1))
205 204
206#define __HAVE_ARCH_CMPXCHG 1 205#define __HAVE_ARCH_CMPXCHG 1
207 206
@@ -262,6 +261,58 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
262 return retval; 261 return retval;
263} 262}
264 263
264static inline unsigned long __cmpxchg_u32_local(volatile int * m,
265 unsigned long old, unsigned long new)
266{
267 __u32 retval;
268
269 if (cpu_has_llsc && R10000_LLSC_WAR) {
270 __asm__ __volatile__(
271 " .set push \n"
272 " .set noat \n"
273 " .set mips3 \n"
274 "1: ll %0, %2 # __cmpxchg_u32 \n"
275 " bne %0, %z3, 2f \n"
276 " .set mips0 \n"
277 " move $1, %z4 \n"
278 " .set mips3 \n"
279 " sc $1, %1 \n"
280 " beqzl $1, 1b \n"
281 "2: \n"
282 " .set pop \n"
283 : "=&r" (retval), "=R" (*m)
284 : "R" (*m), "Jr" (old), "Jr" (new)
285 : "memory");
286 } else if (cpu_has_llsc) {
287 __asm__ __volatile__(
288 " .set push \n"
289 " .set noat \n"
290 " .set mips3 \n"
291 "1: ll %0, %2 # __cmpxchg_u32 \n"
292 " bne %0, %z3, 2f \n"
293 " .set mips0 \n"
294 " move $1, %z4 \n"
295 " .set mips3 \n"
296 " sc $1, %1 \n"
297 " beqz $1, 1b \n"
298 "2: \n"
299 " .set pop \n"
300 : "=&r" (retval), "=R" (*m)
301 : "R" (*m), "Jr" (old), "Jr" (new)
302 : "memory");
303 } else {
304 unsigned long flags;
305
306 local_irq_save(flags);
307 retval = *m;
308 if (retval == old)
309 *m = new;
310 local_irq_restore(flags); /* implies memory barrier */
311 }
312
313 return retval;
314}
315
265#ifdef CONFIG_64BIT 316#ifdef CONFIG_64BIT
266static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, 317static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
267 unsigned long new) 318 unsigned long new)
@@ -315,10 +366,62 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
315 366
316 return retval; 367 return retval;
317} 368}
369
370static inline unsigned long __cmpxchg_u64_local(volatile int * m,
371 unsigned long old, unsigned long new)
372{
373 __u64 retval;
374
375 if (cpu_has_llsc && R10000_LLSC_WAR) {
376 __asm__ __volatile__(
377 " .set push \n"
378 " .set noat \n"
379 " .set mips3 \n"
380 "1: lld %0, %2 # __cmpxchg_u64 \n"
381 " bne %0, %z3, 2f \n"
382 " move $1, %z4 \n"
383 " scd $1, %1 \n"
384 " beqzl $1, 1b \n"
385 "2: \n"
386 " .set pop \n"
387 : "=&r" (retval), "=R" (*m)
388 : "R" (*m), "Jr" (old), "Jr" (new)
389 : "memory");
390 } else if (cpu_has_llsc) {
391 __asm__ __volatile__(
392 " .set push \n"
393 " .set noat \n"
394 " .set mips3 \n"
395 "1: lld %0, %2 # __cmpxchg_u64 \n"
396 " bne %0, %z3, 2f \n"
397 " move $1, %z4 \n"
398 " scd $1, %1 \n"
399 " beqz $1, 1b \n"
400 "2: \n"
401 " .set pop \n"
402 : "=&r" (retval), "=R" (*m)
403 : "R" (*m), "Jr" (old), "Jr" (new)
404 : "memory");
405 } else {
406 unsigned long flags;
407
408 local_irq_save(flags);
409 retval = *m;
410 if (retval == old)
411 *m = new;
412 local_irq_restore(flags); /* implies memory barrier */
413 }
414
415 return retval;
416}
417
318#else 418#else
319extern unsigned long __cmpxchg_u64_unsupported_on_32bit_kernels( 419extern unsigned long __cmpxchg_u64_unsupported_on_32bit_kernels(
320 volatile int * m, unsigned long old, unsigned long new); 420 volatile int * m, unsigned long old, unsigned long new);
321#define __cmpxchg_u64 __cmpxchg_u64_unsupported_on_32bit_kernels 421#define __cmpxchg_u64 __cmpxchg_u64_unsupported_on_32bit_kernels
422extern unsigned long __cmpxchg_u64_local_unsupported_on_32bit_kernels(
423 volatile int * m, unsigned long old, unsigned long new);
424#define __cmpxchg_u64_local __cmpxchg_u64_local_unsupported_on_32bit_kernels
322#endif 425#endif
323 426
324/* This function doesn't exist, so you'll get a linker error 427/* This function doesn't exist, so you'll get a linker error
@@ -338,7 +441,26 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
338 return old; 441 return old;
339} 442}
340 443
341#define cmpxchg(ptr,old,new) ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr)))) 444static inline unsigned long __cmpxchg_local(volatile void * ptr,
445 unsigned long old, unsigned long new, int size)
446{
447 switch (size) {
448 case 4:
449 return __cmpxchg_u32_local(ptr, old, new);
450 case 8:
451 return __cmpxchg_u64_local(ptr, old, new);
452 }
453 __cmpxchg_called_with_bad_pointer();
454 return old;
455}
456
457#define cmpxchg(ptr,old,new) \
458 ((__typeof__(*(ptr)))__cmpxchg((ptr), \
459 (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr))))
460
461#define cmpxchg_local(ptr,old,new) \
462 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), \
463 (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr))))
342 464
343extern void set_handler (unsigned long offset, void *addr, unsigned long len); 465extern void set_handler (unsigned long offset, void *addr, unsigned long len);
344extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len); 466extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len);
diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h
index 7d57d34fcca8..e894ee35074b 100644
--- a/include/asm-parisc/atomic.h
+++ b/include/asm-parisc/atomic.h
@@ -163,7 +163,7 @@ static __inline__ int atomic_read(const atomic_t *v)
163} 163}
164 164
165/* exported interface */ 165/* exported interface */
166#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) 166#define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
167#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 167#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
168 168
169/** 169/**
@@ -175,14 +175,21 @@ static __inline__ int atomic_read(const atomic_t *v)
175 * Atomically adds @a to @v, so long as it was not @u. 175 * Atomically adds @a to @v, so long as it was not @u.
176 * Returns non-zero if @v was not @u, and zero otherwise. 176 * Returns non-zero if @v was not @u, and zero otherwise.
177 */ 177 */
178#define atomic_add_unless(v, a, u) \ 178static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
179({ \ 179{
180 int c, old; \ 180 int c, old;
181 c = atomic_read(v); \ 181 c = atomic_read(v);
182 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ 182 for (;;) {
183 c = old; \ 183 if (unlikely(c == (u)))
184 c != (u); \ 184 break;
185}) 185 old = atomic_cmpxchg((v), c, c + (a));
186 if (likely(old == c))
187 break;
188 c = old;
189 }
190 return c != (u);
191}
192
186#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 193#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
187 194
188#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)i),(v)))) 195#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)i),(v))))
@@ -270,6 +277,37 @@ atomic64_read(const atomic64_t *v)
270#define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0) 277#define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0)
271#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i),(v)) == 0) 278#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i),(v)) == 0)
272 279
280/* exported interface */
281#define atomic64_cmpxchg(v, o, n) \
282 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
283#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
284
285/**
286 * atomic64_add_unless - add unless the number is a given value
287 * @v: pointer of type atomic64_t
288 * @a: the amount to add to v...
289 * @u: ...unless v is equal to u.
290 *
291 * Atomically adds @a to @v, so long as it was not @u.
292 * Returns non-zero if @v was not @u, and zero otherwise.
293 */
294static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
295{
296 long c, old;
297 c = atomic64_read(v);
298 for (;;) {
299 if (unlikely(c == (u)))
300 break;
301 old = atomic64_cmpxchg((v), c, c + (a));
302 if (likely(old == c))
303 break;
304 c = old;
305 }
306 return c != (u);
307}
308
309#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
310
273#endif /* CONFIG_64BIT */ 311#endif /* CONFIG_64BIT */
274 312
275#include <asm-generic/atomic.h> 313#include <asm-generic/atomic.h>
diff --git a/include/asm-parisc/kdebug.h b/include/asm-parisc/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-parisc/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-parisc/local.h b/include/asm-parisc/local.h
index d0f550912755..c11c530f74d0 100644
--- a/include/asm-parisc/local.h
+++ b/include/asm-parisc/local.h
@@ -1,40 +1 @@
1#ifndef _ARCH_PARISC_LOCAL_H #include <asm-generic/local.h>
2#define _ARCH_PARISC_LOCAL_H
3
4#include <linux/percpu.h>
5#include <asm/atomic.h>
6
7typedef atomic_long_t local_t;
8
9#define LOCAL_INIT(i) ATOMIC_LONG_INIT(i)
10#define local_read(v) atomic_long_read(v)
11#define local_set(v,i) atomic_long_set(v,i)
12
13#define local_inc(v) atomic_long_inc(v)
14#define local_dec(v) atomic_long_dec(v)
15#define local_add(i, v) atomic_long_add(i, v)
16#define local_sub(i, v) atomic_long_sub(i, v)
17
18#define __local_inc(v) ((v)->counter++)
19#define __local_dec(v) ((v)->counter--)
20#define __local_add(i,v) ((v)->counter+=(i))
21#define __local_sub(i,v) ((v)->counter-=(i))
22
23/* Use these for per-cpu local_t variables: on some archs they are
24 * much more efficient than these naive implementations. Note they take
25 * a variable, not an address.
26 */
27#define cpu_local_read(v) local_read(&__get_cpu_var(v))
28#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i))
29
30#define cpu_local_inc(v) local_inc(&__get_cpu_var(v))
31#define cpu_local_dec(v) local_dec(&__get_cpu_var(v))
32#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v))
33#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v))
34
35#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v))
36#define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v))
37#define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v))
38#define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v))
39
40#endif /* _ARCH_PARISC_LOCAL_H */
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index d7e1b10da5c6..beb2adb979d9 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -528,10 +528,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
528 528
529#define pgprot_noncached(prot) __pgprot(pgprot_val(prot) | _PAGE_NO_CACHE) 529#define pgprot_noncached(prot) __pgprot(pgprot_val(prot) | _PAGE_NO_CACHE)
530 530
531#define MK_IOSPACE_PFN(space, pfn) (pfn)
532#define GET_IOSPACE(pfn) 0
533#define GET_PFN(pfn) (pfn)
534
535/* We provide our own get_unmapped_area to provide cache coherency */ 531/* We provide our own get_unmapped_area to provide cache coherency */
536 532
537#define HAVE_ARCH_UNMAPPED_AREA 533#define HAVE_ARCH_UNMAPPED_AREA
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h
index 2ce4b6b7b348..c44810b9d322 100644
--- a/include/asm-powerpc/atomic.h
+++ b/include/asm-powerpc/atomic.h
@@ -11,6 +11,7 @@ typedef struct { volatile int counter; } atomic_t;
11#include <linux/compiler.h> 11#include <linux/compiler.h>
12#include <asm/synch.h> 12#include <asm/synch.h>
13#include <asm/asm-compat.h> 13#include <asm/asm-compat.h>
14#include <asm/system.h>
14 15
15#define ATOMIC_INIT(i) { (i) } 16#define ATOMIC_INIT(i) { (i) }
16 17
@@ -165,8 +166,7 @@ static __inline__ int atomic_dec_return(atomic_t *v)
165 return t; 166 return t;
166} 167}
167 168
168#define atomic_cmpxchg(v, o, n) \ 169#define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
169 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
170#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 170#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
171 171
172/** 172/**
@@ -414,8 +414,7 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v)
414 return t; 414 return t;
415} 415}
416 416
417#define atomic64_cmpxchg(v, o, n) \ 417#define atomic64_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
418 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
419#define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) 418#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
420 419
421/** 420/**
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index 8f757f6246e4..8144a2788db6 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -39,7 +39,6 @@
39#ifdef __KERNEL__ 39#ifdef __KERNEL__
40 40
41#include <linux/compiler.h> 41#include <linux/compiler.h>
42#include <asm/atomic.h>
43#include <asm/asm-compat.h> 42#include <asm/asm-compat.h>
44#include <asm/synch.h> 43#include <asm/synch.h>
45 44
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index b2e56b30306a..870967e47204 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -26,6 +26,7 @@
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <linux/device.h> 27#include <linux/device.h>
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <asm/machdep.h>
29#include <asm/types.h> 30#include <asm/types.h>
30#include <asm/bitops.h> 31#include <asm/bitops.h>
31 32
@@ -109,6 +110,19 @@ static inline void pci_iommu_init(void) { }
109#endif 110#endif
110 111
111extern void alloc_dart_table(void); 112extern void alloc_dart_table(void);
113#if defined(CONFIG_PPC64) && defined(CONFIG_PM)
114static inline void iommu_save(void)
115{
116 if (ppc_md.iommu_save)
117 ppc_md.iommu_save();
118}
119
120static inline void iommu_restore(void)
121{
122 if (ppc_md.iommu_restore)
123 ppc_md.iommu_restore();
124}
125#endif
112 126
113#endif /* __KERNEL__ */ 127#endif /* __KERNEL__ */
114#endif /* _ASM_IOMMU_H */ 128#endif /* _ASM_IOMMU_H */
diff --git a/include/asm-powerpc/kdebug.h b/include/asm-powerpc/kdebug.h
index 532bfee934f4..295f0162c608 100644
--- a/include/asm-powerpc/kdebug.h
+++ b/include/asm-powerpc/kdebug.h
@@ -6,20 +6,19 @@
6 6
7#include <linux/notifier.h> 7#include <linux/notifier.h>
8 8
9struct pt_regs; 9/*
10 10 * These are only here because kprobes.c wants them to implement a
11struct die_args { 11 * blatant layering violation. Will hopefully go away soon once all
12 struct pt_regs *regs; 12 * architectures are updated.
13 const char *str; 13 */
14 long err; 14static inline int register_page_fault_notifier(struct notifier_block *nb)
15 int trapnr; 15{
16 int signr; 16 return 0;
17}; 17}
18 18static inline int unregister_page_fault_notifier(struct notifier_block *nb)
19extern int register_die_notifier(struct notifier_block *); 19{
20extern int unregister_die_notifier(struct notifier_block *); 20 return 0;
21extern int register_page_fault_notifier(struct notifier_block *); 21}
22extern int unregister_page_fault_notifier(struct notifier_block *);
23extern struct atomic_notifier_head powerpc_die_chain; 22extern struct atomic_notifier_head powerpc_die_chain;
24 23
25/* Grossly misnamed. */ 24/* Grossly misnamed. */
@@ -29,14 +28,7 @@ enum die_val {
29 DIE_DABR_MATCH, 28 DIE_DABR_MATCH,
30 DIE_BPT, 29 DIE_BPT,
31 DIE_SSTEP, 30 DIE_SSTEP,
32 DIE_PAGE_FAULT,
33}; 31};
34 32
35static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
36{
37 struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig };
38 return atomic_notifier_call_chain(&powerpc_die_chain, val, &args);
39}
40
41#endif /* __KERNEL__ */ 33#endif /* __KERNEL__ */
42#endif /* _ASM_POWERPC_KDEBUG_H */ 34#endif /* _ASM_POWERPC_KDEBUG_H */
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h
index 11cbdf81fd2e..b6f817b8ba3d 100644
--- a/include/asm-powerpc/kexec.h
+++ b/include/asm-powerpc/kexec.h
@@ -108,8 +108,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
108 struct pt_regs *oldregs) { } 108 struct pt_regs *oldregs) { }
109#endif /* !__powerpc64 __ */ 109#endif /* !__powerpc64 __ */
110 110
111#define MAX_NOTE_BYTES 1024
112
113extern void kexec_smp_wait(void); /* get and clear naca physid, wait for 111extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
114 master to copy new code to 0 */ 112 master to copy new code to 0 */
115extern int crashing_cpu; 113extern int crashing_cpu;
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index f850ca7020ed..b0e40ff32ee0 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -64,6 +64,12 @@ typedef unsigned int kprobe_opcode_t;
64 addr = *(kprobe_opcode_t **)addr; \ 64 addr = *(kprobe_opcode_t **)addr; \
65 } else if (name[0] != '.') \ 65 } else if (name[0] != '.') \
66 addr = *(kprobe_opcode_t **)addr; \ 66 addr = *(kprobe_opcode_t **)addr; \
67 } else { \
68 char dot_name[KSYM_NAME_LEN+1]; \
69 dot_name[0] = '.'; \
70 dot_name[1] = '\0'; \
71 strncat(dot_name, name, KSYM_NAME_LEN); \
72 addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); \
67 } \ 73 } \
68} 74}
69 75
@@ -110,5 +116,6 @@ struct kprobe_ctlblk {
110 116
111extern int kprobe_exceptions_notify(struct notifier_block *self, 117extern int kprobe_exceptions_notify(struct notifier_block *self,
112 unsigned long val, void *data); 118 unsigned long val, void *data);
119extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
113#endif /* __KERNEL__ */ 120#endif /* __KERNEL__ */
114#endif /* _ASM_POWERPC_KPROBES_H */ 121#endif /* _ASM_POWERPC_KPROBES_H */
diff --git a/include/asm-powerpc/local.h b/include/asm-powerpc/local.h
index c11c530f74d0..612d83276653 100644
--- a/include/asm-powerpc/local.h
+++ b/include/asm-powerpc/local.h
@@ -1 +1,200 @@
1#include <asm-generic/local.h> 1#ifndef _ARCH_POWERPC_LOCAL_H
2#define _ARCH_POWERPC_LOCAL_H
3
4#include <linux/percpu.h>
5#include <asm/atomic.h>
6
7typedef struct
8{
9 atomic_long_t a;
10} local_t;
11
12#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
13
14#define local_read(l) atomic_long_read(&(l)->a)
15#define local_set(l,i) atomic_long_set(&(l)->a, (i))
16
17#define local_add(i,l) atomic_long_add((i),(&(l)->a))
18#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
19#define local_inc(l) atomic_long_inc(&(l)->a)
20#define local_dec(l) atomic_long_dec(&(l)->a)
21
22static __inline__ long local_add_return(long a, local_t *l)
23{
24 long t;
25
26 __asm__ __volatile__(
27"1:" PPC_LLARX "%0,0,%2 # local_add_return\n\
28 add %0,%1,%0\n"
29 PPC405_ERR77(0,%2)
30 PPC_STLCX "%0,0,%2 \n\
31 bne- 1b"
32 : "=&r" (t)
33 : "r" (a), "r" (&(l->a.counter))
34 : "cc", "memory");
35
36 return t;
37}
38
39#define local_add_negative(a, l) (local_add_return((a), (l)) < 0)
40
41static __inline__ long local_sub_return(long a, local_t *l)
42{
43 long t;
44
45 __asm__ __volatile__(
46"1:" PPC_LLARX "%0,0,%2 # local_sub_return\n\
47 subf %0,%1,%0\n"
48 PPC405_ERR77(0,%2)
49 PPC_STLCX "%0,0,%2 \n\
50 bne- 1b"
51 : "=&r" (t)
52 : "r" (a), "r" (&(l->a.counter))
53 : "cc", "memory");
54
55 return t;
56}
57
58static __inline__ long local_inc_return(local_t *l)
59{
60 long t;
61
62 __asm__ __volatile__(
63"1:" PPC_LLARX "%0,0,%1 # local_inc_return\n\
64 addic %0,%0,1\n"
65 PPC405_ERR77(0,%1)
66 PPC_STLCX "%0,0,%1 \n\
67 bne- 1b"
68 : "=&r" (t)
69 : "r" (&(l->a.counter))
70 : "cc", "memory");
71
72 return t;
73}
74
75/*
76 * local_inc_and_test - increment and test
77 * @l: pointer of type local_t
78 *
79 * Atomically increments @l by 1
80 * and returns true if the result is zero, or false for all
81 * other cases.
82 */
83#define local_inc_and_test(l) (local_inc_return(l) == 0)
84
85static __inline__ long local_dec_return(local_t *l)
86{
87 long t;
88
89 __asm__ __volatile__(
90"1:" PPC_LLARX "%0,0,%1 # local_dec_return\n\
91 addic %0,%0,-1\n"
92 PPC405_ERR77(0,%1)
93 PPC_STLCX "%0,0,%1\n\
94 bne- 1b"
95 : "=&r" (t)
96 : "r" (&(l->a.counter))
97 : "cc", "memory");
98
99 return t;
100}
101
102#define local_cmpxchg(l, o, n) \
103 (cmpxchg_local(&((l)->a.counter), (o), (n)))
104#define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n)))
105
106/**
107 * local_add_unless - add unless the number is a given value
108 * @l: pointer of type local_t
109 * @a: the amount to add to v...
110 * @u: ...unless v is equal to u.
111 *
112 * Atomically adds @a to @l, so long as it was not @u.
113 * Returns non-zero if @l was not @u, and zero otherwise.
114 */
115static __inline__ int local_add_unless(local_t *l, long a, long u)
116{
117 long t;
118
119 __asm__ __volatile__ (
120"1:" PPC_LLARX "%0,0,%1 # local_add_unless\n\
121 cmpw 0,%0,%3 \n\
122 beq- 2f \n\
123 add %0,%2,%0 \n"
124 PPC405_ERR77(0,%2)
125 PPC_STLCX "%0,0,%1 \n\
126 bne- 1b \n"
127" subf %0,%2,%0 \n\
1282:"
129 : "=&r" (t)
130 : "r" (&(l->a.counter)), "r" (a), "r" (u)
131 : "cc", "memory");
132
133 return t != u;
134}
135
136#define local_inc_not_zero(l) local_add_unless((l), 1, 0)
137
138#define local_sub_and_test(a, l) (local_sub_return((a), (l)) == 0)
139#define local_dec_and_test(l) (local_dec_return((l)) == 0)
140
141/*
142 * Atomically test *l and decrement if it is greater than 0.
143 * The function returns the old value of *l minus 1.
144 */
145static __inline__ long local_dec_if_positive(local_t *l)
146{
147 long t;
148
149 __asm__ __volatile__(
150"1:" PPC_LLARX "%0,0,%1 # local_dec_if_positive\n\
151 cmpwi %0,1\n\
152 addi %0,%0,-1\n\
153 blt- 2f\n"
154 PPC405_ERR77(0,%1)
155 PPC_STLCX "%0,0,%1\n\
156 bne- 1b"
157 "\n\
1582:" : "=&b" (t)
159 : "r" (&(l->a.counter))
160 : "cc", "memory");
161
162 return t;
163}
164
165/* Use these for per-cpu local_t variables: on some archs they are
166 * much more efficient than these naive implementations. Note they take
167 * a variable, not an address.
168 */
169
170#define __local_inc(l) ((l)->a.counter++)
171#define __local_dec(l) ((l)->a.counter++)
172#define __local_add(i,l) ((l)->a.counter+=(i))
173#define __local_sub(i,l) ((l)->a.counter-=(i))
174
175/* Need to disable preemption for the cpu local counters otherwise we could
176 still access a variable of a previous CPU in a non atomic way. */
177#define cpu_local_wrap_v(l) \
178 ({ local_t res__; \
179 preempt_disable(); \
180 res__ = (l); \
181 preempt_enable(); \
182 res__; })
183#define cpu_local_wrap(l) \
184 ({ preempt_disable(); \
185 l; \
186 preempt_enable(); }) \
187
188#define cpu_local_read(l) cpu_local_wrap_v(local_read(&__get_cpu_var(l)))
189#define cpu_local_set(l, i) cpu_local_wrap(local_set(&__get_cpu_var(l), (i)))
190#define cpu_local_inc(l) cpu_local_wrap(local_inc(&__get_cpu_var(l)))
191#define cpu_local_dec(l) cpu_local_wrap(local_dec(&__get_cpu_var(l)))
192#define cpu_local_add(i, l) cpu_local_wrap(local_add((i), &__get_cpu_var(l)))
193#define cpu_local_sub(i, l) cpu_local_wrap(local_sub((i), &__get_cpu_var(l)))
194
195#define __cpu_local_inc(l) cpu_local_inc(l)
196#define __cpu_local_dec(l) cpu_local_dec(l)
197#define __cpu_local_add(i, l) cpu_local_add((i), (l))
198#define __cpu_local_sub(i, l) cpu_local_sub((i), (l))
199
200#endif /* _ARCH_POWERPC_LOCAL_H */
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index b204926ce913..6cf1a831f550 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -91,6 +91,11 @@ struct machdep_calls {
91 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size, 91 void __iomem * (*ioremap)(phys_addr_t addr, unsigned long size,
92 unsigned long flags); 92 unsigned long flags);
93 void (*iounmap)(volatile void __iomem *token); 93 void (*iounmap)(volatile void __iomem *token);
94
95#ifdef CONFIG_PM
96 void (*iommu_save)(void);
97 void (*iommu_restore)(void);
98#endif
94#endif /* CONFIG_PPC64 */ 99#endif /* CONFIG_PPC64 */
95 100
96 int (*probe)(void); 101 int (*probe)(void);
@@ -115,6 +120,14 @@ struct machdep_calls {
115 /* To setup PHBs when using automatic OF platform driver for PCI */ 120 /* To setup PHBs when using automatic OF platform driver for PCI */
116 int (*pci_setup_phb)(struct pci_controller *host); 121 int (*pci_setup_phb)(struct pci_controller *host);
117 122
123#ifdef CONFIG_PCI_MSI
124 int (*msi_check_device)(struct pci_dev* dev,
125 int nvec, int type);
126 int (*setup_msi_irqs)(struct pci_dev *dev,
127 int nvec, int type);
128 void (*teardown_msi_irqs)(struct pci_dev *dev);
129#endif
130
118 void (*restart)(char *cmd); 131 void (*restart)(char *cmd);
119 void (*power_off)(void); 132 void (*power_off)(void);
120 void (*halt)(void); 133 void (*halt)(void);
@@ -240,14 +253,10 @@ struct machdep_calls {
240 */ 253 */
241 void (*machine_kexec)(struct kimage *image); 254 void (*machine_kexec)(struct kimage *image);
242#endif /* CONFIG_KEXEC */ 255#endif /* CONFIG_KEXEC */
243
244#ifdef CONFIG_PCI_MSI
245 int (*enable_msi)(struct pci_dev *pdev);
246 void (*disable_msi)(struct pci_dev *pdev);
247#endif /* CONFIG_PCI_MSI */
248}; 256};
249 257
250extern void power4_idle(void); 258extern void power4_idle(void);
259extern void power4_cpu_offline_powersave(void);
251extern void ppc6xx_idle(void); 260extern void ppc6xx_idle(void);
252 261
253/* 262/*
diff --git a/include/asm-powerpc/mmu-44x.h b/include/asm-powerpc/mmu-44x.h
new file mode 100644
index 000000000000..d5ce7a8dfe9f
--- /dev/null
+++ b/include/asm-powerpc/mmu-44x.h
@@ -0,0 +1,78 @@
1#ifndef _ASM_POWERPC_MMU_44X_H_
2#define _ASM_POWERPC_MMU_44X_H_
3/*
4 * PPC440 support
5 */
6
7#define PPC44x_MMUCR_TID 0x000000ff
8#define PPC44x_MMUCR_STS 0x00010000
9
10#define PPC44x_TLB_PAGEID 0
11#define PPC44x_TLB_XLAT 1
12#define PPC44x_TLB_ATTRIB 2
13
14/* Page identification fields */
15#define PPC44x_TLB_EPN_MASK 0xfffffc00 /* Effective Page Number */
16#define PPC44x_TLB_VALID 0x00000200 /* Valid flag */
17#define PPC44x_TLB_TS 0x00000100 /* Translation address space */
18#define PPC44x_TLB_1K 0x00000000 /* Page sizes */
19#define PPC44x_TLB_4K 0x00000010
20#define PPC44x_TLB_16K 0x00000020
21#define PPC44x_TLB_64K 0x00000030
22#define PPC44x_TLB_256K 0x00000040
23#define PPC44x_TLB_1M 0x00000050
24#define PPC44x_TLB_16M 0x00000070
25#define PPC44x_TLB_256M 0x00000090
26
27/* Translation fields */
28#define PPC44x_TLB_RPN_MASK 0xfffffc00 /* Real Page Number */
29#define PPC44x_TLB_ERPN_MASK 0x0000000f
30
31/* Storage attribute and access control fields */
32#define PPC44x_TLB_ATTR_MASK 0x0000ff80
33#define PPC44x_TLB_U0 0x00008000 /* User 0 */
34#define PPC44x_TLB_U1 0x00004000 /* User 1 */
35#define PPC44x_TLB_U2 0x00002000 /* User 2 */
36#define PPC44x_TLB_U3 0x00001000 /* User 3 */
37#define PPC44x_TLB_W 0x00000800 /* Caching is write-through */
38#define PPC44x_TLB_I 0x00000400 /* Caching is inhibited */
39#define PPC44x_TLB_M 0x00000200 /* Memory is coherent */
40#define PPC44x_TLB_G 0x00000100 /* Memory is guarded */
41#define PPC44x_TLB_E 0x00000080 /* Memory is guarded */
42
43#define PPC44x_TLB_PERM_MASK 0x0000003f
44#define PPC44x_TLB_UX 0x00000020 /* User execution */
45#define PPC44x_TLB_UW 0x00000010 /* User write */
46#define PPC44x_TLB_UR 0x00000008 /* User read */
47#define PPC44x_TLB_SX 0x00000004 /* Super execution */
48#define PPC44x_TLB_SW 0x00000002 /* Super write */
49#define PPC44x_TLB_SR 0x00000001 /* Super read */
50
51/* Number of TLB entries */
52#define PPC44x_TLB_SIZE 64
53
54#ifndef __ASSEMBLY__
55
56typedef unsigned long long phys_addr_t;
57
58extern phys_addr_t fixup_bigphys_addr(phys_addr_t, phys_addr_t);
59
60typedef struct {
61 unsigned long id;
62 unsigned long vdso_base;
63} mm_context_t;
64
65#endif /* !__ASSEMBLY__ */
66
67#ifndef CONFIG_PPC_EARLY_DEBUG_44x
68#define PPC44x_EARLY_TLBS 1
69#else
70#define PPC44x_EARLY_TLBS 2
71#define PPC44x_EARLY_DEBUG_VIRTADDR (ASM_CONST(0xf0000000) \
72 | (ASM_CONST(CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW) & 0xffff))
73#endif
74
75/* Size of the TLBs used for pinning in lowmem */
76#define PPC_PIN_SIZE (1 << 28) /* 256M */
77
78#endif /* _ASM_POWERPC_MMU_44X_H_ */
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index 06b3e6d336cb..fe510fff8907 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -5,9 +5,12 @@
5#ifdef CONFIG_PPC64 5#ifdef CONFIG_PPC64
6/* 64-bit classic hash table MMU */ 6/* 64-bit classic hash table MMU */
7# include <asm/mmu-hash64.h> 7# include <asm/mmu-hash64.h>
8#elif defined(CONFIG_44x)
9/* 44x-style software loaded TLB */
10# include <asm/mmu-44x.h>
8#else 11#else
9/* 32-bit. FIXME: split up the 32-bit MMU types, and revise for 12/* Other 32-bit. FIXME: split up the other 32-bit MMU types, and
10 * arch/powerpc */ 13 * revise for arch/powerpc */
11# include <asm-ppc/mmu.h> 14# include <asm-ppc/mmu.h>
12#endif 15#endif
13 16
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index 7afd5bf94528..c4631f6dd4f9 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -253,5 +253,16 @@ extern int __init mpc52xx_add_bridge(struct device_node *node);
253 253
254#endif /* __ASSEMBLY__ */ 254#endif /* __ASSEMBLY__ */
255 255
256#ifdef CONFIG_PM
257struct mpc52xx_suspend {
258 void (*board_suspend_prepare)(void __iomem *mbar);
259 void (*board_resume_finish)(void __iomem *mbar);
260};
261
262extern struct mpc52xx_suspend mpc52xx_suspend;
263extern int __init mpc52xx_pm_init(void);
264extern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level);
265#endif /* CONFIG_PM */
266
256#endif /* __ASM_POWERPC_MPC52xx_H__ */ 267#endif /* __ASM_POWERPC_MPC52xx_H__ */
257 268
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index e4d5fc5362a0..2ffb06abe881 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -3,6 +3,7 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/irq.h> 5#include <linux/irq.h>
6#include <linux/sysdev.h>
6#include <asm/dcr.h> 7#include <asm/dcr.h>
7 8
8/* 9/*
@@ -228,6 +229,14 @@ struct mpic_reg_bank {
228#endif /* CONFIG_PPC_DCR */ 229#endif /* CONFIG_PPC_DCR */
229}; 230};
230 231
232struct mpic_irq_save {
233 u32 vecprio,
234 dest;
235#ifdef CONFIG_MPIC_U3_HT_IRQS
236 u32 fixup_data;
237#endif
238};
239
231/* The instance data of a given MPIC */ 240/* The instance data of a given MPIC */
232struct mpic 241struct mpic
233{ 242{
@@ -292,8 +301,19 @@ struct mpic
292 u32 *hw_set; 301 u32 *hw_set;
293#endif 302#endif
294 303
304#ifdef CONFIG_PCI_MSI
305 spinlock_t bitmap_lock;
306 unsigned long *hwirq_bitmap;
307#endif
308
295 /* link */ 309 /* link */
296 struct mpic *next; 310 struct mpic *next;
311
312 struct sys_device sysdev;
313
314#ifdef CONFIG_PM
315 struct mpic_irq_save *save_data;
316#endif
297}; 317};
298 318
299/* 319/*
diff --git a/include/asm-powerpc/of_device.h b/include/asm-powerpc/of_device.h
index 4f1aabe0ce73..e9af49eb1aa8 100644
--- a/include/asm-powerpc/of_device.h
+++ b/include/asm-powerpc/of_device.h
@@ -32,6 +32,8 @@ extern int of_device_register(struct of_device *ofdev);
32extern void of_device_unregister(struct of_device *ofdev); 32extern void of_device_unregister(struct of_device *ofdev);
33extern void of_release_dev(struct device *dev); 33extern void of_release_dev(struct device *dev);
34 34
35extern ssize_t of_device_get_modalias(struct of_device *ofdev,
36 char *str, ssize_t len);
35extern int of_device_uevent(struct device *dev, 37extern int of_device_uevent(struct device *dev,
36 char **envp, int num_envp, char *buffer, int buffer_size); 38 char **envp, int num_envp, char *buffer, int buffer_size);
37 39
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index b4d38b0b15f8..10c51f457d48 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -121,6 +121,7 @@ typedef struct { pte_t pte; } real_pte_t;
121#endif 121#endif
122 122
123/* PMD level */ 123/* PMD level */
124#ifdef CONFIG_PPC64
124typedef struct { unsigned long pmd; } pmd_t; 125typedef struct { unsigned long pmd; } pmd_t;
125#define pmd_val(x) ((x).pmd) 126#define pmd_val(x) ((x).pmd)
126#define __pmd(x) ((pmd_t) { (x) }) 127#define __pmd(x) ((pmd_t) { (x) })
@@ -130,7 +131,8 @@ typedef struct { unsigned long pmd; } pmd_t;
130typedef struct { unsigned long pud; } pud_t; 131typedef struct { unsigned long pud; } pud_t;
131#define pud_val(x) ((x).pud) 132#define pud_val(x) ((x).pud)
132#define __pud(x) ((pud_t) { (x) }) 133#define __pud(x) ((pud_t) { (x) })
133#endif 134#endif /* !CONFIG_PPC_64K_PAGES */
135#endif /* CONFIG_PPC64 */
134 136
135/* PGD level */ 137/* PGD level */
136typedef struct { unsigned long pgd; } pgd_t; 138typedef struct { unsigned long pgd; } pgd_t;
@@ -159,15 +161,17 @@ typedef unsigned long real_pte_t;
159#endif 161#endif
160 162
161 163
164#ifdef CONFIG_PPC64
162typedef unsigned long pmd_t; 165typedef unsigned long pmd_t;
163#define pmd_val(x) (x) 166#define pmd_val(x) (x)
164#define __pmd(x) (x) 167#define __pmd(x) (x)
165 168
166#if defined(CONFIG_PPC64) && !defined(CONFIG_PPC_64K_PAGES) 169#ifndef CONFIG_PPC_64K_PAGES
167typedef unsigned long pud_t; 170typedef unsigned long pud_t;
168#define pud_val(x) (x) 171#define pud_val(x) (x)
169#define __pud(x) (x) 172#define __pud(x) (x)
170#endif 173#endif /* !CONFIG_PPC_64K_PAGES */
174#endif /* CONFIG_PPC64 */
171 175
172typedef unsigned long pgd_t; 176typedef unsigned long pgd_t;
173#define pgd_val(x) (x) 177#define pgd_val(x) (x)
diff --git a/include/asm-powerpc/page_32.h b/include/asm-powerpc/page_32.h
index 07f6d3cf5e5a..374d0db37e1c 100644
--- a/include/asm-powerpc/page_32.h
+++ b/include/asm-powerpc/page_32.h
@@ -14,11 +14,9 @@
14#ifdef CONFIG_PTE_64BIT 14#ifdef CONFIG_PTE_64BIT
15typedef unsigned long long pte_basic_t; 15typedef unsigned long long pte_basic_t;
16#define PTE_SHIFT (PAGE_SHIFT - 3) /* 512 ptes per page */ 16#define PTE_SHIFT (PAGE_SHIFT - 3) /* 512 ptes per page */
17#define PTE_FMT "%16Lx"
18#else 17#else
19typedef unsigned long pte_basic_t; 18typedef unsigned long pte_basic_t;
20#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */ 19#define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */
21#define PTE_FMT "%.8lx"
22#endif 20#endif
23 21
24struct page; 22struct page;
diff --git a/include/asm-powerpc/parport.h b/include/asm-powerpc/parport.h
index b37b81e37278..414c50e2e881 100644
--- a/include/asm-powerpc/parport.h
+++ b/include/asm-powerpc/parport.h
@@ -12,11 +12,6 @@
12 12
13#include <asm/prom.h> 13#include <asm/prom.h>
14 14
15extern struct parport *parport_pc_probe_port (unsigned long int base,
16 unsigned long int base_hi,
17 int irq, int dma,
18 struct pci_dev *dev);
19
20static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) 15static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
21{ 16{
22 struct device_node *np; 17 struct device_node *np;
diff --git a/include/asm-powerpc/pgalloc-32.h b/include/asm-powerpc/pgalloc-32.h
new file mode 100644
index 000000000000..e1307432163c
--- /dev/null
+++ b/include/asm-powerpc/pgalloc-32.h
@@ -0,0 +1,41 @@
1#ifndef _ASM_POWERPC_PGALLOC_32_H
2#define _ASM_POWERPC_PGALLOC_32_H
3
4#include <linux/threads.h>
5
6extern void __bad_pte(pmd_t *pmd);
7
8extern pgd_t *pgd_alloc(struct mm_struct *mm);
9extern void pgd_free(pgd_t *pgd);
10
11/*
12 * We don't have any real pmd's, and this code never triggers because
13 * the pgd will always be present..
14 */
15/* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */
16#define pmd_free(x) do { } while (0)
17#define __pmd_free_tlb(tlb,x) do { } while (0)
18/* #define pgd_populate(mm, pmd, pte) BUG() */
19
20#ifndef CONFIG_BOOKE
21#define pmd_populate_kernel(mm, pmd, pte) \
22 (pmd_val(*(pmd)) = __pa(pte) | _PMD_PRESENT)
23#define pmd_populate(mm, pmd, pte) \
24 (pmd_val(*(pmd)) = (page_to_pfn(pte) << PAGE_SHIFT) | _PMD_PRESENT)
25#else
26#define pmd_populate_kernel(mm, pmd, pte) \
27 (pmd_val(*(pmd)) = (unsigned long)pte | _PMD_PRESENT)
28#define pmd_populate(mm, pmd, pte) \
29 (pmd_val(*(pmd)) = (unsigned long)lowmem_page_address(pte) | _PMD_PRESENT)
30#endif
31
32extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
33extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr);
34extern void pte_free_kernel(pte_t *pte);
35extern void pte_free(struct page *pte);
36
37#define __pte_free_tlb(tlb, pte) pte_free((pte))
38
39#define check_pgt_cache() do { } while (0)
40
41#endif /* _ASM_POWERPC_PGALLOC_32_H */
diff --git a/include/asm-powerpc/pgalloc-64.h b/include/asm-powerpc/pgalloc-64.h
new file mode 100644
index 000000000000..30b50cf56e2c
--- /dev/null
+++ b/include/asm-powerpc/pgalloc-64.h
@@ -0,0 +1,152 @@
1#ifndef _ASM_POWERPC_PGALLOC_64_H
2#define _ASM_POWERPC_PGALLOC_64_H
3/*
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include <linux/mm.h>
11#include <linux/slab.h>
12#include <linux/cpumask.h>
13#include <linux/percpu.h>
14
15extern struct kmem_cache *pgtable_cache[];
16
17#ifdef CONFIG_PPC_64K_PAGES
18#define PTE_CACHE_NUM 0
19#define PMD_CACHE_NUM 1
20#define PGD_CACHE_NUM 2
21#define HUGEPTE_CACHE_NUM 3
22#else
23#define PTE_CACHE_NUM 0
24#define PMD_CACHE_NUM 1
25#define PUD_CACHE_NUM 1
26#define PGD_CACHE_NUM 0
27#define HUGEPTE_CACHE_NUM 2
28#endif
29
30static inline pgd_t *pgd_alloc(struct mm_struct *mm)
31{
32 return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL);
33}
34
35static inline void pgd_free(pgd_t *pgd)
36{
37 kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd);
38}
39
40#ifndef CONFIG_PPC_64K_PAGES
41
42#define pgd_populate(MM, PGD, PUD) pgd_set(PGD, PUD)
43
44static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
45{
46 return kmem_cache_alloc(pgtable_cache[PUD_CACHE_NUM],
47 GFP_KERNEL|__GFP_REPEAT);
48}
49
50static inline void pud_free(pud_t *pud)
51{
52 kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud);
53}
54
55static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
56{
57 pud_set(pud, (unsigned long)pmd);
58}
59
60#define pmd_populate(mm, pmd, pte_page) \
61 pmd_populate_kernel(mm, pmd, page_address(pte_page))
62#define pmd_populate_kernel(mm, pmd, pte) pmd_set(pmd, (unsigned long)(pte))
63
64
65#else /* CONFIG_PPC_64K_PAGES */
66
67#define pud_populate(mm, pud, pmd) pud_set(pud, (unsigned long)pmd)
68
69static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
70 pte_t *pte)
71{
72 pmd_set(pmd, (unsigned long)pte);
73}
74
75#define pmd_populate(mm, pmd, pte_page) \
76 pmd_populate_kernel(mm, pmd, page_address(pte_page))
77
78#endif /* CONFIG_PPC_64K_PAGES */
79
80static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
81{
82 return kmem_cache_alloc(pgtable_cache[PMD_CACHE_NUM],
83 GFP_KERNEL|__GFP_REPEAT);
84}
85
86static inline void pmd_free(pmd_t *pmd)
87{
88 kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd);
89}
90
91static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
92 unsigned long address)
93{
94 return kmem_cache_alloc(pgtable_cache[PTE_CACHE_NUM],
95 GFP_KERNEL|__GFP_REPEAT);
96}
97
98static inline struct page *pte_alloc_one(struct mm_struct *mm,
99 unsigned long address)
100{
101 return virt_to_page(pte_alloc_one_kernel(mm, address));
102}
103
104static inline void pte_free_kernel(pte_t *pte)
105{
106 kmem_cache_free(pgtable_cache[PTE_CACHE_NUM], pte);
107}
108
109static inline void pte_free(struct page *ptepage)
110{
111 pte_free_kernel(page_address(ptepage));
112}
113
114#define PGF_CACHENUM_MASK 0x3
115
116typedef struct pgtable_free {
117 unsigned long val;
118} pgtable_free_t;
119
120static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum,
121 unsigned long mask)
122{
123 BUG_ON(cachenum > PGF_CACHENUM_MASK);
124
125 return (pgtable_free_t){.val = ((unsigned long) p & ~mask) | cachenum};
126}
127
128static inline void pgtable_free(pgtable_free_t pgf)
129{
130 void *p = (void *)(pgf.val & ~PGF_CACHENUM_MASK);
131 int cachenum = pgf.val & PGF_CACHENUM_MASK;
132
133 kmem_cache_free(pgtable_cache[cachenum], p);
134}
135
136extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
137
138#define __pte_free_tlb(tlb, ptepage) \
139 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
140 PTE_CACHE_NUM, PTE_TABLE_SIZE-1))
141#define __pmd_free_tlb(tlb, pmd) \
142 pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \
143 PMD_CACHE_NUM, PMD_TABLE_SIZE-1))
144#ifndef CONFIG_PPC_64K_PAGES
145#define __pud_free_tlb(tlb, pud) \
146 pgtable_free_tlb(tlb, pgtable_free_cache(pud, \
147 PUD_CACHE_NUM, PUD_TABLE_SIZE-1))
148#endif /* CONFIG_PPC_64K_PAGES */
149
150#define check_pgt_cache() do { } while (0)
151
152#endif /* _ASM_POWERPC_PGALLOC_64_H */
diff --git a/include/asm-powerpc/pgalloc.h b/include/asm-powerpc/pgalloc.h
index b0830db68f8a..b4505ed0f0f2 100644
--- a/include/asm-powerpc/pgalloc.h
+++ b/include/asm-powerpc/pgalloc.h
@@ -2,159 +2,11 @@
2#define _ASM_POWERPC_PGALLOC_H 2#define _ASM_POWERPC_PGALLOC_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#ifndef CONFIG_PPC64 5#ifdef CONFIG_PPC64
6#include <asm-ppc/pgalloc.h> 6#include <asm/pgalloc-64.h>
7#else 7#else
8 8#include <asm/pgalloc-32.h>
9#include <linux/mm.h>
10#include <linux/slab.h>
11#include <linux/cpumask.h>
12#include <linux/percpu.h>
13
14extern struct kmem_cache *pgtable_cache[];
15
16#ifdef CONFIG_PPC_64K_PAGES
17#define PTE_CACHE_NUM 0
18#define PMD_CACHE_NUM 1
19#define PGD_CACHE_NUM 2
20#define HUGEPTE_CACHE_NUM 3
21#else
22#define PTE_CACHE_NUM 0
23#define PMD_CACHE_NUM 1
24#define PUD_CACHE_NUM 1
25#define PGD_CACHE_NUM 0
26#define HUGEPTE_CACHE_NUM 2
27#endif 9#endif
28 10
29/*
30 * This program is free software; you can redistribute it and/or
31 * modify it under the terms of the GNU General Public License
32 * as published by the Free Software Foundation; either version
33 * 2 of the License, or (at your option) any later version.
34 */
35
36static inline pgd_t *pgd_alloc(struct mm_struct *mm)
37{
38 return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL);
39}
40
41static inline void pgd_free(pgd_t *pgd)
42{
43 kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd);
44}
45
46#ifndef CONFIG_PPC_64K_PAGES
47
48#define pgd_populate(MM, PGD, PUD) pgd_set(PGD, PUD)
49
50static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
51{
52 return kmem_cache_alloc(pgtable_cache[PUD_CACHE_NUM],
53 GFP_KERNEL|__GFP_REPEAT);
54}
55
56static inline void pud_free(pud_t *pud)
57{
58 kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud);
59}
60
61static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
62{
63 pud_set(pud, (unsigned long)pmd);
64}
65
66#define pmd_populate(mm, pmd, pte_page) \
67 pmd_populate_kernel(mm, pmd, page_address(pte_page))
68#define pmd_populate_kernel(mm, pmd, pte) pmd_set(pmd, (unsigned long)(pte))
69
70
71#else /* CONFIG_PPC_64K_PAGES */
72
73#define pud_populate(mm, pud, pmd) pud_set(pud, (unsigned long)pmd)
74
75static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
76 pte_t *pte)
77{
78 pmd_set(pmd, (unsigned long)pte);
79}
80
81#define pmd_populate(mm, pmd, pte_page) \
82 pmd_populate_kernel(mm, pmd, page_address(pte_page))
83
84#endif /* CONFIG_PPC_64K_PAGES */
85
86static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
87{
88 return kmem_cache_alloc(pgtable_cache[PMD_CACHE_NUM],
89 GFP_KERNEL|__GFP_REPEAT);
90}
91
92static inline void pmd_free(pmd_t *pmd)
93{
94 kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd);
95}
96
97static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
98 unsigned long address)
99{
100 return kmem_cache_alloc(pgtable_cache[PTE_CACHE_NUM],
101 GFP_KERNEL|__GFP_REPEAT);
102}
103
104static inline struct page *pte_alloc_one(struct mm_struct *mm,
105 unsigned long address)
106{
107 return virt_to_page(pte_alloc_one_kernel(mm, address));
108}
109
110static inline void pte_free_kernel(pte_t *pte)
111{
112 kmem_cache_free(pgtable_cache[PTE_CACHE_NUM], pte);
113}
114
115static inline void pte_free(struct page *ptepage)
116{
117 pte_free_kernel(page_address(ptepage));
118}
119
120#define PGF_CACHENUM_MASK 0x3
121
122typedef struct pgtable_free {
123 unsigned long val;
124} pgtable_free_t;
125
126static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum,
127 unsigned long mask)
128{
129 BUG_ON(cachenum > PGF_CACHENUM_MASK);
130
131 return (pgtable_free_t){.val = ((unsigned long) p & ~mask) | cachenum};
132}
133
134static inline void pgtable_free(pgtable_free_t pgf)
135{
136 void *p = (void *)(pgf.val & ~PGF_CACHENUM_MASK);
137 int cachenum = pgf.val & PGF_CACHENUM_MASK;
138
139 kmem_cache_free(pgtable_cache[cachenum], p);
140}
141
142extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
143
144#define __pte_free_tlb(tlb, ptepage) \
145 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
146 PTE_CACHE_NUM, PTE_TABLE_SIZE-1))
147#define __pmd_free_tlb(tlb, pmd) \
148 pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \
149 PMD_CACHE_NUM, PMD_TABLE_SIZE-1))
150#ifndef CONFIG_PPC_64K_PAGES
151#define __pud_free_tlb(tlb, pud) \
152 pgtable_free_tlb(tlb, pgtable_free_cache(pud, \
153 PUD_CACHE_NUM, PUD_TABLE_SIZE-1))
154#endif /* CONFIG_PPC_64K_PAGES */
155
156#define check_pgt_cache() do { } while (0)
157
158#endif /* CONFIG_PPC64 */
159#endif /* __KERNEL__ */ 11#endif /* __KERNEL__ */
160#endif /* _ASM_POWERPC_PGALLOC_H */ 12#endif /* _ASM_POWERPC_PGALLOC_H */
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h
index a28fa8bc01da..1744d6ac12a2 100644
--- a/include/asm-powerpc/pgtable-4k.h
+++ b/include/asm-powerpc/pgtable-4k.h
@@ -1,3 +1,5 @@
1#ifndef _ASM_POWERPC_PGTABLE_4K_H
2#define _ASM_POWERPC_PGTABLE_4K_H
1/* 3/*
2 * Entries per page directory level. The PTE level must use a 64b record 4 * Entries per page directory level. The PTE level must use a 64b record
3 * for each page table entry. The PMD and PGD level use a 32b record for 5 * for each page table entry. The PMD and PGD level use a 32b record for
@@ -100,3 +102,4 @@
100 102
101#define remap_4k_pfn(vma, addr, pfn, prot) \ 103#define remap_4k_pfn(vma, addr, pfn, prot) \
102 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, (prot)) 104 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, (prot))
105#endif /* _ASM_POWERPC_PGTABLE_4K_H */
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h
index 5e84f070eaf7..16ef4978520d 100644
--- a/include/asm-powerpc/pgtable-64k.h
+++ b/include/asm-powerpc/pgtable-64k.h
@@ -1,6 +1,5 @@
1#ifndef _ASM_POWERPC_PGTABLE_64K_H 1#ifndef _ASM_POWERPC_PGTABLE_64K_H
2#define _ASM_POWERPC_PGTABLE_64K_H 2#define _ASM_POWERPC_PGTABLE_64K_H
3#ifdef __KERNEL__
4 3
5#include <asm-generic/pgtable-nopud.h> 4#include <asm-generic/pgtable-nopud.h>
6 5
@@ -65,8 +64,6 @@
65/* Bits to mask out from a PGD/PUD to get to the PMD page */ 64/* Bits to mask out from a PGD/PUD to get to the PMD page */
66#define PUD_MASKED_BITS 0x1ff 65#define PUD_MASKED_BITS 0x1ff
67 66
68#ifndef __ASSEMBLY__
69
70/* Manipulate "rpte" values */ 67/* Manipulate "rpte" values */
71#define __real_pte(e,p) ((real_pte_t) { \ 68#define __real_pte(e,p) ((real_pte_t) { \
72 (e), pte_val(*((p) + PTRS_PER_PTE)) }) 69 (e), pte_val(*((p) + PTRS_PER_PTE)) })
@@ -98,6 +95,4 @@
98 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \ 95 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, \
99 __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN)) 96 __pgprot(pgprot_val((prot)) | _PAGE_4K_PFN))
100 97
101#endif /* __ASSEMBLY__ */
102#endif /* __KERNEL__ */
103#endif /* _ASM_POWERPC_PGTABLE_64K_H */ 98#endif /* _ASM_POWERPC_PGTABLE_64K_H */
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h
new file mode 100644
index 000000000000..09662a24f226
--- /dev/null
+++ b/include/asm-powerpc/pgtable-ppc32.h
@@ -0,0 +1,813 @@
1#ifndef _ASM_POWERPC_PGTABLE_PPC32_H
2#define _ASM_POWERPC_PGTABLE_PPC32_H
3
4#include <asm-generic/pgtable-nopmd.h>
5
6#ifndef __ASSEMBLY__
7#include <linux/sched.h>
8#include <linux/threads.h>
9#include <asm/processor.h> /* For TASK_SIZE */
10#include <asm/mmu.h>
11#include <asm/page.h>
12#include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */
13struct mm_struct;
14
15extern unsigned long va_to_phys(unsigned long address);
16extern pte_t *va_to_pte(unsigned long address);
17extern unsigned long ioremap_bot, ioremap_base;
18#endif /* __ASSEMBLY__ */
19
20/*
21 * The PowerPC MMU uses a hash table containing PTEs, together with
22 * a set of 16 segment registers (on 32-bit implementations), to define
23 * the virtual to physical address mapping.
24 *
25 * We use the hash table as an extended TLB, i.e. a cache of currently
26 * active mappings. We maintain a two-level page table tree, much
27 * like that used by the i386, for the sake of the Linux memory
28 * management code. Low-level assembler code in hashtable.S
29 * (procedure hash_page) is responsible for extracting ptes from the
30 * tree and putting them into the hash table when necessary, and
31 * updating the accessed and modified bits in the page table tree.
32 */
33
34/*
35 * The PowerPC MPC8xx uses a TLB with hardware assisted, software tablewalk.
36 * We also use the two level tables, but we can put the real bits in them
37 * needed for the TLB and tablewalk. These definitions require Mx_CTR.PPM = 0,
38 * Mx_CTR.PPCS = 0, and MD_CTR.TWAM = 1. The level 2 descriptor has
39 * additional page protection (when Mx_CTR.PPCS = 1) that allows TLB hit
40 * based upon user/super access. The TLB does not have accessed nor write
41 * protect. We assume that if the TLB get loaded with an entry it is
42 * accessed, and overload the changed bit for write protect. We use
43 * two bits in the software pte that are supposed to be set to zero in
44 * the TLB entry (24 and 25) for these indicators. Although the level 1
45 * descriptor contains the guarded and writethrough/copyback bits, we can
46 * set these at the page level since they get copied from the Mx_TWC
47 * register when the TLB entry is loaded. We will use bit 27 for guard, since
48 * that is where it exists in the MD_TWC, and bit 26 for writethrough.
49 * These will get masked from the level 2 descriptor at TLB load time, and
50 * copied to the MD_TWC before it gets loaded.
51 * Large page sizes added. We currently support two sizes, 4K and 8M.
52 * This also allows a TLB hander optimization because we can directly
53 * load the PMD into MD_TWC. The 8M pages are only used for kernel
54 * mapping of well known areas. The PMD (PGD) entries contain control
55 * flags in addition to the address, so care must be taken that the
56 * software no longer assumes these are only pointers.
57 */
58
59/*
60 * At present, all PowerPC 400-class processors share a similar TLB
61 * architecture. The instruction and data sides share a unified,
62 * 64-entry, fully-associative TLB which is maintained totally under
63 * software control. In addition, the instruction side has a
64 * hardware-managed, 4-entry, fully-associative TLB which serves as a
65 * first level to the shared TLB. These two TLBs are known as the UTLB
66 * and ITLB, respectively (see "mmu.h" for definitions).
67 */
68
69/*
70 * The normal case is that PTEs are 32-bits and we have a 1-page
71 * 1024-entry pgdir pointing to 1-page 1024-entry PTE pages. -- paulus
72 *
73 * For any >32-bit physical address platform, we can use the following
74 * two level page table layout where the pgdir is 8KB and the MS 13 bits
75 * are an index to the second level table. The combined pgdir/pmd first
76 * level has 2048 entries and the second level has 512 64-bit PTE entries.
77 * -Matt
78 */
79/* PGDIR_SHIFT determines what a top-level page table entry can map */
80#define PGDIR_SHIFT (PAGE_SHIFT + PTE_SHIFT)
81#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
82#define PGDIR_MASK (~(PGDIR_SIZE-1))
83
84/*
85 * entries per page directory level: our page-table tree is two-level, so
86 * we don't really have any PMD directory.
87 */
88#define PTRS_PER_PTE (1 << PTE_SHIFT)
89#define PTRS_PER_PMD 1
90#define PTRS_PER_PGD (1 << (32 - PGDIR_SHIFT))
91
92#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
93#define FIRST_USER_ADDRESS 0
94
95#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
96#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
97
98#define pte_ERROR(e) \
99 printk("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \
100 (unsigned long long)pte_val(e))
101#define pgd_ERROR(e) \
102 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
103
104/*
105 * Just any arbitrary offset to the start of the vmalloc VM area: the
106 * current 64MB value just means that there will be a 64MB "hole" after the
107 * physical memory until the kernel virtual memory starts. That means that
108 * any out-of-bounds memory accesses will hopefully be caught.
109 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
110 * area for the same reason. ;)
111 *
112 * We no longer map larger than phys RAM with the BATs so we don't have
113 * to worry about the VMALLOC_OFFSET causing problems. We do have to worry
114 * about clashes between our early calls to ioremap() that start growing down
115 * from ioremap_base being run into the VM area allocations (growing upwards
116 * from VMALLOC_START). For this reason we have ioremap_bot to check when
117 * we actually run into our mappings setup in the early boot with the VM
118 * system. This really does become a problem for machines with good amounts
119 * of RAM. -- Cort
120 */
121#define VMALLOC_OFFSET (0x1000000) /* 16M */
122#ifdef PPC_PIN_SIZE
123#define VMALLOC_START (((_ALIGN((long)high_memory, PPC_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
124#else
125#define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
126#endif
127#define VMALLOC_END ioremap_bot
128
129/*
130 * Bits in a linux-style PTE. These match the bits in the
131 * (hardware-defined) PowerPC PTE as closely as possible.
132 */
133
134#if defined(CONFIG_40x)
135
136/* There are several potential gotchas here. The 40x hardware TLBLO
137 field looks like this:
138
139 0 1 2 3 4 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31
140 RPN..................... 0 0 EX WR ZSEL....... W I M G
141
142 Where possible we make the Linux PTE bits match up with this
143
144 - bits 20 and 21 must be cleared, because we use 4k pages (40x can
145 support down to 1k pages), this is done in the TLBMiss exception
146 handler.
147 - We use only zones 0 (for kernel pages) and 1 (for user pages)
148 of the 16 available. Bit 24-26 of the TLB are cleared in the TLB
149 miss handler. Bit 27 is PAGE_USER, thus selecting the correct
150 zone.
151 - PRESENT *must* be in the bottom two bits because swap cache
152 entries use the top 30 bits. Because 40x doesn't support SMP
153 anyway, M is irrelevant so we borrow it for PAGE_PRESENT. Bit 30
154 is cleared in the TLB miss handler before the TLB entry is loaded.
155 - All other bits of the PTE are loaded into TLBLO without
156 modification, leaving us only the bits 20, 21, 24, 25, 26, 30 for
157 software PTE bits. We actually use use bits 21, 24, 25, and
158 30 respectively for the software bits: ACCESSED, DIRTY, RW, and
159 PRESENT.
160*/
161
162/* Definitions for 40x embedded chips. */
163#define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */
164#define _PAGE_FILE 0x001 /* when !present: nonlinear file mapping */
165#define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */
166#define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */
167#define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */
168#define _PAGE_USER 0x010 /* matches one of the zone permission bits */
169#define _PAGE_RW 0x040 /* software: Writes permitted */
170#define _PAGE_DIRTY 0x080 /* software: dirty page */
171#define _PAGE_HWWRITE 0x100 /* hardware: Dirty & RW, set in exception */
172#define _PAGE_HWEXEC 0x200 /* hardware: EX permission */
173#define _PAGE_ACCESSED 0x400 /* software: R: page referenced */
174
175#define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */
176#define _PMD_BAD 0x802
177#define _PMD_SIZE 0x0e0 /* size field, != 0 for large-page PMD entry */
178#define _PMD_SIZE_4M 0x0c0
179#define _PMD_SIZE_16M 0x0e0
180#define PMD_PAGE_SIZE(pmdval) (1024 << (((pmdval) & _PMD_SIZE) >> 4))
181
182#elif defined(CONFIG_44x)
183/*
184 * Definitions for PPC440
185 *
186 * Because of the 3 word TLB entries to support 36-bit addressing,
187 * the attribute are difficult to map in such a fashion that they
188 * are easily loaded during exception processing. I decided to
189 * organize the entry so the ERPN is the only portion in the
190 * upper word of the PTE and the attribute bits below are packed
191 * in as sensibly as they can be in the area below a 4KB page size
192 * oriented RPN. This at least makes it easy to load the RPN and
193 * ERPN fields in the TLB. -Matt
194 *
195 * Note that these bits preclude future use of a page size
196 * less than 4KB.
197 *
198 *
199 * PPC 440 core has following TLB attribute fields;
200 *
201 * TLB1:
202 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
203 * RPN................................. - - - - - - ERPN.......
204 *
205 * TLB2:
206 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
207 * - - - - - - U0 U1 U2 U3 W I M G E - UX UW UR SX SW SR
208 *
209 * There are some constrains and options, to decide mapping software bits
210 * into TLB entry.
211 *
212 * - PRESENT *must* be in the bottom three bits because swap cache
213 * entries use the top 29 bits for TLB2.
214 *
215 * - FILE *must* be in the bottom three bits because swap cache
216 * entries use the top 29 bits for TLB2.
217 *
218 * - CACHE COHERENT bit (M) has no effect on PPC440 core, because it
219 * doesn't support SMP. So we can use this as software bit, like
220 * DIRTY.
221 *
222 * With the PPC 44x Linux implementation, the 0-11th LSBs of the PTE are used
223 * for memory protection related functions (see PTE structure in
224 * include/asm-ppc/mmu.h). The _PAGE_XXX definitions in this file map to the
225 * above bits. Note that the bit values are CPU specific, not architecture
226 * specific.
227 *
228 * The kernel PTE entry holds an arch-dependent swp_entry structure under
229 * certain situations. In other words, in such situations some portion of
230 * the PTE bits are used as a swp_entry. In the PPC implementation, the
231 * 3-24th LSB are shared with swp_entry, however the 0-2nd three LSB still
232 * hold protection values. That means the three protection bits are
233 * reserved for both PTE and SWAP entry at the most significant three
234 * LSBs.
235 *
236 * There are three protection bits available for SWAP entry:
237 * _PAGE_PRESENT
238 * _PAGE_FILE
239 * _PAGE_HASHPTE (if HW has)
240 *
241 * So those three bits have to be inside of 0-2nd LSB of PTE.
242 *
243 */
244
245#define _PAGE_PRESENT 0x00000001 /* S: PTE valid */
246#define _PAGE_RW 0x00000002 /* S: Write permission */
247#define _PAGE_FILE 0x00000004 /* S: nonlinear file mapping */
248#define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */
249#define _PAGE_HWWRITE 0x00000010 /* H: Dirty & RW */
250#define _PAGE_HWEXEC 0x00000020 /* H: Execute permission */
251#define _PAGE_USER 0x00000040 /* S: User page */
252#define _PAGE_ENDIAN 0x00000080 /* H: E bit */
253#define _PAGE_GUARDED 0x00000100 /* H: G bit */
254#define _PAGE_DIRTY 0x00000200 /* S: Page dirty */
255#define _PAGE_NO_CACHE 0x00000400 /* H: I bit */
256#define _PAGE_WRITETHRU 0x00000800 /* H: W bit */
257
258/* TODO: Add large page lowmem mapping support */
259#define _PMD_PRESENT 0
260#define _PMD_PRESENT_MASK (PAGE_MASK)
261#define _PMD_BAD (~PAGE_MASK)
262
263/* ERPN in a PTE never gets cleared, ignore it */
264#define _PTE_NONE_MASK 0xffffffff00000000ULL
265
266#elif defined(CONFIG_FSL_BOOKE)
267/*
268 MMU Assist Register 3:
269
270 32 33 34 35 36 ... 50 51 52 53 54 55 56 57 58 59 60 61 62 63
271 RPN...................... 0 0 U0 U1 U2 U3 UX SX UW SW UR SR
272
273 - PRESENT *must* be in the bottom three bits because swap cache
274 entries use the top 29 bits.
275
276 - FILE *must* be in the bottom three bits because swap cache
277 entries use the top 29 bits.
278*/
279
280/* Definitions for FSL Book-E Cores */
281#define _PAGE_PRESENT 0x00001 /* S: PTE contains a translation */
282#define _PAGE_USER 0x00002 /* S: User page (maps to UR) */
283#define _PAGE_FILE 0x00002 /* S: when !present: nonlinear file mapping */
284#define _PAGE_ACCESSED 0x00004 /* S: Page referenced */
285#define _PAGE_HWWRITE 0x00008 /* H: Dirty & RW, set in exception */
286#define _PAGE_RW 0x00010 /* S: Write permission */
287#define _PAGE_HWEXEC 0x00020 /* H: UX permission */
288
289#define _PAGE_ENDIAN 0x00040 /* H: E bit */
290#define _PAGE_GUARDED 0x00080 /* H: G bit */
291#define _PAGE_COHERENT 0x00100 /* H: M bit */
292#define _PAGE_NO_CACHE 0x00200 /* H: I bit */
293#define _PAGE_WRITETHRU 0x00400 /* H: W bit */
294
295#ifdef CONFIG_PTE_64BIT
296#define _PAGE_DIRTY 0x08000 /* S: Page dirty */
297
298/* ERPN in a PTE never gets cleared, ignore it */
299#define _PTE_NONE_MASK 0xffffffffffff0000ULL
300#else
301#define _PAGE_DIRTY 0x00800 /* S: Page dirty */
302#endif
303
304#define _PMD_PRESENT 0
305#define _PMD_PRESENT_MASK (PAGE_MASK)
306#define _PMD_BAD (~PAGE_MASK)
307
308#elif defined(CONFIG_8xx)
309/* Definitions for 8xx embedded chips. */
310#define _PAGE_PRESENT 0x0001 /* Page is valid */
311#define _PAGE_FILE 0x0002 /* when !present: nonlinear file mapping */
312#define _PAGE_NO_CACHE 0x0002 /* I: cache inhibit */
313#define _PAGE_SHARED 0x0004 /* No ASID (context) compare */
314
315/* These five software bits must be masked out when the entry is loaded
316 * into the TLB.
317 */
318#define _PAGE_EXEC 0x0008 /* software: i-cache coherency required */
319#define _PAGE_GUARDED 0x0010 /* software: guarded access */
320#define _PAGE_DIRTY 0x0020 /* software: page changed */
321#define _PAGE_RW 0x0040 /* software: user write access allowed */
322#define _PAGE_ACCESSED 0x0080 /* software: page referenced */
323
324/* Setting any bits in the nibble with the follow two controls will
325 * require a TLB exception handler change. It is assumed unused bits
326 * are always zero.
327 */
328#define _PAGE_HWWRITE 0x0100 /* h/w write enable: never set in Linux PTE */
329#define _PAGE_USER 0x0800 /* One of the PP bits, the other is USER&~RW */
330
331#define _PMD_PRESENT 0x0001
332#define _PMD_BAD 0x0ff0
333#define _PMD_PAGE_MASK 0x000c
334#define _PMD_PAGE_8M 0x000c
335
336/*
337 * The 8xx TLB miss handler allegedly sets _PAGE_ACCESSED in the PTE
338 * for an address even if _PAGE_PRESENT is not set, as a performance
339 * optimization. This is a bug if you ever want to use swap unless
340 * _PAGE_ACCESSED is 2, which it isn't, or unless you have 8xx-specific
341 * definitions for __swp_entry etc. below, which would be gross.
342 * -- paulus
343 */
344#define _PTE_NONE_MASK _PAGE_ACCESSED
345
346#else /* CONFIG_6xx */
347/* Definitions for 60x, 740/750, etc. */
348#define _PAGE_PRESENT 0x001 /* software: pte contains a translation */
349#define _PAGE_HASHPTE 0x002 /* hash_page has made an HPTE for this pte */
350#define _PAGE_FILE 0x004 /* when !present: nonlinear file mapping */
351#define _PAGE_USER 0x004 /* usermode access allowed */
352#define _PAGE_GUARDED 0x008 /* G: prohibit speculative access */
353#define _PAGE_COHERENT 0x010 /* M: enforce memory coherence (SMP systems) */
354#define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */
355#define _PAGE_WRITETHRU 0x040 /* W: cache write-through */
356#define _PAGE_DIRTY 0x080 /* C: page changed */
357#define _PAGE_ACCESSED 0x100 /* R: page referenced */
358#define _PAGE_EXEC 0x200 /* software: i-cache coherency required */
359#define _PAGE_RW 0x400 /* software: user write access allowed */
360
361#define _PTE_NONE_MASK _PAGE_HASHPTE
362
363#define _PMD_PRESENT 0
364#define _PMD_PRESENT_MASK (PAGE_MASK)
365#define _PMD_BAD (~PAGE_MASK)
366#endif
367
368/*
369 * Some bits are only used on some cpu families...
370 */
371#ifndef _PAGE_HASHPTE
372#define _PAGE_HASHPTE 0
373#endif
374#ifndef _PTE_NONE_MASK
375#define _PTE_NONE_MASK 0
376#endif
377#ifndef _PAGE_SHARED
378#define _PAGE_SHARED 0
379#endif
380#ifndef _PAGE_HWWRITE
381#define _PAGE_HWWRITE 0
382#endif
383#ifndef _PAGE_HWEXEC
384#define _PAGE_HWEXEC 0
385#endif
386#ifndef _PAGE_EXEC
387#define _PAGE_EXEC 0
388#endif
389#ifndef _PMD_PRESENT_MASK
390#define _PMD_PRESENT_MASK _PMD_PRESENT
391#endif
392#ifndef _PMD_SIZE
393#define _PMD_SIZE 0
394#define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE()
395#endif
396
397#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
398
399/*
400 * Note: the _PAGE_COHERENT bit automatically gets set in the hardware
401 * PTE if CONFIG_SMP is defined (hash_page does this); there is no need
402 * to have it in the Linux PTE, and in fact the bit could be reused for
403 * another purpose. -- paulus.
404 */
405
406#ifdef CONFIG_44x
407#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_GUARDED)
408#else
409#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED)
410#endif
411#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY | _PAGE_HWWRITE)
412#define _PAGE_KERNEL (_PAGE_BASE | _PAGE_SHARED | _PAGE_WRENABLE)
413
414#ifdef CONFIG_PPC_STD_MMU
415/* On standard PPC MMU, no user access implies kernel read/write access,
416 * so to write-protect kernel memory we must turn on user access */
417#define _PAGE_KERNEL_RO (_PAGE_BASE | _PAGE_SHARED | _PAGE_USER)
418#else
419#define _PAGE_KERNEL_RO (_PAGE_BASE | _PAGE_SHARED)
420#endif
421
422#define _PAGE_IO (_PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED)
423#define _PAGE_RAM (_PAGE_KERNEL | _PAGE_HWEXEC)
424
425#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH)
426/* We want the debuggers to be able to set breakpoints anywhere, so
427 * don't write protect the kernel text */
428#define _PAGE_RAM_TEXT _PAGE_RAM
429#else
430#define _PAGE_RAM_TEXT (_PAGE_KERNEL_RO | _PAGE_HWEXEC)
431#endif
432
433#define PAGE_NONE __pgprot(_PAGE_BASE)
434#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
435#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
436#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
437#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
438#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
439#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
440
441#define PAGE_KERNEL __pgprot(_PAGE_RAM)
442#define PAGE_KERNEL_NOCACHE __pgprot(_PAGE_IO)
443
444/*
445 * The PowerPC can only do execute protection on a segment (256MB) basis,
446 * not on a page basis. So we consider execute permission the same as read.
447 * Also, write permissions imply read permissions.
448 * This is the closest we can get..
449 */
450#define __P000 PAGE_NONE
451#define __P001 PAGE_READONLY_X
452#define __P010 PAGE_COPY
453#define __P011 PAGE_COPY_X
454#define __P100 PAGE_READONLY
455#define __P101 PAGE_READONLY_X
456#define __P110 PAGE_COPY
457#define __P111 PAGE_COPY_X
458
459#define __S000 PAGE_NONE
460#define __S001 PAGE_READONLY_X
461#define __S010 PAGE_SHARED
462#define __S011 PAGE_SHARED_X
463#define __S100 PAGE_READONLY
464#define __S101 PAGE_READONLY_X
465#define __S110 PAGE_SHARED
466#define __S111 PAGE_SHARED_X
467
468#ifndef __ASSEMBLY__
469/* Make sure we get a link error if PMD_PAGE_SIZE is ever called on a
470 * kernel without large page PMD support */
471extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
472
473/*
474 * Conversions between PTE values and page frame numbers.
475 */
476
477/* in some case we want to additionaly adjust where the pfn is in the pte to
478 * allow room for more flags */
479#if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_PTE_64BIT)
480#define PFN_SHIFT_OFFSET (PAGE_SHIFT + 8)
481#else
482#define PFN_SHIFT_OFFSET (PAGE_SHIFT)
483#endif
484
485#define pte_pfn(x) (pte_val(x) >> PFN_SHIFT_OFFSET)
486#define pte_page(x) pfn_to_page(pte_pfn(x))
487
488#define pfn_pte(pfn, prot) __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) |\
489 pgprot_val(prot))
490#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
491
492/*
493 * ZERO_PAGE is a global shared page that is always zero: used
494 * for zero-mapped memory areas etc..
495 */
496extern unsigned long empty_zero_page[1024];
497#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
498
499#endif /* __ASSEMBLY__ */
500
501#define pte_none(pte) ((pte_val(pte) & ~_PTE_NONE_MASK) == 0)
502#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
503#define pte_clear(mm,addr,ptep) do { set_pte_at((mm), (addr), (ptep), __pte(0)); } while (0)
504
505#define pmd_none(pmd) (!pmd_val(pmd))
506#define pmd_bad(pmd) (pmd_val(pmd) & _PMD_BAD)
507#define pmd_present(pmd) (pmd_val(pmd) & _PMD_PRESENT_MASK)
508#define pmd_clear(pmdp) do { pmd_val(*(pmdp)) = 0; } while (0)
509
510#ifndef __ASSEMBLY__
511/*
512 * The following only work if pte_present() is true.
513 * Undefined behaviour if not..
514 */
515static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
516static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
517static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; }
518static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
519static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
520static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
521
522static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
523static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
524
525static inline pte_t pte_rdprotect(pte_t pte) {
526 pte_val(pte) &= ~_PAGE_USER; return pte; }
527static inline pte_t pte_wrprotect(pte_t pte) {
528 pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; }
529static inline pte_t pte_exprotect(pte_t pte) {
530 pte_val(pte) &= ~_PAGE_EXEC; return pte; }
531static inline pte_t pte_mkclean(pte_t pte) {
532 pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; }
533static inline pte_t pte_mkold(pte_t pte) {
534 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
535
536static inline pte_t pte_mkread(pte_t pte) {
537 pte_val(pte) |= _PAGE_USER; return pte; }
538static inline pte_t pte_mkexec(pte_t pte) {
539 pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
540static inline pte_t pte_mkwrite(pte_t pte) {
541 pte_val(pte) |= _PAGE_RW; return pte; }
542static inline pte_t pte_mkdirty(pte_t pte) {
543 pte_val(pte) |= _PAGE_DIRTY; return pte; }
544static inline pte_t pte_mkyoung(pte_t pte) {
545 pte_val(pte) |= _PAGE_ACCESSED; return pte; }
546
547static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
548{
549 pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot);
550 return pte;
551}
552
553/*
554 * When flushing the tlb entry for a page, we also need to flush the hash
555 * table entry. flush_hash_pages is assembler (for speed) in hashtable.S.
556 */
557extern int flush_hash_pages(unsigned context, unsigned long va,
558 unsigned long pmdval, int count);
559
560/* Add an HPTE to the hash table */
561extern void add_hash_page(unsigned context, unsigned long va,
562 unsigned long pmdval);
563
564/*
565 * Atomic PTE updates.
566 *
567 * pte_update clears and sets bit atomically, and returns
568 * the old pte value. In the 64-bit PTE case we lock around the
569 * low PTE word since we expect ALL flag bits to be there
570 */
571#ifndef CONFIG_PTE_64BIT
572static inline unsigned long pte_update(pte_t *p, unsigned long clr,
573 unsigned long set)
574{
575 unsigned long old, tmp;
576
577 __asm__ __volatile__("\
5781: lwarx %0,0,%3\n\
579 andc %1,%0,%4\n\
580 or %1,%1,%5\n"
581 PPC405_ERR77(0,%3)
582" stwcx. %1,0,%3\n\
583 bne- 1b"
584 : "=&r" (old), "=&r" (tmp), "=m" (*p)
585 : "r" (p), "r" (clr), "r" (set), "m" (*p)
586 : "cc" );
587 return old;
588}
589#else
590static inline unsigned long long pte_update(pte_t *p, unsigned long clr,
591 unsigned long set)
592{
593 unsigned long long old;
594 unsigned long tmp;
595
596 __asm__ __volatile__("\
5971: lwarx %L0,0,%4\n\
598 lwzx %0,0,%3\n\
599 andc %1,%L0,%5\n\
600 or %1,%1,%6\n"
601 PPC405_ERR77(0,%3)
602" stwcx. %1,0,%4\n\
603 bne- 1b"
604 : "=&r" (old), "=&r" (tmp), "=m" (*p)
605 : "r" (p), "r" ((unsigned long)(p) + 4), "r" (clr), "r" (set), "m" (*p)
606 : "cc" );
607 return old;
608}
609#endif
610
611/*
612 * set_pte stores a linux PTE into the linux page table.
613 * On machines which use an MMU hash table we avoid changing the
614 * _PAGE_HASHPTE bit.
615 */
616static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
617 pte_t *ptep, pte_t pte)
618{
619#if _PAGE_HASHPTE != 0
620 pte_update(ptep, ~_PAGE_HASHPTE, pte_val(pte) & ~_PAGE_HASHPTE);
621#else
622 *ptep = pte;
623#endif
624}
625
626/*
627 * 2.6 calles this without flushing the TLB entry, this is wrong
628 * for our hash-based implementation, we fix that up here
629 */
630#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
631static inline int __ptep_test_and_clear_young(unsigned int context, unsigned long addr, pte_t *ptep)
632{
633 unsigned long old;
634 old = pte_update(ptep, _PAGE_ACCESSED, 0);
635#if _PAGE_HASHPTE != 0
636 if (old & _PAGE_HASHPTE) {
637 unsigned long ptephys = __pa(ptep) & PAGE_MASK;
638 flush_hash_pages(context, addr, ptephys, 1);
639 }
640#endif
641 return (old & _PAGE_ACCESSED) != 0;
642}
643#define ptep_test_and_clear_young(__vma, __addr, __ptep) \
644 __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep)
645
646#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
647static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma,
648 unsigned long addr, pte_t *ptep)
649{
650 return (pte_update(ptep, (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0;
651}
652
653#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
654static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
655 pte_t *ptep)
656{
657 return __pte(pte_update(ptep, ~_PAGE_HASHPTE, 0));
658}
659
660#define __HAVE_ARCH_PTEP_SET_WRPROTECT
661static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
662 pte_t *ptep)
663{
664 pte_update(ptep, (_PAGE_RW | _PAGE_HWWRITE), 0);
665}
666
667#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
668static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
669{
670 unsigned long bits = pte_val(entry) &
671 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW);
672 pte_update(ptep, 0, bits);
673}
674
675#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
676 do { \
677 __ptep_set_access_flags(__ptep, __entry, __dirty); \
678 flush_tlb_page_nohash(__vma, __address); \
679 } while(0)
680
681/*
682 * Macro to mark a page protection value as "uncacheable".
683 */
684#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED))
685
686struct file;
687extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
688 unsigned long size, pgprot_t vma_prot);
689#define __HAVE_PHYS_MEM_ACCESS_PROT
690
691#define __HAVE_ARCH_PTE_SAME
692#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HASHPTE) == 0)
693
694/*
695 * Note that on Book E processors, the pmd contains the kernel virtual
696 * (lowmem) address of the pte page. The physical address is less useful
697 * because everything runs with translation enabled (even the TLB miss
698 * handler). On everything else the pmd contains the physical address
699 * of the pte page. -- paulus
700 */
701#ifndef CONFIG_BOOKE
702#define pmd_page_vaddr(pmd) \
703 ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
704#define pmd_page(pmd) \
705 (mem_map + (pmd_val(pmd) >> PAGE_SHIFT))
706#else
707#define pmd_page_vaddr(pmd) \
708 ((unsigned long) (pmd_val(pmd) & PAGE_MASK))
709#define pmd_page(pmd) \
710 (mem_map + (__pa(pmd_val(pmd)) >> PAGE_SHIFT))
711#endif
712
713/* to find an entry in a kernel page-table-directory */
714#define pgd_offset_k(address) pgd_offset(&init_mm, address)
715
716/* to find an entry in a page-table-directory */
717#define pgd_index(address) ((address) >> PGDIR_SHIFT)
718#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
719
720/* Find an entry in the third-level page table.. */
721#define pte_index(address) \
722 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
723#define pte_offset_kernel(dir, addr) \
724 ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
725#define pte_offset_map(dir, addr) \
726 ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE0) + pte_index(addr))
727#define pte_offset_map_nested(dir, addr) \
728 ((pte_t *) kmap_atomic(pmd_page(*(dir)), KM_PTE1) + pte_index(addr))
729
730#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
731#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
732
733extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
734
735extern void paging_init(void);
736
737/*
738 * Encode and decode a swap entry.
739 * Note that the bits we use in a PTE for representing a swap entry
740 * must not include the _PAGE_PRESENT bit, the _PAGE_FILE bit, or the
741 *_PAGE_HASHPTE bit (if used). -- paulus
742 */
743#define __swp_type(entry) ((entry).val & 0x1f)
744#define __swp_offset(entry) ((entry).val >> 5)
745#define __swp_entry(type, offset) ((swp_entry_t) { (type) | ((offset) << 5) })
746#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 3 })
747#define __swp_entry_to_pte(x) ((pte_t) { (x).val << 3 })
748
749/* Encode and decode a nonlinear file mapping entry */
750#define PTE_FILE_MAX_BITS 29
751#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
752#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })
753
754/* CONFIG_APUS */
755/* For virtual address to physical address conversion */
756extern void cache_clear(__u32 addr, int length);
757extern void cache_push(__u32 addr, int length);
758extern int mm_end_of_chunk (unsigned long addr, int len);
759extern unsigned long iopa(unsigned long addr);
760extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
761
762/* Values for nocacheflag and cmode */
763/* These are not used by the APUS kernel_map, but prevents
764 compilation errors. */
765#define KERNELMAP_FULL_CACHING 0
766#define KERNELMAP_NOCACHE_SER 1
767#define KERNELMAP_NOCACHE_NONSER 2
768#define KERNELMAP_NO_COPYBACK 3
769
770/*
771 * Map some physical address range into the kernel address space.
772 */
773extern unsigned long kernel_map(unsigned long paddr, unsigned long size,
774 int nocacheflag, unsigned long *memavailp );
775
776/*
777 * Set cache mode of (kernel space) address range.
778 */
779extern void kernel_set_cachemode (unsigned long address, unsigned long size,
780 unsigned int cmode);
781
782/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
783#define kern_addr_valid(addr) (1)
784
785#ifdef CONFIG_PHYS_64BIT
786extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
787 unsigned long paddr, unsigned long size, pgprot_t prot);
788
789static inline int io_remap_pfn_range(struct vm_area_struct *vma,
790 unsigned long vaddr,
791 unsigned long pfn,
792 unsigned long size,
793 pgprot_t prot)
794{
795 phys_addr_t paddr64 = fixup_bigphys_addr(pfn << PAGE_SHIFT, size);
796 return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot);
797}
798#else
799#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
800 remap_pfn_range(vma, vaddr, pfn, size, prot)
801#endif
802
803/*
804 * No page table caches to initialise
805 */
806#define pgtable_cache_init() do { } while (0)
807
808extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep,
809 pmd_t **pmdp);
810
811#endif /* !__ASSEMBLY__ */
812
813#endif /* _ASM_POWERPC_PGTABLE_PPC32_H */
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h
new file mode 100644
index 000000000000..704c4e669fe0
--- /dev/null
+++ b/include/asm-powerpc/pgtable-ppc64.h
@@ -0,0 +1,492 @@
1#ifndef _ASM_POWERPC_PGTABLE_PPC64_H_
2#define _ASM_POWERPC_PGTABLE_PPC64_H_
3/*
4 * This file contains the functions and defines necessary to modify and use
5 * the ppc64 hashed page table.
6 */
7
8#ifndef __ASSEMBLY__
9#include <linux/stddef.h>
10#include <asm/processor.h> /* For TASK_SIZE */
11#include <asm/mmu.h>
12#include <asm/page.h>
13#include <asm/tlbflush.h>
14struct mm_struct;
15#endif /* __ASSEMBLY__ */
16
17#ifdef CONFIG_PPC_64K_PAGES
18#include <asm/pgtable-64k.h>
19#else
20#include <asm/pgtable-4k.h>
21#endif
22
23#define FIRST_USER_ADDRESS 0
24
25/*
26 * Size of EA range mapped by our pagetables.
27 */
28#define PGTABLE_EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
29 PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT)
30#define PGTABLE_RANGE (1UL << PGTABLE_EADDR_SIZE)
31
32#if TASK_SIZE_USER64 > PGTABLE_RANGE
33#error TASK_SIZE_USER64 exceeds pagetable range
34#endif
35
36#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT))
37#error TASK_SIZE_USER64 exceeds user VSID range
38#endif
39
40/*
41 * Define the address range of the vmalloc VM area.
42 */
43#define VMALLOC_START ASM_CONST(0xD000000000000000)
44#define VMALLOC_SIZE ASM_CONST(0x80000000000)
45#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE)
46
47/*
48 * Define the address range of the imalloc VM area.
49 */
50#define PHBS_IO_BASE VMALLOC_END
51#define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */
52#define IMALLOC_END (VMALLOC_START + PGTABLE_RANGE)
53
54/*
55 * Region IDs
56 */
57#define REGION_SHIFT 60UL
58#define REGION_MASK (0xfUL << REGION_SHIFT)
59#define REGION_ID(ea) (((unsigned long)(ea)) >> REGION_SHIFT)
60
61#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START))
62#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET))
63#define USER_REGION_ID (0UL)
64
65/*
66 * Common bits in a linux-style PTE. These match the bits in the
67 * (hardware-defined) PowerPC PTE as closely as possible. Additional
68 * bits may be defined in pgtable-*.h
69 */
70#define _PAGE_PRESENT 0x0001 /* software: pte contains a translation */
71#define _PAGE_USER 0x0002 /* matches one of the PP bits */
72#define _PAGE_FILE 0x0002 /* (!present only) software: pte holds file offset */
73#define _PAGE_EXEC 0x0004 /* No execute on POWER4 and newer (we invert) */
74#define _PAGE_GUARDED 0x0008
75#define _PAGE_COHERENT 0x0010 /* M: enforce memory coherence (SMP systems) */
76#define _PAGE_NO_CACHE 0x0020 /* I: cache inhibit */
77#define _PAGE_WRITETHRU 0x0040 /* W: cache write-through */
78#define _PAGE_DIRTY 0x0080 /* C: page changed */
79#define _PAGE_ACCESSED 0x0100 /* R: page referenced */
80#define _PAGE_RW 0x0200 /* software: user write access allowed */
81#define _PAGE_HASHPTE 0x0400 /* software: pte has an associated HPTE */
82#define _PAGE_BUSY 0x0800 /* software: PTE & hash are busy */
83
84#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT)
85
86#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY)
87
88/* __pgprot defined in asm-powerpc/page.h */
89#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
90
91#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER)
92#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER | _PAGE_EXEC)
93#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
94#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
95#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
96#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
97#define PAGE_KERNEL __pgprot(_PAGE_BASE | _PAGE_WRENABLE)
98#define PAGE_KERNEL_CI __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
99 _PAGE_WRENABLE | _PAGE_NO_CACHE | _PAGE_GUARDED)
100#define PAGE_KERNEL_EXEC __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_EXEC)
101
102#define PAGE_AGP __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE)
103#define HAVE_PAGE_AGP
104
105/* PTEIDX nibble */
106#define _PTEIDX_SECONDARY 0x8
107#define _PTEIDX_GROUP_IX 0x7
108
109
110/*
111 * POWER4 and newer have per page execute protection, older chips can only
112 * do this on a segment (256MB) basis.
113 *
114 * Also, write permissions imply read permissions.
115 * This is the closest we can get..
116 *
117 * Note due to the way vm flags are laid out, the bits are XWR
118 */
119#define __P000 PAGE_NONE
120#define __P001 PAGE_READONLY
121#define __P010 PAGE_COPY
122#define __P011 PAGE_COPY
123#define __P100 PAGE_READONLY_X
124#define __P101 PAGE_READONLY_X
125#define __P110 PAGE_COPY_X
126#define __P111 PAGE_COPY_X
127
128#define __S000 PAGE_NONE
129#define __S001 PAGE_READONLY
130#define __S010 PAGE_SHARED
131#define __S011 PAGE_SHARED
132#define __S100 PAGE_READONLY_X
133#define __S101 PAGE_READONLY_X
134#define __S110 PAGE_SHARED_X
135#define __S111 PAGE_SHARED_X
136
137#ifndef __ASSEMBLY__
138
139/*
140 * ZERO_PAGE is a global shared page that is always zero: used
141 * for zero-mapped memory areas etc..
142 */
143extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
144#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
145#endif /* __ASSEMBLY__ */
146
147#ifdef CONFIG_HUGETLB_PAGE
148
149#define HAVE_ARCH_UNMAPPED_AREA
150#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
151
152#endif
153
154#ifndef __ASSEMBLY__
155
156/*
157 * Conversion functions: convert a page and protection to a page entry,
158 * and a page entry and page directory to the page they refer to.
159 *
160 * mk_pte takes a (struct page *) as input
161 */
162#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
163
164static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
165{
166 pte_t pte;
167
168
169 pte_val(pte) = (pfn << PTE_RPN_SHIFT) | pgprot_val(pgprot);
170 return pte;
171}
172
173#define pte_modify(_pte, newprot) \
174 (__pte((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)))
175
176#define pte_none(pte) ((pte_val(pte) & ~_PAGE_HPTEFLAGS) == 0)
177#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
178
179/* pte_clear moved to later in this file */
180
181#define pte_pfn(x) ((unsigned long)((pte_val(x)>>PTE_RPN_SHIFT)))
182#define pte_page(x) pfn_to_page(pte_pfn(x))
183
184#define PMD_BAD_BITS (PTE_TABLE_SIZE-1)
185#define PUD_BAD_BITS (PMD_TABLE_SIZE-1)
186
187#define pmd_set(pmdp, pmdval) (pmd_val(*(pmdp)) = (pmdval))
188#define pmd_none(pmd) (!pmd_val(pmd))
189#define pmd_bad(pmd) (!is_kernel_addr(pmd_val(pmd)) \
190 || (pmd_val(pmd) & PMD_BAD_BITS))
191#define pmd_present(pmd) (pmd_val(pmd) != 0)
192#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0)
193#define pmd_page_vaddr(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS)
194#define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd))
195
196#define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval))
197#define pud_none(pud) (!pud_val(pud))
198#define pud_bad(pud) (!is_kernel_addr(pud_val(pud)) \
199 || (pud_val(pud) & PUD_BAD_BITS))
200#define pud_present(pud) (pud_val(pud) != 0)
201#define pud_clear(pudp) (pud_val(*(pudp)) = 0)
202#define pud_page_vaddr(pud) (pud_val(pud) & ~PUD_MASKED_BITS)
203#define pud_page(pud) virt_to_page(pud_page_vaddr(pud))
204
205#define pgd_set(pgdp, pudp) ({pgd_val(*(pgdp)) = (unsigned long)(pudp);})
206
207/*
208 * Find an entry in a page-table-directory. We combine the address region
209 * (the high order N bits) and the pgd portion of the address.
210 */
211/* to avoid overflow in free_pgtables we don't use PTRS_PER_PGD here */
212#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & 0x1ff)
213
214#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
215
216#define pmd_offset(pudp,addr) \
217 (((pmd_t *) pud_page_vaddr(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
218
219#define pte_offset_kernel(dir,addr) \
220 (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
221
222#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
223#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr))
224#define pte_unmap(pte) do { } while(0)
225#define pte_unmap_nested(pte) do { } while(0)
226
227/* to find an entry in a kernel page-table-directory */
228/* This now only contains the vmalloc pages */
229#define pgd_offset_k(address) pgd_offset(&init_mm, address)
230
231/*
232 * The following only work if pte_present() is true.
233 * Undefined behaviour if not..
234 */
235static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER;}
236static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;}
237static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC;}
238static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;}
239static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;}
240static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;}
241
242static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
243static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
244
245static inline pte_t pte_rdprotect(pte_t pte) {
246 pte_val(pte) &= ~_PAGE_USER; return pte; }
247static inline pte_t pte_exprotect(pte_t pte) {
248 pte_val(pte) &= ~_PAGE_EXEC; return pte; }
249static inline pte_t pte_wrprotect(pte_t pte) {
250 pte_val(pte) &= ~(_PAGE_RW); return pte; }
251static inline pte_t pte_mkclean(pte_t pte) {
252 pte_val(pte) &= ~(_PAGE_DIRTY); return pte; }
253static inline pte_t pte_mkold(pte_t pte) {
254 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
255static inline pte_t pte_mkread(pte_t pte) {
256 pte_val(pte) |= _PAGE_USER; return pte; }
257static inline pte_t pte_mkexec(pte_t pte) {
258 pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
259static inline pte_t pte_mkwrite(pte_t pte) {
260 pte_val(pte) |= _PAGE_RW; return pte; }
261static inline pte_t pte_mkdirty(pte_t pte) {
262 pte_val(pte) |= _PAGE_DIRTY; return pte; }
263static inline pte_t pte_mkyoung(pte_t pte) {
264 pte_val(pte) |= _PAGE_ACCESSED; return pte; }
265static inline pte_t pte_mkhuge(pte_t pte) {
266 return pte; }
267
268/* Atomic PTE updates */
269static inline unsigned long pte_update(struct mm_struct *mm,
270 unsigned long addr,
271 pte_t *ptep, unsigned long clr,
272 int huge)
273{
274 unsigned long old, tmp;
275
276 __asm__ __volatile__(
277 "1: ldarx %0,0,%3 # pte_update\n\
278 andi. %1,%0,%6\n\
279 bne- 1b \n\
280 andc %1,%0,%4 \n\
281 stdcx. %1,0,%3 \n\
282 bne- 1b"
283 : "=&r" (old), "=&r" (tmp), "=m" (*ptep)
284 : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY)
285 : "cc" );
286
287 if (old & _PAGE_HASHPTE)
288 hpte_need_flush(mm, addr, ptep, old, huge);
289 return old;
290}
291
292static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
293 unsigned long addr, pte_t *ptep)
294{
295 unsigned long old;
296
297 if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0)
298 return 0;
299 old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0);
300 return (old & _PAGE_ACCESSED) != 0;
301}
302#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
303#define ptep_test_and_clear_young(__vma, __addr, __ptep) \
304({ \
305 int __r; \
306 __r = __ptep_test_and_clear_young((__vma)->vm_mm, __addr, __ptep); \
307 __r; \
308})
309
310/*
311 * On RW/DIRTY bit transitions we can avoid flushing the hpte. For the
312 * moment we always flush but we need to fix hpte_update and test if the
313 * optimisation is worth it.
314 */
315static inline int __ptep_test_and_clear_dirty(struct mm_struct *mm,
316 unsigned long addr, pte_t *ptep)
317{
318 unsigned long old;
319
320 if ((pte_val(*ptep) & _PAGE_DIRTY) == 0)
321 return 0;
322 old = pte_update(mm, addr, ptep, _PAGE_DIRTY, 0);
323 return (old & _PAGE_DIRTY) != 0;
324}
325#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
326#define ptep_test_and_clear_dirty(__vma, __addr, __ptep) \
327({ \
328 int __r; \
329 __r = __ptep_test_and_clear_dirty((__vma)->vm_mm, __addr, __ptep); \
330 __r; \
331})
332
333#define __HAVE_ARCH_PTEP_SET_WRPROTECT
334static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
335 pte_t *ptep)
336{
337 unsigned long old;
338
339 if ((pte_val(*ptep) & _PAGE_RW) == 0)
340 return;
341 old = pte_update(mm, addr, ptep, _PAGE_RW, 0);
342}
343
344/*
345 * We currently remove entries from the hashtable regardless of whether
346 * the entry was young or dirty. The generic routines only flush if the
347 * entry was young or dirty which is not good enough.
348 *
349 * We should be more intelligent about this but for the moment we override
350 * these functions and force a tlb flush unconditionally
351 */
352#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
353#define ptep_clear_flush_young(__vma, __address, __ptep) \
354({ \
355 int __young = __ptep_test_and_clear_young((__vma)->vm_mm, __address, \
356 __ptep); \
357 __young; \
358})
359
360#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
361#define ptep_clear_flush_dirty(__vma, __address, __ptep) \
362({ \
363 int __dirty = __ptep_test_and_clear_dirty((__vma)->vm_mm, __address, \
364 __ptep); \
365 __dirty; \
366})
367
368#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
369static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
370 unsigned long addr, pte_t *ptep)
371{
372 unsigned long old = pte_update(mm, addr, ptep, ~0UL, 0);
373 return __pte(old);
374}
375
376static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
377 pte_t * ptep)
378{
379 pte_update(mm, addr, ptep, ~0UL, 0);
380}
381
382/*
383 * set_pte stores a linux PTE into the linux page table.
384 */
385static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
386 pte_t *ptep, pte_t pte)
387{
388 if (pte_present(*ptep))
389 pte_clear(mm, addr, ptep);
390 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
391 *ptep = pte;
392}
393
394/* Set the dirty and/or accessed bits atomically in a linux PTE, this
395 * function doesn't need to flush the hash entry
396 */
397#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
398static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
399{
400 unsigned long bits = pte_val(entry) &
401 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
402 unsigned long old, tmp;
403
404 __asm__ __volatile__(
405 "1: ldarx %0,0,%4\n\
406 andi. %1,%0,%6\n\
407 bne- 1b \n\
408 or %0,%3,%0\n\
409 stdcx. %0,0,%4\n\
410 bne- 1b"
411 :"=&r" (old), "=&r" (tmp), "=m" (*ptep)
412 :"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY)
413 :"cc");
414}
415#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
416 do { \
417 __ptep_set_access_flags(__ptep, __entry, __dirty); \
418 flush_tlb_page_nohash(__vma, __address); \
419 } while(0)
420
421/*
422 * Macro to mark a page protection value as "uncacheable".
423 */
424#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED))
425
426struct file;
427extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
428 unsigned long size, pgprot_t vma_prot);
429#define __HAVE_PHYS_MEM_ACCESS_PROT
430
431#define __HAVE_ARCH_PTE_SAME
432#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0)
433
434#define pte_ERROR(e) \
435 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
436#define pmd_ERROR(e) \
437 printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
438#define pgd_ERROR(e) \
439 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
440
441extern pgd_t swapper_pg_dir[];
442
443extern void paging_init(void);
444
445/* Encode and de-code a swap entry */
446#define __swp_type(entry) (((entry).val >> 1) & 0x3f)
447#define __swp_offset(entry) ((entry).val >> 8)
448#define __swp_entry(type, offset) ((swp_entry_t){((type)<< 1)|((offset)<<8)})
449#define __pte_to_swp_entry(pte) ((swp_entry_t){pte_val(pte) >> PTE_RPN_SHIFT})
450#define __swp_entry_to_pte(x) ((pte_t) { (x).val << PTE_RPN_SHIFT })
451#define pte_to_pgoff(pte) (pte_val(pte) >> PTE_RPN_SHIFT)
452#define pgoff_to_pte(off) ((pte_t) {((off) << PTE_RPN_SHIFT)|_PAGE_FILE})
453#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_RPN_SHIFT)
454
455/*
456 * kern_addr_valid is intended to indicate whether an address is a valid
457 * kernel address. Most 32-bit archs define it as always true (like this)
458 * but most 64-bit archs actually perform a test. What should we do here?
459 * The only use is in fs/ncpfs/dir.c
460 */
461#define kern_addr_valid(addr) (1)
462
463#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
464 remap_pfn_range(vma, vaddr, pfn, size, prot)
465
466void pgtable_cache_init(void);
467
468/*
469 * find_linux_pte returns the address of a linux pte for a given
470 * effective address and directory. If not found, it returns zero.
471 */static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
472{
473 pgd_t *pg;
474 pud_t *pu;
475 pmd_t *pm;
476 pte_t *pt = NULL;
477
478 pg = pgdir + pgd_index(ea);
479 if (!pgd_none(*pg)) {
480 pu = pud_offset(pg, ea);
481 if (!pud_none(*pu)) {
482 pm = pmd_offset(pu, ea);
483 if (pmd_present(*pm))
484 pt = pte_offset_kernel(pm, ea);
485 }
486 }
487 return pt;
488}
489
490#endif /* __ASSEMBLY__ */
491
492#endif /* _ASM_POWERPC_PGTABLE_PPC64_H_ */
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h
index 19edb6982b81..78bf4ae712a6 100644
--- a/include/asm-powerpc/pgtable.h
+++ b/include/asm-powerpc/pgtable.h
@@ -2,502 +2,15 @@
2#define _ASM_POWERPC_PGTABLE_H 2#define _ASM_POWERPC_PGTABLE_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#ifndef CONFIG_PPC64 5#if defined(CONFIG_PPC64)
6#include <asm-ppc/pgtable.h> 6# include <asm/pgtable-ppc64.h>
7#else 7#else
8 8# include <asm/pgtable-ppc32.h>
9/*
10 * This file contains the functions and defines necessary to modify and use
11 * the ppc64 hashed page table.
12 */
13
14#ifndef __ASSEMBLY__
15#include <linux/stddef.h>
16#include <asm/processor.h> /* For TASK_SIZE */
17#include <asm/mmu.h>
18#include <asm/page.h>
19#include <asm/tlbflush.h>
20struct mm_struct;
21#endif /* __ASSEMBLY__ */
22
23#ifdef CONFIG_PPC_64K_PAGES
24#include <asm/pgtable-64k.h>
25#else
26#include <asm/pgtable-4k.h>
27#endif
28
29#define FIRST_USER_ADDRESS 0
30
31/*
32 * Size of EA range mapped by our pagetables.
33 */
34#define PGTABLE_EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
35 PUD_INDEX_SIZE + PGD_INDEX_SIZE + PAGE_SHIFT)
36#define PGTABLE_RANGE (1UL << PGTABLE_EADDR_SIZE)
37
38#if TASK_SIZE_USER64 > PGTABLE_RANGE
39#error TASK_SIZE_USER64 exceeds pagetable range
40#endif
41
42#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT))
43#error TASK_SIZE_USER64 exceeds user VSID range
44#endif 9#endif
45 10
46/*
47 * Define the address range of the vmalloc VM area.
48 */
49#define VMALLOC_START ASM_CONST(0xD000000000000000)
50#define VMALLOC_SIZE ASM_CONST(0x80000000000)
51#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE)
52
53/*
54 * Define the address range of the imalloc VM area.
55 */
56#define PHBS_IO_BASE VMALLOC_END
57#define IMALLOC_BASE (PHBS_IO_BASE + 0x80000000ul) /* Reserve 2 gigs for PHBs */
58#define IMALLOC_END (VMALLOC_START + PGTABLE_RANGE)
59
60/*
61 * Region IDs
62 */
63#define REGION_SHIFT 60UL
64#define REGION_MASK (0xfUL << REGION_SHIFT)
65#define REGION_ID(ea) (((unsigned long)(ea)) >> REGION_SHIFT)
66
67#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START))
68#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET))
69#define USER_REGION_ID (0UL)
70
71/*
72 * Common bits in a linux-style PTE. These match the bits in the
73 * (hardware-defined) PowerPC PTE as closely as possible. Additional
74 * bits may be defined in pgtable-*.h
75 */
76#define _PAGE_PRESENT 0x0001 /* software: pte contains a translation */
77#define _PAGE_USER 0x0002 /* matches one of the PP bits */
78#define _PAGE_FILE 0x0002 /* (!present only) software: pte holds file offset */
79#define _PAGE_EXEC 0x0004 /* No execute on POWER4 and newer (we invert) */
80#define _PAGE_GUARDED 0x0008
81#define _PAGE_COHERENT 0x0010 /* M: enforce memory coherence (SMP systems) */
82#define _PAGE_NO_CACHE 0x0020 /* I: cache inhibit */
83#define _PAGE_WRITETHRU 0x0040 /* W: cache write-through */
84#define _PAGE_DIRTY 0x0080 /* C: page changed */
85#define _PAGE_ACCESSED 0x0100 /* R: page referenced */
86#define _PAGE_RW 0x0200 /* software: user write access allowed */
87#define _PAGE_HASHPTE 0x0400 /* software: pte has an associated HPTE */
88#define _PAGE_BUSY 0x0800 /* software: PTE & hash are busy */
89
90#define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT)
91
92#define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY)
93
94/* __pgprot defined in asm-powerpc/page.h */
95#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
96
97#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER)
98#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER | _PAGE_EXEC)
99#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
100#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
101#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
102#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
103#define PAGE_KERNEL __pgprot(_PAGE_BASE | _PAGE_WRENABLE)
104#define PAGE_KERNEL_CI __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
105 _PAGE_WRENABLE | _PAGE_NO_CACHE | _PAGE_GUARDED)
106#define PAGE_KERNEL_EXEC __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_EXEC)
107
108#define PAGE_AGP __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE)
109#define HAVE_PAGE_AGP
110
111/* PTEIDX nibble */
112#define _PTEIDX_SECONDARY 0x8
113#define _PTEIDX_GROUP_IX 0x7
114
115
116/*
117 * POWER4 and newer have per page execute protection, older chips can only
118 * do this on a segment (256MB) basis.
119 *
120 * Also, write permissions imply read permissions.
121 * This is the closest we can get..
122 *
123 * Note due to the way vm flags are laid out, the bits are XWR
124 */
125#define __P000 PAGE_NONE
126#define __P001 PAGE_READONLY
127#define __P010 PAGE_COPY
128#define __P011 PAGE_COPY
129#define __P100 PAGE_READONLY_X
130#define __P101 PAGE_READONLY_X
131#define __P110 PAGE_COPY_X
132#define __P111 PAGE_COPY_X
133
134#define __S000 PAGE_NONE
135#define __S001 PAGE_READONLY
136#define __S010 PAGE_SHARED
137#define __S011 PAGE_SHARED
138#define __S100 PAGE_READONLY_X
139#define __S101 PAGE_READONLY_X
140#define __S110 PAGE_SHARED_X
141#define __S111 PAGE_SHARED_X
142
143#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
144
145/*
146 * ZERO_PAGE is a global shared page that is always zero: used
147 * for zero-mapped memory areas etc..
148 */
149extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
150#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
151#endif /* __ASSEMBLY__ */
152
153#ifdef CONFIG_HUGETLB_PAGE
154
155#define HAVE_ARCH_UNMAPPED_AREA
156#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
157
158#endif
159
160#ifndef __ASSEMBLY__
161
162/*
163 * Conversion functions: convert a page and protection to a page entry,
164 * and a page entry and page directory to the page they refer to.
165 *
166 * mk_pte takes a (struct page *) as input
167 */
168#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
169
170static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
171{
172 pte_t pte;
173
174
175 pte_val(pte) = (pfn << PTE_RPN_SHIFT) | pgprot_val(pgprot);
176 return pte;
177}
178
179#define pte_modify(_pte, newprot) \
180 (__pte((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)))
181
182#define pte_none(pte) ((pte_val(pte) & ~_PAGE_HPTEFLAGS) == 0)
183#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
184
185/* pte_clear moved to later in this file */
186
187#define pte_pfn(x) ((unsigned long)((pte_val(x)>>PTE_RPN_SHIFT)))
188#define pte_page(x) pfn_to_page(pte_pfn(x))
189
190#define PMD_BAD_BITS (PTE_TABLE_SIZE-1)
191#define PUD_BAD_BITS (PMD_TABLE_SIZE-1)
192
193#define pmd_set(pmdp, pmdval) (pmd_val(*(pmdp)) = (pmdval))
194#define pmd_none(pmd) (!pmd_val(pmd))
195#define pmd_bad(pmd) (!is_kernel_addr(pmd_val(pmd)) \
196 || (pmd_val(pmd) & PMD_BAD_BITS))
197#define pmd_present(pmd) (pmd_val(pmd) != 0)
198#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0)
199#define pmd_page_vaddr(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS)
200#define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd))
201
202#define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval))
203#define pud_none(pud) (!pud_val(pud))
204#define pud_bad(pud) (!is_kernel_addr(pud_val(pud)) \
205 || (pud_val(pud) & PUD_BAD_BITS))
206#define pud_present(pud) (pud_val(pud) != 0)
207#define pud_clear(pudp) (pud_val(*(pudp)) = 0)
208#define pud_page_vaddr(pud) (pud_val(pud) & ~PUD_MASKED_BITS)
209#define pud_page(pud) virt_to_page(pud_page_vaddr(pud))
210
211#define pgd_set(pgdp, pudp) ({pgd_val(*(pgdp)) = (unsigned long)(pudp);})
212
213/*
214 * Find an entry in a page-table-directory. We combine the address region
215 * (the high order N bits) and the pgd portion of the address.
216 */
217/* to avoid overflow in free_pgtables we don't use PTRS_PER_PGD here */
218#define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & 0x1ff)
219
220#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
221
222#define pmd_offset(pudp,addr) \
223 (((pmd_t *) pud_page_vaddr(*(pudp))) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
224
225#define pte_offset_kernel(dir,addr) \
226 (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
227
228#define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
229#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr))
230#define pte_unmap(pte) do { } while(0)
231#define pte_unmap_nested(pte) do { } while(0)
232
233/* to find an entry in a kernel page-table-directory */
234/* This now only contains the vmalloc pages */
235#define pgd_offset_k(address) pgd_offset(&init_mm, address)
236
237/*
238 * The following only work if pte_present() is true.
239 * Undefined behaviour if not..
240 */
241static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER;}
242static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;}
243static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC;}
244static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;}
245static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;}
246static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;}
247
248static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; }
249static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; }
250
251static inline pte_t pte_rdprotect(pte_t pte) {
252 pte_val(pte) &= ~_PAGE_USER; return pte; }
253static inline pte_t pte_exprotect(pte_t pte) {
254 pte_val(pte) &= ~_PAGE_EXEC; return pte; }
255static inline pte_t pte_wrprotect(pte_t pte) {
256 pte_val(pte) &= ~(_PAGE_RW); return pte; }
257static inline pte_t pte_mkclean(pte_t pte) {
258 pte_val(pte) &= ~(_PAGE_DIRTY); return pte; }
259static inline pte_t pte_mkold(pte_t pte) {
260 pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
261static inline pte_t pte_mkread(pte_t pte) {
262 pte_val(pte) |= _PAGE_USER; return pte; }
263static inline pte_t pte_mkexec(pte_t pte) {
264 pte_val(pte) |= _PAGE_USER | _PAGE_EXEC; return pte; }
265static inline pte_t pte_mkwrite(pte_t pte) {
266 pte_val(pte) |= _PAGE_RW; return pte; }
267static inline pte_t pte_mkdirty(pte_t pte) {
268 pte_val(pte) |= _PAGE_DIRTY; return pte; }
269static inline pte_t pte_mkyoung(pte_t pte) {
270 pte_val(pte) |= _PAGE_ACCESSED; return pte; }
271static inline pte_t pte_mkhuge(pte_t pte) {
272 return pte; }
273
274/* Atomic PTE updates */
275static inline unsigned long pte_update(struct mm_struct *mm,
276 unsigned long addr,
277 pte_t *ptep, unsigned long clr,
278 int huge)
279{
280 unsigned long old, tmp;
281
282 __asm__ __volatile__(
283 "1: ldarx %0,0,%3 # pte_update\n\
284 andi. %1,%0,%6\n\
285 bne- 1b \n\
286 andc %1,%0,%4 \n\
287 stdcx. %1,0,%3 \n\
288 bne- 1b"
289 : "=&r" (old), "=&r" (tmp), "=m" (*ptep)
290 : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY)
291 : "cc" );
292
293 if (old & _PAGE_HASHPTE)
294 hpte_need_flush(mm, addr, ptep, old, huge);
295 return old;
296}
297
298static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
299 unsigned long addr, pte_t *ptep)
300{
301 unsigned long old;
302
303 if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0)
304 return 0;
305 old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0);
306 return (old & _PAGE_ACCESSED) != 0;
307}
308#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
309#define ptep_test_and_clear_young(__vma, __addr, __ptep) \
310({ \
311 int __r; \
312 __r = __ptep_test_and_clear_young((__vma)->vm_mm, __addr, __ptep); \
313 __r; \
314})
315
316/*
317 * On RW/DIRTY bit transitions we can avoid flushing the hpte. For the
318 * moment we always flush but we need to fix hpte_update and test if the
319 * optimisation is worth it.
320 */
321static inline int __ptep_test_and_clear_dirty(struct mm_struct *mm,
322 unsigned long addr, pte_t *ptep)
323{
324 unsigned long old;
325
326 if ((pte_val(*ptep) & _PAGE_DIRTY) == 0)
327 return 0;
328 old = pte_update(mm, addr, ptep, _PAGE_DIRTY, 0);
329 return (old & _PAGE_DIRTY) != 0;
330}
331#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
332#define ptep_test_and_clear_dirty(__vma, __addr, __ptep) \
333({ \
334 int __r; \
335 __r = __ptep_test_and_clear_dirty((__vma)->vm_mm, __addr, __ptep); \
336 __r; \
337})
338
339#define __HAVE_ARCH_PTEP_SET_WRPROTECT
340static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
341 pte_t *ptep)
342{
343 unsigned long old;
344
345 if ((pte_val(*ptep) & _PAGE_RW) == 0)
346 return;
347 old = pte_update(mm, addr, ptep, _PAGE_RW, 0);
348}
349
350/*
351 * We currently remove entries from the hashtable regardless of whether
352 * the entry was young or dirty. The generic routines only flush if the
353 * entry was young or dirty which is not good enough.
354 *
355 * We should be more intelligent about this but for the moment we override
356 * these functions and force a tlb flush unconditionally
357 */
358#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
359#define ptep_clear_flush_young(__vma, __address, __ptep) \
360({ \
361 int __young = __ptep_test_and_clear_young((__vma)->vm_mm, __address, \
362 __ptep); \
363 __young; \
364})
365
366#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
367#define ptep_clear_flush_dirty(__vma, __address, __ptep) \
368({ \
369 int __dirty = __ptep_test_and_clear_dirty((__vma)->vm_mm, __address, \
370 __ptep); \
371 __dirty; \
372})
373
374#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
375static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
376 unsigned long addr, pte_t *ptep)
377{
378 unsigned long old = pte_update(mm, addr, ptep, ~0UL, 0);
379 return __pte(old);
380}
381
382static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
383 pte_t * ptep)
384{
385 pte_update(mm, addr, ptep, ~0UL, 0);
386}
387
388/*
389 * set_pte stores a linux PTE into the linux page table.
390 */
391static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
392 pte_t *ptep, pte_t pte)
393{
394 if (pte_present(*ptep))
395 pte_clear(mm, addr, ptep);
396 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
397 *ptep = pte;
398}
399
400/* Set the dirty and/or accessed bits atomically in a linux PTE, this
401 * function doesn't need to flush the hash entry
402 */
403#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
404static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
405{
406 unsigned long bits = pte_val(entry) &
407 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
408 unsigned long old, tmp;
409
410 __asm__ __volatile__(
411 "1: ldarx %0,0,%4\n\
412 andi. %1,%0,%6\n\
413 bne- 1b \n\
414 or %0,%3,%0\n\
415 stdcx. %0,0,%4\n\
416 bne- 1b"
417 :"=&r" (old), "=&r" (tmp), "=m" (*ptep)
418 :"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY)
419 :"cc");
420}
421#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
422 do { \
423 __ptep_set_access_flags(__ptep, __entry, __dirty); \
424 flush_tlb_page_nohash(__vma, __address); \
425 } while(0)
426
427/*
428 * Macro to mark a page protection value as "uncacheable".
429 */
430#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED))
431
432struct file;
433extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
434 unsigned long size, pgprot_t vma_prot);
435#define __HAVE_PHYS_MEM_ACCESS_PROT
436
437#define __HAVE_ARCH_PTE_SAME
438#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0)
439
440#define pte_ERROR(e) \
441 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
442#define pmd_ERROR(e) \
443 printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e))
444#define pgd_ERROR(e) \
445 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
446
447extern pgd_t swapper_pg_dir[];
448
449extern void paging_init(void);
450
451/* Encode and de-code a swap entry */
452#define __swp_type(entry) (((entry).val >> 1) & 0x3f)
453#define __swp_offset(entry) ((entry).val >> 8)
454#define __swp_entry(type, offset) ((swp_entry_t){((type)<< 1)|((offset)<<8)})
455#define __pte_to_swp_entry(pte) ((swp_entry_t){pte_val(pte) >> PTE_RPN_SHIFT})
456#define __swp_entry_to_pte(x) ((pte_t) { (x).val << PTE_RPN_SHIFT })
457#define pte_to_pgoff(pte) (pte_val(pte) >> PTE_RPN_SHIFT)
458#define pgoff_to_pte(off) ((pte_t) {((off) << PTE_RPN_SHIFT)|_PAGE_FILE})
459#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_RPN_SHIFT)
460
461/*
462 * kern_addr_valid is intended to indicate whether an address is a valid
463 * kernel address. Most 32-bit archs define it as always true (like this)
464 * but most 64-bit archs actually perform a test. What should we do here?
465 * The only use is in fs/ncpfs/dir.c
466 */
467#define kern_addr_valid(addr) (1)
468
469#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
470 remap_pfn_range(vma, vaddr, pfn, size, prot)
471
472void pgtable_cache_init(void);
473
474/*
475 * find_linux_pte returns the address of a linux pte for a given
476 * effective address and directory. If not found, it returns zero.
477 */static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea)
478{
479 pgd_t *pg;
480 pud_t *pu;
481 pmd_t *pm;
482 pte_t *pt = NULL;
483
484 pg = pgdir + pgd_index(ea);
485 if (!pgd_none(*pg)) {
486 pu = pud_offset(pg, ea);
487 if (!pud_none(*pu)) {
488 pm = pmd_offset(pu, ea);
489 if (pmd_present(*pm))
490 pt = pte_offset_kernel(pm, ea);
491 }
492 }
493 return pt;
494}
495
496
497#include <asm-generic/pgtable.h> 12#include <asm-generic/pgtable.h>
498
499#endif /* __ASSEMBLY__ */ 13#endif /* __ASSEMBLY__ */
500 14
501#endif /* CONFIG_PPC64 */
502#endif /* __KERNEL__ */ 15#endif /* __KERNEL__ */
503#endif /* _ASM_POWERPC_PGTABLE_H */ 16#endif /* _ASM_POWERPC_PGTABLE_H */
diff --git a/include/asm-powerpc/pmac_feature.h b/include/asm-powerpc/pmac_feature.h
index d3599cc9aa74..d43d91beba9b 100644
--- a/include/asm-powerpc/pmac_feature.h
+++ b/include/asm-powerpc/pmac_feature.h
@@ -146,7 +146,7 @@ struct device_node;
146static inline long pmac_call_feature(int selector, struct device_node* node, 146static inline long pmac_call_feature(int selector, struct device_node* node,
147 long param, long value) 147 long param, long value)
148{ 148{
149 if (!ppc_md.feature_call) 149 if (!ppc_md.feature_call || !machine_is(powermac))
150 return -ENODEV; 150 return -ENODEV;
151 return ppc_md.feature_call(selector, node, param, value); 151 return ppc_md.feature_call(selector, node, param, value);
152} 152}
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index ec400f608e16..6845af93ba91 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -20,7 +20,6 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/atomic.h> 22#include <asm/atomic.h>
23#include <asm/io.h>
24 23
25/* Definitions used by the flattened device tree */ 24/* Definitions used by the flattened device tree */
26#define OF_DT_HEADER 0xd00dfeed /* marker */ 25#define OF_DT_HEADER 0xd00dfeed /* marker */
@@ -334,30 +333,17 @@ extern int of_irq_map_one(struct device_node *device, int index,
334struct pci_dev; 333struct pci_dev;
335extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 334extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
336 335
337static inline int of_irq_to_resource(struct device_node *dev, int index, struct resource *r) 336extern int of_irq_to_resource(struct device_node *dev, int index,
338{ 337 struct resource *r);
339 int irq = irq_of_parse_and_map(dev, index);
340
341 /* Only dereference the resource if both the
342 * resource and the irq are valid. */
343 if (r && irq != NO_IRQ) {
344 r->start = r->end = irq;
345 r->flags = IORESOURCE_IRQ;
346 }
347
348 return irq;
349}
350
351static inline void __iomem *of_iomap(struct device_node *np, int index)
352{
353 struct resource res;
354
355 if (of_address_to_resource(np, index, &res))
356 return NULL;
357
358 return ioremap(res.start, 1 + res.end - res.start);
359}
360 338
339/**
340 * of_iomap - Maps the memory mapped IO for a given device_node
341 * @device: the device whose io range will be mapped
342 * @index: index of the io range
343 *
344 * Returns a pointer to the mapped memory
345 */
346extern void __iomem *of_iomap(struct device_node *device, int index);
361 347
362#endif /* __KERNEL__ */ 348#endif /* __KERNEL__ */
363#endif /* _POWERPC_PROM_H */ 349#endif /* _POWERPC_PROM_H */
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 821581a8b643..13c372df99e8 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -167,26 +167,31 @@ enum ps3_cpu_binding {
167 PS3_BINDING_CPU_1 = 1, 167 PS3_BINDING_CPU_1 = 1,
168}; 168};
169 169
170int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id, 170int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
171 unsigned int *virq); 171 unsigned int *virq);
172int ps3_free_io_irq(unsigned int virq); 172int ps3_virq_destroy(unsigned int virq);
173int ps3_alloc_event_irq(enum ps3_cpu_binding cpu, unsigned int *virq); 173int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
174int ps3_free_event_irq(unsigned int virq); 174 unsigned int *virq);
175int ps3_irq_plug_destroy(unsigned int virq);
176int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq);
177int ps3_event_receive_port_destroy(unsigned int virq);
175int ps3_send_event_locally(unsigned int virq); 178int ps3_send_event_locally(unsigned int virq);
176int ps3_connect_event_irq(enum ps3_cpu_binding cpu, 179
177 const struct ps3_device_id *did, unsigned int interrupt_id, 180int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
178 unsigned int *virq); 181 unsigned int *virq);
179int ps3_disconnect_event_irq(const struct ps3_device_id *did, 182int ps3_io_irq_destroy(unsigned int virq);
180 unsigned int interrupt_id, unsigned int virq); 183int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
181int ps3_alloc_vuart_irq(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
182 unsigned int *virq); 184 unsigned int *virq);
183int ps3_free_vuart_irq(unsigned int virq); 185int ps3_vuart_irq_destroy(unsigned int virq);
184int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id, 186int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
185 unsigned int class, unsigned int *virq); 187 unsigned int class, unsigned int *virq);
186int ps3_free_spe_irq(unsigned int virq); 188int ps3_spe_irq_destroy(unsigned int virq);
187int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet, 189
190int ps3_sb_event_receive_port_setup(enum ps3_cpu_binding cpu,
191 const struct ps3_device_id *did, unsigned int interrupt_id,
188 unsigned int *virq); 192 unsigned int *virq);
189int ps3_free_irq(unsigned int virq); 193int ps3_sb_event_receive_port_destroy(const struct ps3_device_id *did,
194 unsigned int interrupt_id, unsigned int virq);
190 195
191/* lv1 result codes */ 196/* lv1 result codes */
192 197
diff --git a/include/asm-powerpc/suspend.h b/include/asm-powerpc/suspend.h
new file mode 100644
index 000000000000..cbf2c9404c37
--- /dev/null
+++ b/include/asm-powerpc/suspend.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_POWERPC_SUSPEND_H
2#define __ASM_POWERPC_SUSPEND_H
3
4static inline int arch_prepare_suspend(void) { return 0; }
5
6void save_processor_state(void);
7void restore_processor_state(void);
8
9#endif /* __ASM_POWERPC_SUSPEND_H */
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index d3e0906ff2bc..09621f611dbc 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -7,7 +7,6 @@
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8 8
9#include <asm/hw_irq.h> 9#include <asm/hw_irq.h>
10#include <asm/atomic.h>
11 10
12/* 11/*
13 * Memory barrier. 12 * Memory barrier.
@@ -227,6 +226,29 @@ __xchg_u32(volatile void *p, unsigned long val)
227 return prev; 226 return prev;
228} 227}
229 228
229/*
230 * Atomic exchange
231 *
232 * Changes the memory location '*ptr' to be val and returns
233 * the previous value stored there.
234 */
235static __inline__ unsigned long
236__xchg_u32_local(volatile void *p, unsigned long val)
237{
238 unsigned long prev;
239
240 __asm__ __volatile__(
241"1: lwarx %0,0,%2 \n"
242 PPC405_ERR77(0,%2)
243" stwcx. %3,0,%2 \n\
244 bne- 1b"
245 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
246 : "r" (p), "r" (val)
247 : "cc", "memory");
248
249 return prev;
250}
251
230#ifdef CONFIG_PPC64 252#ifdef CONFIG_PPC64
231static __inline__ unsigned long 253static __inline__ unsigned long
232__xchg_u64(volatile void *p, unsigned long val) 254__xchg_u64(volatile void *p, unsigned long val)
@@ -246,6 +268,23 @@ __xchg_u64(volatile void *p, unsigned long val)
246 268
247 return prev; 269 return prev;
248} 270}
271
272static __inline__ unsigned long
273__xchg_u64_local(volatile void *p, unsigned long val)
274{
275 unsigned long prev;
276
277 __asm__ __volatile__(
278"1: ldarx %0,0,%2 \n"
279 PPC405_ERR77(0,%2)
280" stdcx. %3,0,%2 \n\
281 bne- 1b"
282 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
283 : "r" (p), "r" (val)
284 : "cc", "memory");
285
286 return prev;
287}
249#endif 288#endif
250 289
251/* 290/*
@@ -269,13 +308,32 @@ __xchg(volatile void *ptr, unsigned long x, unsigned int size)
269 return x; 308 return x;
270} 309}
271 310
311static __inline__ unsigned long
312__xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
313{
314 switch (size) {
315 case 4:
316 return __xchg_u32_local(ptr, x);
317#ifdef CONFIG_PPC64
318 case 8:
319 return __xchg_u64_local(ptr, x);
320#endif
321 }
322 __xchg_called_with_bad_pointer();
323 return x;
324}
272#define xchg(ptr,x) \ 325#define xchg(ptr,x) \
273 ({ \ 326 ({ \
274 __typeof__(*(ptr)) _x_ = (x); \ 327 __typeof__(*(ptr)) _x_ = (x); \
275 (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \ 328 (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \
276 }) 329 })
277 330
278#define tas(ptr) (xchg((ptr),1)) 331#define xchg_local(ptr,x) \
332 ({ \
333 __typeof__(*(ptr)) _x_ = (x); \
334 (__typeof__(*(ptr))) __xchg_local((ptr), \
335 (unsigned long)_x_, sizeof(*(ptr))); \
336 })
279 337
280/* 338/*
281 * Compare and exchange - if *p == old, set it to new, 339 * Compare and exchange - if *p == old, set it to new,
@@ -306,6 +364,28 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
306 return prev; 364 return prev;
307} 365}
308 366
367static __inline__ unsigned long
368__cmpxchg_u32_local(volatile unsigned int *p, unsigned long old,
369 unsigned long new)
370{
371 unsigned int prev;
372
373 __asm__ __volatile__ (
374"1: lwarx %0,0,%2 # __cmpxchg_u32\n\
375 cmpw 0,%0,%3\n\
376 bne- 2f\n"
377 PPC405_ERR77(0,%2)
378" stwcx. %4,0,%2\n\
379 bne- 1b"
380 "\n\
3812:"
382 : "=&r" (prev), "+m" (*p)
383 : "r" (p), "r" (old), "r" (new)
384 : "cc", "memory");
385
386 return prev;
387}
388
309#ifdef CONFIG_PPC64 389#ifdef CONFIG_PPC64
310static __inline__ unsigned long 390static __inline__ unsigned long
311__cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) 391__cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
@@ -328,6 +408,27 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
328 408
329 return prev; 409 return prev;
330} 410}
411
412static __inline__ unsigned long
413__cmpxchg_u64_local(volatile unsigned long *p, unsigned long old,
414 unsigned long new)
415{
416 unsigned long prev;
417
418 __asm__ __volatile__ (
419"1: ldarx %0,0,%2 # __cmpxchg_u64\n\
420 cmpd 0,%0,%3\n\
421 bne- 2f\n\
422 stdcx. %4,0,%2\n\
423 bne- 1b"
424 "\n\
4252:"
426 : "=&r" (prev), "+m" (*p)
427 : "r" (p), "r" (old), "r" (new)
428 : "cc", "memory");
429
430 return prev;
431}
331#endif 432#endif
332 433
333/* This function doesn't exist, so you'll get a linker error 434/* This function doesn't exist, so you'll get a linker error
@@ -350,6 +451,22 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
350 return old; 451 return old;
351} 452}
352 453
454static __inline__ unsigned long
455__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
456 unsigned int size)
457{
458 switch (size) {
459 case 4:
460 return __cmpxchg_u32_local(ptr, old, new);
461#ifdef CONFIG_PPC64
462 case 8:
463 return __cmpxchg_u64_local(ptr, old, new);
464#endif
465 }
466 __cmpxchg_called_with_bad_pointer();
467 return old;
468}
469
353#define cmpxchg(ptr,o,n) \ 470#define cmpxchg(ptr,o,n) \
354 ({ \ 471 ({ \
355 __typeof__(*(ptr)) _o_ = (o); \ 472 __typeof__(*(ptr)) _o_ = (o); \
@@ -358,6 +475,15 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
358 (unsigned long)_n_, sizeof(*(ptr))); \ 475 (unsigned long)_n_, sizeof(*(ptr))); \
359 }) 476 })
360 477
478
479#define cmpxchg_local(ptr,o,n) \
480 ({ \
481 __typeof__(*(ptr)) _o_ = (o); \
482 __typeof__(*(ptr)) _n_ = (n); \
483 (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
484 (unsigned long)_n_, sizeof(*(ptr))); \
485 })
486
361#ifdef CONFIG_PPC64 487#ifdef CONFIG_PPC64
362/* 488/*
363 * We handle most unaligned accesses in hardware. On the other hand 489 * We handle most unaligned accesses in hardware. On the other hand
diff --git a/include/asm-powerpc/tsi108.h b/include/asm-powerpc/tsi108.h
index 4e95d153be84..f8b60793b7a9 100644
--- a/include/asm-powerpc/tsi108.h
+++ b/include/asm-powerpc/tsi108.h
@@ -68,8 +68,17 @@
68#define TSI108_PB_ERRCS_ES (1 << 1) 68#define TSI108_PB_ERRCS_ES (1 << 1)
69#define TSI108_PB_ISR_PBS_RD_ERR (1 << 8) 69#define TSI108_PB_ISR_PBS_RD_ERR (1 << 8)
70 70
71#define TSI108_PCI_CFG_BASE_PHYS (0xfb000000)
72#define TSI108_PCI_CFG_SIZE (0x01000000) 71#define TSI108_PCI_CFG_SIZE (0x01000000)
72
73/*
74 * PHY Configuration Options
75 *
76 * Specify "bcm54xx" in the compatible property of your device tree phy
77 * nodes if your board uses the Broadcom PHYs
78 */
79#define TSI108_PHY_MV88E 0 /* Marvel 88Exxxx PHY */
80#define TSI108_PHY_BCM54XX 1 /* Broardcom BCM54xx PHY */
81
73/* Global variables */ 82/* Global variables */
74 83
75extern u32 tsi108_pci_cfg_base; 84extern u32 tsi108_pci_cfg_base;
@@ -93,6 +102,7 @@ typedef struct {
93 u16 phy; /* phy address */ 102 u16 phy; /* phy address */
94 u16 irq_num; /* irq number */ 103 u16 irq_num; /* irq number */
95 u8 mac_addr[6]; /* phy mac address */ 104 u8 mac_addr[6]; /* phy mac address */
105 u16 phy_type; /* type of phy on board */
96} hw_info; 106} hw_info;
97 107
98extern u32 get_vir_csrbase(void); 108extern u32 get_vir_csrbase(void);
diff --git a/include/asm-powerpc/tsi108_pci.h b/include/asm-powerpc/tsi108_pci.h
new file mode 100644
index 000000000000..a9f92f73232c
--- /dev/null
+++ b/include/asm-powerpc/tsi108_pci.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright 2007 IBM Corp
3 *
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
19 */
20
21#ifndef _ASM_PPC_TSI108_PCI_H
22#define _ASM_PPC_TSI108_PCI_H
23
24#include <asm/tsi108.h>
25
26/* Register definitions */
27#define TSI108_PCI_P2O_BAR0 (TSI108_PCI_OFFSET + 0x10)
28#define TSI108_PCI_P2O_BAR0_UPPER (TSI108_PCI_OFFSET + 0x14)
29#define TSI108_PCI_P2O_BAR2 (TSI108_PCI_OFFSET + 0x18)
30#define TSI108_PCI_P2O_BAR2_UPPER (TSI108_PCI_OFFSET + 0x1c)
31#define TSI108_PCI_P2O_PAGE_SIZES (TSI108_PCI_OFFSET + 0x4c)
32#define TSI108_PCI_PFAB_BAR0 (TSI108_PCI_OFFSET + 0x204)
33#define TSI108_PCI_PFAB_BAR0_UPPER (TSI108_PCI_OFFSET + 0x208)
34#define TSI108_PCI_PFAB_IO (TSI108_PCI_OFFSET + 0x20c)
35#define TSI108_PCI_PFAB_IO_UPPER (TSI108_PCI_OFFSET + 0x210)
36#define TSI108_PCI_PFAB_MEM32 (TSI108_PCI_OFFSET + 0x214)
37#define TSI108_PCI_PFAB_PFM3 (TSI108_PCI_OFFSET + 0x220)
38#define TSI108_PCI_PFAB_PFM4 (TSI108_PCI_OFFSET + 0x230)
39
40extern int tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary);
41extern void tsi108_pci_int_init(struct device_node *node);
42extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc);
43extern void tsi108_clear_pci_cfg_error(void);
44
45#endif /* _ASM_PPC_TSI108_PCI_H */
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h
index d03d8557f706..ce9d82fb7b68 100644
--- a/include/asm-powerpc/udbg.h
+++ b/include/asm-powerpc/udbg.h
@@ -47,6 +47,7 @@ extern void __init udbg_init_rtas_panel(void);
47extern void __init udbg_init_rtas_console(void); 47extern void __init udbg_init_rtas_console(void);
48extern void __init udbg_init_debug_beat(void); 48extern void __init udbg_init_debug_beat(void);
49extern void __init udbg_init_btext(void); 49extern void __init udbg_init_btext(void);
50extern void __init udbg_init_44x_as1(void);
50 51
51#endif /* __KERNEL__ */ 52#endif /* __KERNEL__ */
52#endif /* _ASM_POWERPC_UDBG_H */ 53#endif /* _ASM_POWERPC_UDBG_H */
diff --git a/include/asm-ppc/kdebug.h b/include/asm-ppc/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-ppc/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index b1fdbf40dba2..bed452d4a5f0 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -827,10 +827,6 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma,
827 remap_pfn_range(vma, vaddr, pfn, size, prot) 827 remap_pfn_range(vma, vaddr, pfn, size, prot)
828#endif 828#endif
829 829
830#define MK_IOSPACE_PFN(space, pfn) (pfn)
831#define GET_IOSPACE(pfn) 0
832#define GET_PFN(pfn) (pfn)
833
834/* 830/*
835 * No page table caches to initialise 831 * No page table caches to initialise
836 */ 832 */
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index 738943584c01..d84a3cf4d033 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -6,7 +6,6 @@
6 6
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8 8
9#include <asm/atomic.h>
10#include <asm/hw_irq.h> 9#include <asm/hw_irq.h>
11 10
12/* 11/*
@@ -170,7 +169,6 @@ xchg_u32(volatile void *p, unsigned long val)
170extern void __xchg_called_with_bad_pointer(void); 169extern void __xchg_called_with_bad_pointer(void);
171 170
172#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 171#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
173#define tas(ptr) (xchg((ptr),1))
174 172
175static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size) 173static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
176{ 174{
diff --git a/include/asm-s390/dma-mapping.h b/include/asm-s390/dma-mapping.h
index 09bb7b04f967..3f8c12fde0f0 100644
--- a/include/asm-s390/dma-mapping.h
+++ b/include/asm-s390/dma-mapping.h
@@ -9,6 +9,4 @@
9#ifndef _ASM_DMA_MAPPING_H 9#ifndef _ASM_DMA_MAPPING_H
10#define _ASM_DMA_MAPPING_H 10#define _ASM_DMA_MAPPING_H
11 11
12#include <asm-generic/dma-mapping-broken.h>
13
14#endif /* _ASM_DMA_MAPPING_H */ 12#endif /* _ASM_DMA_MAPPING_H */
diff --git a/include/asm-s390/kdebug.h b/include/asm-s390/kdebug.h
index d2d7ad276148..04418af08f85 100644
--- a/include/asm-s390/kdebug.h
+++ b/include/asm-s390/kdebug.h
@@ -8,21 +8,6 @@
8 8
9struct pt_regs; 9struct pt_regs;
10 10
11struct die_args {
12 struct pt_regs *regs;
13 const char *str;
14 long err;
15 int trapnr;
16 int signr;
17};
18
19/* Note - you should never unregister because that can race with NMIs.
20 * If you really want to do it first unregister - then synchronize_sched
21 * - then free.
22 */
23extern int register_die_notifier(struct notifier_block *);
24extern int unregister_die_notifier(struct notifier_block *);
25
26/* 11/*
27 * These are only here because kprobes.c wants them to implement a 12 * These are only here because kprobes.c wants them to implement a
28 * blatant layering violation. Will hopefully go away soon once all 13 * blatant layering violation. Will hopefully go away soon once all
@@ -37,8 +22,6 @@ static inline int unregister_page_fault_notifier(struct notifier_block *nb)
37 return 0; 22 return 0;
38} 23}
39 24
40extern struct atomic_notifier_head s390die_chain;
41
42enum die_val { 25enum die_val {
43 DIE_OOPS = 1, 26 DIE_OOPS = 1,
44 DIE_BPT, 27 DIE_BPT,
@@ -54,19 +37,6 @@ enum die_val {
54 DIE_NMI_IPI, 37 DIE_NMI_IPI,
55}; 38};
56 39
57static inline int notify_die(enum die_val val, const char *str,
58 struct pt_regs *regs, long err, int trap, int sig)
59{
60 struct die_args args = {
61 .regs = regs,
62 .str = str,
63 .err = err,
64 .trapnr = trap,
65 .signr = sig
66 };
67 return atomic_notifier_call_chain(&s390die_chain, val, &args);
68}
69
70extern void die(const char *, struct pt_regs *, long); 40extern void die(const char *, struct pt_regs *, long);
71 41
72#endif 42#endif
diff --git a/include/asm-s390/kexec.h b/include/asm-s390/kexec.h
index 9c35c8ad1afd..7592af708b41 100644
--- a/include/asm-s390/kexec.h
+++ b/include/asm-s390/kexec.h
@@ -34,8 +34,6 @@
34/* The native architecture */ 34/* The native architecture */
35#define KEXEC_ARCH KEXEC_ARCH_S390 35#define KEXEC_ARCH KEXEC_ARCH_S390
36 36
37#define MAX_NOTE_BYTES 1024
38
39/* Provide a dummy definition to avoid build failures. */ 37/* Provide a dummy definition to avoid build failures. */
40static inline void crash_setup_regs(struct pt_regs *newregs, 38static inline void crash_setup_regs(struct pt_regs *newregs,
41 struct pt_regs *oldregs) { } 39 struct pt_regs *oldregs) { }
diff --git a/include/asm-s390/qdio.h b/include/asm-s390/qdio.h
index 127f72e77419..74db1dc10a7d 100644
--- a/include/asm-s390/qdio.h
+++ b/include/asm-s390/qdio.h
@@ -120,6 +120,7 @@ extern unsigned long qdio_get_status(int irq);
120#define QDIO_FLAG_NO_INPUT_INTERRUPT_CONTEXT 0x08 /* no effect on 120#define QDIO_FLAG_NO_INPUT_INTERRUPT_CONTEXT 0x08 /* no effect on
121 adapter interrupts */ 121 adapter interrupts */
122#define QDIO_FLAG_DONT_SIGA 0x10 122#define QDIO_FLAG_DONT_SIGA 0x10
123#define QDIO_FLAG_PCI_OUT 0x20
123 124
124extern int do_QDIO(struct ccw_device*, unsigned int flags, 125extern int do_QDIO(struct ccw_device*, unsigned int flags,
125 unsigned int queue_number, 126 unsigned int queue_number,
diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h
index 2f89dd06d0cd..794c36daf06d 100644
--- a/include/asm-sh/bug.h
+++ b/include/asm-sh/bug.h
@@ -2,50 +2,80 @@
2#define __ASM_SH_BUG_H 2#define __ASM_SH_BUG_H
3 3
4#ifdef CONFIG_BUG 4#ifdef CONFIG_BUG
5 5#define HAVE_ARCH_BUG
6struct bug_frame { 6#define HAVE_ARCH_WARN_ON
7 unsigned short opcode;
8 unsigned short line;
9 const char *file;
10 const char *func;
11};
12
13struct pt_regs;
14
15extern void handle_BUG(struct pt_regs *);
16 7
17#define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */ 8#define TRAPA_BUG_OPCODE 0xc33e /* trapa #0x3e */
18 9
10/**
11 * _EMIT_BUG_ENTRY
12 * %1 - __FILE__
13 * %2 - __LINE__
14 * %3 - trap type
15 * %4 - sizeof(struct bug_entry)
16 *
17 * The trapa opcode itself sits in %0.
18 * The %O notation is used to avoid # generation.
19 *
20 * The offending file and line are encoded in the __bug_table section.
21 */
19#ifdef CONFIG_DEBUG_BUGVERBOSE 22#ifdef CONFIG_DEBUG_BUGVERBOSE
23#define _EMIT_BUG_ENTRY \
24 "\t.pushsection __bug_table,\"a\"\n" \
25 "2:\t.long 1b, %O1\n" \
26 "\t.short %O2, %O3\n" \
27 "\t.org 2b+%O4\n" \
28 "\t.popsection\n"
29#else
30#define _EMIT_BUG_ENTRY \
31 "\t.pushsection __bug_table,\"a\"\n" \
32 "2:\t.long 1b\n" \
33 "\t.short %O3\n" \
34 "\t.org 2b+%O4\n" \
35 "\t.popsection\n"
36#endif
20 37
21#define BUG() \ 38#define BUG() \
22do { \ 39do { \
23 __asm__ __volatile__ ( \ 40 __asm__ __volatile__ ( \
24 ".align 2\n\t" \ 41 "1:\t.short %O0\n" \
25 ".short %O0\n\t" \ 42 _EMIT_BUG_ENTRY \
26 ".short %O1\n\t" \ 43 : \
27 ".long %O2\n\t" \ 44 : "n" (TRAPA_BUG_OPCODE), \
28 ".long %O3\n\t" \ 45 "i" (__FILE__), \
29 : \ 46 "i" (__LINE__), "i" (0), \
30 : "n" (TRAPA_BUG_OPCODE), \ 47 "i" (sizeof(struct bug_entry))); \
31 "i" (__LINE__), "X" (__FILE__), \
32 "X" (__FUNCTION__)); \
33} while (0) 48} while (0)
34 49
35#else 50#define __WARN() \
36 51do { \
37#define BUG() \ 52 __asm__ __volatile__ ( \
38do { \ 53 "1:\t.short %O0\n" \
39 __asm__ __volatile__ ( \ 54 _EMIT_BUG_ENTRY \
40 ".align 2\n\t" \ 55 : \
41 ".short %O0\n\t" \ 56 : "n" (TRAPA_BUG_OPCODE), \
42 : \ 57 "i" (__FILE__), \
43 : "n" (TRAPA_BUG_OPCODE)); \ 58 "i" (__LINE__), \
59 "i" (BUGFLAG_WARNING), \
60 "i" (sizeof(struct bug_entry))); \
44} while (0) 61} while (0)
45 62
46#endif /* CONFIG_DEBUG_BUGVERBOSE */ 63#define WARN_ON(x) ({ \
64 typeof(x) __ret_warn_on = (x); \
65 if (__builtin_constant_p(__ret_warn_on)) { \
66 if (__ret_warn_on) \
67 __WARN(); \
68 } else { \
69 if (unlikely(__ret_warn_on)) \
70 __WARN(); \
71 } \
72 unlikely(__ret_warn_on); \
73})
47 74
48#define HAVE_ARCH_BUG 75struct pt_regs;
76
77/* arch/sh/kernel/traps.c */
78void handle_BUG(struct pt_regs *);
49 79
50#endif /* CONFIG_BUG */ 80#endif /* CONFIG_BUG */
51 81
diff --git a/include/asm-sh/clock.h b/include/asm-sh/clock.h
index 1df92807f8c5..386d797d86b7 100644
--- a/include/asm-sh/clock.h
+++ b/include/asm-sh/clock.h
@@ -13,7 +13,7 @@ struct clk_ops {
13 void (*enable)(struct clk *clk); 13 void (*enable)(struct clk *clk);
14 void (*disable)(struct clk *clk); 14 void (*disable)(struct clk *clk);
15 void (*recalc)(struct clk *clk); 15 void (*recalc)(struct clk *clk);
16 int (*set_rate)(struct clk *clk, unsigned long rate); 16 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
17}; 17};
18 18
19struct clk { 19struct clk {
@@ -48,6 +48,34 @@ void clk_recalc_rate(struct clk *);
48int clk_register(struct clk *); 48int clk_register(struct clk *);
49void clk_unregister(struct clk *); 49void clk_unregister(struct clk *);
50 50
51int show_clocks(struct seq_file *m); 51/* the exported API, in addition to clk_set_rate */
52/**
53 * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter
54 * @clk: clock source
55 * @rate: desired clock rate in Hz
56 * @algo_id: algorithm id to be passed down to ops->set_rate
57 *
58 * Returns success (0) or negative errno.
59 */
60int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id);
52 61
62enum clk_sh_algo_id {
63 NO_CHANGE = 0,
64
65 IUS_N1_N1,
66 IUS_322,
67 IUS_522,
68 IUS_N11,
69
70 SB_N1,
71
72 SB3_N1,
73 SB3_32,
74 SB3_43,
75 SB3_54,
76
77 BP_N1,
78
79 IP_N1,
80};
53#endif /* __ASM_SH_CLOCK_H */ 81#endif /* __ASM_SH_CLOCK_H */
diff --git a/include/asm-sh/cpu-sh3/mmu_context.h b/include/asm-sh/cpu-sh3/mmu_context.h
index bccb7ddb438b..4704e86dff5b 100644
--- a/include/asm-sh/cpu-sh3/mmu_context.h
+++ b/include/asm-sh/cpu-sh3/mmu_context.h
@@ -32,6 +32,7 @@
32 defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 32 defined(CONFIG_CPU_SUBTYPE_SH7706) || \
33 defined(CONFIG_CPU_SUBTYPE_SH7300) || \ 33 defined(CONFIG_CPU_SUBTYPE_SH7300) || \
34 defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 34 defined(CONFIG_CPU_SUBTYPE_SH7705) || \
35 defined(CONFIG_CPU_SUBTYPE_SH7712) || \
35 defined(CONFIG_CPU_SUBTYPE_SH7710) 36 defined(CONFIG_CPU_SUBTYPE_SH7710)
36#define INTEVT 0xa4000000 /* INTEVTE2(0xa4000000) */ 37#define INTEVT 0xa4000000 /* INTEVTE2(0xa4000000) */
37#else 38#else
diff --git a/include/asm-sh/cpu-sh4/freq.h b/include/asm-sh/cpu-sh4/freq.h
index 602d061ca2dc..86564e7a26ae 100644
--- a/include/asm-sh/cpu-sh4/freq.h
+++ b/include/asm-sh/cpu-sh4/freq.h
@@ -12,8 +12,16 @@
12 12
13#if defined(CONFIG_CPU_SUBTYPE_SH73180) || defined(CONFIG_CPU_SUBTYPE_SH7722) 13#if defined(CONFIG_CPU_SUBTYPE_SH73180) || defined(CONFIG_CPU_SUBTYPE_SH7722)
14#define FRQCR 0xa4150000 14#define FRQCR 0xa4150000
15#define VCLKCR 0xa4150004
16#define SCLKACR 0xa4150008
17#define SCLKBCR 0xa415000c
18#define IrDACLKCR 0xa4150010
15#elif defined(CONFIG_CPU_SUBTYPE_SH7780) 19#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
16#define FRQCR 0xffc80000 20#define FRQCR 0xffc80000
21#elif defined(CONFIG_CPU_SUBTYPE_SH7785)
22#define FRQCR0 0xffc80000
23#define FRQCR1 0xffc80004
24#define FRQMR1 0xffc80014
17#else 25#else
18#define FRQCR 0xffc00000 26#define FRQCR 0xffc00000
19#endif 27#endif
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index afe188f0ad5f..e81bf21c801e 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -2,94 +2,13 @@
2#define __ASM_SH_IRQ_H 2#define __ASM_SH_IRQ_H
3 3
4#include <asm/machvec.h> 4#include <asm/machvec.h>
5#include <asm/ptrace.h> /* for pt_regs */
6 5
7/* NR_IRQS is made from three components: 6/*
8 * 1. ONCHIP_NR_IRQS - number of IRLS + on-chip peripherial modules 7 * A sane default based on a reasonable vector table size, platforms are
9 * 2. PINT_NR_IRQS - number of PINT interrupts 8 * advised to cap this at the hard limit that they're interested in
10 * 3. OFFCHIP_NR_IRQS - numbe of IRQs from off-chip peripherial modules 9 * through the machvec.
11 */ 10 */
12 11#define NR_IRQS 256
13/* 1. ONCHIP_NR_IRQS */
14#if defined(CONFIG_CPU_SUBTYPE_SH7604)
15# define ONCHIP_NR_IRQS 24 // Actually 21
16#elif defined(CONFIG_CPU_SUBTYPE_SH7707)
17# define ONCHIP_NR_IRQS 64
18# define PINT_NR_IRQS 16
19#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
20# define ONCHIP_NR_IRQS 32
21#elif defined(CONFIG_CPU_SUBTYPE_SH7709) || \
22 defined(CONFIG_CPU_SUBTYPE_SH7706) || \
23 defined(CONFIG_CPU_SUBTYPE_SH7705)
24# define ONCHIP_NR_IRQS 64 // Actually 61
25# define PINT_NR_IRQS 16
26#elif defined(CONFIG_CPU_SUBTYPE_SH7710)
27# define ONCHIP_NR_IRQS 104
28#elif defined(CONFIG_CPU_SUBTYPE_SH7750)
29# define ONCHIP_NR_IRQS 48 // Actually 44
30#elif defined(CONFIG_CPU_SUBTYPE_SH7751)
31# define ONCHIP_NR_IRQS 72
32#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
33# define ONCHIP_NR_IRQS 112 /* XXX */
34#elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
35# define ONCHIP_NR_IRQS 72
36#elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
37# define ONCHIP_NR_IRQS 144
38#elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \
39 defined(CONFIG_CPU_SUBTYPE_SH73180) || \
40 defined(CONFIG_CPU_SUBTYPE_SH7343) || \
41 defined(CONFIG_CPU_SUBTYPE_SH7722)
42# define ONCHIP_NR_IRQS 109
43#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
44# define ONCHIP_NR_IRQS 111
45#elif defined(CONFIG_CPU_SUBTYPE_SH7206)
46# define ONCHIP_NR_IRQS 256
47#elif defined(CONFIG_CPU_SUBTYPE_SH7619)
48# define ONCHIP_NR_IRQS 128
49#elif defined(CONFIG_SH_UNKNOWN) /* Most be last */
50# define ONCHIP_NR_IRQS 144
51#endif
52
53/* 2. PINT_NR_IRQS */
54#ifdef CONFIG_SH_UNKNOWN
55# define PINT_NR_IRQS 16
56#else
57# ifndef PINT_NR_IRQS
58# define PINT_NR_IRQS 0
59# endif
60#endif
61
62#if PINT_NR_IRQS > 0
63# define PINT_IRQ_BASE ONCHIP_NR_IRQS
64#endif
65
66/* 3. OFFCHIP_NR_IRQS */
67#if defined(CONFIG_HD64461)
68# define OFFCHIP_NR_IRQS 18
69#elif defined(CONFIG_HD64465)
70# define OFFCHIP_NR_IRQS 16
71#elif defined (CONFIG_SH_DREAMCAST)
72# define OFFCHIP_NR_IRQS 96
73#elif defined (CONFIG_SH_TITAN)
74# define OFFCHIP_NR_IRQS 4
75#elif defined(CONFIG_SH_R7780RP)
76# define OFFCHIP_NR_IRQS 16
77#elif defined(CONFIG_SH_7343_SOLUTION_ENGINE)
78# define OFFCHIP_NR_IRQS 12
79#elif defined(CONFIG_SH_7722_SOLUTION_ENGINE)
80# define OFFCHIP_NR_IRQS 14
81#elif defined(CONFIG_SH_UNKNOWN)
82# define OFFCHIP_NR_IRQS 16 /* Must also be last */
83#else
84# define OFFCHIP_NR_IRQS 0
85#endif
86
87#if OFFCHIP_NR_IRQS > 0
88# define OFFCHIP_IRQ_BASE (ONCHIP_NR_IRQS + PINT_NR_IRQS)
89#endif
90
91/* NR_IRQS. 1+2+3 */
92#define NR_IRQS (ONCHIP_NR_IRQS + PINT_NR_IRQS + OFFCHIP_NR_IRQS)
93 12
94/* 13/*
95 * Convert back and forth between INTEVT and IRQ values. 14 * Convert back and forth between INTEVT and IRQ values.
diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h
new file mode 100644
index 000000000000..493c20629747
--- /dev/null
+++ b/include/asm-sh/kdebug.h
@@ -0,0 +1,36 @@
1#ifndef __ASM_SH_KDEBUG_H
2#define __ASM_SH_KDEBUG_H
3
4#include <linux/notifier.h>
5#include <asm-generic/kdebug.h>
6
7struct pt_regs;
8
9struct die_args {
10 struct pt_regs *regs;
11 int trapnr;
12};
13
14int register_die_notifier(struct notifier_block *nb);
15int unregister_die_notifier(struct notifier_block *nb);
16int register_page_fault_notifier(struct notifier_block *nb);
17int unregister_page_fault_notifier(struct notifier_block *nb);
18extern struct atomic_notifier_head shdie_chain;
19
20/* Grossly misnamed. */
21enum die_val {
22 DIE_TRAP,
23 DIE_PAGE_FAULT,
24};
25
26static inline int notify_die(enum die_val val, struct pt_regs *regs,
27 int trap, int sig)
28{
29 struct die_args args = {
30 .regs = regs,
31 .trapnr = trap,
32 };
33
34 return atomic_notifier_call_chain(&shdie_chain, val, &args);
35}
36#endif /* __ASM_SH_KDEBUG_H */
diff --git a/include/asm-sh/kexec.h b/include/asm-sh/kexec.h
index 9d235af20cdd..00f4260ef09b 100644
--- a/include/asm-sh/kexec.h
+++ b/include/asm-sh/kexec.h
@@ -1,5 +1,8 @@
1#ifndef _SH_KEXEC_H 1#ifndef __ASM_SH_KEXEC_H
2#define _SH_KEXEC_H 2#define __ASM_SH_KEXEC_H
3
4#include <asm/ptrace.h>
5#include <asm/string.h>
3 6
4/* 7/*
5 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. 8 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
@@ -23,10 +26,37 @@
23/* The native architecture */ 26/* The native architecture */
24#define KEXEC_ARCH KEXEC_ARCH_SH 27#define KEXEC_ARCH KEXEC_ARCH_SH
25 28
26#define MAX_NOTE_BYTES 1024
27
28/* Provide a dummy definition to avoid build failures. */
29static inline void crash_setup_regs(struct pt_regs *newregs, 29static inline void crash_setup_regs(struct pt_regs *newregs,
30 struct pt_regs *oldregs) { } 30 struct pt_regs *oldregs)
31{
32 if (oldregs)
33 memcpy(newregs, oldregs, sizeof(*newregs));
34 else {
35 __asm__ __volatile__ ("mov r0, %0" : "=r" (newregs->regs[0]));
36 __asm__ __volatile__ ("mov r1, %0" : "=r" (newregs->regs[1]));
37 __asm__ __volatile__ ("mov r2, %0" : "=r" (newregs->regs[2]));
38 __asm__ __volatile__ ("mov r3, %0" : "=r" (newregs->regs[3]));
39 __asm__ __volatile__ ("mov r4, %0" : "=r" (newregs->regs[4]));
40 __asm__ __volatile__ ("mov r5, %0" : "=r" (newregs->regs[5]));
41 __asm__ __volatile__ ("mov r6, %0" : "=r" (newregs->regs[6]));
42 __asm__ __volatile__ ("mov r7, %0" : "=r" (newregs->regs[7]));
43 __asm__ __volatile__ ("mov r8, %0" : "=r" (newregs->regs[8]));
44 __asm__ __volatile__ ("mov r9, %0" : "=r" (newregs->regs[9]));
45 __asm__ __volatile__ ("mov r10, %0" : "=r" (newregs->regs[10]));
46 __asm__ __volatile__ ("mov r11, %0" : "=r" (newregs->regs[11]));
47 __asm__ __volatile__ ("mov r12, %0" : "=r" (newregs->regs[12]));
48 __asm__ __volatile__ ("mov r13, %0" : "=r" (newregs->regs[13]));
49 __asm__ __volatile__ ("mov r14, %0" : "=r" (newregs->regs[14]));
50 __asm__ __volatile__ ("mov r15, %0" : "=r" (newregs->regs[15]));
51
52 __asm__ __volatile__ ("sts pr, %0" : "=r" (newregs->pr));
53 __asm__ __volatile__ ("sts macl, %0" : "=r" (newregs->macl));
54 __asm__ __volatile__ ("sts mach, %0" : "=r" (newregs->mach));
55
56 __asm__ __volatile__ ("stc gbr, %0" : "=r" (newregs->gbr));
57 __asm__ __volatile__ ("stc sr, %0" : "=r" (newregs->sr));
31 58
32#endif /* _SH_KEXEC_H */ 59 newregs->pc = (unsigned long)current_text_addr();
60 }
61}
62#endif /* __ASM_SH_KEXEC_H */
diff --git a/include/asm-sh/kgdb.h b/include/asm-sh/kgdb.h
index 0095c665d272..74bd0953e5ce 100644
--- a/include/asm-sh/kgdb.h
+++ b/include/asm-sh/kgdb.h
@@ -17,6 +17,7 @@
17#define __KGDB_H 17#define __KGDB_H
18 18
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/cacheflush.h>
20 21
21struct console; 22struct console;
22 23
@@ -45,35 +46,21 @@ extern int kgdb_portnum;
45extern int kgdb_baud; 46extern int kgdb_baud;
46extern char kgdb_parity; 47extern char kgdb_parity;
47extern char kgdb_bits; 48extern char kgdb_bits;
48extern int kgdb_console_setup(struct console *, char *);
49 49
50/* Init and interface stuff */ 50/* Init and interface stuff */
51extern int kgdb_init(void); 51extern int kgdb_init(void);
52extern int (*kgdb_serial_setup)(void);
53extern int (*kgdb_getchar)(void); 52extern int (*kgdb_getchar)(void);
54extern void (*kgdb_putchar)(int); 53extern void (*kgdb_putchar)(int);
55 54
56struct kgdb_sermap {
57 char *name;
58 int namelen;
59 int (*setup_fn)(struct console *, char *);
60 struct kgdb_sermap *next;
61};
62extern void kgdb_register_sermap(struct kgdb_sermap *map);
63extern struct kgdb_sermap *kgdb_porttype;
64
65/* Trap functions */ 55/* Trap functions */
66typedef void (kgdb_debug_hook_t)(struct pt_regs *regs); 56typedef void (kgdb_debug_hook_t)(struct pt_regs *regs);
67typedef void (kgdb_bus_error_hook_t)(void); 57typedef void (kgdb_bus_error_hook_t)(void);
68extern kgdb_debug_hook_t *kgdb_debug_hook; 58extern kgdb_debug_hook_t *kgdb_debug_hook;
69extern kgdb_bus_error_hook_t *kgdb_bus_err_hook; 59extern kgdb_bus_error_hook_t *kgdb_bus_err_hook;
70 60
71extern void breakpoint(void);
72
73/* Console */ 61/* Console */
74struct console;
75void kgdb_console_write(struct console *co, const char *s, unsigned count); 62void kgdb_console_write(struct console *co, const char *s, unsigned count);
76void kgdb_console_init(void); 63extern int kgdb_console_setup(struct console *, char *);
77 64
78/* Prototypes for jmp fns */ 65/* Prototypes for jmp fns */
79#define _JBLEN 9 66#define _JBLEN 9
@@ -81,11 +68,8 @@ typedef int jmp_buf[_JBLEN];
81extern void longjmp(jmp_buf __jmpb, int __retval); 68extern void longjmp(jmp_buf __jmpb, int __retval);
82extern int setjmp(jmp_buf __jmpb); 69extern int setjmp(jmp_buf __jmpb);
83 70
84/* Variadic macro to print our own message to the console */
85#define KGDB_PRINTK(...) printk("KGDB: " __VA_ARGS__)
86
87/* Forced breakpoint */ 71/* Forced breakpoint */
88#define BREAKPOINT() \ 72#define breakpoint() \
89do { \ 73do { \
90 if (kgdb_enabled) \ 74 if (kgdb_enabled) \
91 __asm__ __volatile__("trapa #0x3c"); \ 75 __asm__ __volatile__("trapa #0x3c"); \
@@ -95,7 +79,6 @@ do { \
95#if defined(CONFIG_CPU_SH4) 79#if defined(CONFIG_CPU_SH4)
96#define kgdb_flush_icache_range(start, end) \ 80#define kgdb_flush_icache_range(start, end) \
97{ \ 81{ \
98 extern void __flush_purge_region(void *, int); \
99 __flush_purge_region((void*)(start), (int)(end) - (int)(start));\ 82 __flush_purge_region((void*)(start), (int)(end) - (int)(start));\
100 flush_icache_range((start), (end)); \ 83 flush_icache_range((start), (end)); \
101} 84}
@@ -103,31 +86,6 @@ do { \
103#define kgdb_flush_icache_range(start, end) do { } while (0) 86#define kgdb_flush_icache_range(start, end) do { } while (0)
104#endif 87#endif
105 88
106/* Kernel assert macros */
107#ifdef CONFIG_KGDB_KERNEL_ASSERTS
108
109/* Predefined conditions */
110#define KA_VALID_ERRNO(errno) ((errno) > 0 && (errno) <= EMEDIUMTYPE)
111#define KA_VALID_PTR_ERR(ptr) KA_VALID_ERRNO(-PTR_ERR(ptr))
112#define KA_VALID_KPTR(ptr) (!(ptr) || \
113 ((void *)(ptr) >= (void *)PAGE_OFFSET && \
114 (void *)(ptr) < ERR_PTR(-EMEDIUMTYPE)))
115#define KA_VALID_PTRORERR(errptr) \
116 (KA_VALID_KPTR(errptr) || KA_VALID_PTR_ERR(errptr))
117#define KA_HELD_GKL() (current->lock_depth >= 0)
118
119/* The actual assert */
120#define KGDB_ASSERT(condition, message) do { \
121 if (!(condition) && (kgdb_enabled)) { \
122 KGDB_PRINTK("Assertion failed at %s:%d: %s\n", \
123 __FILE__, __LINE__, message);\
124 BREAKPOINT(); \
125 } \
126} while (0)
127#else
128#define KGDB_ASSERT(condition, message)
129#endif
130
131/* Taken from sh-stub.c of GDB 4.18 */ 89/* Taken from sh-stub.c of GDB 4.18 */
132static const char hexchars[] = "0123456789abcdef"; 90static const char hexchars[] = "0123456789abcdef";
133 91
@@ -142,5 +100,4 @@ static inline char lowhex(const int x)
142{ 100{
143 return hexchars[x & 0xf]; 101 return hexchars[x & 0xf];
144} 102}
145
146#endif 103#endif
diff --git a/include/asm-sh/lboxre2.h b/include/asm-sh/lboxre2.h
new file mode 100644
index 000000000000..e6d160504923
--- /dev/null
+++ b/include/asm-sh/lboxre2.h
@@ -0,0 +1,27 @@
1#ifndef __ASM_SH_LBOXRE2_H
2#define __ASM_SH_LBOXRE2_H
3
4/*
5 * Copyright (C) 2007 Nobuhiro Iwamatsu
6 *
7 * NTT COMWARE L-BOX RE2 support
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
12 *
13 */
14
15#define IRQ_CF1 9 /* CF1 */
16#define IRQ_CF0 10 /* CF0 */
17#define IRQ_INTD 11 /* INTD */
18#define IRQ_ETH1 12 /* Ether1 */
19#define IRQ_ETH0 13 /* Ether0 */
20#define IRQ_INTA 14 /* INTA */
21
22void init_lboxre2_IRQ(void);
23
24#define __IO_PREFIX lboxre2
25#include <asm/io_generic.h>
26
27#endif /* __ASM_SH_LBOXRE2_H */
diff --git a/include/asm-sh/mmu_context.h b/include/asm-sh/mmu_context.h
index 01acaaae9751..199662bb35c6 100644
--- a/include/asm-sh/mmu_context.h
+++ b/include/asm-sh/mmu_context.h
@@ -169,6 +169,8 @@ enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
169#define destroy_context(mm) do { } while (0) 169#define destroy_context(mm) do { } while (0)
170#define set_asid(asid) do { } while (0) 170#define set_asid(asid) do { } while (0)
171#define get_asid() (0) 171#define get_asid() (0)
172#define set_TTB(pgd) do { } while (0)
173#define get_TTB() (0)
172#define activate_context(mm,cpu) do { } while (0) 174#define activate_context(mm,cpu) do { } while (0)
173#define switch_mm(prev,next,tsk) do { } while (0) 175#define switch_mm(prev,next,tsk) do { } while (0)
174#define deactivate_mm(tsk,mm) do { } while (0) 176#define deactivate_mm(tsk,mm) do { } while (0)
@@ -211,8 +213,8 @@ static inline void disable_mmu(void)
211 * MMU control handlers for processors lacking memory 213 * MMU control handlers for processors lacking memory
212 * management hardware. 214 * management hardware.
213 */ 215 */
214#define enable_mmu() do { BUG(); } while (0) 216#define enable_mmu() do { } while (0)
215#define disable_mmu() do { BUG(); } while (0) 217#define disable_mmu() do { } while (0)
216#endif 218#endif
217 219
218#endif /* __KERNEL__ */ 220#endif /* __KERNEL__ */
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index ac4b4677f28c..7464de4ba07d 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -59,6 +59,7 @@ extern void (*clear_page)(void *to);
59extern void (*copy_page)(void *to, void *from); 59extern void (*copy_page)(void *to, void *from);
60 60
61extern unsigned long shm_align_mask; 61extern unsigned long shm_align_mask;
62extern unsigned long max_low_pfn, min_low_pfn;
62 63
63#ifdef CONFIG_MMU 64#ifdef CONFIG_MMU
64extern void clear_page_slow(void *to); 65extern void clear_page_slow(void *to);
@@ -124,17 +125,16 @@ typedef struct { unsigned long pgd; } pgd_t;
124#define PAGE_OFFSET CONFIG_PAGE_OFFSET 125#define PAGE_OFFSET CONFIG_PAGE_OFFSET
125#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) 126#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
126#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) 127#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
128#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
127 129
128#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) 130#define phys_to_page(phys) (pfn_to_page(phys >> PAGE_SHIFT))
129 131#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
130#define phys_to_page(phys) (mem_map + (((phys)-__MEMORY_START) >> PAGE_SHIFT))
131#define page_to_phys(page) (((page - mem_map) << PAGE_SHIFT) + __MEMORY_START)
132 132
133/* PFN start number, because of __MEMORY_START */ 133/* PFN start number, because of __MEMORY_START */
134#define PFN_START (__MEMORY_START >> PAGE_SHIFT) 134#define PFN_START (__MEMORY_START >> PAGE_SHIFT)
135#define ARCH_PFN_OFFSET (PFN_START) 135#define ARCH_PFN_OFFSET (PFN_START)
136#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 136#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
137#define pfn_valid(pfn) (((pfn) - PFN_START) < max_mapnr) 137#define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_low_pfn)
138#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 138#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
139 139
140#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 140#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
diff --git a/include/asm-sh/param.h b/include/asm-sh/param.h
index ce13064fec21..1012296e07ab 100644
--- a/include/asm-sh/param.h
+++ b/include/asm-sh/param.h
@@ -5,7 +5,7 @@
5# ifdef CONFIG_SH_WDT 5# ifdef CONFIG_SH_WDT
6# define HZ 1000 /* Needed for high-res WOVF */ 6# define HZ 1000 /* Needed for high-res WOVF */
7# else 7# else
8# define HZ 100 8# define HZ CONFIG_HZ
9# endif 9# endif
10# define USER_HZ 100 /* User interfaces are in "ticks" */ 10# define USER_HZ 100 /* User interfaces are in "ticks" */
11# define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ 11# define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h
index 6ccc948fe216..b1f9a9e0231e 100644
--- a/include/asm-sh/pci.h
+++ b/include/asm-sh/pci.h
@@ -35,7 +35,7 @@ extern struct pci_channel board_pci_channels[];
35/* 35/*
36 * I/O routine helpers 36 * I/O routine helpers
37 */ 37 */
38#ifdef CONFIG_CPU_SUBTYPE_SH7780 38#if defined(CONFIG_CPU_SUBTYPE_SH7780) || defined(CONFIG_CPU_SUBTYPE_SH7785)
39#define PCI_IO_AREA 0xFE400000 39#define PCI_IO_AREA 0xFE400000
40#define PCI_IO_SIZE 0x00400000 40#define PCI_IO_SIZE 0x00400000
41#else 41#else
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index 184d7fcaaf10..5b523c7e7d99 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -568,10 +568,6 @@ typedef pte_t *pte_addr_t;
568#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 568#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
569 remap_pfn_range(vma, vaddr, pfn, size, prot) 569 remap_pfn_range(vma, vaddr, pfn, size, prot)
570 570
571#define MK_IOSPACE_PFN(space, pfn) (pfn)
572#define GET_IOSPACE(pfn) 0
573#define GET_PFN(pfn) (pfn)
574
575struct mm_struct; 571struct mm_struct;
576 572
577/* 573/*
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 3e46a7afe764..d42f68e724fa 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -44,7 +44,7 @@ enum cpu_type {
44 /* SH-3 types */ 44 /* SH-3 types */
45 CPU_SH7705, CPU_SH7706, CPU_SH7707, 45 CPU_SH7705, CPU_SH7706, CPU_SH7707,
46 CPU_SH7708, CPU_SH7708S, CPU_SH7708R, 46 CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
47 CPU_SH7709, CPU_SH7709A, CPU_SH7710, 47 CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712,
48 CPU_SH7729, CPU_SH7300, 48 CPU_SH7729, CPU_SH7300,
49 49
50 /* SH-4 types */ 50 /* SH-4 types */
diff --git a/include/asm-sh/r7780rp.h b/include/asm-sh/r7780rp.h
index c18f648a7995..4083b5949928 100644
--- a/include/asm-sh/r7780rp.h
+++ b/include/asm-sh/r7780rp.h
@@ -1,17 +1,11 @@
1#ifndef __ASM_SH_RENESAS_R7780RP_H 1#ifndef __ASM_SH_RENESAS_R7780RP_H
2#define __ASM_SH_RENESAS_R7780RP_H 2#define __ASM_SH_RENESAS_R7780RP_H
3 3
4/*
5 * linux/include/asm-sh/r7780rp.h
6 *
7 * Copyright (C) 2000 Atom Create Engineering Co., Ltd.
8 *
9 * Renesas Solutions Highlander R7780RP support
10 */
11
12/* Box specific addresses. */ 4/* Box specific addresses. */
13#if defined(CONFIG_SH_R7780MP) 5#if defined(CONFIG_SH_R7780MP)
14#define PA_BCR 0xa4000000 /* FPGA */ 6#define PA_BCR 0xa4000000 /* FPGA */
7#define PA_SDPOW (-1)
8
15#define PA_IRLMSK (PA_BCR+0x0000) /* Interrupt Mask control */ 9#define PA_IRLMSK (PA_BCR+0x0000) /* Interrupt Mask control */
16#define PA_IRLMON (PA_BCR+0x0002) /* Interrupt Status control */ 10#define PA_IRLMON (PA_BCR+0x0002) /* Interrupt Status control */
17#define PA_IRLPRI1 (PA_BCR+0x0004) /* Interrupt Priorty 1 */ 11#define PA_IRLPRI1 (PA_BCR+0x0004) /* Interrupt Priorty 1 */
@@ -70,18 +64,12 @@
70#define PA_POFF (PA_BCR+0x0800) /* System Power Off control */ 64#define PA_POFF (PA_BCR+0x0800) /* System Power Off control */
71#define PA_PMR (PA_BCR+0x0900) /* */ 65#define PA_PMR (PA_BCR+0x0900) /* */
72 66
73#define PA_AX88796L 0xa4100400 /* AX88796L Area */
74#define PA_SC1602BSLB 0xa6000000 /* SC1602BSLB Area */
75#define PA_IDE_OFFSET 0x1f0 /* CF IDE Offset */
76#define AX88796L_IO_BASE 0x1000 /* AX88796L IO Base Address */
77
78#define IRLCNTR1 (PA_BCR + 0) /* Interrupt Control Register1 */ 67#define IRLCNTR1 (PA_BCR + 0) /* Interrupt Control Register1 */
79 68
80#define IRQ_PCISLOT1 65 /* PCI Slot #1 IRQ */ 69#define IRQ_PCISLOT1 65 /* PCI Slot #1 IRQ */
81#define IRQ_PCISLOT2 66 /* PCI Slot #2 IRQ */ 70#define IRQ_PCISLOT2 66 /* PCI Slot #2 IRQ */
82#define IRQ_PCISLOT3 67 /* PCI Slot #3 IRQ */ 71#define IRQ_PCISLOT3 67 /* PCI Slot #3 IRQ */
83#define IRQ_PCISLOT4 68 /* PCI Slot #4 IRQ */ 72#define IRQ_PCISLOT4 68 /* PCI Slot #4 IRQ */
84// #define IRQ_CFINST 0 /* CF Card Insert IRQ */
85#define IRQ_TP 2 /* Touch Panel IRQ */ 73#define IRQ_TP 2 /* Touch Panel IRQ */
86#define IRQ_SCI1 3 /* SCI1 IRQ */ 74#define IRQ_SCI1 3 /* SCI1 IRQ */
87#define IRQ_SCI0 4 /* SCI0 IRQ */ 75#define IRQ_SCI0 4 /* SCI0 IRQ */
@@ -95,7 +83,10 @@
95#define IRQ_ONETH 13 /* On board Ethernet IRQ */ 83#define IRQ_ONETH 13 /* On board Ethernet IRQ */
96#define IRQ_PSW 14 /* Push Switch IRQ */ 84#define IRQ_PSW 14 /* Push Switch IRQ */
97 85
98#else /* R7780RP */ 86#define IVDR_CK_ON 8 /* iVDR Clock ON */
87
88#elif defined(CONFIG_SH_R7780RP)
89#define PA_POFF (-1)
99 90
100#define PA_BCR 0xa5000000 /* FPGA */ 91#define PA_BCR 0xa5000000 /* FPGA */
101#define PA_IRLMSK (PA_BCR+0x0000) /* Interrupt Mask control */ 92#define PA_IRLMSK (PA_BCR+0x0000) /* Interrupt Mask control */
@@ -163,7 +154,60 @@
163#define IRQ_PSW 13 /* Push Switch IRQ */ 154#define IRQ_PSW 13 /* Push Switch IRQ */
164#define IRQ_ZIGBEE 14 /* Ziggbee IO IRQ */ 155#define IRQ_ZIGBEE 14 /* Ziggbee IO IRQ */
165 156
166#endif /* CONFIG_SH_R7780MP */ 157#define IVDR_CK_ON 8 /* iVDR Clock ON */
158
159#elif defined(CONFIG_SH_R7785RP)
160#define PA_BCR 0xa4000000 /* FPGA */
161#define PA_SDPOW (-1)
162
163#define PA_PCISCR (PA_BCR+0x0000)
164#define PA_IRLPRA (PA_BCR+0x0002)
165#define PA_IRLPRB (PA_BCR+0x0004)
166#define PA_IRLPRC (PA_BCR+0x0006)
167#define PA_IRLPRD (PA_BCR+0x0008)
168#define IRLCNTR1 (PA_BCR+0x0010)
169#define PA_IRLPRE (PA_BCR+0x000a)
170#define PA_IRLPRF (PA_BCR+0x000c)
171#define PA_EXIRLCR (PA_BCR+0x000e)
172#define PA_IRLMCR1 (PA_BCR+0x0010)
173#define PA_IRLMCR2 (PA_BCR+0x0012)
174#define PA_IRLSSR1 (PA_BCR+0x0014)
175#define PA_IRLSSR2 (PA_BCR+0x0016)
176#define PA_CFTCR (PA_BCR+0x0100)
177#define PA_CFPCR (PA_BCR+0x0102)
178#define PA_PCICR (PA_BCR+0x0110)
179#define PA_IVDRCTL (PA_BCR+0x0112)
180#define PA_IVDRSR (PA_BCR+0x0114)
181#define PA_PDRSTCR (PA_BCR+0x0116)
182#define PA_POFF (PA_BCR+0x0120)
183#define PA_LCDCR (PA_BCR+0x0130)
184#define PA_TPCR (PA_BCR+0x0140)
185#define PA_TPCKCR (PA_BCR+0x0142)
186#define PA_TPRSTR (PA_BCR+0x0144)
187#define PA_TPXPDR (PA_BCR+0x0146)
188#define PA_TPYPDR (PA_BCR+0x0148)
189#define PA_GPIOPFR (PA_BCR+0x0150)
190#define PA_GPIODR (PA_BCR+0x0152)
191#define PA_OBLED (PA_BCR+0x0154)
192#define PA_SWSR (PA_BCR+0x0156)
193#define PA_VERREG (PA_BCR+0x0158)
194#define PA_SMCR (PA_BCR+0x0200)
195#define PA_SMSMADR (PA_BCR+0x0202)
196#define PA_SMMR (PA_BCR+0x0204)
197#define PA_SMSADR1 (PA_BCR+0x0206)
198#define PA_SMSADR32 (PA_BCR+0x0244)
199#define PA_SMTRDR1 (PA_BCR+0x0246)
200#define PA_SMTRDR16 (PA_BCR+0x0264)
201#define PA_CU3MDR (PA_BCR+0x0300)
202#define PA_CU5MDR (PA_BCR+0x0302)
203#define PA_MMSR (PA_BCR+0x0400)
204
205#define IVDR_CK_ON 4 /* iVDR Clock ON */
206
207#endif
208
209void make_r7780rp_irq(unsigned int irq);
210void highlander_init_irq(void);
167 211
168#define __IO_PREFIX r7780rp 212#define __IO_PREFIX r7780rp
169#include <asm/io_generic.h> 213#include <asm/io_generic.h>
diff --git a/include/asm-sh/se.h b/include/asm-sh/se.h
index a1832154a3aa..bd2596c014a9 100644
--- a/include/asm-sh/se.h
+++ b/include/asm-sh/se.h
@@ -69,9 +69,11 @@
69#define BCR_ILCRG (PA_BCR + 12) 69#define BCR_ILCRG (PA_BCR + 12)
70 70
71#if defined(CONFIG_CPU_SUBTYPE_SH7705) 71#if defined(CONFIG_CPU_SUBTYPE_SH7705)
72#define IRQ_STNIC 12 72#define IRQ_STNIC 12
73#define IRQ_CFCARD 14
73#else 74#else
74#define IRQ_STNIC 10 75#define IRQ_STNIC 10
76#define IRQ_CFCARD 7
75#endif 77#endif
76 78
77#define __IO_PREFIX se 79#define __IO_PREFIX se
diff --git a/include/asm-sh/se7722.h b/include/asm-sh/se7722.h
new file mode 100644
index 000000000000..b3b31e4725c6
--- /dev/null
+++ b/include/asm-sh/se7722.h
@@ -0,0 +1,118 @@
1#ifndef __ASM_SH_SE7722_H
2#define __ASM_SH_SE7722_H
3
4/*
5 * linux/include/asm-sh/se7722.h
6 *
7 * Copyright (C) 2007 Nobuhiro Iwamatsu
8 *
9 * Hitachi UL SolutionEngine 7722 Support.
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 *
15 */
16#include <asm/addrspace.h>
17
18/* Box specific addresses. */
19#define SE_AREA0_WIDTH 4 /* Area0: 32bit */
20#define PA_ROM 0xa0000000 /* EPROM */
21#define PA_ROM_SIZE 0x00200000 /* EPROM size 2M byte */
22#define PA_FROM 0xa1000000 /* Flash-ROM */
23#define PA_FROM_SIZE 0x01000000 /* Flash-ROM size 16M byte */
24#define PA_EXT1 0xa4000000
25#define PA_EXT1_SIZE 0x04000000
26#define PA_SDRAM 0xaC000000 /* DDR-SDRAM(Area3) 64MB */
27#define PA_SDRAM_SIZE 0x04000000
28
29#define PA_EXT4 0xb0000000
30#define PA_EXT4_SIZE 0x04000000
31
32#define PA_PERIPHERAL 0xB0000000
33
34#define PA_PCIC PA_PERIPHERAL /* MR-SHPC-01 PCMCIA */
35#define PA_MRSHPC (PA_PERIPHERAL + 0x003fffe0) /* MR-SHPC-01 PCMCIA controller */
36#define PA_MRSHPC_MW1 (PA_PERIPHERAL + 0x00400000) /* MR-SHPC-01 memory window base */
37#define PA_MRSHPC_MW2 (PA_PERIPHERAL + 0x00500000) /* MR-SHPC-01 attribute window base */
38#define PA_MRSHPC_IO (PA_PERIPHERAL + 0x00600000) /* MR-SHPC-01 I/O window base */
39#define MRSHPC_OPTION (PA_MRSHPC + 6)
40#define MRSHPC_CSR (PA_MRSHPC + 8)
41#define MRSHPC_ISR (PA_MRSHPC + 10)
42#define MRSHPC_ICR (PA_MRSHPC + 12)
43#define MRSHPC_CPWCR (PA_MRSHPC + 14)
44#define MRSHPC_MW0CR1 (PA_MRSHPC + 16)
45#define MRSHPC_MW1CR1 (PA_MRSHPC + 18)
46#define MRSHPC_IOWCR1 (PA_MRSHPC + 20)
47#define MRSHPC_MW0CR2 (PA_MRSHPC + 22)
48#define MRSHPC_MW1CR2 (PA_MRSHPC + 24)
49#define MRSHPC_IOWCR2 (PA_MRSHPC + 26)
50#define MRSHPC_CDCR (PA_MRSHPC + 28)
51#define MRSHPC_PCIC_INFO (PA_MRSHPC + 30)
52
53#define PA_LED (PA_PERIPHERAL + 0x00800000) /* 8bit LED */
54#define PA_FPGA (PA_PERIPHERAL + 0x01800000) /* FPGA base address */
55
56#define PA_LAN (PA_AREA6_IO + 0) /* SMC LAN91C111 */
57/* GPIO */
58#define MSTPCR0 0xA4150030UL
59#define MSTPCR1 0xA4150034UL
60#define MSTPCR2 0xA4150038UL
61
62#define FPGA_IN 0xb1840000UL
63#define FPGA_OUT 0xb1840004UL
64
65#define PORT_PECR 0xA4050108UL
66#define PORT_PJCR 0xA4050110UL
67#define PORT_PSELD 0xA4050154UL
68#define PORT_PSELB 0xA4050150UL
69
70#define PORT_PSELC 0xA4050152UL
71#define PORT_PKCR 0xA4050112UL
72#define PORT_PHCR 0xA405010EUL
73#define PORT_PLCR 0xA4050114UL
74#define PORT_PMCR 0xA4050116UL
75#define PORT_PRCR 0xA405011CUL
76#define PORT_PXCR 0xA4050148UL
77#define PORT_PSELA 0xA405014EUL
78#define PORT_PYCR 0xA405014AUL
79#define PORT_PZCR 0xA405014CUL
80
81/* IRQ */
82#define IRQ0_IRQ 32
83#define IRQ1_IRQ 33
84#define INTC_ICR0 0xA4140000UL
85#define INTC_ICR1 0xA414001CUL
86
87#define INTMSK0 0xa4140044
88#define INTMSKCLR0 0xa4140064
89#define INTC_INTPRI0 0xa4140010
90
91#define IRQ01_MODE 0xb1800000
92#define IRQ01_STS 0xb1800004
93#define IRQ01_MASK 0xb1800008
94#define EXT_BIT (0x3fc0) /* SH IRQ1 */
95#define MRSHPC_BIT0 (0x0004) /* SH IRQ1 */
96#define MRSHPC_BIT1 (0x0008) /* SH IRQ1 */
97#define MRSHPC_BIT2 (0x0010) /* SH IRQ1 */
98#define MRSHPC_BIT3 (0x0020) /* SH IRQ1 */
99#define SMC_BIT (0x0002) /* SH IRQ0 */
100#define USB_BIT (0x0001) /* SH IRQ0 */
101
102#define MRSHPC_IRQ3 11
103#define MRSHPC_IRQ2 12
104#define MRSHPC_IRQ1 13
105#define MRSHPC_IRQ0 14
106#define SMC_IRQ 10
107#define EXT_IRQ 5
108#define USB_IRQ 6
109
110
111/* arch/sh/boards/se/7722/irq.c */
112void init_se7722_IRQ(void);
113int se7722_irq_demux(int);
114
115#define __IO_PREFIX se7722
116#include <asm/io_generic.h>
117
118#endif /* __ASM_SH_SE7722_H */
diff --git a/include/asm-sh/se7751.h b/include/asm-sh/se7751.h
index 88cd379d9084..02ca9347f043 100644
--- a/include/asm-sh/se7751.h
+++ b/include/asm-sh/se7751.h
@@ -65,6 +65,8 @@
65 65
66#define IRQ_79C973 13 66#define IRQ_79C973 13
67 67
68void init_7751se_IRQ(void);
69
68#define __IO_PREFIX sh7751se 70#define __IO_PREFIX sh7751se
69#include <asm/io_generic.h> 71#include <asm/io_generic.h>
70 72
diff --git a/include/asm-sh/se7780.h b/include/asm-sh/se7780.h
new file mode 100644
index 000000000000..40e9b41458cd
--- /dev/null
+++ b/include/asm-sh/se7780.h
@@ -0,0 +1,108 @@
1#ifndef __ASM_SH_SE7780_H
2#define __ASM_SH_SE7780_H
3
4/*
5 * linux/include/asm-sh/se7780.h
6 *
7 * Copyright (C) 2006,2007 Nobuhiro Iwamatsu
8 *
9 * Hitachi UL SolutionEngine 7780 Support.
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 */
15#include <asm/addrspace.h>
16
17/* Box specific addresses. */
18#define SE_AREA0_WIDTH 4 /* Area0: 32bit */
19#define PA_ROM 0xa0000000 /* EPROM */
20#define PA_ROM_SIZE 0x00400000 /* EPROM size 4M byte */
21#define PA_FROM 0xa1000000 /* Flash-ROM */
22#define PA_FROM_SIZE 0x01000000 /* Flash-ROM size 16M byte */
23#define PA_EXT1 0xa4000000
24#define PA_EXT1_SIZE 0x04000000
25#define PA_SM501 PA_EXT1 /* Graphic IC (SM501) */
26#define PA_SM501_SIZE PA_EXT1_SIZE /* Graphic IC (SM501) */
27#define PA_SDRAM 0xa8000000 /* DDR-SDRAM(Area2/3) 128MB */
28#define PA_SDRAM_SIZE 0x08000000
29
30#define PA_EXT4 0xb0000000
31#define PA_EXT4_SIZE 0x04000000
32#define PA_EXT_FLASH PA_EXT4 /* Expansion Flash-ROM */
33
34#define PA_PERIPHERAL PA_AREA6_IO /* SW6-6=ON */
35
36#define PA_LAN (PA_PERIPHERAL + 0) /* SMC LAN91C111 */
37#define PA_LED_DISP (PA_PERIPHERAL + 0x02000000) /* 8words LED Display */
38#define DISP_CHAR_RAM (7 << 3)
39#define DISP_SEL0_ADDR (DISP_CHAR_RAM + 0)
40#define DISP_SEL1_ADDR (DISP_CHAR_RAM + 1)
41#define DISP_SEL2_ADDR (DISP_CHAR_RAM + 2)
42#define DISP_SEL3_ADDR (DISP_CHAR_RAM + 3)
43#define DISP_SEL4_ADDR (DISP_CHAR_RAM + 4)
44#define DISP_SEL5_ADDR (DISP_CHAR_RAM + 5)
45#define DISP_SEL6_ADDR (DISP_CHAR_RAM + 6)
46#define DISP_SEL7_ADDR (DISP_CHAR_RAM + 7)
47
48#define DISP_UDC_RAM (5 << 3)
49#define PA_FPGA (PA_PERIPHERAL + 0x03000000) /* FPGA base address */
50
51/* FPGA register address and bit */
52#define FPGA_SFTRST (PA_FPGA + 0) /* Soft reset register */
53#define FPGA_INTMSK1 (PA_FPGA + 2) /* Interrupt Mask register 1 */
54#define FPGA_INTMSK2 (PA_FPGA + 4) /* Interrupt Mask register 2 */
55#define FPGA_INTSEL1 (PA_FPGA + 6) /* Interrupt select register 1 */
56#define FPGA_INTSEL2 (PA_FPGA + 8) /* Interrupt select register 2 */
57#define FPGA_INTSEL3 (PA_FPGA + 10) /* Interrupt select register 3 */
58#define FPGA_PCI_INTSEL1 (PA_FPGA + 12) /* PCI Interrupt select register 1 */
59#define FPGA_PCI_INTSEL2 (PA_FPGA + 14) /* PCI Interrupt select register 2 */
60#define FPGA_INTSET (PA_FPGA + 16) /* IRQ/IRL select register */
61#define FPGA_INTSTS1 (PA_FPGA + 18) /* Interrupt status register 1 */
62#define FPGA_INTSTS2 (PA_FPGA + 20) /* Interrupt status register 2 */
63#define FPGA_REQSEL (PA_FPGA + 22) /* REQ/GNT select register */
64#define FPGA_DBG_LED (PA_FPGA + 32) /* Debug LED(D-LED[8:1] */
65#define PA_LED FPGA_DBG_LED
66#define FPGA_IVDRID (PA_FPGA + 36) /* iVDR ID Register */
67#define FPGA_IVDRPW (PA_FPGA + 38) /* iVDR Power ON Register */
68#define FPGA_MMCID (PA_FPGA + 40) /* MMC ID Register */
69
70/* FPGA INTSEL position */
71/* INTSEL1 */
72#define IRQPOS_SMC91CX (0 * 4)
73#define IRQPOS_SM501 (1 * 4)
74/* INTSEL2 */
75#define IRQPOS_EXTINT1 (0 * 4)
76#define IRQPOS_EXTINT2 (1 * 4)
77#define IRQPOS_EXTINT3 (2 * 4)
78#define IRQPOS_EXTINT4 (3 * 4)
79/* INTSEL3 */
80#define IRQPOS_PCCPW (0 * 4)
81
82/* IDE interrupt */
83#define IRQ_IDE0 67 /* iVDR */
84
85/* SMC interrupt */
86#define SMC_IRQ 8
87
88/* SM501 interrupt */
89#define SM501_IRQ 0
90
91/* interrupt pin */
92#define IRQPIN_EXTINT1 0 /* IRQ0 pin */
93#define IRQPIN_EXTINT2 1 /* IRQ1 pin */
94#define IRQPIN_EXTINT3 2 /* IRQ2 pin */
95#define IRQPIN_SMC91CX 3 /* IRQ3 pin */
96#define IRQPIN_EXTINT4 4 /* IRQ4 pin */
97#define IRQPIN_PCC0 5 /* IRQ5 pin */
98#define IRQPIN_PCC2 6 /* IRQ6 pin */
99#define IRQPIN_SM501 7 /* IRQ7 pin */
100#define IRQPIN_PCCPW 7 /* IRQ7 pin */
101
102/* arch/sh/boards/se/7780/irq.c */
103void init_se7780_IRQ(void);
104
105#define __IO_PREFIX se7780
106#include <asm/io_generic.h>
107
108#endif /* __ASM_SH_SE7780_H */
diff --git a/include/asm-sh/stat.h b/include/asm-sh/stat.h
index 6c41a60657f1..6d6ad26e3a2a 100644
--- a/include/asm-sh/stat.h
+++ b/include/asm-sh/stat.h
@@ -16,15 +16,13 @@ struct __old_kernel_stat {
16}; 16};
17 17
18struct stat { 18struct stat {
19 unsigned short st_dev; 19 unsigned long st_dev;
20 unsigned short __pad1; 20 unsigned long st_ino;
21 unsigned long st_ino;
22 unsigned short st_mode; 21 unsigned short st_mode;
23 unsigned short st_nlink; 22 unsigned short st_nlink;
24 unsigned short st_uid; 23 unsigned short st_uid;
25 unsigned short st_gid; 24 unsigned short st_gid;
26 unsigned short st_rdev; 25 unsigned long st_rdev;
27 unsigned short __pad2;
28 unsigned long st_size; 26 unsigned long st_size;
29 unsigned long st_blksize; 27 unsigned long st_blksize;
30 unsigned long st_blocks; 28 unsigned long st_blocks;
@@ -38,8 +36,6 @@ struct stat {
38 unsigned long __unused5; 36 unsigned long __unused5;
39}; 37};
40 38
41#define STAT_HAVE_NSEC 1
42
43/* This matches struct stat64 in glibc2.1, hence the absolutely 39/* This matches struct stat64 in glibc2.1, hence the absolutely
44 * insane amounts of padding around dev_t's. 40 * insane amounts of padding around dev_t's.
45 */ 41 */
@@ -47,7 +43,9 @@ struct stat64 {
47 unsigned long long st_dev; 43 unsigned long long st_dev;
48 unsigned char __pad0[4]; 44 unsigned char __pad0[4];
49 45
50 unsigned long st_ino; 46#define STAT64_HAS_BROKEN_ST_INO 1
47 unsigned long __st_ino;
48
51 unsigned int st_mode; 49 unsigned int st_mode;
52 unsigned int st_nlink; 50 unsigned int st_nlink;
53 51
@@ -71,8 +69,9 @@ struct stat64 {
71 unsigned long st_ctime; 69 unsigned long st_ctime;
72 unsigned long st_ctime_nsec; 70 unsigned long st_ctime_nsec;
73 71
74 unsigned long __unused1; 72 unsigned long long st_ino;
75 unsigned long __unused2;
76}; 73};
77 74
75#define STAT_HAVE_NSEC 1
76
78#endif /* __ASM_SH_STAT_H */ 77#endif /* __ASM_SH_STAT_H */
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 4a6a19f4f8a4..e7e96ee0c8a5 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -9,6 +9,7 @@
9#include <linux/irqflags.h> 9#include <linux/irqflags.h>
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <asm/types.h> 11#include <asm/types.h>
12#include <asm/ptrace.h>
12 13
13/* 14/*
14 * switch_to() should switch tasks to task nr n, first 15 * switch_to() should switch tasks to task nr n, first
@@ -81,16 +82,6 @@ static inline void sched_cacheflush(void)
81} 82}
82#endif 83#endif
83 84
84static inline unsigned long tas(volatile int *m)
85{
86 unsigned long retval;
87
88 __asm__ __volatile__ ("tas.b @%1\n\t"
89 "movt %0"
90 : "=r" (retval): "r" (m): "t", "memory");
91 return retval;
92}
93
94/* 85/*
95 * A brief note on ctrl_barrier(), the control register write barrier. 86 * A brief note on ctrl_barrier(), the control register write barrier.
96 * 87 *
@@ -255,6 +246,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
255 (unsigned long)_n_, sizeof(*(ptr))); \ 246 (unsigned long)_n_, sizeof(*(ptr))); \
256 }) 247 })
257 248
249extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn));
250
258extern void *set_exception_table_vec(unsigned int vec, void *handler); 251extern void *set_exception_table_vec(unsigned int vec, void *handler);
259 252
260static inline void *set_exception_table_evt(unsigned int evt, void *handler) 253static inline void *set_exception_table_evt(unsigned int evt, void *handler)
diff --git a/include/asm-sh64/kdebug.h b/include/asm-sh64/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-sh64/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h
index 6b97c4cb1d64..b875482eb592 100644
--- a/include/asm-sh64/pgtable.h
+++ b/include/asm-sh64/pgtable.h
@@ -485,10 +485,6 @@ extern void update_mmu_cache(struct vm_area_struct * vma,
485#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 485#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
486 remap_pfn_range(vma, vaddr, pfn, size, prot) 486 remap_pfn_range(vma, vaddr, pfn, size, prot)
487 487
488#define MK_IOSPACE_PFN(space, pfn) (pfn)
489#define GET_IOSPACE(pfn) 0
490#define GET_PFN(pfn) (pfn)
491
492#endif /* !__ASSEMBLY__ */ 488#endif /* !__ASSEMBLY__ */
493 489
494/* 490/*
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h
index b1598c26fcb0..5ff94644e8c8 100644
--- a/include/asm-sh64/system.h
+++ b/include/asm-sh64/system.h
@@ -43,8 +43,6 @@ extern struct task_struct *sh64_switch_to(struct task_struct *prev,
43 43
44#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 44#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
45 45
46#define tas(ptr) (xchg((ptr), 1))
47
48extern void __xchg_called_with_bad_pointer(void); 46extern void __xchg_called_with_bad_pointer(void);
49 47
50#define mb() __asm__ __volatile__ ("synco": : :"memory") 48#define mb() __asm__ __volatile__ ("synco": : :"memory")
diff --git a/include/asm-sparc/kdebug.h b/include/asm-sparc/kdebug.h
index fba92485fdba..404d80767323 100644
--- a/include/asm-sparc/kdebug.h
+++ b/include/asm-sparc/kdebug.h
@@ -66,4 +66,8 @@ static inline void sp_enter_debugger(void)
66#define KDEBUG_DUNNO2_OFF 0x8 66#define KDEBUG_DUNNO2_OFF 0x8
67#define KDEBUG_TEACH_OFF 0xc 67#define KDEBUG_TEACH_OFF 0xc
68 68
69enum die_val {
70 DIE_UNUSED,
71};
72
69#endif /* !(_SPARC_KDEBUG_H) */ 73#endif /* !(_SPARC_KDEBUG_H) */
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 100c3eaf3c1f..8b6d9c9c8b93 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -241,7 +241,6 @@ static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned lon
241} 241}
242 242
243#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 243#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
244#define tas(ptr) (xchg((ptr),1))
245 244
246extern void __xchg_called_with_bad_pointer(void); 245extern void __xchg_called_with_bad_pointer(void);
247 246
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild
index a7f44408c93b..854fd3a65acf 100644
--- a/include/asm-sparc64/Kbuild
+++ b/include/asm-sparc64/Kbuild
@@ -8,7 +8,6 @@ header-y += apb.h
8header-y += asi.h 8header-y += asi.h
9header-y += bbc.h 9header-y += bbc.h
10header-y += bpp.h 10header-y += bpp.h
11header-y += const.h
12header-y += display7seg.h 11header-y += display7seg.h
13header-y += envctrl.h 12header-y += envctrl.h
14header-y += ipc.h 13header-y += ipc.h
diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h
index 2f0bec26a695..3fb4e1f7f186 100644
--- a/include/asm-sparc64/atomic.h
+++ b/include/asm-sparc64/atomic.h
@@ -9,6 +9,7 @@
9#define __ARCH_SPARC64_ATOMIC__ 9#define __ARCH_SPARC64_ATOMIC__
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <asm/system.h>
12 13
13typedef struct { volatile int counter; } atomic_t; 14typedef struct { volatile int counter; } atomic_t;
14typedef struct { volatile __s64 counter; } atomic64_t; 15typedef struct { volatile __s64 counter; } atomic64_t;
@@ -70,25 +71,47 @@ extern int atomic64_sub_ret(int, atomic64_t *);
70#define atomic_add_negative(i, v) (atomic_add_ret(i, v) < 0) 71#define atomic_add_negative(i, v) (atomic_add_ret(i, v) < 0)
71#define atomic64_add_negative(i, v) (atomic64_add_ret(i, v) < 0) 72#define atomic64_add_negative(i, v) (atomic64_add_ret(i, v) < 0)
72 73
73#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) 74#define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
74#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 75#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
75 76
76#define atomic_add_unless(v, a, u) \ 77static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
77({ \ 78{
78 int c, old; \ 79 int c, old;
79 c = atomic_read(v); \ 80 c = atomic_read(v);
80 for (;;) { \ 81 for (;;) {
81 if (unlikely(c == (u))) \ 82 if (unlikely(c == (u)))
82 break; \ 83 break;
83 old = atomic_cmpxchg((v), c, c + (a)); \ 84 old = atomic_cmpxchg((v), c, c + (a));
84 if (likely(old == c)) \ 85 if (likely(old == c))
85 break; \ 86 break;
86 c = old; \ 87 c = old;
87 } \ 88 }
88 likely(c != (u)); \ 89 return c != (u);
89}) 90}
91
90#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 92#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
91 93
94#define atomic64_cmpxchg(v, o, n) \
95 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
96#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
97
98static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
99{
100 long c, old;
101 c = atomic64_read(v);
102 for (;;) {
103 if (unlikely(c == (u)))
104 break;
105 old = atomic64_cmpxchg((v), c, c + (a));
106 if (likely(old == c))
107 break;
108 c = old;
109 }
110 return c != (u);
111}
112
113#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
114
92/* Atomic operations are already serializing */ 115/* Atomic operations are already serializing */
93#ifdef CONFIG_SMP 116#ifdef CONFIG_SMP
94#define smp_mb__before_atomic_dec() membar_storeload_loadload(); 117#define smp_mb__before_atomic_dec() membar_storeload_loadload();
diff --git a/include/asm-sparc64/const.h b/include/asm-sparc64/const.h
deleted file mode 100644
index 8ad902b2ce04..000000000000
--- a/include/asm-sparc64/const.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/* const.h: Macros for dealing with constants. */
2
3#ifndef _SPARC64_CONST_H
4#define _SPARC64_CONST_H
5
6/* Some constant macros are used in both assembler and
7 * C code. Therefore we cannot annotate them always with
8 * 'UL' and other type specificers unilaterally. We
9 * use the following macros to deal with this.
10 */
11
12#ifdef __ASSEMBLY__
13#define _AC(X,Y) X
14#else
15#define _AC(X,Y) (X##Y)
16#endif
17
18
19#endif /* !(_SPARC64_CONST_H) */
diff --git a/include/asm-sparc64/iommu.h b/include/asm-sparc64/iommu.h
index e199594a1e9b..0b1813f41045 100644
--- a/include/asm-sparc64/iommu.h
+++ b/include/asm-sparc64/iommu.h
@@ -32,6 +32,7 @@ struct iommu {
32 unsigned long iommu_control; 32 unsigned long iommu_control;
33 unsigned long iommu_tsbbase; 33 unsigned long iommu_tsbbase;
34 unsigned long iommu_flush; 34 unsigned long iommu_flush;
35 unsigned long iommu_flushinv;
35 unsigned long iommu_ctxflush; 36 unsigned long iommu_ctxflush;
36 unsigned long write_complete_reg; 37 unsigned long write_complete_reg;
37 unsigned long dummy_page; 38 unsigned long dummy_page;
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h
index 11251bdd00cb..f8032e73f384 100644
--- a/include/asm-sparc64/kdebug.h
+++ b/include/asm-sparc64/kdebug.h
@@ -7,19 +7,8 @@
7 7
8struct pt_regs; 8struct pt_regs;
9 9
10struct die_args {
11 struct pt_regs *regs;
12 const char *str;
13 long err;
14 int trapnr;
15 int signr;
16};
17
18extern int register_die_notifier(struct notifier_block *);
19extern int unregister_die_notifier(struct notifier_block *);
20extern int register_page_fault_notifier(struct notifier_block *); 10extern int register_page_fault_notifier(struct notifier_block *);
21extern int unregister_page_fault_notifier(struct notifier_block *); 11extern int unregister_page_fault_notifier(struct notifier_block *);
22extern struct atomic_notifier_head sparc64die_chain;
23 12
24extern void bad_trap(struct pt_regs *, long); 13extern void bad_trap(struct pt_regs *, long);
25 14
@@ -36,16 +25,4 @@ enum die_val {
36 DIE_PAGE_FAULT, 25 DIE_PAGE_FAULT,
37}; 26};
38 27
39static inline int notify_die(enum die_val val,char *str, struct pt_regs *regs,
40 long err, int trap, int sig)
41{
42 struct die_args args = { .regs = regs,
43 .str = str,
44 .err = err,
45 .trapnr = trap,
46 .signr = sig };
47
48 return atomic_notifier_call_chain(&sparc64die_chain, val, &args);
49}
50
51#endif 28#endif
diff --git a/include/asm-sparc64/local.h b/include/asm-sparc64/local.h
index dfde115ac892..c11c530f74d0 100644
--- a/include/asm-sparc64/local.h
+++ b/include/asm-sparc64/local.h
@@ -1,40 +1 @@
1#ifndef _ARCH_SPARC64_LOCAL_H #include <asm-generic/local.h>
2#define _ARCH_SPARC64_LOCAL_H
3
4#include <linux/percpu.h>
5#include <asm/atomic.h>
6
7typedef atomic64_t local_t;
8
9#define LOCAL_INIT(i) ATOMIC64_INIT(i)
10#define local_read(v) atomic64_read(v)
11#define local_set(v,i) atomic64_set(v,i)
12
13#define local_inc(v) atomic64_inc(v)
14#define local_dec(v) atomic64_dec(v)
15#define local_add(i, v) atomic64_add(i, v)
16#define local_sub(i, v) atomic64_sub(i, v)
17
18#define __local_inc(v) ((v)->counter++)
19#define __local_dec(v) ((v)->counter--)
20#define __local_add(i,v) ((v)->counter+=(i))
21#define __local_sub(i,v) ((v)->counter-=(i))
22
23/* Use these for per-cpu local_t variables: on some archs they are
24 * much more efficient than these naive implementations. Note they take
25 * a variable, not an address.
26 */
27#define cpu_local_read(v) local_read(&__get_cpu_var(v))
28#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i))
29
30#define cpu_local_inc(v) local_inc(&__get_cpu_var(v))
31#define cpu_local_dec(v) local_dec(&__get_cpu_var(v))
32#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v))
33#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v))
34
35#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v))
36#define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v))
37#define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v))
38#define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v))
39
40#endif /* _ARCH_SPARC64_LOCAL_H */
diff --git a/include/asm-sparc64/lsu.h b/include/asm-sparc64/lsu.h
index e5329c7f5833..79f109840c39 100644
--- a/include/asm-sparc64/lsu.h
+++ b/include/asm-sparc64/lsu.h
@@ -2,7 +2,7 @@
2#ifndef _SPARC64_LSU_H 2#ifndef _SPARC64_LSU_H
3#define _SPARC64_LSU_H 3#define _SPARC64_LSU_H
4 4
5#include <asm/const.h> 5#include <linux/const.h>
6 6
7/* LSU Control Register */ 7/* LSU Control Register */
8#define LSU_CONTROL_PM _AC(0x000001fe00000000,UL) /* Phys-watchpoint byte mask*/ 8#define LSU_CONTROL_PM _AC(0x000001fe00000000,UL) /* Phys-watchpoint byte mask*/
diff --git a/include/asm-sparc64/mmu.h b/include/asm-sparc64/mmu.h
index 70af4b6ce136..8abc58f0f9d7 100644
--- a/include/asm-sparc64/mmu.h
+++ b/include/asm-sparc64/mmu.h
@@ -1,8 +1,8 @@
1#ifndef __MMU_H 1#ifndef __MMU_H
2#define __MMU_H 2#define __MMU_H
3 3
4#include <linux/const.h>
4#include <asm/page.h> 5#include <asm/page.h>
5#include <asm/const.h>
6#include <asm/hypervisor.h> 6#include <asm/hypervisor.h>
7 7
8#define CTX_NR_BITS 13 8#define CTX_NR_BITS 13
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index ff736eafa64d..7af1077451ff 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -5,7 +5,7 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8#include <asm/const.h> 8#include <linux/const.h>
9 9
10#if defined(CONFIG_SPARC64_PAGE_SIZE_8KB) 10#if defined(CONFIG_SPARC64_PAGE_SIZE_8KB)
11#define PAGE_SHIFT 13 11#define PAGE_SHIFT 13
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
index 5891ff7ba760..5d66b858a965 100644
--- a/include/asm-sparc64/pgalloc.h
+++ b/include/asm-sparc64/pgalloc.h
@@ -6,6 +6,7 @@
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/mm.h> 7#include <linux/mm.h>
8#include <linux/slab.h> 8#include <linux/slab.h>
9#include <linux/quicklist.h>
9 10
10#include <asm/spitfire.h> 11#include <asm/spitfire.h>
11#include <asm/cpudata.h> 12#include <asm/cpudata.h>
@@ -13,52 +14,50 @@
13#include <asm/page.h> 14#include <asm/page.h>
14 15
15/* Page table allocation/freeing. */ 16/* Page table allocation/freeing. */
16extern struct kmem_cache *pgtable_cache;
17 17
18static inline pgd_t *pgd_alloc(struct mm_struct *mm) 18static inline pgd_t *pgd_alloc(struct mm_struct *mm)
19{ 19{
20 return kmem_cache_alloc(pgtable_cache, GFP_KERNEL); 20 return quicklist_alloc(0, GFP_KERNEL, NULL);
21} 21}
22 22
23static inline void pgd_free(pgd_t *pgd) 23static inline void pgd_free(pgd_t *pgd)
24{ 24{
25 kmem_cache_free(pgtable_cache, pgd); 25 quicklist_free(0, NULL, pgd);
26} 26}
27 27
28#define pud_populate(MM, PUD, PMD) pud_set(PUD, PMD) 28#define pud_populate(MM, PUD, PMD) pud_set(PUD, PMD)
29 29
30static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) 30static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
31{ 31{
32 return kmem_cache_alloc(pgtable_cache, 32 return quicklist_alloc(0, GFP_KERNEL, NULL);
33 GFP_KERNEL|__GFP_REPEAT);
34} 33}
35 34
36static inline void pmd_free(pmd_t *pmd) 35static inline void pmd_free(pmd_t *pmd)
37{ 36{
38 kmem_cache_free(pgtable_cache, pmd); 37 quicklist_free(0, NULL, pmd);
39} 38}
40 39
41static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 40static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
42 unsigned long address) 41 unsigned long address)
43{ 42{
44 return kmem_cache_alloc(pgtable_cache, 43 return quicklist_alloc(0, GFP_KERNEL, NULL);
45 GFP_KERNEL|__GFP_REPEAT);
46} 44}
47 45
48static inline struct page *pte_alloc_one(struct mm_struct *mm, 46static inline struct page *pte_alloc_one(struct mm_struct *mm,
49 unsigned long address) 47 unsigned long address)
50{ 48{
51 return virt_to_page(pte_alloc_one_kernel(mm, address)); 49 void *pg = quicklist_alloc(0, GFP_KERNEL, NULL);
50 return pg ? virt_to_page(pg) : NULL;
52} 51}
53 52
54static inline void pte_free_kernel(pte_t *pte) 53static inline void pte_free_kernel(pte_t *pte)
55{ 54{
56 kmem_cache_free(pgtable_cache, pte); 55 quicklist_free(0, NULL, pte);
57} 56}
58 57
59static inline void pte_free(struct page *ptepage) 58static inline void pte_free(struct page *ptepage)
60{ 59{
61 pte_free_kernel(page_address(ptepage)); 60 quicklist_free_page(0, NULL, ptepage);
62} 61}
63 62
64 63
@@ -66,6 +65,9 @@ static inline void pte_free(struct page *ptepage)
66#define pmd_populate(MM,PMD,PTE_PAGE) \ 65#define pmd_populate(MM,PMD,PTE_PAGE) \
67 pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) 66 pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE))
68 67
69#define check_pgt_cache() do { } while (0) 68static inline void check_pgt_cache(void)
69{
70 quicklist_trim(0, NULL, 25, 16);
71}
70 72
71#endif /* _SPARC64_PGALLOC_H */ 73#endif /* _SPARC64_PGALLOC_H */
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 46705ef47d27..9e80ad43b29c 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -15,13 +15,13 @@
15#include <asm-generic/pgtable-nopud.h> 15#include <asm-generic/pgtable-nopud.h>
16 16
17#include <linux/compiler.h> 17#include <linux/compiler.h>
18#include <linux/const.h>
18#include <asm/types.h> 19#include <asm/types.h>
19#include <asm/spitfire.h> 20#include <asm/spitfire.h>
20#include <asm/asi.h> 21#include <asm/asi.h>
21#include <asm/system.h> 22#include <asm/system.h>
22#include <asm/page.h> 23#include <asm/page.h>
23#include <asm/processor.h> 24#include <asm/processor.h>
24#include <asm/const.h>
25 25
26/* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 32MB). 26/* The kernel image occupies 0x4000000 to 0x1000000 (4MB --> 32MB).
27 * The page copy blockops can use 0x2000000 to 0x4000000. 27 * The page copy blockops can use 0x2000000 to 0x4000000.
diff --git a/include/asm-sparc64/pstate.h b/include/asm-sparc64/pstate.h
index 49a7924a89ab..f3c45484c636 100644
--- a/include/asm-sparc64/pstate.h
+++ b/include/asm-sparc64/pstate.h
@@ -2,7 +2,7 @@
2#ifndef _SPARC64_PSTATE_H 2#ifndef _SPARC64_PSTATE_H
3#define _SPARC64_PSTATE_H 3#define _SPARC64_PSTATE_H
4 4
5#include <asm/const.h> 5#include <linux/const.h>
6 6
7/* The V9 PSTATE Register (with SpitFire extensions). 7/* The V9 PSTATE Register (with SpitFire extensions).
8 * 8 *
diff --git a/include/asm-sparc64/sfafsr.h b/include/asm-sparc64/sfafsr.h
index 2f792c20b53c..e96137b04a4f 100644
--- a/include/asm-sparc64/sfafsr.h
+++ b/include/asm-sparc64/sfafsr.h
@@ -1,7 +1,7 @@
1#ifndef _SPARC64_SFAFSR_H 1#ifndef _SPARC64_SFAFSR_H
2#define _SPARC64_SFAFSR_H 2#define _SPARC64_SFAFSR_H
3 3
4#include <asm/const.h> 4#include <linux/const.h>
5 5
6/* Spitfire Asynchronous Fault Status register, ASI=0x4C VA<63:0>=0x0 */ 6/* Spitfire Asynchronous Fault Status register, ASI=0x4C VA<63:0>=0x0 */
7 7
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 32281acb878b..8ba380ec6daa 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -253,7 +253,6 @@ static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long
253} 253}
254 254
255#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 255#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
256#define tas(ptr) (xchg((ptr),1))
257 256
258extern void __xchg_called_with_bad_pointer(void); 257extern void __xchg_called_with_bad_pointer(void);
259 258
diff --git a/include/asm-um/cmpxchg.h b/include/asm-um/cmpxchg.h
new file mode 100644
index 000000000000..529376a99885
--- /dev/null
+++ b/include/asm-um/cmpxchg.h
@@ -0,0 +1,6 @@
1#ifndef __UM_CMPXCHG_H
2#define __UM_CMPXCHG_H
3
4#include "asm/arch/cmpxchg.h"
5
6#endif
diff --git a/include/asm-um/kdebug.h b/include/asm-um/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-um/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-um/page.h b/include/asm-um/page.h
index 4296d3135aa9..8e310d81e5b4 100644
--- a/include/asm-um/page.h
+++ b/include/asm-um/page.h
@@ -114,9 +114,6 @@ extern unsigned long uml_physmem;
114extern struct page *arch_validate(struct page *page, gfp_t mask, int order); 114extern struct page *arch_validate(struct page *page, gfp_t mask, int order);
115#define HAVE_ARCH_VALIDATE 115#define HAVE_ARCH_VALIDATE
116 116
117extern void arch_free_page(struct page *page, int order);
118#define HAVE_ARCH_FREE_PAGE
119
120#include <asm-generic/memory_model.h> 117#include <asm-generic/memory_model.h>
121#include <asm-generic/page.h> 118#include <asm-generic/page.h>
122 119
diff --git a/include/asm-um/tlbflush.h b/include/asm-um/tlbflush.h
index 522aa30f7eaa..e78c28c1f350 100644
--- a/include/asm-um/tlbflush.h
+++ b/include/asm-um/tlbflush.h
@@ -7,6 +7,7 @@
7#define __UM_TLBFLUSH_H 7#define __UM_TLBFLUSH_H
8 8
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include "choose-mode.h"
10 11
11/* 12/*
12 * TLB flushing: 13 * TLB flushing:
@@ -24,6 +25,18 @@ extern void flush_tlb_all(void);
24extern void flush_tlb_mm(struct mm_struct *mm); 25extern void flush_tlb_mm(struct mm_struct *mm);
25extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, 26extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
26 unsigned long end); 27 unsigned long end);
28extern void flush_tlb_page_skas(struct vm_area_struct *vma,
29 unsigned long address);
30
31static inline void flush_tlb_page(struct vm_area_struct *vma,
32 unsigned long address)
33{
34 address &= PAGE_MASK;
35
36 CHOOSE_MODE(flush_tlb_range(vma, address, address + PAGE_SIZE),
37 flush_tlb_page_skas(vma, address));
38}
39
27extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); 40extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
28extern void flush_tlb_kernel_vm(void); 41extern void flush_tlb_kernel_vm(void);
29extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); 42extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
@@ -35,14 +48,3 @@ static inline void flush_tlb_pgtables(struct mm_struct *mm,
35} 48}
36 49
37#endif 50#endif
38
39/*
40 * Overrides for Emacs so that we follow Linus's tabbing style.
41 * Emacs will notice this stuff at the end of the file and automatically
42 * adjust the settings for this buffer only. This must remain at the end
43 * of the file.
44 * ---------------------------------------------------------------------------
45 * Local variables:
46 * c-file-style: "linux"
47 * End:
48 */
diff --git a/include/asm-v850/kdebug.h b/include/asm-v850/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-v850/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h
index da39916f10b0..0de2481fd990 100644
--- a/include/asm-v850/system.h
+++ b/include/asm-v850/system.h
@@ -76,7 +76,6 @@ static inline int irqs_disabled (void)
76 76
77#define xchg(ptr, with) \ 77#define xchg(ptr, with) \
78 ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr)))) 78 ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr))))
79#define tas(ptr) (xchg ((ptr), 1))
80 79
81static inline unsigned long __xchg (unsigned long with, 80static inline unsigned long __xchg (unsigned long with,
82 __volatile__ void *ptr, int size) 81 __volatile__ void *ptr, int size)
diff --git a/include/asm-x86_64/Kbuild b/include/asm-x86_64/Kbuild
index 89ad1fc27c8b..75a2deffca68 100644
--- a/include/asm-x86_64/Kbuild
+++ b/include/asm-x86_64/Kbuild
@@ -19,4 +19,3 @@ unifdef-y += mce.h
19unifdef-y += msr.h 19unifdef-y += msr.h
20unifdef-y += mtrr.h 20unifdef-y += mtrr.h
21unifdef-y += vsyscall.h 21unifdef-y += vsyscall.h
22unifdef-y += const.h
diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h
index 706ca4b60000..f2e64634fa48 100644
--- a/include/asm-x86_64/atomic.h
+++ b/include/asm-x86_64/atomic.h
@@ -2,6 +2,7 @@
2#define __ARCH_X86_64_ATOMIC__ 2#define __ARCH_X86_64_ATOMIC__
3 3
4#include <asm/alternative.h> 4#include <asm/alternative.h>
5#include <asm/cmpxchg.h>
5 6
6/* atomic_t should be 32 bit signed type */ 7/* atomic_t should be 32 bit signed type */
7 8
@@ -375,8 +376,8 @@ static __inline__ long atomic64_add_return(long i, atomic64_t *v)
375 long __i = i; 376 long __i = i;
376 __asm__ __volatile__( 377 __asm__ __volatile__(
377 LOCK_PREFIX "xaddq %0, %1;" 378 LOCK_PREFIX "xaddq %0, %1;"
378 :"=r"(i) 379 :"+r" (i), "+m" (v->counter)
379 :"m"(v->counter), "0"(i)); 380 : : "memory");
380 return i + __i; 381 return i + __i;
381} 382}
382 383
@@ -388,7 +389,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t *v)
388#define atomic64_inc_return(v) (atomic64_add_return(1,v)) 389#define atomic64_inc_return(v) (atomic64_add_return(1,v))
389#define atomic64_dec_return(v) (atomic64_sub_return(1,v)) 390#define atomic64_dec_return(v) (atomic64_sub_return(1,v))
390 391
391#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) 392#define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
393#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
394
395#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
392#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 396#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
393 397
394/** 398/**
@@ -400,22 +404,49 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t *v)
400 * Atomically adds @a to @v, so long as it was not @u. 404 * Atomically adds @a to @v, so long as it was not @u.
401 * Returns non-zero if @v was not @u, and zero otherwise. 405 * Returns non-zero if @v was not @u, and zero otherwise.
402 */ 406 */
403#define atomic_add_unless(v, a, u) \ 407static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
404({ \ 408{
405 int c, old; \ 409 int c, old;
406 c = atomic_read(v); \ 410 c = atomic_read(v);
407 for (;;) { \ 411 for (;;) {
408 if (unlikely(c == (u))) \ 412 if (unlikely(c == (u)))
409 break; \ 413 break;
410 old = atomic_cmpxchg((v), c, c + (a)); \ 414 old = atomic_cmpxchg((v), c, c + (a));
411 if (likely(old == c)) \ 415 if (likely(old == c))
412 break; \ 416 break;
413 c = old; \ 417 c = old;
414 } \ 418 }
415 c != (u); \ 419 return c != (u);
416}) 420}
421
417#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 422#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
418 423
424/**
425 * atomic64_add_unless - add unless the number is a given value
426 * @v: pointer of type atomic64_t
427 * @a: the amount to add to v...
428 * @u: ...unless v is equal to u.
429 *
430 * Atomically adds @a to @v, so long as it was not @u.
431 * Returns non-zero if @v was not @u, and zero otherwise.
432 */
433static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
434{
435 long c, old;
436 c = atomic64_read(v);
437 for (;;) {
438 if (unlikely(c == (u)))
439 break;
440 old = atomic64_cmpxchg((v), c, c + (a));
441 if (likely(old == c))
442 break;
443 c = old;
444 }
445 return c != (u);
446}
447
448#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
449
419/* These are x86-specific, used by some header files */ 450/* These are x86-specific, used by some header files */
420#define atomic_clear_mask(mask, addr) \ 451#define atomic_clear_mask(mask, addr) \
421__asm__ __volatile__(LOCK_PREFIX "andl %0,%1" \ 452__asm__ __volatile__(LOCK_PREFIX "andl %0,%1" \
diff --git a/include/asm-x86_64/cmpxchg.h b/include/asm-x86_64/cmpxchg.h
new file mode 100644
index 000000000000..09a6b6b6b74d
--- /dev/null
+++ b/include/asm-x86_64/cmpxchg.h
@@ -0,0 +1,134 @@
1#ifndef __ASM_CMPXCHG_H
2#define __ASM_CMPXCHG_H
3
4#include <asm/alternative.h> /* Provides LOCK_PREFIX */
5
6#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
7
8#define __xg(x) ((volatile long *)(x))
9
10static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
11{
12 *ptr = val;
13}
14
15#define _set_64bit set_64bit
16
17/*
18 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
19 * Note 2: xchg has side effect, so that attribute volatile is necessary,
20 * but generally the primitive is invalid, *ptr is output argument. --ANK
21 */
22static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
23{
24 switch (size) {
25 case 1:
26 __asm__ __volatile__("xchgb %b0,%1"
27 :"=q" (x)
28 :"m" (*__xg(ptr)), "0" (x)
29 :"memory");
30 break;
31 case 2:
32 __asm__ __volatile__("xchgw %w0,%1"
33 :"=r" (x)
34 :"m" (*__xg(ptr)), "0" (x)
35 :"memory");
36 break;
37 case 4:
38 __asm__ __volatile__("xchgl %k0,%1"
39 :"=r" (x)
40 :"m" (*__xg(ptr)), "0" (x)
41 :"memory");
42 break;
43 case 8:
44 __asm__ __volatile__("xchgq %0,%1"
45 :"=r" (x)
46 :"m" (*__xg(ptr)), "0" (x)
47 :"memory");
48 break;
49 }
50 return x;
51}
52
53/*
54 * Atomic compare and exchange. Compare OLD with MEM, if identical,
55 * store NEW in MEM. Return the initial value in MEM. Success is
56 * indicated by comparing RETURN with OLD.
57 */
58
59#define __HAVE_ARCH_CMPXCHG 1
60
61static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
62 unsigned long new, int size)
63{
64 unsigned long prev;
65 switch (size) {
66 case 1:
67 __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
68 : "=a"(prev)
69 : "q"(new), "m"(*__xg(ptr)), "0"(old)
70 : "memory");
71 return prev;
72 case 2:
73 __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
74 : "=a"(prev)
75 : "r"(new), "m"(*__xg(ptr)), "0"(old)
76 : "memory");
77 return prev;
78 case 4:
79 __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %k1,%2"
80 : "=a"(prev)
81 : "r"(new), "m"(*__xg(ptr)), "0"(old)
82 : "memory");
83 return prev;
84 case 8:
85 __asm__ __volatile__(LOCK_PREFIX "cmpxchgq %1,%2"
86 : "=a"(prev)
87 : "r"(new), "m"(*__xg(ptr)), "0"(old)
88 : "memory");
89 return prev;
90 }
91 return old;
92}
93
94static inline unsigned long __cmpxchg_local(volatile void *ptr,
95 unsigned long old, unsigned long new, int size)
96{
97 unsigned long prev;
98 switch (size) {
99 case 1:
100 __asm__ __volatile__("cmpxchgb %b1,%2"
101 : "=a"(prev)
102 : "q"(new), "m"(*__xg(ptr)), "0"(old)
103 : "memory");
104 return prev;
105 case 2:
106 __asm__ __volatile__("cmpxchgw %w1,%2"
107 : "=a"(prev)
108 : "r"(new), "m"(*__xg(ptr)), "0"(old)
109 : "memory");
110 return prev;
111 case 4:
112 __asm__ __volatile__("cmpxchgl %k1,%2"
113 : "=a"(prev)
114 : "r"(new), "m"(*__xg(ptr)), "0"(old)
115 : "memory");
116 return prev;
117 case 8:
118 __asm__ __volatile__("cmpxchgq %1,%2"
119 : "=a"(prev)
120 : "r"(new), "m"(*__xg(ptr)), "0"(old)
121 : "memory");
122 return prev;
123 }
124 return old;
125}
126
127#define cmpxchg(ptr,o,n)\
128 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
129 (unsigned long)(n),sizeof(*(ptr))))
130#define cmpxchg_local(ptr,o,n)\
131 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
132 (unsigned long)(n),sizeof(*(ptr))))
133
134#endif
diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h
index 2b0c088e2957..74feae945a26 100644
--- a/include/asm-x86_64/kdebug.h
+++ b/include/asm-x86_64/kdebug.h
@@ -5,19 +5,8 @@
5 5
6struct pt_regs; 6struct pt_regs;
7 7
8struct die_args {
9 struct pt_regs *regs;
10 const char *str;
11 long err;
12 int trapnr;
13 int signr;
14};
15
16extern int register_die_notifier(struct notifier_block *);
17extern int unregister_die_notifier(struct notifier_block *);
18extern int register_page_fault_notifier(struct notifier_block *); 8extern int register_page_fault_notifier(struct notifier_block *);
19extern int unregister_page_fault_notifier(struct notifier_block *); 9extern int unregister_page_fault_notifier(struct notifier_block *);
20extern struct atomic_notifier_head die_chain;
21 10
22/* Grossly misnamed. */ 11/* Grossly misnamed. */
23enum die_val { 12enum die_val {
@@ -33,22 +22,10 @@ enum die_val {
33 DIE_GPF, 22 DIE_GPF,
34 DIE_CALL, 23 DIE_CALL,
35 DIE_NMI_IPI, 24 DIE_NMI_IPI,
25 DIE_NMI_POST,
36 DIE_PAGE_FAULT, 26 DIE_PAGE_FAULT,
37}; 27};
38 28
39static inline int notify_die(enum die_val val, const char *str,
40 struct pt_regs *regs, long err, int trap, int sig)
41{
42 struct die_args args = {
43 .regs = regs,
44 .str = str,
45 .err = err,
46 .trapnr = trap,
47 .signr = sig
48 };
49 return atomic_notifier_call_chain(&die_chain, val, &args);
50}
51
52extern void printk_address(unsigned long address); 29extern void printk_address(unsigned long address);
53extern void die(const char *,struct pt_regs *,long); 30extern void die(const char *,struct pt_regs *,long);
54extern void __die(const char *,struct pt_regs *,long); 31extern void __die(const char *,struct pt_regs *,long);
diff --git a/include/asm-x86_64/kexec.h b/include/asm-x86_64/kexec.h
index 5fab957e1091..738e581b67f8 100644
--- a/include/asm-x86_64/kexec.h
+++ b/include/asm-x86_64/kexec.h
@@ -48,8 +48,6 @@
48/* The native architecture */ 48/* The native architecture */
49#define KEXEC_ARCH KEXEC_ARCH_X86_64 49#define KEXEC_ARCH KEXEC_ARCH_X86_64
50 50
51#define MAX_NOTE_BYTES 1024
52
53/* 51/*
54 * Saving the registers of the cpu on which panic occured in 52 * Saving the registers of the cpu on which panic occured in
55 * crash_kexec to save a valid sp. The registers of other cpus 53 * crash_kexec to save a valid sp. The registers of other cpus
diff --git a/include/asm-x86_64/local.h b/include/asm-x86_64/local.h
index e769e6200225..e87492bb0693 100644
--- a/include/asm-x86_64/local.h
+++ b/include/asm-x86_64/local.h
@@ -2,49 +2,183 @@
2#define _ARCH_X8664_LOCAL_H 2#define _ARCH_X8664_LOCAL_H
3 3
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5#include <asm/atomic.h>
5 6
6typedef struct 7typedef struct
7{ 8{
8 volatile long counter; 9 atomic_long_t a;
9} local_t; 10} local_t;
10 11
11#define LOCAL_INIT(i) { (i) } 12#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
12 13
13#define local_read(v) ((v)->counter) 14#define local_read(l) atomic_long_read(&(l)->a)
14#define local_set(v,i) (((v)->counter) = (i)) 15#define local_set(l,i) atomic_long_set(&(l)->a, (i))
15 16
16static inline void local_inc(local_t *v) 17static inline void local_inc(local_t *l)
17{ 18{
18 __asm__ __volatile__( 19 __asm__ __volatile__(
19 "incq %0" 20 "incq %0"
20 :"=m" (v->counter) 21 :"=m" (l->a.counter)
21 :"m" (v->counter)); 22 :"m" (l->a.counter));
22} 23}
23 24
24static inline void local_dec(local_t *v) 25static inline void local_dec(local_t *l)
25{ 26{
26 __asm__ __volatile__( 27 __asm__ __volatile__(
27 "decq %0" 28 "decq %0"
28 :"=m" (v->counter) 29 :"=m" (l->a.counter)
29 :"m" (v->counter)); 30 :"m" (l->a.counter));
30} 31}
31 32
32static inline void local_add(long i, local_t *v) 33static inline void local_add(long i, local_t *l)
33{ 34{
34 __asm__ __volatile__( 35 __asm__ __volatile__(
35 "addq %1,%0" 36 "addq %1,%0"
36 :"=m" (v->counter) 37 :"=m" (l->a.counter)
37 :"ir" (i), "m" (v->counter)); 38 :"ir" (i), "m" (l->a.counter));
38} 39}
39 40
40static inline void local_sub(long i, local_t *v) 41static inline void local_sub(long i, local_t *l)
41{ 42{
42 __asm__ __volatile__( 43 __asm__ __volatile__(
43 "subq %1,%0" 44 "subq %1,%0"
44 :"=m" (v->counter) 45 :"=m" (l->a.counter)
45 :"ir" (i), "m" (v->counter)); 46 :"ir" (i), "m" (l->a.counter));
46} 47}
47 48
49/**
50 * local_sub_and_test - subtract value from variable and test result
51 * @i: integer value to subtract
52 * @l: pointer to type local_t
53 *
54 * Atomically subtracts @i from @l and returns
55 * true if the result is zero, or false for all
56 * other cases.
57 */
58static __inline__ int local_sub_and_test(long i, local_t *l)
59{
60 unsigned char c;
61
62 __asm__ __volatile__(
63 "subq %2,%0; sete %1"
64 :"=m" (l->a.counter), "=qm" (c)
65 :"ir" (i), "m" (l->a.counter) : "memory");
66 return c;
67}
68
69/**
70 * local_dec_and_test - decrement and test
71 * @l: pointer to type local_t
72 *
73 * Atomically decrements @l by 1 and
74 * returns true if the result is 0, or false for all other
75 * cases.
76 */
77static __inline__ int local_dec_and_test(local_t *l)
78{
79 unsigned char c;
80
81 __asm__ __volatile__(
82 "decq %0; sete %1"
83 :"=m" (l->a.counter), "=qm" (c)
84 :"m" (l->a.counter) : "memory");
85 return c != 0;
86}
87
88/**
89 * local_inc_and_test - increment and test
90 * @l: pointer to type local_t
91 *
92 * Atomically increments @l by 1
93 * and returns true if the result is zero, or false for all
94 * other cases.
95 */
96static __inline__ int local_inc_and_test(local_t *l)
97{
98 unsigned char c;
99
100 __asm__ __volatile__(
101 "incq %0; sete %1"
102 :"=m" (l->a.counter), "=qm" (c)
103 :"m" (l->a.counter) : "memory");
104 return c != 0;
105}
106
107/**
108 * local_add_negative - add and test if negative
109 * @i: integer value to add
110 * @l: pointer to type local_t
111 *
112 * Atomically adds @i to @l and returns true
113 * if the result is negative, or false when
114 * result is greater than or equal to zero.
115 */
116static __inline__ int local_add_negative(long i, local_t *l)
117{
118 unsigned char c;
119
120 __asm__ __volatile__(
121 "addq %2,%0; sets %1"
122 :"=m" (l->a.counter), "=qm" (c)
123 :"ir" (i), "m" (l->a.counter) : "memory");
124 return c;
125}
126
127/**
128 * local_add_return - add and return
129 * @i: integer value to add
130 * @l: pointer to type local_t
131 *
132 * Atomically adds @i to @l and returns @i + @l
133 */
134static __inline__ long local_add_return(long i, local_t *l)
135{
136 long __i = i;
137 __asm__ __volatile__(
138 "xaddq %0, %1;"
139 :"+r" (i), "+m" (l->a.counter)
140 : : "memory");
141 return i + __i;
142}
143
144static __inline__ long local_sub_return(long i, local_t *l)
145{
146 return local_add_return(-i,l);
147}
148
149#define local_inc_return(l) (local_add_return(1,l))
150#define local_dec_return(l) (local_sub_return(1,l))
151
152#define local_cmpxchg(l, o, n) \
153 (cmpxchg_local(&((l)->a.counter), (o), (n)))
154/* Always has a lock prefix */
155#define local_xchg(l, n) (xchg(&((l)->a.counter), (n)))
156
157/**
158 * atomic_up_add_unless - add unless the number is a given value
159 * @l: pointer of type local_t
160 * @a: the amount to add to l...
161 * @u: ...unless l is equal to u.
162 *
163 * Atomically adds @a to @l, so long as it was not @u.
164 * Returns non-zero if @l was not @u, and zero otherwise.
165 */
166#define local_add_unless(l, a, u) \
167({ \
168 long c, old; \
169 c = local_read(l); \
170 for (;;) { \
171 if (unlikely(c == (u))) \
172 break; \
173 old = local_cmpxchg((l), c, c + (a)); \
174 if (likely(old == c)) \
175 break; \
176 c = old; \
177 } \
178 c != (u); \
179})
180#define local_inc_not_zero(l) local_add_unless((l), 1, 0)
181
48/* On x86-64 these are better than the atomic variants on SMP kernels 182/* On x86-64 these are better than the atomic variants on SMP kernels
49 because they dont use a lock prefix. */ 183 because they dont use a lock prefix. */
50#define __local_inc(l) local_inc(l) 184#define __local_inc(l) local_inc(l)
@@ -62,27 +196,27 @@ static inline void local_sub(long i, local_t *v)
62 196
63/* Need to disable preemption for the cpu local counters otherwise we could 197/* Need to disable preemption for the cpu local counters otherwise we could
64 still access a variable of a previous CPU in a non atomic way. */ 198 still access a variable of a previous CPU in a non atomic way. */
65#define cpu_local_wrap_v(v) \ 199#define cpu_local_wrap_v(l) \
66 ({ local_t res__; \ 200 ({ local_t res__; \
67 preempt_disable(); \ 201 preempt_disable(); \
68 res__ = (v); \ 202 res__ = (l); \
69 preempt_enable(); \ 203 preempt_enable(); \
70 res__; }) 204 res__; })
71#define cpu_local_wrap(v) \ 205#define cpu_local_wrap(l) \
72 ({ preempt_disable(); \ 206 ({ preempt_disable(); \
73 v; \ 207 l; \
74 preempt_enable(); }) \ 208 preempt_enable(); }) \
75 209
76#define cpu_local_read(v) cpu_local_wrap_v(local_read(&__get_cpu_var(v))) 210#define cpu_local_read(l) cpu_local_wrap_v(local_read(&__get_cpu_var(l)))
77#define cpu_local_set(v, i) cpu_local_wrap(local_set(&__get_cpu_var(v), (i))) 211#define cpu_local_set(l, i) cpu_local_wrap(local_set(&__get_cpu_var(l), (i)))
78#define cpu_local_inc(v) cpu_local_wrap(local_inc(&__get_cpu_var(v))) 212#define cpu_local_inc(l) cpu_local_wrap(local_inc(&__get_cpu_var(l)))
79#define cpu_local_dec(v) cpu_local_wrap(local_dec(&__get_cpu_var(v))) 213#define cpu_local_dec(l) cpu_local_wrap(local_dec(&__get_cpu_var(l)))
80#define cpu_local_add(i, v) cpu_local_wrap(local_add((i), &__get_cpu_var(v))) 214#define cpu_local_add(i, l) cpu_local_wrap(local_add((i), &__get_cpu_var(l)))
81#define cpu_local_sub(i, v) cpu_local_wrap(local_sub((i), &__get_cpu_var(v))) 215#define cpu_local_sub(i, l) cpu_local_wrap(local_sub((i), &__get_cpu_var(l)))
82 216
83#define __cpu_local_inc(v) cpu_local_inc(v) 217#define __cpu_local_inc(l) cpu_local_inc(l)
84#define __cpu_local_dec(v) cpu_local_dec(v) 218#define __cpu_local_dec(l) cpu_local_dec(l)
85#define __cpu_local_add(i, v) cpu_local_add((i), (v)) 219#define __cpu_local_add(i, l) cpu_local_add((i), (l))
86#define __cpu_local_sub(i, v) cpu_local_sub((i), (v)) 220#define __cpu_local_sub(i, l) cpu_local_sub((i), (l))
87 221
88#endif /* _ARCH_I386_LOCAL_H */ 222#endif /* _ARCH_X8664_LOCAL_H */
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h
index a524f0325673..d5c55b80da54 100644
--- a/include/asm-x86_64/msr.h
+++ b/include/asm-x86_64/msr.h
@@ -4,6 +4,7 @@
4#include <asm/msr-index.h> 4#include <asm/msr-index.h>
5 5
6#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
7#include <linux/errno.h>
7/* 8/*
8 * Access to machine-specific registers (available on 586 and better only) 9 * Access to machine-specific registers (available on 586 and better only)
9 * Note: the rd* operations modify the parameters directly (without using 10 * Note: the rd* operations modify the parameters directly (without using
@@ -162,6 +163,8 @@ static inline unsigned int cpuid_edx(unsigned int op)
162#ifdef CONFIG_SMP 163#ifdef CONFIG_SMP
163void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 164void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
164void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 165void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
166int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
167int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
165#else /* CONFIG_SMP */ 168#else /* CONFIG_SMP */
166static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) 169static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
167{ 170{
@@ -171,6 +174,14 @@ static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
171{ 174{
172 wrmsr(msr_no, l, h); 175 wrmsr(msr_no, l, h);
173} 176}
177static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
178{
179 return rdmsr_safe(msr_no, l, h);
180}
181static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
182{
183 return wrmsr_safe(msr_no, l, h);
184}
174#endif /* CONFIG_SMP */ 185#endif /* CONFIG_SMP */
175#endif /* __ASSEMBLY__ */ 186#endif /* __ASSEMBLY__ */
176#endif /* X86_64_MSR_H */ 187#endif /* X86_64_MSR_H */
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index b17fc16ec2eb..dee632fa457d 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -1,7 +1,7 @@
1#ifndef _X86_64_PAGE_H 1#ifndef _X86_64_PAGE_H
2#define _X86_64_PAGE_H 2#define _X86_64_PAGE_H
3 3
4#include <asm/const.h> 4#include <linux/const.h>
5 5
6/* PAGE_SHIFT determines the page size */ 6/* PAGE_SHIFT determines the page size */
7#define PAGE_SHIFT 12 7#define PAGE_SHIFT 12
@@ -79,9 +79,10 @@ extern unsigned long phys_base;
79 79
80#define __PHYSICAL_START CONFIG_PHYSICAL_START 80#define __PHYSICAL_START CONFIG_PHYSICAL_START
81#define __KERNEL_ALIGN 0x200000 81#define __KERNEL_ALIGN 0x200000
82
82#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START) 83#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
83#define __START_KERNEL_map 0xffffffff80000000 84#define __START_KERNEL_map _AC(0xffffffff80000000, UL)
84#define __PAGE_OFFSET 0xffff810000000000 85#define __PAGE_OFFSET _AC(0xffff810000000000, UL)
85 86
86/* to align the pointer to the (next) page boundary */ 87/* to align the pointer to the (next) page boundary */
87#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) 88#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
@@ -93,27 +94,23 @@ extern unsigned long phys_base;
93#define __VIRTUAL_MASK ((_AC(1,UL) << __VIRTUAL_MASK_SHIFT) - 1) 94#define __VIRTUAL_MASK ((_AC(1,UL) << __VIRTUAL_MASK_SHIFT) - 1)
94 95
95#define KERNEL_TEXT_SIZE (40*1024*1024) 96#define KERNEL_TEXT_SIZE (40*1024*1024)
96#define KERNEL_TEXT_START 0xffffffff80000000 97#define KERNEL_TEXT_START _AC(0xffffffff80000000, UL)
98#define PAGE_OFFSET __PAGE_OFFSET
97 99
98#ifndef __ASSEMBLY__ 100#ifndef __ASSEMBLY__
99 101
100#include <asm/bug.h> 102#include <asm/bug.h>
101 103
102#endif /* __ASSEMBLY__ */ 104extern unsigned long __phys_addr(unsigned long);
103 105
104#define PAGE_OFFSET __PAGE_OFFSET 106#endif /* __ASSEMBLY__ */
105 107
106/* Note: __pa(&symbol_visible_to_c) should be always replaced with __pa_symbol. 108#define __pa(x) __phys_addr((unsigned long)(x))
107 Otherwise you risk miscompilation. */ 109#define __pa_symbol(x) __phys_addr((unsigned long)(x))
108#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET)
109/* __pa_symbol should be used for C visible symbols.
110 This seems to be the official gcc blessed way to do such arithmetic. */
111#define __pa_symbol(x) \
112 ({unsigned long v; \
113 asm("" : "=r" (v) : "0" (x)); \
114 ((v - __START_KERNEL_map) + phys_base); })
115 110
116#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) 111#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
112#define __boot_va(x) __va(x)
113#define __boot_pa(x) __pa(x)
117#ifdef CONFIG_FLATMEM 114#ifdef CONFIG_FLATMEM
118#define pfn_valid(pfn) ((pfn) < end_pfn) 115#define pfn_valid(pfn) ((pfn) < end_pfn)
119#endif 116#endif
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 599993f6ba84..08b9831f2e14 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -1,7 +1,7 @@
1#ifndef _X86_64_PGTABLE_H 1#ifndef _X86_64_PGTABLE_H
2#define _X86_64_PGTABLE_H 2#define _X86_64_PGTABLE_H
3 3
4#include <asm/const.h> 4#include <linux/const.h>
5#ifndef __ASSEMBLY__ 5#ifndef __ASSEMBLY__
6 6
7/* 7/*
@@ -19,7 +19,7 @@ extern pmd_t level2_kernel_pgt[512];
19extern pgd_t init_level4_pgt[]; 19extern pgd_t init_level4_pgt[];
20extern unsigned long __supported_pte_mask; 20extern unsigned long __supported_pte_mask;
21 21
22#define swapper_pg_dir ((pgd_t *)NULL) 22#define swapper_pg_dir init_level4_pgt
23 23
24extern void paging_init(void); 24extern void paging_init(void);
25extern void clear_kernel_mapping(unsigned long addr, unsigned long size); 25extern void clear_kernel_mapping(unsigned long addr, unsigned long size);
@@ -29,7 +29,7 @@ extern void clear_kernel_mapping(unsigned long addr, unsigned long size);
29 * for zero-mapped memory areas etc.. 29 * for zero-mapped memory areas etc..
30 */ 30 */
31extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)]; 31extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
32#define ZERO_PAGE(vaddr) (pfn_to_page(__pa_symbol(&empty_zero_page) >> PAGE_SHIFT)) 32#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
33 33
34#endif /* !__ASSEMBLY__ */ 34#endif /* !__ASSEMBLY__ */
35 35
@@ -134,11 +134,11 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long
134#define USER_PTRS_PER_PGD ((TASK_SIZE-1)/PGDIR_SIZE+1) 134#define USER_PTRS_PER_PGD ((TASK_SIZE-1)/PGDIR_SIZE+1)
135#define FIRST_USER_ADDRESS 0 135#define FIRST_USER_ADDRESS 0
136 136
137#define MAXMEM 0x3fffffffffff 137#define MAXMEM _AC(0x3fffffffffff, UL)
138#define VMALLOC_START 0xffffc20000000000 138#define VMALLOC_START _AC(0xffffc20000000000, UL)
139#define VMALLOC_END 0xffffe1ffffffffff 139#define VMALLOC_END _AC(0xffffe1ffffffffff, UL)
140#define MODULES_VADDR 0xffffffff88000000 140#define MODULES_VADDR _AC(0xffffffff88000000, UL)
141#define MODULES_END 0xfffffffffff00000 141#define MODULES_END _AC(0xfffffffffff00000, UL)
142#define MODULES_LEN (MODULES_END - MODULES_VADDR) 142#define MODULES_LEN (MODULES_END - MODULES_VADDR)
143 143
144#define _PAGE_BIT_PRESENT 0 144#define _PAGE_BIT_PRESENT 0
@@ -411,17 +411,12 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
411 411
412extern spinlock_t pgd_lock; 412extern spinlock_t pgd_lock;
413extern struct list_head pgd_list; 413extern struct list_head pgd_list;
414void vmalloc_sync_all(void);
415 414
416extern int kern_addr_valid(unsigned long addr); 415extern int kern_addr_valid(unsigned long addr);
417 416
418#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 417#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
419 remap_pfn_range(vma, vaddr, pfn, size, prot) 418 remap_pfn_range(vma, vaddr, pfn, size, prot)
420 419
421#define MK_IOSPACE_PFN(space, pfn) (pfn)
422#define GET_IOSPACE(pfn) 0
423#define GET_PFN(pfn) (pfn)
424
425#define HAVE_ARCH_UNMAPPED_AREA 420#define HAVE_ARCH_UNMAPPED_AREA
426 421
427#define pgtable_cache_init() do { } while (0) 422#define pgtable_cache_init() do { } while (0)
diff --git a/include/asm-x86_64/serial.h b/include/asm-x86_64/serial.h
index b0496e0d72a6..8ebd765c674a 100644
--- a/include/asm-x86_64/serial.h
+++ b/include/asm-x86_64/serial.h
@@ -11,19 +11,3 @@
11 * megabits/second; but this requires the faster clock. 11 * megabits/second; but this requires the faster clock.
12 */ 12 */
13#define BASE_BAUD ( 1843200 / 16 ) 13#define BASE_BAUD ( 1843200 / 16 )
14
15/* Standard COM flags (except for COM4, because of the 8514 problem) */
16#ifdef CONFIG_SERIAL_DETECT_IRQ
17#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
18#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
19#else
20#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
21#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
22#endif
23
24#define SERIAL_PORT_DFNS \
25 /* UART CLK PORT IRQ FLAGS */ \
26 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
27 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
28 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
29 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
index 213b7fe5d998..b7b8021e8c43 100644
--- a/include/asm-x86_64/system.h
+++ b/include/asm-x86_64/system.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <asm/segment.h> 5#include <asm/segment.h>
6#include <asm/alternative.h> 6#include <asm/cmpxchg.h>
7 7
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9 9
@@ -124,100 +124,6 @@ static inline void sched_cacheflush(void)
124 124
125#define nop() __asm__ __volatile__ ("nop") 125#define nop() __asm__ __volatile__ ("nop")
126 126
127#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
128
129#define tas(ptr) (xchg((ptr),1))
130
131#define __xg(x) ((volatile long *)(x))
132
133static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
134{
135 *ptr = val;
136}
137
138#define _set_64bit set_64bit
139
140/*
141 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
142 * Note 2: xchg has side effect, so that attribute volatile is necessary,
143 * but generally the primitive is invalid, *ptr is output argument. --ANK
144 */
145static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
146{
147 switch (size) {
148 case 1:
149 __asm__ __volatile__("xchgb %b0,%1"
150 :"=q" (x)
151 :"m" (*__xg(ptr)), "0" (x)
152 :"memory");
153 break;
154 case 2:
155 __asm__ __volatile__("xchgw %w0,%1"
156 :"=r" (x)
157 :"m" (*__xg(ptr)), "0" (x)
158 :"memory");
159 break;
160 case 4:
161 __asm__ __volatile__("xchgl %k0,%1"
162 :"=r" (x)
163 :"m" (*__xg(ptr)), "0" (x)
164 :"memory");
165 break;
166 case 8:
167 __asm__ __volatile__("xchgq %0,%1"
168 :"=r" (x)
169 :"m" (*__xg(ptr)), "0" (x)
170 :"memory");
171 break;
172 }
173 return x;
174}
175
176/*
177 * Atomic compare and exchange. Compare OLD with MEM, if identical,
178 * store NEW in MEM. Return the initial value in MEM. Success is
179 * indicated by comparing RETURN with OLD.
180 */
181
182#define __HAVE_ARCH_CMPXCHG 1
183
184static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
185 unsigned long new, int size)
186{
187 unsigned long prev;
188 switch (size) {
189 case 1:
190 __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
191 : "=a"(prev)
192 : "q"(new), "m"(*__xg(ptr)), "0"(old)
193 : "memory");
194 return prev;
195 case 2:
196 __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
197 : "=a"(prev)
198 : "r"(new), "m"(*__xg(ptr)), "0"(old)
199 : "memory");
200 return prev;
201 case 4:
202 __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %k1,%2"
203 : "=a"(prev)
204 : "r"(new), "m"(*__xg(ptr)), "0"(old)
205 : "memory");
206 return prev;
207 case 8:
208 __asm__ __volatile__(LOCK_PREFIX "cmpxchgq %1,%2"
209 : "=a"(prev)
210 : "r"(new), "m"(*__xg(ptr)), "0"(old)
211 : "memory");
212 return prev;
213 }
214 return old;
215}
216
217#define cmpxchg(ptr,o,n)\
218 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
219 (unsigned long)(n),sizeof(*(ptr))))
220
221#ifdef CONFIG_SMP 127#ifdef CONFIG_SMP
222#define smp_mb() mb() 128#define smp_mb() mb()
223#define smp_rmb() rmb() 129#define smp_rmb() rmb()
diff --git a/include/asm-x86_64/termbits.h b/include/asm-x86_64/termbits.h
index 6cfc3bb10c1a..7405756dd41b 100644
--- a/include/asm-x86_64/termbits.h
+++ b/include/asm-x86_64/termbits.h
@@ -160,7 +160,7 @@ struct ktermios {
160#define CMSPAR 010000000000 /* mark or space (stick) parity */ 160#define CMSPAR 010000000000 /* mark or space (stick) parity */
161#define CRTSCTS 020000000000 /* flow control */ 161#define CRTSCTS 020000000000 /* flow control */
162 162
163#define IBSHIFT 8 /* Shift from CBAUD to CIBAUD */ 163#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
164 164
165/* c_lflag bits */ 165/* c_lflag bits */
166#define ISIG 0000001 166#define ISIG 0000001
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 26e23e01c54a..595703949df3 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -619,6 +619,8 @@ __SYSCALL(__NR_sync_file_range, sys_sync_file_range)
619__SYSCALL(__NR_vmsplice, sys_vmsplice) 619__SYSCALL(__NR_vmsplice, sys_vmsplice)
620#define __NR_move_pages 279 620#define __NR_move_pages 279
621__SYSCALL(__NR_move_pages, sys_move_pages) 621__SYSCALL(__NR_move_pages, sys_move_pages)
622#define __NR_utimensat 280
623__SYSCALL(__NR_utimensat, sys_utimensat)
622 624
623#ifndef __NO_STUBS 625#ifndef __NO_STUBS
624#define __ARCH_WANT_OLD_READDIR 626#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-xtensa/atomic.h b/include/asm-xtensa/atomic.h
index 5c2672021068..b3b23540f14d 100644
--- a/include/asm-xtensa/atomic.h
+++ b/include/asm-xtensa/atomic.h
@@ -234,14 +234,21 @@ static inline int atomic_sub_return(int i, atomic_t * v)
234 * Atomically adds @a to @v, so long as it was not @u. 234 * Atomically adds @a to @v, so long as it was not @u.
235 * Returns non-zero if @v was not @u, and zero otherwise. 235 * Returns non-zero if @v was not @u, and zero otherwise.
236 */ 236 */
237#define atomic_add_unless(v, a, u) \ 237static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
238({ \ 238{
239 int c, old; \ 239 int c, old;
240 c = atomic_read(v); \ 240 c = atomic_read(v);
241 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ 241 for (;;) {
242 c = old; \ 242 if (unlikely(c == (u)))
243 c != (u); \ 243 break;
244}) 244 old = atomic_cmpxchg((v), c, c + (a));
245 if (likely(old == c))
246 break;
247 c = old;
248 }
249 return c != (u);
250}
251
245#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 252#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
246 253
247static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) 254static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
diff --git a/include/asm-xtensa/kdebug.h b/include/asm-xtensa/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/include/asm-xtensa/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h
index 4aaed7fe6cfe..ddc970847ae9 100644
--- a/include/asm-xtensa/system.h
+++ b/include/asm-xtensa/system.h
@@ -183,8 +183,6 @@ static inline unsigned long xchg_u32(volatile int * m, unsigned long val)
183 return tmp; 183 return tmp;
184} 184}
185 185
186#define tas(ptr) (xchg((ptr),1))
187
188#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) 186#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
189 187
190/* 188/*
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4ff0f57d0add..94cc04a143f2 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -4,6 +4,7 @@ header-y += hdlc/
4header-y += isdn/ 4header-y += isdn/
5header-y += nfsd/ 5header-y += nfsd/
6header-y += raid/ 6header-y += raid/
7header-y += spi/
7header-y += sunrpc/ 8header-y += sunrpc/
8header-y += tc_act/ 9header-y += tc_act/
9header-y += netfilter/ 10header-y += netfilter/
@@ -33,7 +34,6 @@ header-y += atmsvc.h
33header-y += atm_zatm.h 34header-y += atm_zatm.h
34header-y += auto_fs4.h 35header-y += auto_fs4.h
35header-y += auxvec.h 36header-y += auxvec.h
36header-y += awe_voice.h
37header-y += ax25.h 37header-y += ax25.h
38header-y += b1lli.h 38header-y += b1lli.h
39header-y += baycom.h 39header-y += baycom.h
@@ -46,6 +46,7 @@ header-y += coda_psdev.h
46header-y += coff.h 46header-y += coff.h
47header-y += comstats.h 47header-y += comstats.h
48header-y += consolemap.h 48header-y += consolemap.h
49header-y += const.h
49header-y += cycx_cfm.h 50header-y += cycx_cfm.h
50header-y += dlm_device.h 51header-y += dlm_device.h
51header-y += dm-ioctl.h 52header-y += dm-ioctl.h
@@ -91,11 +92,11 @@ header-y += ip_mp_alg.h
91header-y += ipsec.h 92header-y += ipsec.h
92header-y += ipx.h 93header-y += ipx.h
93header-y += irda.h 94header-y += irda.h
94header-y += isdn_divertif.h
95header-y += iso_fs.h 95header-y += iso_fs.h
96header-y += ixjuser.h 96header-y += ixjuser.h
97header-y += jffs2.h 97header-y += jffs2.h
98header-y += keyctl.h 98header-y += keyctl.h
99header-y += kvm.h
99header-y += limits.h 100header-y += limits.h
100header-y += lock_dlm_plock.h 101header-y += lock_dlm_plock.h
101header-y += magic.h 102header-y += magic.h
@@ -120,6 +121,7 @@ header-y += pci_regs.h
120header-y += personality.h 121header-y += personality.h
121header-y += pfkeyv2.h 122header-y += pfkeyv2.h
122header-y += pg.h 123header-y += pg.h
124header-y += phantom.h
123header-y += pkt_cls.h 125header-y += pkt_cls.h
124header-y += pkt_sched.h 126header-y += pkt_sched.h
125header-y += posix_types.h 127header-y += posix_types.h
@@ -139,6 +141,7 @@ header-y += sockios.h
139header-y += som.h 141header-y += som.h
140header-y += sound.h 142header-y += sound.h
141header-y += synclink.h 143header-y += synclink.h
144header-y += taskstats.h
142header-y += telephony.h 145header-y += telephony.h
143header-y += termios.h 146header-y += termios.h
144header-y += ticable.h 147header-y += ticable.h
@@ -238,6 +241,7 @@ unifdef-y += ipv6.h
238unifdef-y += ipv6_route.h 241unifdef-y += ipv6_route.h
239unifdef-y += isdn.h 242unifdef-y += isdn.h
240unifdef-y += isdnif.h 243unifdef-y += isdnif.h
244unifdef-y += isdn_divertif.h
241unifdef-y += isdn_ppp.h 245unifdef-y += isdn_ppp.h
242unifdef-y += isicom.h 246unifdef-y += isicom.h
243unifdef-y += jbd.h 247unifdef-y += jbd.h
diff --git a/include/linux/awe_voice.h b/include/linux/awe_voice.h
deleted file mode 100644
index bf33f17bea99..000000000000
--- a/include/linux/awe_voice.h
+++ /dev/null
@@ -1,525 +0,0 @@
1/*
2 * include/linux/awe_voice.h
3 *
4 * Voice information definitions for the low level driver for the
5 * AWE32/SB32/AWE64 wave table synth.
6 * version 0.4.4; Jan. 4, 2000
7 *
8 * Copyright (C) 1996-2000 Takashi Iwai
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25#ifndef AWE_VOICE_H
26#define AWE_VOICE_H
27
28#ifndef SAMPLE_TYPE_AWE32
29#define SAMPLE_TYPE_AWE32 0x20
30#endif
31
32#define _LINUX_PATCHKEY_H_INDIRECT
33#include <linux/patchkey.h>
34#undef _LINUX_PATCHKEY_H_INDIRECT
35
36/*----------------------------------------------------------------
37 * patch information record
38 *----------------------------------------------------------------*/
39
40/* patch interface header: 16 bytes */
41typedef struct awe_patch_info {
42 short key; /* use AWE_PATCH here */
43#define AWE_PATCH _PATCHKEY(0x07)
44
45 short device_no; /* synthesizer number */
46 unsigned short sf_id; /* file id (should be zero) */
47 short optarg; /* optional argument */
48 int len; /* data length (without this header) */
49
50 short type; /* patch operation type */
51#define AWE_LOAD_INFO 0 /* awe_voice_rec */
52#define AWE_LOAD_DATA 1 /* awe_sample_info */
53#define AWE_OPEN_PATCH 2 /* awe_open_parm */
54#define AWE_CLOSE_PATCH 3 /* none */
55#define AWE_UNLOAD_PATCH 4 /* none */
56#define AWE_REPLACE_DATA 5 /* awe_sample_info (optarg=#channels)*/
57#define AWE_MAP_PRESET 6 /* awe_voice_map */
58/*#define AWE_PROBE_INFO 7*/ /* awe_voice_map (pat only) */
59#define AWE_PROBE_DATA 8 /* optarg=sample */
60#define AWE_REMOVE_INFO 9 /* optarg=(bank<<8)|instr */
61#define AWE_LOAD_CHORUS_FX 0x10 /* awe_chorus_fx_rec (optarg=mode) */
62#define AWE_LOAD_REVERB_FX 0x11 /* awe_reverb_fx_rec (optarg=mode) */
63
64 short reserved; /* word alignment data */
65
66 /* the actual patch data begins after this */
67#if defined(AWE_COMPAT_030) && AWE_COMPAT_030
68 char data[0];
69#endif
70} awe_patch_info;
71
72/*#define AWE_PATCH_INFO_SIZE 16*/
73#define AWE_PATCH_INFO_SIZE sizeof(awe_patch_info)
74
75
76/*----------------------------------------------------------------
77 * open patch
78 *----------------------------------------------------------------*/
79
80#define AWE_PATCH_NAME_LEN 32
81
82typedef struct _awe_open_parm {
83 unsigned short type; /* sample type */
84#define AWE_PAT_TYPE_MISC 0
85#define AWE_PAT_TYPE_GM 1
86#define AWE_PAT_TYPE_GS 2
87#define AWE_PAT_TYPE_MT32 3
88#define AWE_PAT_TYPE_XG 4
89#define AWE_PAT_TYPE_SFX 5
90#define AWE_PAT_TYPE_GUS 6
91#define AWE_PAT_TYPE_MAP 7
92
93#define AWE_PAT_LOCKED 0x100 /* lock the samples */
94#define AWE_PAT_SHARED 0x200 /* sample is shared */
95
96 short reserved;
97 char name[AWE_PATCH_NAME_LEN];
98} awe_open_parm;
99
100/*#define AWE_OPEN_PARM_SIZE 28*/
101#define AWE_OPEN_PARM_SIZE sizeof(awe_open_parm)
102
103
104/*----------------------------------------------------------------
105 * raw voice information record
106 *----------------------------------------------------------------*/
107
108/* wave table envelope & effect parameters to control EMU8000 */
109typedef struct _awe_voice_parm {
110 unsigned short moddelay; /* modulation delay (0x8000) */
111 unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */
112 unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */
113 unsigned short modrelease; /* modulation release time (0x807f) */
114 short modkeyhold, modkeydecay; /* envelope change per key (not used) */
115 unsigned short voldelay; /* volume delay (0x8000) */
116 unsigned short volatkhld; /* volume attack & hold time (0x7f7f) */
117 unsigned short voldcysus; /* volume decay & sustain (0x7f7f) */
118 unsigned short volrelease; /* volume release time (0x807f) */
119 short volkeyhold, volkeydecay; /* envelope change per key (not used) */
120 unsigned short lfo1delay; /* LFO1 delay (0x8000) */
121 unsigned short lfo2delay; /* LFO2 delay (0x8000) */
122 unsigned short pefe; /* modulation pitch & cutoff (0x0000) */
123 unsigned short fmmod; /* LFO1 pitch & cutoff (0x0000) */
124 unsigned short tremfrq; /* LFO1 volume & freq (0x0000) */
125 unsigned short fm2frq2; /* LFO2 pitch & freq (0x0000) */
126 unsigned char cutoff; /* initial cutoff (0xff) */
127 unsigned char filterQ; /* initial filter Q [0-15] (0x0) */
128 unsigned char chorus; /* chorus send (0x00) */
129 unsigned char reverb; /* reverb send (0x00) */
130 unsigned short reserved[4]; /* not used */
131} awe_voice_parm;
132
133typedef struct _awe_voice_parm_block {
134 unsigned short moddelay; /* modulation delay (0x8000) */
135 unsigned char modatk, modhld;
136 unsigned char moddcy, modsus;
137 unsigned char modrel, moddummy;
138 short modkeyhold, modkeydecay; /* envelope change per key (not used) */
139 unsigned short voldelay; /* volume delay (0x8000) */
140 unsigned char volatk, volhld;
141 unsigned char voldcy, volsus;
142 unsigned char volrel, voldummy;
143 short volkeyhold, volkeydecay; /* envelope change per key (not used) */
144 unsigned short lfo1delay; /* LFO1 delay (0x8000) */
145 unsigned short lfo2delay; /* LFO2 delay (0x8000) */
146 unsigned char env1fc, env1pit;
147 unsigned char lfo1fc, lfo1pit;
148 unsigned char lfo1freq, lfo1vol;
149 unsigned char lfo2freq, lfo2pit;
150 unsigned char cutoff; /* initial cutoff (0xff) */
151 unsigned char filterQ; /* initial filter Q [0-15] (0x0) */
152 unsigned char chorus; /* chorus send (0x00) */
153 unsigned char reverb; /* reverb send (0x00) */
154 unsigned short reserved[4]; /* not used */
155} awe_voice_parm_block;
156
157#define AWE_VOICE_PARM_SIZE 48
158
159
160/* wave table parameters: 92 bytes */
161typedef struct _awe_voice_info {
162 unsigned short sf_id; /* file id (should be zero) */
163 unsigned short sample; /* sample id */
164 int start, end; /* sample offset correction */
165 int loopstart, loopend; /* loop offset correction */
166 short rate_offset; /* sample rate pitch offset */
167 unsigned short mode; /* sample mode */
168#define AWE_MODE_ROMSOUND 0x8000
169#define AWE_MODE_STEREO 1
170#define AWE_MODE_LOOPING 2
171#define AWE_MODE_NORELEASE 4 /* obsolete */
172#define AWE_MODE_INIT_PARM 8
173
174 short root; /* midi root key */
175 short tune; /* pitch tuning (in cents) */
176 signed char low, high; /* key note range */
177 signed char vellow, velhigh; /* velocity range */
178 signed char fixkey, fixvel; /* fixed key, velocity */
179 signed char pan, fixpan; /* panning, fixed panning */
180 short exclusiveClass; /* exclusive class (0 = none) */
181 unsigned char amplitude; /* sample volume (127 max) */
182 unsigned char attenuation; /* attenuation (0.375dB) */
183 short scaleTuning; /* pitch scale tuning(%), normally 100 */
184 awe_voice_parm parm; /* voice envelope parameters */
185 short index; /* internal index (set by driver) */
186} awe_voice_info;
187
188/*#define AWE_VOICE_INFO_SIZE 92*/
189#define AWE_VOICE_INFO_SIZE sizeof(awe_voice_info)
190
191/*----------------------------------------------------------------*/
192
193/* The info entry of awe_voice_rec is changed from 0 to 1
194 * for some compilers refusing zero size array.
195 * Due to this change, sizeof(awe_voice_rec) becomes different
196 * from older versions.
197 * Use AWE_VOICE_REC_SIZE instead.
198 */
199
200/* instrument info header: 4 bytes */
201typedef struct _awe_voice_rec_hdr {
202 unsigned char bank; /* midi bank number */
203 unsigned char instr; /* midi preset number */
204 char nvoices; /* number of voices */
205 char write_mode; /* write mode; normally 0 */
206#define AWE_WR_APPEND 0 /* append anyway */
207#define AWE_WR_EXCLUSIVE 1 /* skip if already exists */
208#define AWE_WR_REPLACE 2 /* replace if already exists */
209} awe_voice_rec_hdr;
210
211/*#define AWE_VOICE_REC_SIZE 4*/
212#define AWE_VOICE_REC_SIZE sizeof(awe_voice_rec_hdr)
213
214/* the standard patch structure for one sample */
215typedef struct _awe_voice_rec_patch {
216 awe_patch_info patch;
217 awe_voice_rec_hdr hdr;
218 awe_voice_info info;
219} awe_voice_rec_patch;
220
221
222/* obsolete data type */
223#if defined(AWE_COMPAT_030) && AWE_COMPAT_030
224#define AWE_INFOARRAY_SIZE 0
225#else
226#define AWE_INFOARRAY_SIZE 1
227#endif
228
229typedef struct _awe_voice_rec {
230 unsigned char bank; /* midi bank number */
231 unsigned char instr; /* midi preset number */
232 short nvoices; /* number of voices */
233 /* voice information follows here */
234 awe_voice_info info[AWE_INFOARRAY_SIZE];
235} awe_voice_rec;
236
237
238/*----------------------------------------------------------------
239 * sample wave information
240 *----------------------------------------------------------------*/
241
242/* wave table sample header: 32 bytes */
243typedef struct awe_sample_info {
244 unsigned short sf_id; /* file id (should be zero) */
245 unsigned short sample; /* sample id */
246 int start, end; /* start & end offset */
247 int loopstart, loopend; /* loop start & end offset */
248 int size; /* size (0 = ROM) */
249 short checksum_flag; /* use check sum = 1 */
250 unsigned short mode_flags; /* mode flags */
251#define AWE_SAMPLE_8BITS 1 /* wave data is 8bits */
252#define AWE_SAMPLE_UNSIGNED 2 /* wave data is unsigned */
253#define AWE_SAMPLE_NO_BLANK 4 /* no blank loop is attached */
254#define AWE_SAMPLE_SINGLESHOT 8 /* single-shot w/o loop */
255#define AWE_SAMPLE_BIDIR_LOOP 16 /* bidirectional looping */
256#define AWE_SAMPLE_STEREO_LEFT 32 /* stereo left sound */
257#define AWE_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */
258#define AWE_SAMPLE_REVERSE_LOOP 128 /* reverse looping */
259 unsigned int checksum; /* check sum */
260#if defined(AWE_COMPAT_030) && AWE_COMPAT_030
261 unsigned short data[0]; /* sample data follows here */
262#endif
263} awe_sample_info;
264
265/*#define AWE_SAMPLE_INFO_SIZE 32*/
266#define AWE_SAMPLE_INFO_SIZE sizeof(awe_sample_info)
267
268
269/*----------------------------------------------------------------
270 * voice preset mapping
271 *----------------------------------------------------------------*/
272
273typedef struct awe_voice_map {
274 int map_bank, map_instr, map_key; /* key = -1 means all keys */
275 int src_bank, src_instr, src_key;
276} awe_voice_map;
277
278#define AWE_VOICE_MAP_SIZE sizeof(awe_voice_map)
279
280
281/*----------------------------------------------------------------
282 * awe hardware controls
283 *----------------------------------------------------------------*/
284
285#define _AWE_DEBUG_MODE 0x00
286#define _AWE_REVERB_MODE 0x01
287#define _AWE_CHORUS_MODE 0x02
288#define _AWE_REMOVE_LAST_SAMPLES 0x03
289#define _AWE_INITIALIZE_CHIP 0x04
290#define _AWE_SEND_EFFECT 0x05
291#define _AWE_TERMINATE_CHANNEL 0x06
292#define _AWE_TERMINATE_ALL 0x07
293#define _AWE_INITIAL_VOLUME 0x08
294#define _AWE_INITIAL_ATTEN _AWE_INITIAL_VOLUME
295#define _AWE_RESET_CHANNEL 0x09
296#define _AWE_CHANNEL_MODE 0x0a
297#define _AWE_DRUM_CHANNELS 0x0b
298#define _AWE_MISC_MODE 0x0c
299#define _AWE_RELEASE_ALL 0x0d
300#define _AWE_NOTEOFF_ALL 0x0e
301#define _AWE_CHN_PRESSURE 0x0f
302/*#define _AWE_GET_CURRENT_MODE 0x10*/
303#define _AWE_EQUALIZER 0x11
304/*#define _AWE_GET_MISC_MODE 0x12*/
305/*#define _AWE_GET_FONTINFO 0x13*/
306
307#define _AWE_MODE_FLAG 0x80
308#define _AWE_COOKED_FLAG 0x40 /* not supported */
309#define _AWE_MODE_VALUE_MASK 0x3F
310
311/*----------------------------------------------------------------*/
312
313#define _AWE_SET_CMD(p,dev,voice,cmd,p1,p2) \
314{((char*)(p))[0] = SEQ_PRIVATE;\
315 ((char*)(p))[1] = dev;\
316 ((char*)(p))[2] = _AWE_MODE_FLAG|(cmd);\
317 ((char*)(p))[3] = voice;\
318 ((unsigned short*)(p))[2] = p1;\
319 ((unsigned short*)(p))[3] = p2;}
320
321/* buffered access */
322#define _AWE_CMD(dev, voice, cmd, p1, p2) \
323{_SEQ_NEEDBUF(8);\
324 _AWE_SET_CMD(_seqbuf + _seqbufptr, dev, voice, cmd, p1, p2);\
325 _SEQ_ADVBUF(8);}
326
327/* direct access */
328#define _AWE_CMD_NOW(seqfd,dev,voice,cmd,p1,p2) \
329{struct seq_event_rec tmp;\
330 _AWE_SET_CMD(&tmp, dev, voice, cmd, p1, p2);\
331 ioctl(seqfd, SNDCTL_SEQ_OUTOFBAND, &tmp);}
332
333/*----------------------------------------------------------------*/
334
335/* set debugging mode */
336#define AWE_DEBUG_MODE(dev,p1) _AWE_CMD(dev, 0, _AWE_DEBUG_MODE, p1, 0)
337/* set reverb mode; from 0 to 7 */
338#define AWE_REVERB_MODE(dev,p1) _AWE_CMD(dev, 0, _AWE_REVERB_MODE, p1, 0)
339/* set chorus mode; from 0 to 7 */
340#define AWE_CHORUS_MODE(dev,p1) _AWE_CMD(dev, 0, _AWE_CHORUS_MODE, p1, 0)
341
342/* reset channel */
343#define AWE_RESET_CHANNEL(dev,ch) _AWE_CMD(dev, ch, _AWE_RESET_CHANNEL, 0, 0)
344#define AWE_RESET_CONTROL(dev,ch) _AWE_CMD(dev, ch, _AWE_RESET_CHANNEL, 1, 0)
345
346/* send an effect to all layers */
347#define AWE_SEND_EFFECT(dev,voice,type,value) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,type,value)
348#define AWE_ADD_EFFECT(dev,voice,type,value) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((type)|0x80),value)
349#define AWE_UNSET_EFFECT(dev,voice,type) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((type)|0x40),0)
350/* send an effect to a layer */
351#define AWE_SEND_LAYER_EFFECT(dev,voice,layer,type,value) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((layer+1)<<8|(type)),value)
352#define AWE_ADD_LAYER_EFFECT(dev,voice,layer,type,value) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((layer+1)<<8|(type)|0x80),value)
353#define AWE_UNSET_LAYER_EFFECT(dev,voice,layer,type) _AWE_CMD(dev,voice,_AWE_SEND_EFFECT,((layer+1)<<8|(type)|0x40),0)
354
355/* terminate sound on the channel/voice */
356#define AWE_TERMINATE_CHANNEL(dev,voice) _AWE_CMD(dev,voice,_AWE_TERMINATE_CHANNEL,0,0)
357/* terminate all sounds */
358#define AWE_TERMINATE_ALL(dev) _AWE_CMD(dev, 0, _AWE_TERMINATE_ALL, 0, 0)
359/* release all sounds (w/o sustain effect) */
360#define AWE_RELEASE_ALL(dev) _AWE_CMD(dev, 0, _AWE_RELEASE_ALL, 0, 0)
361/* note off all sounds (w sustain effect) */
362#define AWE_NOTEOFF_ALL(dev) _AWE_CMD(dev, 0, _AWE_NOTEOFF_ALL, 0, 0)
363
364/* set initial attenuation */
365#define AWE_INITIAL_VOLUME(dev,atten) _AWE_CMD(dev, 0, _AWE_INITIAL_VOLUME, atten, 0)
366#define AWE_INITIAL_ATTEN AWE_INITIAL_VOLUME
367/* relative attenuation */
368#define AWE_SET_ATTEN(dev,atten) _AWE_CMD(dev, 0, _AWE_INITIAL_VOLUME, atten, 1)
369
370/* set channel playing mode; mode=0/1/2 */
371#define AWE_SET_CHANNEL_MODE(dev,mode) _AWE_CMD(dev, 0, _AWE_CHANNEL_MODE, mode, 0)
372#define AWE_PLAY_INDIRECT 0 /* indirect voice mode (default) */
373#define AWE_PLAY_MULTI 1 /* multi note voice mode */
374#define AWE_PLAY_DIRECT 2 /* direct single voice mode */
375#define AWE_PLAY_MULTI2 3 /* sequencer2 mode; used internally */
376
377/* set drum channel mask; channels is 32bit long value */
378#define AWE_DRUM_CHANNELS(dev,channels) _AWE_CMD(dev, 0, _AWE_DRUM_CHANNELS, ((channels) & 0xffff), ((channels) >> 16))
379
380/* set bass and treble control; values are from 0 to 11 */
381#define AWE_EQUALIZER(dev,bass,treble) _AWE_CMD(dev, 0, _AWE_EQUALIZER, bass, treble)
382
383/* remove last loaded samples */
384#define AWE_REMOVE_LAST_SAMPLES(seqfd,dev) _AWE_CMD_NOW(seqfd, dev, 0, _AWE_REMOVE_LAST_SAMPLES, 0, 0)
385/* initialize emu8000 chip */
386#define AWE_INITIALIZE_CHIP(seqfd,dev) _AWE_CMD_NOW(seqfd, dev, 0, _AWE_INITIALIZE_CHIP, 0, 0)
387
388/* set miscellaneous modes; meta command */
389#define AWE_MISC_MODE(dev,mode,value) _AWE_CMD(dev, 0, _AWE_MISC_MODE, mode, value)
390/* exclusive sound off; 1=off */
391#define AWE_EXCLUSIVE_SOUND(dev,mode) AWE_MISC_MODE(dev,AWE_MD_EXCLUSIVE_SOUND,mode)
392/* default GUS bank number */
393#define AWE_SET_GUS_BANK(dev,bank) AWE_MISC_MODE(dev,AWE_MD_GUS_BANK,bank)
394/* change panning position in realtime; 0=don't 1=do */
395#define AWE_REALTIME_PAN(dev,mode) AWE_MISC_MODE(dev,AWE_MD_REALTIME_PAN,mode)
396
397/* extended pressure controls; not portable with other sound drivers */
398#define AWE_KEY_PRESSURE(dev,ch,note,vel) SEQ_START_NOTE(dev,ch,(note)+128,vel)
399#define AWE_CHN_PRESSURE(dev,ch,vel) _AWE_CMD(dev,ch,_AWE_CHN_PRESSURE,vel,0)
400
401/*----------------------------------------------------------------*/
402
403/* reverb mode parameters */
404#define AWE_REVERB_ROOM1 0
405#define AWE_REVERB_ROOM2 1
406#define AWE_REVERB_ROOM3 2
407#define AWE_REVERB_HALL1 3
408#define AWE_REVERB_HALL2 4
409#define AWE_REVERB_PLATE 5
410#define AWE_REVERB_DELAY 6
411#define AWE_REVERB_PANNINGDELAY 7
412#define AWE_REVERB_PREDEFINED 8
413/* user can define reverb modes up to 32 */
414#define AWE_REVERB_NUMBERS 32
415
416typedef struct awe_reverb_fx_rec {
417 unsigned short parms[28];
418} awe_reverb_fx_rec;
419
420/*----------------------------------------------------------------*/
421
422/* chorus mode parameters */
423#define AWE_CHORUS_1 0
424#define AWE_CHORUS_2 1
425#define AWE_CHORUS_3 2
426#define AWE_CHORUS_4 3
427#define AWE_CHORUS_FEEDBACK 4
428#define AWE_CHORUS_FLANGER 5
429#define AWE_CHORUS_SHORTDELAY 6
430#define AWE_CHORUS_SHORTDELAY2 7
431#define AWE_CHORUS_PREDEFINED 8
432/* user can define chorus modes up to 32 */
433#define AWE_CHORUS_NUMBERS 32
434
435typedef struct awe_chorus_fx_rec {
436 unsigned short feedback; /* feedback level (0xE600-0xE6FF) */
437 unsigned short delay_offset; /* delay (0-0x0DA3) [1/44100 sec] */
438 unsigned short lfo_depth; /* LFO depth (0xBC00-0xBCFF) */
439 unsigned int delay; /* right delay (0-0xFFFFFFFF) [1/256/44100 sec] */
440 unsigned int lfo_freq; /* LFO freq LFO freq (0-0xFFFFFFFF) */
441} awe_chorus_fx_rec;
442
443/*----------------------------------------------------------------*/
444
445/* misc mode types */
446enum {
447/* 0*/ AWE_MD_EXCLUSIVE_OFF, /* obsolete */
448/* 1*/ AWE_MD_EXCLUSIVE_ON, /* obsolete */
449/* 2*/ AWE_MD_VERSION, /* read only */
450/* 3*/ AWE_MD_EXCLUSIVE_SOUND, /* 0/1: exclusive note on (default=1) */
451/* 4*/ AWE_MD_REALTIME_PAN, /* 0/1: do realtime pan change (default=1) */
452/* 5*/ AWE_MD_GUS_BANK, /* bank number for GUS patches (default=0) */
453/* 6*/ AWE_MD_KEEP_EFFECT, /* 0/1: keep effect values, (default=0) */
454/* 7*/ AWE_MD_ZERO_ATTEN, /* attenuation of max volume (default=32) */
455/* 8*/ AWE_MD_CHN_PRIOR, /* 0/1: set MIDI channel priority mode (default=1) */
456/* 9*/ AWE_MD_MOD_SENSE, /* integer: modwheel sensitivity (def=18) */
457/*10*/ AWE_MD_DEF_PRESET, /* integer: default preset number (def=0) */
458/*11*/ AWE_MD_DEF_BANK, /* integer: default bank number (def=0) */
459/*12*/ AWE_MD_DEF_DRUM, /* integer: default drumset number (def=0) */
460/*13*/ AWE_MD_TOGGLE_DRUM_BANK, /* 0/1: toggle drum flag with bank# (def=0) */
461/*14*/ AWE_MD_NEW_VOLUME_CALC, /* 0/1: volume calculation mode (def=1) */
462/*15*/ AWE_MD_CHORUS_MODE, /* integer: chorus mode (def=2) */
463/*16*/ AWE_MD_REVERB_MODE, /* integer: chorus mode (def=4) */
464/*17*/ AWE_MD_BASS_LEVEL, /* integer: bass level (def=5) */
465/*18*/ AWE_MD_TREBLE_LEVEL, /* integer: treble level (def=9) */
466/*19*/ AWE_MD_DEBUG_MODE, /* integer: debug level (def=0) */
467/*20*/ AWE_MD_PAN_EXCHANGE, /* 0/1: exchange panning direction (def=0) */
468 AWE_MD_END,
469};
470
471/*----------------------------------------------------------------*/
472
473/* effect parameters */
474enum {
475
476/* modulation envelope parameters */
477/* 0*/ AWE_FX_ENV1_DELAY, /* WORD: ENVVAL */
478/* 1*/ AWE_FX_ENV1_ATTACK, /* BYTE: up ATKHLD */
479/* 2*/ AWE_FX_ENV1_HOLD, /* BYTE: lw ATKHLD */
480/* 3*/ AWE_FX_ENV1_DECAY, /* BYTE: lw DCYSUS */
481/* 4*/ AWE_FX_ENV1_RELEASE, /* BYTE: lw DCYSUS */
482/* 5*/ AWE_FX_ENV1_SUSTAIN, /* BYTE: up DCYSUS */
483/* 6*/ AWE_FX_ENV1_PITCH, /* BYTE: up PEFE */
484/* 7*/ AWE_FX_ENV1_CUTOFF, /* BYTE: lw PEFE */
485
486/* volume envelope parameters */
487/* 8*/ AWE_FX_ENV2_DELAY, /* WORD: ENVVOL */
488/* 9*/ AWE_FX_ENV2_ATTACK, /* BYTE: up ATKHLDV */
489/*10*/ AWE_FX_ENV2_HOLD, /* BYTE: lw ATKHLDV */
490/*11*/ AWE_FX_ENV2_DECAY, /* BYTE: lw DCYSUSV */
491/*12*/ AWE_FX_ENV2_RELEASE, /* BYTE: lw DCYSUSV */
492/*13*/ AWE_FX_ENV2_SUSTAIN, /* BYTE: up DCYSUSV */
493
494/* LFO1 (tremolo & vibrato) parameters */
495/*14*/ AWE_FX_LFO1_DELAY, /* WORD: LFO1VAL */
496/*15*/ AWE_FX_LFO1_FREQ, /* BYTE: lo TREMFRQ */
497/*16*/ AWE_FX_LFO1_VOLUME, /* BYTE: up TREMFRQ */
498/*17*/ AWE_FX_LFO1_PITCH, /* BYTE: up FMMOD */
499/*18*/ AWE_FX_LFO1_CUTOFF, /* BYTE: lo FMMOD */
500
501/* LFO2 (vibrato) parameters */
502/*19*/ AWE_FX_LFO2_DELAY, /* WORD: LFO2VAL */
503/*20*/ AWE_FX_LFO2_FREQ, /* BYTE: lo FM2FRQ2 */
504/*21*/ AWE_FX_LFO2_PITCH, /* BYTE: up FM2FRQ2 */
505
506/* Other overall effect parameters */
507/*22*/ AWE_FX_INIT_PITCH, /* SHORT: pitch offset */
508/*23*/ AWE_FX_CHORUS, /* BYTE: chorus effects send (0-255) */
509/*24*/ AWE_FX_REVERB, /* BYTE: reverb effects send (0-255) */
510/*25*/ AWE_FX_CUTOFF, /* BYTE: up IFATN */
511/*26*/ AWE_FX_FILTERQ, /* BYTE: up CCCA */
512
513/* Sample / loop offset changes */
514/*27*/ AWE_FX_SAMPLE_START, /* SHORT: offset */
515/*28*/ AWE_FX_LOOP_START, /* SHORT: offset */
516/*29*/ AWE_FX_LOOP_END, /* SHORT: offset */
517/*30*/ AWE_FX_COARSE_SAMPLE_START, /* SHORT: upper word offset */
518/*31*/ AWE_FX_COARSE_LOOP_START, /* SHORT: upper word offset */
519/*32*/ AWE_FX_COARSE_LOOP_END, /* SHORT: upper word offset */
520/*33*/ AWE_FX_ATTEN, /* BYTE: lo IFATN */
521
522 AWE_FX_END,
523};
524
525#endif /* AWE_VOICE_H */
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index dd27b1c7227f..5c6e12853a9b 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -165,7 +165,7 @@ int sync_mapping_buffers(struct address_space *mapping);
165void unmap_underlying_metadata(struct block_device *bdev, sector_t block); 165void unmap_underlying_metadata(struct block_device *bdev, sector_t block);
166 166
167void mark_buffer_async_write(struct buffer_head *bh); 167void mark_buffer_async_write(struct buffer_head *bh);
168void invalidate_bdev(struct block_device *, int); 168void invalidate_bdev(struct block_device *);
169int sync_blockdev(struct block_device *bdev); 169int sync_blockdev(struct block_device *bdev);
170void __wait_on_buffer(struct buffer_head *); 170void __wait_on_buffer(struct buffer_head *);
171wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); 171wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
@@ -182,6 +182,7 @@ void __brelse(struct buffer_head *);
182void __bforget(struct buffer_head *); 182void __bforget(struct buffer_head *);
183void __breadahead(struct block_device *, sector_t block, unsigned int size); 183void __breadahead(struct block_device *, sector_t block, unsigned int size);
184struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size); 184struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size);
185void invalidate_bh_lrus(void);
185struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); 186struct buffer_head *alloc_buffer_head(gfp_t gfp_flags);
186void free_buffer_head(struct buffer_head * bh); 187void free_buffer_head(struct buffer_head * bh);
187void FASTCALL(unlock_buffer(struct buffer_head *bh)); 188void FASTCALL(unlock_buffer(struct buffer_head *bh));
@@ -319,7 +320,7 @@ static inline int inode_has_buffers(struct inode *inode) { return 0; }
319static inline void invalidate_inode_buffers(struct inode *inode) {} 320static inline void invalidate_inode_buffers(struct inode *inode) {}
320static inline int remove_inode_buffers(struct inode *inode) { return 1; } 321static inline int remove_inode_buffers(struct inode *inode) { return 1; }
321static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; } 322static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; }
322static inline void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) {} 323static inline void invalidate_bdev(struct block_device *bdev) {}
323 324
324 325
325#endif /* CONFIG_BLOCK */ 326#endif /* CONFIG_BLOCK */
diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h
index e86e4a938373..3dc715b02500 100644
--- a/include/linux/byteorder/generic.h
+++ b/include/linux/byteorder/generic.h
@@ -124,19 +124,8 @@
124#define be32_to_cpus __be32_to_cpus 124#define be32_to_cpus __be32_to_cpus
125#define cpu_to_be16s __cpu_to_be16s 125#define cpu_to_be16s __cpu_to_be16s
126#define be16_to_cpus __be16_to_cpus 126#define be16_to_cpus __be16_to_cpus
127#endif
128 127
129
130#if defined(__KERNEL__)
131/* 128/*
132 * Handle ntohl and suches. These have various compatibility
133 * issues - like we want to give the prototype even though we
134 * also have a macro for them in case some strange program
135 * wants to take the address of the thing or something..
136 *
137 * Note that these used to return a "long" in libc5, even though
138 * long is often 64-bit these days.. Thus the casts.
139 *
140 * They have to be macros in order to do the constant folding 129 * They have to be macros in order to do the constant folding
141 * correctly - if the argument passed into a inline function 130 * correctly - if the argument passed into a inline function
142 * it is no longer constant according to gcc.. 131 * it is no longer constant according to gcc..
@@ -147,17 +136,6 @@
147#undef htonl 136#undef htonl
148#undef htons 137#undef htons
149 138
150/*
151 * Do the prototypes. Somebody might want to take the
152 * address or some such sick thing..
153 */
154extern __u32 ntohl(__be32);
155extern __be32 htonl(__u32);
156extern __u16 ntohs(__be16);
157extern __be16 htons(__u16);
158
159#if defined(__GNUC__) && defined(__OPTIMIZE__)
160
161#define ___htonl(x) __cpu_to_be32(x) 139#define ___htonl(x) __cpu_to_be32(x)
162#define ___htons(x) __cpu_to_be16(x) 140#define ___htons(x) __cpu_to_be16(x)
163#define ___ntohl(x) __be32_to_cpu(x) 141#define ___ntohl(x) __be32_to_cpu(x)
@@ -168,9 +146,6 @@ extern __be16 htons(__u16);
168#define htons(x) ___htons(x) 146#define htons(x) ___htons(x)
169#define ntohs(x) ___ntohs(x) 147#define ntohs(x) ___ntohs(x)
170 148
171#endif /* OPTIMIZE */
172
173#endif /* KERNEL */ 149#endif /* KERNEL */
174 150
175
176#endif /* _LINUX_BYTEORDER_GENERIC_H */ 151#endif /* _LINUX_BYTEORDER_GENERIC_H */
diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h
index 25f7f32883ec..142134ff1645 100644
--- a/include/linux/byteorder/swab.h
+++ b/include/linux/byteorder/swab.h
@@ -10,6 +10,10 @@
10 * separated swab functions from cpu_to_XX, 10 * separated swab functions from cpu_to_XX,
11 * to clean up support for bizarre-endian architectures. 11 * to clean up support for bizarre-endian architectures.
12 * 12 *
13 * Trent Piepho <xyzzy@speakeasy.org> 2007114
14 * make constant-folding work, provide C versions that
15 * gcc can optimize better, explain different versions
16 *
13 * See asm-i386/byteorder.h and suches for examples of how to provide 17 * See asm-i386/byteorder.h and suches for examples of how to provide
14 * architecture-dependent optimized versions 18 * architecture-dependent optimized versions
15 * 19 *
@@ -17,40 +21,66 @@
17 21
18#include <linux/compiler.h> 22#include <linux/compiler.h>
19 23
24/* Functions/macros defined, there are a lot:
25 *
26 * ___swabXX
27 * Generic C versions of the swab functions.
28 *
29 * ___constant_swabXX
30 * C versions that gcc can fold into a compile-time constant when
31 * the argument is a compile-time constant.
32 *
33 * __arch__swabXX[sp]?
34 * Architecture optimized versions of all the swab functions
35 * (including the s and p versions). These can be defined in
36 * asm-arch/byteorder.h. Any which are not, are defined here.
37 * __arch__swabXXs() is defined in terms of __arch__swabXXp(), which
38 * is defined in terms of __arch__swabXX(), which is in turn defined
39 * in terms of ___swabXX(x).
40 * These must be macros. They may be unsafe for arguments with
41 * side-effects.
42 *
43 * __fswabXX
44 * Inline function versions of the __arch__ macros. These _are_ safe
45 * if the arguments have side-effects. Note there are no s and p
46 * versions of these.
47 *
48 * __swabXX[sb]
49 * There are the ones you should actually use. The __swabXX versions
50 * will be a constant given a constant argument and use the arch
51 * specific code (if any) for non-constant arguments. The s and p
52 * versions always use the arch specific code (constant folding
53 * doesn't apply). They are safe to use with arguments with
54 * side-effects.
55 *
56 * swabXX[sb]
57 * Nicknames for __swabXX[sb] to use in the kernel.
58 */
59
20/* casts are necessary for constants, because we never know how for sure 60/* casts are necessary for constants, because we never know how for sure
21 * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way. 61 * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
22 */ 62 */
23#define ___swab16(x) \
24({ \
25 __u16 __x = (x); \
26 ((__u16)( \
27 (((__u16)(__x) & (__u16)0x00ffU) << 8) | \
28 (((__u16)(__x) & (__u16)0xff00U) >> 8) )); \
29})
30 63
31#define ___swab32(x) \ 64static __inline__ __attribute_const__ __u16 ___swab16(__u16 x)
32({ \ 65{
33 __u32 __x = (x); \ 66 return x<<8 | x>>8;
34 ((__u32)( \ 67}
35 (((__u32)(__x) & (__u32)0x000000ffUL) << 24) | \ 68static __inline__ __attribute_const__ __u32 ___swab32(__u32 x)
36 (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) | \ 69{
37 (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) | \ 70 return x<<24 | x>>24 |
38 (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); \ 71 (x & (__u32)0x0000ff00UL)<<8 |
39}) 72 (x & (__u32)0x00ff0000UL)>>8;
40 73}
41#define ___swab64(x) \ 74static __inline__ __attribute_const__ __u64 ___swab64(__u64 x)
42({ \ 75{
43 __u64 __x = (x); \ 76 return x<<56 | x>>56 |
44 ((__u64)( \ 77 (x & (__u64)0x000000000000ff00ULL)<<40 |
45 (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \ 78 (x & (__u64)0x0000000000ff0000ULL)<<24 |
46 (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \ 79 (x & (__u64)0x00000000ff000000ULL)<< 8 |
47 (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \ 80 (x & (__u64)0x000000ff00000000ULL)>> 8 |
48 (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \ 81 (x & (__u64)0x0000ff0000000000ULL)>>24 |
49 (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \ 82 (x & (__u64)0x00ff000000000000ULL)>>40;
50 (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \ 83}
51 (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
52 (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
53})
54 84
55#define ___constant_swab16(x) \ 85#define ___constant_swab16(x) \
56 ((__u16)( \ 86 ((__u16)( \
@@ -77,13 +107,13 @@
77 * provide defaults when no architecture-specific optimization is detected 107 * provide defaults when no architecture-specific optimization is detected
78 */ 108 */
79#ifndef __arch__swab16 109#ifndef __arch__swab16
80# define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); }) 110# define __arch__swab16(x) ___swab16(x)
81#endif 111#endif
82#ifndef __arch__swab32 112#ifndef __arch__swab32
83# define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); }) 113# define __arch__swab32(x) ___swab32(x)
84#endif 114#endif
85#ifndef __arch__swab64 115#ifndef __arch__swab64
86# define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); }) 116# define __arch__swab64(x) ___swab64(x)
87#endif 117#endif
88 118
89#ifndef __arch__swab16p 119#ifndef __arch__swab16p
@@ -97,13 +127,13 @@
97#endif 127#endif
98 128
99#ifndef __arch__swab16s 129#ifndef __arch__swab16s
100# define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0) 130# define __arch__swab16s(x) ((void)(*(x) = __arch__swab16p(x)))
101#endif 131#endif
102#ifndef __arch__swab32s 132#ifndef __arch__swab32s
103# define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0) 133# define __arch__swab32s(x) ((void)(*(x) = __arch__swab32p(x)))
104#endif 134#endif
105#ifndef __arch__swab64s 135#ifndef __arch__swab64s
106# define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0) 136# define __arch__swab64s(x) ((void)(*(x) = __arch__swab64p(x)))
107#endif 137#endif
108 138
109 139
@@ -113,15 +143,15 @@
113#if defined(__GNUC__) && defined(__OPTIMIZE__) 143#if defined(__GNUC__) && defined(__OPTIMIZE__)
114# define __swab16(x) \ 144# define __swab16(x) \
115(__builtin_constant_p((__u16)(x)) ? \ 145(__builtin_constant_p((__u16)(x)) ? \
116 ___swab16((x)) : \ 146 ___constant_swab16((x)) : \
117 __fswab16((x))) 147 __fswab16((x)))
118# define __swab32(x) \ 148# define __swab32(x) \
119(__builtin_constant_p((__u32)(x)) ? \ 149(__builtin_constant_p((__u32)(x)) ? \
120 ___swab32((x)) : \ 150 ___constant_swab32((x)) : \
121 __fswab32((x))) 151 __fswab32((x)))
122# define __swab64(x) \ 152# define __swab64(x) \
123(__builtin_constant_p((__u64)(x)) ? \ 153(__builtin_constant_p((__u64)(x)) ? \
124 ___swab64((x)) : \ 154 ___constant_swab64((x)) : \
125 __fswab64((x))) 155 __fswab64((x)))
126#else 156#else
127# define __swab16(x) __fswab16(x) 157# define __swab16(x) __fswab16(x)
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 4ea7e7bcfafe..8486e78f7335 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -54,17 +54,17 @@ enum clock_event_nofitiers {
54/** 54/**
55 * struct clock_event_device - clock event device descriptor 55 * struct clock_event_device - clock event device descriptor
56 * @name: ptr to clock event name 56 * @name: ptr to clock event name
57 * @hints: usage hints 57 * @features: features
58 * @max_delta_ns: maximum delta value in ns 58 * @max_delta_ns: maximum delta value in ns
59 * @min_delta_ns: minimum delta value in ns 59 * @min_delta_ns: minimum delta value in ns
60 * @mult: nanosecond to cycles multiplier 60 * @mult: nanosecond to cycles multiplier
61 * @shift: nanoseconds to cycles divisor (power of two) 61 * @shift: nanoseconds to cycles divisor (power of two)
62 * @rating: variable to rate clock event devices 62 * @rating: variable to rate clock event devices
63 * @irq: irq number (only for non cpu local devices) 63 * @irq: IRQ number (only for non CPU local devices)
64 * @cpumask: cpumask to indicate for which cpus this device works 64 * @cpumask: cpumask to indicate for which CPUs this device works
65 * @set_next_event: set next event 65 * @set_next_event: set next event function
66 * @set_mode: set mode function 66 * @set_mode: set mode function
67 * @evthandler: Assigned by the framework to be called by the low 67 * @event_handler: Assigned by the framework to be called by the low
68 * level handler of the event source 68 * level handler of the event source
69 * @broadcast: function to broadcast events 69 * @broadcast: function to broadcast events
70 * @list: list head for the management code 70 * @list: list head for the management code
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index daa4940cc0f1..2665ca04cf8f 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -12,6 +12,7 @@
12#include <linux/timex.h> 12#include <linux/timex.h>
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/cache.h>
15#include <linux/timer.h> 16#include <linux/timer.h>
16#include <asm/div64.h> 17#include <asm/div64.h>
17#include <asm/io.h> 18#include <asm/io.h>
@@ -52,6 +53,9 @@ struct clocksource;
52 * @xtime_interval: Used internally by timekeeping core, please ignore. 53 * @xtime_interval: Used internally by timekeeping core, please ignore.
53 */ 54 */
54struct clocksource { 55struct clocksource {
56 /*
57 * First part of structure is read mostly
58 */
55 char *name; 59 char *name;
56 struct list_head list; 60 struct list_head list;
57 int rating; 61 int rating;
@@ -63,8 +67,15 @@ struct clocksource {
63 cycle_t (*vread)(void); 67 cycle_t (*vread)(void);
64 68
65 /* timekeeping specific data, ignore */ 69 /* timekeeping specific data, ignore */
66 cycle_t cycle_last, cycle_interval; 70 cycle_t cycle_interval;
67 u64 xtime_nsec, xtime_interval; 71 u64 xtime_interval;
72 /*
73 * Second part is written at each timer interrupt
74 * Keep it in a different cache line to dirty no
75 * more than one cache line.
76 */
77 cycle_t cycle_last ____cacheline_aligned_in_smp;
78 u64 xtime_nsec;
68 s64 error; 79 s64 error;
69 80
70#ifdef CONFIG_CLOCKSOURCE_WATCHDOG 81#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
deleted file mode 100644
index c26c3adcfacf..000000000000
--- a/include/linux/compat_ioctl.h
+++ /dev/null
@@ -1,830 +0,0 @@
1/* List here explicitly which ioctl's are known to have
2 * compatible types passed or none at all... Please include
3 * only stuff that is compatible on *all architectures*.
4 */
5
6COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
7COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
8
9/* Big T */
10COMPATIBLE_IOCTL(TCGETA)
11COMPATIBLE_IOCTL(TCSETA)
12COMPATIBLE_IOCTL(TCSETAW)
13COMPATIBLE_IOCTL(TCSETAF)
14COMPATIBLE_IOCTL(TCSBRK)
15ULONG_IOCTL(TCSBRKP)
16COMPATIBLE_IOCTL(TCXONC)
17COMPATIBLE_IOCTL(TCFLSH)
18COMPATIBLE_IOCTL(TCGETS)
19COMPATIBLE_IOCTL(TCSETS)
20COMPATIBLE_IOCTL(TCSETSW)
21COMPATIBLE_IOCTL(TCSETSF)
22COMPATIBLE_IOCTL(TIOCLINUX)
23COMPATIBLE_IOCTL(TIOCSBRK)
24COMPATIBLE_IOCTL(TIOCCBRK)
25ULONG_IOCTL(TIOCMIWAIT)
26COMPATIBLE_IOCTL(TIOCGICOUNT)
27/* Little t */
28COMPATIBLE_IOCTL(TIOCGETD)
29COMPATIBLE_IOCTL(TIOCSETD)
30COMPATIBLE_IOCTL(TIOCEXCL)
31COMPATIBLE_IOCTL(TIOCNXCL)
32COMPATIBLE_IOCTL(TIOCCONS)
33COMPATIBLE_IOCTL(TIOCGSOFTCAR)
34COMPATIBLE_IOCTL(TIOCSSOFTCAR)
35COMPATIBLE_IOCTL(TIOCSWINSZ)
36COMPATIBLE_IOCTL(TIOCGWINSZ)
37COMPATIBLE_IOCTL(TIOCMGET)
38COMPATIBLE_IOCTL(TIOCMBIC)
39COMPATIBLE_IOCTL(TIOCMBIS)
40COMPATIBLE_IOCTL(TIOCMSET)
41COMPATIBLE_IOCTL(TIOCPKT)
42COMPATIBLE_IOCTL(TIOCNOTTY)
43COMPATIBLE_IOCTL(TIOCSTI)
44COMPATIBLE_IOCTL(TIOCOUTQ)
45COMPATIBLE_IOCTL(TIOCSPGRP)
46COMPATIBLE_IOCTL(TIOCGPGRP)
47ULONG_IOCTL(TIOCSCTTY)
48COMPATIBLE_IOCTL(TIOCGPTN)
49COMPATIBLE_IOCTL(TIOCSPTLCK)
50COMPATIBLE_IOCTL(TIOCSERGETLSR)
51/* Little f */
52COMPATIBLE_IOCTL(FIOCLEX)
53COMPATIBLE_IOCTL(FIONCLEX)
54COMPATIBLE_IOCTL(FIOASYNC)
55COMPATIBLE_IOCTL(FIONBIO)
56COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */
57/* 0x00 */
58COMPATIBLE_IOCTL(FIBMAP)
59COMPATIBLE_IOCTL(FIGETBSZ)
60/* 0x03 -- HD/IDE ioctl's used by hdparm and friends.
61 * Some need translations, these do not.
62 */
63COMPATIBLE_IOCTL(HDIO_GET_IDENTITY)
64COMPATIBLE_IOCTL(HDIO_DRIVE_TASK)
65COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
66ULONG_IOCTL(HDIO_SET_MULTCOUNT)
67ULONG_IOCTL(HDIO_SET_UNMASKINTR)
68ULONG_IOCTL(HDIO_SET_KEEPSETTINGS)
69ULONG_IOCTL(HDIO_SET_32BIT)
70ULONG_IOCTL(HDIO_SET_NOWERR)
71ULONG_IOCTL(HDIO_SET_DMA)
72ULONG_IOCTL(HDIO_SET_PIO_MODE)
73ULONG_IOCTL(HDIO_SET_NICE)
74ULONG_IOCTL(HDIO_SET_WCACHE)
75ULONG_IOCTL(HDIO_SET_ACOUSTIC)
76ULONG_IOCTL(HDIO_SET_BUSSTATE)
77ULONG_IOCTL(HDIO_SET_ADDRESS)
78COMPATIBLE_IOCTL(HDIO_SCAN_HWIF)
79/* 0x330 is reserved -- it used to be HDIO_GETGEO_BIG */
80COMPATIBLE_IOCTL(0x330)
81/* 0x02 -- Floppy ioctls */
82COMPATIBLE_IOCTL(FDMSGON)
83COMPATIBLE_IOCTL(FDMSGOFF)
84COMPATIBLE_IOCTL(FDSETEMSGTRESH)
85COMPATIBLE_IOCTL(FDFLUSH)
86COMPATIBLE_IOCTL(FDWERRORCLR)
87COMPATIBLE_IOCTL(FDSETMAXERRS)
88COMPATIBLE_IOCTL(FDGETMAXERRS)
89COMPATIBLE_IOCTL(FDGETDRVTYP)
90COMPATIBLE_IOCTL(FDEJECT)
91COMPATIBLE_IOCTL(FDCLRPRM)
92COMPATIBLE_IOCTL(FDFMTBEG)
93COMPATIBLE_IOCTL(FDFMTEND)
94COMPATIBLE_IOCTL(FDRESET)
95COMPATIBLE_IOCTL(FDTWADDLE)
96COMPATIBLE_IOCTL(FDFMTTRK)
97COMPATIBLE_IOCTL(FDRAWCMD)
98/* 0x12 */
99#ifdef CONFIG_BLOCK
100COMPATIBLE_IOCTL(BLKRASET)
101COMPATIBLE_IOCTL(BLKROSET)
102COMPATIBLE_IOCTL(BLKROGET)
103COMPATIBLE_IOCTL(BLKRRPART)
104COMPATIBLE_IOCTL(BLKFLSBUF)
105COMPATIBLE_IOCTL(BLKSECTSET)
106COMPATIBLE_IOCTL(BLKSSZGET)
107COMPATIBLE_IOCTL(BLKTRACESTART)
108COMPATIBLE_IOCTL(BLKTRACESTOP)
109COMPATIBLE_IOCTL(BLKTRACESETUP)
110COMPATIBLE_IOCTL(BLKTRACETEARDOWN)
111ULONG_IOCTL(BLKRASET)
112ULONG_IOCTL(BLKFRASET)
113#endif
114/* RAID */
115COMPATIBLE_IOCTL(RAID_VERSION)
116COMPATIBLE_IOCTL(GET_ARRAY_INFO)
117COMPATIBLE_IOCTL(GET_DISK_INFO)
118COMPATIBLE_IOCTL(PRINT_RAID_DEBUG)
119COMPATIBLE_IOCTL(RAID_AUTORUN)
120COMPATIBLE_IOCTL(CLEAR_ARRAY)
121COMPATIBLE_IOCTL(ADD_NEW_DISK)
122ULONG_IOCTL(HOT_REMOVE_DISK)
123COMPATIBLE_IOCTL(SET_ARRAY_INFO)
124COMPATIBLE_IOCTL(SET_DISK_INFO)
125COMPATIBLE_IOCTL(WRITE_RAID_INFO)
126COMPATIBLE_IOCTL(UNPROTECT_ARRAY)
127COMPATIBLE_IOCTL(PROTECT_ARRAY)
128ULONG_IOCTL(HOT_ADD_DISK)
129ULONG_IOCTL(SET_DISK_FAULTY)
130COMPATIBLE_IOCTL(RUN_ARRAY)
131COMPATIBLE_IOCTL(STOP_ARRAY)
132COMPATIBLE_IOCTL(STOP_ARRAY_RO)
133COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
134COMPATIBLE_IOCTL(GET_BITMAP_FILE)
135ULONG_IOCTL(SET_BITMAP_FILE)
136/* DM */
137COMPATIBLE_IOCTL(DM_VERSION_32)
138COMPATIBLE_IOCTL(DM_REMOVE_ALL_32)
139COMPATIBLE_IOCTL(DM_LIST_DEVICES_32)
140COMPATIBLE_IOCTL(DM_DEV_CREATE_32)
141COMPATIBLE_IOCTL(DM_DEV_REMOVE_32)
142COMPATIBLE_IOCTL(DM_DEV_RENAME_32)
143COMPATIBLE_IOCTL(DM_DEV_SUSPEND_32)
144COMPATIBLE_IOCTL(DM_DEV_STATUS_32)
145COMPATIBLE_IOCTL(DM_DEV_WAIT_32)
146COMPATIBLE_IOCTL(DM_TABLE_LOAD_32)
147COMPATIBLE_IOCTL(DM_TABLE_CLEAR_32)
148COMPATIBLE_IOCTL(DM_TABLE_DEPS_32)
149COMPATIBLE_IOCTL(DM_TABLE_STATUS_32)
150COMPATIBLE_IOCTL(DM_LIST_VERSIONS_32)
151COMPATIBLE_IOCTL(DM_TARGET_MSG_32)
152COMPATIBLE_IOCTL(DM_DEV_SET_GEOMETRY_32)
153COMPATIBLE_IOCTL(DM_VERSION)
154COMPATIBLE_IOCTL(DM_REMOVE_ALL)
155COMPATIBLE_IOCTL(DM_LIST_DEVICES)
156COMPATIBLE_IOCTL(DM_DEV_CREATE)
157COMPATIBLE_IOCTL(DM_DEV_REMOVE)
158COMPATIBLE_IOCTL(DM_DEV_RENAME)
159COMPATIBLE_IOCTL(DM_DEV_SUSPEND)
160COMPATIBLE_IOCTL(DM_DEV_STATUS)
161COMPATIBLE_IOCTL(DM_DEV_WAIT)
162COMPATIBLE_IOCTL(DM_TABLE_LOAD)
163COMPATIBLE_IOCTL(DM_TABLE_CLEAR)
164COMPATIBLE_IOCTL(DM_TABLE_DEPS)
165COMPATIBLE_IOCTL(DM_TABLE_STATUS)
166COMPATIBLE_IOCTL(DM_LIST_VERSIONS)
167COMPATIBLE_IOCTL(DM_TARGET_MSG)
168COMPATIBLE_IOCTL(DM_DEV_SET_GEOMETRY)
169/* Big K */
170COMPATIBLE_IOCTL(PIO_FONT)
171COMPATIBLE_IOCTL(GIO_FONT)
172ULONG_IOCTL(KDSIGACCEPT)
173COMPATIBLE_IOCTL(KDGETKEYCODE)
174COMPATIBLE_IOCTL(KDSETKEYCODE)
175ULONG_IOCTL(KIOCSOUND)
176ULONG_IOCTL(KDMKTONE)
177COMPATIBLE_IOCTL(KDGKBTYPE)
178ULONG_IOCTL(KDSETMODE)
179COMPATIBLE_IOCTL(KDGETMODE)
180ULONG_IOCTL(KDSKBMODE)
181COMPATIBLE_IOCTL(KDGKBMODE)
182ULONG_IOCTL(KDSKBMETA)
183COMPATIBLE_IOCTL(KDGKBMETA)
184COMPATIBLE_IOCTL(KDGKBENT)
185COMPATIBLE_IOCTL(KDSKBENT)
186COMPATIBLE_IOCTL(KDGKBSENT)
187COMPATIBLE_IOCTL(KDSKBSENT)
188COMPATIBLE_IOCTL(KDGKBDIACR)
189COMPATIBLE_IOCTL(KDSKBDIACR)
190COMPATIBLE_IOCTL(KDKBDREP)
191COMPATIBLE_IOCTL(KDGKBLED)
192ULONG_IOCTL(KDSKBLED)
193COMPATIBLE_IOCTL(KDGETLED)
194ULONG_IOCTL(KDSETLED)
195COMPATIBLE_IOCTL(GIO_SCRNMAP)
196COMPATIBLE_IOCTL(PIO_SCRNMAP)
197COMPATIBLE_IOCTL(GIO_UNISCRNMAP)
198COMPATIBLE_IOCTL(PIO_UNISCRNMAP)
199COMPATIBLE_IOCTL(PIO_FONTRESET)
200COMPATIBLE_IOCTL(PIO_UNIMAPCLR)
201/* Big S */
202COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN)
203COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK)
204COMPATIBLE_IOCTL(SCSI_IOCTL_DOORUNLOCK)
205COMPATIBLE_IOCTL(SCSI_IOCTL_TEST_UNIT_READY)
206COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER)
207COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND)
208COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST)
209COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI)
210/* Big T */
211COMPATIBLE_IOCTL(TUNSETNOCSUM)
212COMPATIBLE_IOCTL(TUNSETDEBUG)
213COMPATIBLE_IOCTL(TUNSETPERSIST)
214COMPATIBLE_IOCTL(TUNSETOWNER)
215/* Big V */
216COMPATIBLE_IOCTL(VT_SETMODE)
217COMPATIBLE_IOCTL(VT_GETMODE)
218COMPATIBLE_IOCTL(VT_GETSTATE)
219COMPATIBLE_IOCTL(VT_OPENQRY)
220ULONG_IOCTL(VT_ACTIVATE)
221ULONG_IOCTL(VT_WAITACTIVE)
222ULONG_IOCTL(VT_RELDISP)
223ULONG_IOCTL(VT_DISALLOCATE)
224COMPATIBLE_IOCTL(VT_RESIZE)
225COMPATIBLE_IOCTL(VT_RESIZEX)
226COMPATIBLE_IOCTL(VT_LOCKSWITCH)
227COMPATIBLE_IOCTL(VT_UNLOCKSWITCH)
228COMPATIBLE_IOCTL(VT_GETHIFONTMASK)
229/* Little p (/dev/rtc, /dev/envctrl, etc.) */
230COMPATIBLE_IOCTL(RTC_AIE_ON)
231COMPATIBLE_IOCTL(RTC_AIE_OFF)
232COMPATIBLE_IOCTL(RTC_UIE_ON)
233COMPATIBLE_IOCTL(RTC_UIE_OFF)
234COMPATIBLE_IOCTL(RTC_PIE_ON)
235COMPATIBLE_IOCTL(RTC_PIE_OFF)
236COMPATIBLE_IOCTL(RTC_WIE_ON)
237COMPATIBLE_IOCTL(RTC_WIE_OFF)
238COMPATIBLE_IOCTL(RTC_ALM_SET)
239COMPATIBLE_IOCTL(RTC_ALM_READ)
240COMPATIBLE_IOCTL(RTC_RD_TIME)
241COMPATIBLE_IOCTL(RTC_SET_TIME)
242COMPATIBLE_IOCTL(RTC_WKALM_SET)
243COMPATIBLE_IOCTL(RTC_WKALM_RD)
244/*
245 * These two are only for the sbus rtc driver, but
246 * hwclock tries them on every rtc device first when
247 * running on sparc. On other architectures the entries
248 * are useless but harmless.
249 */
250COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
251COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
252/* Little m */
253COMPATIBLE_IOCTL(MTIOCTOP)
254/* Socket level stuff */
255COMPATIBLE_IOCTL(FIOQSIZE)
256COMPATIBLE_IOCTL(FIOSETOWN)
257COMPATIBLE_IOCTL(SIOCSPGRP)
258COMPATIBLE_IOCTL(FIOGETOWN)
259COMPATIBLE_IOCTL(SIOCGPGRP)
260COMPATIBLE_IOCTL(SIOCATMARK)
261COMPATIBLE_IOCTL(SIOCSIFLINK)
262COMPATIBLE_IOCTL(SIOCSIFENCAP)
263COMPATIBLE_IOCTL(SIOCGIFENCAP)
264COMPATIBLE_IOCTL(SIOCSIFNAME)
265COMPATIBLE_IOCTL(SIOCSARP)
266COMPATIBLE_IOCTL(SIOCGARP)
267COMPATIBLE_IOCTL(SIOCDARP)
268COMPATIBLE_IOCTL(SIOCSRARP)
269COMPATIBLE_IOCTL(SIOCGRARP)
270COMPATIBLE_IOCTL(SIOCDRARP)
271COMPATIBLE_IOCTL(SIOCADDDLCI)
272COMPATIBLE_IOCTL(SIOCDELDLCI)
273COMPATIBLE_IOCTL(SIOCGMIIPHY)
274COMPATIBLE_IOCTL(SIOCGMIIREG)
275COMPATIBLE_IOCTL(SIOCSMIIREG)
276COMPATIBLE_IOCTL(SIOCGIFVLAN)
277COMPATIBLE_IOCTL(SIOCSIFVLAN)
278COMPATIBLE_IOCTL(SIOCBRADDBR)
279COMPATIBLE_IOCTL(SIOCBRDELBR)
280/* SG stuff */
281COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
282COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
283COMPATIBLE_IOCTL(SG_EMULATED_HOST)
284ULONG_IOCTL(SG_SET_TRANSFORM)
285COMPATIBLE_IOCTL(SG_GET_TRANSFORM)
286COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE)
287COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE)
288COMPATIBLE_IOCTL(SG_GET_SCSI_ID)
289COMPATIBLE_IOCTL(SG_SET_FORCE_LOW_DMA)
290COMPATIBLE_IOCTL(SG_GET_LOW_DMA)
291COMPATIBLE_IOCTL(SG_SET_FORCE_PACK_ID)
292COMPATIBLE_IOCTL(SG_GET_PACK_ID)
293COMPATIBLE_IOCTL(SG_GET_NUM_WAITING)
294COMPATIBLE_IOCTL(SG_SET_DEBUG)
295COMPATIBLE_IOCTL(SG_GET_SG_TABLESIZE)
296COMPATIBLE_IOCTL(SG_GET_COMMAND_Q)
297COMPATIBLE_IOCTL(SG_SET_COMMAND_Q)
298COMPATIBLE_IOCTL(SG_GET_VERSION_NUM)
299COMPATIBLE_IOCTL(SG_NEXT_CMD_LEN)
300COMPATIBLE_IOCTL(SG_SCSI_RESET)
301COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE)
302COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN)
303COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN)
304/* PPP stuff */
305COMPATIBLE_IOCTL(PPPIOCGFLAGS)
306COMPATIBLE_IOCTL(PPPIOCSFLAGS)
307COMPATIBLE_IOCTL(PPPIOCGASYNCMAP)
308COMPATIBLE_IOCTL(PPPIOCSASYNCMAP)
309COMPATIBLE_IOCTL(PPPIOCGUNIT)
310COMPATIBLE_IOCTL(PPPIOCGRASYNCMAP)
311COMPATIBLE_IOCTL(PPPIOCSRASYNCMAP)
312COMPATIBLE_IOCTL(PPPIOCGMRU)
313COMPATIBLE_IOCTL(PPPIOCSMRU)
314COMPATIBLE_IOCTL(PPPIOCSMAXCID)
315COMPATIBLE_IOCTL(PPPIOCGXASYNCMAP)
316COMPATIBLE_IOCTL(PPPIOCSXASYNCMAP)
317COMPATIBLE_IOCTL(PPPIOCXFERUNIT)
318/* PPPIOCSCOMPRESS is translated */
319COMPATIBLE_IOCTL(PPPIOCGNPMODE)
320COMPATIBLE_IOCTL(PPPIOCSNPMODE)
321COMPATIBLE_IOCTL(PPPIOCGDEBUG)
322COMPATIBLE_IOCTL(PPPIOCSDEBUG)
323/* PPPIOCSPASS is translated */
324/* PPPIOCSACTIVE is translated */
325/* PPPIOCGIDLE is translated */
326COMPATIBLE_IOCTL(PPPIOCNEWUNIT)
327COMPATIBLE_IOCTL(PPPIOCATTACH)
328COMPATIBLE_IOCTL(PPPIOCDETACH)
329COMPATIBLE_IOCTL(PPPIOCSMRRU)
330COMPATIBLE_IOCTL(PPPIOCCONNECT)
331COMPATIBLE_IOCTL(PPPIOCDISCONN)
332COMPATIBLE_IOCTL(PPPIOCATTCHAN)
333COMPATIBLE_IOCTL(PPPIOCGCHAN)
334/* PPPOX */
335COMPATIBLE_IOCTL(PPPOEIOCSFWD)
336COMPATIBLE_IOCTL(PPPOEIOCDFWD)
337/* LP */
338COMPATIBLE_IOCTL(LPGETSTATUS)
339/* ppdev */
340COMPATIBLE_IOCTL(PPSETMODE)
341COMPATIBLE_IOCTL(PPRSTATUS)
342COMPATIBLE_IOCTL(PPRCONTROL)
343COMPATIBLE_IOCTL(PPWCONTROL)
344COMPATIBLE_IOCTL(PPFCONTROL)
345COMPATIBLE_IOCTL(PPRDATA)
346COMPATIBLE_IOCTL(PPWDATA)
347COMPATIBLE_IOCTL(PPCLAIM)
348COMPATIBLE_IOCTL(PPRELEASE)
349COMPATIBLE_IOCTL(PPYIELD)
350COMPATIBLE_IOCTL(PPEXCL)
351COMPATIBLE_IOCTL(PPDATADIR)
352COMPATIBLE_IOCTL(PPNEGOT)
353COMPATIBLE_IOCTL(PPWCTLONIRQ)
354COMPATIBLE_IOCTL(PPCLRIRQ)
355COMPATIBLE_IOCTL(PPSETPHASE)
356COMPATIBLE_IOCTL(PPGETMODES)
357COMPATIBLE_IOCTL(PPGETMODE)
358COMPATIBLE_IOCTL(PPGETPHASE)
359COMPATIBLE_IOCTL(PPGETFLAGS)
360COMPATIBLE_IOCTL(PPSETFLAGS)
361/* CDROM stuff */
362COMPATIBLE_IOCTL(CDROMPAUSE)
363COMPATIBLE_IOCTL(CDROMRESUME)
364COMPATIBLE_IOCTL(CDROMPLAYMSF)
365COMPATIBLE_IOCTL(CDROMPLAYTRKIND)
366COMPATIBLE_IOCTL(CDROMREADTOCHDR)
367COMPATIBLE_IOCTL(CDROMREADTOCENTRY)
368COMPATIBLE_IOCTL(CDROMSTOP)
369COMPATIBLE_IOCTL(CDROMSTART)
370COMPATIBLE_IOCTL(CDROMEJECT)
371COMPATIBLE_IOCTL(CDROMVOLCTRL)
372COMPATIBLE_IOCTL(CDROMSUBCHNL)
373ULONG_IOCTL(CDROMEJECT_SW)
374COMPATIBLE_IOCTL(CDROMMULTISESSION)
375COMPATIBLE_IOCTL(CDROM_GET_MCN)
376COMPATIBLE_IOCTL(CDROMRESET)
377COMPATIBLE_IOCTL(CDROMVOLREAD)
378COMPATIBLE_IOCTL(CDROMSEEK)
379COMPATIBLE_IOCTL(CDROMPLAYBLK)
380COMPATIBLE_IOCTL(CDROMCLOSETRAY)
381ULONG_IOCTL(CDROM_SET_OPTIONS)
382ULONG_IOCTL(CDROM_CLEAR_OPTIONS)
383ULONG_IOCTL(CDROM_SELECT_SPEED)
384ULONG_IOCTL(CDROM_SELECT_DISC)
385ULONG_IOCTL(CDROM_MEDIA_CHANGED)
386ULONG_IOCTL(CDROM_DRIVE_STATUS)
387COMPATIBLE_IOCTL(CDROM_DISC_STATUS)
388COMPATIBLE_IOCTL(CDROM_CHANGER_NSLOTS)
389ULONG_IOCTL(CDROM_LOCKDOOR)
390ULONG_IOCTL(CDROM_DEBUG)
391COMPATIBLE_IOCTL(CDROM_GET_CAPABILITY)
392/* Ignore cdrom.h about these next 5 ioctls, they absolutely do
393 * not take a struct cdrom_read, instead they take a struct cdrom_msf
394 * which is compatible.
395 */
396COMPATIBLE_IOCTL(CDROMREADMODE2)
397COMPATIBLE_IOCTL(CDROMREADMODE1)
398COMPATIBLE_IOCTL(CDROMREADRAW)
399COMPATIBLE_IOCTL(CDROMREADCOOKED)
400COMPATIBLE_IOCTL(CDROMREADALL)
401/* DVD ioctls */
402COMPATIBLE_IOCTL(DVD_READ_STRUCT)
403COMPATIBLE_IOCTL(DVD_WRITE_STRUCT)
404COMPATIBLE_IOCTL(DVD_AUTH)
405/* pktcdvd */
406COMPATIBLE_IOCTL(PACKET_CTRL_CMD)
407/* Big A */
408/* sparc only */
409/* Big Q for sound/OSS */
410COMPATIBLE_IOCTL(SNDCTL_SEQ_RESET)
411COMPATIBLE_IOCTL(SNDCTL_SEQ_SYNC)
412COMPATIBLE_IOCTL(SNDCTL_SYNTH_INFO)
413COMPATIBLE_IOCTL(SNDCTL_SEQ_CTRLRATE)
414COMPATIBLE_IOCTL(SNDCTL_SEQ_GETOUTCOUNT)
415COMPATIBLE_IOCTL(SNDCTL_SEQ_GETINCOUNT)
416COMPATIBLE_IOCTL(SNDCTL_SEQ_PERCMODE)
417COMPATIBLE_IOCTL(SNDCTL_FM_LOAD_INSTR)
418COMPATIBLE_IOCTL(SNDCTL_SEQ_TESTMIDI)
419COMPATIBLE_IOCTL(SNDCTL_SEQ_RESETSAMPLES)
420COMPATIBLE_IOCTL(SNDCTL_SEQ_NRSYNTHS)
421COMPATIBLE_IOCTL(SNDCTL_SEQ_NRMIDIS)
422COMPATIBLE_IOCTL(SNDCTL_MIDI_INFO)
423COMPATIBLE_IOCTL(SNDCTL_SEQ_THRESHOLD)
424COMPATIBLE_IOCTL(SNDCTL_SYNTH_MEMAVL)
425COMPATIBLE_IOCTL(SNDCTL_FM_4OP_ENABLE)
426COMPATIBLE_IOCTL(SNDCTL_SEQ_PANIC)
427COMPATIBLE_IOCTL(SNDCTL_SEQ_OUTOFBAND)
428COMPATIBLE_IOCTL(SNDCTL_SEQ_GETTIME)
429COMPATIBLE_IOCTL(SNDCTL_SYNTH_ID)
430COMPATIBLE_IOCTL(SNDCTL_SYNTH_CONTROL)
431COMPATIBLE_IOCTL(SNDCTL_SYNTH_REMOVESAMPLE)
432/* Big T for sound/OSS */
433COMPATIBLE_IOCTL(SNDCTL_TMR_TIMEBASE)
434COMPATIBLE_IOCTL(SNDCTL_TMR_START)
435COMPATIBLE_IOCTL(SNDCTL_TMR_STOP)
436COMPATIBLE_IOCTL(SNDCTL_TMR_CONTINUE)
437COMPATIBLE_IOCTL(SNDCTL_TMR_TEMPO)
438COMPATIBLE_IOCTL(SNDCTL_TMR_SOURCE)
439COMPATIBLE_IOCTL(SNDCTL_TMR_METRONOME)
440COMPATIBLE_IOCTL(SNDCTL_TMR_SELECT)
441/* Little m for sound/OSS */
442COMPATIBLE_IOCTL(SNDCTL_MIDI_PRETIME)
443COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUMODE)
444COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUCMD)
445/* Big P for sound/OSS */
446COMPATIBLE_IOCTL(SNDCTL_DSP_RESET)
447COMPATIBLE_IOCTL(SNDCTL_DSP_SYNC)
448COMPATIBLE_IOCTL(SNDCTL_DSP_SPEED)
449COMPATIBLE_IOCTL(SNDCTL_DSP_STEREO)
450COMPATIBLE_IOCTL(SNDCTL_DSP_GETBLKSIZE)
451COMPATIBLE_IOCTL(SNDCTL_DSP_CHANNELS)
452COMPATIBLE_IOCTL(SOUND_PCM_WRITE_FILTER)
453COMPATIBLE_IOCTL(SNDCTL_DSP_POST)
454COMPATIBLE_IOCTL(SNDCTL_DSP_SUBDIVIDE)
455COMPATIBLE_IOCTL(SNDCTL_DSP_SETFRAGMENT)
456COMPATIBLE_IOCTL(SNDCTL_DSP_GETFMTS)
457COMPATIBLE_IOCTL(SNDCTL_DSP_SETFMT)
458COMPATIBLE_IOCTL(SNDCTL_DSP_GETOSPACE)
459COMPATIBLE_IOCTL(SNDCTL_DSP_GETISPACE)
460COMPATIBLE_IOCTL(SNDCTL_DSP_NONBLOCK)
461COMPATIBLE_IOCTL(SNDCTL_DSP_GETCAPS)
462COMPATIBLE_IOCTL(SNDCTL_DSP_GETTRIGGER)
463COMPATIBLE_IOCTL(SNDCTL_DSP_SETTRIGGER)
464COMPATIBLE_IOCTL(SNDCTL_DSP_GETIPTR)
465COMPATIBLE_IOCTL(SNDCTL_DSP_GETOPTR)
466/* SNDCTL_DSP_MAPINBUF, XXX needs translation */
467/* SNDCTL_DSP_MAPOUTBUF, XXX needs translation */
468COMPATIBLE_IOCTL(SNDCTL_DSP_SETSYNCRO)
469COMPATIBLE_IOCTL(SNDCTL_DSP_SETDUPLEX)
470COMPATIBLE_IOCTL(SNDCTL_DSP_GETODELAY)
471COMPATIBLE_IOCTL(SNDCTL_DSP_PROFILE)
472COMPATIBLE_IOCTL(SOUND_PCM_READ_RATE)
473COMPATIBLE_IOCTL(SOUND_PCM_READ_CHANNELS)
474COMPATIBLE_IOCTL(SOUND_PCM_READ_BITS)
475COMPATIBLE_IOCTL(SOUND_PCM_READ_FILTER)
476/* Big C for sound/OSS */
477COMPATIBLE_IOCTL(SNDCTL_COPR_RESET)
478COMPATIBLE_IOCTL(SNDCTL_COPR_LOAD)
479COMPATIBLE_IOCTL(SNDCTL_COPR_RDATA)
480COMPATIBLE_IOCTL(SNDCTL_COPR_RCODE)
481COMPATIBLE_IOCTL(SNDCTL_COPR_WDATA)
482COMPATIBLE_IOCTL(SNDCTL_COPR_WCODE)
483COMPATIBLE_IOCTL(SNDCTL_COPR_RUN)
484COMPATIBLE_IOCTL(SNDCTL_COPR_HALT)
485COMPATIBLE_IOCTL(SNDCTL_COPR_SENDMSG)
486COMPATIBLE_IOCTL(SNDCTL_COPR_RCVMSG)
487/* Big M for sound/OSS */
488COMPATIBLE_IOCTL(SOUND_MIXER_READ_VOLUME)
489COMPATIBLE_IOCTL(SOUND_MIXER_READ_BASS)
490COMPATIBLE_IOCTL(SOUND_MIXER_READ_TREBLE)
491COMPATIBLE_IOCTL(SOUND_MIXER_READ_SYNTH)
492COMPATIBLE_IOCTL(SOUND_MIXER_READ_PCM)
493COMPATIBLE_IOCTL(SOUND_MIXER_READ_SPEAKER)
494COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE)
495COMPATIBLE_IOCTL(SOUND_MIXER_READ_MIC)
496COMPATIBLE_IOCTL(SOUND_MIXER_READ_CD)
497COMPATIBLE_IOCTL(SOUND_MIXER_READ_IMIX)
498COMPATIBLE_IOCTL(SOUND_MIXER_READ_ALTPCM)
499COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECLEV)
500COMPATIBLE_IOCTL(SOUND_MIXER_READ_IGAIN)
501COMPATIBLE_IOCTL(SOUND_MIXER_READ_OGAIN)
502COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE1)
503COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE2)
504COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE3)
505COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL1))
506COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL2))
507COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL3))
508COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEIN))
509COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEOUT))
510COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_VIDEO))
511COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_RADIO))
512COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_MONITOR))
513COMPATIBLE_IOCTL(SOUND_MIXER_READ_MUTE)
514/* SOUND_MIXER_READ_ENHANCE, same value as READ_MUTE */
515/* SOUND_MIXER_READ_LOUD, same value as READ_MUTE */
516COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECSRC)
517COMPATIBLE_IOCTL(SOUND_MIXER_READ_DEVMASK)
518COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECMASK)
519COMPATIBLE_IOCTL(SOUND_MIXER_READ_STEREODEVS)
520COMPATIBLE_IOCTL(SOUND_MIXER_READ_CAPS)
521COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_VOLUME)
522COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_BASS)
523COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_TREBLE)
524COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SYNTH)
525COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_PCM)
526COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SPEAKER)
527COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE)
528COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MIC)
529COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_CD)
530COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IMIX)
531COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_ALTPCM)
532COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECLEV)
533COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IGAIN)
534COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_OGAIN)
535COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE1)
536COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE2)
537COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE3)
538COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL1))
539COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL2))
540COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL3))
541COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEIN))
542COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEOUT))
543COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_VIDEO))
544COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_RADIO))
545COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_MONITOR))
546COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MUTE)
547/* SOUND_MIXER_WRITE_ENHANCE, same value as WRITE_MUTE */
548/* SOUND_MIXER_WRITE_LOUD, same value as WRITE_MUTE */
549COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECSRC)
550COMPATIBLE_IOCTL(SOUND_MIXER_INFO)
551COMPATIBLE_IOCTL(SOUND_OLD_MIXER_INFO)
552COMPATIBLE_IOCTL(SOUND_MIXER_ACCESS)
553COMPATIBLE_IOCTL(SOUND_MIXER_AGC)
554COMPATIBLE_IOCTL(SOUND_MIXER_3DSE)
555COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE1)
556COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE2)
557COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE3)
558COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE4)
559COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5)
560COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS)
561COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS)
562COMPATIBLE_IOCTL(OSS_GETVERSION)
563/* AUTOFS */
564ULONG_IOCTL(AUTOFS_IOC_READY)
565ULONG_IOCTL(AUTOFS_IOC_FAIL)
566COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
567COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
568COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
569COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
570COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER)
571COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST)
572COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST)
573COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)
574/* Raw devices */
575COMPATIBLE_IOCTL(RAW_SETBIND)
576COMPATIBLE_IOCTL(RAW_GETBIND)
577/* SMB ioctls which do not need any translations */
578COMPATIBLE_IOCTL(SMB_IOC_NEWCONN)
579/* Little a */
580COMPATIBLE_IOCTL(ATMSIGD_CTRL)
581COMPATIBLE_IOCTL(ATMARPD_CTRL)
582COMPATIBLE_IOCTL(ATMLEC_CTRL)
583COMPATIBLE_IOCTL(ATMLEC_MCAST)
584COMPATIBLE_IOCTL(ATMLEC_DATA)
585COMPATIBLE_IOCTL(ATM_SETSC)
586COMPATIBLE_IOCTL(SIOCSIFATMTCP)
587COMPATIBLE_IOCTL(SIOCMKCLIP)
588COMPATIBLE_IOCTL(ATMARP_MKIP)
589COMPATIBLE_IOCTL(ATMARP_SETENTRY)
590COMPATIBLE_IOCTL(ATMARP_ENCAP)
591COMPATIBLE_IOCTL(ATMTCP_CREATE)
592COMPATIBLE_IOCTL(ATMTCP_REMOVE)
593COMPATIBLE_IOCTL(ATMMPC_CTRL)
594COMPATIBLE_IOCTL(ATMMPC_DATA)
595/* Watchdog */
596COMPATIBLE_IOCTL(WDIOC_GETSUPPORT)
597COMPATIBLE_IOCTL(WDIOC_GETSTATUS)
598COMPATIBLE_IOCTL(WDIOC_GETBOOTSTATUS)
599COMPATIBLE_IOCTL(WDIOC_GETTEMP)
600COMPATIBLE_IOCTL(WDIOC_SETOPTIONS)
601COMPATIBLE_IOCTL(WDIOC_KEEPALIVE)
602COMPATIBLE_IOCTL(WDIOC_SETTIMEOUT)
603COMPATIBLE_IOCTL(WDIOC_GETTIMEOUT)
604/* Big R */
605COMPATIBLE_IOCTL(RNDGETENTCNT)
606COMPATIBLE_IOCTL(RNDADDTOENTCNT)
607COMPATIBLE_IOCTL(RNDGETPOOL)
608COMPATIBLE_IOCTL(RNDADDENTROPY)
609COMPATIBLE_IOCTL(RNDZAPENTCNT)
610COMPATIBLE_IOCTL(RNDCLEARPOOL)
611/* Bluetooth */
612COMPATIBLE_IOCTL(HCIDEVUP)
613COMPATIBLE_IOCTL(HCIDEVDOWN)
614COMPATIBLE_IOCTL(HCIDEVRESET)
615COMPATIBLE_IOCTL(HCIDEVRESTAT)
616COMPATIBLE_IOCTL(HCIGETDEVLIST)
617COMPATIBLE_IOCTL(HCIGETDEVINFO)
618COMPATIBLE_IOCTL(HCIGETCONNLIST)
619COMPATIBLE_IOCTL(HCIGETCONNINFO)
620COMPATIBLE_IOCTL(HCISETRAW)
621COMPATIBLE_IOCTL(HCISETSCAN)
622COMPATIBLE_IOCTL(HCISETAUTH)
623COMPATIBLE_IOCTL(HCISETENCRYPT)
624COMPATIBLE_IOCTL(HCISETPTYPE)
625COMPATIBLE_IOCTL(HCISETLINKPOL)
626COMPATIBLE_IOCTL(HCISETLINKMODE)
627COMPATIBLE_IOCTL(HCISETACLMTU)
628COMPATIBLE_IOCTL(HCISETSCOMTU)
629COMPATIBLE_IOCTL(HCIINQUIRY)
630COMPATIBLE_IOCTL(HCIUARTSETPROTO)
631COMPATIBLE_IOCTL(HCIUARTGETPROTO)
632COMPATIBLE_IOCTL(RFCOMMCREATEDEV)
633COMPATIBLE_IOCTL(RFCOMMRELEASEDEV)
634COMPATIBLE_IOCTL(RFCOMMGETDEVLIST)
635COMPATIBLE_IOCTL(RFCOMMGETDEVINFO)
636COMPATIBLE_IOCTL(RFCOMMSTEALDLC)
637COMPATIBLE_IOCTL(BNEPCONNADD)
638COMPATIBLE_IOCTL(BNEPCONNDEL)
639COMPATIBLE_IOCTL(BNEPGETCONNLIST)
640COMPATIBLE_IOCTL(BNEPGETCONNINFO)
641COMPATIBLE_IOCTL(CMTPCONNADD)
642COMPATIBLE_IOCTL(CMTPCONNDEL)
643COMPATIBLE_IOCTL(CMTPGETCONNLIST)
644COMPATIBLE_IOCTL(CMTPGETCONNINFO)
645COMPATIBLE_IOCTL(HIDPCONNADD)
646COMPATIBLE_IOCTL(HIDPCONNDEL)
647COMPATIBLE_IOCTL(HIDPGETCONNLIST)
648COMPATIBLE_IOCTL(HIDPGETCONNINFO)
649/* CAPI */
650COMPATIBLE_IOCTL(CAPI_REGISTER)
651COMPATIBLE_IOCTL(CAPI_GET_MANUFACTURER)
652COMPATIBLE_IOCTL(CAPI_GET_VERSION)
653COMPATIBLE_IOCTL(CAPI_GET_SERIAL)
654COMPATIBLE_IOCTL(CAPI_GET_PROFILE)
655COMPATIBLE_IOCTL(CAPI_MANUFACTURER_CMD)
656COMPATIBLE_IOCTL(CAPI_GET_ERRCODE)
657COMPATIBLE_IOCTL(CAPI_INSTALLED)
658COMPATIBLE_IOCTL(CAPI_GET_FLAGS)
659COMPATIBLE_IOCTL(CAPI_SET_FLAGS)
660COMPATIBLE_IOCTL(CAPI_CLR_FLAGS)
661COMPATIBLE_IOCTL(CAPI_NCCI_OPENCOUNT)
662COMPATIBLE_IOCTL(CAPI_NCCI_GETUNIT)
663/* Siemens Gigaset */
664COMPATIBLE_IOCTL(GIGASET_REDIR)
665COMPATIBLE_IOCTL(GIGASET_CONFIG)
666COMPATIBLE_IOCTL(GIGASET_BRKCHARS)
667COMPATIBLE_IOCTL(GIGASET_VERSION)
668/* Misc. */
669COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */
670COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */
671COMPATIBLE_IOCTL(PCIIOC_CONTROLLER)
672COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO)
673COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM)
674COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE)
675/* USB */
676COMPATIBLE_IOCTL(USBDEVFS_RESETEP)
677COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE)
678COMPATIBLE_IOCTL(USBDEVFS_SETCONFIGURATION)
679COMPATIBLE_IOCTL(USBDEVFS_GETDRIVER)
680COMPATIBLE_IOCTL(USBDEVFS_DISCARDURB)
681COMPATIBLE_IOCTL(USBDEVFS_CLAIMINTERFACE)
682COMPATIBLE_IOCTL(USBDEVFS_RELEASEINTERFACE)
683COMPATIBLE_IOCTL(USBDEVFS_CONNECTINFO)
684COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO)
685COMPATIBLE_IOCTL(USBDEVFS_RESET)
686COMPATIBLE_IOCTL(USBDEVFS_SUBMITURB32)
687COMPATIBLE_IOCTL(USBDEVFS_REAPURB32)
688COMPATIBLE_IOCTL(USBDEVFS_REAPURBNDELAY32)
689COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT)
690/* MTD */
691COMPATIBLE_IOCTL(MEMGETINFO)
692COMPATIBLE_IOCTL(MEMERASE)
693COMPATIBLE_IOCTL(MEMLOCK)
694COMPATIBLE_IOCTL(MEMUNLOCK)
695COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
696COMPATIBLE_IOCTL(MEMGETREGIONINFO)
697COMPATIBLE_IOCTL(MEMGETBADBLOCK)
698COMPATIBLE_IOCTL(MEMSETBADBLOCK)
699/* NBD */
700ULONG_IOCTL(NBD_SET_SOCK)
701ULONG_IOCTL(NBD_SET_BLKSIZE)
702ULONG_IOCTL(NBD_SET_SIZE)
703COMPATIBLE_IOCTL(NBD_DO_IT)
704COMPATIBLE_IOCTL(NBD_CLEAR_SOCK)
705COMPATIBLE_IOCTL(NBD_CLEAR_QUE)
706COMPATIBLE_IOCTL(NBD_PRINT_DEBUG)
707ULONG_IOCTL(NBD_SET_SIZE_BLOCKS)
708COMPATIBLE_IOCTL(NBD_DISCONNECT)
709/* i2c */
710COMPATIBLE_IOCTL(I2C_SLAVE)
711COMPATIBLE_IOCTL(I2C_SLAVE_FORCE)
712COMPATIBLE_IOCTL(I2C_TENBIT)
713COMPATIBLE_IOCTL(I2C_PEC)
714COMPATIBLE_IOCTL(I2C_RETRIES)
715COMPATIBLE_IOCTL(I2C_TIMEOUT)
716/* wireless */
717COMPATIBLE_IOCTL(SIOCSIWCOMMIT)
718COMPATIBLE_IOCTL(SIOCGIWNAME)
719COMPATIBLE_IOCTL(SIOCSIWNWID)
720COMPATIBLE_IOCTL(SIOCGIWNWID)
721COMPATIBLE_IOCTL(SIOCSIWFREQ)
722COMPATIBLE_IOCTL(SIOCGIWFREQ)
723COMPATIBLE_IOCTL(SIOCSIWMODE)
724COMPATIBLE_IOCTL(SIOCGIWMODE)
725COMPATIBLE_IOCTL(SIOCSIWSENS)
726COMPATIBLE_IOCTL(SIOCGIWSENS)
727COMPATIBLE_IOCTL(SIOCSIWRANGE)
728COMPATIBLE_IOCTL(SIOCSIWPRIV)
729COMPATIBLE_IOCTL(SIOCGIWPRIV)
730COMPATIBLE_IOCTL(SIOCSIWSTATS)
731COMPATIBLE_IOCTL(SIOCGIWSTATS)
732COMPATIBLE_IOCTL(SIOCSIWAP)
733COMPATIBLE_IOCTL(SIOCGIWAP)
734COMPATIBLE_IOCTL(SIOCSIWSCAN)
735COMPATIBLE_IOCTL(SIOCSIWRATE)
736COMPATIBLE_IOCTL(SIOCGIWRATE)
737COMPATIBLE_IOCTL(SIOCSIWRTS)
738COMPATIBLE_IOCTL(SIOCGIWRTS)
739COMPATIBLE_IOCTL(SIOCSIWFRAG)
740COMPATIBLE_IOCTL(SIOCGIWFRAG)
741COMPATIBLE_IOCTL(SIOCSIWTXPOW)
742COMPATIBLE_IOCTL(SIOCGIWTXPOW)
743COMPATIBLE_IOCTL(SIOCSIWRETRY)
744COMPATIBLE_IOCTL(SIOCGIWRETRY)
745COMPATIBLE_IOCTL(SIOCSIWPOWER)
746COMPATIBLE_IOCTL(SIOCGIWPOWER)
747/* hiddev */
748COMPATIBLE_IOCTL(HIDIOCGVERSION)
749COMPATIBLE_IOCTL(HIDIOCAPPLICATION)
750COMPATIBLE_IOCTL(HIDIOCGDEVINFO)
751COMPATIBLE_IOCTL(HIDIOCGSTRING)
752COMPATIBLE_IOCTL(HIDIOCINITREPORT)
753COMPATIBLE_IOCTL(HIDIOCGREPORT)
754COMPATIBLE_IOCTL(HIDIOCSREPORT)
755COMPATIBLE_IOCTL(HIDIOCGREPORTINFO)
756COMPATIBLE_IOCTL(HIDIOCGFIELDINFO)
757COMPATIBLE_IOCTL(HIDIOCGUSAGE)
758COMPATIBLE_IOCTL(HIDIOCSUSAGE)
759COMPATIBLE_IOCTL(HIDIOCGUCODE)
760COMPATIBLE_IOCTL(HIDIOCGFLAG)
761COMPATIBLE_IOCTL(HIDIOCSFLAG)
762COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX)
763COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO)
764/* dvb */
765COMPATIBLE_IOCTL(AUDIO_STOP)
766COMPATIBLE_IOCTL(AUDIO_PLAY)
767COMPATIBLE_IOCTL(AUDIO_PAUSE)
768COMPATIBLE_IOCTL(AUDIO_CONTINUE)
769COMPATIBLE_IOCTL(AUDIO_SELECT_SOURCE)
770COMPATIBLE_IOCTL(AUDIO_SET_MUTE)
771COMPATIBLE_IOCTL(AUDIO_SET_AV_SYNC)
772COMPATIBLE_IOCTL(AUDIO_SET_BYPASS_MODE)
773COMPATIBLE_IOCTL(AUDIO_CHANNEL_SELECT)
774COMPATIBLE_IOCTL(AUDIO_GET_STATUS)
775COMPATIBLE_IOCTL(AUDIO_GET_CAPABILITIES)
776COMPATIBLE_IOCTL(AUDIO_CLEAR_BUFFER)
777COMPATIBLE_IOCTL(AUDIO_SET_ID)
778COMPATIBLE_IOCTL(AUDIO_SET_MIXER)
779COMPATIBLE_IOCTL(AUDIO_SET_STREAMTYPE)
780COMPATIBLE_IOCTL(AUDIO_SET_EXT_ID)
781COMPATIBLE_IOCTL(AUDIO_SET_ATTRIBUTES)
782COMPATIBLE_IOCTL(AUDIO_SET_KARAOKE)
783COMPATIBLE_IOCTL(DMX_START)
784COMPATIBLE_IOCTL(DMX_STOP)
785COMPATIBLE_IOCTL(DMX_SET_FILTER)
786COMPATIBLE_IOCTL(DMX_SET_PES_FILTER)
787COMPATIBLE_IOCTL(DMX_SET_BUFFER_SIZE)
788COMPATIBLE_IOCTL(DMX_GET_PES_PIDS)
789COMPATIBLE_IOCTL(DMX_GET_CAPS)
790COMPATIBLE_IOCTL(DMX_SET_SOURCE)
791COMPATIBLE_IOCTL(DMX_GET_STC)
792COMPATIBLE_IOCTL(FE_GET_INFO)
793COMPATIBLE_IOCTL(FE_DISEQC_RESET_OVERLOAD)
794COMPATIBLE_IOCTL(FE_DISEQC_SEND_MASTER_CMD)
795COMPATIBLE_IOCTL(FE_DISEQC_RECV_SLAVE_REPLY)
796COMPATIBLE_IOCTL(FE_DISEQC_SEND_BURST)
797COMPATIBLE_IOCTL(FE_SET_TONE)
798COMPATIBLE_IOCTL(FE_SET_VOLTAGE)
799COMPATIBLE_IOCTL(FE_ENABLE_HIGH_LNB_VOLTAGE)
800COMPATIBLE_IOCTL(FE_READ_STATUS)
801COMPATIBLE_IOCTL(FE_READ_BER)
802COMPATIBLE_IOCTL(FE_READ_SIGNAL_STRENGTH)
803COMPATIBLE_IOCTL(FE_READ_SNR)
804COMPATIBLE_IOCTL(FE_READ_UNCORRECTED_BLOCKS)
805COMPATIBLE_IOCTL(FE_SET_FRONTEND)
806COMPATIBLE_IOCTL(FE_GET_FRONTEND)
807COMPATIBLE_IOCTL(FE_GET_EVENT)
808COMPATIBLE_IOCTL(FE_DISHNETWORK_SEND_LEGACY_CMD)
809COMPATIBLE_IOCTL(VIDEO_STOP)
810COMPATIBLE_IOCTL(VIDEO_PLAY)
811COMPATIBLE_IOCTL(VIDEO_FREEZE)
812COMPATIBLE_IOCTL(VIDEO_CONTINUE)
813COMPATIBLE_IOCTL(VIDEO_SELECT_SOURCE)
814COMPATIBLE_IOCTL(VIDEO_SET_BLANK)
815COMPATIBLE_IOCTL(VIDEO_GET_STATUS)
816COMPATIBLE_IOCTL(VIDEO_SET_DISPLAY_FORMAT)
817COMPATIBLE_IOCTL(VIDEO_FAST_FORWARD)
818COMPATIBLE_IOCTL(VIDEO_SLOWMOTION)
819COMPATIBLE_IOCTL(VIDEO_GET_CAPABILITIES)
820COMPATIBLE_IOCTL(VIDEO_CLEAR_BUFFER)
821COMPATIBLE_IOCTL(VIDEO_SET_ID)
822COMPATIBLE_IOCTL(VIDEO_SET_STREAMTYPE)
823COMPATIBLE_IOCTL(VIDEO_SET_FORMAT)
824COMPATIBLE_IOCTL(VIDEO_SET_SYSTEM)
825COMPATIBLE_IOCTL(VIDEO_SET_HIGHLIGHT)
826COMPATIBLE_IOCTL(VIDEO_SET_SPU)
827COMPATIBLE_IOCTL(VIDEO_GET_NAVI)
828COMPATIBLE_IOCTL(VIDEO_SET_ATTRIBUTES)
829COMPATIBLE_IOCTL(VIDEO_GET_SIZE)
830COMPATIBLE_IOCTL(VIDEO_GET_FRAME_RATE)
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 9008eabb9c3d..a9f794716a81 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -22,6 +22,9 @@
22 __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ 22 __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
23 (typeof(ptr)) (__ptr + (off)); }) 23 (typeof(ptr)) (__ptr + (off)); })
24 24
25/* &a[0] degrades to a pointer: a different type from an array */
26#define __must_be_array(a) \
27 BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
25 28
26#define inline inline __attribute__((always_inline)) 29#define inline inline __attribute__((always_inline))
27#define __inline__ __inline__ __attribute__((always_inline)) 30#define __inline__ __inline__ __attribute__((always_inline))
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
index 1698b845761f..ecd621fd27d2 100644
--- a/include/linux/compiler-gcc3.h
+++ b/include/linux/compiler-gcc3.h
@@ -13,4 +13,10 @@
13#define __must_check __attribute__((warn_unused_result)) 13#define __must_check __attribute__((warn_unused_result))
14#endif 14#endif
15 15
16/*
17 * A trick to suppress uninitialized variable warning without generating any
18 * code
19 */
20#define uninitialized_var(x) x = x
21
16#define __always_inline inline __attribute__((always_inline)) 22#define __always_inline inline __attribute__((always_inline))
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 6f5cc6f0e7a6..fd0cc7c4a636 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -16,3 +16,9 @@
16#define __must_check __attribute__((warn_unused_result)) 16#define __must_check __attribute__((warn_unused_result))
17#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) 17#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
18#define __always_inline inline __attribute__((always_inline)) 18#define __always_inline inline __attribute__((always_inline))
19
20/*
21 * A trick to suppress uninitialized variable warning without generating any
22 * code
23 */
24#define uninitialized_var(x) x = x
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h
index 1d1c3ceaff4e..b769961e6f23 100644
--- a/include/linux/compiler-intel.h
+++ b/include/linux/compiler-intel.h
@@ -21,4 +21,9 @@
21 __ptr = (unsigned long) (ptr); \ 21 __ptr = (unsigned long) (ptr); \
22 (typeof(ptr)) (__ptr + (off)); }) 22 (typeof(ptr)) (__ptr + (off)); })
23 23
24/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
25#define __must_be_array(a) 0
26
24#endif 27#endif
28
29#define uninitialized_var(x) x
diff --git a/include/linux/console.h b/include/linux/console.h
index de25ee3b7919..62ef6e11d0d2 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -51,7 +51,7 @@ struct consw {
51 int (*con_scrolldelta)(struct vc_data *, int); 51 int (*con_scrolldelta)(struct vc_data *, int);
52 int (*con_set_origin)(struct vc_data *); 52 int (*con_set_origin)(struct vc_data *);
53 void (*con_save_screen)(struct vc_data *); 53 void (*con_save_screen)(struct vc_data *);
54 u8 (*con_build_attr)(struct vc_data *, u8, u8, u8, u8, u8); 54 u8 (*con_build_attr)(struct vc_data *, u8, u8, u8, u8, u8, u8);
55 void (*con_invert_region)(struct vc_data *, u16 *, int); 55 void (*con_invert_region)(struct vc_data *, u16 *, int);
56 u16 *(*con_screen_pos)(struct vc_data *, int); 56 u16 *(*con_screen_pos)(struct vc_data *, int);
57 unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); 57 unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *);
@@ -92,9 +92,8 @@ void give_up_console(const struct consw *sw);
92#define CON_BOOT (8) 92#define CON_BOOT (8)
93#define CON_ANYTIME (16) /* Safe to call when cpu is offline */ 93#define CON_ANYTIME (16) /* Safe to call when cpu is offline */
94 94
95struct console 95struct console {
96{ 96 char name[16];
97 char name[8];
98 void (*write)(struct console *, const char *, unsigned); 97 void (*write)(struct console *, const char *, unsigned);
99 int (*read)(struct console *, char *, unsigned); 98 int (*read)(struct console *, char *, unsigned);
100 struct tty_driver *(*device)(struct console *, int *); 99 struct tty_driver *(*device)(struct console *, int *);
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index a86162b26c0d..a461f76fb004 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -37,6 +37,7 @@ struct vc_data {
37 unsigned char vc_color; /* Foreground & background */ 37 unsigned char vc_color; /* Foreground & background */
38 unsigned char vc_s_color; /* Saved foreground & background */ 38 unsigned char vc_s_color; /* Saved foreground & background */
39 unsigned char vc_ulcolor; /* Color for underline mode */ 39 unsigned char vc_ulcolor; /* Color for underline mode */
40 unsigned char vc_itcolor;
40 unsigned char vc_halfcolor; /* Color for half intensity mode */ 41 unsigned char vc_halfcolor; /* Color for half intensity mode */
41 /* cursor */ 42 /* cursor */
42 unsigned int vc_cursor_type; 43 unsigned int vc_cursor_type;
@@ -71,10 +72,12 @@ struct vc_data {
71 unsigned int vc_deccolm : 1; /* 80/132 Column Mode */ 72 unsigned int vc_deccolm : 1; /* 80/132 Column Mode */
72 /* attribute flags */ 73 /* attribute flags */
73 unsigned int vc_intensity : 2; /* 0=half-bright, 1=normal, 2=bold */ 74 unsigned int vc_intensity : 2; /* 0=half-bright, 1=normal, 2=bold */
75 unsigned int vc_italic:1;
74 unsigned int vc_underline : 1; 76 unsigned int vc_underline : 1;
75 unsigned int vc_blink : 1; 77 unsigned int vc_blink : 1;
76 unsigned int vc_reverse : 1; 78 unsigned int vc_reverse : 1;
77 unsigned int vc_s_intensity : 2; /* saved rendition */ 79 unsigned int vc_s_intensity : 2; /* saved rendition */
80 unsigned int vc_s_italic:1;
78 unsigned int vc_s_underline : 1; 81 unsigned int vc_s_underline : 1;
79 unsigned int vc_s_blink : 1; 82 unsigned int vc_s_blink : 1;
80 unsigned int vc_s_reverse : 1; 83 unsigned int vc_s_reverse : 1;
diff --git a/include/asm-x86_64/const.h b/include/linux/const.h
index 54fb08f3db9b..07b300bfe34b 100644
--- a/include/asm-x86_64/const.h
+++ b/include/linux/const.h
@@ -1,11 +1,11 @@
1/* const.h: Macros for dealing with constants. */ 1/* const.h: Macros for dealing with constants. */
2 2
3#ifndef _X86_64_CONST_H 3#ifndef _LINUX_CONST_H
4#define _X86_64_CONST_H 4#define _LINUX_CONST_H
5 5
6/* Some constant macros are used in both assembler and 6/* Some constant macros are used in both assembler and
7 * C code. Therefore we cannot annotate them always with 7 * C code. Therefore we cannot annotate them always with
8 * 'UL' and other type specificers unilaterally. We 8 * 'UL' and other type specifiers unilaterally. We
9 * use the following macros to deal with this. 9 * use the following macros to deal with this.
10 */ 10 */
11 11
@@ -16,5 +16,4 @@
16#define _AC(X,Y) __AC(X,Y) 16#define _AC(X,Y) __AC(X,Y)
17#endif 17#endif
18 18
19 19#endif /* !(_LINUX_CONST_H) */
20#endif /* !(_X86_64_CONST_H) */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index c22b0dfcbcd2..3b2df2523f1d 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -41,6 +41,9 @@ extern void cpu_remove_sysdev_attr(struct sysdev_attribute *attr);
41extern int cpu_add_sysdev_attr_group(struct attribute_group *attrs); 41extern int cpu_add_sysdev_attr_group(struct attribute_group *attrs);
42extern void cpu_remove_sysdev_attr_group(struct attribute_group *attrs); 42extern void cpu_remove_sysdev_attr_group(struct attribute_group *attrs);
43 43
44extern struct sysdev_attribute attr_sched_mc_power_savings;
45extern struct sysdev_attribute attr_sched_smt_power_savings;
46extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
44 47
45#ifdef CONFIG_HOTPLUG_CPU 48#ifdef CONFIG_HOTPLUG_CPU
46extern void unregister_cpu(struct cpu *cpu); 49extern void unregister_cpu(struct cpu *cpu);
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h
index 46d8254c1a79..72aa00cc4b2d 100644
--- a/include/linux/cyclades.h
+++ b/include/linux/cyclades.h
@@ -67,6 +67,8 @@
67#ifndef _LINUX_CYCLADES_H 67#ifndef _LINUX_CYCLADES_H
68#define _LINUX_CYCLADES_H 68#define _LINUX_CYCLADES_H
69 69
70#include <linux/types.h>
71
70struct cyclades_monitor { 72struct cyclades_monitor {
71 unsigned long int_count; 73 unsigned long int_count;
72 unsigned long char_count; 74 unsigned long char_count;
@@ -108,7 +110,6 @@ struct cyclades_idle_stats {
108#define CYZSETPOLLCYCLE 0x43590e 110#define CYZSETPOLLCYCLE 0x43590e
109#define CYZGETPOLLCYCLE 0x43590f 111#define CYZGETPOLLCYCLE 0x43590f
110#define CYGETCD1400VER 0x435910 112#define CYGETCD1400VER 0x435910
111#define CYGETCARDINFO 0x435911
112#define CYSETWAIT 0x435912 113#define CYSETWAIT 0x435912
113#define CYGETWAIT 0x435913 114#define CYGETWAIT 0x435913
114 115
@@ -149,14 +150,12 @@ struct CYZ_BOOT_CTRL {
149 * architectures and compilers. 150 * architectures and compilers.
150 */ 151 */
151 152
152#if defined(__alpha__) 153#include <asm/types.h>
153typedef unsigned long ucdouble; /* 64 bits, unsigned */ 154
154typedef unsigned int uclong; /* 32 bits, unsigned */ 155typedef __u64 ucdouble; /* 64 bits, unsigned */
155#else 156typedef __u32 uclong; /* 32 bits, unsigned */
156typedef unsigned long uclong; /* 32 bits, unsigned */ 157typedef __u16 ucshort; /* 16 bits, unsigned */
157#endif 158typedef __u8 ucchar; /* 8 bits, unsigned */
158typedef unsigned short ucshort; /* 16 bits, unsigned */
159typedef unsigned char ucchar; /* 8 bits, unsigned */
160 159
161/* 160/*
162 * Memory Window Sizes 161 * Memory Window Sizes
@@ -174,24 +173,24 @@ typedef unsigned char ucchar; /* 8 bits, unsigned */
174 */ 173 */
175 174
176struct CUSTOM_REG { 175struct CUSTOM_REG {
177 uclong fpga_id; /* FPGA Identification Register */ 176 __u32 fpga_id; /* FPGA Identification Register */
178 uclong fpga_version; /* FPGA Version Number Register */ 177 __u32 fpga_version; /* FPGA Version Number Register */
179 uclong cpu_start; /* CPU start Register (write) */ 178 __u32 cpu_start; /* CPU start Register (write) */
180 uclong cpu_stop; /* CPU stop Register (write) */ 179 __u32 cpu_stop; /* CPU stop Register (write) */
181 uclong misc_reg; /* Miscelaneous Register */ 180 __u32 misc_reg; /* Miscelaneous Register */
182 uclong idt_mode; /* IDT mode Register */ 181 __u32 idt_mode; /* IDT mode Register */
183 uclong uart_irq_status; /* UART IRQ status Register */ 182 __u32 uart_irq_status; /* UART IRQ status Register */
184 uclong clear_timer0_irq; /* Clear timer interrupt Register */ 183 __u32 clear_timer0_irq; /* Clear timer interrupt Register */
185 uclong clear_timer1_irq; /* Clear timer interrupt Register */ 184 __u32 clear_timer1_irq; /* Clear timer interrupt Register */
186 uclong clear_timer2_irq; /* Clear timer interrupt Register */ 185 __u32 clear_timer2_irq; /* Clear timer interrupt Register */
187 uclong test_register; /* Test Register */ 186 __u32 test_register; /* Test Register */
188 uclong test_count; /* Test Count Register */ 187 __u32 test_count; /* Test Count Register */
189 uclong timer_select; /* Timer select register */ 188 __u32 timer_select; /* Timer select register */
190 uclong pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */ 189 __u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
191 uclong ram_wait_state; /* RAM wait-state Register */ 190 __u32 ram_wait_state; /* RAM wait-state Register */
192 uclong uart_wait_state; /* UART wait-state Register */ 191 __u32 uart_wait_state; /* UART wait-state Register */
193 uclong timer_wait_state; /* timer wait-state Register */ 192 __u32 timer_wait_state; /* timer wait-state Register */
194 uclong ack_wait_state; /* ACK wait State Register */ 193 __u32 ack_wait_state; /* ACK wait State Register */
195}; 194};
196 195
197/* 196/*
@@ -201,34 +200,34 @@ struct CUSTOM_REG {
201 */ 200 */
202 201
203struct RUNTIME_9060 { 202struct RUNTIME_9060 {
204 uclong loc_addr_range; /* 00h - Local Address Range */ 203 __u32 loc_addr_range; /* 00h - Local Address Range */
205 uclong loc_addr_base; /* 04h - Local Address Base */ 204 __u32 loc_addr_base; /* 04h - Local Address Base */
206 uclong loc_arbitr; /* 08h - Local Arbitration */ 205 __u32 loc_arbitr; /* 08h - Local Arbitration */
207 uclong endian_descr; /* 0Ch - Big/Little Endian Descriptor */ 206 __u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */
208 uclong loc_rom_range; /* 10h - Local ROM Range */ 207 __u32 loc_rom_range; /* 10h - Local ROM Range */
209 uclong loc_rom_base; /* 14h - Local ROM Base */ 208 __u32 loc_rom_base; /* 14h - Local ROM Base */
210 uclong loc_bus_descr; /* 18h - Local Bus descriptor */ 209 __u32 loc_bus_descr; /* 18h - Local Bus descriptor */
211 uclong loc_range_mst; /* 1Ch - Local Range for Master to PCI */ 210 __u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */
212 uclong loc_base_mst; /* 20h - Local Base for Master PCI */ 211 __u32 loc_base_mst; /* 20h - Local Base for Master PCI */
213 uclong loc_range_io; /* 24h - Local Range for Master IO */ 212 __u32 loc_range_io; /* 24h - Local Range for Master IO */
214 uclong pci_base_mst; /* 28h - PCI Base for Master PCI */ 213 __u32 pci_base_mst; /* 28h - PCI Base for Master PCI */
215 uclong pci_conf_io; /* 2Ch - PCI configuration for Master IO */ 214 __u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */
216 uclong filler1; /* 30h */ 215 __u32 filler1; /* 30h */
217 uclong filler2; /* 34h */ 216 __u32 filler2; /* 34h */
218 uclong filler3; /* 38h */ 217 __u32 filler3; /* 38h */
219 uclong filler4; /* 3Ch */ 218 __u32 filler4; /* 3Ch */
220 uclong mail_box_0; /* 40h - Mail Box 0 */ 219 __u32 mail_box_0; /* 40h - Mail Box 0 */
221 uclong mail_box_1; /* 44h - Mail Box 1 */ 220 __u32 mail_box_1; /* 44h - Mail Box 1 */
222 uclong mail_box_2; /* 48h - Mail Box 2 */ 221 __u32 mail_box_2; /* 48h - Mail Box 2 */
223 uclong mail_box_3; /* 4Ch - Mail Box 3 */ 222 __u32 mail_box_3; /* 4Ch - Mail Box 3 */
224 uclong filler5; /* 50h */ 223 __u32 filler5; /* 50h */
225 uclong filler6; /* 54h */ 224 __u32 filler6; /* 54h */
226 uclong filler7; /* 58h */ 225 __u32 filler7; /* 58h */
227 uclong filler8; /* 5Ch */ 226 __u32 filler8; /* 5Ch */
228 uclong pci_doorbell; /* 60h - PCI to Local Doorbell */ 227 __u32 pci_doorbell; /* 60h - PCI to Local Doorbell */
229 uclong loc_doorbell; /* 64h - Local to PCI Doorbell */ 228 __u32 loc_doorbell; /* 64h - Local to PCI Doorbell */
230 uclong intr_ctrl_stat; /* 68h - Interrupt Control/Status */ 229 __u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */
231 uclong init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */ 230 __u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
232}; 231};
233 232
234/* Values for the Local Base Address re-map register */ 233/* Values for the Local Base Address re-map register */
@@ -270,8 +269,8 @@ struct RUNTIME_9060 {
270#define ZF_TINACT ZF_TINACT_DEF 269#define ZF_TINACT ZF_TINACT_DEF
271 270
272struct FIRM_ID { 271struct FIRM_ID {
273 uclong signature; /* ZFIRM/U signature */ 272 __u32 signature; /* ZFIRM/U signature */
274 uclong zfwctrl_addr; /* pointer to ZFW_CTRL structure */ 273 __u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */
275}; 274};
276 275
277/* Op. System id */ 276/* Op. System id */
@@ -408,24 +407,24 @@ struct FIRM_ID {
408 */ 407 */
409 408
410struct CH_CTRL { 409struct CH_CTRL {
411 uclong op_mode; /* operation mode */ 410 __u32 op_mode; /* operation mode */
412 uclong intr_enable; /* interrupt masking */ 411 __u32 intr_enable; /* interrupt masking */
413 uclong sw_flow; /* SW flow control */ 412 __u32 sw_flow; /* SW flow control */
414 uclong flow_status; /* output flow status */ 413 __u32 flow_status; /* output flow status */
415 uclong comm_baud; /* baud rate - numerically specified */ 414 __u32 comm_baud; /* baud rate - numerically specified */
416 uclong comm_parity; /* parity */ 415 __u32 comm_parity; /* parity */
417 uclong comm_data_l; /* data length/stop */ 416 __u32 comm_data_l; /* data length/stop */
418 uclong comm_flags; /* other flags */ 417 __u32 comm_flags; /* other flags */
419 uclong hw_flow; /* HW flow control */ 418 __u32 hw_flow; /* HW flow control */
420 uclong rs_control; /* RS-232 outputs */ 419 __u32 rs_control; /* RS-232 outputs */
421 uclong rs_status; /* RS-232 inputs */ 420 __u32 rs_status; /* RS-232 inputs */
422 uclong flow_xon; /* xon char */ 421 __u32 flow_xon; /* xon char */
423 uclong flow_xoff; /* xoff char */ 422 __u32 flow_xoff; /* xoff char */
424 uclong hw_overflow; /* hw overflow counter */ 423 __u32 hw_overflow; /* hw overflow counter */
425 uclong sw_overflow; /* sw overflow counter */ 424 __u32 sw_overflow; /* sw overflow counter */
426 uclong comm_error; /* frame/parity error counter */ 425 __u32 comm_error; /* frame/parity error counter */
427 uclong ichar; 426 __u32 ichar;
428 uclong filler[7]; 427 __u32 filler[7];
429}; 428};
430 429
431 430
@@ -435,18 +434,18 @@ struct CH_CTRL {
435 */ 434 */
436 435
437struct BUF_CTRL { 436struct BUF_CTRL {
438 uclong flag_dma; /* buffers are in Host memory */ 437 __u32 flag_dma; /* buffers are in Host memory */
439 uclong tx_bufaddr; /* address of the tx buffer */ 438 __u32 tx_bufaddr; /* address of the tx buffer */
440 uclong tx_bufsize; /* tx buffer size */ 439 __u32 tx_bufsize; /* tx buffer size */
441 uclong tx_threshold; /* tx low water mark */ 440 __u32 tx_threshold; /* tx low water mark */
442 uclong tx_get; /* tail index tx buf */ 441 __u32 tx_get; /* tail index tx buf */
443 uclong tx_put; /* head index tx buf */ 442 __u32 tx_put; /* head index tx buf */
444 uclong rx_bufaddr; /* address of the rx buffer */ 443 __u32 rx_bufaddr; /* address of the rx buffer */
445 uclong rx_bufsize; /* rx buffer size */ 444 __u32 rx_bufsize; /* rx buffer size */
446 uclong rx_threshold; /* rx high water mark */ 445 __u32 rx_threshold; /* rx high water mark */
447 uclong rx_get; /* tail index rx buf */ 446 __u32 rx_get; /* tail index rx buf */
448 uclong rx_put; /* head index rx buf */ 447 __u32 rx_put; /* head index rx buf */
449 uclong filler[5]; /* filler to align structures */ 448 __u32 filler[5]; /* filler to align structures */
450}; 449};
451 450
452/* 451/*
@@ -457,27 +456,27 @@ struct BUF_CTRL {
457struct BOARD_CTRL { 456struct BOARD_CTRL {
458 457
459 /* static info provided by the on-board CPU */ 458 /* static info provided by the on-board CPU */
460 uclong n_channel; /* number of channels */ 459 __u32 n_channel; /* number of channels */
461 uclong fw_version; /* firmware version */ 460 __u32 fw_version; /* firmware version */
462 461
463 /* static info provided by the driver */ 462 /* static info provided by the driver */
464 uclong op_system; /* op_system id */ 463 __u32 op_system; /* op_system id */
465 uclong dr_version; /* driver version */ 464 __u32 dr_version; /* driver version */
466 465
467 /* board control area */ 466 /* board control area */
468 uclong inactivity; /* inactivity control */ 467 __u32 inactivity; /* inactivity control */
469 468
470 /* host to FW commands */ 469 /* host to FW commands */
471 uclong hcmd_channel; /* channel number */ 470 __u32 hcmd_channel; /* channel number */
472 uclong hcmd_param; /* pointer to parameters */ 471 __u32 hcmd_param; /* pointer to parameters */
473 472
474 /* FW to Host commands */ 473 /* FW to Host commands */
475 uclong fwcmd_channel; /* channel number */ 474 __u32 fwcmd_channel; /* channel number */
476 uclong fwcmd_param; /* pointer to parameters */ 475 __u32 fwcmd_param; /* pointer to parameters */
477 uclong zf_int_queue_addr; /* offset for INT_QUEUE structure */ 476 __u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */
478 477
479 /* filler so the structures are aligned */ 478 /* filler so the structures are aligned */
480 uclong filler[6]; 479 __u32 filler[6];
481}; 480};
482 481
483/* Host Interrupt Queue */ 482/* Host Interrupt Queue */
@@ -506,11 +505,10 @@ struct ZFW_CTRL {
506/****************** ****************** *******************/ 505/****************** ****************** *******************/
507#endif 506#endif
508 507
508#ifdef __KERNEL__
509
509/* Per card data structure */ 510/* Per card data structure */
510struct resource;
511struct cyclades_card { 511struct cyclades_card {
512 unsigned long base_phys;
513 unsigned long ctl_phys;
514 void __iomem *base_addr; 512 void __iomem *base_addr;
515 void __iomem *ctl_addr; 513 void __iomem *ctl_addr;
516 int irq; 514 int irq;
@@ -519,33 +517,18 @@ struct cyclades_card {
519 int nports; /* Number of ports in the card */ 517 int nports; /* Number of ports in the card */
520 int bus_index; /* address shift - 0 for ISA, 1 for PCI */ 518 int bus_index; /* address shift - 0 for ISA, 1 for PCI */
521 int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */ 519 int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */
522 struct pci_dev *pdev;
523#ifdef __KERNEL__
524 spinlock_t card_lock; 520 spinlock_t card_lock;
525#else 521 struct cyclades_port *ports;
526 unsigned long filler;
527#endif
528}; 522};
529 523
530struct cyclades_chip {
531 int filler;
532};
533
534
535#ifdef __KERNEL__
536
537/*************************************** 524/***************************************
538 * Memory access functions/macros * 525 * Memory access functions/macros *
539 * (required to support Alpha systems) * 526 * (required to support Alpha systems) *
540 ***************************************/ 527 ***************************************/
541 528
542#define cy_writeb(port,val) {writeb((val),(port)); mb();} 529#define cy_writeb(port,val) do { writeb((val), (port)); mb(); } while (0)
543#define cy_writew(port,val) {writew((val),(port)); mb();} 530#define cy_writew(port,val) do { writew((val), (port)); mb(); } while (0)
544#define cy_writel(port,val) {writel((val),(port)); mb();} 531#define cy_writel(port,val) do { writel((val), (port)); mb(); } while (0)
545
546#define cy_readb(port) readb(port)
547#define cy_readw(port) readw(port)
548#define cy_readl(port) readl(port)
549 532
550/* 533/*
551 * Statistics counters 534 * Statistics counters
@@ -567,7 +550,7 @@ struct cyclades_icount {
567 550
568struct cyclades_port { 551struct cyclades_port {
569 int magic; 552 int magic;
570 int card; 553 struct cyclades_card *card;
571 int line; 554 int line;
572 int flags; /* defined in tty.h */ 555 int flags; /* defined in tty.h */
573 int type; /* UART type */ 556 int type; /* UART type */
@@ -587,7 +570,6 @@ struct cyclades_port {
587 int close_delay; 570 int close_delay;
588 unsigned short closing_wait; 571 unsigned short closing_wait;
589 unsigned long event; 572 unsigned long event;
590 unsigned long last_active;
591 int count; /* # of fd on device */ 573 int count; /* # of fd on device */
592 int breakon; 574 int breakon;
593 int breakoff; 575 int breakoff;
@@ -598,7 +580,6 @@ struct cyclades_port {
598 int xmit_cnt; 580 int xmit_cnt;
599 int default_threshold; 581 int default_threshold;
600 int default_timeout; 582 int default_timeout;
601 unsigned long jiffies[3];
602 unsigned long rflush_count; 583 unsigned long rflush_count;
603 struct cyclades_monitor mon; 584 struct cyclades_monitor mon;
604 struct cyclades_idle_stats idle_stats; 585 struct cyclades_idle_stats idle_stats;
@@ -606,7 +587,7 @@ struct cyclades_port {
606 struct work_struct tqueue; 587 struct work_struct tqueue;
607 wait_queue_head_t open_wait; 588 wait_queue_head_t open_wait;
608 wait_queue_head_t close_wait; 589 wait_queue_head_t close_wait;
609 wait_queue_head_t shutdown_wait; 590 struct completion shutdown_wait;
610 wait_queue_head_t delta_msr_wait; 591 wait_queue_head_t delta_msr_wait;
611 int throttle; 592 int throttle;
612}; 593};
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 63f64a9a5bf7..aab53df4fafa 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -133,6 +133,7 @@ struct dentry_operations {
133 int (*d_delete)(struct dentry *); 133 int (*d_delete)(struct dentry *);
134 void (*d_release)(struct dentry *); 134 void (*d_release)(struct dentry *);
135 void (*d_iput)(struct dentry *, struct inode *); 135 void (*d_iput)(struct dentry *, struct inode *);
136 char *(*d_dname)(struct dentry *, char *, int);
136}; 137};
137 138
138/* the dentry parameter passed to d_hash and d_compare is the parent 139/* the dentry parameter passed to d_hash and d_compare is the parent
@@ -293,6 +294,11 @@ extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *);
293/* validate "insecure" dentry pointer */ 294/* validate "insecure" dentry pointer */
294extern int d_validate(struct dentry *, struct dentry *); 295extern int d_validate(struct dentry *, struct dentry *);
295 296
297/*
298 * helper function for dentry_operations.d_dname() members
299 */
300extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
301
296extern char * d_path(struct dentry *, struct vfsmount *, char *, int); 302extern char * d_path(struct dentry *, struct vfsmount *, char *, int);
297 303
298/* Allocation counts.. */ 304/* Allocation counts.. */
diff --git a/include/linux/device.h b/include/linux/device.h
index 6579068134d1..2e1a2988b7e1 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -412,12 +412,13 @@ struct device {
412 struct klist_node knode_parent; /* node in sibling list */ 412 struct klist_node knode_parent; /* node in sibling list */
413 struct klist_node knode_driver; 413 struct klist_node knode_driver;
414 struct klist_node knode_bus; 414 struct klist_node knode_bus;
415 struct device * parent; 415 struct device *parent;
416 416
417 struct kobject kobj; 417 struct kobject kobj;
418 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 418 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
419 struct device_type *type; 419 struct device_type *type;
420 unsigned is_registered:1; 420 unsigned is_registered:1;
421 unsigned uevent_suppress:1;
421 struct device_attribute uevent_attr; 422 struct device_attribute uevent_attr;
422 struct device_attribute *devt_attr; 423 struct device_attribute *devt_attr;
423 424
@@ -458,7 +459,6 @@ struct device {
458 struct class *class; 459 struct class *class;
459 dev_t devt; /* dev_t, creates the sysfs "dev" */ 460 dev_t devt; /* dev_t, creates the sysfs "dev" */
460 struct attribute_group **groups; /* optional groups */ 461 struct attribute_group **groups; /* optional groups */
461 int uevent_suppress;
462 462
463 void (*release)(struct device * dev); 463 void (*release)(struct device * dev);
464}; 464};
diff --git a/include/linux/display.h b/include/linux/display.h
new file mode 100644
index 000000000000..3bf70d639728
--- /dev/null
+++ b/include/linux/display.h
@@ -0,0 +1,61 @@
1/*
2 * Copyright (C) 2006 James Simmons <jsimmons@infradead.org>
3 *
4 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 *
20 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 */
22
23#ifndef _LINUX_DISPLAY_H
24#define _LINUX_DISPLAY_H
25
26#include <linux/device.h>
27
28struct display_device;
29
30/* This structure defines all the properties of a Display. */
31struct display_driver {
32 int (*set_contrast)(struct display_device *, unsigned int);
33 int (*get_contrast)(struct display_device *);
34 void (*suspend)(struct display_device *, pm_message_t state);
35 void (*resume)(struct display_device *);
36 int (*probe)(struct display_device *, void *);
37 int (*remove)(struct display_device *);
38 int max_contrast;
39};
40
41struct display_device {
42 struct module *owner; /* Owner module */
43 struct display_driver *driver;
44 struct device *parent; /* This is the parent */
45 struct device *dev; /* This is this display device */
46 struct mutex lock;
47 void *priv_data;
48 char type[16];
49 char *name;
50 int idx;
51};
52
53extern struct display_device *display_device_register(struct display_driver *driver,
54 struct device *dev, void *devdata);
55extern void display_device_unregister(struct display_device *dev);
56
57extern int probe_edid(struct display_device *dev, void *devdata);
58
59#define to_display_device(obj) container_of(obj, struct display_device, class_dev)
60
61#endif
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h
index 2a2dd189b9fd..c2735cab2ebf 100644
--- a/include/linux/dlm_device.h
+++ b/include/linux/dlm_device.h
@@ -19,7 +19,7 @@
19 19
20/* Version of the device interface */ 20/* Version of the device interface */
21#define DLM_DEVICE_VERSION_MAJOR 5 21#define DLM_DEVICE_VERSION_MAJOR 5
22#define DLM_DEVICE_VERSION_MINOR 0 22#define DLM_DEVICE_VERSION_MINOR 1
23#define DLM_DEVICE_VERSION_PATCH 0 23#define DLM_DEVICE_VERSION_PATCH 0
24 24
25/* struct passed to the lock write */ 25/* struct passed to the lock write */
@@ -44,6 +44,11 @@ struct dlm_lspace_params {
44 char name[0]; 44 char name[0];
45}; 45};
46 46
47struct dlm_purge_params {
48 __u32 nodeid;
49 __u32 pid;
50};
51
47struct dlm_write_request { 52struct dlm_write_request {
48 __u32 version[3]; 53 __u32 version[3];
49 __u8 cmd; 54 __u8 cmd;
@@ -53,6 +58,7 @@ struct dlm_write_request {
53 union { 58 union {
54 struct dlm_lock_params lock; 59 struct dlm_lock_params lock;
55 struct dlm_lspace_params lspace; 60 struct dlm_lspace_params lspace;
61 struct dlm_purge_params purge;
56 } i; 62 } i;
57}; 63};
58 64
@@ -76,6 +82,7 @@ struct dlm_lock_result {
76#define DLM_USER_QUERY 3 82#define DLM_USER_QUERY 3
77#define DLM_USER_CREATE_LOCKSPACE 4 83#define DLM_USER_CREATE_LOCKSPACE 4
78#define DLM_USER_REMOVE_LOCKSPACE 5 84#define DLM_USER_REMOVE_LOCKSPACE 5
85#define DLM_USER_PURGE 6
79 86
80/* Arbitrary length restriction */ 87/* Arbitrary length restriction */
81#define MAX_LS_NAME_LEN 64 88#define MAX_LS_NAME_LEN 64
diff --git a/include/linux/ds1wm.h b/include/linux/ds1wm.h
new file mode 100644
index 000000000000..31f6e3c427fb
--- /dev/null
+++ b/include/linux/ds1wm.h
@@ -0,0 +1,11 @@
1/* platform data for the DS1WM driver */
2
3struct ds1wm_platform_data {
4 int bus_shift; /* number of shifts needed to calculate the
5 * offset between DS1WM registers;
6 * e.g. on h5xxx and h2200 this is 2
7 * (registers aligned to 4-byte boundaries),
8 * while on hx4700 this is 1 */
9 void (*enable)(struct platform_device *pdev);
10 void (*disable)(struct platform_device *pdev);
11};
diff --git a/include/linux/efi.h b/include/linux/efi.h
index f8ebd7c1ddb3..0b9579a4cd42 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -213,7 +213,6 @@ typedef struct {
213} efi_config_table_t; 213} efi_config_table_t;
214 214
215#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) 215#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL)
216#define EFI_SYSTEM_TABLE_REVISION ((1 << 16) | 00)
217 216
218typedef struct { 217typedef struct {
219 efi_table_hdr_t hdr; 218 efi_table_hdr_t hdr;
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
index 666e0a5f00fc..0311bad838b1 100644
--- a/include/linux/elf-em.h
+++ b/include/linux/elf-em.h
@@ -30,6 +30,7 @@
30#define EM_V850 87 /* NEC v850 */ 30#define EM_V850 87 /* NEC v850 */
31#define EM_M32R 88 /* Renesas M32R */ 31#define EM_M32R 88 /* Renesas M32R */
32#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ 32#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
33#define EM_BLACKFIN 106 /* ADI Blackfin Processor */
33#define EM_FRV 0x5441 /* Fujitsu FR-V */ 34#define EM_FRV 0x5441 /* Fujitsu FR-V */
34#define EM_AVR32 0x18ad /* Atmel AVR32 */ 35#define EM_AVR32 0x18ad /* Atmel AVR32 */
35 36
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 745c988359c0..071c67abed86 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -71,6 +71,18 @@ static inline int is_multicast_ether_addr(const u8 *addr)
71} 71}
72 72
73/** 73/**
74 * is_local_ether_addr - Determine if the Ethernet address is locally-assigned
75 * one (IEEE 802).
76 * @addr: Pointer to a six-byte array containing the Ethernet address
77 *
78 * Return true if the address is a local address.
79 */
80static inline int is_local_ether_addr(const u8 *addr)
81{
82 return (0x02 & addr[0]);
83}
84
85/**
74 * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast 86 * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast
75 * @addr: Pointer to a six-byte array containing the Ethernet address 87 * @addr: Pointer to a six-byte array containing the Ethernet address
76 * 88 *
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 4eb18ac510ae..ece49a804fe1 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -824,6 +824,7 @@ extern int ext3_change_inode_journal_flag(struct inode *, int);
824extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); 824extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *);
825extern void ext3_truncate (struct inode *); 825extern void ext3_truncate (struct inode *);
826extern void ext3_set_inode_flags(struct inode *); 826extern void ext3_set_inode_flags(struct inode *);
827extern void ext3_get_inode_flags(struct ext3_inode_info *);
827extern void ext3_set_aops(struct inode *inode); 828extern void ext3_set_aops(struct inode *inode);
828 829
829/* ioctl.c */ 830/* ioctl.c */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index be913ec87169..dff7a728948c 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -4,6 +4,8 @@
4#include <asm/types.h> 4#include <asm/types.h>
5#include <linux/i2c.h> 5#include <linux/i2c.h>
6 6
7struct dentry;
8
7/* Definitions of frame buffers */ 9/* Definitions of frame buffers */
8 10
9#define FB_MAJOR 29 11#define FB_MAJOR 29
@@ -525,12 +527,20 @@ struct fb_cursor_user {
525#define FB_EVENT_MODE_CHANGE_ALL 0x0B 527#define FB_EVENT_MODE_CHANGE_ALL 0x0B
526/* A software display blank change occured */ 528/* A software display blank change occured */
527#define FB_EVENT_CONBLANK 0x0C 529#define FB_EVENT_CONBLANK 0x0C
530/* Get drawing requirements */
531#define FB_EVENT_GET_REQ 0x0D
528 532
529struct fb_event { 533struct fb_event {
530 struct fb_info *info; 534 struct fb_info *info;
531 void *data; 535 void *data;
532}; 536};
533 537
538struct fb_blit_caps {
539 u32 x;
540 u32 y;
541 u32 len;
542 u32 flags;
543};
534 544
535extern int fb_register_client(struct notifier_block *nb); 545extern int fb_register_client(struct notifier_block *nb);
536extern int fb_unregister_client(struct notifier_block *nb); 546extern int fb_unregister_client(struct notifier_block *nb);
@@ -556,11 +566,25 @@ struct fb_pixmap {
556 u32 scan_align; /* alignment per scanline */ 566 u32 scan_align; /* alignment per scanline */
557 u32 access_align; /* alignment per read/write (bits) */ 567 u32 access_align; /* alignment per read/write (bits) */
558 u32 flags; /* see FB_PIXMAP_* */ 568 u32 flags; /* see FB_PIXMAP_* */
569 u32 blit_x; /* supported bit block dimensions (1-32)*/
570 u32 blit_y; /* Format: blit_x = 1 << (width - 1) */
571 /* blit_y = 1 << (height - 1) */
572 /* if 0, will be set to 0xffffffff (all)*/
559 /* access methods */ 573 /* access methods */
560 void (*writeio)(struct fb_info *info, void __iomem *dst, void *src, unsigned int size); 574 void (*writeio)(struct fb_info *info, void __iomem *dst, void *src, unsigned int size);
561 void (*readio) (struct fb_info *info, void *dst, void __iomem *src, unsigned int size); 575 void (*readio) (struct fb_info *info, void *dst, void __iomem *src, unsigned int size);
562}; 576};
563 577
578#ifdef CONFIG_FB_DEFERRED_IO
579struct fb_deferred_io {
580 /* delay between mkwrite and deferred handler */
581 unsigned long delay;
582 struct mutex lock; /* mutex that protects the page list */
583 struct list_head pagelist; /* list of touched pages */
584 /* callback */
585 void (*deferred_io)(struct fb_info *info, struct list_head *pagelist);
586};
587#endif
564 588
565/* 589/*
566 * Frame buffer operations 590 * Frame buffer operations
@@ -579,8 +603,10 @@ struct fb_ops {
579 /* For framebuffers with strange non linear layouts or that do not 603 /* For framebuffers with strange non linear layouts or that do not
580 * work with normal memory mapped access 604 * work with normal memory mapped access
581 */ 605 */
582 ssize_t (*fb_read)(struct file *file, char __user *buf, size_t count, loff_t *ppos); 606 ssize_t (*fb_read)(struct fb_info *info, char __user *buf,
583 ssize_t (*fb_write)(struct file *file, const char __user *buf, size_t count, loff_t *ppos); 607 size_t count, loff_t *ppos);
608 ssize_t (*fb_write)(struct fb_info *info, const char __user *buf,
609 size_t count, loff_t *ppos);
584 610
585 /* checks var and eventually tweaks it to something supported, 611 /* checks var and eventually tweaks it to something supported,
586 * DO NOT MODIFY PAR */ 612 * DO NOT MODIFY PAR */
@@ -634,10 +660,13 @@ struct fb_ops {
634 660
635 /* restore saved state */ 661 /* restore saved state */
636 void (*fb_restore_state)(struct fb_info *info); 662 void (*fb_restore_state)(struct fb_info *info);
663
664 /* get capability given var */
665 void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps,
666 struct fb_var_screeninfo *var);
637}; 667};
638 668
639#ifdef CONFIG_FB_TILEBLITTING 669#ifdef CONFIG_FB_TILEBLITTING
640
641#define FB_TILE_CURSOR_NONE 0 670#define FB_TILE_CURSOR_NONE 0
642#define FB_TILE_CURSOR_UNDERLINE 1 671#define FB_TILE_CURSOR_UNDERLINE 1
643#define FB_TILE_CURSOR_LOWER_THIRD 2 672#define FB_TILE_CURSOR_LOWER_THIRD 2
@@ -709,6 +738,8 @@ struct fb_tile_ops {
709 /* cursor */ 738 /* cursor */
710 void (*fb_tilecursor)(struct fb_info *info, 739 void (*fb_tilecursor)(struct fb_info *info,
711 struct fb_tilecursor *cursor); 740 struct fb_tilecursor *cursor);
741 /* get maximum length of the tile map */
742 int (*fb_get_tilemax)(struct fb_info *info);
712}; 743};
713#endif /* CONFIG_FB_TILEBLITTING */ 744#endif /* CONFIG_FB_TILEBLITTING */
714 745
@@ -778,6 +809,10 @@ struct fb_info {
778 struct mutex bl_curve_mutex; 809 struct mutex bl_curve_mutex;
779 u8 bl_curve[FB_BACKLIGHT_LEVELS]; 810 u8 bl_curve[FB_BACKLIGHT_LEVELS];
780#endif 811#endif
812#ifdef CONFIG_FB_DEFERRED_IO
813 struct delayed_work deferred_work;
814 struct fb_deferred_io *fbdefio;
815#endif
781 816
782 struct fb_ops *fbops; 817 struct fb_ops *fbops;
783 struct device *device; /* This is the parent */ 818 struct device *device; /* This is the parent */
@@ -879,6 +914,16 @@ extern int fb_blank(struct fb_info *info, int blank);
879extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); 914extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
880extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); 915extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
881extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image); 916extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image);
917/*
918 * Drawing operations where framebuffer is in system RAM
919 */
920extern void sys_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
921extern void sys_copyarea(struct fb_info *info, const struct fb_copyarea *area);
922extern void sys_imageblit(struct fb_info *info, const struct fb_image *image);
923extern ssize_t fb_sys_read(struct fb_info *info, char __user *buf,
924 size_t count, loff_t *ppos);
925extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
926 size_t count, loff_t *ppos);
882 927
883/* drivers/video/fbmem.c */ 928/* drivers/video/fbmem.c */
884extern int register_framebuffer(struct fb_info *fb_info); 929extern int register_framebuffer(struct fb_info *fb_info);
@@ -913,6 +958,12 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
913 } 958 }
914} 959}
915 960
961/* drivers/video/fb_defio.c */
962extern void fb_deferred_io_init(struct fb_info *info);
963extern void fb_deferred_io_cleanup(struct fb_info *info);
964extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry,
965 int datasync);
966
916/* drivers/video/fbsysfs.c */ 967/* drivers/video/fbsysfs.c */
917extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); 968extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
918extern void framebuffer_release(struct fb_info *info); 969extern void framebuffer_release(struct fb_info *info);
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index 996f5611cd59..40b93265d4ba 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -3,6 +3,10 @@
3 3
4#include <asm/fcntl.h> 4#include <asm/fcntl.h>
5 5
6/* Cancel a blocking posix lock; internal use only until we expose an
7 * asynchronous lock api to userspace: */
8#define F_CANCELLK (F_LINUX_SPECIFIC_BASE+5)
9
6#define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0) 10#define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0)
7#define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1) 11#define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1)
8 12
diff --git a/include/linux/font.h b/include/linux/font.h
index 53b129f07f6f..40a24ab41b36 100644
--- a/include/linux/font.h
+++ b/include/linux/font.h
@@ -49,7 +49,8 @@ extern const struct font_desc *find_font(const char *name);
49 49
50/* Get the default font for a specific screen size */ 50/* Get the default font for a specific screen size */
51 51
52extern const struct font_desc *get_default_font(int xres, int yres); 52extern const struct font_desc *get_default_font(int xres, int yres,
53 u32 font_w, u32 font_h);
53 54
54/* Max. length for the name of a predefined font */ 55/* Max. length for the name of a predefined font */
55#define MAX_FONT_NAME 32 56#define MAX_FONT_NAME 32
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7c0077f06e24..7cf0c54a46a7 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -30,6 +30,7 @@
30#define SEEK_SET 0 /* seek relative to beginning of file */ 30#define SEEK_SET 0 /* seek relative to beginning of file */
31#define SEEK_CUR 1 /* seek relative to current file position */ 31#define SEEK_CUR 1 /* seek relative to current file position */
32#define SEEK_END 2 /* seek relative to end of file */ 32#define SEEK_END 2 /* seek relative to end of file */
33#define SEEK_MAX SEEK_END
33 34
34/* And dynamically-tunable limits and defaults: */ 35/* And dynamically-tunable limits and defaults: */
35struct files_stat_struct { 36struct files_stat_struct {
@@ -91,6 +92,7 @@ extern int dir_notify_enable;
91/* public flags for file_system_type */ 92/* public flags for file_system_type */
92#define FS_REQUIRES_DEV 1 93#define FS_REQUIRES_DEV 1
93#define FS_BINARY_MOUNTDATA 2 94#define FS_BINARY_MOUNTDATA 2
95#define FS_HAS_SUBTYPE 4
94#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ 96#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
95#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() 97#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move()
96 * during rename() internally. 98 * during rename() internally.
@@ -696,12 +698,13 @@ struct file_ra_state {
696 unsigned long size; 698 unsigned long size;
697 unsigned long flags; /* ra flags RA_FLAG_xxx*/ 699 unsigned long flags; /* ra flags RA_FLAG_xxx*/
698 unsigned long cache_hit; /* cache hit count*/ 700 unsigned long cache_hit; /* cache hit count*/
699 unsigned long prev_page; /* Cache last read() position */ 701 unsigned long prev_index; /* Cache last read() position */
700 unsigned long ahead_start; /* Ahead window */ 702 unsigned long ahead_start; /* Ahead window */
701 unsigned long ahead_size; 703 unsigned long ahead_size;
702 unsigned long ra_pages; /* Maximum readahead window */ 704 unsigned long ra_pages; /* Maximum readahead window */
703 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ 705 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */
704 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ 706 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */
707 unsigned int prev_offset; /* Offset where last read() ended in a page */
705}; 708};
706#define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */ 709#define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */
707#define RA_FLAG_INCACHE 0x02 /* file is already in cache */ 710#define RA_FLAG_INCACHE 0x02 /* file is already in cache */
@@ -785,6 +788,7 @@ struct file_lock_operations {
785struct lock_manager_operations { 788struct lock_manager_operations {
786 int (*fl_compare_owner)(struct file_lock *, struct file_lock *); 789 int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
787 void (*fl_notify)(struct file_lock *); /* unblock callback */ 790 void (*fl_notify)(struct file_lock *); /* unblock callback */
791 int (*fl_grant)(struct file_lock *, struct file_lock *, int);
788 void (*fl_copy_lock)(struct file_lock *, struct file_lock *); 792 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
789 void (*fl_release_private)(struct file_lock *); 793 void (*fl_release_private)(struct file_lock *);
790 void (*fl_break)(struct file_lock *); 794 void (*fl_break)(struct file_lock *);
@@ -845,22 +849,19 @@ extern int fcntl_getlease(struct file *filp);
845/* fs/sync.c */ 849/* fs/sync.c */
846extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, 850extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
847 loff_t endbyte, unsigned int flags); 851 loff_t endbyte, unsigned int flags);
848static inline int do_sync_file_range(struct file *file, loff_t offset,
849 loff_t endbyte, unsigned int flags)
850{
851 return do_sync_mapping_range(file->f_mapping, offset, endbyte, flags);
852}
853 852
854/* fs/locks.c */ 853/* fs/locks.c */
855extern void locks_init_lock(struct file_lock *); 854extern void locks_init_lock(struct file_lock *);
856extern void locks_copy_lock(struct file_lock *, struct file_lock *); 855extern void locks_copy_lock(struct file_lock *, struct file_lock *);
857extern void locks_remove_posix(struct file *, fl_owner_t); 856extern void locks_remove_posix(struct file *, fl_owner_t);
858extern void locks_remove_flock(struct file *); 857extern void locks_remove_flock(struct file *);
859extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *); 858extern int posix_test_lock(struct file *, struct file_lock *);
860extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *); 859extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
861extern int posix_lock_file(struct file *, struct file_lock *);
862extern int posix_lock_file_wait(struct file *, struct file_lock *); 860extern int posix_lock_file_wait(struct file *, struct file_lock *);
863extern int posix_unblock_lock(struct file *, struct file_lock *); 861extern int posix_unblock_lock(struct file *, struct file_lock *);
862extern int vfs_test_lock(struct file *, struct file_lock *);
863extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
864extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
864extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 865extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
865extern int __break_lease(struct inode *inode, unsigned int flags); 866extern int __break_lease(struct inode *inode, unsigned int flags);
866extern void lease_get_mtime(struct inode *, struct timespec *time); 867extern void lease_get_mtime(struct inode *, struct timespec *time);
@@ -956,6 +957,12 @@ struct super_block {
956 /* Granularity of c/m/atime in ns. 957 /* Granularity of c/m/atime in ns.
957 Cannot be worse than a second */ 958 Cannot be worse than a second */
958 u32 s_time_gran; 959 u32 s_time_gran;
960
961 /*
962 * Filesystem subtype. If non-empty the filesystem type field
963 * in /proc/mounts will be "type.subtype"
964 */
965 char *s_subtype;
959}; 966};
960 967
961extern struct timespec current_fs_time(struct super_block *sb); 968extern struct timespec current_fs_time(struct super_block *sb);
@@ -1731,6 +1738,8 @@ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor
1731extern void do_generic_mapping_read(struct address_space *mapping, 1738extern void do_generic_mapping_read(struct address_space *mapping,
1732 struct file_ra_state *, struct file *, 1739 struct file_ra_state *, struct file *,
1733 loff_t *, read_descriptor_t *, read_actor_t); 1740 loff_t *, read_descriptor_t *, read_actor_t);
1741extern int generic_segment_checks(const struct iovec *iov,
1742 unsigned long *nr_segs, size_t *count, int access_flags);
1734 1743
1735/* fs/splice.c */ 1744/* fs/splice.c */
1736extern ssize_t generic_file_splice_read(struct file *, loff_t *, 1745extern ssize_t generic_file_splice_read(struct file *, loff_t *,
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 3f153b4e156c..820125c628c1 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -100,6 +100,35 @@ long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
100extern int 100extern int
101handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); 101handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi);
102 102
103/*
104 * Futexes are matched on equal values of this key.
105 * The key type depends on whether it's a shared or private mapping.
106 * Don't rearrange members without looking at hash_futex().
107 *
108 * offset is aligned to a multiple of sizeof(u32) (== 4) by definition.
109 * We set bit 0 to indicate if it's an inode-based key.
110 */
111union futex_key {
112 struct {
113 unsigned long pgoff;
114 struct inode *inode;
115 int offset;
116 } shared;
117 struct {
118 unsigned long address;
119 struct mm_struct *mm;
120 int offset;
121 } private;
122 struct {
123 unsigned long word;
124 void *ptr;
125 int offset;
126 } both;
127};
128int get_futex_key(u32 __user *uaddr, union futex_key *key);
129void get_futex_key_refs(union futex_key *key);
130void drop_futex_key_refs(union futex_key *key);
131
103#ifdef CONFIG_FUTEX 132#ifdef CONFIG_FUTEX
104extern void exit_robust_list(struct task_struct *curr); 133extern void exit_robust_list(struct task_struct *curr);
105extern void exit_pi_state_list(struct task_struct *curr); 134extern void exit_pi_state_list(struct task_struct *curr);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 2a7d15bcde46..97a36c3d96e2 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -40,7 +40,6 @@ struct vm_area_struct;
40#define __GFP_REPEAT ((__force gfp_t)0x400u) /* Retry the allocation. Might fail */ 40#define __GFP_REPEAT ((__force gfp_t)0x400u) /* Retry the allocation. Might fail */
41#define __GFP_NOFAIL ((__force gfp_t)0x800u) /* Retry for ever. Cannot fail */ 41#define __GFP_NOFAIL ((__force gfp_t)0x800u) /* Retry for ever. Cannot fail */
42#define __GFP_NORETRY ((__force gfp_t)0x1000u)/* Do not retry. Might fail */ 42#define __GFP_NORETRY ((__force gfp_t)0x1000u)/* Do not retry. Might fail */
43#define __GFP_NO_GROW ((__force gfp_t)0x2000u)/* Slab internal usage */
44#define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ 43#define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */
45#define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ 44#define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */
46#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ 45#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */
@@ -53,7 +52,7 @@ struct vm_area_struct;
53/* if you forget to add the bitmask here kernel will crash, period */ 52/* if you forget to add the bitmask here kernel will crash, period */
54#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ 53#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
55 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ 54 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
56 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ 55 __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \
57 __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE) 56 __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE)
58 57
59/* This equals 0, but use constants in case they ever change */ 58/* This equals 0, but use constants in case they ever change */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 3f3e7a648da3..b4570b62ab85 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -189,4 +189,10 @@ static inline void set_file_hugepages(struct file *file)
189 189
190#endif /* !CONFIG_HUGETLBFS */ 190#endif /* !CONFIG_HUGETLBFS */
191 191
192#ifdef HAVE_ARCH_HUGETLB_UNMAPPED_AREA
193unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
194 unsigned long len, unsigned long pgoff,
195 unsigned long flags);
196#endif /* HAVE_ARCH_HUGETLB_UNMAPPED_AREA */
197
192#endif /* _LINUX_HUGETLB_H */ 198#endif /* _LINUX_HUGETLB_H */
diff --git a/include/linux/init.h b/include/linux/init.h
index 9abf120ec9f8..8bc32bb2fce2 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -77,7 +77,8 @@ extern char *saved_command_line;
77extern unsigned int reset_devices; 77extern unsigned int reset_devices;
78 78
79/* used by init/main.c */ 79/* used by init/main.c */
80extern void setup_arch(char **); 80void setup_arch(char **);
81void prepare_namespace(void);
81 82
82#endif 83#endif
83 84
@@ -233,7 +234,7 @@ void __init parse_early_param(void);
233#define __obsolete_setup(str) /* nothing */ 234#define __obsolete_setup(str) /* nothing */
234#endif 235#endif
235 236
236/* Data marked not to be saved by software_suspend() */ 237/* Data marked not to be saved by software suspend */
237#define __nosavedata __attribute__ ((__section__ (".data.nosave"))) 238#define __nosavedata __attribute__ ((__section__ (".data.nosave")))
238 239
239/* This means "can be init if no module support, otherwise module load 240/* This means "can be init if no module support, otherwise module load
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index a2d95ff50e9b..795102309bf1 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -138,7 +138,7 @@ extern struct group_info init_groups;
138 .journal_info = NULL, \ 138 .journal_info = NULL, \
139 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ 139 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
140 .fs_excl = ATOMIC_INIT(0), \ 140 .fs_excl = ATOMIC_INIT(0), \
141 .pi_lock = SPIN_LOCK_UNLOCKED, \ 141 .pi_lock = __SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
142 INIT_TRACE_IRQFLAGS \ 142 INIT_TRACE_IRQFLAGS \
143 INIT_LOCKDEP \ 143 INIT_LOCKDEP \
144} 144}
diff --git a/include/linux/input.h b/include/linux/input.h
index 439954d09752..be2bf3a2b031 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -990,6 +990,10 @@ struct input_dev {
990#error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match" 990#error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
991#endif 991#endif
992 992
993#if KEY_MIN_INTERESTING != INPUT_DEVICE_ID_KEY_MIN_INTERESTING
994#error "KEY_MIN_INTERESTING and INPUT_DEVICE_ID_KEY_MIN_INTERESTING do not match"
995#endif
996
993#if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX 997#if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
994#error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match" 998#error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
995#endif 999#endif
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 0319f665dd3f..f7b01b9a35b3 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -44,6 +44,9 @@
44 * IRQF_TIMER - Flag to mark this interrupt as timer interrupt 44 * IRQF_TIMER - Flag to mark this interrupt as timer interrupt
45 * IRQF_PERCPU - Interrupt is per cpu 45 * IRQF_PERCPU - Interrupt is per cpu
46 * IRQF_NOBALANCING - Flag to exclude this interrupt from irq balancing 46 * IRQF_NOBALANCING - Flag to exclude this interrupt from irq balancing
47 * IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is
48 * registered first in an shared interrupt is considered for
49 * performance reasons)
47 */ 50 */
48#define IRQF_DISABLED 0x00000020 51#define IRQF_DISABLED 0x00000020
49#define IRQF_SAMPLE_RANDOM 0x00000040 52#define IRQF_SAMPLE_RANDOM 0x00000040
@@ -52,22 +55,29 @@
52#define IRQF_TIMER 0x00000200 55#define IRQF_TIMER 0x00000200
53#define IRQF_PERCPU 0x00000400 56#define IRQF_PERCPU 0x00000400
54#define IRQF_NOBALANCING 0x00000800 57#define IRQF_NOBALANCING 0x00000800
58#define IRQF_IRQPOLL 0x00001000
55 59
56/* 60/*
57 * Migration helpers. Scheduled for removal in 1/2007 61 * Migration helpers. Scheduled for removal in 9/2007
58 * Do not use for new code ! 62 * Do not use for new code !
59 */ 63 */
60#define SA_INTERRUPT IRQF_DISABLED 64static inline
61#define SA_SAMPLE_RANDOM IRQF_SAMPLE_RANDOM 65unsigned long __deprecated deprecated_irq_flag(unsigned long flag)
62#define SA_SHIRQ IRQF_SHARED 66{
63#define SA_PROBEIRQ IRQF_PROBE_SHARED 67 return flag;
64#define SA_PERCPU IRQF_PERCPU 68}
65 69
66#define SA_TRIGGER_LOW IRQF_TRIGGER_LOW 70#define SA_INTERRUPT deprecated_irq_flag(IRQF_DISABLED)
67#define SA_TRIGGER_HIGH IRQF_TRIGGER_HIGH 71#define SA_SAMPLE_RANDOM deprecated_irq_flag(IRQF_SAMPLE_RANDOM)
68#define SA_TRIGGER_FALLING IRQF_TRIGGER_FALLING 72#define SA_SHIRQ deprecated_irq_flag(IRQF_SHARED)
69#define SA_TRIGGER_RISING IRQF_TRIGGER_RISING 73#define SA_PROBEIRQ deprecated_irq_flag(IRQF_PROBE_SHARED)
70#define SA_TRIGGER_MASK IRQF_TRIGGER_MASK 74#define SA_PERCPU deprecated_irq_flag(IRQF_PERCPU)
75
76#define SA_TRIGGER_LOW deprecated_irq_flag(IRQF_TRIGGER_LOW)
77#define SA_TRIGGER_HIGH deprecated_irq_flag(IRQF_TRIGGER_HIGH)
78#define SA_TRIGGER_FALLING deprecated_irq_flag(IRQF_TRIGGER_FALLING)
79#define SA_TRIGGER_RISING deprecated_irq_flag(IRQF_TRIGGER_RISING)
80#define SA_TRIGGER_MASK deprecated_irq_flag(IRQF_TRIGGER_MASK)
71 81
72typedef irqreturn_t (*irq_handler_t)(int, void *); 82typedef irqreturn_t (*irq_handler_t)(int, void *);
73 83
@@ -83,11 +93,11 @@ struct irqaction {
83}; 93};
84 94
85extern irqreturn_t no_action(int cpl, void *dev_id); 95extern irqreturn_t no_action(int cpl, void *dev_id);
86extern int request_irq(unsigned int, irq_handler_t handler, 96extern int __must_check request_irq(unsigned int, irq_handler_t handler,
87 unsigned long, const char *, void *); 97 unsigned long, const char *, void *);
88extern void free_irq(unsigned int, void *); 98extern void free_irq(unsigned int, void *);
89 99
90extern int devm_request_irq(struct device *dev, unsigned int irq, 100extern int __must_check devm_request_irq(struct device *dev, unsigned int irq,
91 irq_handler_t handler, unsigned long irqflags, 101 irq_handler_t handler, unsigned long irqflags,
92 const char *devname, void *dev_id); 102 const char *devname, void *dev_id);
93extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id); 103extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
diff --git a/include/linux/ioctl32.h b/include/linux/ioctl32.h
deleted file mode 100644
index 948809d99917..000000000000
--- a/include/linux/ioctl32.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef IOCTL32_H
2#define IOCTL32_H 1
3
4#include <linux/compiler.h> /* for __deprecated */
5
6struct file;
7
8typedef int (*ioctl_trans_handler_t)(unsigned int, unsigned int,
9 unsigned long, struct file *);
10
11struct ioctl_trans {
12 unsigned long cmd;
13 ioctl_trans_handler_t handler;
14 struct ioctl_trans *next;
15};
16
17#endif
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 6da6772c19ff..1980867a64a4 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -92,16 +92,19 @@ extern struct ipc_namespace init_ipc_ns;
92 92
93#ifdef CONFIG_SYSVIPC 93#ifdef CONFIG_SYSVIPC
94#define INIT_IPC_NS(ns) .ns = &init_ipc_ns, 94#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
95extern int copy_ipcs(unsigned long flags, struct task_struct *tsk); 95extern struct ipc_namespace *copy_ipcs(unsigned long flags,
96 struct ipc_namespace *ns);
96#else 97#else
97#define INIT_IPC_NS(ns) 98#define INIT_IPC_NS(ns)
98static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk) 99static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
99{ return 0; } 100 struct ipc_namespace *ns)
101{
102 return ns;
103}
100#endif 104#endif
101 105
102#ifdef CONFIG_IPC_NS 106#ifdef CONFIG_IPC_NS
103extern void free_ipc_ns(struct kref *kref); 107extern void free_ipc_ns(struct kref *kref);
104extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns);
105#endif 108#endif
106 109
107static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) 110static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
diff --git a/include/linux/irq.h b/include/linux/irq.h
index a6899402b522..1695054e8c63 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -147,8 +147,6 @@ struct irq_chip {
147 * @dir: /proc/irq/ procfs entry 147 * @dir: /proc/irq/ procfs entry
148 * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP 148 * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP
149 * @name: flow handler name for /proc/interrupts output 149 * @name: flow handler name for /proc/interrupts output
150 *
151 * Pad this out to 32 bytes for cache and indexing reasons.
152 */ 150 */
153struct irq_desc { 151struct irq_desc {
154 irq_flow_handler_t handle_irq; 152 irq_flow_handler_t handle_irq;
@@ -175,7 +173,7 @@ struct irq_desc {
175 struct proc_dir_entry *dir; 173 struct proc_dir_entry *dir;
176#endif 174#endif
177 const char *name; 175 const char *name;
178} ____cacheline_aligned; 176} ____cacheline_internodealigned_in_smp;
179 177
180extern struct irq_desc irq_desc[NR_IRQS]; 178extern struct irq_desc irq_desc[NR_IRQS];
181 179
diff --git a/include/linux/isdn/capiutil.h b/include/linux/isdn/capiutil.h
index 63bd9cf821a7..5a52f2c94f3f 100644
--- a/include/linux/isdn/capiutil.h
+++ b/include/linux/isdn/capiutil.h
@@ -187,7 +187,6 @@ typedef struct {
187#define CDEBUG_SIZE 1024 187#define CDEBUG_SIZE 1024
188#define CDEBUG_GSIZE 4096 188#define CDEBUG_GSIZE 4096
189 189
190_cdebbuf *cdebbuf_alloc(void);
191void cdebbuf_free(_cdebbuf *cdb); 190void cdebbuf_free(_cdebbuf *cdb);
192int cdebug_init(void); 191int cdebug_init(void);
193void cdebug_exit(void); 192void cdebug_exit(void);
diff --git a/include/linux/isdn_divertif.h b/include/linux/isdn_divertif.h
index 0e7e44ce8301..07821ca5955f 100644
--- a/include/linux/isdn_divertif.h
+++ b/include/linux/isdn_divertif.h
@@ -24,6 +24,10 @@
24#define DIVERT_REL_ERR 0x04 /* module not registered */ 24#define DIVERT_REL_ERR 0x04 /* module not registered */
25#define DIVERT_REG_NAME isdn_register_divert 25#define DIVERT_REG_NAME isdn_register_divert
26 26
27#ifdef __KERNEL__
28#include <linux/isdnif.h>
29#include <linux/types.h>
30
27/***************************************************************/ 31/***************************************************************/
28/* structure exchanging data between isdn hl and divert module */ 32/* structure exchanging data between isdn hl and divert module */
29/***************************************************************/ 33/***************************************************************/
@@ -40,3 +44,4 @@ typedef struct
40/* function register */ 44/* function register */
41/*********************/ 45/*********************/
42extern int DIVERT_REG_NAME(isdn_divert_if *); 46extern int DIVERT_REG_NAME(isdn_divert_if *);
47#endif
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 3e3b92dabe3b..12178d2c882b 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -30,6 +30,9 @@ extern int sprint_symbol(char *buffer, unsigned long address);
30/* Look up a kernel symbol and print it to the kernel messages. */ 30/* Look up a kernel symbol and print it to the kernel messages. */
31extern void __print_symbol(const char *fmt, unsigned long address); 31extern void __print_symbol(const char *fmt, unsigned long address);
32 32
33int lookup_symbol_name(unsigned long addr, char *symname);
34int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
35
33#else /* !CONFIG_KALLSYMS */ 36#else /* !CONFIG_KALLSYMS */
34 37
35static inline unsigned long kallsyms_lookup_name(const char *name) 38static inline unsigned long kallsyms_lookup_name(const char *name)
@@ -58,6 +61,16 @@ static inline int sprint_symbol(char *buffer, unsigned long addr)
58 return 0; 61 return 0;
59} 62}
60 63
64static inline int lookup_symbol_name(unsigned long addr, char *symname)
65{
66 return -ERANGE;
67}
68
69static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name)
70{
71 return -ERANGE;
72}
73
61/* Stupid that this does nothing, but I didn't create this mess. */ 74/* Stupid that this does nothing, but I didn't create this mess. */
62#define __print_symbol(fmt, addr) 75#define __print_symbol(fmt, addr)
63#endif /*CONFIG_KALLSYMS*/ 76#endif /*CONFIG_KALLSYMS*/
diff --git a/include/linux/kdebug.h b/include/linux/kdebug.h
new file mode 100644
index 000000000000..5db38d6d8b92
--- /dev/null
+++ b/include/linux/kdebug.h
@@ -0,0 +1,20 @@
1#ifndef _LINUX_KDEBUG_H
2#define _LINUX_KDEBUG_H
3
4#include <asm/kdebug.h>
5
6struct die_args {
7 struct pt_regs *regs;
8 const char *str;
9 long err;
10 int trapnr;
11 int signr;
12};
13
14int register_die_notifier(struct notifier_block *nb);
15int unregister_die_notifier(struct notifier_block *nb);
16
17int notify_die(enum die_val val, const char *str,
18 struct pt_regs *regs, long err, int trap, int sig);
19
20#endif /* _LINUX_KDEBUG_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e2f41b051b12..144b615f3a89 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -35,7 +35,8 @@ extern const char linux_proc_banner[];
35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
37 37
38#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 38#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
39
39#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 40#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
40#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 41#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
41#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) 42#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 696e5ec63f77..8c2c7fcd58ce 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -7,6 +7,8 @@
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <linux/compat.h> 8#include <linux/compat.h>
9#include <linux/ioport.h> 9#include <linux/ioport.h>
10#include <linux/elfcore.h>
11#include <linux/elf.h>
10#include <asm/kexec.h> 12#include <asm/kexec.h>
11 13
12/* Verify architecture specific macros are defined */ 14/* Verify architecture specific macros are defined */
@@ -31,6 +33,19 @@
31#error KEXEC_ARCH not defined 33#error KEXEC_ARCH not defined
32#endif 34#endif
33 35
36#define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4)
37#define KEXEC_CORE_NOTE_NAME "CORE"
38#define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4)
39#define KEXEC_CORE_NOTE_DESC_BYTES ALIGN(sizeof(struct elf_prstatus), 4)
40/*
41 * The per-cpu notes area is a list of notes terminated by a "NULL"
42 * note header. For kdump, the code in vmcore.c runs in the context
43 * of the second kernel to combine them into one note.
44 */
45#define KEXEC_NOTE_BYTES ( (KEXEC_NOTE_HEAD_BYTES * 2) + \
46 KEXEC_CORE_NOTE_NAME_BYTES + \
47 KEXEC_CORE_NOTE_DESC_BYTES )
48
34/* 49/*
35 * This structure is used to hold the arguments that are used when loading 50 * This structure is used to hold the arguments that are used when loading
36 * kernel binaries. 51 * kernel binaries.
@@ -136,7 +151,7 @@ extern struct kimage *kexec_crash_image;
136/* Location of a reserved region to hold the crash kernel. 151/* Location of a reserved region to hold the crash kernel.
137 */ 152 */
138extern struct resource crashk_res; 153extern struct resource crashk_res;
139typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; 154typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4];
140extern note_buf_t *crash_notes; 155extern note_buf_t *crash_notes;
141 156
142 157
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 769be39b9681..23adf6075ae4 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -78,7 +78,7 @@ struct kprobe {
78 kprobe_opcode_t *addr; 78 kprobe_opcode_t *addr;
79 79
80 /* Allow user to indicate symbol name of the probe point */ 80 /* Allow user to indicate symbol name of the probe point */
81 char *symbol_name; 81 const char *symbol_name;
82 82
83 /* Offset into the symbol */ 83 /* Offset into the symbol */
84 unsigned int offset; 84 unsigned int offset;
@@ -123,12 +123,18 @@ DECLARE_PER_CPU(struct kprobe *, current_kprobe);
123DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 123DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
124 124
125#ifdef ARCH_SUPPORTS_KRETPROBES 125#ifdef ARCH_SUPPORTS_KRETPROBES
126extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs); 126extern void arch_prepare_kretprobe(struct kretprobe_instance *ri,
127 struct pt_regs *regs);
128extern int arch_trampoline_kprobe(struct kprobe *p);
127#else /* ARCH_SUPPORTS_KRETPROBES */ 129#else /* ARCH_SUPPORTS_KRETPROBES */
128static inline void arch_prepare_kretprobe(struct kretprobe *rp, 130static inline void arch_prepare_kretprobe(struct kretprobe *rp,
129 struct pt_regs *regs) 131 struct pt_regs *regs)
130{ 132{
131} 133}
134static inline int arch_trampoline_kprobe(struct kprobe *p)
135{
136 return 0;
137}
132#endif /* ARCH_SUPPORTS_KRETPROBES */ 138#endif /* ARCH_SUPPORTS_KRETPROBES */
133/* 139/*
134 * Function-return probe - 140 * Function-return probe -
@@ -157,6 +163,16 @@ struct kretprobe_instance {
157 struct task_struct *task; 163 struct task_struct *task;
158}; 164};
159 165
166static inline void kretprobe_assert(struct kretprobe_instance *ri,
167 unsigned long orig_ret_address, unsigned long trampoline_address)
168{
169 if (!orig_ret_address || (orig_ret_address == trampoline_address)) {
170 printk("kretprobe BUG!: Processing kretprobe %p @ %p\n",
171 ri->rp, ri->rp->kp.addr);
172 BUG();
173 }
174}
175
160extern spinlock_t kretprobe_lock; 176extern spinlock_t kretprobe_lock;
161extern struct mutex kprobe_mutex; 177extern struct mutex kprobe_mutex;
162extern int arch_prepare_kprobe(struct kprobe *p); 178extern int arch_prepare_kprobe(struct kprobe *p);
@@ -199,8 +215,6 @@ void jprobe_return(void);
199int register_kretprobe(struct kretprobe *rp); 215int register_kretprobe(struct kretprobe *rp);
200void unregister_kretprobe(struct kretprobe *rp); 216void unregister_kretprobe(struct kretprobe *rp);
201 217
202struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp);
203void add_rp_inst(struct kretprobe_instance *ri);
204void kprobe_flush_task(struct task_struct *tk); 218void kprobe_flush_task(struct task_struct *tk);
205void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); 219void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
206#else /* CONFIG_KPROBES */ 220#else /* CONFIG_KPROBES */
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 275354ffa1cb..e6edca81ab84 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -11,7 +11,7 @@
11#include <asm/types.h> 11#include <asm/types.h>
12#include <linux/ioctl.h> 12#include <linux/ioctl.h>
13 13
14#define KVM_API_VERSION 4 14#define KVM_API_VERSION 12
15 15
16/* 16/*
17 * Architectural interrupt line count, and the size of the bitmap needed 17 * Architectural interrupt line count, and the size of the bitmap needed
@@ -33,37 +33,39 @@ struct kvm_memory_region {
33/* for kvm_memory_region::flags */ 33/* for kvm_memory_region::flags */
34#define KVM_MEM_LOG_DIRTY_PAGES 1UL 34#define KVM_MEM_LOG_DIRTY_PAGES 1UL
35 35
36 36struct kvm_memory_alias {
37#define KVM_EXIT_TYPE_FAIL_ENTRY 1 37 __u32 slot; /* this has a different namespace than memory slots */
38#define KVM_EXIT_TYPE_VM_EXIT 2 38 __u32 flags;
39 __u64 guest_phys_addr;
40 __u64 memory_size;
41 __u64 target_phys_addr;
42};
39 43
40enum kvm_exit_reason { 44enum kvm_exit_reason {
41 KVM_EXIT_UNKNOWN = 0, 45 KVM_EXIT_UNKNOWN = 0,
42 KVM_EXIT_EXCEPTION = 1, 46 KVM_EXIT_EXCEPTION = 1,
43 KVM_EXIT_IO = 2, 47 KVM_EXIT_IO = 2,
44 KVM_EXIT_CPUID = 3, 48 KVM_EXIT_HYPERCALL = 3,
45 KVM_EXIT_DEBUG = 4, 49 KVM_EXIT_DEBUG = 4,
46 KVM_EXIT_HLT = 5, 50 KVM_EXIT_HLT = 5,
47 KVM_EXIT_MMIO = 6, 51 KVM_EXIT_MMIO = 6,
48 KVM_EXIT_IRQ_WINDOW_OPEN = 7, 52 KVM_EXIT_IRQ_WINDOW_OPEN = 7,
49 KVM_EXIT_SHUTDOWN = 8, 53 KVM_EXIT_SHUTDOWN = 8,
54 KVM_EXIT_FAIL_ENTRY = 9,
55 KVM_EXIT_INTR = 10,
50}; 56};
51 57
52/* for KVM_RUN */ 58/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
53struct kvm_run { 59struct kvm_run {
54 /* in */ 60 /* in */
55 __u32 emulated; /* skip current instruction */
56 __u32 mmio_completed; /* mmio request completed */
57 __u8 request_interrupt_window; 61 __u8 request_interrupt_window;
58 __u8 padding1[7]; 62 __u8 padding1[7];
59 63
60 /* out */ 64 /* out */
61 __u32 exit_type;
62 __u32 exit_reason; 65 __u32 exit_reason;
63 __u32 instruction_length;
64 __u8 ready_for_interrupt_injection; 66 __u8 ready_for_interrupt_injection;
65 __u8 if_flag; 67 __u8 if_flag;
66 __u16 padding2; 68 __u8 padding2[2];
67 69
68 /* in (pre_kvm_run), out (post_kvm_run) */ 70 /* in (pre_kvm_run), out (post_kvm_run) */
69 __u64 cr8; 71 __u64 cr8;
@@ -72,29 +74,26 @@ struct kvm_run {
72 union { 74 union {
73 /* KVM_EXIT_UNKNOWN */ 75 /* KVM_EXIT_UNKNOWN */
74 struct { 76 struct {
75 __u32 hardware_exit_reason; 77 __u64 hardware_exit_reason;
76 } hw; 78 } hw;
79 /* KVM_EXIT_FAIL_ENTRY */
80 struct {
81 __u64 hardware_entry_failure_reason;
82 } fail_entry;
77 /* KVM_EXIT_EXCEPTION */ 83 /* KVM_EXIT_EXCEPTION */
78 struct { 84 struct {
79 __u32 exception; 85 __u32 exception;
80 __u32 error_code; 86 __u32 error_code;
81 } ex; 87 } ex;
82 /* KVM_EXIT_IO */ 88 /* KVM_EXIT_IO */
83 struct { 89 struct kvm_io {
84#define KVM_EXIT_IO_IN 0 90#define KVM_EXIT_IO_IN 0
85#define KVM_EXIT_IO_OUT 1 91#define KVM_EXIT_IO_OUT 1
86 __u8 direction; 92 __u8 direction;
87 __u8 size; /* bytes */ 93 __u8 size; /* bytes */
88 __u8 string;
89 __u8 string_down;
90 __u8 rep;
91 __u8 pad;
92 __u16 port; 94 __u16 port;
93 __u64 count; 95 __u32 count;
94 union { 96 __u64 data_offset; /* relative to kvm_run start */
95 __u64 address;
96 __u32 value;
97 };
98 } io; 97 } io;
99 struct { 98 struct {
100 } debug; 99 } debug;
@@ -105,6 +104,13 @@ struct kvm_run {
105 __u32 len; 104 __u32 len;
106 __u8 is_write; 105 __u8 is_write;
107 } mmio; 106 } mmio;
107 /* KVM_EXIT_HYPERCALL */
108 struct {
109 __u64 args[6];
110 __u64 ret;
111 __u32 longmode;
112 __u32 pad;
113 } hypercall;
108 }; 114 };
109}; 115};
110 116
@@ -118,6 +124,21 @@ struct kvm_regs {
118 __u64 rip, rflags; 124 __u64 rip, rflags;
119}; 125};
120 126
127/* for KVM_GET_FPU and KVM_SET_FPU */
128struct kvm_fpu {
129 __u8 fpr[8][16];
130 __u16 fcw;
131 __u16 fsw;
132 __u8 ftwx; /* in fxsave format */
133 __u8 pad1;
134 __u16 last_opcode;
135 __u64 last_ip;
136 __u64 last_dp;
137 __u8 xmm[16][16];
138 __u32 mxcsr;
139 __u32 pad2;
140};
141
121struct kvm_segment { 142struct kvm_segment {
122 __u64 base; 143 __u64 base;
123 __u32 limit; 144 __u32 limit;
@@ -210,38 +231,74 @@ struct kvm_dirty_log {
210 }; 231 };
211}; 232};
212 233
234struct kvm_cpuid_entry {
235 __u32 function;
236 __u32 eax;
237 __u32 ebx;
238 __u32 ecx;
239 __u32 edx;
240 __u32 padding;
241};
242
243/* for KVM_SET_CPUID */
244struct kvm_cpuid {
245 __u32 nent;
246 __u32 padding;
247 struct kvm_cpuid_entry entries[0];
248};
249
250/* for KVM_SET_SIGNAL_MASK */
251struct kvm_signal_mask {
252 __u32 len;
253 __u8 sigset[0];
254};
255
213#define KVMIO 0xAE 256#define KVMIO 0xAE
214 257
215/* 258/*
216 * ioctls for /dev/kvm fds: 259 * ioctls for /dev/kvm fds:
217 */ 260 */
218#define KVM_GET_API_VERSION _IO(KVMIO, 1) 261#define KVM_GET_API_VERSION _IO(KVMIO, 0x00)
219#define KVM_CREATE_VM _IO(KVMIO, 2) /* returns a VM fd */ 262#define KVM_CREATE_VM _IO(KVMIO, 0x01) /* returns a VM fd */
220#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 15, struct kvm_msr_list) 263#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list)
264/*
265 * Check if a kvm extension is available. Argument is extension number,
266 * return is 1 (yes) or 0 (no, sorry).
267 */
268#define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03)
269/*
270 * Get size for mmap(vcpu_fd)
271 */
272#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */
221 273
222/* 274/*
223 * ioctls for VM fds 275 * ioctls for VM fds
224 */ 276 */
225#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region) 277#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
226/* 278/*
227 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns 279 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
228 * a vcpu fd. 280 * a vcpu fd.
229 */ 281 */
230#define KVM_CREATE_VCPU _IOW(KVMIO, 11, int) 282#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
231#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log) 283#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
284#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
232 285
233/* 286/*
234 * ioctls for vcpu fds 287 * ioctls for vcpu fds
235 */ 288 */
236#define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) 289#define KVM_RUN _IO(KVMIO, 0x80)
237#define KVM_GET_REGS _IOR(KVMIO, 3, struct kvm_regs) 290#define KVM_GET_REGS _IOR(KVMIO, 0x81, struct kvm_regs)
238#define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) 291#define KVM_SET_REGS _IOW(KVMIO, 0x82, struct kvm_regs)
239#define KVM_GET_SREGS _IOR(KVMIO, 5, struct kvm_sregs) 292#define KVM_GET_SREGS _IOR(KVMIO, 0x83, struct kvm_sregs)
240#define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs) 293#define KVM_SET_SREGS _IOW(KVMIO, 0x84, struct kvm_sregs)
241#define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation) 294#define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation)
242#define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt) 295#define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt)
243#define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest) 296#define KVM_DEBUG_GUEST _IOW(KVMIO, 0x87, struct kvm_debug_guest)
244#define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs) 297#define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs)
245#define KVM_SET_MSRS _IOW(KVMIO, 14, struct kvm_msrs) 298#define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs)
299#define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid)
300#define KVM_SET_SIGNAL_MASK _IOW(KVMIO, 0x8b, struct kvm_signal_mask)
301#define KVM_GET_FPU _IOR(KVMIO, 0x8c, struct kvm_fpu)
302#define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu)
246 303
247#endif 304#endif
diff --git a/include/linux/libata.h b/include/linux/libata.h
index d8cfc72ea9c1..7906d750aa77 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -296,18 +296,8 @@ enum {
296 296
297 /* how hard are we gonna try to probe/recover devices */ 297 /* how hard are we gonna try to probe/recover devices */
298 ATA_PROBE_MAX_TRIES = 3, 298 ATA_PROBE_MAX_TRIES = 3,
299 ATA_EH_RESET_TRIES = 3,
300 ATA_EH_DEV_TRIES = 3, 299 ATA_EH_DEV_TRIES = 3,
301 300
302 /* Drive spinup time (time from power-on to the first D2H FIS)
303 * in msecs - 8s currently. Failing to get ready in this time
304 * isn't critical. It will result in reset failure for
305 * controllers which can't wait for the first D2H FIS. libata
306 * will retry, so it just has to be long enough to spin up
307 * most devices.
308 */
309 ATA_SPINUP_WAIT = 8000,
310
311 /* Horkage types. May be set by libata or controller on drives 301 /* Horkage types. May be set by libata or controller on drives
312 (some horkage may be drive/controller pair dependant */ 302 (some horkage may be drive/controller pair dependant */
313 303
@@ -348,8 +338,9 @@ struct ata_queued_cmd;
348 338
349/* typedefs */ 339/* typedefs */
350typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); 340typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
351typedef int (*ata_prereset_fn_t)(struct ata_port *ap); 341typedef int (*ata_prereset_fn_t)(struct ata_port *ap, unsigned long deadline);
352typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes); 342typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes,
343 unsigned long deadline);
353typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes); 344typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes);
354 345
355struct ata_ioports { 346struct ata_ioports {
@@ -494,7 +485,6 @@ struct ata_eh_info {
494 unsigned int dev_action[ATA_MAX_DEVICES]; /* dev EH action */ 485 unsigned int dev_action[ATA_MAX_DEVICES]; /* dev EH action */
495 unsigned int flags; /* ATA_EHI_* flags */ 486 unsigned int flags; /* ATA_EHI_* flags */
496 487
497 unsigned long hotplug_timestamp;
498 unsigned int probe_mask; 488 unsigned int probe_mask;
499 489
500 char desc[ATA_EH_DESC_LEN]; 490 char desc[ATA_EH_DESC_LEN];
@@ -688,13 +678,17 @@ extern void __sata_phy_reset(struct ata_port *ap);
688extern void sata_phy_reset(struct ata_port *ap); 678extern void sata_phy_reset(struct ata_port *ap);
689extern void ata_bus_reset(struct ata_port *ap); 679extern void ata_bus_reset(struct ata_port *ap);
690extern int sata_set_spd(struct ata_port *ap); 680extern int sata_set_spd(struct ata_port *ap);
691extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param); 681extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param,
692extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param); 682 unsigned long deadline);
693extern int ata_std_prereset(struct ata_port *ap); 683extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param,
694extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); 684 unsigned long deadline);
695extern int sata_port_hardreset(struct ata_port *ap, 685extern int ata_std_prereset(struct ata_port *ap, unsigned long deadline);
696 const unsigned long *timing); 686extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes,
697extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); 687 unsigned long deadline);
688extern int sata_port_hardreset(struct ata_port *ap, const unsigned long *timing,
689 unsigned long deadline);
690extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class,
691 unsigned long deadline);
698extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 692extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
699extern void ata_port_disable(struct ata_port *); 693extern void ata_port_disable(struct ata_port *);
700extern void ata_std_ports(struct ata_ioports *ioaddr); 694extern void ata_std_ports(struct ata_ioports *ioaddr);
@@ -750,6 +744,7 @@ extern void ata_host_resume(struct ata_host *host);
750extern int ata_ratelimit(void); 744extern int ata_ratelimit(void);
751extern int ata_busy_sleep(struct ata_port *ap, 745extern int ata_busy_sleep(struct ata_port *ap,
752 unsigned long timeout_pat, unsigned long timeout); 746 unsigned long timeout_pat, unsigned long timeout);
747extern int ata_wait_ready(struct ata_port *ap, unsigned long deadline);
753extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn, 748extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn,
754 void *data, unsigned long delay); 749 void *data, unsigned long delay);
755extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, 750extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
@@ -919,12 +914,7 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
919 914
920static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi) 915static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
921{ 916{
922 if (ehi->flags & ATA_EHI_HOTPLUGGED)
923 return;
924
925 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK; 917 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK;
926 ehi->hotplug_timestamp = jiffies;
927
928 ehi->action |= ATA_EH_SOFTRESET; 918 ehi->action |= ATA_EH_SOFTRESET;
929 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; 919 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
930} 920}
diff --git a/include/linux/list.h b/include/linux/list.h
index f9d71eab05ee..9202703be2a4 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -426,6 +426,17 @@ static inline void list_splice_init_rcu(struct list_head *list,
426 container_of(ptr, type, member) 426 container_of(ptr, type, member)
427 427
428/** 428/**
429 * list_first_entry - get the first element from a list
430 * @ptr: the list head to take the element from.
431 * @type: the type of the struct this is embedded in.
432 * @member: the name of the list_struct within the struct.
433 *
434 * Note, that list is expected to be not empty.
435 */
436#define list_first_entry(ptr, type, member) \
437 list_entry((ptr)->next, type, member)
438
439/**
429 * list_for_each - iterate over a list 440 * list_for_each - iterate over a list
430 * @pos: the &struct list_head to use as a loop cursor. 441 * @pos: the &struct list_head to use as a loop cursor.
431 * @head: the head for your list. 442 * @head: the head for your list.
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index f6a81e0b1b93..05707e2fccae 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -119,6 +119,9 @@ struct nlm_file {
119 * couldn't be granted because of a conflicting lock). 119 * couldn't be granted because of a conflicting lock).
120 */ 120 */
121#define NLM_NEVER (~(unsigned long) 0) 121#define NLM_NEVER (~(unsigned long) 0)
122/* timeout on non-blocking call: */
123#define NLM_TIMEOUT (7 * HZ)
124
122struct nlm_block { 125struct nlm_block {
123 struct kref b_count; /* Reference count */ 126 struct kref b_count; /* Reference count */
124 struct list_head b_list; /* linked list of all blocks */ 127 struct list_head b_list; /* linked list of all blocks */
@@ -130,6 +133,13 @@ struct nlm_block {
130 unsigned int b_id; /* block id */ 133 unsigned int b_id; /* block id */
131 unsigned char b_granted; /* VFS granted lock */ 134 unsigned char b_granted; /* VFS granted lock */
132 struct nlm_file * b_file; /* file in question */ 135 struct nlm_file * b_file; /* file in question */
136 struct cache_req * b_cache_req; /* deferred request handling */
137 struct file_lock * b_fl; /* set for GETLK */
138 struct cache_deferred_req * b_deferred_req;
139 unsigned int b_flags; /* block flags */
140#define B_QUEUED 1 /* lock queued */
141#define B_GOT_CALLBACK 2 /* got lock or conflicting lock */
142#define B_TIMED_OUT 4 /* filesystem too slow to respond */
133}; 143};
134 144
135/* 145/*
@@ -185,8 +195,8 @@ typedef int (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref)
185__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, 195__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
186 struct nlm_lock *, int, struct nlm_cookie *); 196 struct nlm_lock *, int, struct nlm_cookie *);
187__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); 197__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
188__be32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *, 198__be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *,
189 struct nlm_lock *); 199 struct nlm_lock *, struct nlm_lock *, struct nlm_cookie *);
190__be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); 200__be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
191unsigned long nlmsvc_retry_blocked(void); 201unsigned long nlmsvc_retry_blocked(void);
192void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, 202void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 191a595055f0..0b99b31f017b 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -64,6 +64,8 @@ struct loop_device {
64 wait_queue_head_t lo_event; 64 wait_queue_head_t lo_event;
65 65
66 request_queue_t *lo_queue; 66 request_queue_t *lo_queue;
67 struct gendisk *lo_disk;
68 struct list_head lo_list;
67}; 69};
68 70
69#endif /* __KERNEL__ */ 71#endif /* __KERNEL__ */
diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h
index bdc01127dced..580b3f4956ee 100644
--- a/include/linux/mc146818rtc.h
+++ b/include/linux/mc146818rtc.h
@@ -22,8 +22,15 @@ extern spinlock_t rtc_lock; /* serialize CMOS RAM access */
22/* Some RTCs extend the mc146818 register set to support alarms of more 22/* Some RTCs extend the mc146818 register set to support alarms of more
23 * than 24 hours in the future; or dates that include a century code. 23 * than 24 hours in the future; or dates that include a century code.
24 * This platform_data structure can pass this information to the driver. 24 * This platform_data structure can pass this information to the driver.
25 *
26 * Also, some platforms need suspend()/resume() hooks to kick in special
27 * handling of wake alarms, e.g. activating ACPI BIOS hooks or setting up
28 * a separate wakeup alarm used by some almost-clone chips.
25 */ 29 */
26struct cmos_rtc_board_info { 30struct cmos_rtc_board_info {
31 void (*wake_on)(struct device *dev);
32 void (*wake_off)(struct device *dev);
33
27 u8 rtc_day_alarm; /* zero, or register index */ 34 u8 rtc_day_alarm; /* zero, or register index */
28 u8 rtc_mon_alarm; /* zero, or register index */ 35 u8 rtc_mon_alarm; /* zero, or register index */
29 u8 rtc_century; /* zero, or register index */ 36 u8 rtc_century; /* zero, or register index */
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 75e55dcdeb18..e10a90a93b5d 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -2,18 +2,29 @@
2#define _LINUX_MIGRATE_H 2#define _LINUX_MIGRATE_H
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/mempolicy.h>
6#include <linux/pagemap.h>
5 7
6typedef struct page *new_page_t(struct page *, unsigned long private, int **); 8typedef struct page *new_page_t(struct page *, unsigned long private, int **);
7 9
10#ifdef CONFIG_MIGRATION
8/* Check if a vma is migratable */ 11/* Check if a vma is migratable */
9static inline int vma_migratable(struct vm_area_struct *vma) 12static inline int vma_migratable(struct vm_area_struct *vma)
10{ 13{
11 if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) 14 if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED))
12 return 0; 15 return 0;
16 /*
17 * Migration allocates pages in the highest zone. If we cannot
18 * do so then migration (at least from node to node) is not
19 * possible.
20 */
21 if (vma->vm_file &&
22 gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping))
23 < policy_zone)
24 return 0;
13 return 1; 25 return 1;
14} 26}
15 27
16#ifdef CONFIG_MIGRATION
17extern int isolate_lru_page(struct page *p, struct list_head *pagelist); 28extern int isolate_lru_page(struct page *p, struct list_head *pagelist);
18extern int putback_lru_pages(struct list_head *l); 29extern int putback_lru_pages(struct list_head *l);
19extern int migrate_page(struct address_space *, 30extern int migrate_page(struct address_space *,
@@ -28,6 +39,8 @@ extern int migrate_vmas(struct mm_struct *mm,
28 const nodemask_t *from, const nodemask_t *to, 39 const nodemask_t *from, const nodemask_t *to,
29 unsigned long flags); 40 unsigned long flags);
30#else 41#else
42static inline int vma_migratable(struct vm_area_struct *vma)
43 { return 0; }
31 44
32static inline int isolate_lru_page(struct page *p, struct list_head *list) 45static inline int isolate_lru_page(struct page *p, struct list_head *list)
33 { return -ENOSYS; } 46 { return -ENOSYS; }
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 326da7d500c7..dff9ea32606a 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -29,6 +29,7 @@
29 29
30#define TUN_MINOR 200 30#define TUN_MINOR 200
31#define HPET_MINOR 228 31#define HPET_MINOR 228
32#define KVM_MINOR 232
32 33
33struct device; 34struct device;
34 35
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 60e0e4a592d2..4670ebd1f622 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -267,21 +267,31 @@ static inline int get_page_unless_zero(struct page *page)
267 return atomic_inc_not_zero(&page->_count); 267 return atomic_inc_not_zero(&page->_count);
268} 268}
269 269
270static inline struct page *compound_head(struct page *page)
271{
272 if (unlikely(PageTail(page)))
273 return page->first_page;
274 return page;
275}
276
270static inline int page_count(struct page *page) 277static inline int page_count(struct page *page)
271{ 278{
272 if (unlikely(PageCompound(page))) 279 return atomic_read(&compound_head(page)->_count);
273 page = (struct page *)page_private(page);
274 return atomic_read(&page->_count);
275} 280}
276 281
277static inline void get_page(struct page *page) 282static inline void get_page(struct page *page)
278{ 283{
279 if (unlikely(PageCompound(page))) 284 page = compound_head(page);
280 page = (struct page *)page_private(page);
281 VM_BUG_ON(atomic_read(&page->_count) == 0); 285 VM_BUG_ON(atomic_read(&page->_count) == 0);
282 atomic_inc(&page->_count); 286 atomic_inc(&page->_count);
283} 287}
284 288
289static inline struct page *virt_to_head_page(const void *x)
290{
291 struct page *page = virt_to_page(x);
292 return compound_head(page);
293}
294
285/* 295/*
286 * Setup the page count before being freed into the page allocator for 296 * Setup the page count before being freed into the page allocator for
287 * the first time (boot or memory hotplug) 297 * the first time (boot or memory hotplug)
@@ -314,6 +324,18 @@ static inline compound_page_dtor *get_compound_page_dtor(struct page *page)
314 return (compound_page_dtor *)page[1].lru.next; 324 return (compound_page_dtor *)page[1].lru.next;
315} 325}
316 326
327static inline int compound_order(struct page *page)
328{
329 if (!PageHead(page))
330 return 0;
331 return (unsigned long)page[1].lru.prev;
332}
333
334static inline void set_compound_order(struct page *page, unsigned long order)
335{
336 page[1].lru.prev = (void *)order;
337}
338
317/* 339/*
318 * Multiple processes may "see" the same page. E.g. for untouched 340 * Multiple processes may "see" the same page. E.g. for untouched
319 * mappings of /dev/null, all processes see the same page full of 341 * mappings of /dev/null, all processes see the same page full of
@@ -850,8 +872,26 @@ static inline int vma_wants_writenotify(struct vm_area_struct *vma)
850 872
851extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); 873extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl));
852 874
875#ifdef __PAGETABLE_PUD_FOLDED
876static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
877 unsigned long address)
878{
879 return 0;
880}
881#else
853int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); 882int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
883#endif
884
885#ifdef __PAGETABLE_PMD_FOLDED
886static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud,
887 unsigned long address)
888{
889 return 0;
890}
891#else
854int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); 892int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
893#endif
894
855int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); 895int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address);
856int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); 896int __pte_alloc_kernel(pmd_t *pmd, unsigned long address);
857 897
@@ -1130,6 +1170,11 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address,
1130#define FOLL_GET 0x04 /* do get_page on page */ 1170#define FOLL_GET 0x04 /* do get_page on page */
1131#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ 1171#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */
1132 1172
1173typedef int (*pte_fn_t)(pte_t *pte, struct page *pmd_page, unsigned long addr,
1174 void *data);
1175extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
1176 unsigned long size, pte_fn_t fn, void *data);
1177
1133#ifdef CONFIG_PROC_FS 1178#ifdef CONFIG_PROC_FS
1134void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); 1179void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
1135#else 1180#else
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index c3852fd4a1cc..e30687bad075 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -19,10 +19,16 @@ struct page {
19 unsigned long flags; /* Atomic flags, some possibly 19 unsigned long flags; /* Atomic flags, some possibly
20 * updated asynchronously */ 20 * updated asynchronously */
21 atomic_t _count; /* Usage count, see below. */ 21 atomic_t _count; /* Usage count, see below. */
22 atomic_t _mapcount; /* Count of ptes mapped in mms, 22 union {
23 atomic_t _mapcount; /* Count of ptes mapped in mms,
23 * to show when page is mapped 24 * to show when page is mapped
24 * & limit reverse map searches. 25 * & limit reverse map searches.
25 */ 26 */
27 struct { /* SLUB uses */
28 short unsigned int inuse;
29 short unsigned int offset;
30 };
31 };
26 union { 32 union {
27 struct { 33 struct {
28 unsigned long private; /* Mapping-private opaque data: 34 unsigned long private; /* Mapping-private opaque data:
@@ -43,8 +49,15 @@ struct page {
43#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 49#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
44 spinlock_t ptl; 50 spinlock_t ptl;
45#endif 51#endif
52 struct { /* SLUB uses */
53 struct page *first_page; /* Compound pages */
54 struct kmem_cache *slab; /* Pointer to slab */
55 };
56 };
57 union {
58 pgoff_t index; /* Our offset within mapping. */
59 void *freelist; /* SLUB: pointer to free object */
46 }; 60 };
47 pgoff_t index; /* Our offset within mapping. */
48 struct list_head lru; /* Pageout list, eg. active_list 61 struct list_head lru; /* Pageout list, eg. active_list
49 * protected by zone->lru_lock ! 62 * protected by zone->lru_lock !
50 */ 63 */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index ee9e3143df4f..2f1544e83042 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -784,6 +784,18 @@ void sparse_init(void);
784void memory_present(int nid, unsigned long start, unsigned long end); 784void memory_present(int nid, unsigned long start, unsigned long end);
785unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); 785unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long);
786 786
787/*
788 * If it is possible to have holes within a MAX_ORDER_NR_PAGES, then we
789 * need to check pfn validility within that MAX_ORDER_NR_PAGES block.
790 * pfn_valid_within() should be used in this case; we optimise this away
791 * when we have no holes within a MAX_ORDER_NR_PAGES block.
792 */
793#ifdef CONFIG_HOLES_IN_ZONE
794#define pfn_valid_within(pfn) pfn_valid(pfn)
795#else
796#define pfn_valid_within(pfn) (1)
797#endif
798
787#endif /* !__ASSEMBLY__ */ 799#endif /* !__ASSEMBLY__ */
788#endif /* __KERNEL__ */ 800#endif /* __KERNEL__ */
789#endif /* _LINUX_MMZONE_H */ 801#endif /* _LINUX_MMZONE_H */
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 4af0b1fc282a..1fa4d9813b31 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -14,10 +14,9 @@ struct mnt_namespace {
14 int event; 14 int event;
15}; 15};
16 16
17extern int copy_mnt_ns(int, struct task_struct *); 17extern struct mnt_namespace *copy_mnt_ns(int, struct mnt_namespace *,
18extern void __put_mnt_ns(struct mnt_namespace *ns);
19extern struct mnt_namespace *dup_mnt_ns(struct task_struct *,
20 struct fs_struct *); 18 struct fs_struct *);
19extern void __put_mnt_ns(struct mnt_namespace *ns);
21 20
22static inline void put_mnt_ns(struct mnt_namespace *ns) 21static inline void put_mnt_ns(struct mnt_namespace *ns)
23{ 22{
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index e96b2dee10bb..af04a555b52c 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -262,6 +262,7 @@ struct i2c_device_id {
262 262
263/* Input */ 263/* Input */
264#define INPUT_DEVICE_ID_EV_MAX 0x1f 264#define INPUT_DEVICE_ID_EV_MAX 0x1f
265#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71
265#define INPUT_DEVICE_ID_KEY_MAX 0x1ff 266#define INPUT_DEVICE_ID_KEY_MAX 0x1ff
266#define INPUT_DEVICE_ID_REL_MAX 0x0f 267#define INPUT_DEVICE_ID_REL_MAX 0x0f
267#define INPUT_DEVICE_ID_ABS_MAX 0x3f 268#define INPUT_DEVICE_ID_ABS_MAX 0x3f
diff --git a/include/linux/module.h b/include/linux/module.h
index f0b0faf42d5d..6d3dc9c4ff96 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -370,16 +370,14 @@ struct module *module_text_address(unsigned long addr);
370struct module *__module_text_address(unsigned long addr); 370struct module *__module_text_address(unsigned long addr);
371int is_module_address(unsigned long addr); 371int is_module_address(unsigned long addr);
372 372
373/* Returns module and fills in value, defined and namebuf, or NULL if 373/* Returns 0 and fills in value, defined and namebuf, or -ERANGE if
374 symnum out of range. */ 374 symnum out of range. */
375struct module *module_get_kallsym(unsigned int symnum, unsigned long *value, 375int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
376 char *type, char *name, size_t namelen); 376 char *name, char *module_name, int *exported);
377 377
378/* Look for this name: can be of form module:name. */ 378/* Look for this name: can be of form module:name. */
379unsigned long module_kallsyms_lookup_name(const char *name); 379unsigned long module_kallsyms_lookup_name(const char *name);
380 380
381int is_exported(const char *name, const struct module *mod);
382
383extern void __module_put_and_exit(struct module *mod, long code) 381extern void __module_put_and_exit(struct module *mod, long code)
384 __attribute__((noreturn)); 382 __attribute__((noreturn));
385#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); 383#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code);
@@ -456,6 +454,8 @@ const char *module_address_lookup(unsigned long addr,
456 unsigned long *symbolsize, 454 unsigned long *symbolsize,
457 unsigned long *offset, 455 unsigned long *offset,
458 char **modname); 456 char **modname);
457int lookup_module_symbol_name(unsigned long addr, char *symname);
458int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
459 459
460/* For extable.c to search modules' exception tables. */ 460/* For extable.c to search modules' exception tables. */
461const struct exception_table_entry *search_module_extables(unsigned long addr); 461const struct exception_table_entry *search_module_extables(unsigned long addr);
@@ -527,20 +527,24 @@ static inline const char *module_address_lookup(unsigned long addr,
527 return NULL; 527 return NULL;
528} 528}
529 529
530static inline struct module *module_get_kallsym(unsigned int symnum, 530static inline int lookup_module_symbol_name(unsigned long addr, char *symname)
531 unsigned long *value,
532 char *type, char *name,
533 size_t namelen)
534{ 531{
535 return NULL; 532 return -ERANGE;
536} 533}
537 534
538static inline unsigned long module_kallsyms_lookup_name(const char *name) 535static inline int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name)
539{ 536{
540 return 0; 537 return -ERANGE;
541} 538}
542 539
543static inline int is_exported(const char *name, const struct module *mod) 540static inline int module_get_kallsym(unsigned int symnum, unsigned long *value,
541 char *type, char *name,
542 char *module_name, int *exported)
543{
544 return -ERANGE;
545}
546
547static inline unsigned long module_kallsyms_lookup_name(const char *name)
544{ 548{
545 return 0; 549 return 0;
546} 550}
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index fa253fa73aa3..0e09c005dda8 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -205,7 +205,8 @@ struct fat_mount_options {
205 numtail:1, /* Does first alias have a numeric '~1' type tail? */ 205 numtail:1, /* Does first alias have a numeric '~1' type tail? */
206 atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ 206 atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */
207 flush:1, /* write things quickly */ 207 flush:1, /* write things quickly */
208 nocase:1; /* Does this need case conversion? 0=need case conversion*/ 208 nocase:1, /* Does this need case conversion? 0=need case conversion*/
209 usefree:1; /* Use free_clusters for FAT32 */
209}; 210};
210 211
211#define FAT_HASH_BITS 8 212#define FAT_HASH_BITS 8
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index c95d5e642548..52b4378311c8 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -82,7 +82,7 @@ struct nfs_server {
82 struct rpc_clnt * client_acl; /* ACL RPC client handle */ 82 struct rpc_clnt * client_acl; /* ACL RPC client handle */
83 struct nfs_iostats * io_stats; /* I/O statistics */ 83 struct nfs_iostats * io_stats; /* I/O statistics */
84 struct backing_dev_info backing_dev_info; 84 struct backing_dev_info backing_dev_info;
85 atomic_t writeback; /* number of writeback pages */ 85 atomic_long_t writeback; /* number of writeback pages */
86 int flags; /* various flags */ 86 int flags; /* various flags */
87 unsigned int caps; /* server capabilities */ 87 unsigned int caps; /* server capabilities */
88 unsigned int rsize; /* read size */ 88 unsigned int rsize; /* read size */
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 0b9f0dc30d61..189e0dc993ab 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -31,10 +31,11 @@ struct nsproxy {
31}; 31};
32extern struct nsproxy init_nsproxy; 32extern struct nsproxy init_nsproxy;
33 33
34struct nsproxy *dup_namespaces(struct nsproxy *orig);
35int copy_namespaces(int flags, struct task_struct *tsk); 34int copy_namespaces(int flags, struct task_struct *tsk);
36void get_task_namespaces(struct task_struct *tsk); 35void get_task_namespaces(struct task_struct *tsk);
37void free_nsproxy(struct nsproxy *ns); 36void free_nsproxy(struct nsproxy *ns);
37int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
38 struct fs_struct *);
38 39
39static inline void put_nsproxy(struct nsproxy *ns) 40static inline void put_nsproxy(struct nsproxy *ns)
40{ 41{
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 96326594e55d..ae2d79f2107e 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -6,6 +6,7 @@
6#define PAGE_FLAGS_H 6#define PAGE_FLAGS_H
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/mm_types.h>
9 10
10/* 11/*
11 * Various page->flags bits: 12 * Various page->flags bits:
@@ -82,13 +83,11 @@
82#define PG_private 11 /* If pagecache, has fs-private data */ 83#define PG_private 11 /* If pagecache, has fs-private data */
83 84
84#define PG_writeback 12 /* Page is under writeback */ 85#define PG_writeback 12 /* Page is under writeback */
85#define PG_nosave 13 /* Used for system suspend/resume */
86#define PG_compound 14 /* Part of a compound page */ 86#define PG_compound 14 /* Part of a compound page */
87#define PG_swapcache 15 /* Swap page: swp_entry_t in private */ 87#define PG_swapcache 15 /* Swap page: swp_entry_t in private */
88 88
89#define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ 89#define PG_mappedtodisk 16 /* Has blocks allocated on-disk */
90#define PG_reclaim 17 /* To be reclaimed asap */ 90#define PG_reclaim 17 /* To be reclaimed asap */
91#define PG_nosave_free 18 /* Used for system suspend/resume */
92#define PG_buddy 19 /* Page is free, on buddy lists */ 91#define PG_buddy 19 /* Page is free, on buddy lists */
93 92
94/* PG_owner_priv_1 users should have descriptive aliases */ 93/* PG_owner_priv_1 users should have descriptive aliases */
@@ -214,16 +213,6 @@ static inline void SetPageUptodate(struct page *page)
214 ret; \ 213 ret; \
215 }) 214 })
216 215
217#define PageNosave(page) test_bit(PG_nosave, &(page)->flags)
218#define SetPageNosave(page) set_bit(PG_nosave, &(page)->flags)
219#define TestSetPageNosave(page) test_and_set_bit(PG_nosave, &(page)->flags)
220#define ClearPageNosave(page) clear_bit(PG_nosave, &(page)->flags)
221#define TestClearPageNosave(page) test_and_clear_bit(PG_nosave, &(page)->flags)
222
223#define PageNosaveFree(page) test_bit(PG_nosave_free, &(page)->flags)
224#define SetPageNosaveFree(page) set_bit(PG_nosave_free, &(page)->flags)
225#define ClearPageNosaveFree(page) clear_bit(PG_nosave_free, &(page)->flags)
226
227#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) 216#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags)
228#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) 217#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags)
229#define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags) 218#define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags)
@@ -241,6 +230,34 @@ static inline void SetPageUptodate(struct page *page)
241#define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) 230#define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags)
242#define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) 231#define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags)
243 232
233/*
234 * PG_reclaim is used in combination with PG_compound to mark the
235 * head and tail of a compound page
236 *
237 * PG_compound & PG_reclaim => Tail page
238 * PG_compound & ~PG_reclaim => Head page
239 */
240
241#define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim))
242
243#define PageTail(page) ((page->flags & PG_head_tail_mask) \
244 == PG_head_tail_mask)
245
246static inline void __SetPageTail(struct page *page)
247{
248 page->flags |= PG_head_tail_mask;
249}
250
251static inline void __ClearPageTail(struct page *page)
252{
253 page->flags &= ~PG_head_tail_mask;
254}
255
256#define PageHead(page) ((page->flags & PG_head_tail_mask) \
257 == (1L << PG_compound))
258#define __SetPageHead(page) __SetPageCompound(page)
259#define __ClearPageHead(page) __ClearPageCompound(page)
260
244#ifdef CONFIG_SWAP 261#ifdef CONFIG_SWAP
245#define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) 262#define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags)
246#define SetPageSwapCache(page) set_bit(PG_swapcache, &(page)->flags) 263#define SetPageSwapCache(page) set_bit(PG_swapcache, &(page)->flags)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 7a8dcb82a699..8a83537d6978 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -11,6 +11,7 @@
11#include <linux/compiler.h> 11#include <linux/compiler.h>
12#include <asm/uaccess.h> 12#include <asm/uaccess.h>
13#include <linux/gfp.h> 13#include <linux/gfp.h>
14#include <linux/bitops.h>
14 15
15/* 16/*
16 * Bits in mapping->flags. The lower __GFP_BITS_SHIFT bits are the page 17 * Bits in mapping->flags. The lower __GFP_BITS_SHIFT bits are the page
@@ -19,6 +20,16 @@
19#define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ 20#define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */
20#define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ 21#define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */
21 22
23static inline void mapping_set_error(struct address_space *mapping, int error)
24{
25 if (error) {
26 if (error == -ENOSPC)
27 set_bit(AS_ENOSPC, &mapping->flags);
28 else
29 set_bit(AS_EIO, &mapping->flags);
30 }
31}
32
22static inline gfp_t mapping_gfp_mask(struct address_space * mapping) 33static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
23{ 34{
24 return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; 35 return (__force gfp_t)mapping->flags & __GFP_BITS_MASK;
@@ -95,12 +106,23 @@ static inline struct page *grab_cache_page(struct address_space *mapping, unsign
95 106
96extern struct page * grab_cache_page_nowait(struct address_space *mapping, 107extern struct page * grab_cache_page_nowait(struct address_space *mapping,
97 unsigned long index); 108 unsigned long index);
109extern struct page * read_cache_page_async(struct address_space *mapping,
110 unsigned long index, filler_t *filler,
111 void *data);
98extern struct page * read_cache_page(struct address_space *mapping, 112extern struct page * read_cache_page(struct address_space *mapping,
99 unsigned long index, filler_t *filler, 113 unsigned long index, filler_t *filler,
100 void *data); 114 void *data);
101extern int read_cache_pages(struct address_space *mapping, 115extern int read_cache_pages(struct address_space *mapping,
102 struct list_head *pages, filler_t *filler, void *data); 116 struct list_head *pages, filler_t *filler, void *data);
103 117
118static inline struct page *read_mapping_page_async(
119 struct address_space *mapping,
120 unsigned long index, void *data)
121{
122 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
123 return read_cache_page_async(mapping, index, filler, data);
124}
125
104static inline struct page *read_mapping_page(struct address_space *mapping, 126static inline struct page *read_mapping_page(struct address_space *mapping,
105 unsigned long index, void *data) 127 unsigned long index, void *data)
106{ 128{
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 80682aaa8f18..9cdd6943e01b 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -279,6 +279,10 @@ struct parport {
279 int dma; 279 int dma;
280 int muxport; /* which muxport (if any) this is */ 280 int muxport; /* which muxport (if any) this is */
281 int portnum; /* which physical parallel port (not mux) */ 281 int portnum; /* which physical parallel port (not mux) */
282 struct device *dev; /* Physical device associated with IO/DMA.
283 * This may unfortulately be null if the
284 * port has a legacy driver.
285 */
282 286
283 struct parport *physport; 287 struct parport *physport;
284 /* If this is a non-default mux 288 /* If this is a non-default mux
@@ -289,7 +293,7 @@ struct parport {
289 following structure members are 293 following structure members are
290 meaningless: devices, cad, muxsel, 294 meaningless: devices, cad, muxsel,
291 waithead, waittail, flags, pdir, 295 waithead, waittail, flags, pdir,
292 ieee1284, *_lock. 296 dev, ieee1284, *_lock.
293 297
294 It this is a default mux parport, or 298 It this is a default mux parport, or
295 there is no mux involved, this points to 299 there is no mux involved, this points to
@@ -302,7 +306,7 @@ struct parport {
302 306
303 struct pardevice *waithead; 307 struct pardevice *waithead;
304 struct pardevice *waittail; 308 struct pardevice *waittail;
305 309
306 struct list_head list; 310 struct list_head list;
307 unsigned int flags; 311 unsigned int flags;
308 312
diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h
index 1cc0f6b1a49a..ea8c6d84996d 100644
--- a/include/linux/parport_pc.h
+++ b/include/linux/parport_pc.h
@@ -38,7 +38,6 @@ struct parport_pc_private {
38 /* buffer suitable for DMA, if DMA enabled */ 38 /* buffer suitable for DMA, if DMA enabled */
39 char *dma_buf; 39 char *dma_buf;
40 dma_addr_t dma_handle; 40 dma_addr_t dma_handle;
41 struct pci_dev *dev;
42 struct list_head list; 41 struct list_head list;
43 struct parport *port; 42 struct parport *port;
44}; 43};
@@ -232,7 +231,7 @@ extern int parport_pc_claim_resources(struct parport *p);
232extern struct parport *parport_pc_probe_port (unsigned long base, 231extern struct parport *parport_pc_probe_port (unsigned long base,
233 unsigned long base_hi, 232 unsigned long base_hi,
234 int irq, int dma, 233 int irq, int dma,
235 struct pci_dev *dev); 234 struct device *dev);
236extern void parport_pc_unregister_port (struct parport *p); 235extern void parport_pc_unregister_port (struct parport *p);
237 236
238#endif 237#endif
diff --git a/include/linux/phantom.h b/include/linux/phantom.h
new file mode 100644
index 000000000000..d3ebbfae6903
--- /dev/null
+++ b/include/linux/phantom.h
@@ -0,0 +1,42 @@
1/*
2 * Copyright (C) 2005-2007 Jiri Slaby <jirislaby@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#ifndef __PHANTOM_H
11#define __PHANTOM_H
12
13#include <asm/types.h>
14
15/* PHN_(G/S)ET_REG param */
16struct phm_reg {
17 __u32 reg;
18 __u32 value;
19};
20
21/* PHN_(G/S)ET_REGS param */
22struct phm_regs {
23 __u32 count;
24 __u32 mask;
25 __u32 values[8];
26};
27
28#define PH_IOC_MAGIC 'p'
29#define PHN_GET_REG _IOWR(PH_IOC_MAGIC, 0, struct phm_reg *)
30#define PHN_SET_REG _IOW (PH_IOC_MAGIC, 1, struct phm_reg *)
31#define PHN_GET_REGS _IOWR(PH_IOC_MAGIC, 2, struct phm_regs *)
32#define PHN_SET_REGS _IOW (PH_IOC_MAGIC, 3, struct phm_regs *)
33#define PH_IOC_MAXNR 3
34
35#define PHN_CONTROL 0x6 /* control byte in iaddr space */
36#define PHN_CTL_AMP 0x1 /* switch after torques change */
37#define PHN_CTL_BUT 0x2 /* is button switched */
38#define PHN_CTL_IRQ 0x10 /* is irq enabled */
39
40#define PHN_ZERO_FORCE 2048 /* zero torque on motor */
41
42#endif
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 2833806d42c6..169c6c24209b 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -29,7 +29,7 @@ static inline void get_pid_ns(struct pid_namespace *ns)
29 kref_get(&ns->kref); 29 kref_get(&ns->kref);
30} 30}
31 31
32extern int copy_pid_ns(int flags, struct task_struct *tsk); 32extern struct pid_namespace *copy_pid_ns(int flags, struct pid_namespace *ns);
33extern void free_pid_ns(struct kref *kref); 33extern void free_pid_ns(struct kref *kref);
34 34
35static inline void put_pid_ns(struct pid_namespace *ns) 35static inline void put_pid_ns(struct pid_namespace *ns)
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index b0952e532ed5..37ca57392add 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -225,4 +225,12 @@ extern unsigned int pmu_power_flags;
225/* Backlight */ 225/* Backlight */
226extern void pmu_backlight_init(void); 226extern void pmu_backlight_init(void);
227 227
228/* some code needs to know if the PMU was suspended for hibernation */
229#ifdef CONFIG_PM
230extern int pmu_sys_suspended;
231#else
232/* if power management is not configured it can't be suspended */
233#define pmu_sys_suspended 0
234#endif
235
228#endif /* __KERNEL__ */ 236#endif /* __KERNEL__ */
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 9a5226f0f169..2a1897e6f937 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -177,6 +177,7 @@ static inline void pnp_set_card_drvdata (struct pnp_card_link *pcard, void *data
177 177
178struct pnp_dev { 178struct pnp_dev {
179 struct device dev; /* Driver Model device interface */ 179 struct device dev; /* Driver Model device interface */
180 u64 dma_mask;
180 unsigned char number; /* used as an index, must be unique */ 181 unsigned char number; /* used as an index, must be unique */
181 int status; 182 int status;
182 183
@@ -363,6 +364,7 @@ int pnp_add_device(struct pnp_dev *dev);
363int pnp_device_attach(struct pnp_dev *pnp_dev); 364int pnp_device_attach(struct pnp_dev *pnp_dev);
364void pnp_device_detach(struct pnp_dev *pnp_dev); 365void pnp_device_detach(struct pnp_dev *pnp_dev);
365extern struct list_head pnp_global; 366extern struct list_head pnp_global;
367extern int pnp_platform_devices;
366 368
367/* multidevice card support */ 369/* multidevice card support */
368int pnp_add_card(struct pnp_card *card); 370int pnp_add_card(struct pnp_card *card);
@@ -410,6 +412,7 @@ static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
410static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } 412static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
411static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } 413static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
412static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } 414static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; }
415#define pnp_platform_devices 0
413 416
414/* multidevice card support */ 417/* multidevice card support */
415static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; } 418static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; }
diff --git a/include/linux/poison.h b/include/linux/poison.h
index 89580b764959..d93c300a3449 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -15,8 +15,11 @@
15 * Magic nums for obj red zoning. 15 * Magic nums for obj red zoning.
16 * Placed in the first word before and the first word after an obj. 16 * Placed in the first word before and the first word after an obj.
17 */ 17 */
18#define RED_INACTIVE 0x5A2CF071UL /* when obj is inactive */ 18#define RED_INACTIVE 0x09F911029D74E35BULL /* when obj is inactive */
19#define RED_ACTIVE 0x170FC2A5UL /* when obj is active */ 19#define RED_ACTIVE 0xD84156C5635688C0ULL /* when obj is active */
20
21#define SLUB_RED_INACTIVE 0xbb
22#define SLUB_RED_ACTIVE 0xcc
20 23
21/* ...and for poisoning */ 24/* ...and for poisoning */
22#define POISON_INUSE 0x5a /* for use-uninitialised poisoning */ 25#define POISON_INUSE 0x5a /* for use-uninitialised poisoning */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index be4652a0545a..3469f96bc8b2 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -104,6 +104,10 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir);
104unsigned long task_vsize(struct mm_struct *); 104unsigned long task_vsize(struct mm_struct *);
105int task_statm(struct mm_struct *, int *, int *, int *, int *); 105int task_statm(struct mm_struct *, int *, int *, int *, int *);
106char *task_mem(struct mm_struct *, char *); 106char *task_mem(struct mm_struct *, char *);
107void clear_refs_smap(struct mm_struct *mm);
108
109struct proc_dir_entry *de_get(struct proc_dir_entry *de);
110void de_put(struct proc_dir_entry *de);
107 111
108extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, 112extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
109 struct proc_dir_entry *parent); 113 struct proc_dir_entry *parent);
diff --git a/include/linux/quicklist.h b/include/linux/quicklist.h
new file mode 100644
index 000000000000..9371c6116df3
--- /dev/null
+++ b/include/linux/quicklist.h
@@ -0,0 +1,94 @@
1#ifndef LINUX_QUICKLIST_H
2#define LINUX_QUICKLIST_H
3/*
4 * Fast allocations and disposal of pages. Pages must be in the condition
5 * as needed after allocation when they are freed. Per cpu lists of pages
6 * are kept that only contain node local pages.
7 *
8 * (C) 2007, SGI. Christoph Lameter <clameter@sgi.com>
9 */
10#include <linux/kernel.h>
11#include <linux/gfp.h>
12#include <linux/percpu.h>
13
14#ifdef CONFIG_QUICKLIST
15
16struct quicklist {
17 void *page;
18 int nr_pages;
19};
20
21DECLARE_PER_CPU(struct quicklist, quicklist)[CONFIG_NR_QUICK];
22
23/*
24 * The two key functions quicklist_alloc and quicklist_free are inline so
25 * that they may be custom compiled for the platform.
26 * Specifying a NULL ctor can remove constructor support. Specifying
27 * a constant quicklist allows the determination of the exact address
28 * in the per cpu area.
29 *
30 * The fast patch in quicklist_alloc touched only a per cpu cacheline and
31 * the first cacheline of the page itself. There is minmal overhead involved.
32 */
33static inline void *quicklist_alloc(int nr, gfp_t flags, void (*ctor)(void *))
34{
35 struct quicklist *q;
36 void **p = NULL;
37
38 q =&get_cpu_var(quicklist)[nr];
39 p = q->page;
40 if (likely(p)) {
41 q->page = p[0];
42 p[0] = NULL;
43 q->nr_pages--;
44 }
45 put_cpu_var(quicklist);
46 if (likely(p))
47 return p;
48
49 p = (void *)__get_free_page(flags | __GFP_ZERO);
50 if (ctor && p)
51 ctor(p);
52 return p;
53}
54
55static inline void __quicklist_free(int nr, void (*dtor)(void *), void *p,
56 struct page *page)
57{
58 struct quicklist *q;
59 int nid = page_to_nid(page);
60
61 if (unlikely(nid != numa_node_id())) {
62 if (dtor)
63 dtor(p);
64 __free_page(page);
65 return;
66 }
67
68 q = &get_cpu_var(quicklist)[nr];
69 *(void **)p = q->page;
70 q->page = p;
71 q->nr_pages++;
72 put_cpu_var(quicklist);
73}
74
75static inline void quicklist_free(int nr, void (*dtor)(void *), void *pp)
76{
77 __quicklist_free(nr, dtor, pp, virt_to_page(pp));
78}
79
80static inline void quicklist_free_page(int nr, void (*dtor)(void *),
81 struct page *page)
82{
83 __quicklist_free(nr, dtor, page_address(page), page);
84}
85
86void quicklist_trim(int nr, void (*dtor)(void *),
87 unsigned long min_pages, unsigned long max_free);
88
89unsigned long quicklist_total_size(void);
90
91#endif
92
93#endif /* LINUX_QUICKLIST_H */
94
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 77db80a953d6..62439828395e 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -44,8 +44,6 @@
44typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ 44typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
45typedef __u64 qsize_t; /* Type in which we store sizes */ 45typedef __u64 qsize_t; /* Type in which we store sizes */
46 46
47extern spinlock_t dq_data_lock;
48
49/* Size of blocks in which are counted size limits */ 47/* Size of blocks in which are counted size limits */
50#define QUOTABLOCK_BITS 10 48#define QUOTABLOCK_BITS 10
51#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) 49#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
@@ -139,6 +137,8 @@ struct if_dqinfo {
139#include <linux/dqblk_v1.h> 137#include <linux/dqblk_v1.h>
140#include <linux/dqblk_v2.h> 138#include <linux/dqblk_v2.h>
141 139
140extern spinlock_t dq_data_lock;
141
142/* Maximal numbers of writes for quota operation (insert/delete/update) 142/* Maximal numbers of writes for quota operation (insert/delete/update)
143 * (over VFS all formats) */ 143 * (over VFS all formats) */
144#define DQUOT_INIT_ALLOC max(V1_INIT_ALLOC, V2_INIT_ALLOC) 144#define DQUOT_INIT_ALLOC max(V1_INIT_ALLOC, V2_INIT_ALLOC)
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 90c23f690c0d..5110201a4159 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -37,9 +37,6 @@ extern int dquot_release(struct dquot *dquot);
37extern int dquot_commit_info(struct super_block *sb, int type); 37extern int dquot_commit_info(struct super_block *sb, int type);
38extern int dquot_mark_dquot_dirty(struct dquot *dquot); 38extern int dquot_mark_dquot_dirty(struct dquot *dquot);
39 39
40int remove_inode_dquot_ref(struct inode *inode, int type,
41 struct list_head *tofree_head);
42
43extern int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path); 40extern int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path);
44extern int vfs_quota_on_mount(struct super_block *sb, char *qf_name, 41extern int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
45 int format_id, int type); 42 int format_id, int type);
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 3a28742d86f9..1e5488ede037 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -401,9 +401,10 @@ struct reiserfs_sb_info {
401 int reserved_blocks; /* amount of blocks reserved for further allocations */ 401 int reserved_blocks; /* amount of blocks reserved for further allocations */
402 spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */ 402 spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */
403 struct dentry *priv_root; /* root of /.reiserfs_priv */ 403 struct dentry *priv_root; /* root of /.reiserfs_priv */
404#ifdef CONFIG_REISERFS_FS_XATTR
404 struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */ 405 struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */
405 struct rw_semaphore xattr_dir_sem; 406 struct rw_semaphore xattr_dir_sem;
406 407#endif
407 int j_errno; 408 int j_errno;
408#ifdef CONFIG_QUOTA 409#ifdef CONFIG_QUOTA
409 char *s_qf_names[MAXQUOTAS]; 410 char *s_qf_names[MAXQUOTAS];
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
new file mode 100644
index 000000000000..7c1ffbab7865
--- /dev/null
+++ b/include/linux/rfkill.h
@@ -0,0 +1,89 @@
1#ifndef __RFKILL_H
2#define __RFKILL_H
3
4/*
5 * Copyright (C) 2006 Ivo van Doorn
6 * Copyright (C) 2007 Dmitry Torokhov
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#include <linux/types.h>
25#include <linux/kernel.h>
26#include <linux/list.h>
27#include <linux/mutex.h>
28#include <linux/device.h>
29
30/**
31 * enum rfkill_type - type of rfkill switch.
32 * RFKILL_TYPE_WLAN: switch is no a Wireless network devices.
33 * RFKILL_TYPE_BlUETOOTH: switch is on a bluetooth device.
34 * RFKILL_TYPE_IRDA: switch is on an infrared devices.
35 */
36enum rfkill_type {
37 RFKILL_TYPE_WLAN = 0,
38 RFKILL_TYPE_BLUETOOTH = 1,
39 RFKILL_TYPE_IRDA = 2,
40 RFKILL_TYPE_MAX = 3,
41};
42
43enum rfkill_state {
44 RFKILL_STATE_OFF = 0,
45 RFKILL_STATE_ON = 1,
46};
47
48/**
49 * struct rfkill - rfkill control structure.
50 * @name: Name of the switch.
51 * @type: Radio type which the button controls, the value stored
52 * here should be a value from enum rfkill_type.
53 * @state: State of the switch (on/off).
54 * @user_claim: Set when the switch is controlled exlusively by userspace.
55 * @mutex: Guards switch state transitions
56 * @data: Pointer to the RF button drivers private data which will be
57 * passed along when toggling radio state.
58 * @toggle_radio(): Mandatory handler to control state of the radio.
59 * @dev: Device structure integrating the switch into device tree.
60 * @node: Used to place switch into list of all switches known to the
61 * the system.
62 *
63 * This structure represents a RF switch located on a network device.
64 */
65struct rfkill {
66 char *name;
67 enum rfkill_type type;
68
69 enum rfkill_state state;
70 bool user_claim;
71
72 struct mutex mutex;
73
74 void *data;
75 int (*toggle_radio)(void *data, enum rfkill_state state);
76
77 struct device dev;
78 struct list_head node;
79};
80#define to_rfkill(d) container_of(d, struct rfkill, dev)
81
82struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type);
83void rfkill_free(struct rfkill *rfkill);
84int rfkill_register(struct rfkill *rfkill);
85void rfkill_unregister(struct rfkill *rfkill);
86
87void rfkill_switch_all(enum rfkill_type type, enum rfkill_state state);
88
89#endif /* RFKILL_H */
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 5e22d4510d11..6d5e4a46781e 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -4,7 +4,7 @@
4 * service. It is used with both the legacy mc146818 and also EFI 4 * service. It is used with both the legacy mc146818 and also EFI
5 * Struct rtc_time and first 12 ioctl by Paul Gortmaker, 1996 - separated out 5 * Struct rtc_time and first 12 ioctl by Paul Gortmaker, 1996 - separated out
6 * from <linux/mc146818rtc.h> to this file for 2.4 kernels. 6 * from <linux/mc146818rtc.h> to this file for 2.4 kernels.
7 * 7 *
8 * Copyright (C) 1999 Hewlett-Packard Co. 8 * Copyright (C) 1999 Hewlett-Packard Co.
9 * Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com> 9 * Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com>
10 */ 10 */
@@ -13,7 +13,7 @@
13 13
14/* 14/*
15 * The struct used to pass data via the following ioctl. Similar to the 15 * The struct used to pass data via the following ioctl. Similar to the
16 * struct tm in <time.h>, but it needs to be here so that the kernel 16 * struct tm in <time.h>, but it needs to be here so that the kernel
17 * source is self contained, allowing cross-compiles, etc. etc. 17 * source is self contained, allowing cross-compiles, etc. etc.
18 */ 18 */
19 19
@@ -50,7 +50,7 @@ struct rtc_wkalrm {
50 * pll_value*pll_posmult/pll_clock 50 * pll_value*pll_posmult/pll_clock
51 * -ve pll_value means clock will run slower by 51 * -ve pll_value means clock will run slower by
52 * pll_value*pll_negmult/pll_clock 52 * pll_value*pll_negmult/pll_clock
53 */ 53 */
54 54
55struct rtc_pll_info { 55struct rtc_pll_info {
56 int pll_ctrl; /* placeholder for fancier control */ 56 int pll_ctrl; /* placeholder for fancier control */
@@ -106,7 +106,6 @@ extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year
106extern int rtc_valid_tm(struct rtc_time *tm); 106extern int rtc_valid_tm(struct rtc_time *tm);
107extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); 107extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time);
108extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); 108extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm);
109extern void rtc_merge_alarm(struct rtc_time *now, struct rtc_time *alarm);
110 109
111#include <linux/device.h> 110#include <linux/device.h>
112#include <linux/seq_file.h> 111#include <linux/seq_file.h>
@@ -136,7 +135,7 @@ struct rtc_task;
136 135
137struct rtc_device 136struct rtc_device
138{ 137{
139 struct class_device class_dev; 138 struct device dev;
140 struct module *owner; 139 struct module *owner;
141 140
142 int id; 141 int id;
@@ -145,7 +144,6 @@ struct rtc_device
145 const struct rtc_class_ops *ops; 144 const struct rtc_class_ops *ops;
146 struct mutex ops_lock; 145 struct mutex ops_lock;
147 146
148 struct class_device *rtc_dev;
149 struct cdev char_dev; 147 struct cdev char_dev;
150 struct mutex char_lock; 148 struct mutex char_lock;
151 149
@@ -169,35 +167,34 @@ struct rtc_device
169 unsigned int uie_timer_active:1; 167 unsigned int uie_timer_active:1;
170#endif 168#endif
171}; 169};
172#define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) 170#define to_rtc_device(d) container_of(d, struct rtc_device, dev)
173 171
174extern struct rtc_device *rtc_device_register(const char *name, 172extern struct rtc_device *rtc_device_register(const char *name,
175 struct device *dev, 173 struct device *dev,
176 const struct rtc_class_ops *ops, 174 const struct rtc_class_ops *ops,
177 struct module *owner); 175 struct module *owner);
178extern void rtc_device_unregister(struct rtc_device *rdev); 176extern void rtc_device_unregister(struct rtc_device *rtc);
179extern int rtc_interface_register(struct class_interface *intf);
180 177
181extern int rtc_read_time(struct class_device *class_dev, struct rtc_time *tm); 178extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm);
182extern int rtc_set_time(struct class_device *class_dev, struct rtc_time *tm); 179extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm);
183extern int rtc_set_mmss(struct class_device *class_dev, unsigned long secs); 180extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs);
184extern int rtc_read_alarm(struct class_device *class_dev, 181extern int rtc_read_alarm(struct rtc_device *rtc,
185 struct rtc_wkalrm *alrm); 182 struct rtc_wkalrm *alrm);
186extern int rtc_set_alarm(struct class_device *class_dev, 183extern int rtc_set_alarm(struct rtc_device *rtc,
187 struct rtc_wkalrm *alrm); 184 struct rtc_wkalrm *alrm);
188extern void rtc_update_irq(struct class_device *class_dev, 185extern void rtc_update_irq(struct rtc_device *rtc,
189 unsigned long num, unsigned long events); 186 unsigned long num, unsigned long events);
190 187
191extern struct class_device *rtc_class_open(char *name); 188extern struct rtc_device *rtc_class_open(char *name);
192extern void rtc_class_close(struct class_device *class_dev); 189extern void rtc_class_close(struct rtc_device *rtc);
193 190
194extern int rtc_irq_register(struct class_device *class_dev, 191extern int rtc_irq_register(struct rtc_device *rtc,
195 struct rtc_task *task); 192 struct rtc_task *task);
196extern void rtc_irq_unregister(struct class_device *class_dev, 193extern void rtc_irq_unregister(struct rtc_device *rtc,
197 struct rtc_task *task); 194 struct rtc_task *task);
198extern int rtc_irq_set_state(struct class_device *class_dev, 195extern int rtc_irq_set_state(struct rtc_device *rtc,
199 struct rtc_task *task, int enabled); 196 struct rtc_task *task, int enabled);
200extern int rtc_irq_set_freq(struct class_device *class_dev, 197extern int rtc_irq_set_freq(struct rtc_device *rtc,
201 struct rtc_task *task, int freq); 198 struct rtc_task *task, int freq);
202 199
203typedef struct rtc_task { 200typedef struct rtc_task {
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a1707583de49..3d95c480f58d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -194,6 +194,14 @@ extern void sched_init_smp(void);
194extern void init_idle(struct task_struct *idle, int cpu); 194extern void init_idle(struct task_struct *idle, int cpu);
195 195
196extern cpumask_t nohz_cpu_mask; 196extern cpumask_t nohz_cpu_mask;
197#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
198extern int select_nohz_load_balancer(int cpu);
199#else
200static inline int select_nohz_load_balancer(int cpu)
201{
202 return 0;
203}
204#endif
197 205
198/* 206/*
199 * Only dump TASK_* tasks. (0 for all tasks) 207 * Only dump TASK_* tasks. (0 for all tasks)
@@ -226,6 +234,7 @@ extern void scheduler_tick(void);
226extern void softlockup_tick(void); 234extern void softlockup_tick(void);
227extern void spawn_softlockup_task(void); 235extern void spawn_softlockup_task(void);
228extern void touch_softlockup_watchdog(void); 236extern void touch_softlockup_watchdog(void);
237extern void touch_all_softlockup_watchdogs(void);
229#else 238#else
230static inline void softlockup_tick(void) 239static inline void softlockup_tick(void)
231{ 240{
@@ -236,6 +245,9 @@ static inline void spawn_softlockup_task(void)
236static inline void touch_softlockup_watchdog(void) 245static inline void touch_softlockup_watchdog(void)
237{ 246{
238} 247}
248static inline void touch_all_softlockup_watchdogs(void)
249{
250}
239#endif 251#endif
240 252
241 253
@@ -668,8 +680,14 @@ struct sched_group {
668 /* 680 /*
669 * CPU power of this group, SCHED_LOAD_SCALE being max power for a 681 * CPU power of this group, SCHED_LOAD_SCALE being max power for a
670 * single CPU. This is read only (except for setup, hotplug CPU). 682 * single CPU. This is read only (except for setup, hotplug CPU).
683 * Note : Never change cpu_power without recompute its reciprocal
684 */
685 unsigned int __cpu_power;
686 /*
687 * reciprocal value of cpu_power to avoid expensive divides
688 * (see include/linux/reciprocal_div.h)
671 */ 689 */
672 unsigned long cpu_power; 690 u32 reciprocal_cpu_power;
673}; 691};
674 692
675struct sched_domain { 693struct sched_domain {
@@ -801,8 +819,8 @@ struct task_struct {
801 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ 819 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
802 struct thread_info *thread_info; 820 struct thread_info *thread_info;
803 atomic_t usage; 821 atomic_t usage;
804 unsigned long flags; /* per process flags, defined below */ 822 unsigned int flags; /* per process flags, defined below */
805 unsigned long ptrace; 823 unsigned int ptrace;
806 824
807 int lock_depth; /* BKL lock depth */ 825 int lock_depth; /* BKL lock depth */
808 826
@@ -825,7 +843,7 @@ struct task_struct {
825 unsigned long long sched_time; /* sched_clock time spent running */ 843 unsigned long long sched_time; /* sched_clock time spent running */
826 enum sleep_type sleep_type; 844 enum sleep_type sleep_type;
827 845
828 unsigned long policy; 846 unsigned int policy;
829 cpumask_t cpus_allowed; 847 cpumask_t cpus_allowed;
830 unsigned int time_slice, first_time_slice; 848 unsigned int time_slice, first_time_slice;
831 849
@@ -845,11 +863,11 @@ struct task_struct {
845 863
846/* task state */ 864/* task state */
847 struct linux_binfmt *binfmt; 865 struct linux_binfmt *binfmt;
848 long exit_state; 866 int exit_state;
849 int exit_code, exit_signal; 867 int exit_code, exit_signal;
850 int pdeath_signal; /* The signal sent when the parent dies */ 868 int pdeath_signal; /* The signal sent when the parent dies */
851 /* ??? */ 869 /* ??? */
852 unsigned long personality; 870 unsigned int personality;
853 unsigned did_exec:1; 871 unsigned did_exec:1;
854 pid_t pid; 872 pid_t pid;
855 pid_t tgid; 873 pid_t tgid;
@@ -881,7 +899,7 @@ struct task_struct {
881 int __user *set_child_tid; /* CLONE_CHILD_SETTID */ 899 int __user *set_child_tid; /* CLONE_CHILD_SETTID */
882 int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ 900 int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */
883 901
884 unsigned long rt_priority; 902 unsigned int rt_priority;
885 cputime_t utime, stime; 903 cputime_t utime, stime;
886 unsigned long nvcsw, nivcsw; /* context switch counts */ 904 unsigned long nvcsw, nivcsw; /* context switch counts */
887 struct timespec start_time; 905 struct timespec start_time;
@@ -1641,10 +1659,7 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm)
1641extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); 1659extern long sched_setaffinity(pid_t pid, cpumask_t new_mask);
1642extern long sched_getaffinity(pid_t pid, cpumask_t *mask); 1660extern long sched_getaffinity(pid_t pid, cpumask_t *mask);
1643 1661
1644#include <linux/sysdev.h>
1645extern int sched_mc_power_savings, sched_smt_power_savings; 1662extern int sched_mc_power_savings, sched_smt_power_savings;
1646extern struct sysdev_attribute attr_sched_mc_power_savings, attr_sched_smt_power_savings;
1647extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
1648 1663
1649extern void normalize_rt_tasks(void); 1664extern void normalize_rt_tasks(void);
1650 1665
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 586aaba91720..aa2653a159f4 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -39,7 +39,8 @@
39#define PORT_RSA 13 39#define PORT_RSA 13
40#define PORT_NS16550A 14 40#define PORT_NS16550A 14
41#define PORT_XSCALE 15 41#define PORT_XSCALE 15
42#define PORT_MAX_8250 15 /* max port ID */ 42#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */
43#define PORT_MAX_8250 16 /* max port ID */
43 44
44/* 45/*
45 * ARM specific type numbers. These are not currently guaranteed 46 * ARM specific type numbers. These are not currently guaranteed
@@ -135,6 +136,9 @@
135/* Xilinx uartlite */ 136/* Xilinx uartlite */
136#define PORT_UARTLITE 74 137#define PORT_UARTLITE 74
137 138
139/* Blackfin bf5xx */
140#define PORT_BFIN 75
141
138#ifdef __KERNEL__ 142#ifdef __KERNEL__
139 143
140#include <linux/compiler.h> 144#include <linux/compiler.h>
@@ -230,6 +234,8 @@ struct uart_port {
230#define UPIO_MEM32 (3) 234#define UPIO_MEM32 (3)
231#define UPIO_AU (4) /* Au1x00 type IO */ 235#define UPIO_AU (4) /* Au1x00 type IO */
232#define UPIO_TSI (5) /* Tsi108/109 type IO */ 236#define UPIO_TSI (5) /* Tsi108/109 type IO */
237#define UPIO_DWAPB (6) /* DesignWare APB UART */
238#define UPIO_RM9000 (7) /* RM9000 type IO */
233 239
234 unsigned int read_status_mask; /* driver specific */ 240 unsigned int read_status_mask; /* driver specific */
235 unsigned int ignore_status_mask; /* driver specific */ 241 unsigned int ignore_status_mask; /* driver specific */
@@ -260,6 +266,7 @@ struct uart_port {
260#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 266#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
261#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 267#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
262#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 268#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
269#define UPF_FIXED_PORT ((__force upf_t) (1 << 29))
263#define UPF_DEAD ((__force upf_t) (1 << 30)) 270#define UPF_DEAD ((__force upf_t) (1 << 30))
264#define UPF_IOREMAP ((__force upf_t) (1 << 31)) 271#define UPF_IOREMAP ((__force upf_t) (1 << 31))
265 272
@@ -276,6 +283,7 @@ struct uart_port {
276 struct device *dev; /* parent device */ 283 struct device *dev; /* parent device */
277 unsigned char hub6; /* this should be in the 8250 driver */ 284 unsigned char hub6; /* this should be in the 8250 driver */
278 unsigned char unused[3]; 285 unsigned char unused[3];
286 void *private_data; /* generic platform data pointer */
279}; 287};
280 288
281/* 289/*
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index 3c8a6aa77415..1c5ed7d92b0f 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -38,6 +38,8 @@
38#define UART_IIR_RDI 0x04 /* Receiver data interrupt */ 38#define UART_IIR_RDI 0x04 /* Receiver data interrupt */
39#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */ 39#define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */
40 40
41#define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */
42
41#define UART_FCR 2 /* Out: FIFO Control Register */ 43#define UART_FCR 2 /* Out: FIFO Control Register */
42#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */ 44#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
43#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ 45#define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1ef822e31c77..71829efc40ba 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -21,28 +21,25 @@ typedef struct kmem_cache kmem_cache_t __deprecated;
21 * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set. 21 * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set.
22 */ 22 */
23#define SLAB_DEBUG_FREE 0x00000100UL /* DEBUG: Perform (expensive) checks on free */ 23#define SLAB_DEBUG_FREE 0x00000100UL /* DEBUG: Perform (expensive) checks on free */
24#define SLAB_DEBUG_INITIAL 0x00000200UL /* DEBUG: Call constructor (as verifier) */
25#define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */ 24#define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */
26#define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */ 25#define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */
27#define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */ 26#define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */
28#define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */ 27#define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */
29#define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* Force alignment even if debuggin is active */
30#define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */ 28#define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */
31#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ 29#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
32#define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */ 30#define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */
33#define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ 31#define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */
34#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ 32#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */
33#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */
35 34
36/* Flags passed to a constructor functions */ 35/* Flags passed to a constructor functions */
37#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */ 36#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */
38#define SLAB_CTOR_ATOMIC 0x002UL /* Tell constructor it can't sleep */
39#define SLAB_CTOR_VERIFY 0x004UL /* Tell constructor it's a verify call */
40 37
41/* 38/*
42 * struct kmem_cache related prototypes 39 * struct kmem_cache related prototypes
43 */ 40 */
44void __init kmem_cache_init(void); 41void __init kmem_cache_init(void);
45extern int slab_is_available(void); 42int slab_is_available(void);
46 43
47struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, 44struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
48 unsigned long, 45 unsigned long,
@@ -57,6 +54,18 @@ unsigned int kmem_cache_size(struct kmem_cache *);
57const char *kmem_cache_name(struct kmem_cache *); 54const char *kmem_cache_name(struct kmem_cache *);
58int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); 55int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
59 56
57/*
58 * Please use this macro to create slab caches. Simply specify the
59 * name of the structure and maybe some flags that are listed above.
60 *
61 * The alignment of the struct determines object alignment. If you
62 * f.e. add ____cacheline_aligned_in_smp to the struct declaration
63 * then the objects will be properly aligned in SMP configurations.
64 */
65#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\
66 sizeof(struct __struct), __alignof__(struct __struct),\
67 (__flags), NULL, NULL)
68
60#ifdef CONFIG_NUMA 69#ifdef CONFIG_NUMA
61extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 70extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
62#else 71#else
@@ -72,8 +81,9 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
72 */ 81 */
73void *__kmalloc(size_t, gfp_t); 82void *__kmalloc(size_t, gfp_t);
74void *__kzalloc(size_t, gfp_t); 83void *__kzalloc(size_t, gfp_t);
84void * __must_check krealloc(const void *, size_t, gfp_t);
75void kfree(const void *); 85void kfree(const void *);
76unsigned int ksize(const void *); 86size_t ksize(const void *);
77 87
78/** 88/**
79 * kcalloc - allocate memory for an array. The memory is set to zero. 89 * kcalloc - allocate memory for an array. The memory is set to zero.
@@ -94,9 +104,14 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
94 * the appropriate general cache at compile time. 104 * the appropriate general cache at compile time.
95 */ 105 */
96 106
97#ifdef CONFIG_SLAB 107#if defined(CONFIG_SLAB) || defined(CONFIG_SLUB)
108#ifdef CONFIG_SLUB
109#include <linux/slub_def.h>
110#else
98#include <linux/slab_def.h> 111#include <linux/slab_def.h>
112#endif /* !CONFIG_SLUB */
99#else 113#else
114
100/* 115/*
101 * Fallback definitions for an allocator not wanting to provide 116 * Fallback definitions for an allocator not wanting to provide
102 * its own optimized kmalloc definitions (like SLOB). 117 * its own optimized kmalloc definitions (like SLOB).
@@ -183,7 +198,7 @@ static inline void *__kmalloc_node(size_t size, gfp_t flags, int node)
183 * allocator where we care about the real place the memory allocation 198 * allocator where we care about the real place the memory allocation
184 * request comes from. 199 * request comes from.
185 */ 200 */
186#ifdef CONFIG_DEBUG_SLAB 201#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB)
187extern void *__kmalloc_track_caller(size_t, gfp_t, void*); 202extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
188#define kmalloc_track_caller(size, flags) \ 203#define kmalloc_track_caller(size, flags) \
189 __kmalloc_track_caller(size, flags, __builtin_return_address(0)) 204 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
@@ -201,7 +216,7 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
201 * standard allocator where we care about the real place the memory 216 * standard allocator where we care about the real place the memory
202 * allocation request comes from. 217 * allocation request comes from.
203 */ 218 */
204#ifdef CONFIG_DEBUG_SLAB 219#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB)
205extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); 220extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *);
206#define kmalloc_node_track_caller(size, flags, node) \ 221#define kmalloc_node_track_caller(size, flags, node) \
207 __kmalloc_node_track_caller(size, flags, node, \ 222 __kmalloc_node_track_caller(size, flags, node, \
@@ -218,6 +233,9 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *);
218 233
219#endif /* DEBUG_SLAB */ 234#endif /* DEBUG_SLAB */
220 235
236extern const struct seq_operations slabinfo_op;
237ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *);
238
221#endif /* __KERNEL__ */ 239#endif /* __KERNEL__ */
222#endif /* _LINUX_SLAB_H */ 240#endif /* _LINUX_SLAB_H */
223 241
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
new file mode 100644
index 000000000000..ea27065e80e6
--- /dev/null
+++ b/include/linux/slub_def.h
@@ -0,0 +1,206 @@
1#ifndef _LINUX_SLUB_DEF_H
2#define _LINUX_SLUB_DEF_H
3
4/*
5 * SLUB : A Slab allocator without object queues.
6 *
7 * (C) 2007 SGI, Christoph Lameter <clameter@sgi.com>
8 */
9#include <linux/types.h>
10#include <linux/gfp.h>
11#include <linux/workqueue.h>
12#include <linux/kobject.h>
13
14struct kmem_cache_node {
15 spinlock_t list_lock; /* Protect partial list and nr_partial */
16 unsigned long nr_partial;
17 atomic_long_t nr_slabs;
18 struct list_head partial;
19 struct list_head full;
20};
21
22/*
23 * Slab cache management.
24 */
25struct kmem_cache {
26 /* Used for retriving partial slabs etc */
27 unsigned long flags;
28 int size; /* The size of an object including meta data */
29 int objsize; /* The size of an object without meta data */
30 int offset; /* Free pointer offset. */
31 unsigned int order;
32
33 /*
34 * Avoid an extra cache line for UP, SMP and for the node local to
35 * struct kmem_cache.
36 */
37 struct kmem_cache_node local_node;
38
39 /* Allocation and freeing of slabs */
40 int objects; /* Number of objects in slab */
41 int refcount; /* Refcount for slab cache destroy */
42 void (*ctor)(void *, struct kmem_cache *, unsigned long);
43 void (*dtor)(void *, struct kmem_cache *, unsigned long);
44 int inuse; /* Offset to metadata */
45 int align; /* Alignment */
46 const char *name; /* Name (only for display!) */
47 struct list_head list; /* List of slab caches */
48 struct kobject kobj; /* For sysfs */
49
50#ifdef CONFIG_NUMA
51 int defrag_ratio;
52 struct kmem_cache_node *node[MAX_NUMNODES];
53#endif
54 struct page *cpu_slab[NR_CPUS];
55};
56
57/*
58 * Kmalloc subsystem.
59 */
60#define KMALLOC_SHIFT_LOW 3
61
62#ifdef CONFIG_LARGE_ALLOCS
63#define KMALLOC_SHIFT_HIGH 25
64#else
65#if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256
66#define KMALLOC_SHIFT_HIGH 20
67#else
68#define KMALLOC_SHIFT_HIGH 18
69#endif
70#endif
71
72/*
73 * We keep the general caches in an array of slab caches that are used for
74 * 2^x bytes of allocations.
75 */
76extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
77
78/*
79 * Sorry that the following has to be that ugly but some versions of GCC
80 * have trouble with constant propagation and loops.
81 */
82static inline int kmalloc_index(int size)
83{
84 /*
85 * We should return 0 if size == 0 but we use the smallest object
86 * here for SLAB legacy reasons.
87 */
88 WARN_ON_ONCE(size == 0);
89
90 if (size > 64 && size <= 96)
91 return 1;
92 if (size > 128 && size <= 192)
93 return 2;
94 if (size <= 8) return 3;
95 if (size <= 16) return 4;
96 if (size <= 32) return 5;
97 if (size <= 64) return 6;
98 if (size <= 128) return 7;
99 if (size <= 256) return 8;
100 if (size <= 512) return 9;
101 if (size <= 1024) return 10;
102 if (size <= 2 * 1024) return 11;
103 if (size <= 4 * 1024) return 12;
104 if (size <= 8 * 1024) return 13;
105 if (size <= 16 * 1024) return 14;
106 if (size <= 32 * 1024) return 15;
107 if (size <= 64 * 1024) return 16;
108 if (size <= 128 * 1024) return 17;
109 if (size <= 256 * 1024) return 18;
110#if KMALLOC_SHIFT_HIGH > 18
111 if (size <= 512 * 1024) return 19;
112 if (size <= 1024 * 1024) return 20;
113#endif
114#if KMALLOC_SHIFT_HIGH > 20
115 if (size <= 2 * 1024 * 1024) return 21;
116 if (size <= 4 * 1024 * 1024) return 22;
117 if (size <= 8 * 1024 * 1024) return 23;
118 if (size <= 16 * 1024 * 1024) return 24;
119 if (size <= 32 * 1024 * 1024) return 25;
120#endif
121 return -1;
122
123/*
124 * What we really wanted to do and cannot do because of compiler issues is:
125 * int i;
126 * for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++)
127 * if (size <= (1 << i))
128 * return i;
129 */
130}
131
132/*
133 * Find the slab cache for a given combination of allocation flags and size.
134 *
135 * This ought to end up with a global pointer to the right cache
136 * in kmalloc_caches.
137 */
138static inline struct kmem_cache *kmalloc_slab(size_t size)
139{
140 int index = kmalloc_index(size);
141
142 if (index == 0)
143 return NULL;
144
145 if (index < 0) {
146 /*
147 * Generate a link failure. Would be great if we could
148 * do something to stop the compile here.
149 */
150 extern void __kmalloc_size_too_large(void);
151 __kmalloc_size_too_large();
152 }
153 return &kmalloc_caches[index];
154}
155
156#ifdef CONFIG_ZONE_DMA
157#define SLUB_DMA __GFP_DMA
158#else
159/* Disable DMA functionality */
160#define SLUB_DMA 0
161#endif
162
163static inline void *kmalloc(size_t size, gfp_t flags)
164{
165 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
166 struct kmem_cache *s = kmalloc_slab(size);
167
168 if (!s)
169 return NULL;
170
171 return kmem_cache_alloc(s, flags);
172 } else
173 return __kmalloc(size, flags);
174}
175
176static inline void *kzalloc(size_t size, gfp_t flags)
177{
178 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
179 struct kmem_cache *s = kmalloc_slab(size);
180
181 if (!s)
182 return NULL;
183
184 return kmem_cache_zalloc(s, flags);
185 } else
186 return __kzalloc(size, flags);
187}
188
189#ifdef CONFIG_NUMA
190extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
191
192static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
193{
194 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
195 struct kmem_cache *s = kmalloc_slab(size);
196
197 if (!s)
198 return NULL;
199
200 return kmem_cache_alloc_node(s, flags, node);
201 } else
202 return __kmalloc_node(size, flags, node);
203}
204#endif
205
206#endif /* _LINUX_SLUB_DEF_H */
diff --git a/include/linux/spi/Kbuild b/include/linux/spi/Kbuild
new file mode 100644
index 000000000000..d375a082986e
--- /dev/null
+++ b/include/linux/spi/Kbuild
@@ -0,0 +1 @@
header-y += spidev.h
diff --git a/include/linux/spi/ad7877.h b/include/linux/spi/ad7877.h
new file mode 100644
index 000000000000..cdbed816f25e
--- /dev/null
+++ b/include/linux/spi/ad7877.h
@@ -0,0 +1,24 @@
1/* linux/spi/ad7877.h */
2
3/* Touchscreen characteristics vary between boards and models. The
4 * platform_data for the device's "struct device" holds this information.
5 *
6 * It's OK if the min/max values are zero.
7 */
8struct ad7877_platform_data {
9 u16 model; /* 7877 */
10 u16 vref_delay_usecs; /* 0 for external vref; etc */
11 u16 x_plate_ohms;
12 u16 y_plate_ohms;
13
14 u16 x_min, x_max;
15 u16 y_min, y_max;
16 u16 pressure_min, pressure_max;
17
18 u8 stopacq_polarity; /* 1 = Active HIGH, 0 = Active LOW */
19 u8 first_conversion_delay; /* 0 = 0.5us, 1 = 128us, 2 = 1ms, 3 = 8ms */
20 u8 acquisition_time; /* 0 = 2us, 1 = 4us, 2 = 8us, 3 = 16us */
21 u8 averaging; /* 0 = 1, 1 = 4, 2 = 8, 3 = 16 */
22 u8 pen_down_acc_interval; /* 0 = covert once, 1 = every 0.5 ms,
23 2 = ever 1 ms, 3 = every 8 ms,*/
24};
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 4f0f8c2e58a5..b6bedc3ee95c 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -32,11 +32,12 @@ extern struct bus_type spi_bus_type;
32 * @max_speed_hz: Maximum clock rate to be used with this chip 32 * @max_speed_hz: Maximum clock rate to be used with this chip
33 * (on this board); may be changed by the device's driver. 33 * (on this board); may be changed by the device's driver.
34 * The spi_transfer.speed_hz can override this for each transfer. 34 * The spi_transfer.speed_hz can override this for each transfer.
35 * @chip-select: Chipselect, distinguishing chips handled by "master". 35 * @chip_select: Chipselect, distinguishing chips handled by @master.
36 * @mode: The spi mode defines how data is clocked out and in. 36 * @mode: The spi mode defines how data is clocked out and in.
37 * This may be changed by the device's driver. 37 * This may be changed by the device's driver.
38 * The "active low" default for chipselect mode can be overridden, 38 * The "active low" default for chipselect mode can be overridden
39 * as can the "MSB first" default for each word in a transfer. 39 * (by specifying SPI_CS_HIGH) as can the "MSB first" default for
40 * each word in a transfer (by specifying SPI_LSB_FIRST).
40 * @bits_per_word: Data transfers involve one or more words; word sizes 41 * @bits_per_word: Data transfers involve one or more words; word sizes
41 * like eight or 12 bits are common. In-memory wordsizes are 42 * like eight or 12 bits are common. In-memory wordsizes are
42 * powers of two bytes (e.g. 20 bit samples use 32 bits). 43 * powers of two bytes (e.g. 20 bit samples use 32 bits).
@@ -48,14 +49,18 @@ extern struct bus_type spi_bus_type;
48 * @controller_state: Controller's runtime state 49 * @controller_state: Controller's runtime state
49 * @controller_data: Board-specific definitions for controller, such as 50 * @controller_data: Board-specific definitions for controller, such as
50 * FIFO initialization parameters; from board_info.controller_data 51 * FIFO initialization parameters; from board_info.controller_data
52 * @modalias: Name of the driver to use with this device, or an alias
53 * for that name. This appears in the sysfs "modalias" attribute
54 * for driver coldplugging, and in uevents used for hotplugging
51 * 55 *
52 * An spi_device is used to interchange data between an SPI slave 56 * A @spi_device is used to interchange data between an SPI slave
53 * (usually a discrete chip) and CPU memory. 57 * (usually a discrete chip) and CPU memory.
54 * 58 *
55 * In "dev", the platform_data is used to hold information about this 59 * In @dev, the platform_data is used to hold information about this
56 * device that's meaningful to the device's protocol driver, but not 60 * device that's meaningful to the device's protocol driver, but not
57 * to its controller. One example might be an identifier for a chip 61 * to its controller. One example might be an identifier for a chip
58 * variant with slightly different functionality. 62 * variant with slightly different functionality; another might be
63 * information about how this particular board wires the chip's pins.
59 */ 64 */
60struct spi_device { 65struct spi_device {
61 struct device dev; 66 struct device dev;
@@ -77,13 +82,15 @@ struct spi_device {
77 void *controller_data; 82 void *controller_data;
78 const char *modalias; 83 const char *modalias;
79 84
80 // likely need more hooks for more protocol options affecting how 85 /*
81 // the controller talks to each chip, like: 86 * likely need more hooks for more protocol options affecting how
82 // - memory packing (12 bit samples into low bits, others zeroed) 87 * the controller talks to each chip, like:
83 // - priority 88 * - memory packing (12 bit samples into low bits, others zeroed)
84 // - drop chipselect after each word 89 * - priority
85 // - chipselect delays 90 * - drop chipselect after each word
86 // - ... 91 * - chipselect delays
92 * - ...
93 */
87}; 94};
88 95
89static inline struct spi_device *to_spi_device(struct device *dev) 96static inline struct spi_device *to_spi_device(struct device *dev)
@@ -146,6 +153,11 @@ static inline struct spi_driver *to_spi_driver(struct device_driver *drv)
146 153
147extern int spi_register_driver(struct spi_driver *sdrv); 154extern int spi_register_driver(struct spi_driver *sdrv);
148 155
156/**
157 * spi_unregister_driver - reverse effect of spi_register_driver
158 * @sdrv: the driver to unregister
159 * Context: can sleep
160 */
149static inline void spi_unregister_driver(struct spi_driver *sdrv) 161static inline void spi_unregister_driver(struct spi_driver *sdrv)
150{ 162{
151 if (sdrv) 163 if (sdrv)
@@ -165,18 +177,20 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
165 * @setup: updates the device mode and clocking records used by a 177 * @setup: updates the device mode and clocking records used by a
166 * device's SPI controller; protocol code may call this. This 178 * device's SPI controller; protocol code may call this. This
167 * must fail if an unrecognized or unsupported mode is requested. 179 * must fail if an unrecognized or unsupported mode is requested.
180 * It's always safe to call this unless transfers are pending on
181 * the device whose settings are being modified.
168 * @transfer: adds a message to the controller's transfer queue. 182 * @transfer: adds a message to the controller's transfer queue.
169 * @cleanup: frees controller-specific state 183 * @cleanup: frees controller-specific state
170 * 184 *
171 * Each SPI master controller can communicate with one or more spi_device 185 * Each SPI master controller can communicate with one or more @spi_device
172 * children. These make a small bus, sharing MOSI, MISO and SCK signals 186 * children. These make a small bus, sharing MOSI, MISO and SCK signals
173 * but not chip select signals. Each device may be configured to use a 187 * but not chip select signals. Each device may be configured to use a
174 * different clock rate, since those shared signals are ignored unless 188 * different clock rate, since those shared signals are ignored unless
175 * the chip is selected. 189 * the chip is selected.
176 * 190 *
177 * The driver for an SPI controller manages access to those devices through 191 * The driver for an SPI controller manages access to those devices through
178 * a queue of spi_message transactions, copyin data between CPU memory and 192 * a queue of spi_message transactions, copying data between CPU memory and
179 * an SPI slave device). For each such message it queues, it calls the 193 * an SPI slave device. For each such message it queues, it calls the
180 * message's completion function when the transaction completes. 194 * message's completion function when the transaction completes.
181 */ 195 */
182struct spi_master { 196struct spi_master {
@@ -280,27 +294,27 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
280 * struct spi_transfer - a read/write buffer pair 294 * struct spi_transfer - a read/write buffer pair
281 * @tx_buf: data to be written (dma-safe memory), or NULL 295 * @tx_buf: data to be written (dma-safe memory), or NULL
282 * @rx_buf: data to be read (dma-safe memory), or NULL 296 * @rx_buf: data to be read (dma-safe memory), or NULL
283 * @tx_dma: DMA address of tx_buf, if spi_message.is_dma_mapped 297 * @tx_dma: DMA address of tx_buf, if @spi_message.is_dma_mapped
284 * @rx_dma: DMA address of rx_buf, if spi_message.is_dma_mapped 298 * @rx_dma: DMA address of rx_buf, if @spi_message.is_dma_mapped
285 * @len: size of rx and tx buffers (in bytes) 299 * @len: size of rx and tx buffers (in bytes)
286 * @speed_hz: Select a speed other then the device default for this 300 * @speed_hz: Select a speed other then the device default for this
287 * transfer. If 0 the default (from spi_device) is used. 301 * transfer. If 0 the default (from @spi_device) is used.
288 * @bits_per_word: select a bits_per_word other then the device default 302 * @bits_per_word: select a bits_per_word other then the device default
289 * for this transfer. If 0 the default (from spi_device) is used. 303 * for this transfer. If 0 the default (from @spi_device) is used.
290 * @cs_change: affects chipselect after this transfer completes 304 * @cs_change: affects chipselect after this transfer completes
291 * @delay_usecs: microseconds to delay after this transfer before 305 * @delay_usecs: microseconds to delay after this transfer before
292 * (optionally) changing the chipselect status, then starting 306 * (optionally) changing the chipselect status, then starting
293 * the next transfer or completing this spi_message. 307 * the next transfer or completing this @spi_message.
294 * @transfer_list: transfers are sequenced through spi_message.transfers 308 * @transfer_list: transfers are sequenced through @spi_message.transfers
295 * 309 *
296 * SPI transfers always write the same number of bytes as they read. 310 * SPI transfers always write the same number of bytes as they read.
297 * Protocol drivers should always provide rx_buf and/or tx_buf. 311 * Protocol drivers should always provide @rx_buf and/or @tx_buf.
298 * In some cases, they may also want to provide DMA addresses for 312 * In some cases, they may also want to provide DMA addresses for
299 * the data being transferred; that may reduce overhead, when the 313 * the data being transferred; that may reduce overhead, when the
300 * underlying driver uses dma. 314 * underlying driver uses dma.
301 * 315 *
302 * If the transmit buffer is null, zeroes will be shifted out 316 * If the transmit buffer is null, zeroes will be shifted out
303 * while filling rx_buf. If the receive buffer is null, the data 317 * while filling @rx_buf. If the receive buffer is null, the data
304 * shifted in will be discarded. Only "len" bytes shift out (or in). 318 * shifted in will be discarded. Only "len" bytes shift out (or in).
305 * It's an error to try to shift out a partial word. (For example, by 319 * It's an error to try to shift out a partial word. (For example, by
306 * shifting out three bytes with word size of sixteen or twenty bits; 320 * shifting out three bytes with word size of sixteen or twenty bits;
@@ -309,7 +323,7 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
309 * In-memory data values are always in native CPU byte order, translated 323 * In-memory data values are always in native CPU byte order, translated
310 * from the wire byte order (big-endian except with SPI_LSB_FIRST). So 324 * from the wire byte order (big-endian except with SPI_LSB_FIRST). So
311 * for example when bits_per_word is sixteen, buffers are 2N bytes long 325 * for example when bits_per_word is sixteen, buffers are 2N bytes long
312 * and hold N sixteen bit words in CPU byte order. 326 * (@len = 2N) and hold N sixteen bit words in CPU byte order.
313 * 327 *
314 * When the word size of the SPI transfer is not a power-of-two multiple 328 * When the word size of the SPI transfer is not a power-of-two multiple
315 * of eight bits, those in-memory words include extra bits. In-memory 329 * of eight bits, those in-memory words include extra bits. In-memory
@@ -318,7 +332,7 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
318 * 332 *
319 * All SPI transfers start with the relevant chipselect active. Normally 333 * All SPI transfers start with the relevant chipselect active. Normally
320 * it stays selected until after the last transfer in a message. Drivers 334 * it stays selected until after the last transfer in a message. Drivers
321 * can affect the chipselect signal using cs_change: 335 * can affect the chipselect signal using cs_change.
322 * 336 *
323 * (i) If the transfer isn't the last one in the message, this flag is 337 * (i) If the transfer isn't the last one in the message, this flag is
324 * used to make the chipselect briefly go inactive in the middle of the 338 * used to make the chipselect briefly go inactive in the middle of the
@@ -372,7 +386,7 @@ struct spi_transfer {
372 * @queue: for use by whichever driver currently owns the message 386 * @queue: for use by whichever driver currently owns the message
373 * @state: for use by whichever driver currently owns the message 387 * @state: for use by whichever driver currently owns the message
374 * 388 *
375 * An spi_message is used to execute an atomic sequence of data transfers, 389 * A @spi_message is used to execute an atomic sequence of data transfers,
376 * each represented by a struct spi_transfer. The sequence is "atomic" 390 * each represented by a struct spi_transfer. The sequence is "atomic"
377 * in the sense that no other spi_message may use that SPI bus until that 391 * in the sense that no other spi_message may use that SPI bus until that
378 * sequence completes. On some systems, many such sequences can execute as 392 * sequence completes. On some systems, many such sequences can execute as
@@ -464,8 +478,9 @@ static inline void spi_message_free(struct spi_message *m)
464} 478}
465 479
466/** 480/**
467 * spi_setup -- setup SPI mode and clock rate 481 * spi_setup - setup SPI mode and clock rate
468 * @spi: the device whose settings are being modified 482 * @spi: the device whose settings are being modified
483 * Context: can sleep
469 * 484 *
470 * SPI protocol drivers may need to update the transfer mode if the 485 * SPI protocol drivers may need to update the transfer mode if the
471 * device doesn't work with the mode 0 default. They may likewise need 486 * device doesn't work with the mode 0 default. They may likewise need
@@ -474,7 +489,7 @@ static inline void spi_message_free(struct spi_message *m)
474 * The changes take effect the next time the device is selected and data 489 * The changes take effect the next time the device is selected and data
475 * is transferred to or from it. 490 * is transferred to or from it.
476 * 491 *
477 * Note that this call wil fail if the protocol driver specifies an option 492 * Note that this call will fail if the protocol driver specifies an option
478 * that the underlying controller or its driver does not support. For 493 * that the underlying controller or its driver does not support. For
479 * example, not all hardware supports wire transfers using nine bit words, 494 * example, not all hardware supports wire transfers using nine bit words,
480 * LSB-first wire encoding, or active-high chipselects. 495 * LSB-first wire encoding, or active-high chipselects.
@@ -487,9 +502,10 @@ spi_setup(struct spi_device *spi)
487 502
488 503
489/** 504/**
490 * spi_async -- asynchronous SPI transfer 505 * spi_async - asynchronous SPI transfer
491 * @spi: device with which data will be exchanged 506 * @spi: device with which data will be exchanged
492 * @message: describes the data transfers, including completion callback 507 * @message: describes the data transfers, including completion callback
508 * Context: any (irqs may be blocked, etc)
493 * 509 *
494 * This call may be used in_irq and other contexts which can't sleep, 510 * This call may be used in_irq and other contexts which can't sleep,
495 * as well as from task contexts which can sleep. 511 * as well as from task contexts which can sleep.
@@ -535,6 +551,7 @@ extern int spi_sync(struct spi_device *spi, struct spi_message *message);
535 * @spi: device to which data will be written 551 * @spi: device to which data will be written
536 * @buf: data buffer 552 * @buf: data buffer
537 * @len: data buffer size 553 * @len: data buffer size
554 * Context: can sleep
538 * 555 *
539 * This writes the buffer and returns zero or a negative error code. 556 * This writes the buffer and returns zero or a negative error code.
540 * Callable only from contexts that can sleep. 557 * Callable only from contexts that can sleep.
@@ -558,8 +575,9 @@ spi_write(struct spi_device *spi, const u8 *buf, size_t len)
558 * @spi: device from which data will be read 575 * @spi: device from which data will be read
559 * @buf: data buffer 576 * @buf: data buffer
560 * @len: data buffer size 577 * @len: data buffer size
578 * Context: can sleep
561 * 579 *
562 * This writes the buffer and returns zero or a negative error code. 580 * This reads the buffer and returns zero or a negative error code.
563 * Callable only from contexts that can sleep. 581 * Callable only from contexts that can sleep.
564 */ 582 */
565static inline int 583static inline int
@@ -585,6 +603,7 @@ extern int spi_write_then_read(struct spi_device *spi,
585 * spi_w8r8 - SPI synchronous 8 bit write followed by 8 bit read 603 * spi_w8r8 - SPI synchronous 8 bit write followed by 8 bit read
586 * @spi: device with which data will be exchanged 604 * @spi: device with which data will be exchanged
587 * @cmd: command to be written before data is read back 605 * @cmd: command to be written before data is read back
606 * Context: can sleep
588 * 607 *
589 * This returns the (unsigned) eight bit number returned by the 608 * This returns the (unsigned) eight bit number returned by the
590 * device, or else a negative error code. Callable only from 609 * device, or else a negative error code. Callable only from
@@ -605,6 +624,7 @@ static inline ssize_t spi_w8r8(struct spi_device *spi, u8 cmd)
605 * spi_w8r16 - SPI synchronous 8 bit write followed by 16 bit read 624 * spi_w8r16 - SPI synchronous 8 bit write followed by 16 bit read
606 * @spi: device with which data will be exchanged 625 * @spi: device with which data will be exchanged
607 * @cmd: command to be written before data is read back 626 * @cmd: command to be written before data is read back
627 * Context: can sleep
608 * 628 *
609 * This returns the (unsigned) sixteen bit number returned by the 629 * This returns the (unsigned) sixteen bit number returned by the
610 * device, or else a negative error code. Callable only from 630 * device, or else a negative error code. Callable only from
diff --git a/include/linux/spi/spidev.h b/include/linux/spi/spidev.h
new file mode 100644
index 000000000000..7d700be57490
--- /dev/null
+++ b/include/linux/spi/spidev.h
@@ -0,0 +1,124 @@
1/*
2 * include/linux/spi/spidev.h
3 *
4 * Copyright (C) 2006 SWAPP
5 * Andrea Paterniani <a.paterniani@swapp-eng.it>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#ifndef SPIDEV_H
23#define SPIDEV_H
24
25
26/* User space versions of kernel symbols for SPI clocking modes,
27 * matching <linux/spi/spi.h>
28 */
29
30#define SPI_CPHA 0x01
31#define SPI_CPOL 0x02
32
33#define SPI_MODE_0 (0|0)
34#define SPI_MODE_1 (0|SPI_CPHA)
35#define SPI_MODE_2 (SPI_CPOL|0)
36#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
37
38
39/*---------------------------------------------------------------------------*/
40
41/* IOCTL commands */
42
43#define SPI_IOC_MAGIC 'k'
44
45/**
46 * struct spi_ioc_transfer - describes a single SPI transfer
47 * @tx_buf: Holds pointer to userspace buffer with transmit data, or null.
48 * If no data is provided, zeroes are shifted out.
49 * @rx_buf: Holds pointer to userspace buffer for receive data, or null.
50 * @len: Length of tx and rx buffers, in bytes.
51 * @speed_hz: Temporary override of the device's bitrate.
52 * @bits_per_word: Temporary override of the device's wordsize.
53 * @delay_usecs: If nonzero, how long to delay after the last bit transfer
54 * before optionally deselecting the device before the next transfer.
55 * @cs_change: True to deselect device before starting the next transfer.
56 *
57 * This structure is mapped directly to the kernel spi_transfer structure;
58 * the fields have the same meanings, except of course that the pointers
59 * are in a different address space (and may be of different sizes in some
60 * cases, such as 32-bit i386 userspace over a 64-bit x86_64 kernel).
61 * Zero-initialize the structure, including currently unused fields, to
62 * accomodate potential future updates.
63 *
64 * SPI_IOC_MESSAGE gives userspace the equivalent of kernel spi_sync().
65 * Pass it an array of related transfers, they'll execute together.
66 * Each transfer may be half duplex (either direction) or full duplex.
67 *
68 * struct spi_ioc_transfer mesg[4];
69 * ...
70 * status = ioctl(fd, SPI_IOC_MESSAGE(4), mesg);
71 *
72 * So for example one transfer might send a nine bit command (right aligned
73 * in a 16-bit word), the next could read a block of 8-bit data before
74 * terminating that command by temporarily deselecting the chip; the next
75 * could send a different nine bit command (re-selecting the chip), and the
76 * last transfer might write some register values.
77 */
78struct spi_ioc_transfer {
79 __u64 tx_buf;
80 __u64 rx_buf;
81
82 __u32 len;
83 __u32 speed_hz;
84
85 __u16 delay_usecs;
86 __u8 bits_per_word;
87 __u8 cs_change;
88 __u32 pad;
89
90 /* If the contents of 'struct spi_ioc_transfer' ever change
91 * incompatibly, then the ioctl number (currently 0) must change;
92 * ioctls with constant size fields get a bit more in the way of
93 * error checking than ones (like this) where that field varies.
94 *
95 * NOTE: struct layout is the same in 64bit and 32bit userspace.
96 */
97};
98
99/* not all platforms use <asm-generic/ioctl.h> or _IOC_TYPECHECK() ... */
100#define SPI_MSGSIZE(N) \
101 ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) \
102 ? ((N)*(sizeof (struct spi_ioc_transfer))) : 0)
103#define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)])
104
105
106/* Read / Write of SPI mode (SPI_MODE_0..SPI_MODE_3) */
107#define SPI_IOC_RD_MODE _IOR(SPI_IOC_MAGIC, 1, __u8)
108#define SPI_IOC_WR_MODE _IOW(SPI_IOC_MAGIC, 1, __u8)
109
110/* Read / Write SPI bit justification */
111#define SPI_IOC_RD_LSB_FIRST _IOR(SPI_IOC_MAGIC, 2, __u8)
112#define SPI_IOC_WR_LSB_FIRST _IOW(SPI_IOC_MAGIC, 2, __u8)
113
114/* Read / Write SPI device word length (1..N) */
115#define SPI_IOC_RD_BITS_PER_WORD _IOR(SPI_IOC_MAGIC, 3, __u8)
116#define SPI_IOC_WR_BITS_PER_WORD _IOW(SPI_IOC_MAGIC, 3, __u8)
117
118/* Read / Write SPI device default max speed hz */
119#define SPI_IOC_RD_MAX_SPEED_HZ _IOR(SPI_IOC_MAGIC, 4, __u32)
120#define SPI_IOC_WR_MAX_SPEED_HZ _IOW(SPI_IOC_MAGIC, 4, __u32)
121
122
123
124#endif /* SPIDEV_H */
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h
index dc5fb69e4de9..210549ba4ef4 100644
--- a/include/linux/spinlock_types.h
+++ b/include/linux/spinlock_types.h
@@ -85,6 +85,12 @@ typedef struct {
85 RW_DEP_MAP_INIT(lockname) } 85 RW_DEP_MAP_INIT(lockname) }
86#endif 86#endif
87 87
88/*
89 * SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and
90 * are hence deprecated.
91 * Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or
92 * __SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate.
93 */
88#define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) 94#define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init)
89#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) 95#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init)
90 96
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 50e2b01e517c..1d2b084c0185 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -6,15 +6,13 @@ struct stack_trace {
6 unsigned int nr_entries, max_entries; 6 unsigned int nr_entries, max_entries;
7 unsigned long *entries; 7 unsigned long *entries;
8 int skip; /* input argument: How many entries to skip */ 8 int skip; /* input argument: How many entries to skip */
9 int all_contexts; /* input argument: if true do than one stack */
10}; 9};
11 10
12extern void save_stack_trace(struct stack_trace *trace, 11extern void save_stack_trace(struct stack_trace *trace);
13 struct task_struct *task);
14 12
15extern void print_stack_trace(struct stack_trace *trace, int spaces); 13extern void print_stack_trace(struct stack_trace *trace, int spaces);
16#else 14#else
17# define save_stack_trace(trace, task) do { } while (0) 15# define save_stack_trace(trace) do { } while (0)
18# define print_stack_trace(trace) do { } while (0) 16# define print_stack_trace(trace) do { } while (0)
19#endif 17#endif
20 18
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 679ef0d70b6b..611c398dab72 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -53,6 +53,9 @@
53#define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) 53#define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH)
54#define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) 54#define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH)
55 55
56#define UTIME_NOW ((1l << 30) - 1l)
57#define UTIME_OMIT ((1l << 30) - 2l)
58
56#include <linux/types.h> 59#include <linux/types.h>
57#include <linux/time.h> 60#include <linux/time.h>
58 61
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index bf99bd49f8ef..9d2aa1a12aa0 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -1,13 +1,14 @@
1#ifndef _LINUX_SWSUSP_H 1#ifndef _LINUX_SWSUSP_H
2#define _LINUX_SWSUSP_H 2#define _LINUX_SWSUSP_H
3 3
4#if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32) 4#if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32) || defined(CONFIG_PPC64)
5#include <asm/suspend.h> 5#include <asm/suspend.h>
6#endif 6#endif
7#include <linux/swap.h> 7#include <linux/swap.h>
8#include <linux/notifier.h> 8#include <linux/notifier.h>
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/pm.h> 10#include <linux/pm.h>
11#include <linux/mm.h>
11 12
12/* struct pbe is used for creating lists of pages that should be restored 13/* struct pbe is used for creating lists of pages that should be restored
13 * atomically during the resume from disk, because the page frames they have 14 * atomically during the resume from disk, because the page frames they have
@@ -23,36 +24,32 @@ struct pbe {
23extern void drain_local_pages(void); 24extern void drain_local_pages(void);
24extern void mark_free_pages(struct zone *zone); 25extern void mark_free_pages(struct zone *zone);
25 26
26#ifdef CONFIG_PM 27#if defined(CONFIG_PM) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
27/* kernel/power/swsusp.c */
28extern int software_suspend(void);
29
30#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
31extern int pm_prepare_console(void); 28extern int pm_prepare_console(void);
32extern void pm_restore_console(void); 29extern void pm_restore_console(void);
33#else 30#else
34static inline int pm_prepare_console(void) { return 0; } 31static inline int pm_prepare_console(void) { return 0; }
35static inline void pm_restore_console(void) {} 32static inline void pm_restore_console(void) {}
36#endif /* defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) */ 33#endif
34
35#if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND)
36/* kernel/power/snapshot.c */
37extern void __init register_nosave_region(unsigned long, unsigned long);
38extern int swsusp_page_is_forbidden(struct page *);
39extern void swsusp_set_page_free(struct page *);
40extern void swsusp_unset_page_free(struct page *);
41extern unsigned long get_safe_page(gfp_t gfp_mask);
37#else 42#else
38static inline int software_suspend(void) 43static inline void register_nosave_region(unsigned long b, unsigned long e) {}
39{ 44static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
40 printk("Warning: fake suspend called\n"); 45static inline void swsusp_set_page_free(struct page *p) {}
41 return -ENOSYS; 46static inline void swsusp_unset_page_free(struct page *p) {}
42} 47#endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */
43#endif /* CONFIG_PM */
44 48
45void save_processor_state(void); 49void save_processor_state(void);
46void restore_processor_state(void); 50void restore_processor_state(void);
47struct saved_context; 51struct saved_context;
48void __save_processor_state(struct saved_context *ctxt); 52void __save_processor_state(struct saved_context *ctxt);
49void __restore_processor_state(struct saved_context *ctxt); 53void __restore_processor_state(struct saved_context *ctxt);
50unsigned long get_safe_page(gfp_t gfp_mask);
51
52/*
53 * XXX: We try to keep some more pages free so that I/O operations succeed
54 * without paging. Might this be more?
55 */
56#define PAGES_FOR_IO 1024
57 54
58#endif /* _LINUX_SWSUSP_H */ 55#endif /* _LINUX_SWSUSP_H */
diff --git a/include/linux/svga.h b/include/linux/svga.h
index eadb981bb37c..e1cc552e04fe 100644
--- a/include/linux/svga.h
+++ b/include/linux/svga.h
@@ -112,6 +112,7 @@ void svga_tilecopy(struct fb_info *info, struct fb_tilearea *area);
112void svga_tilefill(struct fb_info *info, struct fb_tilerect *rect); 112void svga_tilefill(struct fb_info *info, struct fb_tilerect *rect);
113void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit); 113void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit);
114void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor); 114void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor);
115int svga_get_tilemax(struct fb_info *info);
115 116
116int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u16 *r, int node); 117int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u16 *r, int node);
117int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node); 118int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node);
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index 389ccf858d37..e699ab279c2c 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -22,6 +22,7 @@
22#define _SYSDEV_H_ 22#define _SYSDEV_H_
23 23
24#include <linux/kobject.h> 24#include <linux/kobject.h>
25#include <linux/module.h>
25#include <linux/pm.h> 26#include <linux/pm.h>
26 27
27 28
diff --git a/include/linux/tifm.h b/include/linux/tifm.h
index 2a196982601f..6b3a31805c72 100644
--- a/include/linux/tifm.h
+++ b/include/linux/tifm.h
@@ -63,6 +63,7 @@ enum {
63 63
64#define TIFM_CTRL_LED 0x00000040 64#define TIFM_CTRL_LED 0x00000040
65#define TIFM_CTRL_FAST_CLK 0x00000100 65#define TIFM_CTRL_FAST_CLK 0x00000100
66#define TIFM_CTRL_POWER_MASK 0x00000007
66 67
67#define TIFM_SOCK_STATE_OCCUPIED 0x00000008 68#define TIFM_SOCK_STATE_OCCUPIED 0x00000008
68#define TIFM_SOCK_STATE_POWERED 0x00000080 69#define TIFM_SOCK_STATE_POWERED 0x00000080
diff --git a/include/linux/time.h b/include/linux/time.h
index 8ea8dea713c7..dda9be685ab6 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -109,7 +109,7 @@ extern void do_gettimeofday(struct timeval *tv);
109extern int do_settimeofday(struct timespec *tv); 109extern int do_settimeofday(struct timespec *tv);
110extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); 110extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz);
111#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) 111#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
112extern long do_utimes(int dfd, char __user *filename, struct timeval *times); 112extern long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags);
113struct itimerval; 113struct itimerval;
114extern int do_setitimer(int which, struct itimerval *value, 114extern int do_setitimer(int which, struct itimerval *value,
115 struct itimerval *ovalue); 115 struct itimerval *ovalue);
@@ -119,6 +119,7 @@ extern void getnstimeofday(struct timespec *tv);
119 119
120extern struct timespec timespec_trunc(struct timespec t, unsigned gran); 120extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
121extern int timekeeping_is_continuous(void); 121extern int timekeeping_is_continuous(void);
122extern void update_wall_time(void);
122 123
123/** 124/**
124 * timespec_to_ns - Convert timespec to nanoseconds 125 * timespec_to_ns - Convert timespec to nanoseconds
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 719113b652dd..e0c5c16c992f 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -37,6 +37,7 @@ extern struct tvec_t_base_s boot_tvec_bases;
37 TIMER_INITIALIZER(_function, _expires, _data) 37 TIMER_INITIALIZER(_function, _expires, _data)
38 38
39void fastcall init_timer(struct timer_list * timer); 39void fastcall init_timer(struct timer_list * timer);
40void fastcall init_timer_deferrable(struct timer_list *timer);
40 41
41static inline void setup_timer(struct timer_list * timer, 42static inline void setup_timer(struct timer_list * timer,
42 void (*function)(unsigned long), 43 void (*function)(unsigned long),
diff --git a/include/linux/tty.h b/include/linux/tty.h
index dee72b9a20fb..bb4576085203 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -313,6 +313,7 @@ extern int tty_hung_up_p(struct file * filp);
313extern void do_SAK(struct tty_struct *tty); 313extern void do_SAK(struct tty_struct *tty);
314extern void __do_SAK(struct tty_struct *tty); 314extern void __do_SAK(struct tty_struct *tty);
315extern void disassociate_ctty(int priv); 315extern void disassociate_ctty(int priv);
316extern void no_tty(void);
316extern void tty_flip_buffer_push(struct tty_struct *tty); 317extern void tty_flip_buffer_push(struct tty_struct *tty);
317extern speed_t tty_get_baud_rate(struct tty_struct *tty); 318extern speed_t tty_get_baud_rate(struct tty_struct *tty);
318extern speed_t tty_termios_baud_rate(struct ktermios *termios); 319extern speed_t tty_termios_baud_rate(struct ktermios *termios);
@@ -333,7 +334,6 @@ extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
333 334
334extern dev_t tty_devnum(struct tty_struct *tty); 335extern dev_t tty_devnum(struct tty_struct *tty);
335extern void proc_clear_tty(struct task_struct *p); 336extern void proc_clear_tty(struct task_struct *p);
336extern void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty);
337extern struct tty_struct *get_current_tty(void); 337extern struct tty_struct *get_current_tty(void);
338 338
339extern struct mutex tty_mutex; 339extern struct mutex tty_mutex;
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 1fd61eeed664..a6c1e8eed226 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -32,6 +32,8 @@
32 * - first public version 32 * - first public version
33 */ 33 */
34 34
35#include <linux/input.h>
36
35#define UINPUT_VERSION 3 37#define UINPUT_VERSION 3
36 38
37#ifdef __KERNEL__ 39#ifdef __KERNEL__
diff --git a/include/linux/usb_sl811.h b/include/linux/usb_sl811.h
new file mode 100644
index 000000000000..4f2d012d7309
--- /dev/null
+++ b/include/linux/usb_sl811.h
@@ -0,0 +1,26 @@
1
2/*
3 * board initialization should put one of these into dev->platform_data
4 * and place the sl811hs onto platform_bus named "sl811-hcd".
5 */
6
7struct sl811_platform_data {
8 unsigned can_wakeup:1;
9
10 /* given port_power, msec/2 after power on till power good */
11 u8 potpg;
12
13 /* mA/2 power supplied on this port (max = default = 250) */
14 u8 power;
15
16 /* sl811 relies on an external source of VBUS current */
17 void (*port_power)(struct device *dev, int is_on);
18
19 /* pulse sl811 nRST (probably with a GPIO) */
20 void (*reset)(struct device *dev);
21
22 // some boards need something like these:
23 // int (*check_overcurrent)(struct device *dev);
24 // void (*clock_enable)(struct device *dev, int is_on);
25};
26
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index e10267d402c5..f8d3b326e93a 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -49,9 +49,7 @@ static inline void get_uts_ns(struct uts_namespace *ns)
49} 49}
50 50
51#ifdef CONFIG_UTS_NS 51#ifdef CONFIG_UTS_NS
52extern int unshare_utsname(unsigned long unshare_flags, 52extern struct uts_namespace *copy_utsname(int flags, struct uts_namespace *ns);
53 struct uts_namespace **new_uts);
54extern int copy_utsname(int flags, struct task_struct *tsk);
55extern void free_uts_ns(struct kref *kref); 53extern void free_uts_ns(struct kref *kref);
56 54
57static inline void put_uts_ns(struct uts_namespace *ns) 55static inline void put_uts_ns(struct uts_namespace *ns)
@@ -59,21 +57,12 @@ static inline void put_uts_ns(struct uts_namespace *ns)
59 kref_put(&ns->kref, free_uts_ns); 57 kref_put(&ns->kref, free_uts_ns);
60} 58}
61#else 59#else
62static inline int unshare_utsname(unsigned long unshare_flags, 60static inline struct uts_namespace *copy_utsname(int flags,
63 struct uts_namespace **new_uts) 61 struct uts_namespace *ns)
64{ 62{
65 if (unshare_flags & CLONE_NEWUTS) 63 return ns;
66 return -EINVAL;
67
68 return 0;
69} 64}
70 65
71static inline int copy_utsname(int flags, struct task_struct *tsk)
72{
73 if (flags & CLONE_NEWUTS)
74 return -EINVAL;
75 return 0;
76}
77static inline void put_uts_ns(struct uts_namespace *ns) 66static inline void put_uts_ns(struct uts_namespace *ns)
78{ 67{
79} 68}
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 924e502905d4..4b7ee83787c1 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -53,6 +53,7 @@ extern void vunmap(void *addr);
53 53
54extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, 54extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
55 unsigned long pgoff); 55 unsigned long pgoff);
56void vmalloc_sync_all(void);
56 57
57/* 58/*
58 * Lowlevel-APIs (not for driver use!) 59 * Lowlevel-APIs (not for driver use!)
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index e0db669998f3..d961635d0e61 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -9,6 +9,7 @@
9#include <linux/vt.h> 9#include <linux/vt.h>
10#include <linux/kd.h> 10#include <linux/kd.h>
11#include <linux/tty.h> 11#include <linux/tty.h>
12#include <linux/mutex.h>
12#include <linux/console_struct.h> 13#include <linux/console_struct.h>
13#include <linux/mm.h> 14#include <linux/mm.h>
14 15
@@ -82,7 +83,7 @@ void reset_vc(struct vc_data *vc);
82 83
83#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) 84#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
84extern char con_buf[CON_BUF_SIZE]; 85extern char con_buf[CON_BUF_SIZE];
85extern struct semaphore con_buf_sem; 86extern struct mutex con_buf_mtx;
86extern char vt_dont_switch; 87extern char vt_dont_switch;
87 88
88struct vt_spawn_console { 89struct vt_spawn_console {
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index b8abfc74d038..f16ba1e0687d 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -121,6 +121,12 @@ struct execute_work {
121 init_timer(&(_work)->timer); \ 121 init_timer(&(_work)->timer); \
122 } while (0) 122 } while (0)
123 123
124#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \
125 do { \
126 INIT_WORK(&(_work)->work, (_func)); \
127 init_timer_deferrable(&(_work)->timer); \
128 } while (0)
129
124/** 130/**
125 * work_pending - Find out whether a work item is currently pending 131 * work_pending - Find out whether a work item is currently pending
126 * @work: The work item in question 132 * @work: The work item in question
diff --git a/include/math-emu/extended.h b/include/math-emu/extended.h
deleted file mode 100644
index 84770fceb53e..000000000000
--- a/include/math-emu/extended.h
+++ /dev/null
@@ -1,396 +0,0 @@
1/* Software floating-point emulation.
2 Definitions for IEEE Extended Precision.
3 Copyright (C) 1999 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
5 Contributed by Jakub Jelinek (jj@ultra.linux.cz).
6
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
11
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If
19 not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21
22
23#ifndef __MATH_EMU_EXTENDED_H__
24#define __MATH_EMU_EXTENDED_H__
25
26#if _FP_W_TYPE_SIZE < 32
27#error "Here's a nickel, kid. Go buy yourself a real computer."
28#endif
29
30#if _FP_W_TYPE_SIZE < 64
31#define _FP_FRACTBITS_E (4*_FP_W_TYPE_SIZE)
32#else
33#define _FP_FRACTBITS_E (2*_FP_W_TYPE_SIZE)
34#endif
35
36#define _FP_FRACBITS_E 64
37#define _FP_FRACXBITS_E (_FP_FRACTBITS_E - _FP_FRACBITS_E)
38#define _FP_WFRACBITS_E (_FP_WORKBITS + _FP_FRACBITS_E)
39#define _FP_WFRACXBITS_E (_FP_FRACTBITS_E - _FP_WFRACBITS_E)
40#define _FP_EXPBITS_E 15
41#define _FP_EXPBIAS_E 16383
42#define _FP_EXPMAX_E 32767
43
44#define _FP_QNANBIT_E \
45 ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-2) % _FP_W_TYPE_SIZE)
46#define _FP_IMPLBIT_E \
47 ((_FP_W_TYPE)1 << (_FP_FRACBITS_E-1) % _FP_W_TYPE_SIZE)
48#define _FP_OVERFLOW_E \
49 ((_FP_W_TYPE)1 << (_FP_WFRACBITS_E % _FP_W_TYPE_SIZE))
50
51#if _FP_W_TYPE_SIZE < 64
52
53union _FP_UNION_E
54{
55 long double flt;
56 struct
57 {
58#if __BYTE_ORDER == __BIG_ENDIAN
59 unsigned long pad1 : _FP_W_TYPE_SIZE;
60 unsigned long pad2 : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
61 unsigned long sign : 1;
62 unsigned long exp : _FP_EXPBITS_E;
63 unsigned long frac1 : _FP_W_TYPE_SIZE;
64 unsigned long frac0 : _FP_W_TYPE_SIZE;
65#else
66 unsigned long frac0 : _FP_W_TYPE_SIZE;
67 unsigned long frac1 : _FP_W_TYPE_SIZE;
68 unsigned exp : _FP_EXPBITS_E;
69 unsigned sign : 1;
70#endif /* not bigendian */
71 } bits __attribute__((packed));
72};
73
74
75#define FP_DECL_E(X) _FP_DECL(4,X)
76
77#define FP_UNPACK_RAW_E(X, val) \
78 do { \
79 union _FP_UNION_E _flo; _flo.flt = (val); \
80 \
81 X##_f[2] = 0; X##_f[3] = 0; \
82 X##_f[0] = _flo.bits.frac0; \
83 X##_f[1] = _flo.bits.frac1; \
84 X##_e = _flo.bits.exp; \
85 X##_s = _flo.bits.sign; \
86 if (!X##_e && (X##_f[1] || X##_f[0]) \
87 && !(X##_f[1] & _FP_IMPLBIT_E)) \
88 { \
89 X##_e++; \
90 FP_SET_EXCEPTION(FP_EX_DENORM); \
91 } \
92 } while (0)
93
94#define FP_UNPACK_RAW_EP(X, val) \
95 do { \
96 union _FP_UNION_E *_flo = \
97 (union _FP_UNION_E *)(val); \
98 \
99 X##_f[2] = 0; X##_f[3] = 0; \
100 X##_f[0] = _flo->bits.frac0; \
101 X##_f[1] = _flo->bits.frac1; \
102 X##_e = _flo->bits.exp; \
103 X##_s = _flo->bits.sign; \
104 if (!X##_e && (X##_f[1] || X##_f[0]) \
105 && !(X##_f[1] & _FP_IMPLBIT_E)) \
106 { \
107 X##_e++; \
108 FP_SET_EXCEPTION(FP_EX_DENORM); \
109 } \
110 } while (0)
111
112#define FP_PACK_RAW_E(val, X) \
113 do { \
114 union _FP_UNION_E _flo; \
115 \
116 if (X##_e) X##_f[1] |= _FP_IMPLBIT_E; \
117 else X##_f[1] &= ~(_FP_IMPLBIT_E); \
118 _flo.bits.frac0 = X##_f[0]; \
119 _flo.bits.frac1 = X##_f[1]; \
120 _flo.bits.exp = X##_e; \
121 _flo.bits.sign = X##_s; \
122 \
123 (val) = _flo.flt; \
124 } while (0)
125
126#define FP_PACK_RAW_EP(val, X) \
127 do { \
128 if (!FP_INHIBIT_RESULTS) \
129 { \
130 union _FP_UNION_E *_flo = \
131 (union _FP_UNION_E *)(val); \
132 \
133 if (X##_e) X##_f[1] |= _FP_IMPLBIT_E; \
134 else X##_f[1] &= ~(_FP_IMPLBIT_E); \
135 _flo->bits.frac0 = X##_f[0]; \
136 _flo->bits.frac1 = X##_f[1]; \
137 _flo->bits.exp = X##_e; \
138 _flo->bits.sign = X##_s; \
139 } \
140 } while (0)
141
142#define FP_UNPACK_E(X,val) \
143 do { \
144 FP_UNPACK_RAW_E(X,val); \
145 _FP_UNPACK_CANONICAL(E,4,X); \
146 } while (0)
147
148#define FP_UNPACK_EP(X,val) \
149 do { \
150 FP_UNPACK_RAW_2_P(X,val); \
151 _FP_UNPACK_CANONICAL(E,4,X); \
152 } while (0)
153
154#define FP_PACK_E(val,X) \
155 do { \
156 _FP_PACK_CANONICAL(E,4,X); \
157 FP_PACK_RAW_E(val,X); \
158 } while (0)
159
160#define FP_PACK_EP(val,X) \
161 do { \
162 _FP_PACK_CANONICAL(E,4,X); \
163 FP_PACK_RAW_EP(val,X); \
164 } while (0)
165
166#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,4,X)
167#define FP_NEG_E(R,X) _FP_NEG(E,4,R,X)
168#define FP_ADD_E(R,X,Y) _FP_ADD(E,4,R,X,Y)
169#define FP_SUB_E(R,X,Y) _FP_SUB(E,4,R,X,Y)
170#define FP_MUL_E(R,X,Y) _FP_MUL(E,4,R,X,Y)
171#define FP_DIV_E(R,X,Y) _FP_DIV(E,4,R,X,Y)
172#define FP_SQRT_E(R,X) _FP_SQRT(E,4,R,X)
173
174/*
175 * Square root algorithms:
176 * We have just one right now, maybe Newton approximation
177 * should be added for those machines where division is fast.
178 * This has special _E version because standard _4 square
179 * root would not work (it has to start normally with the
180 * second word and not the first), but as we have to do it
181 * anyway, we optimize it by doing most of the calculations
182 * in two UWtype registers instead of four.
183 */
184
185#define _FP_SQRT_MEAT_E(R, S, T, X, q) \
186 do { \
187 q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \
188 _FP_FRAC_SRL_4(X, (_FP_WORKBITS)); \
189 while (q) \
190 { \
191 T##_f[1] = S##_f[1] + q; \
192 if (T##_f[1] <= X##_f[1]) \
193 { \
194 S##_f[1] = T##_f[1] + q; \
195 X##_f[1] -= T##_f[1]; \
196 R##_f[1] += q; \
197 } \
198 _FP_FRAC_SLL_2(X, 1); \
199 q >>= 1; \
200 } \
201 q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \
202 while (q) \
203 { \
204 T##_f[0] = S##_f[0] + q; \
205 T##_f[1] = S##_f[1]; \
206 if (T##_f[1] < X##_f[1] || \
207 (T##_f[1] == X##_f[1] && \
208 T##_f[0] <= X##_f[0])) \
209 { \
210 S##_f[0] = T##_f[0] + q; \
211 S##_f[1] += (T##_f[0] > S##_f[0]); \
212 _FP_FRAC_DEC_2(X, T); \
213 R##_f[0] += q; \
214 } \
215 _FP_FRAC_SLL_2(X, 1); \
216 q >>= 1; \
217 } \
218 _FP_FRAC_SLL_4(R, (_FP_WORKBITS)); \
219 if (X##_f[0] | X##_f[1]) \
220 { \
221 if (S##_f[1] < X##_f[1] || \
222 (S##_f[1] == X##_f[1] && \
223 S##_f[0] < X##_f[0])) \
224 R##_f[0] |= _FP_WORK_ROUND; \
225 R##_f[0] |= _FP_WORK_STICKY; \
226 } \
227 } while (0)
228
229#define FP_CMP_E(r,X,Y,un) _FP_CMP(E,4,r,X,Y,un)
230#define FP_CMP_EQ_E(r,X,Y) _FP_CMP_EQ(E,4,r,X,Y)
231
232#define FP_TO_INT_E(r,X,rsz,rsg) _FP_TO_INT(E,4,r,X,rsz,rsg)
233#define FP_TO_INT_ROUND_E(r,X,rsz,rsg) _FP_TO_INT_ROUND(E,4,r,X,rsz,rsg)
234#define FP_FROM_INT_E(X,r,rs,rt) _FP_FROM_INT(E,4,X,r,rs,rt)
235
236#define _FP_FRAC_HIGH_E(X) (X##_f[2])
237#define _FP_FRAC_HIGH_RAW_E(X) (X##_f[1])
238
239#else /* not _FP_W_TYPE_SIZE < 64 */
240union _FP_UNION_E
241{
242 long double flt /* __attribute__((mode(TF))) */ ;
243 struct {
244#if __BYTE_ORDER == __BIG_ENDIAN
245 unsigned long pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
246 unsigned sign : 1;
247 unsigned exp : _FP_EXPBITS_E;
248 unsigned long frac : _FP_W_TYPE_SIZE;
249#else
250 unsigned long frac : _FP_W_TYPE_SIZE;
251 unsigned exp : _FP_EXPBITS_E;
252 unsigned sign : 1;
253#endif
254 } bits;
255};
256
257#define FP_DECL_E(X) _FP_DECL(2,X)
258
259#define FP_UNPACK_RAW_E(X, val) \
260 do { \
261 union _FP_UNION_E _flo; _flo.flt = (val); \
262 \
263 X##_f0 = _flo.bits.frac; \
264 X##_f1 = 0; \
265 X##_e = _flo.bits.exp; \
266 X##_s = _flo.bits.sign; \
267 if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \
268 { \
269 X##_e++; \
270 FP_SET_EXCEPTION(FP_EX_DENORM); \
271 } \
272 } while (0)
273
274#define FP_UNPACK_RAW_EP(X, val) \
275 do { \
276 union _FP_UNION_E *_flo = \
277 (union _FP_UNION_E *)(val); \
278 \
279 X##_f0 = _flo->bits.frac; \
280 X##_f1 = 0; \
281 X##_e = _flo->bits.exp; \
282 X##_s = _flo->bits.sign; \
283 if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \
284 { \
285 X##_e++; \
286 FP_SET_EXCEPTION(FP_EX_DENORM); \
287 } \
288 } while (0)
289
290#define FP_PACK_RAW_E(val, X) \
291 do { \
292 union _FP_UNION_E _flo; \
293 \
294 if (X##_e) X##_f0 |= _FP_IMPLBIT_E; \
295 else X##_f0 &= ~(_FP_IMPLBIT_E); \
296 _flo.bits.frac = X##_f0; \
297 _flo.bits.exp = X##_e; \
298 _flo.bits.sign = X##_s; \
299 \
300 (val) = _flo.flt; \
301 } while (0)
302
303#define FP_PACK_RAW_EP(fs, val, X) \
304 do { \
305 if (!FP_INHIBIT_RESULTS) \
306 { \
307 union _FP_UNION_E *_flo = \
308 (union _FP_UNION_E *)(val); \
309 \
310 if (X##_e) X##_f0 |= _FP_IMPLBIT_E; \
311 else X##_f0 &= ~(_FP_IMPLBIT_E); \
312 _flo->bits.frac = X##_f0; \
313 _flo->bits.exp = X##_e; \
314 _flo->bits.sign = X##_s; \
315 } \
316 } while (0)
317
318
319#define FP_UNPACK_E(X,val) \
320 do { \
321 FP_UNPACK_RAW_E(X,val); \
322 _FP_UNPACK_CANONICAL(E,2,X); \
323 } while (0)
324
325#define FP_UNPACK_EP(X,val) \
326 do { \
327 FP_UNPACK_RAW_EP(X,val); \
328 _FP_UNPACK_CANONICAL(E,2,X); \
329 } while (0)
330
331#define FP_PACK_E(val,X) \
332 do { \
333 _FP_PACK_CANONICAL(E,2,X); \
334 FP_PACK_RAW_E(val,X); \
335 } while (0)
336
337#define FP_PACK_EP(val,X) \
338 do { \
339 _FP_PACK_CANONICAL(E,2,X); \
340 FP_PACK_RAW_EP(val,X); \
341 } while (0)
342
343#define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,2,X)
344#define FP_NEG_E(R,X) _FP_NEG(E,2,R,X)
345#define FP_ADD_E(R,X,Y) _FP_ADD(E,2,R,X,Y)
346#define FP_SUB_E(R,X,Y) _FP_SUB(E,2,R,X,Y)
347#define FP_MUL_E(R,X,Y) _FP_MUL(E,2,R,X,Y)
348#define FP_DIV_E(R,X,Y) _FP_DIV(E,2,R,X,Y)
349#define FP_SQRT_E(R,X) _FP_SQRT(E,2,R,X)
350
351/*
352 * Square root algorithms:
353 * We have just one right now, maybe Newton approximation
354 * should be added for those machines where division is fast.
355 * We optimize it by doing most of the calculations
356 * in one UWtype registers instead of two, although we don't
357 * have to.
358 */
359#define _FP_SQRT_MEAT_E(R, S, T, X, q) \
360 do { \
361 q = (_FP_W_TYPE)1 << (_FP_W_TYPE_SIZE - 1); \
362 _FP_FRAC_SRL_2(X, (_FP_WORKBITS)); \
363 while (q) \
364 { \
365 T##_f0 = S##_f0 + q; \
366 if (T##_f0 <= X##_f0) \
367 { \
368 S##_f0 = T##_f0 + q; \
369 X##_f0 -= T##_f0; \
370 R##_f0 += q; \
371 } \
372 _FP_FRAC_SLL_1(X, 1); \
373 q >>= 1; \
374 } \
375 _FP_FRAC_SLL_2(R, (_FP_WORKBITS)); \
376 if (X##_f0) \
377 { \
378 if (S##_f0 < X##_f0) \
379 R##_f0 |= _FP_WORK_ROUND; \
380 R##_f0 |= _FP_WORK_STICKY; \
381 } \
382 } while (0)
383
384#define FP_CMP_E(r,X,Y,un) _FP_CMP(E,2,r,X,Y,un)
385#define FP_CMP_EQ_E(r,X,Y) _FP_CMP_EQ(E,2,r,X,Y)
386
387#define FP_TO_INT_E(r,X,rsz,rsg) _FP_TO_INT(E,2,r,X,rsz,rsg)
388#define FP_TO_INT_ROUND_E(r,X,rsz,rsg) _FP_TO_INT_ROUND(E,2,r,X,rsz,rsg)
389#define FP_FROM_INT_E(X,r,rs,rt) _FP_FROM_INT(E,2,X,r,rs,rt)
390
391#define _FP_FRAC_HIGH_E(X) (X##_f1)
392#define _FP_FRAC_HIGH_RAW_E(X) (X##_f0)
393
394#endif /* not _FP_W_TYPE_SIZE < 64 */
395
396#endif /* __MATH_EMU_EXTENDED_H__ */
diff --git a/include/net/sock.h b/include/net/sock.h
index 25c37e34bfdc..689b886038da 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1361,15 +1361,6 @@ static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool)
1361extern __u32 sysctl_wmem_max; 1361extern __u32 sysctl_wmem_max;
1362extern __u32 sysctl_rmem_max; 1362extern __u32 sysctl_rmem_max;
1363 1363
1364#ifdef CONFIG_NET
1365int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
1366#else
1367static inline int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
1368{
1369 return -ENODEV;
1370}
1371#endif
1372
1373extern void sk_init(void); 1364extern void sk_init(void);
1374 1365
1375#ifdef CONFIG_SYSCTL 1366#ifdef CONFIG_SYSCTL
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 8c339f5678cf..90ef552c42dd 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -108,6 +108,11 @@ typedef struct dev_node_t {
108struct pcmcia_socket; 108struct pcmcia_socket;
109struct config_t; 109struct config_t;
110 110
111struct pcmcia_dynids {
112 spinlock_t lock;
113 struct list_head list;
114};
115
111struct pcmcia_driver { 116struct pcmcia_driver {
112 int (*probe) (struct pcmcia_device *dev); 117 int (*probe) (struct pcmcia_device *dev);
113 void (*remove) (struct pcmcia_device *dev); 118 void (*remove) (struct pcmcia_device *dev);
@@ -118,6 +123,7 @@ struct pcmcia_driver {
118 struct module *owner; 123 struct module *owner;
119 struct pcmcia_device_id *id_table; 124 struct pcmcia_device_id *id_table;
120 struct device_driver drv; 125 struct device_driver drv;
126 struct pcmcia_dynids dynids;
121}; 127};
122 128
123/* driver registration */ 129/* driver registration */
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 765589f4d166..5342ac64ed1a 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -431,9 +431,11 @@ struct ib_wc {
431 u8 port_num; /* valid only for DR SMPs on switches */ 431 u8 port_num; /* valid only for DR SMPs on switches */
432}; 432};
433 433
434enum ib_cq_notify { 434enum ib_cq_notify_flags {
435 IB_CQ_SOLICITED, 435 IB_CQ_SOLICITED = 1 << 0,
436 IB_CQ_NEXT_COMP 436 IB_CQ_NEXT_COMP = 1 << 1,
437 IB_CQ_SOLICITED_MASK = IB_CQ_SOLICITED | IB_CQ_NEXT_COMP,
438 IB_CQ_REPORT_MISSED_EVENTS = 1 << 2,
437}; 439};
438 440
439enum ib_srq_attr_mask { 441enum ib_srq_attr_mask {
@@ -912,6 +914,8 @@ struct ib_device {
912 914
913 u32 flags; 915 u32 flags;
914 916
917 int num_comp_vectors;
918
915 struct iw_cm_verbs *iwcm; 919 struct iw_cm_verbs *iwcm;
916 920
917 int (*query_device)(struct ib_device *device, 921 int (*query_device)(struct ib_device *device,
@@ -978,6 +982,7 @@ struct ib_device {
978 struct ib_recv_wr *recv_wr, 982 struct ib_recv_wr *recv_wr,
979 struct ib_recv_wr **bad_recv_wr); 983 struct ib_recv_wr **bad_recv_wr);
980 struct ib_cq * (*create_cq)(struct ib_device *device, int cqe, 984 struct ib_cq * (*create_cq)(struct ib_device *device, int cqe,
985 int comp_vector,
981 struct ib_ucontext *context, 986 struct ib_ucontext *context,
982 struct ib_udata *udata); 987 struct ib_udata *udata);
983 int (*destroy_cq)(struct ib_cq *cq); 988 int (*destroy_cq)(struct ib_cq *cq);
@@ -987,7 +992,7 @@ struct ib_device {
987 struct ib_wc *wc); 992 struct ib_wc *wc);
988 int (*peek_cq)(struct ib_cq *cq, int wc_cnt); 993 int (*peek_cq)(struct ib_cq *cq, int wc_cnt);
989 int (*req_notify_cq)(struct ib_cq *cq, 994 int (*req_notify_cq)(struct ib_cq *cq,
990 enum ib_cq_notify cq_notify); 995 enum ib_cq_notify_flags flags);
991 int (*req_ncomp_notif)(struct ib_cq *cq, 996 int (*req_ncomp_notif)(struct ib_cq *cq,
992 int wc_cnt); 997 int wc_cnt);
993 struct ib_mr * (*get_dma_mr)(struct ib_pd *pd, 998 struct ib_mr * (*get_dma_mr)(struct ib_pd *pd,
@@ -1358,13 +1363,15 @@ static inline int ib_post_recv(struct ib_qp *qp,
1358 * @cq_context: Context associated with the CQ returned to the user via 1363 * @cq_context: Context associated with the CQ returned to the user via
1359 * the associated completion and event handlers. 1364 * the associated completion and event handlers.
1360 * @cqe: The minimum size of the CQ. 1365 * @cqe: The minimum size of the CQ.
1366 * @comp_vector - Completion vector used to signal completion events.
1367 * Must be >= 0 and < context->num_comp_vectors.
1361 * 1368 *
1362 * Users can examine the cq structure to determine the actual CQ size. 1369 * Users can examine the cq structure to determine the actual CQ size.
1363 */ 1370 */
1364struct ib_cq *ib_create_cq(struct ib_device *device, 1371struct ib_cq *ib_create_cq(struct ib_device *device,
1365 ib_comp_handler comp_handler, 1372 ib_comp_handler comp_handler,
1366 void (*event_handler)(struct ib_event *, void *), 1373 void (*event_handler)(struct ib_event *, void *),
1367 void *cq_context, int cqe); 1374 void *cq_context, int cqe, int comp_vector);
1368 1375
1369/** 1376/**
1370 * ib_resize_cq - Modifies the capacity of the CQ. 1377 * ib_resize_cq - Modifies the capacity of the CQ.
@@ -1414,14 +1421,34 @@ int ib_peek_cq(struct ib_cq *cq, int wc_cnt);
1414/** 1421/**
1415 * ib_req_notify_cq - Request completion notification on a CQ. 1422 * ib_req_notify_cq - Request completion notification on a CQ.
1416 * @cq: The CQ to generate an event for. 1423 * @cq: The CQ to generate an event for.
1417 * @cq_notify: If set to %IB_CQ_SOLICITED, completion notification will 1424 * @flags:
1418 * occur on the next solicited event. If set to %IB_CQ_NEXT_COMP, 1425 * Must contain exactly one of %IB_CQ_SOLICITED or %IB_CQ_NEXT_COMP
1419 * notification will occur on the next completion. 1426 * to request an event on the next solicited event or next work
1427 * completion at any type, respectively. %IB_CQ_REPORT_MISSED_EVENTS
1428 * may also be |ed in to request a hint about missed events, as
1429 * described below.
1430 *
1431 * Return Value:
1432 * < 0 means an error occurred while requesting notification
1433 * == 0 means notification was requested successfully, and if
1434 * IB_CQ_REPORT_MISSED_EVENTS was passed in, then no events
1435 * were missed and it is safe to wait for another event. In
1436 * this case is it guaranteed that any work completions added
1437 * to the CQ since the last CQ poll will trigger a completion
1438 * notification event.
1439 * > 0 is only returned if IB_CQ_REPORT_MISSED_EVENTS was passed
1440 * in. It means that the consumer must poll the CQ again to
1441 * make sure it is empty to avoid missing an event because of a
1442 * race between requesting notification and an entry being
1443 * added to the CQ. This return value means it is possible
1444 * (but not guaranteed) that a work completion has been added
1445 * to the CQ since the last poll without triggering a
1446 * completion notification event.
1420 */ 1447 */
1421static inline int ib_req_notify_cq(struct ib_cq *cq, 1448static inline int ib_req_notify_cq(struct ib_cq *cq,
1422 enum ib_cq_notify cq_notify) 1449 enum ib_cq_notify_flags flags)
1423{ 1450{
1424 return cq->device->req_notify_cq(cq, cq_notify); 1451 return cq->device->req_notify_cq(cq, flags);
1425} 1452}
1426 1453
1427/** 1454/**
diff --git a/include/video/mach64.h b/include/video/mach64.h
index 09a7f4a7289f..a8332e528ec1 100644
--- a/include/video/mach64.h
+++ b/include/video/mach64.h
@@ -885,6 +885,7 @@
885#define SDRAM 4 885#define SDRAM 4
886#define SGRAM 5 886#define SGRAM 5
887#define WRAM 6 887#define WRAM 6
888#define SDRAM32 6
888 889
889#define DAC_INTERNAL 0x00 890#define DAC_INTERNAL 0x00
890#define DAC_IBMRGB514 0x01 891#define DAC_IBMRGB514 0x01
diff --git a/include/video/permedia2.h b/include/video/permedia2.h
index b95d36289336..9e49c9571ec3 100644
--- a/include/video/permedia2.h
+++ b/include/video/permedia2.h
@@ -154,6 +154,10 @@
154#define PM2VI_RD_CLK1_PRESCALE 0x204 154#define PM2VI_RD_CLK1_PRESCALE 0x204
155#define PM2VI_RD_CLK1_FEEDBACK 0x205 155#define PM2VI_RD_CLK1_FEEDBACK 0x205
156#define PM2VI_RD_CLK1_POSTSCALE 0x206 156#define PM2VI_RD_CLK1_POSTSCALE 0x206
157#define PM2VI_RD_MCLK_CONTROL 0x20D
158#define PM2VI_RD_MCLK_PRESCALE 0x20E
159#define PM2VI_RD_MCLK_FEEDBACK 0x20F
160#define PM2VI_RD_MCLK_POSTSCALE 0x210
157#define PM2VI_RD_CURSOR_PALETTE 0x303 161#define PM2VI_RD_CURSOR_PALETTE 0x303
158#define PM2VI_RD_CURSOR_PATTERN 0x400 162#define PM2VI_RD_CURSOR_PATTERN 0x400
159 163
diff --git a/include/video/tgafb.h b/include/video/tgafb.h
index be2b3e94e251..03d0dbe293a8 100644
--- a/include/video/tgafb.h
+++ b/include/video/tgafb.h
@@ -39,6 +39,7 @@
39#define TGA_RASTEROP_REG 0x0034 39#define TGA_RASTEROP_REG 0x0034
40#define TGA_PIXELSHIFT_REG 0x0038 40#define TGA_PIXELSHIFT_REG 0x0038
41#define TGA_DEEP_REG 0x0050 41#define TGA_DEEP_REG 0x0050
42#define TGA_START_REG 0x0054
42#define TGA_PIXELMASK_REG 0x005c 43#define TGA_PIXELMASK_REG 0x005c
43#define TGA_CURSOR_BASE_REG 0x0060 44#define TGA_CURSOR_BASE_REG 0x0060
44#define TGA_HORIZ_REG 0x0064 45#define TGA_HORIZ_REG 0x0064
@@ -140,7 +141,7 @@
140 141
141 142
142/* 143/*
143 * Useful defines for managing the BT463 on the 24-plane TGAs 144 * Useful defines for managing the BT463 on the 24-plane TGAs/SFB+s
144 */ 145 */
145 146
146#define BT463_ADDR_LO 0x0 147#define BT463_ADDR_LO 0x0
@@ -168,12 +169,35 @@
168#define BT463_WINDOW_TYPE_BASE 0x0300 169#define BT463_WINDOW_TYPE_BASE 0x0300
169 170
170/* 171/*
172 * Useful defines for managing the BT459 on the 8-plane SFB+s
173 */
174
175#define BT459_ADDR_LO 0x0
176#define BT459_ADDR_HI 0x1
177#define BT459_REG_ACC 0x2
178#define BT459_PALETTE 0x3
179
180#define BT459_CUR_CLR_1 0x0181
181#define BT459_CUR_CLR_2 0x0182
182#define BT459_CUR_CLR_3 0x0183
183
184#define BT459_CMD_REG_0 0x0201
185#define BT459_CMD_REG_1 0x0202
186#define BT459_CMD_REG_2 0x0203
187
188#define BT459_READ_MASK 0x0204
189
190#define BT459_BLINK_MASK 0x0206
191
192#define BT459_CUR_CMD_REG 0x0300
193
194/*
171 * The framebuffer driver private data. 195 * The framebuffer driver private data.
172 */ 196 */
173 197
174struct tga_par { 198struct tga_par {
175 /* PCI device. */ 199 /* PCI/TC device. */
176 struct pci_dev *pdev; 200 struct device *dev;
177 201
178 /* Device dependent information. */ 202 /* Device dependent information. */
179 void __iomem *tga_mem_base; 203 void __iomem *tga_mem_base;
@@ -235,4 +259,21 @@ BT463_WRITE(struct tga_par *par, u32 m, u16 a, u8 v)
235 TGA_WRITE_REG(par, m << 10 | v, TGA_RAMDAC_REG); 259 TGA_WRITE_REG(par, m << 10 | v, TGA_RAMDAC_REG);
236} 260}
237 261
262static inline void
263BT459_LOAD_ADDR(struct tga_par *par, u16 a)
264{
265 TGA_WRITE_REG(par, BT459_ADDR_LO << 2, TGA_RAMDAC_SETUP_REG);
266 TGA_WRITE_REG(par, a & 0xff, TGA_RAMDAC_REG);
267 TGA_WRITE_REG(par, BT459_ADDR_HI << 2, TGA_RAMDAC_SETUP_REG);
268 TGA_WRITE_REG(par, a >> 8, TGA_RAMDAC_REG);
269}
270
271static inline void
272BT459_WRITE(struct tga_par *par, u32 m, u16 a, u8 v)
273{
274 BT459_LOAD_ADDR(par, a);
275 TGA_WRITE_REG(par, m << 2, TGA_RAMDAC_SETUP_REG);
276 TGA_WRITE_REG(par, v, TGA_RAMDAC_REG);
277}
278
238#endif /* TGAFB_H */ 279#endif /* TGAFB_H */